CoChat

Transformers Represent Belief State Geometry in their Residual Stream

Open access
Shai, Adam, Marzen, Sarah, Teixeira, Lucas, Oldenziel, Alexander, Riechers, Paul · 2024 · Advances in Neural Information Processing Systems 37

The DOI matches its Crossref record; 26 of the 26 references it cites were found in a registry or an index; none of the 19 sources its claims cite is checked for support yet.

Abstract

What computational structure are we building into large language models when we train them on next-token prediction? Here, we present evidence that this structure is given by the meta-dynamics of belief updating over hidden states of the data-generating process. Leveraging the theory of optimal prediction, we anticipate and then find that belief states are linearly represented in the residual stream of transformers, even in cases where the predicted belief state geometry has highly nontrivial fractal structure. We investigate cases where the belief state geometry is represented in the final residual stream or distributed across the residual streams of multiple layers, providing a framework to explain these observations. Furthermore we demonstrate that the inferred belief states contain information about the entire future, beyond the local next-token prediction that the transformers are explicitly trained on. Our work provides a general framework connecting the structure of training data to the geometric structure of activations inside transformers.

Overview

CoChat Summary

TL;DR

Transformers trained on next-token prediction over HMM-generated data linearly encode the mixed-state presentation’s belief-state geometry in their residual stream, including highly nontrivial fractal geometries. This geometry can appear in the final residual stream or be distributed across layers, and it carries information beyond local next-token prediction.

Key findings

  • For the Mess3 process, a 2D subspace of the 64-dimensional final residual stream linearly matches the ground-truth fractal belief-state geometry; MSE was 0.0003 after LayerNorm versus 0.0004 before LayerNorm.
  • For the RRXOR process, the 36 belief states in a 4-simplex are not represented in the final residual stream, but are veridically represented when residual activations from all layers are concatenated; individual layers do not suffice.
  • Pairwise distances in transformer belief-state representations correlate with ground-truth belief-state distances for RRXOR (R² = 0.95) more than with next-token probabilities (R² = 0.31), while Mess3 next-token structure is preserved.
  • The geometry emerges gradually during training, lower MSE correlates with lower validation loss, and cross-validation using 20% of input-activation pairs still recovers the geometry; shuffled labels collapse to the simplex center.

Methods

  • Data were generated from edge-emitting hidden Markov models, primarily Mess3 (3 hidden states, vocabulary {A, B, C}) and RRXOR (36 MSP states, 4-simplex), with Z1R as an illustrative example.
  • Transformers used context window 10, ReLU, head dimension 8, model dimension 64, 1 attention head in each of 4 layers, MLP dimension 256, causal attention masking, and LayerNorm; training used SGD with batch size 64, 1,000,000 epochs, learning rate 0.01, no weight decay, and 64 sequences per batch from the HMM stationary initial state.
  • Residual stream activations were recorded at all context positions, labeled by ground-truth belief states from the MSP, and fit with an affine map \(b \approx W a + c\) via linear regression minimizing MSE; controls included 20%/80% cross-validation and shuffled-label analyses repeated 1000 times.

Limitations

  • Stated in the paper: experiments are small-scale, using HMMs with only 3–5 states and vocabularies of 2–3 tokens; the stationary ergodic setting is assumed; realistic systems would have belief-state simplex dimensions exceeding the residual stream, requiring unknown compression; computing ground-truth MSPs becomes intractable as generator size and context length grow; and the work did not directly test whether the representations implement Bayesian updating circuits.
  • Evident from the text: validation is limited to synthetic HMM-generated data rather than natural language or other real-world sources, and linear regression establishes representational correspondence, not causal use of the belief-state geometry.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.52202/079017-2387

Cites

26 of 26 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Verification

Claims the paper makes

0 Valid · 1 Not valid · 16 Not checked · 58 Own results and interpretations

34 more claims

Create a free account to see all 75 claims and every source verdict.

See all claims — free account
  • It may state two separate claims as one. 12
  • Probably not a substantial claim. 28
  • The quote only partly states this claim. 1

Create a free account to see these claims.

Citations

Cites

Show all 26 references

Research works printed but not linked: 4

  1. Lukasz Debowski. Information theory meets power laws: Stochastic processes and language models. John Wiley & Sons, 2020.
  2. Wolfgang Löhr. Predictive models and generative complexity. Journal of Systems Science and Complexity, 25:30-45, 2012.
  3. Sarah E Marzen and James P Crutchfield. Nearly maximally predictive features and their dimensions. Physical Review E, 95(5):051301, 2017.
  4. D. R. Upper. Theory and Algorithms for Hidden Markov Models and Generalized Hidden Markov Models. PhD thesis, University of California, Berkeley, 1997. Published by University Microfilms Intl, Ann Arbor, Michigan.

Cited by

See all 35

Metadata

Authors
Shai, A., Marzen, S., Teixeira, L., Oldenziel, A., & Riechers, P.
Venue
Advances in Neural Information Processing Systems 37
Published
2024
Pages
75012-75034
ISSN
1049-5258 (ISSN-L)
OpenAlex
W4415797094
Cited by
4
References
16
Citations by year
2026: 2 · 2025: 2
FWCI
1.17
Type
conference paper
Language
en
Open access
Locations
  • neural information processing systems (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Artificial Intelligence › Logic, Reasoning, and Knowledge
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
Keywords
residual stream, transformer models

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

A language model drew the claims from the paper on 2026-11-01, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).

A second model labelled each claim on 2026-11-01 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

How to cite

Cite CoChat for the checks on this page, and the paper for its own findings.

This page
CoChat. (2026). Citation check: Transformers Represent Belief State Geometry in their Residual Stream. https://app.cochat.ai/papers/10.52202/079017-2387
The paper
Shai, A., Marzen, S., Teixeira, L., Oldenziel, A., & Riechers, P. (2024). Transformers Represent Belief State Geometry in their Residual Stream. Advances in Neural Information Processing Systems 37. https://doi.org/10.52202/079017-2387

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.