Prefix Tuning
A method of the PEFT family: instead of all weights, only a small 'prefix' — a set of virtual vectors inserted before the model input — is trained.
Idea
The model is frozen. Trainable hint vectors are added before its input, which 'tune' its behavior. Only these vectors are changed, while billions of weights remain untouched.
Advantages
- A fraction of a percent of trainable parameters;
- Memory and time savings;
- One base model + many lightweight prefixes for different tasks.
Prefix Tuning vs LoRA
| Prefix Tuning | LoRA | |
|---|---|---|
| What is trained | Vectors at the input | Matrices within layers |
| Popularity | Lower | Higher |