causal-tracing

Compute total, direct, and indirect causal effects in transformer models.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Causal tracing identifies which intermediate computations causally mediate the relationship between inputs and outputs, revealing not just what correlates with behavior but what causes it.

Core Features & Use Cases

  • Three Types of Causal Effects: total, direct, and indirect effects, plus the interchange intervention for testing causal relationships across runs.
  • Position- and layer-specific tracing: diagnose how different tokens and network layers contribute to final predictions.
  • Use cases include debugging model behavior, validating hypotheses about information flow, and guiding interventions to alter outputs.

Quick Start

Run a tracing session on a language model with base and source prompts to compute total, direct, and indirect causal effects.

Frequently Asked Questions about causal-tracing

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

FAQPage Schema
How do I identify which transformer layers causally influence language model outputs?

Causal tracing identifies which intermediate computations mediate the relationship between inputs and outputs by quantifying total, direct, and indirect effects across specific layers and tokens in transformers.

Can I test causal relationships across different model runs using interchange interventions?

Yes, interchange interventions test causal relationships across runs by applying interventions to trace how different base and source prompts influence intermediate activations and final predictions.

What do I need to compute total, direct, and indirect causal effects on a language model?

You need a LanguageModel instance, a tracing context, and access to model activations and outputs to compute total, direct, and indirect causal effects during a tracing session.

How does causal tracing help debug model behavior in transformers?

Causal tracing debugs model behavior by diagnosing how different tokens and network layers contribute to final predictions, validating hypotheses about information flow and guiding interventions to alter outputs.

What is the difference between direct and indirect effects in causal tracing?

Direct effects measure the immediate causal influence of a component on outputs, while indirect effects capture the causal influence mediated through other intermediate components in the transformer network.

When should I use causal tracing instead of standard activation tracing for interpretability?

Use causal tracing when you need to move beyond correlational interpretability to identify what actually causes model behavior, validating information flow hypotheses through total, direct, and indirect effect quantification.