atlas

Research map / Architectures and efficiency / Attention and transformers

What One Cannot, Two Can: Two-Layer Transformers Provably Represent Induction Heads on Any-Order Markov Chains

NeurIPS 2025 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and circuits · 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 two-layer, single-head transformer (embedding dim 6S+3) can represent the conditional k-gram model for any Markov order k, improving on prior three-layer single-head constructions, and gives a gradient-descent analysis for first-order chains.

Problem

Whether a two-layer single-head transformer can represent induction heads / conditional k-gram estimators for any-order Markov chains, since prior best constructions needed three layers (single head) or two layers with multiple heads.

Approach

Uses the MLP between the two attention layers (ReLU and layer normalization) to isolate the symbol at position n-k and reconstruct the hard-attention representation u_n, so the second layer acts as a k-th order induction head with one attention head per layer.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use a two-layer transformer with one attention head per layerconditional k-gram representation on any-order Markov chains · Markov-ICL, any Markov order k ≥ 1representation capabilityHelped
reduce depth from three layers to two while keeping one head per layertransformer representation of conditional k-grams · Markov-ICL, higher-order Markov processesrequired transformer depth: three layers -> two layersHelped
use two attention heads in the first layer and one in the secondtransformer representation of conditional k-grams · Markov-ICL, any Markov order krepresentation capability: three layers, one head -> two layers, two heads in layer one and one in layer twoHelped
train the reduced two-layer model with the two-stage gradient descent algorithmtwo-layer transformer · first-order Markov chainsexcess loss: ≲ \frac{\log(T + 1)}{(T + 1)^{c \gamma}}Helped
use ReLU and layer normalization in the intermediate MLP to construct the complementary context representationtwo-layer, single-head transformer · Markov-ICL, higher-order Markov processesrepresentation capabilityHelped
use layer normalization on the second-layer query and key projections instead of intermediate MLP layerstwo-layer, single-head transformer · Markov-ICL, any Markov order krepresentation capabilityNo clear effect
replace the three-layer, single-head construction with a two-layer construction using two first-layer headstransformer representation of conditional k-grams · Markov-ICL, any Markov order kdepth versus width: depth three, width one -> depth two, width twoMixed

Surprising findings

Limitations

Experimental setup

Datasets: synthetic random Markov chain sequences (Dirichlet prior over transition kernels)

Metrics: representation of conditional k-gram (theoretical) cross-entropy loss convergence bound attention pattern visualization

Baselines: three-layer single-head construction two-layer two-head construction single-layer transformer

Builds on: induction heads Markov-ICL three-layer construction relative positional encodings conditional k-gram model

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