AI State of the Art
SOTA/Efficient Fine-tuning (PEFT)/24 min
Section 107

Prompt Tuning and Soft Prompts

Listen as a podcast →

The Flaw in Prefix Tuning That Prompt Tuning Fixes

In one sentence: prefix tuning replants learned vectors in every layer, which multiplies parameters by the layer count and complicates the implementation; prompt tuning puts them at the input only and lets the model propagate them itself.

Take prefix tuning's count again: l×d×L×2l \times d \times L \times 2. Prompt tuning drops the LL factor (the layers) and the factor of 2 (keys and values). What remains is k×dk \times d. On a 24-layer model, that divides the parameter count by roughly fifty.

What it adds are trainable vectors glued in front of the input text. Nothing else. The model is entirely frozen.

The Power of Scale for Parameter-Efficient Prompt Tuning (Lester et al., 2021)
The Idea in One Picture

Before a text enters the model, it is turned into a sequence of vectors: each word is replaced by the vector the model has learned to associate with it, its embedding. A simple table lookup.

Prompt tuning adds kk vectors that come from no row of that table, no word in the vocabulary corresponds to them. They are called "virtual tokens", or soft prompts. They, and only they, are learned.

How It Works Concretely

For an input x=[x1,x2,…,xn]x = [x_1, x_2, \ldots, x_n], prompt tuning builds:

x′=[p1,p2,…,pk,x1,x2,…,xn]x' = [p_1, p_2, \ldots, p_k, x_1, x_2, \ldots, x_n]

Read that back: the new input is the kk learned vectors, then the nn vectors of the real text. The brackets mean "placed end to end".

And the essential distinction, the one that decides everything:

NatureChanges with the text?
x1…xnx_1 \ldots x_nactivations: the result of looking up the embedding table for the text's wordsyes, on every request
p1…pkp_1 \ldots p_klearned parameters, of dimension dd like the aboveno, never
every weight in the modelparameters learned during pre-trainingfrozen, never modified here

The model treats the pip_i exactly as if they were real words: it cannot tell the difference. It propagates them through every layer, and its answer comes out steered.

Two-part diagram separated by a dashed line. On the left, Model Tuning: three data batches (Task A Batch, Task B Batch, Task C Batch) each feed a separate 11-billion-parameter model (Task A Model, Task B Model, Task C Model), all derived from an 11-billion-parameter pre-trained model. On the right, Prompt Tuning: three small Task Prompts blocks of 20,000 parameters each (A, B, C) are prepended to examples to form a Mixed-task Batch interleaving tasks A, C, B, A, C, feeding a single pre-trained 11-billion-parameter model.
What prompt tuning changes in practice. On the left, every task demands its own copy of the 11-billion-parameter model. On the right, there is only one model: the small 20K-parameter prefixes carry the task, which even allows several tasks to be mixed in a single inference batch.Source : The Power of Scale for Parameter-Efficient Prompt Tuning paper (Lester et al., figure 2), via ar5iv

The Parameter Count: k×dk \times d

The whole calculation is right there: number of fake words times model width. For d=4096d = 4096 and k=20k = 20:

20×4096=81,920 parameters20 \times 4096 = 81{,}920 \text{ parameters}

What that weighs on disk, in 16 bits, i.e. 2 bytes per parameter: 81,920×2=16481{,}920 \times 2 = 164 kilobytes. Against the 34 MB of a rank-16 LoRA adapter: two hundred times lighter.

And against the model itself: on a 7-billion-parameter model, 81,920/7×109=0.0012%81{,}920 / 7 \times 10^9 = 0.0012\%. One parameter in eighty thousand.

Initialization Matters a Lot

Since the fake words start from arbitrary values, their starting point matters. Three options, from crudest to sharpest:

  • Random: small values drawn at random. It eventually works, but slowly.
  • From real words: start from the embedding of a word relevant to the task. The model begins with a hint.
  • From the task's labels: start from the embeddings of the expected answers, the vectors for "positive" and "negative" on a sentiment task.
Why Good Initialization Changes Everything

A fake word initialized at random lands in a region of the space where the model has never seen anything: it has no idea what to do with it, and many examples are needed before that vector drifts somewhere useful.

A fake word initialized on the embedding of "positive" already sits somewhere the model interprets. It only has to adjust by a few steps. The gain is clearest when data is scarce.

The Key Discovery: The Scale Effect

This is the result that made the paper famous, and its title says it: The Power of Scale.

The larger the model, the closer prompt tuning gets to full fine-tuning.

What the abstract claims, and this is checkable: from a few billion parameters upwards, the method "closes the gap" and matches full fine-tuning. The models tested are from the T5 family (Text-to-Text Transfer Transformer, a Google series), from the smallest up to T5-XXL and its 11 billion parameters, and the benchmark is SuperGLUE, a battery of eight English comprehension tasks deliberately picked to be hard, successor to the GLUE mentioned on the adapters page.

Below a billion parameters, though, the gap is plain. The figure below shows both regimes.

Why? Because a large model already knows how to do the task; all it lacks is the indication of which task. A nudge is enough. A small model does not yet know how, and no nudge substitutes for learning. It is the difference between saying "Japanese cuisine" to a chef and saying it to someone who has never cooked.

