GPT-2 Activation Viewer

This repository also includes a lightweight GPT-2 activation viewer for prompt-level inspection. It is separate from the small-transformer retrieval experiments and is best treated as a compact inspection tool rather than part of the main paper evidence.

GPT-2 activation viewer interface
Figure 1. Prompt-level GPT-2 activation viewer bundled with the repository.

Build A Viewer Payload

.venv/bin/python scripts/build_interactive_model_viewer.py \
  --prompt "The secret code is 73914. Repeat the secret code exactly:" \
  --prompt-id demo_prompt_001 \
  --task copy \
  --model gpt2-small \
  --out outputs/viewer_payload.json

Run The Viewer

cd webapp
.venv/bin/python -m http.server 8000

Then open http://localhost:8000 and upload outputs/viewer_payload.json.

Repository Sources