Skip to content

gpt2 SAE recipe: interactive feature-explorer dashboard - #1697

Draft
polinabinder1 wants to merge 3 commits into
pbinder/evo2-sae-dashboardfrom
pbinder/gpt2-sae-dashboard
Draft

gpt2 SAE recipe: interactive feature-explorer dashboard#1697
polinabinder1 wants to merge 3 commits into
pbinder/evo2-sae-dashboardfrom
pbinder/gpt2-sae-dashboard

Conversation

@polinabinder1

Copy link
Copy Markdown
Collaborator

What this is

A GPT-2 small SAE feature explorer — the NLP sibling of the existing evo2 / esm2 / codonfm interpretability recipes. It pairs TransformerLens GPT-2 small with Joseph Bloom's layer-7 residual SAE (blocks.7.hook_resid_pre, 24,576 features) and serves an interactive dashboard for browsing, probing, and steering features on ordinary text.

Key points

  • Reuses the shared sae lib and the feature_explorer dashboard unchanged apart from a small text adaptation (~95-line frontend diff: evo2/DNA-specific copy scrubbed for NLP). No forked infrastructure.
  • Neuronpedia labels: bundles 24,570 auto-interp explanations for this exact SAE (gpt2-small/7-res-jb, index-aligned), so nearly every feature is searchable by concept in the pickers. Plus a curated ⭐ steerable set verified to move generations.
  • CPU-capable, no gated model — GPT-2 small runs comfortably on CPU, nothing to request access for. Great as a low-friction interpretability demo.
  • Prebuilt dashboard dist bundled (parquets + labels + JS assets) so gpt2-sae serve is one step — no build needed to try it.
  • Backend exposes the same /api surface as the sibling recipes (/annotate, /generate feature-clamped steering, /gene_embed for the UMAP tab), plus a terminal CLI (gpt2-sae annotate|generate|serve).

Lint (ruff) clean and the CPU-only unit tests (5) pass; they do not download the model.

Stacking

Stacked on #1623 — base branch is pbinder/evo2-sae-dashboard. Review/merge that first; this PR's diff is only the new recipes/gpt2/ tree plus one line adding recipes/gpt2 to the uv workspace members.

🤖 Generated with Claude Code

TransformerLens GPT-2 small + Joseph Bloom's layer-7 residual SAE (24,576
features). Reuses the shared `sae` lib and the `feature_explorer` dashboard
(a ~95-line frontend adaptation, evo2/DNA text scrubbed). Bundles 24,570
Neuronpedia auto-interp labels + a curated star steerable set. CPU-capable,
no training/gated model. Prebuilt dashboard dist bundled for one-step serve.
Stacked on #1623.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e80c9e02-4c79-48b4-9d73-3d5b73033454

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pbinder/gpt2-sae-dashboard

Comment @coderabbitai help to get the list of available commands.

@polinabinder1
polinabinder1 marked this pull request as draft July 28, 2026 04:55
@copy-pr-bot

copy-pr-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

polinabinder1 and others added 2 commits July 28, 2026 23:28
gpt2 now serves evo2's dashboard (config-driven via /api/health `ui` block;
evo2 defaults to DNA, unchanged) and ships backend + `dashboard_data/` only —
drops ~9.6k duplicated dashboard/lockfile/built lines. Finer text-label scrub
deferred to a config-driven follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
/api/health now reports restart_enabled from ALLOW_ENGINE_RESTART (was hardcoded
False), and POST /api/restart exits the worker with code 42 for a respawn wrapper
to bring back — same contract as evo2's launch_inference.sh serve. Button stays
off (409) unless run under a respawn loop that sets the flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: polinabinder1 <pbinder@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant