Transformers Linearly Represent Highly Structured World Models
By training a transformer on Sudoku solving traces, the study reveals that the model internally constructs a structured world model aligned with the domain's constraint algebra rather than surface features, utilizing sparse, interpretable circuits like a "naked-single" detector to solve the task.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you hire a brilliant but mysterious apprentice to learn how to solve Sudoku puzzles. You don't teach them the rules directly; instead, you just show them thousands of examples of someone else solving puzzles step-by-step. After a while, the apprentice gets really good at solving them.
But here's the big question: How does the apprentice's brain actually work? Do they see the puzzle as 81 individual empty squares, or do they see it as a set of interconnected rules?
This paper investigates exactly that by "opening up" a computer model (a Transformer) trained on Sudoku. The researchers found three surprising things about how this model thinks.
1. The "Team Captain" vs. The "Individual Worker"
Most people assume that if you show a model a Sudoku grid, it will learn to track every single cell (the little boxes) individually, like a worker checking off 81 separate items on a list.
The Paper's Finding: The model doesn't do that. Instead, it organizes its thinking around groups.
Think of a Sudoku puzzle not as 81 boxes, but as three types of teams:
- The Row Team (9 horizontal lines)
- The Column Team (9 vertical lines)
- The Box Team (9 small 3x3 squares)
The model builds a "world model" where it tracks what numbers are present in these teams, not just in individual boxes. It's as if the apprentice stopped looking at individual bricks and started looking at the walls, floors, and ceilings. The researchers found that the model is perfect at answering, "Is the number 5 in the top row?" but only about 80% accurate at guessing, "What number is in this specific box?"
Why? Because in Sudoku, a number's validity depends on the group it belongs to, not the box itself. The model learned to think in terms of the rules (the algebra), not the surface appearance (the grid).
2. The "Traffic Controllers" in the Middle
The model has 8 layers of "thinking" steps. The researchers looked at the middle layers to see how information flows.
The Paper's Finding: They discovered specific "traffic controllers" (called attention heads) that act like specialized managers for each team.
- One manager only looks at Row 4.
- Another only looks at Box 5.
- Another only looks at Column 2.
These managers have a very simple job: The "No-Go" Signal.
If a number (say, a 7) is already in Row 4, this manager immediately puts a "Do Not Use" sign on the number 7 for every empty spot in that row. They don't just ignore it; they actively suppress the idea of using it. This happens simultaneously for all rows, columns, and boxes, creating a clean list of what can be used.
3. The "Lightbulb Moment" Neurons
Finally, the researchers looked at the very last step before the model makes a move. This is where the model decides, "Okay, I'm going to put a 7 here."
The Paper's Finding: They found a tiny, specific group of neurons (only 91 of them) that act like Lightbulbs.
- These lightbulbs only turn on when a specific cell has exactly one possible number left (a situation called a "Naked Single").
- When the lightbulb turns on, it doesn't just say "7 is good." It shouts, "Hey, this whole cell is solved!" and boosts the confidence for all numbers in that cell equally.
- Because the middle layers had already done the hard work of eliminating the wrong numbers, the "correct" number was already the top choice. The lightbulb just gives it a final, massive push to ensure the model commits to that answer.
The Big Picture
The paper concludes that this AI didn't just memorize patterns; it built an internal map that perfectly matches the logic of the puzzle.
- It doesn't see a grid; it sees constraints.
- It doesn't guess randomly; it uses specialized managers to enforce rules.
- It doesn't hesitate; it has dedicated switches to lock in the answer when the logic is clear.
The researchers proved this by "breaking" the model: when they turned off the "Row Managers," the model started suggesting numbers that were already in that row. When they turned off the "Lightbulb Neurons," the model got confused about which number to pick, even though it knew the answer was there.
In short, the AI learned to solve Sudoku the way a human expert does: by understanding the rules of the game, not just by looking at the empty squares.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.