Skip to content

Releases

Attention follow-up: 3,338 Elo at 100,000 searches

Choose a tag to compare

@BertilBraun BertilBraun released this 03 Oct 08:56

Attention follow-up: a T1-shaped network after the paper

After the technical report, a teacher-distillation diagnostic pointed at the network's construction as the limit of the convolutional plateau. One more self-play run tested that: a 10-layer, 192-wide attention network built like Lc0's T1 (with smolgen), trained from random initialization with AdamW on one node with eight RTX 4080 SUPER GPUs.

Results

  • 3,338 benchmark Elo [3,293, 3,381] at 100,000 searches per move: 39/52/9 (65.0%) against Stockfish 13 at 200,000 nodes, under the paper's protocol and calibration. The paper's convolutional model scored 3,251 [3,206, 3,297] there. This row used eight-way rather than sixteen-way search parallelism and float16 rather than INT8 serving.
  • The 64-search training ladder settled near 2,480, about 120 Elo above the convolutional lineage's plateau, after 56 hours of run time (about $89 at $1.60/hour; the paper's narrow figure was $43.20).
  • It then plateaued again. A learning-rate warm restart lowered training loss but not strength (59/87/54 over 200 games against the checkpoint before it).
  • On the same calibration Lc0 sits near 3,600 at 100,000 nodes. Lc0's own T1 network, run inside this project's search, plays about 245 Elo above this model, so the remaining gap of roughly 250 is network quality that Lc0 obtained from far more self-play and larger networks, not a different algorithm.

Artifacts

  • Weights: production/attention-10x192-generation-896/ (the evaluated checkpoint, PyTorch and float16 ONNX) and -950/ (final), archived in the model repository. The play site and the latest aliases remain the paper's convolutional model.
  • Training curves and logs: the new run dataset holds TensorBoard data and logs of the main campaigns (V9, V29, V34, V46, the final CNN lineage V89-V99 and the attention run), plus stitched single-run views of the final CNN lineage and the attention run. The stitched CNN lineage reproduces the paper's published ladder export point for point.
  • Full record with configurations, matches, costs and caveats: documentation/benchmarks/attention-adamw-final-run-rtx4080s-20261002/README.md.

The paper's reported result and its 2.5-day training budget are unchanged by this follow-up.

Engineering Efficient Self-Play Chess — final report and chess system

Choose a tag to compare

@BertilBraun BertilBraun released this 27 Sep 11:43

Engineering Efficient Self-Play Chess

This release publishes the technical report and the accompanying chess system, documentation, configuration, and preserved experimental evidence.

Results

Training from random initialization through self-play on one node with eight RTX 4070 SUPER GPUs produced a 6.32-million-parameter model in 2.5 days. The reported run ingested 3.25 million completed games and made 836.6 million training presentations, at a node rental cost of $43.20 for that training budget.

The final model reached 3,251 benchmark Elo [3,206, 3,297] at 100,000 searches per move, compared with 1,658 [1,608, 1,710] without search. Ratings use a historical fixed-node Stockfish 13 calibration, not FIDE ratings. The approximately 470-thousand-parameter distilled student reached 2,873 [2,819, 2,935] at 100,000 searches per move.

What is included

  • The complete technical report, attached as engineering-efficient-self-play-chess.pdf, with methods, results, failure studies, references, and detailed appendices.
  • Native C++ search and batched inference, Python orchestration and distributed training, replay management, and evaluation tooling.
  • The final chess configuration, progressive model sizing, restart-state sampling, replay policies, calibrated resignation, and TensorRT deployment.
  • Benchmarks and analyses covering retained improvements and rejected approaches, including graph search, inference caching, adaptive search, alternative architectures, and quantization.
  • Reworked project documentation and report-generation tools.

The reported strength belongs to the integrated system; the report distinguishes full training results from individual controlled comparisons. Later experiments do not extend the reported 2.5-day training budget. The separate LC0-teacher work remains experimental and is not included in this release.

Use the project

  • Play against the model
  • Model artifacts and model card
  • The source archive includes py/configs/production/chess-final-config.yaml, the entry point for the maintained training recipe.
  • See the root README for setup and documentation/report/README.md for report sources and evidence.

Original project code, documentation, and model artifacts are MIT-licensed; third-party dependencies retain their own licenses. This is the GitHub publication of the paper; an arXiv submission is not part of this release.

Monte-Carlo graph search (rejected)

Choose a tag to compare

@BertilBraun BertilBraun released this 06 Sep 16:28

