Temperature (Sampling)
Temperature is a decoding parameter that scales the logits before sampling the next token, controlling randomness. Values near 0 make output nearly deterministic, favoring the highest-probability token, while higher values flatten the distribution and increase diversity. Typical ranges are 0 to 1 for factual tasks and 0.7 to 1.2 for creative generation. It is often combined with top-p or top-k sampling.
Definition
Temperature is a decoding parameter that scales the logits before sampling the next token, controlling randomness. Values near 0 make output nearly deterministic, favoring the highest-probability token, while higher values flatten the distribution and increase diversity. Typical ranges are 0 to 1 for factual tasks and 0.7 to 1.2 for creative generation. It is often combined with top-p or top-k sampling.
Examples
- Setting temperature to 0 for SQL generation to get reproducible queries across runs.
- Using temperature 0.9 when drafting marketing taglines to encourage variety.
- A/B testing temperature 0.2 vs 0.7 on a support bot to balance accuracy and tone.
Related terms
No credit card required
Frequently asked
- What is Temperature (Sampling)?
- Temperature is a decoding parameter that scales the logits before sampling the next token, controlling randomness. Values near 0 make output nearly deterministic, favoring the highest-probability token, while higher values flatten the distribution and increase diversity. Typical ranges are 0 to 1 for factual tasks and 0.7 to 1.2 for creative generation. It is often combined with top-p or top-k sampling.
- How is Temperature (Sampling) used in practice?
- Temperature (Sampling) is commonly used in scenarios such as: Setting temperature to 0 for SQL generation to get reproducible queries across runs.; Using temperature 0.9 when drafting marketing taglines to encourage variety.; A/B testing temperature 0.2 vs 0.7 on a support bot to balance accuracy and tone..
- How does yno.ai support Temperature (Sampling)?
- yno.ai supports Temperature (Sampling) as part of its agentic AI platform — combining multiple frontier models with extensible tool use.
- What other concepts are related to Temperature (Sampling)?
- Temperature (Sampling) relates to Inference, Top-p / Top-k Sampling, Prompt Engineering, Hallucination. Each links to its own glossary page below.