
pyvene Causal Interventions
Guides an agent through causal tracing and activation patching experiments on PyTorch models with pyvene.
- Repository
- Orchestra-Research/AI-Research-SKILLs
- Stars
- 14,195
- Licence
- MIT
- Files
- 4 files
What it does
When installed, the agent gets a structured guide to pyvene, a Python library for testing which internal parts of a neural network cause a model's behavior. It explains how to set up intervention configs, swap or zero out activations between runs, sweep over layers and positions for causal tracing, and run activation patching for circuit analysis. The skill is mainly reference material and code templates; it helps the agent write and explain these experiments correctly.
Great for
- Interpretability researchers who want to localize where a model stores a fact or computes a task
- Students learning causal tracing or activation patching on small open models like GPT-2
- Engineers reproducing intervention experiments with pyvene
Skip it if
- Exploratory activation analysis or quick probing, where TransformerLens or nnsight is a simpler fit according to the skill's own guidance
- Running on very large models without suitable GPU memory, since sweeps over every layer and position are compute-heavy
- Production model safety decisions, since the skill covers research experiments rather than validated evaluation
Try asking
- “Run a causal tracing sweep on GPT-2 XL to find layers where the fact about the Space Needle is stored”
- “Write a pyvene activation patching experiment that swaps block outputs between clean and corrupted prompts”
- “Set up an IOI-style logit difference test to see which attention outputs matter for indirect object prediction”
- “Explain the difference between VanillaIntervention and AdditionIntervention for my experiment”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 4 original files, the MIT licence and an attribution note.
pyvene.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip pyvene.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip pyvene.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Start with the small gpt2 model to check your setup before running sweeps on gpt2-xl
- Ask the agent to review the code before running it, since the examples load models and run loops that can take significant time and memory
- Verify the example's token choice and prompt design yourself, as the SKILL.md snippets are templates and some details (such as the corrupted prompt and token indexing) may need adjustment
What's inside
- references/api.md
- references/README.md
- references/tutorials.md
- SKILL.md
Redistributed unmodified from Orchestra-Research/AI-Research-SKILLs under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.