Abstract
While Recurrent Neural Networks (RNNs) have been known to be Turing complete in a classification context since the early 1990s, their capacity as probabilistic generators remains less understood. This paper extends the theoretical framework of RNNs to the domain of probabilistic language models (RLMs). We demonstrate that RLMs, when permitted internal computational steps between token outputs, can represent any computable probability distribution. Furthermore, we establish a new lower bound for the representational capacity of real-time RLMs, bridging the gap between abstract theory and practical implementation.
Introduction
In 1992, Siegelmann and Sontag established that RNNs with rational weights are Turing complete. However, this proof treated RNNs primarily as binary classifiers. Modern language models (LMs) function differently; they are technically semimeasures that assign probability distributions to strings.
There is a significant gap in our theoretical understanding of the probability distributions these models can represent. Moreover, while theoretical proofs often assume unbounded computation time, real-world RLMs are "real-time," processing exactly one token per time step. This research characterizes the representational capacity of RLMs through the lens of probabilistic computation and formal language theory.
Methodology
The study maps RLMs to established models of computation using several key formalisms:
- The $\epsilon$RLM: The authors introduce a variant of the RLM capable of outputting "empty" symbols ($\epsilon$). This allows the model to perform multiple internal computational steps before producing the next visible token, effectively granting it a "scratchpad" for computation.
- Probabilistic Turing Machines (PTMs): The classic PTM is reformulated to handle rational weights (QPTMs), establishing their relationship to two-stack pushdown automata (2PDA).
- Construction Proofs: The authors extend the "Minsky construction"—which uses neurons to simulate counters or stacks—to the probabilistic case. They demonstrate how an RNN's hidden state can encode the contents of two stacks, using its weights to simulate the transition probabilities of a Turing machine.
Hierarchy and Key Results
The research establishes a "roadmap" of computational classes, relating real-time versus unbounded models and deterministic versus probabilistic systems.
Upper Bound: Unbounded Time
The authors prove that $\epsilon$RLMs (with unbounded time) are equivalent to Probabilistic Turing Machines. Consequently, they can represent any enumerable semimeasure—essentially any probability distribution that is algorithmically computable.
Lower Bound: Real-Time Constraints
When restricted to real-time operation (no $\epsilon$ tokens), the model's power is reduced. However, the authors prove that real-time RLMs can still simulate any real-time deterministic probabilistic 2-stack machine (RD-2PDA). This establishes a robust lower bound for the models used in modern NLP.
Discussion and Future Work
This work highlights that treating LMs as simple automata is a category error; because they encode probabilities, they must be compared to probabilistic machines. The study also confirms that rational weights are sufficient for Turing completeness in a probabilistic setting, meaning infinite-precision real numbers are not a requirement for these theoretical bounds.
Several limitations remain for future exploration:
- Arithmetic Precision: The proofs assume exact rational arithmetic, whereas practical models use finite-precision floating-point numbers.
- The Real-time Gap: While a lower bound for real-time RLMs is established, an exact upper bound (the "ceiling" of a standard Elman RNN) remains unknown.
- Architectural Shifts: As Transformers replace RNNs in many applications, a major open question is how these results translate to non-recurrent architectures with different computational dynamics.
- Trainability: A significant gap remains between representational capacity (what a model can do) and learnability (what gradient descent can actually achieve).
Summary updated