- https://arxiv.org/abs/2411.01992
- Source: arxiv
TL;DR
A single finite-size Transformer is provably Turing-complete under prompting: for every computable function there exists a prompt that causes it to compute that function.
Summary
Despite the enormous empirical success of the LLM prompting paradigm — one model, many tasks — no prior work had provided a theoretical foundation for it. This paper proves that prompting is Turing-complete: there exists a finite-size Transformer Γ such that for any computable function, a finite prompt encodes the function and Γ computes it on any input. Crucially, Γ is task-agnostic (fixed independently of the function) and the prompt is input-agnostic (fixed independently of the test input). The constructive proof goes through a novel intermediate model called 2-PTMs, which are Turing-complete and encode compactly into prompts. The result further shows that this single Transformer matches, up to a log factor, the CoT (chain-of-thought) complexity and exactly matches the precision complexity of the entire class of unbounded-size Transformers — establishing efficient universality.
Key contributions
- Proves Turing-completeness of prompting — for every computable function ϕ, a finite prompt πϕ exists such that a fixed finite-size Transformer Γ computes ϕ(x) on all inputs x.
- Introduces 2-PTMs (a new computational model) that are Turing-complete and can be encoded into a finite alphabet prompt, bridging computation theory and prompt design.
- Establishes near-optimal CoT complexity: Γ computes any TIME(t(n)) function in O(t(n) log t(n)) chain-of-thought steps, matching the class of all Transformers up to a log factor.
- Shows exact precision complexity parity: Γ requires only O(log(n + t(n))) bits of precision — the same bound as the full class of Transformers, implying that any P language is decidable within log-precision by a single Transformer.
- Provides a simple constructive proof (not just an existence argument) using ReLU activation, layer normalization, and causal attention in a decoder-only architecture.
When to cite
- When arguing theoretically why prompt engineering works — this paper provides the formal grounding that prompts can express any computable task.
- When discussing the expressivity and limits of Transformers and why a single pretrained model can generalize to novel tasks zero-shot.
- When comparing one-model-many-tasks vs. one-model-one-task paradigms and the computational power difference they imply.
- When reasoning about chain-of-thought length requirements for a given computational class — the O(t(n) log t(n)) bound is a concrete theoretical baseline.
Attention Is All You Need Prompting Frameworks for Large Language Models - A Survey A Survey of Large Language Models REACT - SYNERGIZING REASONING AND ACTING IN LANGUAGE MODELS