Chart with four curves. The x-axis is model parameter count on a log scale from 10 to the 8th to 10 to the 11th. The y-axis is SuperGLUE score from 50 to 100. The red curve (Model Tuning) and the orange curve (multi-task Model Tuning) start around 63 and climb to 90. The green curve (Prompt Tuning) starts lower at 58, stays clearly below the other two until around 3 billion parameters, then meets them exactly at 90 around 10 to the 10th parameters. The blue curve (Prompt Design, manual prompt) stays far below, between 50 and 73.
The figure that made the paper famous. The green prompt tuning curve trails far behind full fine-tuning (red and orange) on small models, then the gap closes and they meet exactly at 11 billion parameters. The blue manual-prompt curve never catches up: learning the vectors is what makes the difference.Source : The Power of Scale for Parameter-Efficient Prompt Tuning paper (Lester et al., figure 1), via ar5iv
What the Scale Effect Teaches Us

A large model does not need its weights modified in order to adapt: steering it is enough. This is a property that only appears past a certain size, below it, the same method fails.

The paper backs this with a second claim you can check in its abstract: its end-to-end learned approach outperforms by a large margin GPT-3's few-shot learning, i.e. simply putting examples in the instruction. Learning the vectors beats writing them.

Comparison with Other Methods

Compare the formulas first, the most honest way to compare these methods.

MethodLearned parametersWhere it acts
Hand-written instruction0at the input
Prompt tuningk×dk \times dat the input only
Prefix tuningk×d×L×2k \times d \times L \times 2in every layer
LoRAr×(d+k)r \times (d + k) per targeted matrixin the chosen matrices
Full fine-tuningall of themeverywhere

With d=4096d = 4096, L=32L = 32, k=20k = 20, r=16r = 16 and LoRA applied to the four attention matrices of every layer, that gives: 0; 81,920; 5.2 million; 16.8 million; 7 billion. Five orders of magnitude between the extremes.

On the quality obtained, the ranking depends on model size, which is the whole point of the previous section: prompt tuning is weak on small models and catches up with full fine-tuning on very large ones. LoRA is the steadiest of the five.

The Concrete Advantages

1. Extreme Compactness

A soft prompt of 20 fake words on a model of width 4096 weighs 164 KB. Ten thousand tasks therefore come to 10,000×16410{,}000 \times 164 KB, i.e. 1.6 GB: a USB stick. With a 34 MB LoRA adapter, the same ten thousand tasks would take 340 GB.

Log-log chart. The x-axis is model size from 10 to the 8th to 10 to the 10th parameters. The y-axis is the number of task-specific parameters, from 10 to the 3rd to over 10 to the 9th. A background gradient shows the corresponding percentage, from 100 percent at the top to 0.001 percent at the bottom. Six curves: Model Tuning at the very top (as many parameters as the model), then Prefix Tuning at training time, Prefix Tuning at inference, WARP, Prompt Tuning near the bottom around 10 to the 5th, and Prompt Design at zero parameters.
Per-task storage cost, method by method, on a log scale. Between the top curve (full fine-tuning, as many parameters as the model) and prompt tuning there are four to five orders of magnitude: under 0.01 percent of the model parameters for each additional task.Source : The Power of Scale for Parameter-Efficient Prompt Tuning paper (Lester et al., figure 4), via ar5iv

2. No Modification to the Model

The model stays strictly intact: neither its layers nor the path the computation takes is touched. You lengthen its input, and that is all. Any machinery that can run the model can run a soft prompt.

3. Composition

Several soft prompts can be placed end to end: the "summary" one followed by the "formal style" one gives a formal summary. Several can also be averaged.

4. No Catastrophic Forgetting

Since not one model weight moves, the model cannot lose its general capabilities, strictly speaking, they are intact. That is a stronger guarantee than LoRA's, whose adapter can still over-specialize the behaviour.

Limitations

The Main Flaw: It Does Not Work on Small Models

Below a billion parameters, prompt tuning sits well behind LoRA. That is the figure above, read left to right. The condition of use is therefore a large enough model, the authors observe the catch-up from a few billion parameters upwards.

The Context Budget

Twenty fake words look like little, and they are: on a 2,048-token window, 20/2,048=1%20 / 2{,}048 = 1\%. On today's windows, which run to hundreds of thousands of tokens, it is undetectable. Unlike prefix tuning, whose long prefix eventually costs, this limit has become theoretical.

No Readability

Soft prompts correspond to no word. You cannot read them, so you cannot know what they encode. If the model misbehaves, nothing tells you whether that is the cause. It is a black box inside a black box, which matters when a behaviour has to be justified or audited.

Practical Use Cases

Many Tasks, One Model

A hundred classification tasks served by a single model. Each task carries its 164 KB soft prompt; the model in memory is shared. The paper's figure even shows you can mix several tasks in one batch of requests, which separate copies of the model make impossible.

Per-User Personalization

Each user can have their own soft prompt, learned from their past interactions, encoding their style and format preferences. 164 KB per user: a million users fit in 164 GB.

Averaging Several Prompts

Training five independent soft prompts for the same task and combining their predictions gives a steadier result. The memory cost of that combination is five times 164 KB: nothing.

Place in the Modern Ecosystem

LoRA has overshadowed prompt tuning in most practical uses. Its contribution remains considerable: it establishes that a large language model can be adapted entirely through its input, without a single weight changing. The idea still runs through work on steering model behaviour.

The next method, IA³, starts from the opposite premise: rather than acting on the input, it acts on the activations inside the model, multiplying them by learned coefficients.


In short. Prompt tuning is the most minimal efficient fine-tuning method: a few vectors at the input, nothing else, 164 KB per task. On very large models it rivals full fine-tuning; on small ones it fails. The full comparison is in PEFT: comparing the methods.

Check your understanding0 / 4

1. What is the finding that made the prompt tuning paper famous?

2. Why is a soft prompt roughly fifty times lighter than a prefix from prefix tuning?

3. Why does the page call a soft prompt a black box inside a black box?

4. How is prompt tuning's guarantee against catastrophic forgetting stronger than LoRA's?