# Parameter Space Inspector vs pyvene

pyvene is Stanford NLP's Python library for interventions on PyTorch model internals, from activation patching to trainable rotated subspaces. The Parameter Space Inspector offers patching and cuts in a window. Where the two meet and where they part.

Canonical: https://parameterspaceinspector.com/compare/psi-vs-pyvene/  
Updated: 2026-10-16  
Part of the Parameter Space Inspector (free, open-source desktop app) · section: https://parameterspaceinspector.com/compare/ · Site guide for AI: https://parameterspaceinspector.com/llms.txt

> **Short version.** pyvene is for people who design interventions: swap, zero, add, collect, rotate a subspace, train the intervention itself, and save it to Hugging Face. The Parameter Space Inspector offers the interventions most people need, patching, knock-outs, concept deletion, cuts and feature steering, as views with controls. Researchers building a new method want pyvene; people with a question want the Inspector.

## Side by side

| | Parameter Space Inspector | pyvene |
|---|---|---|
| What it is | Desktop instrument that opens a local model and measures it | Python library for intervening on the internal states of PyTorch models |
| Made by | The Emergence Machine | Stanford NLP (Wu, Geiger, Arora, Huang, Wang, Goodman, Manning, Potts) |
| Licence | Apache-2.0 | Apache-2.0 |
| How you use it | Views with controls | `pip install pyvene`; interventions as configs on an `IntervenableModel` |
| Models | Any GGUF for answers; any Hugging Face-format folder for inside views | Any PyTorch model; bundled definitions for GPT-2, Llama, Mistral, Gemma, Qwen 2 and 3, OLMo, GPT-OSS and others |
| Interventions | Activation patching, knock-outs with random controls, concept lighting and deletion, structured and weight cuts, SAE feature steering | Vanilla swap (activation patching), zero, addition, subtraction, noise, collect, skip, rotated-space (DAS) and low-rank variants, autoencoder latent swaps; trainable interventions; generation-time |
| Visualisation | Every intervention is a view with its result | None |
| Save and share | Cuts saved as model folders with every deleted part listed; recipes and receipts | `IntervenableModel.save(..., save_to_hf_hub=True)` uploads interventions |
| Activity | Active | 0.1.8 on 2025-05-26; commits into 2026 |

## Where pyvene is the better choice

Causal abstraction research and new intervention types, especially trainable ones such as distributed alignment search, and ReFT-style fine-tuning through its sibling library. If the intervention is the contribution, pyvene is the tool.

## Where the Inspector is the better choice

Applying the standard interventions to a question about one model, with the controls attached and the understanding tests scored beside an untrained twin.

## See it in a case study

Each of these is a published study you can repeat in the Inspector and change to your own question.

- **Activation patching**: [Where is the fact decided?](/blog/where-is-the-fact-decided-activation-patching/), which mapped where copying one activation from the Eiffel Tower prompt brings "Paris" back: a band of middle layers at the subject's position.
- **Concept lighting and deletion**: [Where is the fact decided?](/blog/where-is-the-fact-decided-activation-patching/), which lit up "Bluetooth" and deleted 1,117 of its neurons over several rounds, against random neurons as a control, and the model still answered correctly.
- **Knock-outs with random controls**: [Reproduce a published result tonight](/blog/reproduce-the-phase-shift-on-your-laptop/), which knocks out Pythia-410m's strongest induction heads beside the same number of random heads, so a loss counts only if random heads do not cause it.
- **Cuts saved as model folders with every deleted part listed**: [Find the tipping point before you prune](/blog/find-the-tipping-point-before-you-prune/), which found where random cuts break Qwen3-4B and saves the cut as a folder listing every deleted part and the hash of every file.
- **Recipes**: [Merging two specialists: run the experiment](/blog/merge-two-specialists-run-the-experiment/), which built a merge as a hash-pinned recipe and found addition fell from 80.5% to 49.5%, below joint training at 86%.
- **The understanding tests beside an untrained twin**: [Audit a fine-tune before you trust it](/blog/audit-a-hugging-face-fine-tune-before-you-trust-it/), which runs the understanding tests on a candidate and on its base, each against the untrained twin, and counts a pass only beyond 0.5 nats.

## Questions people ask

### How do I capture the residual stream in pyvene?

With a collect intervention on the residual component; it is the library's most-asked question. The Inspector's Neural net view records every layer's residual by default.

### Does pyvene work with gradient checkpointing?

An open issue reports incompatibility. The Inspector does not train through its interventions, so the question does not arise.

### Can I share an Inspector cut the way pyvene shares an intervention?

Yes: a cut is a standard model folder with `cut.json` and the base model's hashes, pushed to Hugging Face with the `psi-cut` tag.

---

*Facts about pyvene verified on 2026-10-16 from its [repository](https://github.com/stanfordnlp/pyvene), [documentation](https://stanfordnlp.github.io/pyvene/) and [PyPI](https://pypi.org/project/pyvene/). Corrections welcome.*

---

From [The Emergence Machine](https://emergencemachine.com/). Newsletter: [subscribe on Substack](https://theemergencemachine.substack.com/subscribe). Use-case feed: https://parameterspaceinspector.com/feed.xml. Follow: [Substack](https://theemergencemachine.substack.com) · [YouTube](https://www.youtube.com/@emergencemachine) · [X](https://x.com/emergences4me) · [Bluesky](https://bsky.app/profile/emergencemachine.bsky.social) · [Reddit](https://www.reddit.com/r/emergencemachine/) · [Instagram](https://www.instagram.com/emergencemachine/) · [TikTok](https://www.tiktok.com/@emergencemachine) · [Kaggle](https://www.kaggle.com/emergencemachine/datasets).
