Reference. Transformers Use Causal World Models in Maze-Solving Tasks
Recent studies in interpretability have explored the inner workings of transformer models trained on tasks across various domains, often discovering that these networks naturally develop highly structured representations. When such representations comprehensively reflect the task domain’s structure, they are commonly referred to as “World Models” (WMs). In this work, we identify WMs in transformers trained on maze-solving tasks. By using Sparse Autoencoders (SAEs) and analyzing attention patterns, we examine the construction of WMs and demonstrate consistency between SAE feature-based and circuit-based analyses. By subsequently intervening on isolated features to confirm their causal role, we find that it is easier to activate features than to suppress them. Furthermore, we find that models can reason about mazes involving more simultaneously active features than they encountered during training; however, when these same mazes (with greater numbers of connections) are provided to models via input tokens instead, the models fail. Finally, we demonstrate that positional encoding schemes appear to influence how World Models are structured within the model’s residual stream.
Cite
Cited by (1)
maze-dataset: Maze Generation with Algorithmic Variety and Representational Flexibility ivanitskiy-2025-maze
Cites 28 works (1 here)
With notes (1)
A Configurable Library for Generating and Manipulating Maze Datasets ivanitskiy-2023-a
Understanding how machine learning models respond to distributional shifts is a key research challenge. Mazes serve as an excellent testbed due to varied generation algorithms offering a nuanced platform to simulate both subtle and pronounced distributional shifts. To enable systematic investigations of model behavior on out-of-distribution data, we present , a comprehensive library for generating, processing, and visualizing datasets consisting of maze-solving tasks. With this library, researchers can easily create datasets, having extensive control over the generation algorithm used, the parameters fed to the algorithm of choice, and the filters that generated mazes must satisfy. Furthermore, it supports multiple output formats, including rasterized and text-based, catering to convolutional neural networks and autoregressive transformer models. These formats, along with tools for visualizing and converting between them, ensure versatility and adaptability in research applications.
External (27)
- Measuring Progress in Dictionary Learning for Language Model Interpretability with Board Game Models (2024)
- Evidence of Learned Look-Ahead in a Chess-Playing Neural Network (2024)
- A Philosophical Introduction to Language Models - Part II: The Way Forward (2024)
- Emergent World Models and Latent Variable Estimation in Chess-Playing Language Models (2024)
- Dictionary Learning Improves Patch-Free Circuit Discovery in Mechanistic Interpretability: A Case Study on Othello-GPT (2024)
- A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning Task (2024)
- Future Lens: Anticipating Subsequent Tokens from a Single Hidden State (2023)
- Evaluating Cognitive Maps and Planning in Large Language Models with CogEval (2023)
- Sparse Autoencoders Find Highly Interpretable Features in Language Models (2023)
- Does Circuit Analysis Interpretability Scale? Evidence from Multiple Choice Capabilities in Chinchilla (2023)
- Eliciting Latent Predictions from Transformers with the Tuned Lens (2023)
- Linearly Structured World Representations in Maze-Solving Transformers (2023)
- Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Task (2022)
- Toy Models of Superposition (2022)
- Toward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networks (2022)
- Sparse Relational Reasoning with Object-Centric Representations (2022)
- In-context Learning and Induction Heads (2022)
- Acquisition of chess knowledge in AlphaZero (2021)
- RoFormer: Enhanced Transformer with Rotary Position Embedding (2021)
- A mathematical framework for transformer circuits (2021)
- Emergent linguistic structure in artificial neural networks trained by self-supervision (2020)
- A Structural Probe for Finding Syntax in Word Representations (2019)
- Attention is All you Need (2017)
- Understanding intermediate layers using linear classifier probes (2016)
- Actually, othello-gpt has a linear emergent world representation
- Anthropic circuits Updates - January
- Towards monosemanticity: Decomposing language models with dictionary learning