Prefix Tuning and Prompt Tuning

Prefix tuning and prompt tuning are both soft-prompt methods. The shared idea: we are not editing the main model weights; we are learning a prompt representation. They differ mainly in how that learned context is attached and used.

Intuition

Both methods add virtual tokens (learned embeddings). Think of them as a small learned “header” that conditions the model for a task.

Method Plain-English idea Often useful for
Prefix tuning Attach learnable prefix context (often influencing attention keys/values as extra context) Generation tasks; compact adaptation
Prompt tuning Learn only the prompt embeddings; keep the whole model frozen Simple PEFT baseline

How it works

Prefix tuning

Prompt tuning

The cost of longer prompts

If you keep adding soft tokens:

Practical habits:

What goes wrong

One-line summary

Prefix tuning and prompt tuning learn virtual prompt context instead of updating the backbone — prefix tuning leans on learned prefix context; prompt tuning learns prompt embeddings with a frozen model.

Key terms