Skip to main content

chessformer_lens

An mechanistic interpretability lens and visualize 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.2.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.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chessformer_lens-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 54f85d0d5cf9023a5462b7bb8df3c473700422e009234c279a754235ed07fa5e
MD5 77ff1ec7953b1dccb593fe7ce983de0c
BLAKE2b-256 5c2a69aeca1a949463e2a7a2a47d3efaaf6cd2882f4affab30597323cd20fab2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chessformer_lens-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2a488b0a635876feb2fe99e1080c32c13b5f6f3e95a546b304af3f061f36e2c7
MD5 96ef421874ae31fdccdf6c56ce829197
BLAKE2b-256 cacde061deaaf2fcfb87e714b26b9f81f62c26120c63f762d5ecdd97b76f6a11

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

This release

0.0.2 This release

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