Transformers Linearly Represent Highly Structured World Models

Roman Kniazev, Nathanaël Fijalkow
5/13/2026
cs.LGcs.AI
transformer-attention

No confident code implementation found for this paper.

Abstract

Do transformers, when trained on sequential reasoning traces, build internal models of the underlying task? And if so, does the structure of those internal representations mirror the structure of the domain?

Show full abstract

We train an 8-layer transformer on Sudoku solving traces and perform a mechanistic analysis of its internal computation. We establish two results. First, the model builds a substructure world model: it does not represent the board state cell by cell, as a human analyst would expect, but organizes information around the rows, columns, and boxes that Sudoku's constraints act on. Second, we identify a naked-single circuit: a small set of dedicated neurons in the final MLP layer, each individually detecting when exactly one digit remains possible for a specific cell, and reliably promoting that digit. These findings show that the geometry of an emergent world model is shaped by the constraint algebra of the domain, not its surface presentation, and that the resulting decision circuit is sparse, monosemantic, and fully interpretable. More broadly, they demonstrate that mechanistic interpretability tools can recover an end-to-end algorithmic account of how a transformer solves a combinatorial reasoning task.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kniazev2026transformers,
  title  = {Transformers Linearly Represent Highly Structured World Models},
  author = {Roman Kniazev and Nathanaël Fijalkow},
  year   = {2026},
  eprint = {2605.18847},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.18847v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.18847.svg)](https://codeofpaper.com/paper/2605.18847)

Discussion