Provides guidance for performing causal interventions on PyTorch models using pyvene's declarative intervention framework. Use when conducting causal tracing,…
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)
don't have the plugin yet? install it then click "run inline in claude" again.