Continuity and Isolation Lead to Doubts or Dilemmas in Large Language Models

Hector Pasten, Felipe Urrutia, Hector Ignacio Jimenez Orellana, Cristian Buc Calderon, Cristobal Rojas, Alexander Kozachinskiy

Abstract

Modern Large Language Models (LLMs) based on the decoder-only Transformer architecture exhibit remarkable capabilities, yet they frequently stumble on tasks involving precise pattern recognition or subtle syntax detection. This paper provides a mathematical foundation for these failures, proving that decoder-only Transformers with compact positional encodings (CPE) are subject to two inherent limitations: continuity and isolation. These properties create "attractor basins" in the model's representational space, forcing it to ignore small but critical input variations. Our analysis suggests that these limitations make it theoretically impossible for a single model to perfectly learn all simple periodic patterns or distinguish between highly similar code snippets, a phenomenon we term "representational collapse."

Introduction

Despite the massive scale of models like Llama, GPT, and Claude, they often fail at seemingly trivial tasks such as counting, identifying single-token syntax errors, or maintaining long-term periodic sequences. While most research characterizes these failures through empirical "red-teaming," this paper investigates the underlying geometry of the Transformer's learnability landscape. By examining the mathematical constraints of the standard decoder-only architecture combined with compact positional encodings, we demonstrate that the very mechanisms ensuring model stability also impose fundamental "blind spots."

Theoretical Framework: Continuity and Isolation

The researchers define two core mathematical phenomena that govern how Transformers process information:

1. The Continuity Constraint

The authors prove that for any Transformer utilizing compact positional encoding (where encoding vectors are bounded, such as Sinusoidal or Rotary embeddings), a small change in the input—specifically changing a small fraction of tokens—results in a proportionally small change in the output probability distribution. This implies that the model's output is "smooth" relative to its input. While smoothness is generally desirable for generalization, it becomes a liability when the model must distinguish between two nearly identical sequences that have different ground-truth labels.

2. The Isolation Theorem

Building on the principle of continuity, the Isolation Theorem posits that if a model successfully "learns" a specific infinite sequence, there exists a "ball" or neighborhood around that sequence (measured by Hamming distance) where no other distinct sequence can be learned. This creates a fundamental trade-off: by becoming an expert in one pattern, the model mathematically forfeits the ability to learn a "nearby" pattern. This suggests that a single Transformer cannot be a universal expert for all possible periodic sequences.

Representational Collapse and the CPE Constraint

The "aha moment" of this research is the identification of representational collapse. Because of continuity, if two prompts are sufficiently similar, the model’s internal representations eventually converge into the same state. It literally loses the ability to "see" the difference between a correct line of code and one containing a subtle error if the surrounding context is long and similar.

The primary driver of this collapse is Compact Positional Encoding (CPE). If positional information does not grow in magnitude or complexity relative to the sequence length, the model eventually loses the ability to distinguish between positions. Furthermore, experiments indicate that models are most sensitive to changes at the end of a prompt; changes at the beginning or middle are frequently "washed out" by the time the model generates a response.

Experimental Validation

To test these theorems, the researchers utilized three distinct experimental setups:

  • Zero Fundamental Sequence: Models were tested on their ability to remain "locked" onto a sequence of zeros despite random noise perturbations.
  • Syntax Verification (SYNTAXVERIFICATION): A new benchmark consisting of 100 Python function exercises. Each exercise features two versions: a syntactically correct one and one with a single-token error (e.g., replacing = with for).
  • Periodic Pattern Generation: Models were tasked with continuing patterns like 00010001... across various period lengths ($p$).

Key Results

  • The Critical Period: In periodic generation, almost every model tested exhibited a "critical period" threshold. Once the period length exceeded this specific number, the model’s success rate dropped precipitously to zero.
  • The Limits of Reasoning: Even state-of-the-art reasoning models like OpenAI’s o3-mini and o4-mini, which utilize Chain-of-Thought (CoT), showed error rates of 20-25% on the Syntax Verification task. This indicates that while CoT improves performance, it does not fully circumvent the underlying geometric constraints of the Transformer architecture.
  • Attention Scaling: The researchers found that replacing standard Softmax with "log-length scaled attention" (ssmax) increased sensitivity. This confirms that the mathematical method used to calculate attention weights directly influences these theoretical limits.

Conclusion and Future Directions

The findings suggest that the current standard for LLM architecture has built-in "doubts" (where it cannot distinguish inputs) and "dilemmas" (where learning one thing prevents learning another). To move beyond these limits, future work may need to explore:

  1. Unbounded Encodings: Moving away from compact positional encodings toward absolute or scalable variants that do not collapse over long sequences.
  2. Dynamic Softmax: Implementing variants like ssmax to maintain sensitivity across varying input lengths.
  3. Expanded CoT: Investigating if the number of reasoning steps can be scaled to make the model "Turing complete" enough to escape these geometric traps.

Ultimately, understanding the geometry of the learnability landscape is essential for building the next generation of models capable of the absolute precision required for complex software engineering and mathematical reasoning.

Summary updated

BibTeX
@inproceedings{pasten2025continuity,
  author = {Hector Pasten and Felipe Urrutia and Hector Ignacio Jimenez Orellana and Cristian Buc Calderon and Cristobal Rojas and Alexander Kozachinskiy},
  title = {{Continuity and Isolation Lead to Doubts or Dilemmas in Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=dR58v9Dd42},
}
Figure