The short version: REA can open up the software that runs a model, but not the model itself. To see what each layer of a model computes, you need a different toolkit: interpretability. Today sets out an 8-week plan with one question per week, and every method first reproduces a published result before being used on a question of my own.
Today's progress: open-model interpretability, plan and acceptance criteria. Status: the 8-week route, tools, hardware split and verification rules are settled; tomorrow the first experiment runs on the Mac.
What happened
After finishing today's deep dive on REA and Ghidra, I wanted to try one thing: could the same approach reverse engineer a large language model?
REA's capability list gives a clear answer: it opens up everything around the model, but not the model itself.
- An inference engine is ordinary software. REA can read which libraries it depends on, whether hardening is enabled and whether it quietly connects out.
- Many AI desktop apps are built with Electron, and REA can list their internal channels and what they can do to your computer.
- But a model's weights are just billions of numbers. At most REA sees a file list and hashes; it cannot see what those numbers compute.
Answering "how does the model think" needs interpretability tools: open each layer's hidden state, change one thing and watch how the behaviour changes. That is the same loop as reverse engineering: observe, hypothesize, experiment, verify. So for the next 8 weeks I will walk that loop with open models.
A method anyone can use
Interpretability research makes it easy to say appealing but possibly wrong things like "the model thinks of Taiwan at layer 12". Whether you are reading such work or doing it yourself, three questions help:
- Was a known result reproduced first? A new method has to get the same answer on a problem someone has already solved before you can trust the tool and the approach.
- Correlation or causation? "A neuron lights up when it sees Taiwan" is correlation. "Switch it off and the model can no longer answer Taiwan" is causation.
- Is there a control? Compare the effect against a random position or a random direction. Only when yours works and the random one does not does it count.
How different readers can use this:
- If you read the news: when you see "researchers found concept X inside an AI", ask whether it was shown by correlation or by causation.
- If you are an engineer: interpretability does not need a big machine; week 1 runs on a laptop CPU.
- If you are a researcher: treat each week's ground truth as a regression test and rerun it whenever the tool or model changes.
Technical details
Why REA cannot open the model
Tools, one job each
| Tool | Purpose |
|---|---|
| Hugging Face transformers | Reads each layer's output; the week 1 and 2 logit lens needs nothing else |
| TransformerLens | Opens every layer and edits hidden states, for activation patching |
| nnsight | Wraps almost any Hugging Face model, for models TransformerLens does not support |
| SAELens and Gemma Scope | Loads the sparse autoencoders Google DeepMind released for Gemma 2, splitting neurons into readable features |
| circuit-tracer | Anthropic's open-source circuit tracing tool, drawing which features a model passes through from input to output |
| Neuronpedia | Browse features and circuit graphs online first, then run the experiment locally |
Two machines, two roles
The Z13 has far more memory, but with an unverified precondition: its GPU is gfx1151, all earlier inference ran on llama.cpp over Vulkan, and interpretability tools are built on PyTorch. Whether PyTorch runs on this card through ROCm is unknown until tried. So the first three weeks run small models on the Mac, while getting PyTorch working on the Z13 is a parallel task.
The 8-week route
| Week | Question | Method | Ground truth |
|---|---|---|---|
| Week 1 | At which layer does an answer form | Logit lens | Last layer equals the output |
| Week 2 | Do Chinese prompts pass through English | Logit lens and tuned lens | Reproduce Llama's English bias |
| Week 3 | Where is a fact stored | Activation patching | Reproduce the IOI heads |
| Week 4 | Are there readable features | Gemma Scope SAEs | Holds on unseen sentences |
| Week 5 | Does editing a feature change behaviour | Steering | A random direction has no effect |
| Week 6 | Does multi-step reasoning have a middle step | circuit-tracer | Reproduce Dallas to Austin |
| Week 7 | When does a capability appear | Pythia checkpoints | The induction head transition |
| Week 8 | A question of my own | The tools from weeks 1 to 7 | Decide first what would refute it |
- Week 1: the logit lens, to see at which layer an answer forms. The ground truth is that the last layer's translation must equal the model's output.
- Week 2: when asked in Chinese, does the model pass through English inside? First reproduce the direction of the 2024 paper "Do Llamas Work in English?", then compare Qwen2.5, which was trained on a lot of Chinese.
- Week 3: activation patching, to find which layer holds a fact. First reproduce, on GPT-2 small, the attention heads that the IOI study found.
- Week 4: use Gemma Scope to find features such as "Taiwan" or "a bug in code", then check them on unseen sentences.
- Week 5: amplify or suppress a feature and see whether the behaviour follows, compared against a random direction.
- Week 6: use circuit-tracer to reproduce Anthropic's published two-step reasoning example (the capital of the state containing Dallas), then try a Chinese version.
- Week 7: use Pythia's training checkpoints to find when induction heads suddenly form during training.
- Week 8: a question of my own, such as which features change after fine-tuning.
Verification rules
- Every new method reproduces a known result first.
- Always have a control: a random direction, a random position, shuffled sentences.
- Never rely on one example: at least 20 to 50 sentences, reporting the average and the spread.
- Only findings with causal evidence become conclusions; the rest are observations.
- State effect sizes: "the probability fell from 0.8 to 0.3", not "it dropped noticeably".
- Everything can be rerun: pinned versions, recorded model revision hashes, the CPU wherever it is fast enough, no sampling.
Safety and licensing
- Isolated environment: a separate virtual environment, switched to offline mode once the models are downloaded, so experiments run without network access.
- Licences: Gemma and Llama have their own terms. Publishing research results is fine, but redistributing weights must follow the terms. GPT-2 and Qwen2.5 have more permissive licences.
- Dual-use topics: research has found that a model's refusals can be controlled by a single direction, and removing it stops the model refusing. The mechanism is worth understanding, but I will not publish a model with its safety removed, and it is not one of my public questions.
Acceptance status
| Criterion | Today's result | Status |
|---|---|---|
| Each week has a clear question and ground truth | All 8 weeks defined | Done |
| Week 1 runs on existing hardware | The 24GB Mac runs GPT-2 small and Qwen2.5-0.5B | Done |
| The Z13 runs PyTorch | Not verified | Not started |
| Verification rules written as a checklist | 6 rules | Done |
Still unresolved
- PyTorch and ROCm on the Z13: whether gfx1151 works has not been tried.
- Whether middle layers are readable: the logit lens is less reliable on newer models, so a tuned lens may be needed sooner.
- Models for weeks 4 to 6: Gemma 2 and Llama 3.2 require accepting their licence on Hugging Face before download, which I have to do myself.
Takeaways
- REA handles the software around a model; interpretability tools handle what is inside
- One question, one ground truth and one write-up per week
- Reproduce first, then innovate
- Correlation is an observation; only causation is a conclusion
- Get it working on small models; use large ones only to check that conclusions generalize
Tomorrow
Run week 1 on the Mac: use the logit lens to see at which layer GPT-2 small and Qwen2.5-0.5B form their answers, plus a first set of Chinese capital-city prompts to see whether the English answer appears first when the question is in Chinese.