[论文解读] Filtering Beats Fine Tuning: A Bayesian Kalman View of In Context Learning in LLMs
该论文将大语言模型中的上下文学习建模为使用卡尔曼滤波的在线贝叶斯状态估计,处理带不确定性的低维潜在自适应状态,从而在没有参数更新的情况下实现快速、以信息为驱动的自适应。
We present a theory-first framework that interprets inference-time adaptation in large language models (LLMs) as online Bayesian state estimation. Rather than modeling rapid adaptation as implicit optimization or meta-learning, we formulate task- and context-specific learning as the sequential inference of a low-dimensional latent adaptation state governed by a linearized state-space model. Under Gaussian assumptions, adaptation follows a Kalman recursion with closed-form updates for both the posterior mean and covariance. This perspective elevates epistemic uncertainty to an explicit dynamical variable. We show that inference-time learning is driven by covariance collapse, i.e., rapid contraction of posterior uncertainty induced by informative tokens, which typically precedes convergence of the posterior mean. Using observability conditions on token-level Jacobians, we establish stability of the Bayesian filter, prove exponential covariance contraction rates, and derive mean-square error bounds. Gradient descent, natural-gradient methods, and meta-learning updates arise as singular, noise-free limits of the filtering dynamics, positioning optimization-based adaptation as a degenerate approximation of Bayesian inference. The resulting theory provides a unified probabilistic account of in-context learning, parameter-efficient adaptation, and test-time learning without parameter updates. It yields explicit guarantees on stability and sample efficiency, offers a principled interpretation of prompt informativeness via information accumulation, and clarifies the role of uncertainty dynamics absent from existing accounts. Minimal illustrative experiments corroborate the qualitative predictions of the theory.
研究动机与目标
- 给出一个以理论为先的推理时自适应在大语言模型中的解释,将自适应视为序贯贝叶斯状态估计。
- 引入一个低维潜在自适应状态,用以参数化相对于预训练模型的任务与上下文特定偏差。
- 在可观测性条件下,对协方差收缩、稳定性和样本效率进行形式化分析。
提出的方法
- 提出一个线性化的状态空间模型,其中有效参数为 θ_t = θ_0 + B x_t,x_t 为潜在状态。
- 将记号级的负对数似然建模为线性化观测:ℓ_t ≈ ℓ_t^(0) + ∇_θ ℓ_t^T B x_t + v_t,其中 v_t ∼ N(0, R_t)。
- 应用卡尔曼(或扩展卡尔曼)滤波来更新后验 p(x_t | D_t),其均值为 μ_t、协方差为 P_t。
- 使用信息型(精度)卡尔曼更新来显示信息累积单调以及协方差收缩。
- 在可观测性假设下推导稳定性与收敛性,并将梯度方法作为滤波的奇异、无噪声极限进行关联。
实验结果
研究问题
- RQ1推理时自适应在大语言模型中能否被严格建模为序贯贝叶斯状态估计?
- RQ2通过提示令牌的信息累积如何影响后验不确定性与自适应速度?
- RQ3在该滤波框架下能给出稳定性、不确定性收缩以及均方误差的哪些保证?
- RQ4在观测噪声趋于零的极限下,梯度基更新如何与卡尔曼滤波关联?
- RQ5提示信息的可信息性在实现无参数更新的测试时自适应中起到何种作用?
主要发现
- 推理时学习以显式后验不确定性动态的贝叶斯滤波形式出现。
- 在可观测性与来自提示的信息累积下协方差呈指数收缩。
- 后验均值误差在不确定性收缩的同时拥有一个随时间衰减的项,体现出在精确状态收敛前的快速改进。
- 梯度下降和自然梯度方法在极限上看作卡尔曼更新的奇异、无噪声极限,而非主要机制。
- 提示本身作为“实验”;其信息量通过可观测性格拉恩矩阵决定可学习性。
- 基于卡尔曼的学习提供稳定性保障,并为少样本泛化中的提示信息可用性提供原则性解释。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。