跳到正文
arXiv (AI + Vision + Imaging)· Mohamed Amine Merzouk, Dmitri Carpov, Mirko Bronzi, Damiano Fornasiere, Adam Oberman·· 7 小时前AI 评分22

LLM如何线性编码剩余输出长度:线性探针可估计生成token数

How Much is Left? LLMs Linearly Encode Their Remaining Output Length

AI 导读

研究者用7-8B指令微调模型的冻结隐藏状态做线性探针,在七个数据集上估计生成回复的剩余token数,误差为统计基线的0.57至0.88倍。出现"Wait"回退token时,探针预测长度平均跳升超70个token,而基线平均下降0.7。在Llama-3.1-8B / GSM8K上沿探针方向加减可增减生成长度,表明LLM对输出长度存在线性可解码的内部表示。

正文 · 原文

arXiv:2607.05316v2 Announce Type: replace Abstract: Large Language models generate tokens, without explicitly keeping track of the length of the generated text. This paper asks the question: can we estimate the number of tokens remaining in a generated response, using just a linear probe on the model's hidden states? Previous work on inference scheduling established that length is statistically predictable, using nonlinear methods. This paper contributes a linear representation method, using frozen hidden states of 7-8B instruction-tuned models, across seven datasets. We show that total completion length can be estimated, with performance stronger than statistical baselines, and stronger than the fair comparison to the prediction at the last token of the prompt. On the natural-language datasets, the probe's error lies between 0.57 and 0.88 of the statistical baseline's. Interestingly, when a retraction token occurs ("Wait"), the probe predicted length jumps upward by over 70 tokens, on average, compared to the baseline, where it drops by 0.7, on average. Moreover, the direction found can be used for length steering: adding to the probe direction increases completion length and vice-versa, on Llama-3.1-8B / GSM8K. These results indicate that LLMs have a linearly decodable internal representation of output length.

来源:arXiv (AI + Vision + Imaging) · arxiv.org