What is Temperature?
Temperature — A parameter that controls the randomness or creativity of an AI model’s output.
Temperature is a number between 0 and 2 that controls how creative or deterministic a model’s output is. At temperature 0, the model always picks the most likely word. At higher temperatures, it takes more risks, producing more creative but less predictable outputs.
Frequently Asked Questions
What temperature should I use?
Use 0-0.3 for factual tasks like data extraction, classification, and code. Use 0.7-1.0 for creative tasks like writing, brainstorming, and content generation.
Does temperature affect accuracy?
Lower temperatures produce more consistent and factually accurate outputs. Higher temperatures increase creativity but also increase the chance of hallucinations and errors.
Is temperature the only way to control output randomness?
No. Top-p (nucleus sampling) is another parameter that limits which tokens the model considers. Many developers use both temperature and top-p together for fine-grained control.