atlas

Research map / Architectures and efficiency / Attention and transformers

How Transformers Learn Causal Structure with Gradient Descent

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and learnability · 5 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 theoretically that a two-layer attention-only (disentangled) transformer trained by stage-wise gradient descent learns the causal (induction-head-style) structure of Markov chain sequences, approximately minimizing loss.

Problem

How transformers learn causal structure in sequences via gradient-based training, i.e., the optimization dynamics that lead attention to recover the parent (previous-token / DAG) structure needed for in-context next-token prediction.

Approach

Introduces a disentangled transformer (attention outputs appended to the residual stream) and a reduced two-layer model, then proves that a three-stage gradient descent schedule on population loss drives the first-layer position attention to the shift (induction-head) matrix, with the second layer growing to reduce loss; also generalizes to random DAG causal structures and multiple parents.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train the reduced two-layer transformer with three-stage gradient descentReduced two-layer transformer · Random sequences with causal structureexcess cross-entropy loss: L(\hat \theta) - L^* \lesssim_{\gamma,\lambda} \frac{S}{T^{1/4}}Helped
Represent each node's parent in the first attention layerDepth-two multiple-head transformer · Random sequences with a general causal DAGexcess cross-entropy loss: L(\hat \theta) - L^* = o_T(1)Helped
Use 2k first-layer heads to copy the k parent tokens and match parent contextsTwo-layer transformer · Sequences with k-parent causal structuretransition probability estimateHelped

Limitations

Experimental setup

Datasets: synthetic Markov chain sequences with causal DAG structure

Metrics: population cross-entropy loss gap to optimal

Builds on: induction head tracr

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