Language models fail at extended rule following

Tianxiang Dai, Jonathan FanarXiv 2026 · arXiv

TL;DR

Current large language models (LLMs) possess a fundamental architectural blind spot: they cannot reliably maintain an exact internal state over extended execution horizons. By testing 126 frontier models on a simple character-counting task, researchers discovered that every model suffers an abrupt structural collapse at a syntax-sensitive "Counting Capacity" threshold. This failure persists despite scaling model size, increasing test-time compute, or providing external tools, indicating that fundamentally new architectures are required for truly reliable autonomous agents.

What Problem Does This Paper Address?

While LLMs excel at retrieving and recombining information across massive context windows, autonomous agents require a distinct capability: extended rule following. To execute complex multi-step workflows (like autonomous coding or scientific computing), a model must reliably preserve an exact internal state while repeatedly applying a rule over many steps.

Evaluating this capability is difficult because standard benchmarks are complex and semantic; a model might succeed via memorized knowledge or task-specific heuristics rather than genuine procedural execution. To isolate pure state-preservation from semantic reasoning, the authors design a minimal, non-semantic stress test: counting a long string of identical characters.

Methods

The authors introduce the Stable Counting Capacity (SCC) assay. The model is given a sequence of identical items (e.g., a, a, a...) and instructed to return the exact count as a single integer. To find the precise failure boundary without letting the model rely on coarse magnitude estimation, the assay adaptively samples sequence lengths using a randomized ladder scheme. The sequence length where the model consistently fails is defined as its Counting Capacity (CC).

To understand why models fail, the authors perform extensive mechanistic probing on open-weight models (Gemma 3 27B-it and Qwen 3.5 35B-A3B) using:

  • Residual stream projections to track how count information is represented across layers.
  • Activation patching (both final-token and full-sequence) to isolate causal control of the output.
  • Sparse Autoencoders (SAEs) via Gemmascope 2 to analyze the underlying feature coalitions.

Additionally, they design a hierarchical nested depth tracking assay to test richer structural states, alongside dual-task experiments that force the model to count while simultaneously solving complex reasoning problems.

Datasets

The study evaluates 126 leading language model variants spanning both proprietary and open-weight families (including OpenAI, Anthropic, Google, DeepSeek, Meta, Mistral, and Qwen).

To see if standard AI evaluations capture this procedural reliability, the authors correlate their measured Counting Capacities against several established benchmarks:

  • GPQA Diamond (Factual knowledge)
  • SWE-bench Verified (Complex coding)
  • ARC-AGI-2 (Abstract fluid intelligence)
  • BBH and MATH-500 (Reasoning and Math)

Key Insights and Ideas

  • Context Access $\neq$ State Maintenance: Processing a long prompt does not imply the ability to carry a simple rule-defined variable through it. Models fail far below their nominal context windows.
  • Abrupt Structural Collapse: When models exceed their capacity, they don't experience gradual numerical drift. Instead, they suffer a sudden collapse, defaulting to highly specific rounded "numerical attractors" like 500, 1000, or 2000.
  • The "Overthinking" Trap: Additional test-time compute (reasoning tokens) fails to rescue these errors. Reasoning-optimized models often elaborate on their failed states or fall into infinite latent reasoning loops, exhausting their token budgets without returning an answer.
  • Resource Competition: Dual-task experiments reveal that complex problem-solving and basic procedural tracking compete for the exact same limited internal tracking resources. Introducing a reasoning task causes models to undercount much earlier.
  • No Abstract Counter: Swapping the character type or delimiter shifts the model's capacity threshold. This syntax sensitivity proves that LLMs do not implement a fully abstract procedural counter; instead, they rely on a fragile, learned trajectory of finite internal states.
Figure 1: Probing the ability of LLMs to follow rules with basic counting. (A) Many language

Key Results

  • Universal Bounded Capacity: Every single one of the 126 tested models exhibited a finite Counting Capacity.
  • Frontier Performance: While claude-4-opus achieved the highest CC at 2176, many state-of-the-art models failed at surprisingly low thresholds: gpt-5.4 collapsed at 608, gpt-4o at 88, o1 at 80, and deepseek-r1 at 72.
  • Mechanistic Proof: Probing showed a precise linear relationship tracking the true count in the residual stream during the successful regime, which completely disintegrated at the failure boundary. Activation patching confirmed that count information is dynamically accumulated in the middle layers before being consolidated in late layers.
Model dynamics near the capacity threshold show sudden collapse to discrete numerical attractors and high sensitivity to syntax variations.

Limitations and Future Work

The authors note that homogeneous character counting is an intentionally artificial task that does not capture the full diversity of natural language procedures. Furthermore, because proprietary models are served behind black-box APIs, hidden system prompts and preprocessing pipelines remain unobservable, restricting deep mechanistic analysis to open-weight models.

The core takeaway is architectural: simply scaling model size, pretraining data, or test-time compute will not solve the state-preservation problem. The authors argue that achieving truly reliable autonomous agents will require fundamental architectural innovations, such as explicit support for persistent variables, recurrence, externalized verifiable memory, and structured execution traces.

Summary updated

Abstract

Large language models are highly capable of answering difficult questions by retrieving, recombining, and attending to information in long contexts. For agentic tasks, an additional capability is required: the preservation of an exact state while repeatedly applying rules. We find that this reliability is absent across language models. To demonstrate, we query 126 leading model variants with the task of counting a long string of repeated characters, and we find they all cannot accurately count above a model-dependent, syntax-sensitive counting capacity threshold. Failures are abrupt and persist even with increasing model size, inference time computation, and external tool. Mechanistic probing indicates that models use a finite number of internal states to mimic counting as a rule and fail once these states are exhausted. Furthermore, such states are the basis for performing complex tasks beyond counting. These results indicate that fundamentally new model architectures are required for autonomous agents to achieve truly reliable rule following capabilities.
BibTeX
@misc{dai2026language,
  author = {Tianxiang Dai and Jonathan Fan},
  title = {{Language models fail at extended rule following}},
  year = {2026},
  eprint = {2605.02028},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.02028},
}
Figure