还剩多少?大语言模型线性编码其剩余输出长度 / How Much is Left? LLMs Linearly Encode Their Remaining Output Length
1️⃣ 一句话总结
这篇论文发现,大型语言模型在生成文本之前,其内部隐藏状态中已经以可解码的线性方式编码了将要生成的总长度,并且这种长度估计在模型中途修正回答时会动态更新,表明模型内部存在一种类似“写作计划”的机制。
Large language models generate one token at a time, yet their responses show remarkably consistent length structure: step-by-step solutions converge in predictable token counts, retrievals stop after a few sentences, retractions extend responses by measurable amounts. We ask whether the model carries an internal estimate of how much response remains. Training minimal-capacity linear probes on frozen hidden states of three open-weight 7-8B models across seven completion-style datasets, we find three converging pieces of evidence. First, total response length is linearly decodable from the prompt's last hidden state alone, before any output is emitted. Second, probe directions trained on natural-language datasets transfer broadly, including to controlled synthetic completions never seen in training, outperforming a statistical baseline; the converse direction generally fails, and this asymmetry is itself informative. Third, on curated high-loss completions, the probe's per-position estimate shifts upward at the moment the model retracts and restarts a partial solution, a directional behavior no position-only predictor can reproduce (qualitative, not aggregate). We frame this as approximate estimation of remaining generation length, distinct from exact-counting impossibility results for transformers, and interpret it as evidence that LLMs maintain a plan-like internal representation of output length (decodable, not necessarily used causally).
还剩多少?大语言模型线性编码其剩余输出长度 / How Much is Left? LLMs Linearly Encode Their Remaining Output Length
这篇论文发现,大型语言模型在生成文本之前,其内部隐藏状态中已经以可解码的线性方式编码了将要生成的总长度,并且这种长度估计在模型中途修正回答时会动态更新,表明模型内部存在一种类似“写作计划”的机制。
源自 arXiv: 2607.05316