AIC. - Artificial Intelligence Command

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command > AI - Set Parameters >

AIC. - Artificial Intelligence Command

AIC.Set Best of

Previous Top Next


MiniRobotLanguage (MRL)

 

AIC.Set Best of

Internally evaluate multiple results and deliver the best of these

 

clip0722

"Best of" as an Parameter will only work with the Command: AIC.Ask Completion

it will not work with any other Command.

 

 

Intention

 

Due to Open AI specification, this command is only valid for the "Completion Endpoint".

Which is the Command: AIC.Ask Completion. It will not effect other "Ask.-Commands"

 

The "best of" parameter allows you to control the number of response candidates generated by the model during an AI call.

Instead of a single evaluation, you can specify the "best of" value To indicate how many response candidates you want the model to generate.

The call will then rank these responses and returns the top-ranked response from the candidates based on the model's scoring.
 

By generating multiple candidates, you can have a more varied set of potential responses. And choose the one that best fits your needs Or preferences.

For example, If you set "best_of" To 3, the model will produce three response candidates, And you can Select the most suitable one based on relevance, quality,
Or any other criteria.

Keep IN mind that setting a higher value For "best_of" increases the computational cost And response time of the Call, as generating multiple candidates requires more    

processing time.

Therefore, it's important to strike a balance between the number of candidates and the trade-off in API performance.

The "best_of" parameter in the OpenAI API accepts integer values greater than or equal to 1.

The value you choose For "best_of" determines the number of response candidates generated by the model.

For example, If you set "best_of" To 3, the API CALL will produce three potential responses, And the API will Return the highest-ranked response among those candidates.

The default value for "best_of" in the OpenAI API is 1, meaning that by default, the API returns a single response without generating additional candidates.

Performance: A higher "best_of" value increases computational cost and response time since it requires generating and scoring multiple candidates.

Therefore, it's important To balance the desired response quality With the associated performance impact.

Response Variation: If you want more diverse And varied responses, a higher "best_of" value can be beneficial As it increases the likelihood of different candidates.

This can help you explore different perspectives Or generate more creative outputs.

 

 

 

 

Syntax

 

 

AIC.Set Best of|[P1]

AIC.sbo|[P1]

 

 

Parameter Explanation

 

P1 - (optional) Number of internal versions that will be rated.

 

 

 

Example

 

'***********************************

' AIC.Best of-Sample

'***********************************

' Set OpenAI API-Key from the saved File

AIC.SetKey|File

 

' Set Model-Temperature

AIC.Set_Temperature|0

 

' Set Max-Tokens (Possible lenght of answer, depending on the Model up to 2000 Tokens which is about ~6000 characters)

' The more Tokens you use the more you need to pay. But the longer Input and Output can be.

AIC.SetMax_Token|300

AIC.Set Echo|1

AIC.Set Top_P|2

AIC.Set best of|2

 

$$TXT=Tell me about this formula and what it has to do with cars:$crlf$ '$z^n = \sqrt(r^n(\cos(n\theta) + \sqrt(i\sin(n\theta))))$

GSB.compl

 

' Using the Chat-Endpoint the "Best-of" Parameter will be ignored to prevent errors.

GSB.chat

 

ENR.

'-----------------------------------------------------------

:compl

AIC.SetModel_Completion|text-davinci-003

AIC.Ask Completion|$$TXT|$$RET

DBP.-----------------------------

DBP. Answer

DBP.$$RET

CLP.$$RET

DBP.-----------------------------

AIC.gro|$$REA

DBP. RAW 

DBP.$$REA

DBP.-----------------------------

DBP.JSON Output

AIC.Gts|9|$$JSO

DBP.$$JSO

DBP.-----------------------------

RET.

'-----------------------------------------------------------

:chat

AIC.SetModel_Chat|0

AIC.Ask Chat|$$TXT|$$RET

DBP.-----------------------------

DBP. Answer

DBP.$$RET

CLP.$$RET

DBP.-----------------------------

AIC.gro|$$REA

DBP. RAW 

DBP.$$REA

DBP.-----------------------------

DBP.JSON Output

AIC.Gts|9|$$JSO

DBP.$$JSO

DBP.-----------------------------

RET.

 

 

 

 

Remarks

 

 If the Open AI closes the "Completion Endpoint" then this Parameter will be useless.

 

 

Limitations:

 

"Best of" as an Parameter will only work with the Command: AIC.Ask Completion

it will not work with any other Command.

 

 

See also:

 

    1.6.1. Program Flow Control

    ! Smart Package Robot 's Parallel Robot Operations

    1.5. Features and Hints