Plain-English explanation
At every step of generating a response, an LLM doesn't just pick one "correct" next token; it computes a probability for many possible next tokens and then selects one. Temperature controls how that selection is made: at low temperature, the model almost always picks the single highest-probability option, producing safe, consistent, somewhat predictable text. At high temperature, the probabilities are flattened out, so lower-probability, more surprising tokens get chosen more often, producing more varied and creative output, but also a higher chance of odd word choices or incoherent phrasing.
How it works
Technically, temperature is applied to the model's output probability distribution before a token is sampled from it; it rescales the distribution rather than changing what the model "knows." A temperature near zero makes generation close to deterministic, always taking the most likely token; a temperature of 1 uses the model's raw predicted probabilities as-is; values above 1 flatten the distribution further, giving less-likely tokens a higher chance of being chosen. Exact ranges and defaults vary by provider and model, but most APIs expose temperature as a simple numeric setting, sometimes alongside related sampling controls like top-p.
Adult-AI use
On companion and roleplay platforms, temperature (when it's exposed to users at all, sometimes indirectly as a "creativity" or "consistency" slider) shapes how predictable versus spontaneous a character feels. Lower temperature tends to keep a character on-script and consistent with its persona, which some users prefer for reliability, while higher temperature can make a character's dialogue feel more natural, varied, and less repetitive over a long conversation: at the cost of occasionally producing odd, off-character, or incoherent responses. Many apps set a fixed temperature behind the scenes rather than exposing it, tuned to balance those trade-offs for their specific persona and use case.
How it differs from token and context window
These are all generation-related settings but control different things: token is the unit of text itself, context window is how much of that text a model can process at once, and temperature is about how the model chooses each next token once it's already looking at that context: a matter of output style and randomness, not memory or capacity.
Limitations and misconceptions
- Higher temperature is not the same as "smarter" or "more creative" in a meaningful sense. It's closer to controlled randomness than genuine creativity, and past a certain point it mostly just increases the risk of incoherent or off-topic output.
- Temperature doesn't reduce or increase hallucination in a simple, predictable way. Very low temperature can make a model repeat a wrong answer more confidently; very high temperature can introduce fabricated detail that wasn't there at lower settings: neither extreme reliably improves factual accuracy.
- Behavior differs by model. The exact effect of a given temperature value isn't identical across different model families or providers.