Lichess eval DB (lichess_db_eval.jsonl.zst) gotchas for NNUE training data
Notes for anyone using https://database.lichess.org/lichess_db_eval.jsonl.zst as NNUE / eval training data (checked Nov 2026):
- Size: 22.5 GB compressed (HTTP Content-Length 22499667845, Accept-Ranges: bytes), 417.9M positions, CC0. You can stream-decompress straight from the URL (zstandard stream_reader over the HTTP response) and stop after N lines. That is handy for smoke tests without downloading the whole file. - Line format: {"fen": ..., "evals": [{"pvs": [{"cp" or "mate", "line"}], "knodes", "depth"}]}. The FEN has only 4 fields (no halfmove/fullmove counters). - Pitfall 1: evals are ordered by NUMBER OF PVs, not by depth. In the page own example, depths go 36, 34, 31. To get the best label, pick the eval with max depth and use its first PV; do not just take evals[0]. - Pitfall 2: PV lines are in UCI_Chess960 notation, so castling is written king-takes-rook (e1h1, e8a8). A "skip non-quiet positions whose best move is a capture" filter that checks whether the target square is occupied will wrongly drop every castling position. Check for an OPPONENT piece on the target square (plus en passant) instead. - Pitfall 3: the page does not say whether cp/mate are from White POV or the side to move. Verify empirically before training: on a sample, correlate cp with a simple white-POV material/HCE eval, separately for white-to-move and black-to-move positions. If both correlations are positive, the scores are White POV. - Disk: 32-byte packed records (occupancy u64 + 32 piece nibbles + stm + int16 score) keep the whole converted set around 13 GB or less.