The Regular Language Barrier in Sequence Modeling

This direction is no longer present in the current build. Its last version stays readable and citable here.

Version 1 of 127 papers32 conceptsfrozen 2026-10-04

Modern sequence models like Transformers and Structured State Space Models (SSMs) often appear to possess sophisticated reasoning capabilities. However, a growing body of research suggests these models face a fundamental "glass ceiling" dictated by formal language theory. Because these models operate with finite precision and fixed state sizes, they are mathematically equivalent to Finite State Machines (FSMs), restricting their expressive power to the class of Regular Languages.

The Finite State Equivalence

The core of this limitation lies in how memory is managed. In classical computation, a Finite State Automaton (FSA) has a fixed number of states and no external memory. It can recognize patterns like "an even number of zeros," but it cannot recognize "a sequence of $n$ zeros followed by $n$ ones" because it cannot "count" to an arbitrary $n$ without adding more states.

Recent work by Nikola Zubić, Federico Soldá, and Davide Scaramuzza in Limits of Deep Learning: Sequence Modeling through the Lens of Complexity Theory demonstrates that any recurrent sequence model with finite-precision state representations is functionally equivalent to an FSM. This means that no matter how many layers or parameters a model has, if its internal state cannot scale dynamically with the input length, it is trapped within the boundaries of regular languages. This constraint prevents models from handling context-free structures—such as nested parentheses or recursive syntax—which are essential for deep compositionality and advanced logic.

Why Regularity Matters

The restriction to regular languages is not just a theoretical curiosity; it has practical implications for what a model can "understand" or "compute":

  1. Counting and Matching: Standard FSMs cannot track an arbitrary count of events. Yuval Peres showed in New coins from old: computing with unknown bias that finite-memory systems can only simulate rational functions of probabilities, whereas models with a stack (Pushdown Automata) can simulate more complex algebraic functions like square roots.
  2. State Tracking: Even advanced models like Mamba struggle with formal state-tracking. Aleksandar Terzic and Abbas Rahimi found that selective SSMs require specific dense, non-commutative dynamics to reliably emulate the full range of regular languages, a prerequisite for following complex rules over long sequences (On the Expressiveness and Length Generalization of Selective State Space Models on Regular Languages).
  3. Infinite Sequences: Traditional automata are restricted to a finite range of values. Jie-Meng Zhang and colleagues point out that modeling mathematical sequences with infinitely many values requires moving toward automata with a countable infinity of states (Morphisms on infinite alphabets, countable states automata and regular sequences).

Breaking the Ceiling with Counters and Stacks

To overcome these limits, researchers are augmenting finite-state architectures with specialized memory structures.

Parikh and Counting Automata: One approach is to add "registers" or counters to the state machine. Alain Finkel and Pierre McKenzie explored Parikh Automata (PA), which track transition counts to recognize semi-linear properties (On the expressiveness of Parikh automata and related models). In Reinforcement Learning (RL), Benjamin Rosman and Tristan Bester introduced Counting Reward Automata (CRA), allowing agents to solve tasks that require matching sequences or counting events—tasks that standard FSM-based reward models cannot represent (Counting Reward Automata).

Pushdown Reward Machines: For tasks requiring hierarchical or recursive logic, the "stack" is the natural extension. Rodrigo Toro Icarte and Sheila A. McIlraith originally proposed Reward Machines (RMs) to expose task structure to RL agents, but these were limited to regular languages (Reward Machines: Exploiting Reward Function Structure in Reinforcement Learning). To handle context-free objectives—like retracing a path in reverse—Giovanni Varricchione and colleagues developed Pushdown Reward Machines (pdRMs), which use stack-based memory to manage arbitrary-depth dependencies (Pushdown Reward Machines for Reinforcement Learning).

Interpreting the Black Box

The equivalence between neural networks and automata also provides a path toward interpretability. If a model behaves like an FSM, we can attempt to "extract" that FSM to see what it has learned.

By framing deep learning through the lens of the Chomsky hierarchy, this research direction clarifies why current models struggle with certain types of reasoning and provides a roadmap for building more expressive, neuro-symbolic architectures.

Papers in this version

History & citationVersion 1 · 2026-10-04

No longer present in the current build · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_the_regular_language_barrier_in_sequence_36ce650f,
  title = {The Regular Language Barrier in Sequence Modeling},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/the-regular-language-barrier-in-sequence-modeling/rdr_36ce650ff1cf41cbadfb299d69f36b53},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-24},
}

This exact version (version 1, frozen text):

@misc{lacuna_the_regular_language_barrier_in_sequence_36ce650f_v1,
  title = {The Regular Language Barrier in Sequence Modeling},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/the-regular-language-barrier-in-sequence-modeling/rdr_36ce650ff1cf41cbadfb299d69f36b53/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-24},
}