pyvene-interventions

Configure and execute causal interventions on PyTorch models.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/t2ance/dr-claw-plugin --skill pyvene-interventions-t2ance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pyvene-interventions
Source: https://github.com/t2ance/dr-claw-plugin/tree/main/plugins/ml-frontiers/skills/mechanistic-interpretability/pyvene
Command: npx skills add https://github.com/t2ance/dr-claw-plugin --skill pyvene-interventions-t2ance

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

pyvene-interventions provides a structured approach to designing, running, and sharing causal interventions on PyTorch models using the pyvene framework. It enables researchers and engineers to perform causal tracing, activation patching, interchange intervention training (IIT), and hypothesis testing across transformer components in a reproducible, configurable manner.

Core Features & Use Cases

  • Declarative configuration with IntervenableConfig and RepresentationConfig to specify targeted layers and components.
  • Support for multiple intervention types (VanillaIntervention, RotatedSpaceIntervention, LowRankRotatedSpaceIntervention, CollectIntervention, etc.) and unit specifiers (layer, unit, pos).
  • End-to-end workflows including activation patching, causal tracing, IIT, and model steering, with forward passes and generation integration.
  • Reproducibility and sharing through model save/load and HuggingFace hub integration.

Quick Start

Create a simple intervenable config targeting a layer and patch activations from a source input into a base input, then run a forward pass to observe the effect.

Frequently Asked Questions about pyvene-interventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run causal tracing and activation patching on PyTorch models?

Interchange intervention training (IIT) and hypothesis testing across transformer components are supported through declarative IntervenableConfig and RepresentationConfig targets. The framework applies both static and trainable interventions to test causal hypotheses on model components.

Can I use trainable interventions instead of static activation patching?

Targeted layers and components are specified using RepresentationConfig with unit specifiers for layer, unit, and position. This declarative approach defines precise intervention targets within the IntervenableConfig for reproducible causal experiments.

Does pyvene-interventions support saving and loading intervention configurations?

Supported intervention types include VanillaIntervention, RotatedSpaceIntervention, LowRankRotatedSpaceIntervention, and CollectIntervention. These are configured declaratively within IntervenableConfig to target specific model components for causal tracing and activation patching.

What's the best way to steer a transformer model using causal interventions?

Model steering is achieved through declarative causal interventions using IntervenableConfig with forward passes and generation integration. You apply static or trainable interventions to targeted components to control and observe model behavior changes.