Failure by Interference: Language Models Make Balanced Parentheses Errors When Faulty Mechanisms Overshadow Sound Ones

Daking Rai, Samuel Miller, Kevin Moran, Ziyu Yao

TL;DR

Language models often fail at simple tasks like balancing parentheses not because they lack the "knowledge," but because noisy internal components (faulty mechanisms) drown out the reliable ones (sound mechanisms). This paper introduces RASTEER, a method that identifies these reliable components and boosts their signal, successfully raising accuracy from near 0% to nearly 100% on syntactic tasks without damaging the model's general capabilities.

The Paradox of Trivial Syntax

Despite their ability to write complex functions or poetry, large language models (LMs) frequently stumble over "trivial" syntax, such as forgetting to close a bracket or miscounting parentheses. This presents a paradox: why can a model solve a difficult coding problem but fail at a task a toddler could learn?

The authors investigate whether this is a "knowledge" issue (the model hasn't learned the rule) or a "computation" issue (the model knows the rule but gets distracted). They focus on the balanced parentheses task—predicting the correct number of closing parentheses—as a representative case study for basic syntactic failure.

Mechanistic Interpretability: A Top-Down Approach

Instead of trying to map every single connection in the model (which is computationally expensive and complex), the researchers look at the components—attention heads and feed-forward (FF) neurons—that contribute most directly to the final output.

  1. Logit Lens Analysis: They project the activations of individual components directly into the model's vocabulary space to see what each part "wants" to predict.
  2. Component Labeling: They categorize components as "sound" (consistently promoting the correct token across different scenarios) or "faulty" (promoting incorrect tokens or adding noise).
  3. RASTEER (RAnking and STEERing): The core contribution works in two steps:
  4. Rank: Identifies the most reliable components based on how well they generalize across different "sub-tasks" (e.g., predicting one vs. four parentheses) and their F1-score.
  5. Steer: During inference, applies a scaling multiplier ($\alpha$) to the activations of these top-ranked "sound" components before they are added back into the model's residual stream. This effectively "turns up the volume" on the reliable parts of the model.

Experimental Setup

The methodology was tested across several datasets to ensure robustness:

  • Synthetic Balanced Parentheses: A custom dataset featuring four sub-tasks (One-Paren, Two-Paren, Three-Paren, and Four-Paren), designed around how different tokenizers group parentheses.
  • HumanEval: A standard benchmark for evaluating general Python code generation, used to ensure that "steering" the model for parentheses didn't break its ability to write actual code.
  • Arithmetic Reasoning: A two-operand math dataset used to test if RASTEER generalizes to other types of logic.

Key Insights: The Internal Shouting Match

LMs don't use a single, unified algorithm to solve syntax. Instead, they rely on a "bag of heuristics"—many independent components making their own guesses. Errors happen when the "faulty" components collectively outvote the "sound" ones.

Noisy Promotion in FF Neurons: The authors found that FF neurons are architecturally limited. Because they project to a fixed set of tokens, a neuron that promotes )))) often inevitably promotes ))) as well, creating "noisy promotion" that the model must filter out.

Average Neuron Logit Values demonstrating noisy promotion across different parenthesis inputs.

Hidden Potential: In some models, a single attention head was found to be more accurate than the entire model. This proves the "sound" logic exists internally but is being overshadowed by noise. Furthermore, steering attention heads proved significantly more effective than steering FF neurons, as attention heads are more flexible and less structurally constrained.

Dramatic Performance Gains

  • Accuracy Boosts: On the difficult "four-paren" sub-task, models like GPT-2 XL and Llama-2-7b went from 0% or 1% accuracy to nearly 100% using RASTEER.
  • Generalization to Math: Applying RASTEER to arithmetic tasks yielded performance gains of up to 20.25% (specifically for multiplication in Pythia-6.9b), suggesting the "interference" theory applies to more than just syntax.
  • Safety and Efficiency: RASTEER did not degrade general coding performance; it actually slightly improved Llama-2-7b’s score on HumanEval by 5.49%. It also consistently outperformed traditional "Circuit Discovery" baselines, especially in smaller models where task circuits are often messy and non-localized.

Limitations and Future Directions

While highly effective, the study relies heavily on synthetic data for the parentheses task, meaning results might be slightly exaggerated compared to real-world, messy codebases. Additionally, the method assumes that the model’s final decision is a simple sum of its parts (the "additive motif"), which may overlook more complex, non-linear interactions between layers.

Finally, RASTEER was tested on tasks with a small number of possible output tokens. It remains to be seen how well this steering scales to tasks with thousands of potential correct outputs. Future work will likely move toward more sophisticated, automated ways to identify "sound" mechanisms without needing labeled synthetic training data.

Summary updated

BibTeX
@inproceedings{rai2025failure,
  author = {Daking Rai and Samuel Miller and Kevin Moran and Ziyu Yao},
  title = {{Failure by Interference: Language Models Make Balanced Parentheses Errors When Faulty Mechanisms Overshadow Sound Ones}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=1t4hR9JCcS},
}
Figure