TL;DR
Can we "see" what a neural network imagines when planning or predicting future outcomes? By hooking up a decoder to the intermediate hidden states of recurrent networks, this paper demonstrates that models internally simulate physical step-by-step states—even when trained only on the final outcome or a scalar summary. While the approach reliably reconstructs hidden steps in Conway’s Game of Life, it fails to reveal clear board-state planning in AlphaZero chess, pointing to the elusive nature of high-level abstract representations.
What Problem Does This Paper Address?
When a neural network is trained to predict the outcome of a sequential process (like a game board several turns ahead), it often generates intermediate representations of the world along the way. In reinforcement learning and decision-making, an agent might internally simulate the consequences of an action before executing it.
Understanding these internal representations is critical for interpretability and AI safety, particularly regarding mesa-optimization—a phenomenon where a network develops its own internal search process that might pursue goals misaligned with its training objective. Currently, peering into whether a model is "imagining" future world states during its internal computation remains an open challenge.
Methods
The authors introduce an encoder–recurrent–decoder pipeline to visualize intermediate "thoughts":
- Architecture: A convolutional encoder compresses the initial environment state into a latent representation, a sequence of recurrent convolutional layers processes it across time/computation steps, and a convolutional decoder reconstructs environment states.
- Decoding Intermediate Activations: During inference, the decoder is applied directly to the intermediate hidden states of the recurrent layers rather than just the final state.
- Regularization & Training:
- Autoencoder Loss: The encoder and decoder are trained as an autoencoder on the initial state to ensure the latent space reliably maps back to valid environment configurations.
- Task Loss: An $L_2$ loss trains the network to predict the final environment state.
- Adversarial Training: An optional discriminator penalizes the decoder if the intermediate reconstructions do not resemble realistic environment states.
- Quantitative Evaluation: For Conway's Game of Life (GoL), the authors propose an interpretability score measuring whether thresholded intermediate hidden reconstructions match ground-truth intermediate states ($\ge 95\%$ pixel agreement).
Datasets
The authors evaluate their technique on two environments:
- Conway’s Game of Life (GoL): Synthetic sequences of deterministic cellular automata grids (evaluated across 10,000 test sequences per run).
- AlphaZero Chess: Board representations and pre-trained residual network activations from an AlphaZero chess agent evaluated on board state transitions.
No new external public benchmarks were introduced; GoL states were procedurally generated.
Key Insights and Ideas
- Networks Learn Step-by-Step Backwards in Time: When training an RNN to predict the 4th GoL state from the 1st, the internal representation of the 2nd state reaches 98% accuracy roughly 5,533 training steps before the final 4th state converges, and the 3rd state converges 2,773 steps before. The network naturally builds prerequisite intermediate steps first.
- Spatial Simulation Emerges from Scalar Objectives: When an LSTM is trained simply to count the number of alive cells after several timesteps (rather than predicting the visual board), its hidden layers still reconstruct the full intermediate visual board layouts with high correlation (up to 0.93).
- Autoencoders and Weight Sharing are Critical: Disabling the autoencoder loss causes interpretability scores on GoL to drop sharply (from 0.99 to 0.56). Removing recurrent weight sharing (using distinct feedforward layers instead of an RNN) drops it further to 0.40.
- The Limits of Visual Decoding in Complex Planning: Applying the decoder to AlphaZero’s residual blocks produced garbled piece arrangements or occasional phantom piece movements, failing to uncover clean future board simulations.
Key Results
- Game of Life (RNN):
- Achieved near-perfect intermediate state recovery on 2-step (1.00) and 3-step (0.99) matching runs.
- Adversarial training substantially boosted interpretability in difficult regimes—for example, raising the mean score from 0.15 to 0.71 when model timesteps and GoL timesteps differed (3 GoL steps vs. 2 model steps).
- Game of Life (LSTM - Cell Counting):
- Despite outputting only an integer cell count, intermediate state reconstructions maintained strong correlation with true intermediate game states (0.73 to 0.93 across varying timestep settings).
- AlphaZero Chess:
- Reconstructions from intermediate residual blocks failed to yield consistent, valid future board states or coherent search trees.
Limitations and Future Work
- Negative Results in Complex Domains: The technique failed on AlphaZero, likely because human-like chess planning operates on abstract strategic concepts, threats, and candidate moves rather than fully rendered, pixel-level future boards.
- Incompatible Latent Geometries: The decoder assumes intermediate layers share a representation space similar to the input/output layers; if a model abstracts or distorts geometry in middle layers, direct decoding fails.
- Future Directions: The authors emphasize developing semantic interpretability tools capable of decoding abstract decision-making features and extending the approach to explore goal alignment in mesa-optimizers.
Summary updated