Generative Causal Mediation (GCM)
- Generative Causal Mediation (GCM) is a framework that pinpoints and edits sparse attention heads to control long-form language model responses.
- It employs contrastive prompt pairs and counterfactual activation patching to rank heads by their causal indirect effects for precise intervention.
- Empirical studies show that GCM outperforms correlational baselines in steering behaviors like refusal, sycophancy, and style transfer in 10–14B models.
Generative Causal Mediation (GCM) is a framework for locating and steering the internal components of a LLM (LM)—in particular, attention heads—that causally mediate a binary, contrastive concept expressed over long-form outputs. It is designed for settings in which the target behavior is diffused across many tokens of a response, such as refusal, sycophancy, or verse style, and therefore is not well captured by token-local probes or heuristics. GCM uses a small, manually curated dataset of minimally differing prompt pairs and their corresponding long generations to quantify how each attention head contributes to producing the contrastive behavior, rank heads by causal indirect effect, and apply sparse, targeted interventions at inference time. The framework cleanly separates “where to steer” from “how to steer,” and it consistently outperforms correlational probe-based baselines and random baselines across three tasks and three 10–14B-parameter models (Sankaranarayanan et al., 17 Feb 2026).
1. Problem setting and conceptual scope
GCM addresses the question of where to intervene in an LM in order to control behaviors that are expressed over long-form responses rather than isolated token decisions. The operative setting is binary and contrastive: an “original” prompt elicits a baseline or negative response, while a minimally different “contrastive” prompt elicits a positive or target response. Examples studied include refusal inducement, sycophancy reduction, and verse-style transfer (Sankaranarayanan et al., 17 Feb 2026).
The central premise is that long-form behaviors may be mediated by a sparse subset of internal components even when the behavior itself is distributed across many output positions. GCM therefore treats attention heads as candidate mediators and asks which of them causally transmit the change from the original prompt-response trajectory to the contrastive one. This stands in contrast to approaches that rely on correlational probes, random selection, or heuristics tied to individual tokens.
A recurrent description in the work is “surgical” intervention. In this context, “surgical” refers to selecting only the strongest mediating heads—typically a small fraction of all heads—and editing those components at inference time. The reported goal is not blanket perturbation of the network, but sparse control that preserves overall fluency and relevance while amplifying or suppressing a specific concept (Sankaranarayanan et al., 17 Feb 2026).
2. Formal mediation objective
Let be a prompt that elicits a baseline response , and let be a minimally different prompt that elicits a contrastive response . Let denote the output of a single attention head at a particular layer and token position. GCM defines mediation through counterfactual activation patching: on input , the head activation is replaced with the corresponding activation obtained under , while the rest of the model is re-run unchanged (Sankaranarayanan et al., 17 Feb 2026).
The indirect effect of patching head is defined as
0
This quantity measures how much more likely the LM is to generate the contrastive response rather than the baseline response solely by swapping the activation of that head from the contrastive context. Over a dataset
1
GCM computes the average indirect effect
2
and ranks all heads by descending 3 (Sankaranarayanan et al., 17 Feb 2026).
Two cheaper first-order approximations are also given. Attribution patching uses a single backward pass:
4
or, equivalently in dataset-averaged form,
5
where 6. Head knockout instead sets the contrastive activation to zero:
7
The top 8 of heads with highest indirect effect are then selected for steering, with 9 used as the sparse localization regime (Sankaranarayanan et al., 17 Feb 2026).
3. Localization pipeline and steering mechanisms
For each binary concept, GCM constructs 0 pairs of minimally different system or user prompts that differ in exactly one token or phrase yet reliably flip the model’s long-form behavior. Their outputs are generated deterministically with temperature 1 and greedy decoding, producing baseline and contrastive references of length approximately 2 tokens. Each pair is vetted by an auxiliary 70B-parameter LM judge to ensure the concept is present or absent as intended (Sankaranarayanan et al., 17 Feb 2026).
The operational workflow has two phases. In localization, the model is run on both 3 and 4, head activations are extracted, each head is patched in turn, and the resulting indirect effect is accumulated over the dataset. After averaging, the top-5 heads are retained. In steering, a new prompt is generated token by token, and at each layer and token where a selected head appears, an activation-editing recipe is applied.
The steering methods are explicitly separated from localization. GCM studies several recipes:
- Activation patching / full-vector patching: directly replace the head’s residual-output vector with the contrastive-prompt value, possibly scaled by 6.
- Difference-in-Means steering: add 7 to 8 at each generation step.
- Mean steering: add 9.
- Representation Fine-Tuning (ReFT): insert, for each selected head, a small adapter that learns a low-rank subspace 0 and weights 1 such that
2
projecting 3 activations toward the 4 subspace. This is trained supervised on 5 pairs (Sankaranarayanan et al., 17 Feb 2026).
The hyperparameters 6 and 7 are tuned by grid search over 8 and 9. Reported performance saturates around 0 and 1, which is consistent with the claim that sparse intervention can suffice for control (Sankaranarayanan et al., 17 Feb 2026).
4. Experimental design and empirical findings
The empirical evaluation uses three models—SOLAR-10.7B, OLMo-13B-DPO, and Qwen1.5-14B-Chat—and three tasks: refusal, sycophancy, and verse style transfer. For each task, 50 contrastive pairs are used as held-in data for localization and steering-vector construction, and 300 held-out prompts are used for transfer evaluation (Sankaranarayanan et al., 17 Feb 2026).
Evaluation is performed by a Llama-3.1-70B-Instruct judge on three binary axes derived from discrete rating schemes. Concept presence is scored on a 5-point Likert scale, with success if the rating is “Strongly agree.” Relevance and fluency are ternary, with success if the rating is “2.” Only responses that pass all three criteria are counted as steering successes. The automatic judgments are reported as 87% accurate versus human labels, with 2 (Sankaranarayanan et al., 17 Feb 2026).
Several quantitative findings are emphasized. Average Steering Success over 120 3 settings is reported, for the Diff-in-Means steering recipe, as 0.40 with Full Patch, 0.40 with Attr Patch, 0.26 with Knockout, 0.34 for Probes (ITI), and 0.27 for Random. Activation patching and attribution patching consistently outperform inference-time linear probes and random selection baselines with 4 under a one-sided Wilcoxon test with FDR correction. Knockouts do not reliably beat baselines. On held-out data, transfer rates range from 10–30% for sycophancy, 40–80% for refusal, and 20–80% for verse, depending on model (Sankaranarayanan et al., 17 Feb 2026).
These results support the paper’s core claim that GCM successfully localizes concepts expressed in long-form responses and can steer them more effectively than correlational baselines when only a sparse set of attention heads is edited.
5. Interpretation, misconceptions, and limitations
A common misconception would be to treat GCM as merely another probe-based selection heuristic. The framework is explicitly presented as causal rather than correlational: heads are ranked by indirect effect under counterfactual activation patching, not by a linear readout’s predictive accuracy. The distinction matters because the reported performance gap is specifically between causally localized heads and heads selected by correlational probe-based baselines (Sankaranarayanan et al., 17 Feb 2026).
A second misconception would be to interpret the method as showing that all controllable concepts are narrowly localized. The discussion reports that, on some tasks and models, “global” steering—applying the same steering vector to all heads—can match GCM’s control, suggesting that these binary concepts are represented along strong global directions. At the same time, the paper notes that global steering can be brittle and may degrade style or factual fidelity in complex scenarios. This suggests that sparsity is not claimed as a universal property of every concept, but as an empirically effective regime for the tasks studied (Sankaranarayanan et al., 17 Feb 2026).
The limitations are also explicit. GCM requires a small set of high-quality contrastive prompt pairs and an auxiliary judge model. Only binary, univariate concepts are studied; more subtle, multi-factor behaviors such as multi-aspect toxicity are described as likely requiring more complex causal graphs and multi-headed interventions. Activation patching remains computationally expensive when measuring indirect effects over large models, which motivates efficient approximations such as attribution patching. Future directions include extension to multi-way mediation, application to other component classes such as MLPs, feed-forward channels, and residual streams, and integration with continual fine-tuning so that localized causal knowledge can inform retraining or distillation (Sankaranarayanan et al., 17 Feb 2026).
6. Relation to broader generative mediation research
GCM belongs to a broader family of methods that combine generative modeling with mediation analysis, but it occupies a distinct technical position. In “Distributional Causal Mediation via Conditional Generative Modeling,” DCMA defines mediation estimands over entire interventional outcome distributions rather than outcome-level summaries. It introduces 5, 6, and 7, learns conditional generators for mediators and outcomes, reconstructs interventional laws by Monte Carlo forward simulation, and supports contrasts including means, quantiles, exceedance probabilities, CDF treatment effects, energy distance, and Wasserstein-1 distance (Zhang et al., 3 May 2026).
In “Disentangled Representation for Causal Mediation Analysis,” DMAVAE addresses observational mediation with latent confounding. It posits three disjoint latent confounder vectors, 8, 9, and 0, uses a VAE-style generative model with a mean-field inference network driven by proxy covariates 1, replaces sequential ignorability with piecemeal deconfounding, and estimates the natural direct effect, reverse natural indirect effect, and total effect from learned conditional distributions (Xu et al., 2023).
By contrast, GCM does not reconstruct population-level interventional outcome laws from observational data, nor does it identify latent confounders for back-door adjustment. It instead treats internal model activations as candidate mediators, uses activation patching to estimate the indirect effect of a component on a contrastive long-form behavior, and then uses inference-time activation edits for control (Sankaranarayanan et al., 17 Feb 2026). A plausible implication is that GCM can be read as a mechanistic, model-internal analogue of mediation analysis: the mediator is not an observed variable in a causal graph over data-generating units, but an internal computational state in a transformer.
7. Significance within LM control
The main significance attributed to GCM is that it marries the rigor of causal mediation analysis to the problem of controlling diffuse, long-form LM behaviors. Its contribution is not only a steering method, but a decomposition of the problem into localization and intervention: first identify the minimal set of truly causal heads for a binary concept, then apply lightweight vector-based edits during generation (Sankaranarayanan et al., 17 Feb 2026).
Within that framing, the method’s empirical profile is specific. It is strongest when the target behavior can be elicited by minimally differing prompts, when a reliable contrastive dataset can be curated, and when sparse head-level edits suffice to alter response trajectories without damaging relevance or fluency. It is less complete as a general theory of representation than as a practical framework for causal localization and control. This suggests that GCM is best understood as a causal-mechanistic method for steering long-form response properties in contemporary autoregressive LMs, rather than as a general replacement for fine-tuning, probing, or distributional mediation analysis.