Lune

ICLR2025顶会

Attention with Markov: A Curious Case of Single-layer Transformers

Ashok Vardhan Makkuva, Marco Bondaschi, Adway Girish, Alliot Nagle, Martin Jaggi, Hyeji Kim, Michael Gastpar

摘要

Attention-based transformers have achieved tremendous success across a variety of disciplines including natural languages. To deepen our understanding of their sequential modeling capabilities, there is a growing interest in using Markov input processes to study them. A key finding is that when trained on first-order Markov chains, transformers with two or more layers consistently develop an induction head mechanism to estimate the in-context bigram conditional distribution. In contrast, single-layer transformers, unable to form an induction head, directly learn the Markov kernel but often face a surprising challenge: they become trapped in local minima representing the unigram distribution, whereas deeper models reliably converge to the ground-truth bigram. While single-layer transformers can theoretically model first-order Markov chains, their empirical failure to learn this simple kernel in practice remains a curious phenomenon. To explain this contrasting behavior of single-layer models, in this paper we introduce a new framework for a principled analysis of transformers via Markov chains. Leveraging our framework, we theoretically characterize the loss landscape of single-layer transformers and show the existence of global minima (bigram) and bad local minima (unigram) contingent on data properties and model architecture. We precisely delineate the regimes under which these local optima occur. Backed by experiments, we demonstrate that our theoretical findings are in congruence with the empirical results. Finally, we outline several open problems in this arena. Code is available at https://github.com/Bond1995/Markov.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 13 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • A Survey on In-context Learning 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
  • A Survey on In-context Learning 引用了 Transformers Learn In-Context by Gradient Descent
  • A Survey on In-context Learning 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Incremental Learning of Sparse Attention Patterns in Transformers 引用了 Transformers Learn In-Context by Gradient Descent
  • Incremental Learning of Sparse Attention Patterns in Transformers 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Transformers Learn In-Context by Gradient Descent 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Are Transformers universal approximators of sequence-to-sequence functions?
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper13

  1. From Markov to Laplace: How Mamba In-Context Learns Markov ChainsMarco Bondaschi, Nived Rajaraman, Xiuying Wei, Razvan Pascanu 等ICLR 2026 · 10 次引用
  2. Nonparametric Teaching of Attention LearnersChen Zhang, Jianghui Wang, Bingyang Cheng, Zhongtao Chen 等ICLR 2026 · 3 次引用
  3. Decoupling Positional and Symbolic Attention in TransformersFelipe Urrutia, Jorge Salas, Alexander Kozachinskiy, Cristian Buc Calderon 等ICLR 2026 · 3 次引用
  4. Incremental Learning of Sparse Attention Patterns in TransformersOğuz YükselICML 2026 · 2 次引用
  5. Multiple Choice Learning of Low-Rank Adapters for Language ModelingVictor Letzelter, Hugo Malard, Mathieu Fontaine, Gaël Richard 等ICML 2026 · 1 次引用

它引用的 Paper29

  1. An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 次引用
  2. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 次引用
  3. Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento 等ICML 2023 · 729 次引用
  4. Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi 等ICLR 2020 · 481 次引用
  5. A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng 等EMNLP 2024 · 479 次引用

相关 Paper

  1. Local to Global: Learning Dynamics and Effect of Initialization for TransformersAshok Vardhan Makkuva, Marco Bondaschi, Adway Girish, Alliot Nagle 等NeurIPS 2024 · 16 次引用
  2. 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 次引用
  3. Transformers on Markov data: Constant depth sufficesNived Rajaraman, Marco Bondaschi, Ashok Vardhan Makkuva, Kannan Ramchandran 等NeurIPS 2024 · 33 次引用
  4. The Evolution of Statistical Induction Heads: In-Context Learning Markov ChainsEzra Edelman, Nikolaos Tsilivis, Benjamin L. Edelman, Eran Malach 等NeurIPS 2024 · 140 次引用
  5. An Analysis of Tokenization: Transformers under Markov DataNived Rajaraman, Jiantao Jiao, Kannan RamchandranNeurIPS 2024 · 16 次引用
黄昏的海面,两侧是细线勾勒的悬崖