Monte-Carlo graph search for chess, implemented, audited against the paper and released reference
code, measured, and rejected. Preserved here because it is not merged to master.

Decision

Do not merge graph search into the production path. Tree search remains the default. This is
rejection evidence, not an accepted training change.

What was built

A shared-statistics Monte-Carlo graph search following Czech, Korus and Kersting,
Improving AlphaZero Using Monte-Carlo Graph Search
(ICAPS 2021), Algorithms 1-2. The implementation matches the paper on every substantive invariant:
one canonical node and shared descendant graph per verified state (not an evaluation cache), node
statistics shared across incoming trajectories with edge statistics local to each parent, ordinary
edge-local PUCT selection, explicit mini-batch trajectories with virtual reservations removed exactly
once, absolute residual comparison against a configurable threshold, correction-only backups, and
backup of only the selected trajectory.

The audit found and fixed one material omission: the first incoming edge linked to an evaluated
shared node must stop and back up that node's value rather than searching deeper immediately, which
is how the authors' released CrazyAra implementation realizes reuse on a newly detected
transposition. Correcting it raised measured reuse — and still was not enough.

Why it was rejected

Corrected measurements, RTX 4070 SUPER, deterministic 12x112 model, 16 Stockfish 8moves-v3 FENs,
batch 256, four parallel searches, >= 120 s per arm:

Searches Tree searches/s Graph searches/s Slowdown Evaluations avoided Structural reuse
1,000 19,765.6 18,059.1 8.63% 0.0249% 0.0814%
10,000 18,752.3 17,200.3 8.28% 0.1769% 0.5007%

Under 0.18% inference avoidance and 0.51% structural reuse do not offset an ~8.3% throughput
loss.

The root cause is domain-specific and worth remembering. The paper assumes a Markov state and
acknowledges that history planes can violate it. Exact chess identity cannot make that approximation:
it includes pieces, side to move, castling, en passant, the exact halfmove clock, and the multiset of
retained repetition-relevant positions with their occurrence counts. That identity is stricter than
the paper's, and it is the primary reason ordinary move-order transpositions do not merge. Relaxing
history identity would be a different, approximate algorithm.

The graph did behave correctly — at 10,000 searches it reached path multiplicity 10 and 34,055 more
completed visits on shared children than on incoming edges. The behaviour was right; the opportunity
was not there.

Caveat recorded by the original work

No strength match was run. A trained compatible model could change paths and threshold crossings, but
it cannot make this measured exact-state hit topology competitive without substantially more
transpositions.

Full audit, artifacts and paired controls:
documentation/benchmarks/monte-carlo-graph-search-paper-audit-rtx4070s-20260818/

Neural-inference cache (declined)

Choose a tag to compare

An upper-bound measurement of neural-inference repetition in chess self-play, used to decline
building an inference cache. Preserved here because it is not merged to master.

Decision

A neural-inference cache does not deserve implementation priority for this workload.

The measurement

The decision-relevant experiment reproduced the actual mixed search policy — 800-search full requests
at a deterministic 25% Bernoulli rate, 150-search fast requests otherwise, 60% retained root visits
before each full search, matching SelfPlayWorker.run_batch. 512 distinct random legal starting
positions over six measured moves, two matched seeds with reversed run order, production search
constants and root noise.

Parallel searches Inference positions Potentially avoidable Upper-bound repeat rate Same-batch repeats Searches/s
1 1,824,486 64,741 3.5485% 0 29,420.6
2 1,826,618 64,470 3.5295% 1 38,222.0 (+29.9%)

~3.5% gross opportunity, before paying any cache cost — finite capacity, lookup,
synchronization, output storage and transfer. Same-batch repetition was effectively zero: all repeats
were prior-batch. The result is insensitive to parallel-search count.

Why the earlier, more exciting numbers were thrown out

An earlier harness reported 37.6% repetition at high budget and 98.5% at low budget. Those are
rejected methodology evidence and must not drive the decision: that harness used up to 64
parallel searches, cycled a fixed 50-opening suite, used evaluation-like search settings, and
repeatedly restarted completed games from the same openings. It did not represent project self-play.

The correction is the main value of this branch — an appealing result that did not survive being
measured against the real workload.

Incidental finding that did survive

parallel_searches: 2 improved aggregate search throughput +29.9% over 1 in two matched seeds
with reversed run order (+33.2% and +26.6% individually), with identical instrumentation in both
arms. It created no meaningful cache opportunity, but it is a throughput result in its own right.

Full data, environment and checksums:
documentation/benchmarks/inference-cache-hit-rate-20260818/

Adaptive search stopping and search budgeting (closed)

