Introduction
Standard transformer-based Large Language Models (LLMs) are theoretically limited by their fixed context windows, making them formally equivalent to finite automata. While they excel at complex reasoning through techniques like Chain-of-Thought prompting, they cannot inherently solve problems requiring unbounded memory or processing time relative to input size. This research demonstrates that LLMs can achieve computational universality—becoming Turing complete—when augmented with an external read-write memory. Notably, this is achieved using a frozen, off-the-shelf model (Flan-U-PaLM 540B) without any weight modifications, relying entirely on a structured "prompt program."
The Stored Instruction Architecture
The study conceptualizes a system where the LLM functions as a Central Processing Unit (CPU) and an external associative dictionary serves as Random Access Memory (RAM). The execution follows a four-stage cycle:
- Pre-processing: An instruction prompt is fetched from memory. Variables (prefixed with
@) are substituted with their current values from the associative dictionary. - LLM Inference: The processed prompt is passed to the LLM.
- Post-processing: The model's output is parsed using finite-state regular expressions to identify variable assignments (e.g.,
x = "value") or arithmetic updates. - Memory Update: The parsed values are written back to the external memory.
By restricting external processing to finite-state operations, the researchers ensure that the system's computational power is derived from the LLM itself, rather than the supporting infrastructure.
Simulating a Universal Turing Machine
To formally prove universality, the authors designed a prompt program to simulate $U_{15,2}$, a known universal Turing machine defined by 15 states and 2 symbols. A "boot" prompt was developed to instruct the model on handling conditional logic and state transitions, effectively turning the LLM into an interpreter for the Turing machine's transition table.
The simulation maps the Turing machine's tape to the external memory, allowing the model to bypass its internal context limits. The LLM's role is to execute the logic defined in the transition table for each step of the computation.
Results and Verification
The universality of the system was verified by testing the Flan-U-PaLM 540B model against every possible state-symbol combination of the $U_{15,2}$ machine.
- Verification Tests: The model successfully passed 29 specific verification tests, correctly producing the next state, write symbol, and head movement for all configurations.
- Deterministic Logic: By utilizing greedy decoding (temperature = 0), the researchers demonstrated that the LLM can act as a reliable, deterministic logic engine.
- Inductive Proof: The paper provides a formal proof showing that if the LLM correctly executes a single cycle, the system maintains exact equivalence with a universal computer over an arbitrary number of steps.
Discussion and Limitations
This work highlights that universality is an emergent property of an LLM's ability to follow instructions and manage context, provided it has a "scratchpad" for infinite state storage. Prompting is reframed as a literal programming language, where the "boot" prompt acts as a compiler for high-level logic.
However, the system remains brittle. Success was highly dependent on the specific model and required extremely compact prompt engineering. The model also struggled with complex nested conditional logic, requiring a flattened if-then structure. While this architecture is a proof of capability rather than efficiency—being significantly slower than silicon-based computers—it suggests that as LLMs evolve, they may eventually support more complex software architectures and high-level programming paradigms.
Summary updated