# Destylacja kontekstu (wpisanie instrukcji w wagi modelu)

EN: **Context distillation** · id `contextdistill` · aliases: context distillation, prompt distillation, destylacja kontekstu

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Trenowanie i dostrajanie](https://aiatlasgraph.com/t/training.md) › [Destylacja](https://aiatlasgraph.com/t/distillation.md) › Destylacja kontekstu (wpisanie instrukcji w wagi modelu)

## Description

- PL: Dostrajanie modelu tak, by bez długiego promptu odpowiadał tak, jak odpowiadał z nim.
- EN: Fine-tuning a model so that without a long prompt it answers as it did with one.

## In one sentence

- PL: Sposób, by model przyswoił zachowanie wywoływane wcześniej długą instrukcją i odtwarzał je z krótszego wejścia.
- EN: A way for a model to absorb behaviour previously elicited by a long instruction and reproduce it from a shorter input.

## Problem it solves

- PL: Długie instrukcje i przykłady trzeba dołączać do każdego zapytania, co spowalnia odpowiedzi i podnosi koszt.
- EN: Long instructions and examples must be attached to every request, which slows answers and raises costs.

## What it does

- PL: Jak pracownik, który po tygodniu z instrukcją obsługi zna procedurę na pamięć i nie musi już do niej zaglądać.
- EN: Like an employee who, after a week with the manual, knows the procedure by heart and no longer needs to look it up.

## Everyday example

- PL: Firmowy czat zachowuje ton i zasady działu obsługi, choć pytania wysyła się do niego bez kilkustronicowego regulaminu.
- EN: A company chat keeps the support team's tone and rules even though questions are sent without the multi-page rulebook.

## This concerns you if you…

- PL: wysyłasz ten sam długi prompt przy każdym zapytaniu
- PL: płacisz za każdy token wejścia
- PL: chcesz skrócić czas odpowiedzi
- EN: send the same long prompt with every request
- EN: pay for every input token
- EN: want faster responses

## Keywords

prompt distillation · system prompt internalization · prompt baking · scratchpad · self-distillation · Learning by Distilling Context

## How it works

- PL: Ten sam model w roli nauczyciela dostaje pełny kontekst — instrukcje, przykłady lub notatnik rozumowania — i generuje odpowiedź. Następnie jest dostrajany, aby z krótkiego wejścia odtworzyć końcową odpowiedź bez pełnego kontekstu.
- EN: The same model acting as teacher receives the full context—instructions, examples or a reasoning scratchpad—and generates an answer. It is then fine-tuned to reproduce the final answer from a short input without the full context.

## Limits

- PL: Model przyswaja zachowanie tylko w zakresie wejść użytych w destylacji. Zmiana instrukcji wymaga ponownego treningu; łączenie wielu promptów może powodować interferencję i zapominanie.
- EN: The model absorbs behaviour only for the range of inputs used in distillation. Changing instructions requires retraining; combining many prompts can cause interference and forgetting.

## Key terms

- PL: **prompt nauczyciela**: Pełny kontekst z instrukcjami, który widzi tylko model w roli nauczyciela.
- PL: **scratchpad**: Miejsce na pośrednie kroki rozumowania przed końcową odpowiedzią.
- EN: **teacher prompt**: The full context with instructions, seen only by the teacher model.
- EN: **scratchpad**: Space for intermediate reasoning steps before the final answer.

## Know first

- [Prompty i kontekst (Prompting and context engineering)](https://aiatlasgraph.com/t/prompting.md)
- [SFT / instruction tuning (Supervised fine-tuning)](https://aiatlasgraph.com/t/sft.md)

## Sources

- [Learning by Distilling Context](<https://arxiv.org/abs/2209.15189>) `snell-2022-contextdistill` · by Charlie Snell, Dan Klein, Ruiqi Zhong

---

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