Choose a tag to compare

Two adaptive-search work packages, both closed as negative results, preserved here because they are
no longer reachable from master.

What this contains

Removed from master in 71bc0e5c ("Remove adaptive search budgeting on both sides"):

  • Learned early stopping — py/src/search_stopping/ (12 modules), cpp/src/search/SearchStopPredictor.{cpp,hpp}, the 17-feature predictor input, stop-rule evaluation and movement guard in SearchExecutor.
  • Predicted search budgets — py/src/search_budget/ (15 modules), cpp/src/search/SearchBudgetCorrector.{cpp,hpp}, and the three-tensor inference contract (policy, WDL, search-budget curve).
  • Every v21–v30 production configuration, the four stopping-fork arms, and configs/validation/archive-pre-stopping/ — deleted from master because they carry configuration blocks for machinery that no longer exists, and FrozenModel uses extra='forbid', so they cannot be loaded. Editing them would have falsified the runs they document and broken their recorded experiment_configuration_sha256.

Why they were closed

Learned early stopping. A controlled experiment forked three arms from byte-identical state at generation 310 and ran each for three hours:

Arm Ladder Elo vs baseline
excess_cost_ceiling 0.25 +1.7 ± 9.9
excess_cost_ceiling 0.15 −4.2 ± 10.1

The mechanism worked exactly as designed — credit-wait ordered 57 < 66 < 80 s by search skipped, so the search really was being cut — but it converted to nothing measurable. The reason is structural: 14% of search saved became 3% of wall-clock, because self-play overlaps training. Saving search time does not save wall-clock when the trainer is the thing you are waiting for.

Predicted search budgets. Retired earlier on the same kind of evidence; the learned-stopping work was its successor.

What was kept on master

The tooling and measurement work these experiments produced was worth keeping and was merged:

  • run_control.sh fetch rewritten to shard, retry and verify
  • Evaluation batching rework — every ladder rung played in one concurrent population (2.71× at parallel_searches 1)
  • Stockfish 13 ladder anchors extended above 10,000 nodes
  • In-flight self-play game suspend/restore across restarts
  • Trainer network seeding, gradient probe under torch.compile, AdamW counters on CPU
  • _publish_ladder_elo fixed to publish once per boundary rather than once per rung
  • The complete v29 measurement record, including the resolved configuration

Reference

  • Analysis: documentation/analysis/adaptive-search-conclusion-20260904.md
  • Benchmarks: documentation/benchmarks/*-20260906/
  • Diff against current master: git log --oneline master..adaptive-stopping-final

Pre-rework engine (2024, 4xA10)

Choose a tag to compare

@BertilBraun BertilBraun released this 22 Aug 09:44

Final state of the original Python engine era (tag pre-rework, f8cb82a). Carries the 2024 A10 run artifacts; SHA-256s recorded in documentation/evidence/chess-legacy-a10-2024/README.md.

Four-day chess baseline (r3/r4)

Choose a tag to compare

@BertilBraun BertilBraun released this 22 Aug 09:44

Frozen revision d988843 (source range d39d5c8..d988843). Generation 445 scored 66.0% vs Stockfish 13 at 6,500 nodes (CI 58.5-73.5%); ~2,800 ladder Elo at 10k visits. Evidence: documentation/evidence/chess-four-day-freeze-20260817/ and .codex-diagnostics/chess-baseline-four-day-freeze-20260817. The recovery-plan yardstick derives from this run.

v1.0

Choose a tag to compare

@BertilBraun BertilBraun released this 22 Jun 18:36

AlphaZero-Clone v1.0.0 Release

Chess AI achieving ~2000-2100 Elo trained on $350 budget

Pre-trained Model Weights

Download the trained chess model:

Quick Start

  1. Setup:

    curl https://raw.githubusercontent.com/BertilBraun/Advanced-Techniques-in-Chess-Engines/v1.0.0/getting_started.sh | bash
  2. Download weights to a folder (e.g., ./models/)

  3. Play against the AI:
    Set MODEL_PATH=./models/best_model.pt in eval.py # or wherever you downloaded the weights, then:

    python eval.py

Performance

  • Elo Rating: ~2000-2100
  • Training Cost: $13 for final model
  • Training Time: 12 hours
  • Total Budget: $350 including all experiments

What's Included

  • Complete AlphaZero implementation (Python + C++)
  • Self-play training pipeline
  • Support for Chess, Connect Four, Checkers, Hex, Tic-Tac-Toe
  • Comprehensive documentation and analysis

See the [main README for full technical details and training results.