This skill helps you run causal interventions on PyTorch models using Stanford NLP's pyvene library. If you're doing activation patching, causal tracing (ROME-style localization), or interchange intervention training, it walks you through the declarative dict-based API. You get concrete workflows for finding where factual associations live in transformers, testing which attention heads matter for specific behaviors, and training interventions to discover causal structure. It's focused on mechanistic interpretability experiments where you need to patch activations between model runs and share reproducible intervention configs. The guidance assumes you already know why you want to intervene on model internals rather than just probe them.

skills.sh installs
1K
GitHub stars
14.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill pyvene-interventions --agent claude-code

Installs into .claude/skills of the current project.

Files

pyvene: Causal Interventions for Neural Networks

pyvene is Stanford NLP's library for performing causal interventions on PyTorch models. It provides a declarative, dict-based framework for activation patching, causal tracing, and interchange intervention training - making intervention experiments reproducible and shareable.

GitHub: stanfordnlp/pyvene (840+ stars) Paper: pyvene: A Library for Understanding and Improving PyTorch Models via Interventions (NAACL 2024)

When to Use pyvene

Use pyvene when you need to:

  • Perform causal tracing (ROME-style localization)
  • Run activation patching experiments
  • Conduct interchange intervention training (IIT)
  • Test causal hypotheses about model components
  • Share/reproduce intervention experiments via HuggingFace
  • Work with any PyTorch architecture (not just transformers)

Consider alternatives when:

  • You need exploratory activation analysis → Use TransformerLens
  • You want to train/analyze SAEs → Use SAELens
  • You need remote execution on massive models → Use nnsight
  • You want lower-level control → Use nnsight

Sponsors

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
Testing & QA, AI & Agent Building, Data Science & ML
First seen
Jun 3, 2026

More from orchestra-research/ai-research-skills

All 95
1dodopayments avatardodo-best-practicesdodopayments/skillsGuide for initial Dodo Payments setup, including SDK installation, test and live environments, API keys, and the canonical checkout-to-webhook architecture.1Kskills.sh installs
2samuraigpt avatarmuapi-platformsamuraigpt/generative-media-skillsSetup and utility scripts for muapi.ai — configure API keys, test connectivity, and poll for async generation results1Kskills.sh installs
3microsoft avatarsenseimicrosoft/github-copilot-for-azure**WORKFLOW SKILL** — Iteratively improve skill frontmatter compliance using the Ralph loop pattern. WHEN: \"run sensei\", \"sensei help\", \"improve skill\", \"1Kskills.sh installs
4mindrally avatarpython-cybersecurity-tool-developmentmindrally/skillsGuidelines for building Python cybersecurity tools with secure coding practices, async scanning, and structured security testing.1Kskills.sh installs
5alirezarezvani avatarux-researcher-designeralirezarezvani/claude-skillsUX research and design toolkit for Senior UX Designer/Researcher including data-driven persona generation, journey mapping, usability testing frameworks, and re991skills.sh installs
6davila7 avatarsenior-securitydavila7/claude-code-templatesComprehensive security engineering skill for application security, penetration testing, security architecture, and compliance auditing. Includes security assess987skills.sh installs