about
Ask, and it shall be given: Turing completeness of prompting (arxiv.org)
1 point by sandwichsphinx on Nov 6, 2024 | hide | past | pdf | discuss on HN

In plain words: A single fixed-size language model, given the right prompt, can compute any function a computer can, showing that prompting alone is powerful enough to be universal. It also runs nearly as efficiently as models allowed to grow without limit.

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

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.

Ruizhong Qiu, Zhe Xu, Wenxuan Bao, Hanghang Tong
arXiv:2411.01992 · cs.LG, cs.CC · submitted Nov 4, 2024 · updated Feb 20, 2025
abstract · pdf · html · ICLR 2025

add comment on HN
Also discussed: Nov 2024 (1 point, 0 comments)