Neural-Policy Chess Inference Inside the EVM: A GenesisL1 Case Study and a General Template for On-Chain Scientific Machine Learning
Decentralized Science Labs · December 2025 · read the paper (PDF)
Abstract #
Running neural networks inside an EVM smart contract has long been treated as impractical: dense arithmetic is costly, floating point is absent, memory is constrained, and determinism is mandatory. In this work we present an existence proof that these barriers are not fundamental. We describe a complete on-chain inference system for chess based on a compact policy network deployed as Solidity code and executed by the EVM, producing deterministic move logits and top-K selections under a legal-move mask. The deployment is performed on GenesisL1, an EVM-compatible blockchain whose compute-friendly execution parameters make such inference feasible; under typical “mainnet-like” EVM conditions, the same inference budget would be prohibitively expensive or fail to fit within practical call constraints. The model is trained on approximately 2×10⁷ positions from 2200+ Elo games, reaching about 25% validation top-10 accuracy when predicting the expert move index in the full fixed action space without providing legality as a network input. We formalize the state encoding, the 4672-action indexing scheme, the mask algebra, and the deterministic selection primitives implemented on-chain. Beyond chess, we argue that this result has broad significance: it demonstrates that small, quantized neural networks can be decentralized and executed directly in smart contracts, enabling verifiable scientific inference for bioinformatics, genomics, chemistry, physics, and astronomy, and supporting “small chat-like” question answering via constrained language models that map user prompts to structured, auditable outputs linked to committed datasets.
What the paper describes #
- Moves as 4,672 indices. A move is 73 × its origin square (0–63) plus its move plane (0–72): 56 planes of sliding moves (8 directions, 7 distances), 8 of knight moves and 9 of underpromotions (to a knight, a bishop or a rook, in 3 directions).
- A legal-move mask. The legal moves of a position are 4,672 bits, packed in 584 bytes, and the contract applies them to the network's scores: only a legal move can be selected, while the network itself is never told which moves are legal.
- The position. Twelve 64-bit bitboards (six piece types for each side), the castling rights and the en-passant file.
- Integer inference. The EVM has no floating point, so every layer computes with integer weights and biases and a scaling constant, and the selection primitives (the top K moves for a small K; the paper's example is K ≤ 32) run in the contract: every node gives the same answer, and any answer can be audited.
- Training. About 2×10⁷ positions from games of players rated 2200 and above; the expert's move is among the network's ten highest scores in about 25% of the validation positions.
- Beyond chess. The same template for on-chain scientific models: bioinformatics and genomics; chemistry, physics and astronomy; small, constrained language models whose answers are structured, auditable and linked to committed datasets.
In GL1X #
GL1X's chess page (/dapps/chess) and its MCP chess tools play against this
network on GenesisL1, with the search of GenesisL1's chess dapp around it
(the legal-move mask, top-K inference, a fast score, best-move refinement and
an opening book). See Chess against GenesisL1.
Read the paper #
- Neural-Policy Chess Inference Inside the GenesisL1 EVM (PDF) on genesisl1.com
How to cite #
@techreport{dsl-chess-2025,
title = {Neural-Policy Chess Inference Inside the {EVM}: A {GenesisL1}
Case Study and a General Template for On-Chain Scientific
Machine Learning},
institution = {Decentralized Science Labs},
year = {2025},
month = dec,
url = {https://genesisl1.com/Neural-Policy%20Chess%20Inference%20Inside%20the%20GenesisL1%20EVM.pdf}
}