The full answer
Prompt tuning learns a "soft prompt": a small set of trainable vectors (embeddings) placed in front of the input, adjusted by gradient descent on task examples while the model's own weights stay frozen. Traditional prompt engineering writes the prompt in words by hand and trains nothing.
How prompt tuning works
- Choose a number of virtual tokens, for example 20.
- Prepend 20 trainable embedding vectors to the embedded input; they don't correspond to real words.
- Train on labelled examples. Only those vectors change; the model is frozen.
- At inference, prepend the learned vectors for that task.
Lester and colleagues showed that as models get larger, prompt tuning approaches the quality of full fine-tuning while training only a tiny fraction of the parameters. Each task needs only its own small soft prompt, so one frozen model can serve many tasks.
Related methods
- Prefix tuning (Li and Liang) learns vectors inserted at every layer of the model, not only the input, which gives more control.
- P-tuning uses a small network to produce the prompt vectors.
- LoRA and other adapters train small weight matrices inside the model; they are the most common parameter-efficient fine-tuning method today. The Hugging Face PEFT library implements all of these.
Comparison with prompt engineering
| Prompt engineering | Prompt tuning | |
|---|---|---|
| What changes | Words in the prompt | Learned vectors |
| Needs training data | No (a test set is still wise) | Yes, labelled examples |
| Needs model access | Any API | The model's weights and embeddings |
| Human-readable | Yes | No: the vectors aren't words |
| Time to change | Minutes | A training run |
| Portability | Often works across models | Tied to one model |
When to use which
- Hosted, closed models are reached through an API that accepts text, so prompt tuning isn't possible there; prompt engineering, retrieval and the provider's fine-tuning service are the options.
- With an open-weights model you run yourself, prompt tuning or LoRA can adapt it cheaply to many tasks.
Experience In an interview, say honestly what you have done. A good answer might be: "I've used LoRA through the PEFT library on an open model for a classification task, and compared it with a few-shot prompt on the same test set. The prompt got close enough that we kept it, because it was easier to maintain." If you haven't used it, explain how you'd decide whether it was worth trying.
Last updated 16 October 2026