Ask, and it shall be given: On the Turing completeness of prompting

Ruizhong Qiu, Zhe Xu, Wenxuan Bao, Hanghang Tong
2/12/2026

No official code found. Best implementation: q-rz/ICLR25-prompting-theory (1 star, MIT, last commit 2025-04-24).

Abstract

Since the success of GPT, large language models (LLMs) have been revolutionizing machine learning and have initiated the so-called LLM prompting paradigm. In the era of LLMs, people train a single general-purpose LLM and provide the LLM with different prompts to perform different tasks. However, such empirical success largely lacks theoretical understanding. Here, we present the first theoretical study on the LLM prompting paradigm to the best of our knowledge. In this work, we show that prompting is in fact Turing-complete: there exists a finite-size Transformer such that for any computable function, there exists a corresponding prompt following which the Transformer computes the function. Furthermore, we show that even though we use only a single finite-size Transformer, it can still achieve nearly the same complexity bounds as that of the class of all unbounded-size Transformers. Overall, our result reveals that prompting can enable a single finite-size Transformer to be efficiently universal, which establishes a theoretical underpinning for prompt engineering in practice.

View on arXivView PDF

Code Implementations(1)

MIT

On the Turing completeness of prompting (ICLR 2025)

10Jupyter NotebookNov 28, 20241 years agoMIT

Similar Papers

Cite this paper

@article{qiu2026ask,
  title  = {Ask, and it shall be given: On the Turing completeness of prompting},
  author = {Ruizhong Qiu and Zhe Xu and Wenxuan Bao and Hanghang Tong},
  year   = {2026},
  eprint = {2411.01992},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2411.01992},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.01992.svg)](https://codeofpaper.com/paper/2411.01992)

Discussion