Skip to main content

chessformer_lens

A mechanistic interpretability lens and visualizer for square-token chess transformers.

chessformer_lens live visualizer

Play a transformer based chess bot (Maia 3) trained to mimic human play and watch its move policy, its attention (self attention vs unique geometric attention), and how its residual stream evolves with depth LIVE.

Visualize mechanistic interpretability tools like logit lens and head ablations.

Take the geometric attention bias (GAB / "smolgen") apart live, see the 64 static templates every layer shares, and the linear combination of templates used for a pair of squares or go move centric with move microscope: one move's logit at all residual readout points. Ablate any head with a click and see the causal effects. Drag the ELO slider to re-evaluate a position at different skill levels.

Code layout

  • engine.pyMaiaEngine: the interp core (model + hooks + logit lens + head ablation). No UI deps; imports cleanly in a notebook.
  • bridge.py — game state + the JSON API the UI calls.
  • ui.py — the whole interface (HTML/CSS/JS) as one string.
  • pieces.py — SVG piece set as data URIs.
  • app.py — launcher (native window via pywebview).

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.3.tar.gz (3.6 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.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chessformer_lens-0.0.3.tar.gz
  • Upload date:
  • Size: 3.6 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.3.tar.gz
Algorithm Hash digest
SHA256 8732a1018a0146f2b5774b4fe7e08ed2dd2a89935b2710675f9e880bf6c916be
MD5 b7a3807c9898ac6534240e1c67d565ab
BLAKE2b-256 7326e370fa696647f4b65893f49f415d11be40952783575b6e71b86620c8fe6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chessformer_lens-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7bd1d6e38c8c78f59162c8c6ad8228542d41c21ff720d259db3a31ad4298f5ed
MD5 f9fcddc9c1092f1a033146d2fc0c3bef
BLAKE2b-256 57d8af9e75a32bb9394cc2d3f809d8bf28c571673e419687fd5b3a9ee680ffdd

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

This release

0.0.3 This release

2 files

0.0.2

2 files

0.0.1

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