Training-Free Universal Approximation by Prompting Random Transformers
Not on the map. Why?
Abstract (arXiv)
How expressive is prompting a transformer? Answering this question is important for separating the roles of prompting, architecture, and pretraining in transformer models, and for determining whether task-specific behavior must be stored in model weights or can instead be induced at inference time through the prompt. We show, in an approximation-theoretic sense, that pretraining is optional: a single-layer softmax attention network with random, untrained weights can approximate any H"older function on a compact manifold when steered by an appropriate soft prompt. Guided by the connection between softmax attention and kernel methods, we construct explicit soft prompts (a prompt per target function, independent of the query) as solutions to linear systems matching attention logits to Gaussian kernel exponents, under which the frozen transformer emulates the classical Nadaraya-Watson kernel estimator. The construction requires only a mild rank condition on the weights, which we show holds almost surely under Gaussian initialization. The prompted network inherits the theoretical guarantees of kernel regression, leading to universal approximation theorems with minimax-optimal rates that depend on the intrinsic dimension. We further quantify the cost of prompting, exposing a tradeoff between the norm of the constructed soft prompt tokens, prompt length, and hidden dimension. Numerical experiments corroborate the constructions and predicted rates.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 47 of its 68 references that are in the map. First posted on arXiv 10 Aug 2026.
Builds on
47 of 68 references.
References · 47
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
- 2019Parameter-Efficient Transfer Learning for NLPcited by 4,236
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
- 2015Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classificationcited by 3,611
- 2023A Survey of Large Language Modelscited by 2,576
- 2020Rethinking Attention with Performerscited by 1,601
35 more
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2016Error bounds for approximations with deep ReLU networkscited by 574
- 2024A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applicationscited by 431
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
- 2021Random Feature Attentioncited by 354
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
- 2023Better Zero-Shot Reasoning with Role-Play Promptingcited by 223
- 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 213
- 2023In-Context Convergence of Transformerscited by 115
- 2023On the Role of Attention in Prompt-tuningcited by 50
- 2023Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?cited by 47
- 2023When Do Prompting and Prefix-Tuning Work? A Theory of Capabilities and Limitationscited by 43
- 2023What's the Magic Word? A Control Theory of LLM Promptingcited by 41
- 2023Approximation and Estimation Ability of Transformers for Sequence-to-Sequence Functions with Infinite Dimensional Inputcited by 32
- 2023Universality and Limitations of Prompt Tuningcited by 30
- 2024Understanding Scaling Laws with Statistical and Approximation Theory for Transformer Neural Networks on Intrinsically Low-dimensional Datacited by 30
- 2023Approximation Rate of the Transformer Architecture for Sequence Modelingcited by 28
- 2024Prompting a Pretrained Transformer Can Be a Universal Approximatorcited by 25
- 2023Understanding Emergent In-Context Learning from a Kernel Regression Perspectivecited by 24
- 2024Fundamental Limits of Prompt Tuning Transformers: Universality, Capacity and Efficiencycited by 22
- 2020Reservoir Transformerscited by 18
- 2024Algorithmic Capabilities of Random Transformerscited by 17
- 2023Prompt Engineering Through the Lens of Optimal Controlcited by 16
- 2025Understanding In-Context Learning on Structured Manifolds: Bridging Attention to Kernel Methodscited by 15
- 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformercited by 12
- 2026Efficient and Minimax Optimal In-context Nonparametric Regression with Transformerscited by 7
- 2025A Theoretical Framework for Prompt Engineering: Approximating Smooth Functions with Transformer Promptscited by 6
- 2025In-Context Algorithm Emulation in Fixed-Weight Transformerscited by 4
- 2025Memory Limitations of Prompt Tuning in Transformerscited by 4
- 2021What's Hidden in a One-layer Randomly Weighted Transformer?cited by 3
- 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizercited by 3
Built on by
Citing papers per year: 2026: 1.
1 paper.