Automatically Finding Rule-Based Neurons in OthelloGPT

Aditya Singh, Zihang Wen, Srujananjali Medicherla, Adam Karvonen, Can Rager

TL;DR

Can we automatically reverse-engineer how a neural network reasons about the rules of a game? This paper introduces an automated framework using decision trees to identify and interpret individual neurons in OthelloGPT that implement discrete, human-readable logic. Through targeted interventions, the authors prove that these decision trees faithfully capture causal, rule-based circuits—revealing that roughly half of the neurons in layer 5 act as compact logical rule detectors.

What Problem Does This Paper Address?

A central goal of mechanistic interpretability is to build human-interpretable "replacement models" that explain a neural network's computations. However, researchers are caught between two extremes: hand-crafted toy networks (like Tracr), which don't reflect how gradient descent naturally structures models, and large language models (LLMs), which are too vast and lack unambiguous ground-truth internal concepts.

OthelloGPT—a 25-million parameter transformer trained autoregressively to predict legal moves from move histories—offers an ideal middle ground. Prior work revealed that it constructs an internal linear model of the board and possesses specialized neurons detecting moves. However, finding and interpreting these rule-based neurons has largely relied on manual reverse-engineering. This paper automates the discovery, extraction, and verification of rule-based logic inside OthelloGPT.

Methods

The authors' pipeline automates the translation of raw neuron activations into human-readable logical formulas:

  1. Training Decision Trees: For each MLP neuron, they train a depth-4 regression decision tree (mapping board state features, previous moves, and flipped tiles directly to activation values) alongside binary classification trees (predicting whether a neuron is "on" or "off").
  2. Logical Rule Extraction (DNF): High-activation paths through each tree are extracted into Disjunctive Normal Form (DNF; an OR-of-ANDs formula). The authors apply logical simplifications to make the rules compact and human-readable (e.g., combining NOT theirs and NOT empty into mine).
  3. Automated Neuron Querying: Given any game-rule query (such as "Is C0 blank AND D1 theirs AND E2 mine?"), the tool evaluates which neurons' DNF formulas evaluate to True.
  4. Validation Metrics & Interventions: Decision trees are compared against sparse linear models (Lasso) and rule-induction baselines (RIPPER) using $R^2$, F1 scores, and alignment with linear probe features (Containment and Jaccard metrics). Finally, they conduct layer-wise surrogate substitutions and fine-grained causal ablation experiments.
Board State Features ──► Depth-4 Decision Tree ──► High-Activation Paths ──► Simplified DNF Rules
                                                                                   │
                                                         Query: "(D1 empty) AND (E2 theirs)..."
                                                                                   ▼
                                                                     Surface Implementing Neurons

Datasets

  • Training/Validation Data: Games generated by uniform-random legal play in Othello.
  • Decision Tree Training: Evaluated scaling behavior from 60 to 30,000 games, finding that performance plateaus near 6,000 games, which was used for main experiments.
  • Evaluation Sets: A 500-game test set was used for evaluating tree accuracy and fine-grained ablations. A 50,000-game training / 10,000-game test set was used for probe uniqueness experiments.
  • Open Benchmark: The authors open-sourced their dataset of extracted rules and a Python tool mapping Othello game rules to specific neurons.

Key Insights and Ideas

  • Logic vs. Linear Features: Decision trees significantly outperform Lasso regression and RIPPER, indicating that these neurons implement compositional, discrete boolean boundaries rather than continuous, linear feature combinations.
  • Functional Separation Across Depth: Layers 0–4 primarily construct distributed representations of board state, whereas layers 5 and 6 house modular "valid-move" classifier neurons that evaluate whether rules are satisfied.
  • Decision Trees Are Faithful Surrogates: Replacing layer 5–6 neurons with their decision-tree predictions leaves OthelloGPT's valid-move accuracy intact and keeps output KL divergence low. In contrast, zero-ablating or mean-ablating those same neurons causes severe performance collapse.
  • Directional Specificity: Ablating neurons identified as detecting a specific capture direction (e.g., diagonal) selectively degrades the model's confidence for that move along that pattern while leaving alternative valid paths (e.g., vertical) mostly unharmed.

Key Results

  • High Rule Coverage in Late Layers: In layer 5, 913 out of 2,048 neurons (~45%) achieve an $R^2 > 0.7$ when modeled with compact, depth-4 regression trees.
  • Feature Alignment: Decision trees recovered features discovered via weight-based direct linear attribution (DLA) with significantly higher containment and Jaccard similarity than Lasso or RIPPER baselines across all layers.
  • Causal Ablation Disruption:
  • Across all 60 playable squares, zero-ablating pattern-specific neurons dropped the target square's probability nearly 2× more in intervention conditions than in control conditions.
  • When excluding the central $4\times 4$ board region (where shared patterns introduce noise), target probability collapsed below 1% of its original value ~10× more frequently under intervention than control conditions (0.077 vs. 0.0076).

Limitations and Future Work

  • Incomplete Mechanism Coverage: Depth-4 trees cannot represent long logical dependencies (e.g., chains of 5+ pieces) or continuous computations, such as non-rule-based global board-state update circuits across timesteps.
  • Single-Neuron Bottleneck: The framework assumes individual neurons are the fundamental units of computation, potentially missing relational or polysemantic logic distributed across multi-neuron subspaces or attention heads.
  • Output Layer Excluded: Layer 7 was excluded from surrogate replacements because it appears to perform continuous logit-cleaning operations that resist simple rule extraction.
  • Future Directions: Expanding tree-based interpretability to multi-neuron subspaces, deeper logical structures, and multi-step temporal circuits.

Summary updated

BibTeX
@inproceedings{singh2025automatically,
  author = {Aditya Singh and Zihang Wen and Srujananjali Medicherla and Adam Karvonen and Can Rager},
  title = {{Automatically Finding Rule-Based Neurons in OthelloGPT}},
  booktitle = {MechInterp @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=GRzC65IqoO},
}
Figure