Amortized Planning with Large-Scale Transformers: A Case Study on Chess

Anian Ruoss, Grégoire Delétang, Sourabh Medapati, Jordi Grau-Moya, Li Kevin Wenliang, Elliot Catt, John Reid, Tim Genewein, Veness, Joel, Genewein, Tim · DOI

Abstract

This paper uses chess, a landmark planning problem in AI, to assess transformers' performance on a planning task where memorization is futile \u2013 even at a large scale. To this end, we release ChessBench, a large-scale benchmark dataset of 10 million chess games with legal move and value annotations (15 billion data points) provided by Stockfish 16, the state-of-the-art chess engine. We train transformers with up to 270 million parameters on ChessBench via supervised learning and perform extensive ablations to assess the impact of dataset size, model size, architecture type, and different prediction targets (state-values, action-values, and behavioral cloning). Our largest models learn to predict action-values for novel boards quite accurately, implying highly non-trivial generalization. Despite performing no explicit search, our resulting chess policy solves challenging chess puzzles and achieves a surprisingly strong Lichess blitz Elo of 2895 against humans (grandmaster level). We also compare to Leela Chess Zero and AlphaZero (trained without supervision via self-play) with and without search. We show that, although a remarkably good approximation of Stockfish's search-based algorithm can be distilled into large-scale transformers via supervised learning, perfect distillation is still beyond reach, thus making ChessBench well-suited for future research.

Introduction

In classical AI, planning is synonymous with search\u2014algorithms that look ahead, evaluate future states, and backtrack to determine the optimal move. While deep learning has transformed chess through systems like AlphaZero, these models still rely on Monte Carlo Tree Search (MCTS) during inference to achieve peak performance. This research investigates a fundamental question: Can a transformer "amortize" this planning process? Specifically, can a neural network learn to predict the outputs of a complex search algorithm so accurately that explicit look-ahead becomes unnecessary?

Methodology

The researchers moved away from traditional reinforcement learning via self-play. Instead, they employed large-scale supervised learning using Stockfish 16, the world's most powerful chess engine, as an "oracle."

Overview of the data generation pipeline and the extraction of state and action values from the Stockfish oracle.

The study compared three distinct training objectives:

  1. Behavioral Cloning (BC): Predicting only the single best move identified by the oracle.
  2. State-Value (SV): Predicting the win probability of a given board state.
  3. Action-Value (AV): Predicting win probabilities for every legal move in a state.

The models used standard decoder-only transformer architectures with up to 270 million parameters. Win probabilities were treated as a classification task, discretizing the 0-100% range into 128 bins and utilizing a specialized HL-Gauss loss function to preserve ordinal relationships between bins.

Datasets and Predictors

To facilitate this large-scale study, the authors introduced ChessBench, a massive dataset comprising 10 million human games from Lichess.org. This resulted in approximately 530 million unique board states and over 15 billion action-value data points.

Details of the ChessBench training and test sets alongside the mathematical formulations for the three predictor types.

A key finding was that training on the full distribution of action-values (AV) significantly outperformed behavioral cloning. By learning the value of every legal move, the model gains a much richer understanding of the underlying game dynamics compared to simply identifying the "best" move.

Key Results

The results demonstrate that large-scale transformers can indeed internalize complex planning:

  • Grandmaster Performance: The 270M parameter model achieved a Lichess blitz Elo of 2895 against human players, placing it firmly in the Grandmaster tier.
  • Tactical Proficiency: Despite no explicit search, the model solved complex puzzles with difficulty ratings up to 2867 Elo.
  • Generalization: With only ~14% overlap between training and test sets (mostly in early-game positions), the model's performance on mid-game puzzles confirms it has learned to approximate Stockfish's evaluation function rather than simply memorizing positions.
  • Efficiency: By relying on a single forward pass, the model is orders of magnitude faster than traditional search-based engines.

Discussion and Limitations

While the model's performance is impressive, a "searchless ceiling" remains. The gap between the searchless transformer and Stockfish with search could not be entirely closed, suggesting that perfect distillation may require architectural advancements beyond simple scaling. Additionally, the model's reliance on FEN strings makes it "state-blind" to history-dependent rules like threefold repetition.

Future research will explore whether internal recurrence or improved data augmentation can bridge the remaining gap, potentially leading to even more efficient and powerful "intuitive" planning agents.

Summary updated

BibTeX
@inproceedings{ruoss2024amortized,
  author = {Anian Ruoss and Grégoire Delétang and Sourabh Medapati and Jordi Grau-Moya and Li Kevin Wenliang and Elliot Catt and John Reid and Tim Genewein and Veness, Joel and Genewein, Tim},
  title = {{Amortized Planning with Large-Scale Transformers: A Case Study on Chess}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=XlpipUGygX},
}
Figure