Enhancing Chess Reinforcement Learning with Graph Representation

Tomas Rigaux, Hisashi Kashima

Introduction

The success of AlphaZero demonstrated the power of reinforcement learning in mastering complex games like Chess and Go. However, AlphaZero’s reliance on grid-based Convolutional Neural Networks (CNNs) introduces inherent limitations. CNNs treat game boards as fixed-size image grids, making them computationally heavy and architecturally rigid. This paper introduces AlphaGateau, a graph-based reinforcement learning architecture that reimagines chess as a dynamic graph of pieces and moves rather than a static grid of pixels.

The Limitations of Grid-Based Architectures

Traditional deep reinforcement learning agents face two primary challenges when using CNNs:

  1. Inflexibility: CNN architectures are hard-coded to specific input dimensions. A model trained on a 19x19 board cannot be applied to a 13x13 board without significant architectural changes.
  2. Representational Mismatch: Chess is fundamentally relational. The game is defined by the interactions between pieces—how a knight defends a square or how a rook pins a king—rather than the spatial proximity of pixels.

By moving away from a pixel-based approach toward a graph-based representation, the authors aim to create a more general, scalable architecture capable of handling different board sizes and variants.

The AlphaGateau Framework

AlphaGateau replaces the CNN backbone of the traditional AlphaZero framework with a Graph Neural Network (GNN).

Graph Representation

The board is modeled as a graph where each square is a node and each legal move is a directed edge. Nodes store features such as piece type and castling rights, while edges store move-specific data (e.g., whether the move is a promotion).

The GATEAU Layer

The core innovation is the GATEAU (Graph Attention neTwork with Edge features from Attention weight Updates) layer. While standard Graph Attention Networks (GAT) typically only update node features, GATEAU incorporates edge features into the attention mechanism and updates both nodes and edges simultaneously. The model utilizes residual versions of these layers, termed "ResGATEAU" blocks.

Policy and Value Heads

  • Value Head: Uses Attention Pooling to aggregate node features into a single vector to predict the game's outcome.
  • Policy Head: Directly uses the updated edge features to output move probabilities. Because the number of edges changes with the board state, this architecture naturally handles different game variants and board sizes without changing internal parameter counts.

Experimental Results and Performance

The model was trained using self-play and Monte Carlo Tree Search (MCTS) across several variants, including standard 8x8 chess and the smaller 5x5 Gardner chess.

  • Superior Learning Speed: In head-to-head tests on 8x8 chess, AlphaGateau learned roughly 10 times faster than a comparable CNN-based AlphaZero in the early stages of training.
  • Higher Peak Performance: After 500 iterations, AlphaGateau reached an estimated Elo of 2105, while the baseline AlphaZero only reached 667.
  • Transfer Learning: The authors demonstrated that the model could successfully transfer knowledge from a 5x5 board to a standard 8x8 board. A model pre-trained on 5x5 chess and fine-tuned on 8x8 reached an Elo of 1876 with significantly less computational effort than training from scratch. Remarkably, a model trained only on 5x5 chess could play 8x8 chess with a "zero-shot" Elo of ~800 immediately.
  • Real-World Validation: A 5-layer AlphaGateau bot was deployed on Lichess, where it achieved a bullet Elo of 1991 against human and bot opponents.

Conclusion and Future Work

AlphaGateau demonstrates that GNNs provide a more efficient and flexible representation for strategic games. By focusing on the "structure" of the game—the relationships between pieces—rather than the grid, the model achieves higher performance with fewer parameters.

While this study was limited to 5-10 residual layers due to hardware constraints, the results suggest that graph-based approaches are highly effective for relational games. Future work will explore deeper architectures and apply the graph approach to games with non-grid structures, such as Shogi (where captured pieces can be dropped anywhere) or Risk (which features a non-uniform map).

Summary updated

BibTeX
@inproceedings{rigaux2024enhancing,
  author = {Tomas Rigaux and Hisashi Kashima},
  title = {{Enhancing Chess Reinforcement Learning with Graph Representation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=97OvPgmjRN},
}
Figure