TL;DR
This paper challenges the prevailing notion in interpretability research that causal interventions are the only way to validate model explanations. By studying small transformer models on a toy task, the authors demonstrate that observational tools, specifically analyzing attention patterns, can effectively predict out-of-distribution (OOD) generalization behavior, even when causal interventions yield ambiguous results.
What Problem Does This Paper Address?
The field of machine learning interpretability has increasingly gravitated towards "causal intervention" as the gold standard for validating explanations of model behavior. This approach involves directly manipulating model components (e.g., through ablation or patching) to observe the effect on the model's output. The underlying assumption is that if an explanation is correct, intervening on the proposed mechanism should predictably alter the model's behavior. However, this paper argues that causal interventions, while powerful, are not always feasible or ecologically valid, especially in naturalistic settings. They can be akin to artificial lab environments that don't fully reflect real-world model behavior. The authors propose that observational methods, which analyze correlations between internal model states and behavior, can offer valuable insights and predictive power, particularly for understanding out-of-distribution generalization, a critical aspect of robust AI.
Methods
The core of the paper's methodology involves training a large population of small transformer models on a carefully designed toy task. This task uses a balanced parenthesis classification problem with an ambiguous rule. The ambiguity arises because the training data allows models to learn either a strict "balanced parenthesis" rule or a simpler "equal count" rule.
To investigate the relationship between internal mechanisms and OOD behavior, the authors employ several techniques:
- Population of Models: Training numerous models with variations in hyperparameters (weight decay, number of layers) and training procedures (random seeds, data shuffling) creates a diverse population with potentially different learned strategies.
- Observational Analysis (Attention Patterns): They focus on analyzing the attention patterns of the EOS token in the final layer of the transformer. They categorize attention heads into four types based on whether they attend to open brackets, close brackets, or tokens based on their "depth" (the running count of open minus closed parentheses).
- Uniform Ablation: To isolate the effect of attention patterns, they use a "uniform attention" ablation. This technique replaces the standard attention mechanism with one where each token attends equally to all other tokens. This preserves any bias contributed by attention but removes the influence of specific token interactions.
- Causal Intervention (Ablation): They also perform causal experiments by ablating specific attention heads (setting their output to zero) to observe the impact on both in-distribution (ID) and out-of-distribution (OOD) accuracy.
Datasets
The paper uses a custom dataset for a balanced parenthesis classification task. The training data is designed to be ambiguous between two rules:
- BALANCED rule: Parentheses form a valid set of pairings (e.g.,
(())). - EQUAL-COUNT rule: The number of open and closed parentheses is equal (e.g.,
())(()).
Crucially, the OOD test set includes sequences that satisfy the EQUAL-COUNT rule but violate the BALANCED rule (e.g., ))((()). These OOD examples are labeled negative under BALANCED but positive under EQUAL-COUNT, allowing the researchers to infer which rule a model has learned based on its OOD predictions.
Key Insights and Ideas
- Observational Tools Can Predict OOD Behavior: The most significant insight is that analyzing attention patterns (an observational method) can predict how a model will generalize to OOD data. This directly challenges the idea that only causal interventions are sufficient for validating explanations.
- Depth-Heads Correlate with BALANCED, but Nonnegative Depth Heads are "Spandrels": Models learning the BALANCED rule tend to have "depth-detecting" attention heads. However, causal interventions reveal that while negative depth heads are crucial for BALANCED, nonnegative depth heads, despite being correlated, can actually decrease OOD accuracy when ablated. This suggests they might be vestigial circuits or "spandrels" – byproducts of learning that don't directly contribute to the target behavior.
- Causal Interventions Can Be Misleading: The paper highlights cases where causal interventions provide results that conflict with correlational evidence, suggesting that ablation might not always accurately reflect a circuit's utility or can be confounded by complex interactions.
- Weight Decay Promotes "Spandrel" Heads: Counterintuitively, weight decay, often used to prune unnecessary weights, actually promotes the presence of nonnegative depth heads, further supporting their potential vestigial nature.
Key Results
- Predictive Power of Attention: The study found that specific attention head types (nonnegative and negative depth heads) are strongly correlated with higher OOD accuracy for models learning the BALANCED rule.
- Conflicting Causal Evidence: While ablating negative depth heads decreased OOD accuracy (as expected for BALANCED), ablating nonnegative depth heads increased OOD accuracy. This is a key finding showing that correlation and causal effects can diverge.
- EQUAL-COUNT Rule and Symbol Heads: Models learning the EQUAL-COUNT rule showed less reliance on specific open/close bracket attention heads, and uniform attention ablation had a negligible effect on their ID and OOD accuracy, suggesting a more robust or different learning mechanism.
- No Correlation Between ID and OOD Ablation Effects: Appendix A shows no statistically significant correlation between the effect of ablating attention on ID accuracy versus OOD accuracy, further emphasizing the difficulty of predicting OOD behavior from ID-focused interventions.
Limitations and Future Work
- Toy Task: The study uses a simplified, "toy" balanced parenthesis task. While valuable for isolating mechanisms, the findings may not directly translate to complex, real-world NLP tasks without further investigation.
- Intractability of Large-Scale Experiments: The authors acknowledge that their approach of training a large population of models with significant random variation is "intractable for many applications."
- Future Directions: The paper suggests that future work should focus on control models exhibiting different OOD behaviors to better study the relationship between internal circuits and generalization. They also emphasize the need to take seriously the relationship between interpretations and predicting model behavior, a goal that may not be fully achievable through causal interventions alone. The evaluation of hypotheses regarding vestigial circuits and spandrels is left for future work.
Summary updated