中文

为何变换器无法学习乘法?逆向工程揭示长程依赖陷阱

机器学习 2025-10-02 v1 人工智能

摘要

Language models 正在变得越来越有能力, 但仍在 seemingly simple 的 multi-digit multiplication 任务中 失败. 在本 work 中, 我们通过 reverse-engineering 成功学习 multiplication via implicit chain-of-thought 的 model, 并 report 三项发现: (1) 长程结构证据: Logit attributions 和 linear probes indicate that the model 编码了 necessary long-range dependencies for multi-digit multiplication. (2) 机制: model 使用 attention 构建 directed acyclic graph 来 ``cache'' 和 ``retrieve'' 两两 partial products. (3) 几何: model 通过在 attention heads 中 form Minkowski sums between pairs of digits 实现 partial products, 且 digits 使用 Fourier basis 表示, 这些都是 intuitive and efficient 的 representations, standard fine-tuning model lacks. 有了这些洞察, 我们重新审视 standard fine-tuning 的 learning dynamics, 发现 model 收敛到 lacks required long-range dependencies 的 local optimum. 我们进一步通过引入 auxiliary loss 预测 ``running sum'' via linear regression probe, 为 model 提供 inductive bias, 使其 成功学习 multi-digit multiplication. 总结来说, 通过 reverse-engineering implicit chain-of-thought model 的 mechanisms, 我们 揭示了 Transformer 学习 long-range dependencies 的陷阱, 并提供了 correct inductive bias 可解决此问题的 示例.

关键词

引用

@article{arxiv.2510.00184,
  title  = {Why Can't Transformers Learn Multiplication? Reverse-Engineering Reveals Long-Range Dependency Pitfalls},
  author = {Xiaoyan Bai and Itamar Pres and Yuntian Deng and Chenhao Tan and Stuart Shieber and Fernanda Viégas and Martin Wattenberg and Andrew Lee},
  journal= {arXiv preprint arXiv:2510.00184},
  year   = {2025}
}