basforge

Search titles, text and the “If it doesn’t work” cases.

    RU

    Consistent answers come from format and checks, not temperature 0

    A model picks the next token with some randomness, so one question gives different wordings. temperature: 0 never removed that completely even where it existed, and on Claude Opus 4.7 and newer the parameter is gone. Get repeatability from a strict answer format, a schema and a scripted check of the result.

    Why temperature doesn’t save you

    • It’s gone. On Claude Opus 4.7 and newer, temperature, top_p and top_k return 400; 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.