Multi-component Causal Tracing in Large Language Models

Zirui Yan, Dennis Wei, Dmitriy A. Katz, Prasanna Sattigeri, Ali Tajer

TL;DR

Traditional causal tracing isolates single components in Large Language Models (LLMs) to understand their inner workings, but it misses the complex, non-linear interactions between multiple components. This paper introduces a unified framework and an efficient gradient-based algorithm (PGB-CT) to trace multiple components simultaneously. By relaxing a massive combinatorial search into a continuous optimization problem, the method identifies critical circuits influencing bias and factuality with massive speedups over traditional search baselines.

What Problem Does This Paper Address?

LLMs are powerful but prone to safety risks like societal bias, hallucinations, and vulnerability to jailbreak attacks. To fix or edit these models, mechanistic interpretability researchers use causal tracing (or activation patching) to pinpoint exactly where knowledge or biases are stored.

However, prior work mostly looked at individual neurons or entire layers in isolation. The authors demonstrate that model components do not act alone; intervening on pairs of attention heads or MLP neurons reveals significant non-linear interactions (as shown in the deviation from linearity in the figure below).

The deviation from linearity when intervening on pairs of attention heads (left) and MLP layers (right).

Finding the optimal subset of multiple components to explain a behavior is a combinatorial nightmare—the search space grows exponentially with model size, making brute-force or greedy searches computationally intractable for modern LLMs.

Methods

To bypass this combinatorial explosion, the authors propose the Penalized Gradient-Based Causal Tracing (PGB-CT) algorithm. Instead of treating component selection as a hard discrete choice, they introduce a series of continuous approximations:

  1. Continuous Relaxation: They introduce a soft masking vector $m \in [0, 1]^N$, allowing gradient descent to explore the component space rather than making a hard binary choice (intervene vs. don't intervene).
  2. Inverse Metric Transformation: Raw evaluation metrics can be unbounded or wildly unstable across training stages. PGB-CT minimizes a transformed loss, $\frac{1}{1 + \ell(D, m)}$, keeping gradients stable and well-calibrated.
  3. Scheduled Penalty Function: To force the soft masks back into sparse, binary choices by the end of optimization, they use a custom regularization term combining an $\ell_1$ norm (for sparsity) and a binarization penalty $m^\top(1-m)$. Crucially, the regularization strengths ($\lambda_1, \lambda_2$) are dynamically scheduled to increase over time, allowing broad exploration early on before locking into a sparse binary mask.

The overall framework relies on comparing an observational run against a counterfactual run via a mixture forward pass:

Counterfactual intervention framework in LLMs.

Datasets

The framework was evaluated across several datasets targeting different model behaviors:

  • WinoGender & WinoBias: Benchmarks derived from the Winograd Schema Challenge to evaluate gender bias in coreference resolution.
  • Professions: A dataset designed for neuron-level intervention analysis regarding gender stereotypes linked to occupations.
  • CounterFact: A dataset of factual assertions used to evaluate knowledge localization and factual correctness.
  • Variable Binding Desiderata (VBD): An algorithmic dataset testing value dependence and operation invariance to evaluate circuit discovery.

Key Insights and Ideas

  • Non-Linearity is the Rule, Not the Exception: Jointly intervening on components yields effects that are vastly different from the sum of individual interventions. Linear approximations of LLM internals fail to capture these emergent behaviors.
  • MLP Dominance: When pooling all attention heads and MLP neurons together, optimization algorithms naturally favor MLPs because they are vastly more numerous and exert a much stronger combined effect. To find meaningful hybrid circuits, researchers must group MLP neurons by layer to balance them against attention heads.
  • The "Half-Half" Rule: Across various models, the authors observed a striking pattern: roughly 50% of the attention heads or neurons collectively boost a target metric, while the other 50% actively diminish it.

Key Results

PGB-CT consistently matches or outperforms top-$k$ and greedy baselines in identifying high-impact components while offering dramatic computational savings:

  • Massive Speedups: On GPT2-medium using the WinoGender dataset, PGB-CT achieved a 1.76x speedup over top-$k$ selection and a massive 229x speedup over the greedy baseline.
  • Scalability: Unlike top-$k$, which fails to scale as model sizes grow, PGB-CT scales efficiently to larger architectures like Qwen3-1.7B and Llama3.2-1B, reducing execution times from days or hours down to mere minutes.
  • Circuit Discovery: It successfully identified specific multi-component circuits; for instance, on LLaMA-13B with the VBD dataset, it isolated a precise combination of 8 attention heads and 2 MLP blocks that governed the target behavior.
Gender bias measure vs. number of attention heads (left) and the specific heads selected at 20% sparsity (right).

Limitations and Future Work

  • Static Objectives: The current approach requires a single, fixed target metric or objective to be specified in advance for a finite dataset.
  • Hyperparameter Sensitivity: The algorithm relies on careful tuning and scheduling of the regularization parameters ($\lambda_1, \lambda_2$) to achieve the exact desired level of sparsity.
  • Scope of Evaluation: Due to the extreme inefficiency of the baselines being compared against, experiments were primarily limited to English datasets and models up to ~13B parameters. Testing generalizability across diverse languages and massive model scales (e.g., 70B+ parameters) remains future work.

Summary updated

Abstract

Causal tracing systematically intervenes on a large language model's (LLM's) internal representations to uncover and quantify the causal pathways linking specific inputs or computations to specific metrics of interest, quantifying the LLM's behavior. Building on previous single-component or single-layer studies, this paper presents a unified framework for causally tracing multiple components simultaneously. This framework systematically identifies the subsets of components (e.g., attention heads and multi-layer perceptron neurons) most critical to a desired target performance metric (e.g., accuracy and fairness). This is achieved by incorporating flexible interventions applied to a wide range of desired metrics. To address the combinatorial complexity of the multi-component problem, an efficient algorithm is designed that leverages soft interventions and a carefully designed metric transformation, converting the combinatorial search problem into a continuous one that can be solved efficiently under proper constraints, thereby generating proper binary decisions for selecting components. Experimental results demonstrate that the proposed method efficiently identifies subsets of the model's components that have a high impact on the target metric, outperforming existing baseline approaches. Our code is available at https://github.com/ZiruiYan/multi-component-causal-tracing.
BibTeX
@inproceedings{yan2026multi,
  author = {Zirui Yan and Dennis Wei and Dmitriy A. Katz and Prasanna Sattigeri and Ali Tajer},
  title = {{Multi-component Causal Tracing in Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.154},
}
Figure