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":
- 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.
- 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).
- 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.
- Rule Extraction: Qinglong Wang and C. Lee Giles have worked on extracting symbolic rules from RNNs to verify their behavior (Verification of Recurrent Neural Networks Through Rule Extraction).
- Weighted Automata: Masaki Waga used regression on state spaces to extract Weighted Finite Automata (WFA) from RNNs, though he notes these extractions are often approximations when the underlying neural logic is non-regular (Weighted Automata Extraction from Recurrent Neural Networks).
- Auditing LLMs: Satwik Bhattamishra and Michael Hahn developed algorithms to extract DFAs from Transformers, providing a way to audit the "generative support" of a language model (Automata Learning and Identification of the Support of Language Models).
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.