Manuscript Offprint

arXiv:2610.36524

Causal Localization of Evidence Effects in Transformers

Jipeng Li, Pramod Khargonekar, Yanning Shen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Can controlled symbolic inputs reveal attention heads that influence a language model's decisions from natural language evidence? We introduce controlled evidence aggregation (CEA), which varies the counts and order of two symbols in otherwise fixed prompts and measures changes in a frozen Transformer's preference between two answer tokens. The preference is measured by their logit difference; the prompts prescribe no correct answer. Balanced utility causal selection (BUC) identifies compact head sets by jointly evaluating how much ablating their outputs removes the count effect and how closely patching mean outputs between count conditions recovers the effect in both directions. We derive conditional bounds linking head attribution to intervention effects and specifying when the attribution shortlist can be recovered from finite samples. In Pythia-410M, ablating sets of 1–12 heads selected separately for four ordering regimes removes 65.5–91.6% of the count effect. The sets retain their influence on count comparisons not used for selection. To test relevance beyond symbolic inputs, we evaluate a natural language task asking which state is supported by more reports. Ablating eight heads selected only on symbolic yes/no prompts lowers mean accuracy by 8.2 percentage points, versus 0.8 for random sets matched by size and layer. Our results demonstrate that controlled symbolic probes can identify compact attention head sets whose causal influence extends to natural language decisions.

1 Introduction

Understanding how language models use evidence requires identifying internal components that connect input changes to answer changes (Elhage et al., 2021; Bereska and Gavves, 2024; Rai et al., 2024). Natural language reports pose a control problem: changing the balance of support can change wording and invoke different learned associations. Symbolic inputs allow more restricted changes, but the identified components' relevance to language behavior remains an empirical question. Prior studies demonstrate component reuse across tasks and prompt variants (Merullo et al., 2024; Nainani et al., 2024). We ask: Can controlled symbolic inputs identify attention heads whose causal influence extends to decisions from natural language evidence?

We introduce controlled evidence aggregation (CEA), which varies the counts and order of B and C in prompts to a frozen Transformer while fixing the template, symbol identities, sequence length, and local answer context. The FRONT ordering, for example, compares

50 B | 150 C | 50 A ⟷\longleftrightarrow 150 B | 50 C | 50 A.

Numbers denote repetition counts; both sequences share a tail of 50 A symbols. Both prompts request either various or successful. Their logit difference measures answer preference; its change between count conditions is the count effect. Neither answer is designated correct. CEA therefore supplies a controlled response to localize without training a symbolic rule or assuming pretrained associations are absent.

To localize the count effect, balanced utility causal selection (BUC) evaluates compact head sets through two complementary interventions at the final prompt position. Ablation zeros selected outputs and measures how much the count effect decreases. Mean patching replaces them with averages from the other count condition and measures how closely replacement reproduces the count effect in both directions. Removal and recovery are distinct requirements, consistent with prior work on intervention and evaluation choices (Miller et al., 2024; Shi et al., 2024). BUC uses both scores in greedy search, evaluating sets jointly rather than summing individual head effects. Reuse tests keep selected heads fixed; reselection for each target would test a different claim.

Our theory separates attribution accuracy from selection uncertainty. Under a bound on attribution mismatch, we bound errors in predicting removal and recovery scores from head attribution. We also derive finite sample conditions for recovering the population attribution shortlist. A separate greedy bound applies under monotonicity and weak submodularity to a weighted sum of unnormalized intervention gains, whereas BUC optimizes normalized removal and recovery scores.

To test symbolic localization on labeled behavior, we introduce a natural language (NL) task with sixteen reports supporting two mutually exclusive states. Affirmative and negated reports balance total state word frequencies: the item is open and the item is not closed, for example, both support open. The model answers whether one state has more supporting reports than the other; reversing the comparison reverses the correct yes/no answer. At equal head budget, we compare sets selected only on symbolic yes/no prompts, sets selected on NL prompts, and random sets matched by layer. Patching in the expanded study uses NL donor outputs, so transfer concerns head identities rather than unchanged activation vectors.

