arXiv:2510.18871cs.CLcs.AI2025-10被引 17

揭示大模型如何分层逐步修正预测,从初步猜测到精细调整。

How Do LLMs Use Their Depth?

  • 模型早期用高频词做初步猜测,后期结合上下文修正。
  • 多选题中前半层识别选项,后半层定稿;长答案首词需更深计算。
  • 功能词最早被正确预测,适合优化模型推理效率的研究者参考。

越来越多证据表明大语言模型并未均匀使用其深度,但对其逐层预测动态仍缺乏细致理解。本文追踪多个开源模型在推理过程中的中间表示,揭示了深度使用的结构性与复杂性。我们提出‘猜-修正’框架:早期层的高排名预测主要由高频词构成,是因缺乏上下文信息而做出的统计猜测;随着上下文信息深入,这些初始猜测被逐步修正为更合适的词语。通过三个案例研究验证:(i) 多选任务中,模型在前半层识别正确选项,后半层完成输出;(ii) 多词回答中,首个词需要更高计算深度;(iii) 语法分析显示功能词平均最早被正确预测。我们通过探针分析与激活修补、提前退出实验等因果干预手段验证结果。整体结果提供了对大模型分层计算机制的详细洞察,为提升Transformer模型的计算效率提供新思路。

原文摘要 · Abstract (English)

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.

模型解释分层计算推理机制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。