Why it matters

Wrong temperature affects quality + consistency. Understanding shapes appropriate output.

Advertisement

The architecture

Temperature parameter to generate() call.

Low = argmax-like. High = more diverse sampling.

Temperature rangesTemp 0-0.3deterministic / factsTemp 0.4-0.7balancedTemp 0.8+creativeCombine with top_p / top_k for finer control
Temperature spectrum.
Advertisement

How it works end to end

Also: top_p (nucleus sampling), top_k, repetition_penalty.

Facts / RAG: low temperature to reduce hallucination.

Chat: moderate for engagement.

Creative writing: high.