Transformer通过上下文学习构建自适应统计估计器,而非简单匹配相似样本。
Implicit Statistical Inference in Transformers: Approximating Likelihood-Ratio Tests In-Context
- 用似然比检验作为基准,研究模型如何在上下文中逼近最优统计量。
- 在非线性任务中,模型性能接近理想最优估计器,且可被单调变换还原。
- 机制分析显示模型动态调整决策可线性解码的点,体现投票或序列计算模式。
上下文学习(ICL)使Transformer能在不更新权重的情况下适应新任务,但其内在机制仍不清楚。本文从统计决策理论视角出发,研究简单的二元假设检验,其中最优策略由似然比检验决定。该设定提供了严格的可解释性框架,目标算法真值已知。通过训练模型处理具有不同几何结构的任务(线性平移均值与非线性方差估计),我们发现模型能从上下文中近似得到贝叶斯最优充分统计量,仅受单调变换影响,并在非线性场景下达到理想先验估计器的性能。基于此分析真值,利用对数概率透镜和电路对齐的机制分析表明,模型并未依赖固定核平滑启发式方法,而是动态调整决策可线性解码的点:在线性任务中呈现类似投票的集成模式,在非线性任务中采用更深层的序列计算。结果表明,ICL源于任务自适应统计估计器的构建,而非简单的相似性匹配。
原文摘要 · Abstract (English)
In-context learning (ICL) allows Transformers to adapt to novel tasks without weight updates, yet the underlying algorithms remain poorly understood. We adopt a statistical decision-theoretic perspective by investigating simple binary hypothesis testing, where the optimal policy is determined by the likelihood-ratio test. Notably, this setup provides a mathematically rigorous setting for mechanistic interpretability where the target algorithmic ground truth is known. By training Transformers on tasks requiring distinct geometries (linear shifted means vs. nonlinear variance estimation), we demonstrate that the models approximate the Bayes-optimal sufficient statistics from context up to some monotonic transformation, matching the performance of an ideal oracle estimator in nonlinear regimes. Leveraging this analytical ground truth, mechanistic analysis via logit lens and circuit alignment suggests that the model does not rely on a fixed kernel smoothing heuristic. Instead, it appears to adapt the point at which decisions become linearly decodable: exhibiting patterns consistent with a voting-style ensemble for linear tasks while utilizing a deeper sequential computation for nonlinear tasks. These findings suggest that ICL emerges from the construction of task-adaptive statistical estimators rather than simple similarity matching.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。