Skip to main content

What does the temperature setting do?

LLM and transformer basics · Intermediate 1

Short answer

Temperature controls how random the model's choice of the next token is. Low temperature makes it pick the most likely tokens, so answers are more consistent. Higher temperature spreads the choice, giving more varied output. Use low values for extraction and classification, higher ones for brainstorming.

Deeper answer

The model produces a probability for each possible next token. Temperature reshapes that distribution before sampling: below 1 it sharpens it towards the top choices, above 1 it flattens it. Near zero the output is close to always taking the top token, though many providers do not guarantee identical output even then.

Temperature does not make a model smarter or more truthful. A low temperature makes a wrong answer repeat consistently. For tasks where you need correctness, rely on good prompts, retrieval and checks, and use low temperature mainly for consistency.

What a strong answer covers

Answer it out loud in the mock interview about 1 min

Follow-ups to expect

Common mistakes

Learn it

System prompts and prompt design

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.