atlas

Research map / Architectures and efficiency / Attention and transformers

Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformers

ICLR 2025 · Architectures and efficiency › Attention and transformers · approach: Attention head mechanisms · 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.

Introduces the retrieval problem requiring log-many transformer layers, shows LLMs solve it zero-shot, and uses reverse-engineering of small trained transformers to reveal stacked retrieval heads emerging one by one under an implicit curriculum.

Problem

Understanding how multi-layer transformers implement multi-step retrieval (chained induction) and how the required attention-head mechanism emerges during training.

Approach

Extends the induction-head task to D chained retrieval steps, proves a logarithmic lower bound on the number of layers needed, and shows that an implicit curriculum (predicting all intermediate chain tokens) is required for learning, with retrieval heads emerging sequentially starting from an induction head.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add an implicit curriculum to the training targets (ablation)Transformers trained on the minimal retrieval problem · Retrieval, D=3final validation loss: above 0.7Helped
increase the number of layersTransformers trained with IC · Retrieval, later chain positionspartial validation lossHelped
ablate the reverse-engineered circuit (ablation)Transformer D · Retrieval, D=4, IC validationmean squared error: 0.031 -> 0.045Hurt
replace attention maps according to the reverse-engineered circuits (ablation)Transformers A, B, and C · Retrieval validationmean squared error: increases slightly, but remains below 0.05Hurt
further ablate an apparently useful attention path (ablation)Transformers A, B, and C · Retrieval validationmean squared error: 0.17-0.89Hurt
replace the first useful layer's attention with uniform attention (ablation)First useful layers of Transformers A, B, and C · Retrieval validationmean squared error: 0.05-0.1Mixed
learn retrieval heads under the implicit curriculum in sequence, starting with an induction headTransformer D · Retrieval, D=4partial validation lossHelped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic retrieval problem sequences programmatically generated prompts for LLM benchmarking

Benchmarks: retrieval problem (5 prompt formulations, 500 questions each) synthetic retrieval validation MSE

Metrics: accuracy validation mean squared error partial validation loss attention score

Baselines: non-implicit-curriculum formulation

Builds on: induction head rotary positional encoding AdamW

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