长文本生成是一个采样问题(当你调高温度时)
Long-Context Generation Is a Sampling Problem (When You Turn Up the Heat)
AI总结:
该研究发现高温度下长文本生成的性能取决于采样器,top-nsigma 采样器在多基准测试中表现优于 top-p 等,其稳定的小候选池可避免性能崩溃,相关代码数据已公开。
摘要:
已广泛观察到,开放权重语言模型生成的文本越长,性能越差。通常,解决这一问题的尝试涉及更多训练。在高温度设置下,采样器(即从模型概率中选择下一个 token 的规则)决定了长且具智能体属性的生成是否能保留和/或提升。我们测试了 29 个参数规模从 10 亿到 1220 亿的开放权重模型,在 10 个已建立的基准测试及长达 100 万 token 的针检索任务上进行,涵盖 SWE-bench Verified 编码智能体、长思维链推理、长文本写作、长结构化输出和长上下文阅读。那些在温度升高时保持候选 token 池小且稳定的采样器不会损失准确性;而那些允许低概率 token 进入的采样器则会崩溃。在温度为 2 时,使用 top-p、top-k 或 Top-H 的编码智能体在 100 个 GitHub 问题中解决了 0 个,而使用 top-nsigma 的相同智能体则解决了 46 到 62 个问题,且在三个 Qwen3.5 模型上,当两种采样器意见不一致时,top-nsigma 在所有问题上都胜出。在所有基准测试中,top-nsigma 保持了其温度为 1 时得分的中位数 100%,而 top-p 仅保持 26%。统计每个采样器允许通过的 token 数量解释了这一现象:在一个 Llama-3.1-8B 的故事生成中,从温度 1 到 2,top-p 的候选池从 4 个 token 增长到 51845 个,而 top-nsigma 则保持在 3 个。在 133 种采样器设置与温度的组合中,典型的候选池大小与判断质量呈 Spearman 相关系数为 -0.77 的关系;当我们选择温度为 1 时的候选池并仅在之后应用温度时,Top-H、min-p 和 p-less 采样器不再崩溃。在默认温度 1 下,大多数采样器的表现大致相同。我们向公众发布了所有代码和数据。
英文摘要:
Open-weight language models are widely observed to get worse the longer they generate. Often, attempts to fix this involve more training. At high temperature, The sampler, i.e. the rule that picks the next token out of the model's probabilities, decides whether long and agentic generation survives and/or thrives. We test 29 open-weight models from 1B to 122B parameters on ten established benchmarks plus needle retrieval out to one million tokens, covering SWE-bench Verified coding agents, long chain-of-thought reasoning, long-form writing, long structured output and long-context reading. Samplers that keep their pool of candidate tokens small and steady as temperature rises don't lose accuracy. Samplers that let in low-probability tokens fall apart. At temperature 2, coding agents running top-p, top-k or Top-H resolve 0 of 100 GitHub issues, while the same agents running top-nsigma resolve 46 to 62 and win every issue the two samplers disagree on, on three Qwen3.5 models. Over all benchmarks top-nsigma keeps a median 100% of its temperature-1 score where top-p keeps 26%. Counting how many tokens each sampler lets through explains why. In one Llama-3.1-8B story, going from temperature 1 to 2 grows top-p's pool from 4 tokens to 51,845 while top-nsigma stays at 3. Across 133 combinations of sampler setting and temperature, the typical pool size predicts judged quality (Spearman correlation of -0.77), and when we pick the pool at temperature 1 and only apply temperature afterwards, Top-H, min-p and p-less stop collapsing. At the default temperature of 1 most samplers perform about the same, We release all code and data to the public.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。