arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.18871cs.CLcs.AI
收藏

大语言模型如何利用其深度?

How Do LLMs Use Their Depth?

University of California Berkeley(加州大学伯克利分校);Georgia Institute of Technology(佐治亚理工学院)

Akshat Gupta, Jay Yeung, Gopala Anumanchipalli, Anna Ivanova

AI总结:

本文研究了大语言模型如何利用深度进行预测,提出'猜测-然后细化'框架,揭示了层间计算动态及深度使用机制。

摘要:

越来越多的证据表明,大型语言模型并未均匀地使用其深度,但我们仍然缺乏对层间预测动态的细致理解。在本文中,我们追踪了几种开源模型在推理过程中的中间表示,并揭示了深度的结构化和细致使用。具体来说,我们提出了一种“猜测-然后细化”的框架,解释了LLM如何内部结构化其计算以进行预测。我们首先表明,在早期的LLM层中,排名最高的预测主要由高频词组成,这些词作为模型由于缺乏上下文信息而提出的统计猜测。随着上下文信息深入模型,这些初始猜测会被细化为上下文合适词。然后,我们通过三个案例研究考察层深度的动态使用。(i)多项选择任务分析显示,模型在模型前半部分识别合适选项,并在后半部分最终确定响应。(ii)事实回忆任务分析显示,在多词答案中,第一个词需要比其余词更多的计算深度。(iii)词性分析显示,功能词在平均上是最早被正确预测的。为了验证我们的结果,我们补充了基于探测的分析,通过激活修补和提前退出实验形式的因果操纵。共同,我们的结果提供了LLM深度使用的详细视图,照亮了成功预测背后的逐层计算,并为未来工作改进transformer模型的计算效率提供了见解。

英文摘要:

Growing evidence suggests that large language models do not use their depth uniformly, yet we still lack a fine-grained understanding of their layer-wise prediction dynamics. In this paper, we trace the intermediate representations of several open-weight models during inference and reveal a structured and nuanced use of depth. Specifically, we propose a "Guess-then-Refine" framework that explains how LLMs internally structure their computations to make predictions. We first show that the top-ranked predictions in early LLM layers are composed primarily of high-frequency tokens, which act as statistical guesses proposed by the model due to the lack of contextual information. As contextual information develops deeper into the model, these initial guesses get refined into contextually appropriate tokens. We then examine the dynamic usage of layer depth through three case studies. (i) Multiple-choice task analysis shows that the model identifies appropriate options within the first half of the model and finalizes the response in the latter half. (ii) Fact recall task analysis shows that in a multi-token answer, the first token requires more computational depth than the rest. (iii) Part-of-speech analysis shows that function words are, on average, the earliest to be predicted correctly. To validate our results, we supplement probe-based analyses with causal manipulations in the form of activation patching and early-exiting experiments. Together, our results provide a detailed view of depth usage in LLMs, shedding light on the layer-by-layer computations that underlie successful predictions and providing insights for future works to improve computational efficiency in transformer-based models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