Learning the greatest common divisor: explaining transformer predictions
摘要
The predictions of small transformers, trained to calculate the greatest common divisor (GCD) of two positive integers, can be fully characterized by looking at model inputs and outputs. As training proceeds, the model learns a list of integers, products of divisors of the base used to represent integers and small primes, and predicts the largest element of that divides both inputs. Training distributions impact performance. Models trained from uniform operands only learn a handful of GCD (up to GCD ). Log-uniform operands boost performance to GCD , and a log-uniform distribution of outcomes (i.e. GCD) to . However, training from uniform (balanced) GCD breaks explainability.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Dichotomy of Early and Late Phase Implicit Biases Can Provably Induce Grokking 引用了 Towards Understanding Grokking: An Effective Theory of Representation Learning
- Teaching Arithmetic to Small Transformers 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networks 引用了 Towards Understanding Grokking: An Effective Theory of Representation Learning
- Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks 引用了 Towards Understanding Grokking: An Effective Theory of Representation Learning
- Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks 引用了 Dichotomy of Early and Late Phase Implicit Biases Can Provably Induce Grokking
- Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks 引用了 The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networks
- Learning to compute Gröbner bases 引用了 Deep Learning For Symbolic Mathematics
- Efficient numeracy in language models through single-token number embeddings 引用了 Teaching Arithmetic to Small Transformers
- Efficient numeracy in language models through single-token number embeddings 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
引用它的顶会 Paper11
- Dichotomy of Early and Late Phase Implicit Biases Can Provably Induce GrokkingKaifeng Lyu, Jikai Jin, Zhiyuan Li, Simon Shaolei Du 等ICLR 2024 · 71 次引用
- Uncovering a Universal Abstract Algorithm for Modular Addition in Neural NetworksGavin McCracken, Gabriela Moisescu-Pareja, Vincent Létourneau, Doina Precup 等NeurIPS 2025 · 14 次引用
- Learning to compute Gröbner basesHiroshi Kera, Yuki Ishihara, Yuta Kambe, Tristan Vaccon 等NeurIPS 2024 · 9 次引用
- Beyond Model Collapse: Scaling Up with Synthesized Data Requires VerificationYunzhen Feng, Elvis Dohmatob, Pu Yang, François Charton 等ICLR 2025 · 6 次引用
- Efficient numeracy in language models through single-token number embeddingsLinus Kreitner, Paul Hager, Jonathan Mengedoht, Georgios Kaissis 等ICML 2026 · 5 次引用
它引用的 Paper8
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- Deep Learning For Symbolic MathematicsGuillaume Lample, François ChartonICLR 2020 · 477 次引用
- Towards Understanding Grokking: An Effective Theory of Representation LearningZiming Liu, Ouail Kitouni, Niklas Nolte, Eric J. Michaud 等NeurIPS 2022 · 299 次引用
- The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural NetworksZiqian Zhong, Ziming Liu, Max Tegmark, Jacob AndreasNeurIPS 2023 · 181 次引用
- Teaching Arithmetic to Small TransformersNayoung Lee, Kartik Sreenivasan, Jason D. Lee, Kangwook Lee 等ICLR 2024 · 128 次引用
相关 Paper
- Algorithmic Capabilities of Random TransformersZiqian Zhong, Jacob AndreasNeurIPS 2024 · 23 次引用
- (How) Can Transformers Predict Pseudo-Random Numbers?Tao Tao, Darshil Doshi, Dayal Singh Kalra, Tianyu He 等ICML 2025
- Learning Pseudorandom Numbers with Transformers: Permuted Congruential Generators, Curricula, and InterpretabilityTao Tao, Maissam BarkeshliICLR 2026
- How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelMichael Hanna, Ollie Liu, Alexandre VariengienNeurIPS 2023 · 251 次引用
- Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasksTianyu He, Darshil Doshi, Aritra Das, Andrey GromovNeurIPS 2024 · 52 次引用
