toolcall() ← all concepts

// concept · workflows

Stop running thinking models at temperature 0

If a local model writes the same paragraph over and over and never finishes, check the temperature. On models that reason out loud before answering, zero is the setting their makers tell you not to use.

// the rule

Qwen3's model card, thinking mode:

For thinking mode, use Temperature=0.6, TopP=0.95, TopK=20, and MinP=0 (the default setting in generation_config.json). DO NOT use greedy decoding, as it can lead to performance degradation and endless repetitions.

DeepSeek R1's card:

Set the temperature within the range of 0.5-0.7 (0.6 is recommended) to prevent endless repetitions or incoherent outputs.

Temperature 0 is greedy decoding: llama.cpp's sampler, for example, handles temp <= 0 by keeping only the single highest-scoring token. Greedy can fall into repetition on these models. It doesn't always.

Why it runs so long

Ollama's Modelfile docs list num_predict as "(Default: -1, infinite generation)". In the code, open-ended output is bounded at ten context windows, so a stuck answer stops eventually, but only after ten windows' worth of the same paragraph. The exact token count scales with your context size.

The fix, and where the trap is

A correction to our own video

Our temperature explainer said to go near zero for facts, code and extraction, and to tune temperature or top p but not both. For thinking models, the model card overrides both: use its temperature, and its top p and top k, together.

Sources: Qwen3-8B, DeepSeek-R1 and Qwen3.8-27B model cards (Hugging Face); Ollama Modelfile docs and library params; llama.cpp sampler source. Verified 2026-10-31.

One concept a week. Free.

The deeper, copy-paste version of each ToolCall short — in your inbox.

// total: 0.00 · spam: void · unsubscribe: one click