Leela Chess Zero (LCZero or Lc0) is a free, open-source chess engine that uses neural networks and Monte Carlo tree search, based on the AlphaZero methodology developed by DeepMind. Unlike traditional chess engines that rely on handcrafted evaluation functions and alpha‑beta pruning, LCZero learns its evaluation and search purely through self-play reinforcement learning. It was launched in 2018 by Gary Linscott and a community of contributors, with the goal of creating a strong chess AI independent of human‑designed heuristics. The project is notable for its distributed training infrastructure, where volunteers contribute computing power to generate self-play games and train the neural network, making it one of the top‑rated chess engines in computer chess competitions.
1 Introduction
1.1 Background and Motivation
The development of chess engines historically relied on manually tuned evaluation functions—heuristics covering material balance, piece activity, king safety, and pawn structure. These engines used alpha‑beta pruning to efficiently search game trees. While highly successful, this approach required extensive human expertise and remained limited by the quality of its handcrafted features. The motivation behind Leela Chess Zero was to demonstrate that a neural network trained solely through self-play could surpass traditional engines without any domain-specific chess knowledge.
1.2 Relationship to AlphaZero
AlphaZero, introduced by DeepMind in 2017, achieved superhuman performance in chess, Go, and shogi by combining a deep neural network with Monte Carlo tree search (MCTS). DeepMind’s implementation was closed-source and required massive computational resources. Leela Chess Zero is an open-source reimplementation of the AlphaZero methodology, adapted for community-driven distributed training. It adopts the same core ideas—self-play, reinforcement learning, and a unified neural network for policy and value—but with a modular codebase designed for volunteer hardware.
1.3 Project Goals and Philosophy
The primary goal of LCZero is to create a strong chess engine that learns entirely from scratch, free of human biases. The project also emphasizes openness, reproducibility, and community participation. By distributing the training workload across many volunteers, LCZero aims to make cutting-edge neural network chess accessible to anyone. A secondary goal is to serve as a research platform for exploring neural network architectures and reinforcement learning algorithms in board games.
2 Architecture
2.1 Neural Network Design
LCZero’s neural network is a deep convolutional network that takes a board position as input and outputs two heads: a policy head (probability distribution over moves) and a value head (estimated game outcome). The architecture has evolved over time, with the most common variant being the “T40” series, which uses residual blocks.
2.1.1 Input Representation
The board is encoded as a stack of binary planes (feature channels) representing the positions of each piece type for both sides, plus additional planes for castling rights, en passant squares, repetition counts, and the side to move. Typical input sizes range from 112 to 119 channels, with each plane being 8×8 (64 cells). This representation allows the network to learn spatial relationships without explicit chess knowledge.
2.1.2 Residual Blocks
The core of the network consists of a series of residual blocks. Each block contains two convolutional layers with batch normalization and ReLU activation, plus a skip connection that adds the block’s input to its output. The number of residual blocks varies by network version; early networks used 10 blocks, while later versions (e.g., T40) use 20 or more blocks, increasing depth and capacity.
2.1.3 Policy and Value Heads
After the residual trunk, separate heads produce the policy and value outputs. The policy head applies a convolutional layer followed by a fully connected layer with a softmax activation, outputting a probability for each legal move (encoded as a 1858‑dimensional vector covering all possible chess moves). The value head uses a convolutional layer, a fully connected layer, and a tanh activation to produce a scalar in [-1, 1], where +1 indicates a win for the current player and -1 a loss.
2.2 Monte Carlo Tree Search (MCTS)
MCTS is used during both self-play training and actual play to guide move selection. It builds a search tree by iterating four steps: selection, expansion, simulation (or “evaluation”), and backpropagation. The neural network is used to evaluate leaf nodes and to provide prior policy probabilities.
2.2.1 Selection, Expansion, Simulation, Backpropagation
- Selection: Starting from the root, the algorithm traverses the tree by choosing the child with the highest upper confidence bound (UCB) score, which balances exploration and exploitation. The standard formula is \(Q + c \cdot P \cdot \frac{\sqrt{N}}{1+N_c}\), where \(Q\) is the average value, \(P\) the prior policy from the network, \(N\) the parent visit count, and \(N_c\) the child visit count. The exploration constant \(c\) is a tunable parameter.
- Expansion: When a leaf node is reached, if it is not a terminal state, it is expanded by adding its children (legal moves) to the tree. The network’s policy head provides initial priors for each child.
- Simulation (Evaluation): The leaf node is evaluated by the neural network’s value head. In LCZero, there is no separate random roll-out; the network directly estimates the outcome.
- Backpropagation: The evaluation result (value) is propagated up the tree, updating the visit count and cumulative value for each node along the path.
2.2.2 MCTS Parameters and Variations
Key MCTS parameters include the number of simulated nodes (or “playouts”) per move, the exploration constant, and the “temperature” used to convert visit counts into a move probability during training. LCZero supports several search variations, such as “policy mixing” (blending network policy with MCTS visit counts) and “safety margin” strategies for time management. These parameters are often tuned for specific network strengths or hardware constraints.
2.3 Hardware and Software Requirements
LCZero can run on CPUs using a generic neural network implementation (with reduced performance), but for competitive play a GPU or dedicated AI accelerator is essential. Minimum requirements typically include a graphics card with at least 2 GB of VRAM and support for CUDA (NVIDIA) or OpenCL (AMD or Intel). Memory usage scales with network size; the T40 network requires approximately 4‑6 GB of VRAM for efficient batching. The engine is available for Windows, Linux, and macOS.
3 Training Process
3.1 Self‑Play Game Generation
LCZero’s training data comes entirely from self-play games between instances of the current neural network. Each game is played on a client machine that runs LCZero with MCTS, using a fixed number of playouts per move. The client records the positions, policy targets, and game outcomes, then uploads the data to a central server.
3.1.1 Distributed Network (LCZero Client/Server)
The training infrastructure consists of a client-server architecture. Volunteers install the LCZero client software, which connects to a central server. The server distributes the latest network weights, and the client plays a specified number of self-play games (typically a few hundred) before uploading the generated training chunks. The server manages the queue of pending games, ensuring a steady flow of data for training.
3.1.2 Game Queue and Contribution System
Contributors can choose the number of games or the duration of their contribution. The system rewards consistent participation; users who contribute large amounts of GPU time may receive recognition or early access to new networks. The server aggregates data from all clients and periodically triggers a new training iteration.
3.2 Reinforcement Learning Loop
The training loop alternates between data generation (self-play) and weight updates. After a sufficient number of games (typically tens of thousands), the server formats the data into a training dataset and runs stochastic gradient descent (SGD) to update the network weights. The new network is then tested and released to clients for the next generation.
3.2.1 Updating Weights with Stochastic Gradient Descent
Training uses a loss function that combines policy error (cross-entropy between the network’s predicted policy and the MCTS search policy) and value error (mean squared error between the predicted value and the actual game outcome), plus L2 regularization. The optimizer is usually Adam or SGD with momentum. Minibatch size and learning rate are tuned for stability. Training runs on a high‑performance server (often with multiple GPUs) owned or rented by the project.
3.2.2 Training Datasets and Validation
Each training iteration produces a new dataset of positions from the latest self-play games. A small validation set is held out to monitor for overfitting and to decide whether to accept the new network weights. If validation loss increases, the training may be reverted or the learning rate adjusted. The training process is continuous; new networks are released as “stages” (e.g., stage 10, stage 20) until the project decides to make a major release.
3.3 Network Releases and Benchmarks
Significant milestones in LCZero’s development are marked by named network releases. These are often designated by a code (e.g., T40, JS, BT) and a number indicating which stage of training. Each release is benchmarked against previous versions and against traditional engines like Stockfish at various time controls.
3.3.1 Major Network Versions (e.g., T40, JS, BT)
- T40: The “Text” network with 40 residual blocks (T40). This was a major improvement that brought LCZero to elite level. T40 networks achieved ratings above 3300 Elo in standard rating lists.
- JS: J38‑series (JS) networks optimized for speed and smaller GPU memory, sacrificing some strength.
- BT: “Big Text” or “BT” networks with even more blocks (e.g., 60 blocks), pushing strength further at the cost of higher hardware requirements.
3.3.2 Strength Progression Over Time
Early LCZero networks (e.g., ID 112, 210) were weak, beating only amateur opponents. By 2019, T40 networks reached parity with top engines like Stockfish 10 in certain time controls. Subsequent iterations (T40‑XX) surpassed Stockfish in blitz and bullet time controls, and by 2020 LCZero was consistently among the top three engines in the Computer Chess Rating Lists (CCRL). The strength continues to improve, though diminishing returns have set in as the architecture reaches its practical limits.
4 Usage and Features
4.1 Command‑Line Interface
LCZero is primarily used via the command line, where users can pass various options to control the search, network file, and hardware settings. The engine supports standard UCI (Universal Chess Interface) for integration with chess GUIs.
4.1.1 Basic Commands and Options
Common command-line options include --weights (path to the network file), --backend (e.g., cuda, opencl, blas), --threads (number of CPU threads for MCTS), and --nncache (cache size for network evaluations). Search parameters like --playouts (number of MCTS simulations per move) and --time (time management mode) can also be set from the command line.
4.1.2 UCI Protocol Support
LCZero implements the full UCI protocol, allowing it to be used with any compatible chess GUI (e.g., Arena, Cute Chess, Fritz). Commands such as uci, ucinewgame, position, and go are supported. Users can set engine options (e.g., WeightsFile, Backend, Threads) via the GUI’s engine settings dialog.
4.2 Graphical User Interfaces (Lc0GUI, Arena, Cute Chess)
While not required, several GUIs simplify LCZero usage. Lc0GUI is a dedicated lightweight interface written in Python, offering basic play‑against‑engine and analysis features. Arena and Cute Chess are full‑featured UCI GUIs that support tournament management and game analysis with LCZero. Most modern chess GUIs (including ChessBase, Lichess, and PyChess) can also use LCZero as an analysis engine.
4.3 Playing Styles and Selectivity
LCZero’s playing style is notably different from traditional engines. It tends to favor positional subtlety and long‑term compensation over immediate material gains. Its selectivity is heavily influenced by the number of MCTS nodes (playouts) per move.
4.3.1 Number of Nodes vs. Time Control
At low node counts (e.g., 100–200 playouts), LCZero’s play can be erratic, missing deep tactics. With higher node counts (e.g., 800–2000), its play becomes stronger and more consistent. Time‑control modes dynamically allocate playouts based on remaining time, often resulting in deeper search in critical positions. The recommended minimum for competitive play is 800 playouts per move.
4.3.2 Syzygy Tablebase Support
LCZero can use Syzygy tablebases (endgame tablebases for positions with up to 7 pieces) to play perfect chess in the endgame. When enabled, the engine consults the tablebase at leaf nodes, overriding its neural network evaluation. This dramatically improves endgame play and reduces blunders in simplified positions. Support for 7‑man tablebases is available with sufficient disk storage.
4.3.3 Special Modes (e.g., “History Fill”, “Self‑Play”)
LCZero includes several special modes:
- History Fill: An analysis mode that fills all legal moves in a position with their evaluation and policy probabilities.
- Self‑Play: Used for training; the engine plays games against itself with a fixed number of playouts, outputting a portable game (PGN) of the match.
- Benchmark: Tests network evaluation speed and reports nodes per second.
5 Performance and Competitions
5.1 Rankings in Computer Chess Rating Lists (CCRL, CEGT)
LCZero consistently ranks among the top engines in the Computer Chess Rating Lists (CCRL) and the Chess Engine Grand Tournament (CEGT). As of 2025, LCZero is typically within the top three, often trading places with Stockfish and Dragon. Its blitz rating (2‑minute games) is around 3500 Elo, while its standard rating (40‑minute games) is slightly lower due to time‑management differences.
5.2 Notable Tournament Results
LCZero has won several major computer chess events:
- TCEC (Top Chess Engine Championship): Winner in Season 16 (2019) and Season 17 (2020), defeating Stockfish in the finals. In later seasons, it placed second or third.
- CCC (Chess.com Computer Chess Championship): Frequent finalist, winning the “Rapid” division in 2020 and the “Blitz” division in 2021.
- ACPC (Annual Computer Poker Competition): Not applicable; chess only.
5.3 Comparison with Other Neural Network Engines (e.g., Stockfish, Komodo, Dragon)
LCZero’s main competitor is Stockfish, which after version 12 adopted a hybrid approach combining neural network evaluation (NNUE) with traditional alpha‑beta search. LCZero’s pure MCTS approach tends to produce more “human‑like” positional play, while Stockfish NNUE is often sharper tactically. Komodo Dragon also uses neural networks but with a more traditional search. Head‑to‑head matches show that LCZero excels in closed, strategic positions, while Stockfish has the edge in open tactical melees. The gap has narrowed over time.
6 Community and Development
6.1 Core Development Team and Maintainers
The project was initiated by Gary Linscott, and key contributors include creators of the neural network training pipeline, the MCTS implementation, and the client‑server infrastructure. Notable maintainers include Alexander Lyashuk (creator of the Lc0 Windows builds), Daniel “dende” (network training), and the “Lc0 Team” (multiple volunteer core developers). The community is active on GitHub, Discord, and a dedicated forum.
6.2 Volunteer Contribution Model
The project depends entirely on donated computing power. Volunteers run the LCZero client on their personal computers, contributing GPU time to generate self‑play games. This distributed model allows continuous training without a central supercomputer.
6.2.1 Donation‑Based GPU Time (Crowdfunding)
In addition to individual contributions, the project has organized crowdfunding campaigns to rent high‑end GPUs for accelerated training. Donors receive recognition on the website. This hybrid model has raised tens of thousands of dollars, funding extended training runs that significantly boosted engine strength.
6.2.2 Client Software and Account Setup
The client software is available for Windows, Linux, and macOS. Users create an account on the LCZero website to receive a unique token. After installing the client and entering the token, the client automatically downloads the latest network, plays games, and uploads results. The user can set the number of games or a time limit for each session.
6.3 Code Repository and Licensing (GPLv3)
The source code of LCZero is hosted on GitHub under the GNU General Public License version 3 (GPLv3). This ensures that all modifications and derived works must also be open‑source. The repository contains the main engine code, the training server scripts, and various utilities. Contributions are made via pull requests, and the project follows a standard open‑source governance model with maintainers reviewing changes.
7 Impact and Criticism
7.1 Influence on Chess Engine Design
LCZero pioneered the open‑source application of AlphaZero methods to chess, inspiring a wave of neural network engines (e.g., Stockfish NNUE, Berserk, Minic). It demonstrated that self‑play training could match or exceed traditional engines without human‑crafted features. The project also popularized distributed reinforcement learning among hobbyists, influencing other game AI projects.
7.2 Debate on Neural Network vs. Traditional Methods
The success of LCZero sparked debates within the computer chess community. Traditionalists argued that pure MCTS is less efficient than alpha‑beta for chess, while proponents noted that neural network evaluation compensates for search depth. The eventual adoption of NNUE by Stockfish (a hybrid approach) suggests that both methods have merit. LCZero’s slower speed per node is often criticized, but its ability to discover unconventional moves (e.g., long‑term sacrifices) is praised.
7.3 Legal and Ethical Considerations in Computer Chess
LCZero raises few legal concerns, as it is open‑source and uses no copyrighted anti‑cheat or proprietary data. Ethically, the use of neural network engines in online chess for cheating has become a problem, but LCZero itself is a legitimate research tool. The project encourages responsible use and does not provide any special chess‑cheating features. The community has also discussed the fairness of using donated GPU time for a closed central training server, but the model remains transparent.
8 Related Projects
8.1 Leela Chess Zero Derivatives (e.g., Lc0 for different games)
The LCZero codebase has been forked to create AIs for other board games:
- Leela Zero: The original Go‑focused project (from which LCZero derived its name).
- Leela Shogi Zero: A shogi (Japanese chess) implementation.
- Leela Mahjong Zero: A mahjong AI (experimental).
8.2 Other AlphaZero‑Inspired Engines (e.g., GNU Chess Zero, Ceres)
Several independent projects replicated AlphaZero for chess:
- GNU Chess Zero: An attempt to reimplement AlphaZero from scratch, but less successful.
- Ceres: A modern MCTS‑based engine with a PyTorch backend; often competes with LCZero in rating lists.
- Antifish: A now‑discontinued MCTS engine that targeted Stockfish.
9 Future Directions
9.1 Potential Improvements in Architecture (e.g., Transformer Networks)
The LCZero community explores alternative neural network architectures, such as transformers or attention‑based models, which might better capture long‑range dependencies in chess positions. Early experiments with transformers have shown promise but require more training data. Integrating such architectures could lead to stronger and more efficient evaluation.
9.2 Integration with Quantum Computing
Though speculative, the project has discussed using quantum computers to speed up MCTS simulations. Quantum annealing or gate‑based quantum computing could, in theory, evaluate many board positions simultaneously. Practical quantum chess engines remain far in the future, but LCZero’s modular design allows experimenting with novel backends.
9.3 Role in Chess Education and Analysis
LCZero’s human‑like playing style and ability to explain moves (via policy probabilities) make it a valuable tool for chess education. Future developments may include built‑in annotations, training puzzles, and integration with online platforms. The project also aims to reduce hardware requirements so that even modest laptops can run strong networks, broadening access to neural‑network chess analysis.