# Miękkie prompty (prompt tuning, prefix tuning)

EN: **Soft prompts: prompt and prefix tuning** · id `softprompts` · aliases: soft prompts, prompt tuning, prefix tuning, P-tuning

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Trenowanie i dostrajanie](https://aiatlasgraph.com/t/training.md) › [Efektywne dostrajanie](https://aiatlasgraph.com/t/peft.md) › Miękkie prompty (prompt tuning, prefix tuning)

## Description

- PL: Model pozostaje zamrożony, a uczy się niewielkiego zestawu ciągłych wektorów. Prompt tuning dodaje je jako wirtualne tokeny przy wejściu, natomiast prefix tuning wprowadza uczone prefiksy do kolejnych warstw uwagi.
- EN: The model stays frozen while a small set of continuous vectors is learned. Prompt tuning adds them as virtual input tokens, whereas prefix tuning supplies learned prefixes to successive attention layers.

## In one sentence

- PL: To uczenie małych liczbowych wskazówek dołączanych do modelu bez zmieniania jego głównych ustawień.
- EN: This learns small numerical prompts attached to a model without changing its main parameters.

## Problem it solves

- PL: Ręcznie pisana instrukcja nie wystarcza do dostosowania modelu, a pełne zmienianie jego ustawień jest kosztowne.
- EN: A manually written instruction does not sufficiently adapt a model, while changing its full parameters is costly.

## What it does

- PL: Trening poprawia wirtualne fragmenty wejścia lub wskazówki w warstwach uwagi, które kierują zachowaniem stałego modelu.
- EN: Training updates virtual input elements or attention-layer prefixes that guide a fixed model's behaviour.

## Everyday example

- PL: Dla sortowania zgłoszeń uczysz krótki zestaw liczbowych wskazówek, zachowując wspólny model bez zmian.
- EN: For sorting support requests, you learn a short set of numerical prompts while keeping the shared model unchanged.

## This concerns you if you…

- PL: chcesz uczyć wskazówki zamiast całego modelu
- PL: potrzebujesz małych zapisów dostosowania do zadań
- EN: want to train prompts rather than the whole model
- EN: need small task-adaptation representations

## Keywords

prompt tuning · prefix tuning · P-tuning · virtual tokens · prefix key-value vectors · frozen language model

## How it works

- PL: Gradient uczy ciągłe wektory dołączane do wejścia lub kluczy i wartości uwagi w wybranych warstwach. Zamrożony model interpretuje je jako dodatkowy kontekst sterujący, chociaż nie odpowiadają zwykłym słowom użytkownika.
- EN: Gradients train continuous vectors attached to inputs or attention keys and values in selected layers. Frozen models interpret them as additional conditioning context, although they do not represent ordinary user words.

## Limits

- PL: Prefiksy zużywają kontekst lub pamięć uwagi i wymagają wsparcia wykonawczego. Efekty zależą od modelu oraz zadania; uczone wektory nie muszą przenosić się między checkpointami.
- EN: Prefixes consume context or attention memory and need runtime support. Outcomes depend on models and tasks; learned vectors may not transfer between checkpoints.

## Key terms

- PL: **token wirtualny**: Uczony wektor zajmujący miejsce kontekstu bez odpowiadającego mu słowa.
- PL: **prefix tuning**: Uczenie dodatkowych reprezentacji sterujących uwagą przy zamrożonych wagach modelu.
- EN: **virtual token**: A learned vector occupying context space without a corresponding word.
- EN: **prefix tuning**: Learning extra attention-conditioning representations while model weights remain frozen.

## Know first

- [Tokenizacja tekstu (BPE, WordPiece, SentencePiece) (Text tokenisation (BPE, WordPiece, SentencePiece))](https://aiatlasgraph.com/t/tokenization.md)
- [Mechanizm self-attention (zapytania, klucze, wartości) (Self-attention (queries, keys, values))](https://aiatlasgraph.com/t/selfattention.md)

## Examples

- PL: prompt tuning · prefix tuning · P-tuning

## Related topics

Untyped, symmetric "see also" links.

- [Prompty i kontekst (Prompting and context engineering)](https://aiatlasgraph.com/t/prompting.md)

## Sources

- [Prefix-Tuning: Optimizing Continuous Prompts for Generation](<https://arxiv.org/abs/2101.00190>) `prefix-tuning-2021` · by Xiang Lisa Li, Percy Liang
- [The Power of Scale for Parameter-Efficient Prompt Tuning](<https://arxiv.org/abs/2104.08691>) `prompt-tuning-2021` · by Brian Lester, Rami Al-Rfou, Noah Constant
- [Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey](<https://arxiv.org/abs/2403.14608>) `peft-survey-2024` · by Zeyu Han, Chao Gao, Jinyang Liu i in.
- [Hugging Face PEFT — library documentation](<https://huggingface.co/docs/peft/index>) `hf-peft-docs` · by Hugging Face

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/softprompts · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
