Temperaturetemp
The dial that controls how random or predictable an AI's output is.
Temperature is a number โ typically between 0 and 2 โ that controls how much randomness the model introduces when choosing its next word.
At temperature 0, the model always picks the single highest-probability next token. Output is deterministic and focused โ ideal for factual Q&A, code generation, and structured data extraction where you want the same answer every time.
At higher temperatures (0.7โ1.0), the model samples from a wider distribution of likely tokens. Output becomes more varied, creative, and sometimes surprising โ better for brainstorming, storytelling, and open-ended generation.
Above temperature 1.5, outputs often become incoherent. Most production uses stay between 0 and 1.
Related parameters: top-p (nucleus sampling) and top-k control similar tradeoffs. Many APIs expose all three; temperature is the most intuitive to adjust first.
Rule of thumb: Start at 0 for precise tasks, 0.7 for creative ones.
In plain terms
Imagine a typewriter where 'temperature 0' locks every key to the most-used letter at that point. At higher temperature, adjacent keys become reachable. At temperature 2, you're flailing across the keyboard.