Prompting a Pretrained Transformer Can Be a Universal Approximator

Aleksandar Petrov, Philip H. S. Torr, Adel Bibi
2/22/2024
cs.LGcs.AImath.FA

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Despite the widespread adoption of prompting, prompt tuning and prefix-tuning of transformer models, our theoretical understanding of these fine-tuning methods remains limited. A key question is whether one can arbitrarily modify the behavior of pretrained model by prompting or prefix-tuning it. Formally, whether prompting and prefix-tuning a pretrained model can universally approximate sequence-to-sequence functions. This paper answers in the affirmative and demonstrates that much smaller pretrained models than previously thought can be universal approximators when prefixed. In fact, the attention mechanism is uniquely suited for universal approximation with prefix-tuning a single attention head being sufficient to approximate any continuous function. Moreover, any sequence-to-sequence function can be approximated by prefixing a transformer with depth linear in the sequence length. Beyond these density-type results, we also offer Jackson-type bounds on the length of the prefix needed to approximate a function to a desired precision.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{petrov2024prompting,
  title  = {Prompting a Pretrained Transformer Can Be a Universal Approximator},
  author = {Aleksandar Petrov and Philip H. S. Torr and Adel Bibi},
  year   = {2024},
  eprint = {2402.14753},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.14753v1},
  journal = {ICML 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/2402.14753.svg)](https://codeofpaper.com/paper/2402.14753)

Discussion