Evidence of Learned Look-Ahead in a Chess-Playing Neural Network
Authors: Erik Jenner, Shreyas Kapur, Vasil Georgiev, Cameron Allen, Scott Emmons, Stuart J Russell
NeurIPS 2024 | Conference PDF | Archive PDF | Plain Text | LLM Run Details
| Reproducibility Variable | Result | LLM Response |
|---|---|---|
| Research Type | Experimental | We present evidence of learned look-ahead in the policy and value network of Leela Chess Zero, the currently strongest deep neural chess engine. We find that Leela internally represents future optimal moves and that these representations are crucial for its final output in certain board states. Concretely, we exploit the fact that Leela is a transformer that treats every chessboard square like a token in language models, and give three lines of evidence: (1) activations on certain squares of future moves are unusually important causally; (2) we find attention heads that move important information forward and backward in time, e.g., from squares of future moves to squares of earlier ones; and (3) we train a simple probe that can predict the optimal move 2 turns ahead with 92% accuracy (in board states where Leela finds a single best line). |
| Researcher Affiliation | Collaboration | Erik Jenner1 UC Berkeley Shreyas Kapur UC Berkeley Vasil Georgiev Independent Cameron Allen UC Berkeley Scott Emmons UC Berkeley Stuart Russell UC Berkeley |
| Pseudocode | No | The paper describes its methods in prose and with figures, but no explicit pseudocode or algorithm blocks are provided. |
| Open Source Code | Yes | Our code is available on Github. (Section 1 Introduction) |
| Open Datasets | Yes | We begin with a dataset of Lichess tactics puzzles(Lichess team), available at https://database.lichess.org/#puzzles under a Creative Commons CC0 license. (Appendix D) |
| Dataset Splits | Yes | We use 70% of our puzzle dataset for training and the remaining 30% to evaluate probes. (Appendix F) |
| Hardware Specification | Yes | Each experiment takes at most a few hours on a fast GPU (e.g., an A100) and about a day for all experiments combined. (Section 2) |
| Software Dependencies | No | We use onnx2torch (ENOT developers et al., 2021) to convert the official Leela ONNX models to Py Torch (Ansel et al., 2024) for easier instrumentation. ... We then use nnsight (Fiotto-Kaufman) to implement our interventions. We also build on the lczero_tools package (Graffa) for some of our instrumentation. We use python-chess (Fiekas) for chess logic, and einops (Rogozhnikov, 2022) for conveniently implementing some of our methods. (Appendix I) While libraries are listed with citations, explicit version numbers (e.g., PyTorch 2.0.1, nnsight 0.1.0) for *all* key software components are not consistently provided. |
| Experiment Setup | Yes | We found that the choice of hyperparameters has essentially no effect on probe accuracy; we used Adam with a learning rate of 1e-2, no weight decay or other regularization, a batch size of 64, and trained for 5 epochs. (Appendix F) |