atlas

Research map / Large language models / Reasoning and chain of thought

Iteration Head: A Mechanistic Study of Chain-of-Thought

NeurIPS 2024 · Large language models › Reasoning and chain of thought · approach: Chain-of-thought training and analysis · 3 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.

Studies how chain-of-thought emerges in small two-layer transformers trained on synthetic iterative tasks (copy, parity, polynomial iteration), identifying an "iteration head" attention circuit and showing skill transfer via pretraining on another iterative task.

Problem

Why and how transformers trained with next-token prediction acquire chain-of-thought abilities for multistep iterative reasoning remains poorly understood, and single-token prediction is limited for such tasks.

Approach

Proposes an "iteration head": a two-layer attention circuit in which the first head locates the end-of-input token and the second retrieves the t-th input token by positional subtraction, letting the MLP compute the successor state from generated CoT tokens; shows it emerges in small transformers and can be transferred via data curation (pretraining on polynomial iteration speeds parity learning).

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Pretrain on polynomial iteration for 200 epochs, then train on parityTwo-layer transformer · Parityepochs to learn: less than 300 epochs vs 1000 epochsHelped
Fine-tune only the second-layer MLP on parity after training on copyingTwo-layer transformer with one attention head per layer · Parityaccuracy: 100%Helped
Use chain-of-thought instead of next-token prediction (ablation)Two-layer transformer · Polynomial iteration, P(X, Y) = XY + 1 in F_11test accuracyHelped
Use a two-layer transformer instead of a one-layer transformer (ablation)Transformer trained with CoT · Polynomial iteration, P(X, Y) = XY + 1 in F_11test accuracyHelped
Remove CoT and use next-token prediction (ablation)Transformer · Parity, sequence lengths up to L_max = 32 and embedding dimension d = 32test accuracyHelped
Use a one-layer transformer with CoT instead of the iteration-head two-layer architecture (ablation)Transformer · Paritytest accuracyNo clear effect
Reduce the embedding dimension (ablation)Two-layer transformer · Polynomial iterationtest accuracyHurt
Patch in the ideal attention maps (ablation)Transformer implementing an iteration head · Iterative tasksaccuracyNo clear effect
Remove the first attention head's focus on EoI (ablation)Transformer implementing an iteration head · Iterative tasksaccuracyHurt
Remove the second attention head's focus on p_t (ablation)Transformer implementing an iteration head · Iterative tasksaccuracyHurt
Freeze the positional embedding (ablation)Transformer trained on parity · Parityiteration-head learningNo clear effect
Train on parity alone instead of first training on polynomial iteration (ablation)Two-layer transformer · Parityepochs to learn: less than 300 epochs vs 1000 epochsHurt

Surprising findings

Limitations

Experimental setup

Datasets: synthetic binary copy synthetic parity synthetic polynomial iteration XY+1 in F_11

Benchmarks: synthetic copy, parity, and polynomial iteration test sets

Metrics: test accuracy attention peakiness score

Baselines: next-token prediction without CoT single-layer transformer with CoT

Builds on: transformer Adam

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