# Destylacja on-policy (uczeń generuje, nauczyciel ocenia)

EN: **On-policy distillation** · id `onpolicydistill` · aliases: on-policy distillation, GKD, generalized knowledge distillation

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 on-policy (uczeń generuje, nauczyciel ocenia)

## Description

- PL: Uczeń generuje własne odpowiedzi, a nauczyciel dostarcza dla nich gęsty sygnał token po tokenie. Dzięki temu uczeń trenuje na stanach, które sam odwiedza, zamiast wyłącznie na gotowych odpowiedziach nauczyciela.
- EN: The student generates its own responses and the teacher provides a dense token-level signal for them. This trains the student on states it visits itself rather than only on finished teacher-generated answers.

## In one sentence

- PL: To uczenie modelu na jego własnych próbach przy pomocy wskazówek modelu nauczyciela.
- EN: This trains a model on its own attempts with guidance from a teacher model.

## Problem it solves

- PL: Uczeń podczas działania trafia na sytuacje wynikające z własnych wyborów, których nie widział w gotowych odpowiedziach nauczyciela.
- EN: During use, a student encounters situations caused by its own choices that were absent from completed teacher responses.

## What it does

- PL: Uczeń generuje tekst, a nauczyciel dostarcza sygnał dla kolejnych fragmentów, pomagając poprawiać decyzje w rzeczywiście odwiedzanych sytuacjach.
- EN: The student generates text, and the teacher provides signals for successive elements, helping improve decisions in situations the student actually encounters.

## Everyday example

- PL: Mały model zaczyna własne podsumowanie, a nauczyciel wskazuje lepsze dalsze wybory dla powstałego już tekstu.
- EN: A small model starts its own summary, and a teacher provides better next-choice signals for the text already produced.

## This concerns you if you…

- PL: uczeń myli się na własnych ścieżkach odpowiedzi
- PL: nauczyciel może oceniać wygenerowane fragmenty
- EN: find a student errs along its own response paths
- EN: can obtain teacher feedback on generated elements

## Keywords

GKD · MiniLLM · reverse KL · student-generated rollouts · DistiLLM · per-token teacher feedback

## How it works

- PL: Uczeń generuje sekwencje, a nauczyciel ocenia rozkłady następnych tokenów w napotkanych prefiksach. Aktualizacje dopasowują zachowanie na stanach odwiedzanych przez ucznia, ograniczając rozbieżność między kontekstami treningowymi i własnym generowaniem.
- EN: Students generate sequences, while teachers evaluate next-token distributions at encountered prefixes. Updates align behaviour on student-visited states, reducing mismatch between training contexts and the student's own generation.

## Limits

- PL: Próbkowanie ucznia i ocena nauczyciela zwiększają koszt treningu. Nieodpowiedni nauczyciel lub rozbieżność mogą utrwalać błędy; potrzebne jest pokrycie wejść i kontrola jakości poza odwiedzanymi trajektoriami.
- EN: Student sampling and teacher evaluation increase training costs. Unsuitable teachers or divergences can reinforce errors; input coverage and quality checks beyond visited trajectories are needed.

## Key terms

- PL: **rozkład stanów ucznia**: Konteksty wynikające z odpowiedzi generowanych przez aktualnego ucznia.
- PL: **sygnał tokenowy**: Informacja nauczyciela dostępna osobno dla kolejnych pozycji sekwencji.
- EN: **student state distribution**: Contexts produced by responses generated by the current student.
- EN: **token-level signal**: Teacher information available separately for successive sequence positions.

## Know first

- [Strategie dekodowania (Decoding strategies)](https://aiatlasgraph.com/t/decoding.md)
- [Funkcje straty (entropia krzyżowa, MSE) (Loss functions (cross-entropy, MSE))](https://aiatlasgraph.com/t/lossfunctions.md)

## Examples

- PL: GKD · reverse KL na tokenach ucznia · odzyskiwanie zdolności po dostrajaniu
- EN: GKD · per-token reverse KL on student samples · recovering abilities after fine-tuning

## Subtopics (2 direct, 2 in total)

- [Destylacja on-policy dla hierarchicznych zespołów agentów (On-policy distillation for hierarchical multi-agent teams)](https://aiatlasgraph.com/t/multiagentopd.md): Combines on-policy distillation with reinforcement learning to train a shared-parameter Leader-Searcher-Answerer team end to end.
- [Eksploracja w kontekście przez asymetryczną destylację on-policy (In-context exploration through asymmetric on-policy distillation)](https://aiatlasgraph.com/t/asteroid.md): A student-teacher framework in which the student's on-policy history receives action labels from a privileged expert, teaching test-time exploration.

## Related topics

Untyped, symmetric "see also" links.

- [Destylacja przez odpowiedzi nauczyciela (dane syntetyczne) (Sequence-level distillation from teacher outputs)](https://aiatlasgraph.com/t/seqdistill.md)
- [Katastrofalne zapominanie i jego ograniczanie (Catastrophic forgetting and its mitigation)](https://aiatlasgraph.com/t/forgetting.md)

## Sources

- [On-Policy Distillation of Language Models: Learning from Self-Generated Mistakes](<https://arxiv.org/abs/2306.13649>) `gkd-2023` · by Rishabh Agarwal, Nino Vieillard, Yongchao Zhou i in.
- [On-Policy Distillation](<https://thinkingmachines.ai/blog/on-policy-distillation/>) `tm-onpolicy-distill-2025` · by Kevin Lu i zespół Thinking Machines Lab

---

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