Why temperature doesn’t save you
- It’s gone. On Claude Opus 4.7 and newer,
temperature,top_pandtop_kreturn400; Sonnet 5.5 accepts only the default value. Reasoning models need randomness for the reasoning itself. - Zero isn’t zero. Even with
temperature: 0, other vendors’ answers diverge: GPU computation batched with other people’s requests gives slightly different numbers, and on near-equal probabilities the pick changes. - Different text isn’t the problem. Different meaning or a different shape is. Pin those down.
What to pin down instead
| What has to be consistent | With what |
|---|---|
| answer structure | JSON by schema — output_config.format (JSON by schema) |
| text shape | an example answer in the prompt (An example over a description) |
| classification | a closed list of labels in the schema: "enum": ["spam", "work", "personal"] |
| a fact in the answer | a scripted check: compare the number in the answer with the source |
| the outcome | several runs and a vote: ask three times, take the answer that matches |
Where temperature still lives
OpenAI models without reasoning, Gemini, and local models in Ollama ("options": {"temperature": 0}). For data
extraction and classification people set 0–0.2 there, for text and ideas around 0.7–1. But even there the check
decides, not identical output: it catches a wrong answer even if it repeated twice.