研究问题
给定训练序列及其 next-token labels,一个 self-attention layer 究竟学到什么关系?作者不把注意力图直接当解释,而是问训练权重的发散方向与有限残差是否分别对应可验证的算法步骤。 目标是证明两步 automaton:hard retrieval 从 context 中排除低优先级 token;soft composition 在同级候选间分配非零概率并形成 convex combination。优先级不是人为赋值,而由训练数据诱导的 token-priority graph 及其 strongly connected components (SCCs) 定义。
模型与方法
模型是一层 self-attention 加固定/一般 linear classifier,以 sequence 最后 token 作为 query,使用 next-token likelihood 或一般单调 loss 训练 attention matrix W。作者按最后 token \(k\) 为训练样本构造一组 directed token-priority graphs G^(\(k\)):若某 token 在带标签样本中应压过另一 token,就形成有向 priority relation;互相可达的 tokens 属于同一 SCC。 Graph-SVM 在不同 SCC 之间施加 \(margin\ge 1\),在 SCC 内施加 score \(difference=0\)。权重空间分为 cyclic subspace \(S_{\mathrm{fin}}\) 与其正交补:作者将非退化情形下的 GD 方向关联到最小范数 \(W^{s}vm\),以编码 SCC 拓扑次序,并将有限投影关联到 \(W^{f}in\) 的 soft allocation;该渐近结论的条件见下文。 论文分别分析 convex log-likelihood setting、regularization path 与 acyclic datasets;数值实验随机生成 vocab/embeddings/sequences,追踪 W 与 \(W^{s}vm\) 的 correlation 及有限投影误差,并扩展到大 vocabulary \(K=10000\)。
核心结果与证据
Figure 1 总结测试时算法:由 last input token 选择关联的 TPG,attention 对 context 中最高 priority SCC 做近似硬检索,再在入选 token 间 soft composition 得到 next-token distribution。 Theorem 2 声称在 full-row-rank embedding、特定 classifier 与 log loss 等假设下,||W(\(\tau\))|| 发散、归一化方向趋于 \(W^{s}vm\)/||\(W^{s}vm\)||,有限投影趋于 \(W^{f}in\)。该无条件表述需限定:若仅有一个 token 且标签就是该 token,损失与梯度恒为零、\(W^{s}vm=0\),范数不发散;附录证明还使用 \(W^{s}vm\ne 0\) 及步长 \(\eta\le 1\)/\(L\)。非退化情形的 hard/soft 分解应连同这些条件阅读。 Figure 4 的 100 个随机实例使用归一化梯度下降,4000 iterations 后方向 correlation 约 0.987,finite-component distance 小于 0.01。附录 \(K=10000\)、\(n=16\)、\(T=64\)、\(d=128\) 的实验以 mask 提取 token 概率;\(K\)>\(d\) 超出正文 full-row-rank 假设,是条件外的数值探查。
Figure 1 · Hard retrieval 选择最高 SCC;soft composition 保留 SCC 内概率结构。
物理解读:The priority levels are defined from the training-set token graph and should not be read as universal semantic importance.
来源:paper.pdf \(p\). 1, Figure 1
有效性与局限
理论对象是 single-layer、single-head-like attention 与线性分类头,不含多层 residual/MLP、layer normalization、learned embeddings 或真实语言的巨大冗余。TPG 从带 next-token labels 的有限训练集构造,它描述样本优先关系,不等同于语义知识图谱。 全局 GD 结论依赖 log loss 带来的 convexity、embedding rank、classifier 与 separability assumptions;一般非凸 loss 主要通过 regularization path 或更受限的 acyclic case 处理。norm 发散与无限训练极限也不同于 weight decay、early stopping 的实际模型。 SCC 内的 soft composition 由有限最优项刻画,但同级概率可能对 sample counts、head 和表示选择敏感。实验是合成验证,不证明大型语言模型逐层实现同一 automaton;本卡未独立复现。
复现与资源
原文:https://arxiv.org/abs/2403.08081。官方 \(v_{1}\) PDF SHA-256:e69c945c154b39c534cb1e81b318798d3e8059baaf4d89a23ba84f3cd9c2285a。正文给出 TPG/Graph-SVM、GD 和 regularization-path theorems;附录含 gradients、辅助 lemmas 与扩展实验。 复现应从小型随机 dataset 开始:按 last token 建 TPG 并求 SCC 与 Graph-SVM,训练同一 attention matrix;同时记录 normalized Frobenius correlation、\(\Pi_{\mathrm{Sfin}}\) projection error、attention mass 落在最高 SCC 的比例和 SCC 内分布误差。需单独报告违反 rank/separability 或使用有限 weight decay 时的偏差。Evidence status: full-text verified; no independent reproduction performed.
阅读指南
先看 Figures 1–2 把 hard/soft 与 SCC 对上;再读 Graph-SVM definition 和 Theorem 2 的 assumptions。实验曲线只用于核查 decomposition,不应跳过有限项。最后读 Discussion,确认多层多头和 MLP 仍是开放扩展。
← 上一篇 Emergent Chirality and Hyperuniformity in an Active Mixture with Nonreciprocal Interactions
下一篇 → The training process of many deep networks explores the same low-dimensional manifold
Discussion
评论与讨论
评论公开保存在 GitHub Discussions;阅读无需登录,发表评论需要 GitHub 账号。