Long-context degradation comes from the sampler, not the model, a study of 29 open-weight models finds
Open-weight models tend to get worse the longer they generate. Is that a training shortfall or a decoding problem? The authors tested many sampler and temperature combinations on 29 open-weight models from 1B to 122B parameters. Samplers whose candidate pool grows with temperature (top-p, top-k, Top-H) collapse at high temperatures, while top-nsigma, which keeps the pool small and stable, barely loses quality. Evidence covers 10 benchmarks plus retrieval tasks up to one million tokens, including the SWE-bench Verified coding agent, long chains of thought, long-form writing and long structured output. On three Qwen3.5 models at temperature 2, top-p-style agents solved 0 of 100 GitHub issues, while top-nsigma solved 46 to 62. The authors explain the gap by candidate pool size: in one Llama-3.1-8B example, raising temperature from 1 to 2 grew top-p's pool from 4 tokens to 51,845, while top-nsigma stayed at 3. Across 133 sampler and temperature combinations, the correlation between typical pool size and human-judged quality was -0.77. Code and data are public, but testing covered only open-weight models; whether closed models behave the same way is unverified.
Falling reliability on long-context and agent tasks is usually treated as a training problem, solved by adding more data and training longer. This paper moves the variable to the inference side: raising the temperature is meant to add diversity, but if the sampling rule also lets in a large number of low-probability tokens, output quality collapses first.
If a product raises the temperature above 1 for diversity, swapping out samplers like top-p and top-k, which open up the candidate pool as temperature rises, may be less work than retraining. At temperature 1 the samplers differ little, which suggests the change only matters in high-temperature settings.