Skip to main content

chessformer_lens

An interpretability lens for square-token chess transformers.

chessformer_lens reads the internals of chess models that represent the board as 64 square tokens with a from×to policy head — the "chessformer" architecture family (MAIA-3 today; Leela Chess Zero's BT transformers next). It is to chess transformers roughly what TransformerLens is to language models: instrumentation for looking at what the network computes, not just what it plays.

Status: pre-alpha (0.0.1). This release reserves the package name. The functional API is being extracted from a working MAIA-3 research harness and lands next. Watch the repo if you want the first usable cut.

What it will expose

  • Logit-lens depth curves — track any move's logit / probability / rank at every readout point of the residual stream and watch it "snap" into the model's plan.
  • Causal ablation grids — remove a single attention head's exact write and measure the effect on a move, across the full block×head grid. Sign convention: Δ = ablated − clean, so a positive Δ means the head was suppressing the move and a negative Δ means it was carrying it.
  • Attention decomposition — per-head attention maps split into geometry vs. semantics, for asking which head routes which relationship on the board.
  • Skill-conditioned diffs — for models with a skill/Elo embedding (e.g. MAIA), diff the same position at two ratings, activation-by-activation, to see where expertise lives.

Design

The coupling to any specific engine lives behind a small adapter (residual-stream readout points, hookable forward pass, exact per-head writes, and a policy-logit decode). Any square-token transformer with a from×to policy head can be plugged in — which is why the roadmap is MAIA-3 → Lc0-BT, the two current members of that family.

Roadmap

  • 0.1 — MAIA-3 backend: logit lens, ablation grids, attention maps, skill diffs
  • Lc0-BT backend (weight conversion + Smolgen handling)
  • Interactive board-native visualizer

License

MIT © 2026 David Litman

Citing

If chessformer_lens contributes to published work, a citation helps others find it — see CITATION.cff (GitHub's "Cite this repository" button) once the first release is out.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chessformer_lens-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chessformer_lens-0.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file chessformer_lens-0.0.1.tar.gz.

File metadata

  • Download URL: chessformer_lens-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for chessformer_lens-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bb1fbe9e3acf810c317783a354ab595e37b94d0ab01d81762a52d8dfbfe6eacf
MD5 a396e25c1a0f349972ab7854b368404a
BLAKE2b-256 8d756ba7f327799b46db1328727489dd2133bb119612043695d9dddb7de1b254

See more details on using hashes here.

File details

Details for the file chessformer_lens-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for chessformer_lens-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98b34006c024b1f6eeb4fcc306e209df7c7d02a09054634e10f1ddd095bbe0f7
MD5 71b190e0df16b1aa936bb69291b14c1c
BLAKE2b-256 b6a2f293552adf72def31a6fe39bc00cebc28e6b9a7d82a4ece4455f87434786

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.2

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.0.3

2 files

0.0.2

2 files

This release

0.0.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page