Search papers, labs, and topics across Lattice.
This paper investigates the expressiveness of prompting in transformer models, revealing that pretraining can be bypassed entirely. The authors demonstrate that a single-layer softmax attention network with random weights can approximate any H枚lder function when guided by specifically constructed soft prompts, effectively emulating kernel methods. Their findings establish universal approximation theorems with minimax-optimal rates, highlighting a tradeoff between prompt characteristics and model dimensions, supported by numerical experiments.
A random transformer can achieve universal approximation without any pretraining, challenging conventional beliefs about model training requirements.
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枚lder 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.