NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Circuit Stability Characterizes Language Model Generalization

Alan Sun

Abstract

Extensively evaluating the capabilities of (large) language models is difficult. Rapid development of state-of-the-art models induce benchmark saturation, while creating more challenging datasets is labor-intensive. Inspired by the recent developments in mechanistic interpretability, we introduce circuit stability as a new way to assess model performance. Circuit stability refers to a model’s ability to apply a consistent reasoning process–its circuit–across various inputs. We mathematically formalize circuit stability and circuit equivalence. Then, through three case studies, we empirically show that circuit stability and the lack thereof can characterize and predict different aspects of generalization. Our proposed methods offer a step towards rigorously relating the generality of models to their interpretability.

Introduction

We are currently witnessing a "benchmark arms race." As Large Language Models (LLMs) improve, existing benchmarks saturate quickly, and creating new, more difficult ones is increasingly labor-intensive. More critically, standard benchmarks typically evaluate only the final output—the what—rather than the internal reasoning process—the how.

A model might solve a simple arithmetic problem using a robust algorithm but switch to a fragile heuristic for more complex inputs. This lack of internal consistency is a significant hurdle for reliable generalization. This paper introduces the concept of circuit stability to bridge the gap between raw performance metrics and the underlying mechanistic logic of a model, providing a framework to predict generalization failures before they occur.

Methodology: Soft Circuits and Stability

Building on the field of mechanistic interpretability, we view neural networks as computational graphs where specific subgraphs, or "circuits," perform specific tasks. To overcome the computational complexity of finding discrete circuits, we propose the use of soft circuits.

Soft circuits map each edge in the model to a continuous value representing its importance, calculated via attribution patching. This gradient-based approximation measures how much performance drops if a specific edge is "broken." Based on these importance maps, we define two key metrics:

  1. $\epsilon$-Circuit Stability: Measures how much the model's internal importance map changes across different subtasks (e.g., adding 2-digit vs. 3-digit numbers).
  2. $\alpha$-Equivalence: Quantifies the similarity (using Spearman’s rank correlation) between the circuits used for two distinct subtasks.
Comparison of model subcircuits. Panels (a) and (b) represent shared subcircuitry (stability), while panel (c) illustrates distinct logic used for different inputs.

By comparing these soft circuits, we can use clustering techniques like t-SNE to identify "families" of tasks that the model treats as mechanistically similar.

Empirical Analysis: Arithmetic Families

We evaluated three primary tasks—Arithmetic Reasoning, Boolean Expressions, and Sports Understanding—across models including Gemma-2-2b, Phi-1.5, and Llama-3.1-8b.

In the case of two-operand addition ($a + b$), we identified five distinct circuit clusters in Gemma-2-2b: equal-digit, one-digit difference, leading-operand heavy, trailing-operand heavy, and single-digit. Interestingly, models often use different internal circuits for $a + b$ than they do for $b + a$. This "commutativity gap" directly correlates with performance discrepancies; for instance, a model may be significantly more accurate on "leading-operand heavy" problems than their mirrored counterparts.

Visualization of circuit clusters for two-operand addition. The top grid shows task similarity ($\alpha$-equivalence), while the bottom t-SNE plot identifies distinct mechanistic families.

Mechanisms of Generalization

Our analysis reveals several key insights into how models generalize:

  • Predictable Decay: Within a stable circuit family, performance decay follows a strict exponential regression ($R^2 > 0.99$). This suggests that failure on longer inputs within a stable family is a result of compounded noise rather than a total breakdown of logic.
  • CoT as a Stabilizer: Chain-of-Thought (CoT) prompting significantly increases circuit stability. By forcing the model to decompose problems into discrete steps, CoT encourages the reuse of reliable sub-circuits rather than the invention of fragile shortcuts for complex inputs.
  • Structural Awareness: In logic tasks, models like Phi-1.5 show significant circuit shifts when parentheses are added only if those parentheses alter the operator precedence, indicating an internal "understanding" of structural logic.

Conclusion

Circuit stability offers a rigorous metric for relating model generality to interpretability. By identifying where a model's internal logic remains consistent, we can better predict its performance on out-of-distribution tasks. Future work will focus on automating the discovery of task partitions and extending these metrics to more open-ended generation tasks, such as coding or creative writing.

Summary updated

BibTeX
@inproceedings{sun2025circuit,
  author = {Alan Sun},
  title = {{Circuit Stability Characterizes Language Model Generalization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=8l7jMNMUtw},
}
Figure