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

Daking Rai, Samuel Miller, Kevin Moran, Ziyu Yao
6/30/2025
cs.CLcs.AIcs.SE

No official code found. Best implementation: Ziyu-Yao-NLP-Lab/failure-by-interference (2 stars, GPL-3.0, last commit 2025-10-23).

Abstract

Despite remarkable advances in coding capabilities, language models (LMs) still struggle with simple syntactic tasks such as generating balanced parentheses. In this study, we investigate the underlying mechanisms behind the persistence of these errors across LMs of varying sizes (124M-7B) to both understand and mitigate the errors. Our study reveals that LMs rely on a number of components (attention heads and FF neurons) that independently make their own predictions. While some components reliably promote correct answers across a generalized range of inputs (i.e., implementing "sound mechanisms''), others are less reliable and introduce noise by promoting incorrect tokens (i.e., implementing "faulty mechanisms''). Errors occur when the faulty mechanisms overshadow the sound ones and dominantly affect the predictions. Motivated by this insight, we introduce RASteer, a steering method to systematically identify and increase the contribution of reliable components for improving model performance. RASteer substantially improves performance on balanced parentheses tasks, boosting accuracy of some models from $0$% to around $100$% without impairing the models' general coding ability. We further demonstrate its broader applicability in arithmetic reasoning tasks, achieving performance gains of up to around $20$%.

View on arXivView PDF

Code Implementations(1)

GPL-3.0

This repo contains code and experiment setup for our paper "An Failure by Interference: Language Models Make Balanced Parentheses Errors When Faulty Mechanisms Overshadow Sound Ones".

20Oct 23, 202512 months agoGPL-3.0

Similar Papers

Cite this paper

@article{rai2025failure,
  title  = {Failure by Interference: Language Models Make Balanced Parentheses Errors When Faulty Mechanisms Overshadow Sound Ones},
  author = {Daking Rai and Samuel Miller and Kevin Moran and Ziyu Yao},
  year   = {2025},
  eprint = {2507.00322},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.00322v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.00322.svg)](https://codeofpaper.com/paper/2507.00322)

Discussion