Transformers Use Causal World Models in Maze-Solving Tasks

Alex F. Spies, William Edwards, Michael I. Ivanitskiy, Adrians Skapars, Tilman Räuker +3 more
12/16/2024
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

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.

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{spies2024transformers,
  title  = {Transformers Use Causal World Models in Maze-Solving Tasks},
  author = {Alex F. Spies and William Edwards and Michael I. Ivanitskiy and Adrians Skapars and Tilman Räuker and Katsumi Inoue and Alessandra Russo and Murray Shanahan},
  year   = {2024},
  eprint = {2412.11867},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.11867v2}
}

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/2412.11867.svg)](https://codeofpaper.com/paper/2412.11867)

Discussion