大模型在推理时会动态构建结构化表示,支撑灵活适应新任务。
Emergent Structured Representations Support Flexible In-Context Inference in Large Language Models
- 发现中间到晚期层存在可迁移的概念子空间,具稳定结构。
- 因果分析证实该子空间对预测有关键作用,非副现象。
- 早期注意力头整合上下文构建表示,后期用于生成答案。
大型语言模型(LLMs)展现出类似人类推理的涌现行为。尽管已有研究发现模型内部存在结构化概念表征,但其是否真正用于推理仍不明确。本文研究了多类任务下模型进行上下文推理时的内部处理机制。结果揭示,在中间到晚期层中出现一个概念子空间,其表征结构在不同上下文中保持一致。通过因果中介分析,我们证明该子空间并非副现象,而是模型预测的功能核心,确立其在推理中的因果作用。进一步发现,早期到中期层的注意力头逐步整合上下文线索,构建并优化该子空间,随后由后期层利用该子空间生成预测。这些发现表明,LLMs 在上下文中动态构建并使用结构化潜在表征进行推理,为灵活适应的计算机制提供了新见解。
原文摘要 · Abstract (English)
Large language models (LLMs) exhibit emergent behaviors suggestive of human-like reasoning. While recent work has identified structured conceptual representations within these models, it remains unclear whether they functionally rely on such representations for reasoning. Here we investigate the internal processing of LLMs during in-context inference across diverse tasks. Our results reveal a conceptual subspace emerging in middle to late layers, whose representational structure persists across contexts. Using causal mediation analyses, we demonstrate that this subspace is not merely an epiphenomenon but is functionally central to model predictions, establishing its causal role in inference. We further identify a layer-wise progression where attention heads in early-to-middle layers integrate contextual cues to construct and refine the subspace, which is subsequently leveraged by later layers to generate predictions. Together, these findings provide evidence that LLMs dynamically construct and use structured latent representations in context for inference, offering insights into the computational processes underlying flexible adaptation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。