arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.22471cs.LGcs.AIstat.ML
收藏

Transformer 注意力的贝叶斯几何

The Bayesian Geometry of Transformer Attention

Columbia University(哥伦比亚大学);Columbia University School of Professional Studies(哥伦比亚大学专业研究学院);Department of Statistics(统计学系);Columbia University Department of Computer Science(哥伦比亚大学计算机科学系)

Naman Agarwal, Siddhartha R. Dalal, Vishal Misra

AI总结:

本文通过构建贝叶斯风道,验证了Transformer在上下文中的贝叶斯推理能力,发现其通过几何机制实现后验更新与路由,揭示了注意力机制的必要性及扁平架构的不足。

摘要:

Transformer 似乎在上下文中表现出贝叶斯推理,但严格验证一直困难:自然数据缺乏解析后验,大模型将推理与记忆混淆。我们通过构建贝叶斯风道——可控环境,其中真实后验以闭合形式给出,记忆可证明不可能。在这些设置中,小型Transformer以10^-3-10^-4 bit精度再现贝叶斯后验,而容量匹配的MLP则相差多个数量级,确立了明确的架构分离。在两个任务——双射消除和隐马尔可夫模型(HMM)状态跟踪中,发现Transformer通过一致的几何机制实现贝叶斯推理:残差流作为信念基质,前馈网络执行后验更新,注意力提供内容可寻址路由。几何诊断揭示正交键基、渐进查询-键对齐和由后验熵参数化的低维值流形。训练期间该流形展开而注意力模式保持稳定,这与最近的梯度分析预测的帧精度解离一致。这些结果表明,分层注意力通过几何设计实现贝叶斯推理,解释了注意力的必要性及扁平架构的失败。贝叶斯风道为机械连接小型可验证系统与大语言模型中推理现象提供了基础。

英文摘要:

Transformers often appear to perform Bayesian reasoning in context, but verifying this rigorously has been impossible: natural data lack analytic posteriors, and large models conflate reasoning with memorization. We address this by constructing \emph{Bayesian wind tunnels} -- controlled environments where the true posterior is known in closed form and memorization is provably impossible. In these settings, small transformers reproduce Bayesian posteriors with $10^{-3}$-$10^{-4}$ bit accuracy, while capacity-matched MLPs fail by orders of magnitude, establishing a clear architectural separation. Across two tasks -- bijection elimination and Hidden Markov Model (HMM) state tracking -- we find that transformers implement Bayesian inference through a consistent geometric mechanism: residual streams serve as the belief substrate, feed-forward networks perform the posterior update, and attention provides content-addressable routing. Geometric diagnostics reveal orthogonal key bases, progressive query-key alignment, and a low-dimensional value manifold parameterized by posterior entropy. During training this manifold unfurls while attention patterns remain stable, a \emph{frame-precision dissociation} predicted by recent gradient analyses. Taken together, these results demonstrate that hierarchical attention realizes Bayesian inference by geometric design, explaining both the necessity of attention and the failure of flat architectures. Bayesian wind tunnels provide a foundation for mechanistically connecting small, verifiable systems to reasoning phenomena observed in large language models.

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

↑