prefix-tuning-continuous-vector-per-layer

IN premisesummaries/2026/08/24/wiki-Prompt_engineering-chunk-2.md

Created 2026-08-24T17:11:22+00:00

Prefix-tuning (Li & Liang, 2021) learns a continuous prefix vector P ∈ ℝ^{L×d} in each Transformer layer, optimizing only that vector while keeping all model weights frozen.

Summary

Instead of retraining a Transformer's billions of parameters to adapt it to a new task, this approach inserts a small, learnable "hint" vector at the start of each layer and trains only that vector while leaving the original model completely untouched. The practical implication is that task adaptation becomes dramatically cheaper in both compute and memory, since the set of trainable parameters shrinks by orders of magnitude.