mlsanityData to 7 Oct 2026

Towards Understanding Transformers in Learning Random Walks

arXiv 2511.23239 ↗First posted 28 Nov 2025cs.LG stat.MLcited by 1

Not on the map. Why?

Abstract (arXiv)

Transformers have proven highly effective across various applications, especially in handling sequential data such as natural languages and time series. However, transformer models often lack clear interpretability, and the success of transformers has not been well understood in theory. In this paper, we study the capability and interpretability of transformers in learning a family of classic statistical models, namely random walks on circles. We theoretically demonstrate that, after training with gradient descent, a one-layer transformer model can achieve optimal accuracy in predicting random walks. Importantly, our analysis reveals that the trained model is interpretable: the trained softmax attention serves as a token selector, focusing on the direct parent state; subsequently, the value matrix executes a one-step probability transition to predict the location of the next state based on this parent state. We also show that certain edge cases not covered by our theory are indeed failure cases, demonstrating that our theoretical conditions are tight. By investigating these success and failure cases, it is revealed that gradient descent with small initialization may fail or struggle to converge to a good solution in certain simple tasks even beyond random walks. Experiments are conducted to support our theoretical findings.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 30 of its 35 references that are in the map. First posted on arXiv 28 Nov 2025.

Builds on

30 of 35 references.

References · 30

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  3. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
  4. 2021DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsificationcited by 849
  5. 2021Offline Reinforcement Learning as One Big Sequence Modeling Problemcited by 636
  6. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  7. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
  8. 2023Birth of a Transformer: A Memory Viewpointcited by 154
  9. 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
  10. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
  11. 2023In-Context Convergence of Transformerscited by 112
  12. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
18 more
  1. 2022Vision Transformers provably learn spatial structurecited by 92
  2. 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
  3. 2023Transformers as Support Vector Machinescited by 67
  4. 2023Max-Margin Token Selection in Attention Mechanismcited by 57
  5. 2023Transformers learn through gradual rank increasecited by 52
  6. 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
  7. 2024Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformerscited by 46
  8. 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformerscited by 34
  9. 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
  10. 2024Transformers Can Represent n-gram Language Modelscited by 31
  11. 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
  12. 2024A Law of Next-Token Prediction in Large Language Modelscited by 15
  13. 2024Implicit Optimization Bias of Next-Token Prediction in Linear Modelscited by 14
  14. 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Contextcited by 14
  15. 2024Rethinking Transformers in Solving POMDPscited by 9
  16. 2025Selective Induction Heads: How Transformers Select Causal Structures In Contextcited by 7
  17. 2025Transformers Simulate MLE for Sequence Generation in Bayesian Networkscited by 5
  18. 2025Transformer Learns Optimal Variable Selection in Group-Sparse Classificationcited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.