Transformers on Markov data: Constant depth suffices
Nived Rajaraman, Marco Bondaschi, Ashok Vardhan Makkuva, Kannan Ramchandran, Michael Gastpar
摘要
Attention-based transformers have been remarkably successful at modeling generative processes across various domains and modalities. In this paper, we study the behavior of transformers on data drawn from Markov processes, where the conditional distribution of the next symbol in a sequence depends on the previous symbols observed. We observe a surprising phenomenon empirically which contradicts previous findings: when trained for sufficiently long, a transformer with a fixed depth and head per layer is able to achieve low test loss on sequences drawn from Markov sources, even as grows. Furthermore, this low test loss is achieved by the transformer's ability to represent and learn the in-context conditional empirical distribution. On the theoretical side, our main result is that a transformer with a single head and three layers can represent the in-context conditional empirical distribution for Markov sources, concurring with our empirical observations. Along the way, we prove that attention-only transformers with layers can represent the in-context conditional empirical distribution by composing induction heads to track the previous symbols in the sequence. These results provide more insight into our current understanding of the mechanisms by which transformers learn to capture context, by understanding their behavior on Markov sources.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 Language Models are Few-Shot Learners
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 Local to Global: Learning Dynamics and Effect of Initialization for Transformers
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformers 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 Language Models are Few-Shot Learners
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
- Latent Concept Disentanglement in Transformer-based Language Models 引用了 Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- Latent Concept Disentanglement in Transformer-based Language Models 引用了 The Evolution of Statistical Induction Heads: In-Context Learning Markov Chains
- Latent Concept Disentanglement in Transformer-based Language Models 引用了 Language Models are Few-Shot Learners
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- From Markov to Laplace: How Mamba In-Context Learns Markov Chains 引用了 The Evolution of Statistical Induction Heads: In-Context Learning Markov Chains
- From Markov to Laplace: How Mamba In-Context Learns Markov Chains 引用了 Local to Global: Learning Dynamics and Effect of Initialization for Transformers
- The Evolution of Statistical Induction Heads: In-Context Learning Markov Chains 引用了 Language Models are Few-Shot Learners
- Local to Global: Learning Dynamics and Effect of Initialization for Transformers 引用了 Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- Local to Global: Learning Dynamics and Effect of Initialization for Transformers 引用了 The Evolution of Statistical Induction Heads: In-Context Learning Markov Chains
- Local to Global: Learning Dynamics and Effect of Initialization for Transformers 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
引用它的顶会 Paper19
- The Evolution of Statistical Induction Heads: In-Context Learning Markov ChainsEzra Edelman, Nikolaos Tsilivis, Benjamin L. Edelman, Eran Malach 等NeurIPS 2024 · 140 次引用
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in TransformersSiyu Chen, Heejune Sheen, Tianhao Wang, Zhuoran YangNeurIPS 2024 · 48 次引用
- Local to Global: Learning Dynamics and Effect of Initialization for TransformersAshok Vardhan Makkuva, Marco Bondaschi, Adway Girish, Alliot Nagle 等NeurIPS 2024 · 16 次引用
- From Markov to Laplace: How Mamba In-Context Learns Markov ChainsMarco Bondaschi, Nived Rajaraman, Xiuying Wei, Razvan Pascanu 等ICLR 2026 · 10 次引用
- Latent Concept Disentanglement in Transformer-based Language ModelsGuanzhe Hong, Bhavya Vasudeva, Vatsal Sharan, Cyrus Rashtchian 等ICLR 2026 · 4 次引用
它引用的 Paper19
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi 等ICLR 2020 · 481 次引用
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm SelectionYu Bai, Fan Chen, Huan Wang, Caiming Xiong 等NeurIPS 2023 · 356 次引用
相关 Paper
- What One Cannot, Two Can: Two-Layer Transformers Provably Represent Induction Heads on Any-Order Markov ChainsChanakya Ekbote, Ashok Vardhan Makkuva, Marco Bondaschi, Nived Rajaraman 等NeurIPS 2025 · 4 次引用
- Attention with Markov: A Curious Case of Single-layer TransformersAshok Vardhan Makkuva, Marco Bondaschi, Adway Girish, Alliot Nagle 等ICLR 2025
- An Analysis of Tokenization: Transformers under Markov DataNived Rajaraman, Jiantao Jiao, Kannan RamchandranNeurIPS 2024 · 16 次引用
- How Transformers Learn Causal Structure with Gradient DescentEshaan Nichani, Alex Damian, Jason D. LeeICML 2024 · 117 次引用
- What Can Transformer Learn with Varying Depth? Case Studies on Sequence Learning TasksXingwu Chen, Difan ZouICML 2024 · 22 次引用
