TL;DR
Most reinforcement learning (RL) agents for board games treat game states as spatial images using Convolutional Neural Networks (CNNs), which struggle with long-range topological connections. This paper shows that Graph Neural Networks (GNNs)—specifically integrated with DQN and AlphaZero-style search—can exploit the graph-theoretic nature of games like Hex. While GNNs drastically outperform CNNs at resolving long-range dependencies and avoiding overfitting on endgame positions, CNNs still retain an edge at recognizing local tactical patterns.
What Problem Does This Paper Address?
Since AlphaGo and AlphaZero, the default architecture for self-play reinforcement learning in board games has been the CNN. CNNs carry strong inductive biases: spatial locality and translational equivariance. However, many abstract strategy games (such as Go, Chess, and Hex) rely on non-local, combinatorial connections—such as "ladder" captures in Go or connectivity chains across an entire board in Hex.
When treated purely as a grid of pixels, distant interactions are difficult for standard convolutions to resolve without deep stacks or receptive field workarounds. The authors ask: Can GNNs replace CNNs in self-play RL by explicitly representing games as graphs?
Methods
The authors focus on Hex, an abstract board game where two players attempt to connect opposite sides of an $n \times n$ board. Hex can be mathematically formalized as a Shannon Vertex-Switching Game, where players alternate between "joining" or "cutting" nodes in an undirected graph.
The paper introduces two architectures:
- GraphDQN: Combines a message-passing GNN (GraphSAGE) with RainbowDQN techniques (specifically Dueling architectures, prioritized replay, and double Q-learning). The network backbone uses 15 GraphSAGE layers to compute per-node embeddings, feeding into:
- An advantage head (using GraphSAGE layers with scaled tanh activations to assign advantages to actions/nodes).
- A value head (aggregating embeddings via mean, max, min, and sum pooling into an MLP with tanh output).
- GraphAra: Integrates the GNN into an MCTS-based AlphaZero pipeline (built on the CrazyAra framework) by replacing the usual ResNet backbone with a GraphSAGE body, a policy head, and a value head.
- Graph Pruning: An algorithmic routine (Algorithm 1) removes dead and captured vertices from the graph during play, simplifying the state representation as the game progresses.
Baselines: The authors compare against two fully convolutional architectures capable of handling variable board sizes:
- Gao CNN: A residual network designed specifically for Hex (residual blocks without pooling, padded with colored border tiles).
- U-Net: An encoder-decoder architecture with pooling and skip connections.
Datasets & Benchmarks
- Synthetic Long-Range Dependency Benchmark: Tailored Hex test positions generated across board sizes ranging from $8 \times 8$ to $25 \times 25$ (4 test patterns per size: red/blue positive and red/blue negative) to evaluate whether models can recognize whether a distant move threatens an immediate connection.
- MoHex 2.0 Dataset: 10,000 self-play games from MoHex 2.0 (8,000 train / 2,000 validation) for supervised learning experiments on move prediction (policy) and game outcome (value sign).
- Variable-Size Transfer Matches: Head-to-head evaluation on board sizes from $8 \times 8$ to $15 \times 15$ after training only on $11 \times 11$.
Key Insights and Ideas
- Information Entropy vs. Board State: As a Hex game progresses, a board image becomes denser and reaches peak visual entropy when tiles are filled. In contrast, the graph representation contracts: dead, captured, or joined nodes are removed or merged. The graph representation naturally sheds irrelevant visual clutter, which helps prevent overfitting.
- Topological Invariance beats Spatial Coordinates: GNNs generalize across radically different board geometries and sizes because two visually distinct positions on different board sizes (e.g., $7 \times 7$ vs. $11 \times 11$) can share an identical Shannon graph representation.
- The Locality Trade-off: While GNNs excel at global topology, CNNs remain stronger at immediate local shapes. In head-to-head play under DQN, the Gao CNN beat the GNN on smaller boards because local tactical play dominates early move quality.
Key Results
- Long-Range Dependency Tasks: On test boards up to $25 \times 25$, GraphDQN made only 1 mistake across all test boards. In contrast, the Gao CNN made 31 mistakes and the U-Net made 36 mistakes, regularly misidentifying critical distant moves even on the $11 \times 11$ size they were trained on.
- Supervised Generalization: On MoHex 2.0 game outcome predictions, both CNNs severely overfit the training set. The GNN achieved the highest validation accuracy on value sign prediction without overfitting.
- AlphaZero / GraphAra Performance:
- The supervised model (GraphAra-SL) defeated its teacher, MoHex 2.0 (1,000 MCTS nodes), winning 52.27% of games with only 800 search nodes.
- After self-play RL training, GraphAra-SP dominated, winning 79.55% against GraphAra-SL and 66.67% against MoHex-1k across all unique $11 \times 11$ openings.
Limitations and Future Work
- Domain Specificity: The approach relies heavily on Hex's elegant equivalence to Shannon Vertex-Switching Games. Games like Go or Chess lack straightforward, canonical graph formulations that contract cleanly as pieces are placed.
- Local Pattern Recognition: GNNs lag behind CNNs in parsing dense, local tactical clusters, pointing toward hybrid architectures (combining local convolutions with global graph message passing) as a logical next step.
- Computational Overhead: GNN message passing converges more slowly during training compared to standard CNN feedforward passes.
Summary updated