Ask an LLM the same question twice and you may get two different answers. Why? Because when the model picks the next token it does not always take the single best option — it picks randomly from a list of plausible choices. The dial controlling that randomness is called temperature.
Low temperature (near 0): the model almost always takes the top choice. Answers are stable and predictable — good for factual work like summarising a document or translating. But they can be repetitive and dry.
High temperature (near 1 or more): the model picks less-likely choices more often. Answers are more creative and varied — good for brainstorming product names or writing stories. But they also get facts wrong more easily and can drift off-topic.
Example: write a Facebook caption for a shop —
- Temperature 0.2 → "20% off today only! Contact us now" — direct and correct.
- Temperature 1.0 → a more creative caption, but sometimes it invents product details — risky for a business.
Simple rule: facts and serious documents → low temperature. Ideas and creative work → higher. In this module's lab you will compare answers to the same request at two temperatures yourself.
Takeaways:
- Temperature controls randomness in token selection
- Low = stable, predictable, for factual work
- High = creative, for ideas, but more error-prone