In-Context Algorithm Emulation in Fixed-Weight Transformers
24 Aug · Jerry Yao-Chieh Hu, Hude Liu, Jennifer Yuntong Zhang +1 · arXiv:2508.17550
We prove that a minimal Transformer with frozen weights emulates a broad class of algorithms by in-context prompting. We formalize two modes of in-context algorithm emulation. In the task-specific mode, for any continuous function $f: \mathbb{R} \to \mathbb{R}$, we show the existence of a single-head softmax attention layer whose forward pass reproduces functions of the form $f(w^\top x - y)$ to arbitrary precision.…