atlas

Research map / Architectures and efficiency / Attention and transformers

Grokking of Implicit Reasoning in Transformers: A Mechanistic Journey to the Edge of Generalization

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and learnability · 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.

Trains GPT-2-style transformers from scratch on synthetic knowledge graphs to study implicit composition and comparison, showing grokking enables ID generalization and mechanistic circuits explain OOD (systematicity) differences.

Problem

Whether transformers can learn implicit reasoning over parametric knowledge (composition and comparison), which LLMs struggle with, and what mechanisms govern its generalization and systematicity.

Approach

Controlled synthetic data with atomic and inferred facts lets the authors show implicit reasoning emerges only via grokking, that the inferred/atomic ratio (not data size) drives grokking speed, and that the generalizing circuit configuration (cross-layer storage for composition vs parallel retrieval for comparison) determines OOD systematicity.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train the vanilla Transformer far beyond training-set saturationVanilla Transformer on composition · Composition test_inferredIDaccuracy: 9.2% before extended training; approaches almost perfect accuracy after extended optimizationHelped
Train the vanilla Transformer for longerVanilla Transformer on composition · Composition test_inferredOODaccuracy: zeroNo clear effect
Increase the inferred-to-atomic fact ratio (ablation)Vanilla Transformer on composition · Composition test_inferredIDgeneralization speedHelped
Increase training data size while holding the inferred-to-atomic ratio fixed (ablation)Vanilla Transformer on composition · Composition test_inferredIDgeneralization behaviorNo clear effect
Increase weight decay (ablation)Vanilla Transformer on composition · Composition test_inferredIDgeneralization speedHelped
Share parameters between the first 4 and last 4 layers (ablation)Transformer on composition · Composition test_inferredOODaccuracyHelped
Scale up the Transformer (ablation)Transformer on composition · Composition test_inferredIDgeneralization behaviorNo clear effect
Increase entity token multiplicity (ablation)Transformer on composition · Composition test_inferredIDgeneralization speedHurt
Increase the inferred-to-atomic fact ratio (ablation)Vanilla Transformer on comparison · Comparison test (ID)generalization speedHelped
Use chain-of-thought prompting instead of direct answeringGemini-Pro-1.5 on the complex reasoning task · Complex reasoning task (OOD test)accuracy (%): 37.3 -> 12.0Hurt
Add retrieval augmentation to Gemini-Pro-1.5 direct answeringGemini-Pro-1.5 on the complex reasoning task · Complex reasoning task (OOD test)accuracy (%): 28.7 -> 37.3Helped
Add retrieval augmentation to Gemini-Pro-1.5 chain-of-thought answeringGemini-Pro-1.5 on the complex reasoning task · Complex reasoning task (OOD test)accuracy (%): 11.3 -> 12.0Helped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic knowledge graph composition facts synthetic attribute comparison facts

Benchmarks: synthetic composition ID/OOD test sets synthetic comparison ID/OOD test sets complex reasoning task (OOD entity comparison)

Metrics: accuracy mean reciprocal rank causal strength Recall@3

Baselines: GPT-4-Turbo Gemini-1.5-Pro

Builds on: grokking (Power et al.) circuit efficiency logit lens causal tracing Universal Transformer

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