[Paper Review] Memory Augmented Large Language Models are Computationally Universal
The paper shows that a fixed large language model (Flan-U-PaLM 540B) augmented with an associative read-write memory can simulate a universal Turing machine without altering the model weights. It constructs a stored instruction computer via prompts and memory interactions to achieve universality.
We show that transformer-based large language models are computationally universal when augmented with an external memory. Any deterministic language model that conditions on strings of bounded length is equivalent to a finite automaton, hence computationally limited. However, augmenting such models with a read-write memory creates the possibility of processing arbitrarily large inputs and, potentially, simulating any algorithm. We establish that an existing large language model, Flan-U-PaLM 540B, can be combined with an associative read-write memory to exactly simulate the execution of a universal Turing machine, $U_{15,2}$. A key aspect of the finding is that it does not require any modification of the language model weights. Instead, the construction relies solely on designing a form of stored instruction computer that can subsequently be programmed with a specific set of prompts.
Motivation & Objective
- Demonstrate that a transformer-based language model conditioned on bounded-length strings is computationally limited without memory augmentation.
- Propose an external associative memory and a stored instruction computer to enable arbitrary computation.
- Show that Flan-U-PaLM 540B can exactly simulate the universal Turing machine U15,2 using only prompt-driven memory interactions.
Proposed method
- Introduce an external associative memory MEMORY that maps keys to values and interface it with the LLM as RAM.
- Define a simple compute cycle where the LLM acts as CPU and memory is updated via finite state post-processing using regular expressions to parse assignments and updates.
- Design a boot prompt and a set of instruction prompts to implement the state machine of U15,2 within MEMORY and the LLM prompts.
- Use memory location op as an instruction register and perform pre-processing of prompts with splicing patterns to read current memory symbols.
- Demonstrate that the stored instruction computer can simulate each compute step of U15,2 through a finite set of prompt-result behaviours.
Experimental results
Research questions
- RQ1Can a fixed, pre-trained LLM achieve universal computation when augmented with external memory?
- RQ2What minimal prompted stored instruction architecture suffices to simulate a universal Turing machine?
- RQ3Does Flan-U-PaLM 540B reliably execute the required prompt-programmed instructions to replicate a Turing machine's behavior?
Key findings
- A memory-augmented LLM can simulate a universal Turing machine using a finite set of prompt-programmed instructions.
- The interaction cycle retrieves the next prompt from memory, runs the LLM, and updates memory based on parsed results, achieving a von Neumann–style compute loop.
- The paper provides a concrete verification showing Flan-U-PaLM 540B can execute 29 (state, symbol) cases to mimic U15,2.
- No retraining of LLM weights is required; universality is achieved through prompt design and memory parsing.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.