Notes

Prompt Tuning

Writing a better prompt means searching for words by hand. Prompt tuning asks a different question: if the model only ever sees a prompt as vectors, why limit the search to vectors that spell real words? It learns the prompt as numbers, by gradient descent, with the model itself frozen.

How it works

A block of 20 to 100 continuous vectors is prepended to the embedded input. These soft prompts live in embedding space and correspond to no tokens in the vocabulary. Training is the ordinary forward and backward pass over task data, except that only those vectors are updated — every model weight stays untouched. What you keep afterwards is a file of a few thousand numbers, so one served base model can host many tasks at once: swap the soft prompt, get different behaviour.

Where it stands
  • Against few-shot prompting: much stronger on the target task, and it costs no context window beyond its own short block.
  • Against full fine-tuning: thousands of times fewer trained parameters, and it closes most of the quality gap once the base model is large — at a few hundred million parameters it lags badly.
  • Against LoRA: fewer parameters still, but slower to converge and more sensitive to initialisation, which is why LoRA dominates in practice.
What you give up

A soft prompt cannot be read or edited — you test what it does rather than inspect what it says — and it is bound to the exact model it was trained against. Prefix tuning is the close variant that injects learned vectors at every layer instead of only at the input.

Prompt tuning learns a short block of continuous vectors — a soft prompt — that is prepended to the embedded input and trained by gradient descent while every model weight stays frozen. It adapts a model to a task by storing a few thousand numbers instead of a new copy of the weights, so one served base model can carry many tasks. The learned prompt is not human-readable, and it matches full fine-tuning only on large models.

Imagine you cannot change what a brilliant but stubborn expert knows, yet you can hand them a small card to glance at before every answer. Now imagine the card is not written in words at all — it is a pattern, worked out by trial and error, that happens to put the expert in exactly the right frame of mind for your kind of question. That is prompt tuning. Rather than retraining the whole AI, which is slow and expensive, a tiny set of numbers is trained to sit in front of whatever you ask. Different cards make the same system good at different jobs. Nobody can read the card, but it works.