TL;DR
This paper investigates how simple transformer models trained on the game Othello develop internal "world models." They discover that these models learn a surprisingly linear representation of the game board state, and crucially, that this linear representation is causally used by the model to make its next move, particularly in the middle layers.
What Problem Does This Paper Address?
A central question in AI research is whether large foundation models truly "understand" the world or if they are merely sophisticated pattern matchers. This paper delves into this by examining the internal representations within transformer models trained on a specific task: playing Othello. The goal is to understand if these models develop interpretable "world models" that go beyond surface-level correlations, and if these internal models are actually used in a causal way to drive decision-making.
Methods
The researchers trained several transformer models of varying sizes (from 1 to 8 layers) on a synthetic Othello dataset. They then employed two primary techniques:
- Linear Probes: These are simple linear classifiers trained to map the internal activations of a specific layer in the Othello model to a representation of the game board state (e.g., which squares are "yours," "mine," or "empty"). This helps determine if the board state is encoded linearly within the model's activations.
- Causal Interventions: This is a more sophisticated technique where the researchers directly manipulate the activations of a layer. They use the linear probe to identify the activation corresponding to a specific board state, then change that activation to represent a different board state. By observing how this manipulation affects the model's subsequent move prediction, they can infer whether the learned world representation is causally influencing the model's decisions.
Datasets
The models were trained on a "synthetic Othello dataset" consisting of over 20 million simulated games where legal moves were played, but without sophisticated strategy. A validation set of 500 game sequences was used for benchmarking.
Key Insights and Ideas
- Linearity is Key: Even very small transformer models (as few as 1 layer and 1 attention head) can learn to play Othello legally and, more surprisingly, encode the board state linearly within their activations. This challenges the notion that complex world models require massive architectures.
- Causal Influence: The learned linear world representation isn't just descriptive; it's actively used by the model to make decisions. Intervening on this representation can directly alter the model's predicted moves, demonstrating a causal link.
- Middle Layers Matter Most: The causal influence of the linear world model is most pronounced in the middle layers of the transformer. This suggests that information processing and integration for decision-making are concentrated in these layers, rather than solely at the input or output.
- Emergence of "Yours" and "Mine": Specific attention heads within the models learn to track pieces belonging to "you" and "your opponent" ("mine" and "theirs"). These heads emerge even in shallow models and contribute to the linear board representation.
Key Results
- Even a 1-layer Othello-GPT model achieves ~95% legal move prediction accuracy. Larger models reach over 99%.
- Linear probes can decode the "Yours, Mine, Empty" board representation with near-perfect accuracy (up to 99.5%) in the deeper layers of the 8-layer model.
- Causal interventions show that the linear world model is causally used for decision-making, particularly in the middle layers (layers 3-6) and earlier in the game. The influence of these interventions diminishes in the later layers.
Limitations and Future Work
- Shallow vs. Deep: While shallow networks (1-layer) can represent the board state linearly, they don't appear to use this representation causally for decision-making. This suggests a minimum complexity is needed for causal utilization.
- Game Tree Shrinking: The authors hypothesize that in late-game scenarios, the model might rely more on "surface statistics" as the game tree becomes simpler, explaining why causal interventions are less effective then.
- Future Work: The authors suggest using mechanistic interpretability tools to understand the specific "circuits" within the transformer that implement this decision-making process and to further break down how the model arrives at its choices. They also aim to explore how these findings generalize to other tasks and larger models.
Summary updated