explaingit

09catho/axon

13JavaScriptAudience · researcherComplexity · 4/5ActiveSetup · moderate

TLDR

Live interpretability tool that streams GPT-2's internal SAE feature activations into a 3D browser graph as the model generates tokens. Built on SAELens and Neuronpedia labels.

Mindmap

mindmap
  root((axon))
    Inputs
      Text prompt
      Generation knobs
      SAE checkpoint
    Outputs
      Streaming tokens
      Feature activations
      3D graph view
    Use Cases
      Mechanistic interpretability demos
      Teach how LLMs work
      Inspect SAE features
    Tech Stack
      Python
      PyTorch
      SAELens
      WebSocket
      ThreeJS
      ForceGraph

Things people build with this

USE CASE 1

Visualise which SAE features fire on a custom prompt to teach mechanistic interpretability

USE CASE 2

Explore Neuronpedia-labeled GPT-2 layer 8 features through a 3D node graph

USE CASE 3

Inspect peak activations and neighbors for a specific feature index during generation

USE CASE 4

Swap in Pythia, Gemma, or Mistral to study SAEs across different base models

Tech stack

PythonPyTorchSAELensWebSocketThreeJS

Getting it running

Difficulty · moderate Time to first run · 30min

First run downloads GPT-2 and an SAE from HuggingFace; CPU works but is ~900 ms per token, so a CUDA GPU is strongly recommended.

In plain English

AXON is a tool for watching a language model think in real time. It runs a small version of GPT-2, the language model from OpenAI, and as the model generates each token of text, it shows you which internal concepts inside the model are firing. The result is a live, interactive 3D graph in your browser where each glowing point is a concept and connections appear between concepts that activate together. The technique behind this comes from an area called mechanistic interpretability. A Sparse Autoencoder, or SAE, is a separate small neural network that has been trained to break a language model's internal state into a long list of features that are each meant to stand for one human-readable concept. AXON hooks into GPT-2 at layer 8, takes the model's hidden state for each new token, passes it through an SAE from a library called SAELens, picks the top features, and looks up labels for them from a public website called Neuronpedia. It then streams the token, the features, and their activation strengths to the browser over a WebSocket. The interface, built with Three.js and 3d-force-graph, draws features as nodes and co-activating features as edges. Node size and brightness grow with activation strength and slowly fade. Clicking a node flies the camera to it and opens an inspector showing the feature index, label, current and peak activation, neighbors, and a link to its Neuronpedia page. A sidebar exposes generation knobs like temperature, top-K, top-P, repetition penalty, max tokens, feature top-K, and an activation threshold. To run it you need Python 3.11 and at least 8 GB of RAM, with a GPU strongly recommended. You clone the repo, create a virtual environment, install requirements, and run server.py, then open http://127.0.0.1:8000. The first run downloads GPT-2 and the SAE from HuggingFace. There are instructions for installing the CUDA build of PyTorch, a timing table showing roughly 35 ms per token on an RTX 4050 down to 900 ms on a CPU, and a guide for swapping in other supported models like GPT-2 medium, large, XL, Pythia, Gemma, Mistral, and LLaMA-2 by editing a few constants at the top of server.py.

Copy-paste prompts

Prompt 1
Clone 09Catho/axon, set up a Python 3.11 venv, and run server.py to open the live GPT-2 graph at 127.0.0.1:8000
Prompt 2
Edit server.py to swap GPT-2 small for Pythia and point at the matching SAELens checkpoint
Prompt 3
Add a feature filter that hides any node whose Neuronpedia label contains the word punctuation
Prompt 4
Export the per-token activation stream to a JSONL file for offline analysis
Prompt 5
Install the CUDA build of PyTorch so axon runs at 35 ms per token on my RTX 4050
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.