From States to Dynamics: Detecting Rule Violations in OthelloGPT
Authors: David L. Cao, Sai Sumedh R. Hindupur, Demba Ba
Organizations: Harvard College, Harvard University, Cambridge, MA 02138 · School of Engineering and Applied Sciences, Harvard University, Cambridge, MA 02138 · School of Engineering and Applied Sciences, Kempner Institute, Harvard University, Cambridge, MA 02138
Sequence models trained on game moves have been shown to encode world models, with structured linear probes revealing the underlying game states. World models, however, are inherently dynamic: in deterministic board games, a set of rules constrain how states evolve over time. We therefore ask if and how OthelloGPT, a transformer trained only on Othello move sequences, manifests the rules of the game in its activation space. We divide the rules of Othello, and symmetrically their violations, into three classes: placing a disc on an empty square (R1), flanking an opponent's disc (R2), and moving in turn (R3). We find that linear probes accurately separate legal from illegal moves, and also distinguish between the three kinds of rule violations. We introduce an unsupervised rule-violation detector based on the step length of activations between consecutive moves, which identifies illegal moves above chance. We further improve our detection metric by computing step length in the latent space of select sparse autoencoders. Together, we find that OthelloGPT follows game rules of Othello to a large extent, and that we can detect rule violations using structured detectors on model activations.
Figures & tables
Figure 1: OthelloGPT largely follows the rules of Othello. (a) Board state from a randomly chosen game at move t=16 , with black to move, illustrating a legal move and the three classes of rule violations (R1, R2, R3). (b) Next-token probability of generating an illegal move at move t , separated by violation class and averaged over n=1000 games. This probability remains low throughout the game, reaching 7.1% at t=58 , indicating that OthelloGPT generally generates moves consistent with the rules of Othello.
Figure 2: Rule violations can be distinguished using linear probes. (a) 2D Multidimensional Scaling (MDS) visualization of linear probe directions (ring is linear probe direction, point is re-fitted probe per square) of the five classes (legal, illegal, R1, R2, and R3) (b) Cosine similarity matrix between the five probe directions. Illegal moves are anti-correlated with legal moves, and illegal classes are also anti-correlated with each other. (c) AUROC of linear probes for distinguishing each class. Performance is highest for distinguishing legal from illegal moves and lowest for distinguishing legal from R1 violations.
Figure 3: Step-length metric detects rule violations in residual stream activations. (a) Example Othello game centered at t0=20 , where an R2 violation occurs; the metric correctly classifies 4/5 moves in the displayed window. (b) The detection metric computed from residual stream activations peaks at the illegal move t0 . (c) AUROC for detecting {illegal,R1,R2,R3} against {legal} exceeds the random baseline of 0.50 for all violation classes. (d) Despite this separation, the metric distributions show substantial overlap between legal moves and illegal moves, including each rule-violation class.
Figure 4: Detecting rule violations in SAE latent space. (a) AUROC of the detector applied in the latent spaces of eight SAE architectures. Several SAE representations outperform the raw residual stream, with GatedSAE achieving the highest AUROC ( ∼0.75 ) for distinguishing illegal from legal moves. (b) Less overlap in the distribution of the metric between legal moves and illegal moves is observed for GatedSAE latent space as opposed to that of residual stream activations (see Figure 3 ).
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: Accuracy of linear probe trained on Othello board state over each residual stream layer of OthelloGPT. A linear probe classifies each of the 64 squares on the board as {empty,mine,theirs} from the residual stream activations after each block ℓ∈{0,…,7} , scored on n=1000 held-out games ( 58,000 positions).
Figure 6: Hyperparameter sweep of each SAE architecture used in this work across sparsity L0 . Every point is one trained dictionary at expansion factor 16 ( 8192 latents) on layer- 5 activations, scored with Karvonen’s board-game suite [ 17 ] ; all four panels share the x -axis L0 , clipped to [0,400] , and marker shape denotes the architecture. (a) Loss recovered (fidelity) against L0 , each point colored by its coverage of the Othello board state. (b) Coverage of the Othello board state against L0 . (c) As in (a), each point colored by its board state reconstruction F1 . (d) Board state reconstruction F1 against L0 .
Figure 7: Concrete example of OthelloGPT following the rules. (a) Randomly chosen game, board state at move t=25 , white to move. ‘m’ denotes move t=26 , ‘s’ denotes the opponent’s flanked disc, and ‘ m′ ’ denotes the matched control move. (b) Tensor product probe (TPR) on the board state of Othello. The y-axis indicates whether or not a square is occupied, and the x-axis indicates OthelloGPT’s understanding of the relative disc color ( mine versus their directions). The TPR shows that OthelloGPT updates its internal board representation in accordance with the flanking rule, changing the represented color of the flanked disc after the move.
Figure 8: Step length performs the best compared to the other rule violation detection metrics we tested. AUROC comparing three rule violation detection metrics – step length d , representation norm ∥z∥ , and turning angle θ – in residual stream activations and in the SAE latent activations , averaged over n=500 games.