attribution-patching

Compute gradient-based attributions to approximate activation patching for circuit analysis.

9|2|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/ndif-team/skills --skill attribution-patching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: attribution-patching
Source: https://github.com/ndif-team/skills/tree/main/plugins/nnsight/skills/attribution-patching
Command: npx skills add https://github.com/ndif-team/skills --skill attribution-patching

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Gradient-based attribution patching provides a scalable alternative to exact activation patching by using gradients to approximate patch effects, enabling analysis across thousands of components without dozens of forward passes.

Core Features & Use Cases

  • Efficiently estimate per-component contributions by combining clean vs. corrupted activations with backward gradients.
  • Supports batch processing across multiple prompts and layers, enabling large-scale circuit analysis.
  • Useful for rapid hypothesis testing, instrumentation, and screening before targeted, exact patching.

Quick Start

Run attribution-patching on a model to generate layer-wise attributions for a given prompt.

Frequently Asked Questions about attribution-patching

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

FAQPage Schema
What is gradient-based attribution patching in neural network interpretability?

Gradient patching approximates exact activation patching for circuit analysis by using backward gradients to estimate per-component contributions, comparing clean versus corrupted activations to yield attribution scores without multiple forward passes.

How do I scale circuit analysis across thousands of transformer components?

You can scale circuit analysis by using gradient patching to approximate activation patching effects, enabling rapid evaluation of thousands of neural network components across multiple prompts and layers without dozens of forward passes.

When should I use gradient patching instead of exact activation patching?

Use gradient patching for rapid hypothesis testing, instrumentation, and large-scale screening across multiple prompts and layers before committing to targeted, exact activation patching on specific components.

Can I batch process attribution scores across multiple transformer prompts and layers?

Yes, attribution patching supports batch processing across multiple prompts and layers, combining clean and corrupted activations with backward gradients to efficiently generate layer-wise attribution scores for downstream interpretation.

What are the limitations of using gradient approximations for circuit analysis?

Gradient patching provides approximate rather than exact attribution scores, meaning it is best suited for initial screening and rapid hypothesis testing before running targeted, exact activation patching for precise circuit analysis.