In Pythia-410M, ablating sets of 1–12 heads selected separately for four ordering regimes removes 65.5–91.6% of the count effect. The same sets affect count comparisons not used for selection (Section 5.3). In the original NL evaluation, ablating eight heads selected only on symbolic yes/no prompts lowers mean accuracy by 8.2 percentage points, versus 0.8 for matched random sets (Section 5.5). Further tests assess reuse across orderings, answer tokens, and replacement operators. The results show that controlled symbolic probes can identify compact attention head sets whose causal influence extends beyond selection prompts to predictions in a labeled language task.

References (93)

  • Transformers learn to implement preconditioned gradient descent for in-context learning
  • What learning algorithm is in-context learning? investigations with linear models (opens arXiv in a new tab)
  • Transformers as statisticians: Provable in-context learning with in-context algorithm selection
  • Mechanistic interpretability for ai safety—a review (opens arXiv in a new tab)
  • A suite for analyzing large language models across training and scaling
  • A mechanistic analysis of a transformer trained on a symbolic multi-step reasoning task
  • Towards automated circuit discovery for mechanistic interpretability
  • Analyzing transformers in embedding space
  • Approximate submodularity and its applications: Subset selection, sparse approximation and dictionary selection
  • Shared circuits predict whether LLMs generalize across formats in arithmetic reasoning
  • Limits of transformers on compositionality
  • A mathematical framework for transformer circuits
  • Information flow routes: Automatically interpreting language models at scale
  • What can transformers learn in-context? a case study of simple function classes
  • Transformer feed-forward layers are key-value memories
  • Dissecting recall of factual associations in autoregressive language models
  • Localizing model behavior with path patching (opens arXiv in a new tab)
  • In-context learning creates task vectors
  • Transformers as algorithms: Generalization and stability in in-context learning
  • Locating and editing factual associations in gpt
  • Circuit component reuse across tasks in transformer language models
  • Transformer circuit faithfulness metrics are not robust (opens arXiv in a new tab)
  • Adaptive circuit behavior and generalization in mechanistic interpretability (opens arXiv in a new tab)
  • Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, et al. In-context learning and induction heads. arXiv preprint arXiv:2209.11895, 2022. (opens arXiv in a new tab)
  • In-context learning through the bayesian prism
  • OpenAI blog, 1(8):9, 2019
  • A practical review of mechanistic interpretability for transformer-based language models (opens arXiv in a new tab)
  • Hypothesis testing the circuit hypothesis in llms
  • Attribution patching outperforms automated circuit discovery
  • Function vectors in large language models
  • Transformers learn in-context by gradient descent
  • Interpretability in the wild: a circuit for indirect object identification in gpt-2 small (opens arXiv in a new tab)
  • An explanation of in-context learning as implicit bayesian inference (opens arXiv in a new tab)
  • Qwen3 Technical Report
  • Towards best practices of activation patching in language models: Metrics and methods
  • If $p_{+}(x)$ denotes the softmax probability restricted to these two tokens, then
  • Direct attribution is $s_i(x) = \langle v_i(x), d \rangle$
  • The mean patch gain $S(H, r)$ and raw utility $J_{\lambda}(H, r)$, for $\lambda \in [0, 1]$, are convex combinations of these quantities, so their errors are bounded by the same $\varepsilon_{\mathrm{int}}(H, r)$
  • Each directional match equals $g_{\Delta_r}(\Gamma_r^\tau)$
  • A large absolute attribution can instead overshoot the contrast
  • Define the difference in positional token probabilities
  • Define its position kernel $\kappa_g(r, j) = \phi_g(\mathbb{B}, j; r) - \phi_g(\mathbb{C}, j; r)$
  • Arbitrary g can be written in this form by placing all error in $\zeta_g$
  • These are conditional approximations; the experiments do not estimate uniformly small values of either error
  • Under T1 in both regimes, with $\Delta_s \neq 0$ and $\Delta_t \neq 0$, the same fixed set and $\lambda$ satisfy
  • If $\nu_r = 0$, every centered paired score is zero almost surely and the claim holds with zero error
  • If the population absolute-score gap between ranks $m$ and $m+1$ exceeds twice this error, every population top- $m$ head still has a larger empirical absolute score than every excluded head
  • Let $O_k$ maximize $J$ among pool subsets of size at most $k$
  • Otherwise at most $k$ summands appear, so greedy search obtains
  • This proves Equation 4.7
  • Apply the error bound at the greedy set and at the same raw-utility optimum:
  • It also describes compute requirements and reproduction coverage
  • The two answer strings are various and successful
  • The selection split contains 48 prompts from $D_{r,b_H}$ and 48 prompts from $D_{r,b_L}$
  • The SEQ token slice refers to symbolic-sequence positions and excludes the final prompt position
  • BUC match averages both patch directions, whereas the random control uses HL match
  • Table 15 excludes RANDOM seeds 3 and 4
  • The following post-selection diagnostics examine how the selected heads act at the final prompt position
  • For a selected head or head group, $\Delta \mathrm{Attn}(R,r)$ denotes the high-minus-low change in attention at the final prompt position mass to region $R$, and $\Delta \mathrm{OV}(R,r)$ denotes the high-minus-low change in source-wise OV contribution along $d$
  • A negative recovery-match score indicates severe mismatch, not necessarily a sign reversal
  • The diagnostic instead measures correlation, which is not an error bound
  • For each regime $r$, let $H_{\lambda}(r)$ denote the selected head set under $Q_{\lambda}(H,r)$
  • It is not the head-patching match metric and does not establish that the selected heads explain the input intervention
  • Output: Selected evidence-position subset $S^\star(r)$
  • Let $\widehat{\Delta}_r$ denote the empirical evidence effect on the black-box selection split
  • Each candidate evaluation uses a prompt batch, so 8,775 is not a count of individual model queries
  • White-box-informed positions are diagnostic only and are not used for the strict black-box claim
  • Table 27 reports robustness across alternate evidence gaps
  • Table 29 reports alternative token surfaces with the same count/order structure, testing the dependence of the results on single-letter inputs
  • Table 31 expands the Pythia sweep to per-regime rows
  • The additional randomly registered readout pairs and native FP32 controls have their own specification in Appendix E. All reported values come from frozen Pythia-410M and use five seeds unless stated otherwise
  • The selected source and target sets are not constrained to a common budget
  • The same set is then evaluated over $b \in \{0, 10, \dots, 200\}$ and on the unseen gaps $(0, 150)$, $(25, 175)$, and $(75, 125)$
  • Every difference is BUC minus sensitivity-only
  • The BF16 bridge separates model accuracy, localization on labeled NL prompts, and the effect of a fixed symbolic CEA set on the NL target
  • Report}j:\mathrm{the item is}u_{c}
  • Report}j:\mathrm{the item is not}v_{c}
  • Report}j:\mathrm{the item is}v_{c}
  • Report}j:\mathrm{the item is not}u_{c}
  • At even count b, the numbers of these four forms are, respectively
  • Report j records the item as $u_c$
  • Evaluation uses Bank B and valid/invalid, available/unavailable, and correct/incorrect
  • The four regimes order reports by semantic support: FRONT puts all reports supporting $u_c$ first, BACK reverses the blocks, INTERLEAVE alternates support as far as possible, and RANDOM uses matched random permutations
  • Do more reports indicate $u_c$ rather than $v_c$?
  • Independent fair guesses have population paired accuracy 0.25 on each margin sign
  • Per seed, selection contains $3 \times 4 \times 2 \times 2 \times 24 = 1152$ prompts: three state pairs, four regimes, two counts, two query polarities, and 24 instances
  • Let $d_{\mathrm{yn}} = W_U^{\mathrm{(yes)}} - W_U^{\mathrm{(no)}}$
  • For target behavior $B$, with nonzero clean contrast $\Delta_B$, define shrink and bidirectional match as in Section 3:
  • The BF16 transfer ratio uses the reported matched-random reference score $Q_B(H_{\mathrm{rand}})$:
  • All sets have budget $k = 8$
  • All values are averaged over four ordering regimes and five seeds
  • The two directions have different targets and denominators; their difference cannot identify additional heads specific to semantic processing
  • The design’s full criterion requires held-out Acc > 0.5, PairAcc > 0.5, and MinPairAcc > 0.25, with prompt-pair bootstrap intervals above those references