研究问题
给定长度 \(L\) 的 token sequence,histogram task 要在每个位置输出该 token 在全序列出现的次数。任务简单但同时需要比较 token identity、跨位置聚合与离散计数,适合分离 attention 与 feed-forward layer 的职责。 作者比较 dot-product attention、带 BOS 的 attention 与 content-independent linear mixing,并切换 softmax;问不同架构会学到何种计数策略、最小 embedding/FFN capacity 如何依赖 vocabulary \(T\)。
模型与方法
模型是一层非自回归 Transformer block:token embeddings 经 mixing matrix A 聚合,再残差连接到每个位置,逐 token FFN 输出 count class。实验固定 \(T=32\)、\(L=10\),网格扫描 \(d\),\(p\) 从 1 到 128,每个配置 5 seeds。 作者推导两类策略。Relation-based counting 让 attention 比较 query token 与其他 tokens,通过同/异 token overlap 或 BOS softmax weight 编码 count;FFN 只需解码一维计数方向,因此 \(p\) 可很小。Inventory-based counting 则把每个 vocabulary item 的数量分别存进 representation,通常需要 \(d\) 或 \(p\) 随 \(T\) 扩展。 机制核查包括 embedding cosine overlaps、attention matrices、BOS contribution、FFN response curves 与 trained-regime heatmaps;附录还测试 frozen random embeddings 和 Mistral/Llama prompting。
核心结果与证据
Figure 1 的六个 \(d\)×\(p\) heatmaps 显示清晰相边界:BOS+softmax 在较大 \(d\) 时可用极小 \(p\) 达到高精度,符合 relation-based strategy;linear mixing 和部分 dot variants 更依赖 \(p\ge T\) 或 \(d\ge T\) 的 inventory capacity。Softmax 会同时帮助 BOS 归一化策略并破坏某些可直接读 count magnitude 的方向。 Figure 3 对一个 \(p=2\)、\(d=45\) 的 BOS+softmax 模型做 introspection:same/different/BOS embeddings 的 overlap 分离,BOS attention weight 随 query token count 变化,FFN 基本只沿这一标量方向划分 1…\(L\),达到 99.9%。 Figure 4 展示 inventory-based models 的 attention/representation 把 token-specific counts 写入多个方向,由 FFN 充当 look-up/readout。理论显式构造与经验 regime 大体一致,但训练能否找到某一策略仍受初始化和优化影响。
Figure 1 · 白线标记 \(d=T\) 与 \(p=T\);星号/点表示至少一个 seed 达到 100%/99%以上。
物理解读:The maps show empirical accessibility across five seeds, not a sharp thermodynamic phase transition or a proof of optimization success.
来源:paper.pdf \(p\). 4, Figure 1
有效性与局限
主模型仅一层、无 causal mask、无 positional encoding、固定短序列与合成 iid tokens;现代 decoder LLM 的多层 residual computation 和自回归输出可能实现不同算法。 Heatmap 星号表示 5 runs 中至少一次达到 100%,点表示至少一次超过 99%;均值颜色与 best-run marker 必须一起读,不能把可达性当作稳定训练概率。理论 capacity construction 也不等于 SGD 隐式偏置。 附录对 7B/8B LLM 的 counting prompts 是有限样本、特定 prompt 与 temperature-zero 诊断,不能直接比较一般算术能力。Relation/inventory 是有证据支持的两类机制,不保证穷尽所有混合策略。本卡未独立复现。
复现与资源
原文:https://arxiv.org/abs/2407.11542。官方 \(v_{3}\) PDF SHA-256:8942cf7ad095f97ecf3a8a5d03c4e8272f28fef810645d8639ecfdd403f1fe35。 复现应固定 \(T\)、\(L\)、token sampling、mixing variant、softmax、\(d\)、\(p\) 和五个以上 seeds;同时保存 final 与 best accuracy,绘制 embedding overlaps、attention/BOS weights 和 FFN count boundaries。用 shuffled labels、frozen embeddings、不同 \(T\)/\(L\) 与 causal-mask controls 检查相边界是否按理论缩放。Evidence status: full-text verified; no independent reproduction performed.
阅读指南
先读 §2–3 的 architecture 与 histogram definition,再看 Figure 1 的六个 capacity maps。随后用 Figure 3 理解 relation-based counting、Figure 4 理解 inventory-based counting;最后读 §6 与附录,区分单层机制结论和 LLM prompt 观察。
← 上一篇 Learning interpretable dynamics of stochastic complex systems from experimental data
下一篇 → Emergence of Hidden Capabilities: Exploring Learning Dynamics in Concept Space
Discussion
评论与讨论
评论公开保存在 GitHub Discussions;阅读无需登录,发表评论需要 GitHub 账号。