A language model gives you an answer. Understanding what changed inside the model—and whether that change matters to its output—is a harder problem.
I built GhostTrace to make that investigation easier to inspect, repeat, and share.
It’s a local-first research engine and visual workbench for controlled prompt comparisons and mechanistic interpretability experiments. You can compare model responses, inspect internal activations, run targeted interventions, and export evidence that someone else can replay without loading the model.
Start with evidence you can explore
One decision shaped the project: opening a research tool should give you a way to understand it before asking you to download model weights.
GhostTrace includes recorded measurements from Qwen2.5-0.5B-Instruct running locally on CPU in FP32.
To explore them:
npm ci
npm run dev
Open http://127.0.0.1:5173 and choose Open recorded smoke, or open the Research lab → Recorded research case.
After setup, recorded replay requires no model download or running inference backend. The workbench loads saved evidence rather than generating new measurements.
There’s also an in-app walkthrough, captions, a guided demo, and searchable help.
From prompt comparisons to internal interventions
The original workflow compares controlled prompt conditions. It records generated responses and aligned residual activations, with repeat, label-only, and wording controls.
The bundled smoke diagnostic completed all 42 planned units, covering three development scenarios, two template families, and three instruction conditions.
That establishes a small working diagnostic. A full confirmatory study still requires additional review and evidence.
The newer Research Lab goes deeper. Its recorded copying example lets you inspect:
- A component graph with attention-head and grouped-query attention structure.
- Signed activation tiles for residual streams, attention and MLP inputs, head contributions, and selected MLP channels.
- Logit-lens readouts showing how intermediate representations relate to target-token predictions.
- Patching and ablation experiments that measure how targeted changes affect the output.
- Gradient attribution alongside exact intervention checks.
The goal is to connect an observation to an experiment: identify a component, inspect its activity, change it under a defined control, and measure the result.
A visualization needs an evidence trail
An activation difference can be interesting without explaining a behavior.
A component might change because of literal prompt wording, token position, sequence length, or ordinary instruction following. Gradient attribution provides another useful signal, but its relationship to an actual intervention needs checking.
GhostTrace keeps those distinctions visible.
For example, replacing the entire final residual stream can serve as an endpoint positive control. A successful replacement does not establish that we discovered a circuit.
The recorded research case also includes dictionary projections and a small trained affine lens. Their limits matter:
- The coordinate-identity dictionary is a diagnostic basis, not a learned sparse autoencoder.
- Reconstruction error remains visible.
- The affine lens was fitted on 24 development prompts and evaluated on eight held-out prompts.
- Those small datasets do not establish broad predictive quality.
Negative effects and recovery values outside the usual range remain in the evidence. They’re part of what happened.
Replay is part of the research workflow
Sharing a screenshot is easy. Sharing enough information to inspect the experiment is harder.
GhostTrace supports portable evidence bundles, integrity checks, and offline metric recomputation. Saved results can be viewed without loading model weights.
That gives the project two useful workflows:
Explore recorded evidence: inspect outputs, graphs, activations, and controls.
Run local experiments: configure conditions and targets, queue capture or intervention jobs, then export the resulting evidence.
The live stack uses React, TypeScript, and Vite for the interface; FastAPI for the API; SQLite-backed job storage; and a single explicit worker. Model capture uses direct Transformers hooks.
To start the local stack:
uv sync --frozen --extra test
npm run dev:full
Live inference requires a separate, explicit model setup. Starting the application or opening saved results does not download model weights.
Keeping research claims bounded
The project includes automated checks for API contracts, storage and recovery, evidence handling, browser workflows, and real-model behavior.
Human review remains a separate requirement.
Dataset review, blinded ratings, a full confirmatory pilot, and final human release QA are still pending. Missing evidence stays pending.
That boundary is especially important for the original persona experiments. An instruction labeled “remorseful” describes a prompt condition. A response expressing regret does not establish a feeling, and a representation difference does not establish a psychological state.
GhostTrace is a tool for investigating model behavior. The conclusions still have to be earned through the experiment.
What I want to improve next
The next work is completing the human review process, expanding the evidence beyond small diagnostics, and making it easier to follow an experimental question through to its controls and results.
I’m particularly interested in feedback from people building interpretability tools:
What information do you need to inspect before you trust an activation or intervention result?
Watch the walkthrough
See GhostTrace in action:
Top comments (0)