揭示大模型如何逐步优化词元预测,发现关键层与信息位置的关系。
Unraveling Token Prediction Refinement and Identifying Essential Layers in Language Models
- 用对数透镜分析中间表示,追踪词元预测的迭代优化过程。
- 信息在输入中越居中,模型需更多层才能稳定输出,呈现倒U型趋势。
- 并非所有层都同等重要,适用于理解模型推理机制与安全研究。
本研究旨在揭示大语言模型(LLMs)如何通过内部处理逐步优化词元预测。我们采用对数透镜技术分析模型从中间表示生成的词元预测。具体关注:(1)LLMs 如何获取并利用输入上下文信息;(2)相关信息的位置如何影响预测优化过程。在多文档问答任务中,针对不同长度的输入上下文,我们发现预测精炼深度(即模型从初始正确词元预测到最终稳定正确输出所使用的中间层数量)随相关信息位置变化呈近似倒U形曲线。当相关资讯位于输入开头或结尾时,两层间差距平均缩小,表明模型在处理长上下文且信息居中时需要更多精炼层级。此外,我们的研究还显示,并非所有层对最终正确输出都同等重要。该结果揭示了词元预测在不同条件下的分布规律,并为人工智能安全研究中的现有假说提供了支持性连接。
原文摘要 · Abstract (English)
This research aims to unravel how large language models (LLMs) iteratively refine token predictions through internal processing. We utilized a logit lens technique to analyze the model's token predictions derived from intermediate representations. Specifically, we focused on (1) how LLMs access and utilize information from input contexts, and (2) how positioning of relevant information affects the model's token prediction refinement process. On a multi-document question answering task with varying input context lengths, we found that the depth of prediction refinement (defined as the number of intermediate layers an LLM uses to transition from an initial correct token prediction to its final, stable correct output), as a function of the position of relevant information, exhibits an approximately inverted U-shaped curve. We also found that the gap between these two layers, on average, diminishes when relevant information is positioned at the beginning or end of the input context. This suggested that the model requires more refinements when processing longer contexts with relevant information situated in the middle. Furthermore, our findings indicate that not all layers are equally essential for determining final correct outputs. Our analysis provides insights into how token predictions are distributed across different conditions, and establishes important connections to existing hypotheses and previous findings in AI safety research and development.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。