atlas

Research map / Architectures and efficiency / Attention and transformers

(How) Do Language Models Track State?

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

Studies how transformer LMs fine-tuned on permutation composition (S3/S5 word problems) implement state tracking, finding they consistently learn either an associative-scan mechanism (AA) or a parity-then-associative mechanism (PAA), and that intermediate parity training can steer which one is learned.

Problem

How transformer language models track unobserved state, using permutation composition (word problems on S3 and S5) as a model system for state tracking in general.

Approach

Combines theoretically derived algorithm signatures (sequential, parallel, associative, parity-associative) with activation patching, probing, attention analysis, and training dynamics to show LMs consistently learn either an associative-scan mechanism or a parity-heuristic-plus-associative-scan mechanism, and that intermediate tasks (parity prediction, topic-model NTP) can steer which is learned.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
learn an associative algorithm rather than a parity-associative algorithmlanguage models trained on permutation composition · S3 and S5, held-out sequence lengthsstate generalizationHelped
learn an associative algorithm rather than a parity-associative algorithmlanguage models trained on permutation composition · S3 and S5, trainingconvergence speedHelped
train from scratch with a topic-modeling next-token-prediction task before S3 trainingrandomly initialized language models · S3AA mechanism emergenceHelped
train on state parity before the S3 objectiveGPT-2 and Pythia trained from scratch · S3PAA mechanism emergenceHelped
train on state parity before the S3 objectivePile-pretrained Pythia models · S3PAA mechanism emergenceHelped
fine-tune on random S3 next-token-prediction documentslanguage models · S3ratio of AA and PAA mechanismsNo clear effect
use PAA rather than AAlanguage models trained on permutation composition · S3 and S5, held-out sequence lengthsstate accuracy cutoff lengthHurt
use PAA rather than AAlanguage models trained on permutation composition · S3 and S5, held-out sequence lengthsparity versus state accuracy cutoff lengthMixed
pre-train Pythia on the Pile before natural-language permutation trainingPythia · Natural-language S3 permutation compositionparity representation depthHelped
use pre-trained rather than non-pre-trained PythiaPythia · Natural-language S3 permutation compositionstate computation depthHelped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic S3 permutation composition sequences synthetic S5 permutation composition sequences The Pile topic-model-generated S3 documents natural language swap/rotate permutation sequences

Benchmarks: synthetic S3 permutation composition synthetic S5 permutation composition natural language permutation composition

Metrics: state accuracy parity accuracy normalized logit difference probe accuracy cutoff length parity head score

Baselines: sequential algorithm parallel algorithm

Builds on: Pythia GPT-2 activation patching associative scan theory of Transformers

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