arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.22364cs.CLcs.AI
收藏

上下文结构重塑语言模型的表征几何

Context Structure Reshapes the Representational Geometry of Language Models

Google DeepMind(谷歌DeepMind);Princeton Neuroscience Institute, Princeton University(普林斯顿神经科学研究所,普林斯顿大学)

Eghbal A. Hosseini, Yuxuan Li, Yasaman Bahri, Declan Campbell, Andrew Kyle Lampinen

AI总结:

研究发现语言模型在不同任务中根据上下文结构动态调整表征方式,部分任务中上下文增加会提升预测性能,而其他任务中则不一致。

摘要:

大型语言模型(LLMs)已被证明能够在其深层网络中将输入序列的表示组织成更笔直的神经轨迹,这被认为有助于通过线性外推进行下一个标记预测。语言模型还可以适应多样化任务并学习新的结构在上下文中,最近的研究表明,这种上下文学习(ICL)可以在表征变化中反映出来。在这里,我们将这两条研究路线结合起来,探讨在ICL过程中是否会出现表征直线化。我们测量了Gemma 2模型在多样化的上下文任务中的表征直线化,并揭示了LLMs在上下文中的表示变化存在二元性。在连续预测设置(例如自然语言、网格世界遍历任务)中,我们发现增加上下文会增加神经序列轨迹的直线性,这与模型预测的改进相关。相反,在结构化预测设置(例如少样本任务)中,直线化是不一致的——它只出现在任务的显式结构阶段(例如重复模板),但其他地方则消失。这些结果表明,ICL不是一个单一的过程。相反,我们提出LLMs就像一把瑞士军刀:根据任务结构,LLM会动态地在不同策略之间切换,其中只有某些策略会产生表征直线化。

英文摘要:

Large Language Models (LLMs) have been shown to organize the representations of input sequences into straighter neural trajectories in their deep layers, which has been hypothesized to facilitate next-token prediction via linear extrapolation. Language models can also adapt to diverse tasks and learn new structure in context, and recent work has shown that this in-context learning (ICL) can be reflected in representational changes. Here we bring these two lines of research together to explore whether representation straightening occurs \emph{within} a context during ICL. We measure representational straightening in Gemma 2 models across a diverse set of in-context tasks, and uncover a dichotomy in how LLMs' representations change in context. In continual prediction settings (e.g., natural language, grid world traversal tasks) we observe that increasing context increases the straightness of neural sequence trajectories, which is correlated with improvement in model prediction. Conversely, in structured prediction settings (e.g., few-shot tasks), straightening is inconsistent -- it is only present in phases of the task with explicit structure (e.g., repeating a template), but vanishes elsewhere. These results suggest that ICL is not a monolithic process. Instead, we propose that LLMs function like a Swiss Army knife: depending on task structure, the LLM dynamically selects between strategies, only some of which yield representational straightening.

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

↑