Transformer 通过受约束的贝叶斯更新形成独特几何结构。
Constrained belief updates explain geometric structures in transformer representations

- 将注意力机制解释为受限贝叶斯推断的并行化实现。
- 准确预测了注意力模式、OV 向量与嵌入向量的几何形态。
- 适合对模型可解释性与神经表征几何感兴趣的读者。
在训练用于下一个词预测的 Transformer 时,其内部计算结构是什么?本文提供证据表明,Transformer 实现了受约束的贝叶斯信念更新——一种由架构约束塑造的局部贝叶斯推断的并行版本。结合最优预测的模型无关理论与机制可解释性方法,我们分析了在可解析的隐马尔可夫模型上训练的 Transformer,这些模型会在神经激活中生成丰富的几何模式。主要分析聚焦于单层 Transformer,揭示第一层注意力如何实现这些受约束的更新;多层扩展则展示了后续层如何优化这些表示。我们发现注意力执行了一种在概率单纯形中有自然解释的算法,并生成具有显著几何特征的表示。通过修改最优未来词预测方程以考虑注意力的架构约束,我们能够详细理论预测该算法行为及表示的几何特性,包括注意力模式、OV 向量和嵌入向量。本方法为架构约束如何塑造最优预测的实现提供了原则性视角,揭示了 Transformer 发展特定中间几何结构的原因。
原文摘要 · Abstract (English)
What computational structures emerge in transformers trained on next-token prediction? In this work, we provide evidence that transformers implement constrained Bayesian belief updating -- a parallelized version of partial Bayesian inference shaped by architectural constraints. We integrate the model-agnostic theory of optimal prediction with mechanistic interpretability to analyze transformers trained on a tractable family of hidden Markov models that generate rich geometric patterns in neural activations. Our primary analysis focuses on single-layer transformers, revealing how the first attention layer implements these constrained updates, with extensions to multi-layer architectures demonstrating how subsequent layers refine these representations. We find that attention carries out an algorithm with a natural interpretation in the probability simplex, and create representations with distinctive geometric structure. We show how both the algorithmic behavior and the underlying geometry of these representations can be theoretically predicted in detail -- including the attention pattern, OV-vectors, and embedding vectors -- by modifying the equations for optimal future token predictions to account for the architectural constraints of attention. Our approach provides a principled lens on how architectural constraints shape the implementation of optimal prediction, revealing why transformers develop specific intermediate geometric structures.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。