Large Language Models Develop Belief State Geometry In-Context

📄 arXiv: 2609.17376v1 📥 PDF

作者: Daniel Balcells, Andrew Jun Lee, Chirag Rastogi, Paul M. Riechers, Adam Shai, Xavier Poncini

分类: cs.LG, cs.CL

发布日期: 2026-09-15

备注: 87 pages


💡 一句话要点

探讨大型语言模型的信念状态几何以提升上下文学习能力

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 上下文学习 信念状态 隐藏马尔可夫模型 贝叶斯预测 激活几何 线性解码

📋 核心要点

  1. 现有方法对大型语言模型的上下文学习能力支持的表示理解不足,缺乏系统性研究。
  2. 本文通过使用隐藏马尔可夫模型生成的数据,探讨信念状态的表示,并通过线性解码验证其有效性。
  3. 实验结果显示,信念状态在不同层次的激活中均可被有效解码,且干预实验表明其对下游任务的预测质量有显著影响。

📝 摘要(中文)

大型语言模型(LLMs)在下一词预测任务中展现出显著的上下文学习(ICL)能力,但其支持ICL的表示仍然不够明确。本文通过隐藏马尔可夫模型(HMM)生成的数据对LLMs进行提示,探讨相应的信念状态,即在观察到的标记历史下对HMM隐藏状态的后验分布。研究发现,信念状态可以从残差流激活中线性解码,$R^2$值在0.83到0.99之间,表明ICL在开源LLMs中近似于基于上下文推断的生成模型的最佳贝叶斯预测。

🔬 方法详解

问题定义:本文旨在解决对大型语言模型在上下文学习中信念状态表示的理解不足,现有方法未能充分揭示其内部机制和有效性。

核心思路:通过提示LLMs使用隐藏马尔可夫模型生成的数据,探讨信念状态的表示,并验证其与模型激活之间的关系,以揭示ICL的本质。

技术框架:研究采用了六个开源LLMs,使用40个具有非平凡信念结构的HMM进行实验,分析了不同层次的激活与信念状态的线性解码关系。

关键创新:本研究的创新在于首次提供了信念状态在LLMs中可被线性解码的证据,表明ICL近似于最佳贝叶斯预测,扩展了输入分布结构与激活几何之间的联系。

关键设计:实验中使用了多层次的激活数据进行线性回归分析,设置了不同的干预策略以验证信念状态的功能相关性,确保了实验的严谨性和结果的可靠性。

🖼️ 关键图片

img_0
img_1
img_2

📊 实验亮点

实验结果显示,信念状态的线性解码$R^2$值在0.83到0.99之间,表明模型在不同层次的激活中均能有效捕捉信念状态。此外,干预实验表明,直接在探测到的子空间进行干预,预测质量与未干预模型相当,而对照组则显著降低了性能。

🎯 应用场景

该研究为理解大型语言模型的内部表示提供了新的视角,潜在应用于自然语言处理、对话系统和智能助手等领域。通过优化模型的上下文学习能力,可以提升其在复杂任务中的表现,具有重要的实际价值和未来影响。

📄 摘要(原文)

Large language models (LLMs) trained on next-token prediction exhibit remarkable in-context learning (ICL) abilities, yet the representations that support ICL remain poorly understood. We consider such representations in a controlled setting: prompting LLMs with data emitted from hidden Markov models (HMMs) and probing for the corresponding belief state -- the posterior distribution over the HMM's hidden states given the observed token history. Across six open-source LLMs prompted with data from 40 HMMs selected for non-trivial belief structure, we find that belief states are linearly decodable from residual stream activations, with peak probe $R^2$-values from 0.83-0.99 across HMM and LLM combinations, ranging from early to late layers. To establish functional relevance, we intervene directly on the probe-identified subspace via patching and steering, resulting in downstream prediction quality on the order of the untampered model, while controls degrade performance substantially. Together, these results provide representation-level evidence that ICL in open-source LLMs approximates optimal Bayesian prediction over a context-inferred generative model. More broadly, our findings extend prior results linking input-distribution structure to activation geometry: from toy networks trained explicitly on HMM data to production-scale LLMs.