atlas

Research map / Architectures and efficiency / Attention and transformers

Transformers on Markov data: Constant depth suffices

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Transformer block and depth design · 1 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 empirically that small fixed-depth 1-head transformers learn k-th order Markov chains for large k, and theoretically that a 3-layer 1-head transformer with layer norm can represent the in-context conditional k-gram, while attention-only models need log-depth or many heads.

Problem

Prior work suggested low-depth transformers need the number of heads to scale linearly with the Markov order k to learn k-th order Markov processes in-context; the paper asks how depth, heads, and non-linearity interact in representing k-th order Markov sources.

Approach

Builds a constant-depth construction in which layer normalization acts as an L2-normalizer, turning dyadic-sum encodings of the last k symbols into a unit vector so that a softmax-based attention can match k-length histories in a single head; attention-only models need O(log k) layers, and lower bounds are proven under an input-independent attention assumption.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use a 2-layer, 1-head transformerTransformer trained on random Markov data · Order-4 Markov datatest lossHelped
Use a 3-layer, 1-head transformerTransformer trained on random Markov data · Order-8 Markov datatest lossHelped
Add layer normalization and feedforward nonlinearityTransformer representing conditional k-grams · k-th order Markov datarepresentation of conditional k-gramsHelped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic k-th order Markov sequences (Dirichlet(1) prior)

Benchmarks: synthetic k-th order Markov sources (gap to optimal test loss)

Metrics: test loss gap to optimal (Bayes) loss

Baselines: 2-layer attention-only transformer with k heads Bayes-optimal conditional k-gram estimate

Builds on: induction heads conditional k-gram (Bayes-optimal in-context estimator)

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