atlas

Research map / Architectures and efficiency / Attention and transformers

Towards Understanding Transformers in Learning Random Walks

NeurIPS 2025 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and learnability · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that a one-layer softmax transformer trained by zero-initialized gradient descent provably learns random walks on a circle for 0<p<1 (selecting the parent token and recovering the transition matrix), while p=0 or 1 deterministically fails due to symmetry.

Problem

Understanding whether and how transformers can learn random walks on circles with many states, and characterizing the interpretability of the trained model, including edge cases of deterministic walks (p=0,1).

Approach

Analyzes gradient descent dynamics from zero initialization of a one-layer transformer (reparameterized attention W, value V, log-loss) on random walks over K-node circles, showing attention concentrates on the direct parent token and V converges in direction to the transition matrix; for deterministic walks, symmetry from zero init prevents learning.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train from zero initialization on random walks with 0<p<1One-layer transformer · Random walks on circlesprediction accuracy: max\{p,1-p\}Helped
Train from zero initialization on deterministic walks (p=0 or 1)One-layer transformer · Deterministic walks, p=0 or 1, N=rK+1prediction accuracy: \frac{1}{K}Hurt
Use zero initializationOne-layer transformer · Deterministic walk, p=1 (K=6, N=97)test accuracy: 0.167Hurt
Use Gaussian random initialization (σ=0.01) instead of zero initializationOne-layer transformer · Deterministic walk, p=1 (K=6, N=97)test accuracy: 100%Mixed
Use Gaussian random initialization (σ=0.01)One-layer transformer · Random walk, p=0.5 (K=6, N=97)test accuracy: 50%Helped
Train on questions where the word-embedding average distinguishes the answerOne-layer transformer · Question answering Task 1 (fruit frequency)test accuracy: 100%Helped
Train on questions with the same average word embedding for both answersOne-layer transformer · Question answering Task 2 (stated preference)test accuracy: 50%Hurt

Surprising findings

Limitations

Experimental setup

Datasets: synthetic random walks on circles (K=6, N=97) synthetic QA tasks (fruit counting, fruit preference)

Benchmarks: synthetic random walks on circles synthetic QA tasks

Metrics: prediction accuracy KL divergence to true next-state distribution attention scores normalized value matrix direction error

Baselines: optimal predictor f^OPT = Pi^T x_{N-1} random guess

Builds on: Markov chain in-context learning analysis (Huang et al.) reparameterized attention in transformer theory

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy