|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIM. - Mistral AI > Modules |
MiniRobotLanguage (MRL)
AIM.Set Temperature
Set AI Temperature Value
Intention
The temperature parameter in the Mistral AI, and in the context of generative AI models in general, plays a crucial role in controlling the randomness of the output generated by the model. It's a numerical value, typically a float ( like 0.1 or 0.25 ) within the range of 0 to 1, that affects the selection of the next word or token given a specific context.
Understanding Temperature:
High Temperature (Closer to 1): Setting a higher temperature value increases the randomness of the output. This means the model is more likely to choose less probable tokens at each step, leading to more diverse and sometimes more creative outputs. However, too high a temperature might result in outputs that are less coherent or relevant to the input.
Low Temperature (Closer to 0): A lower temperature value makes the model's outputs more deterministic. With a temperature close to 0, the model tends to choose the most likely next word or token. This can lead to more predictable and repetitive text, but generally ensures that the output is coherent and closely follows the patterns seen during training.
Temperature of 1: This is often considered the "default" or "neutral" setting, where the probability of selecting tokens is proportional to their predicted likelihood. Adjustments above or below this value skew the model towards more creative or more deterministic outputs, respectively.
Practical Applications:
Creative Writing: For applications requiring creativity or varied responses, such as story generation or brainstorming sessions, a higher temperature might be preferred to introduce novelty and diversity.
Information Retrieval: In scenarios where accuracy and relevance are paramount, such as answering factual questions or generating reports, a lower temperature may be desirable to ensure that the outputs are reliable and on-topic.
Conclusion:
The temperature parameter is a powerful tool for tuning the behavior of generative AI models like those provided by Mistral AI. By adjusting the temperature, developers can balance between creativity and coherence to suit the needs of different applications, making it an essential consideration for anyone working with generative text models
Syntax
AIM.Set Temperature[|P1]
Parameter Explanation
P1 - (optional) - Temperature Value, Float between 0 and 1. If P1 is missing, the default value 0.7 is used.
Example
'***********************************
' AIM.Set Temperature-Sample
'***********************************
$$PRO=How can i compare time in china with time in Hannover?
AIM.SetModel|mistral-medium
AIM.Set Temperature|0.9
AIM.Asc|$$PRO|$$RES
MBX.$$RES
AIM.SetModel|mistral-tiny
AIM.Set Temperature|0.1
AIM.Asc|$$PRO|$$RES
MBX.$$RES
ENR.
Remarks
-
Limitations:
-
See also:
•