# DPO i optymalizacja offline

EN: **Direct preference optimization and offline variants** · id `dpo`

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Trenowanie i dostrajanie](https://aiatlasgraph.com/t/training.md) › [Post-training](https://aiatlasgraph.com/t/posttraining.md) › [Preferencje i RL dla LLM](https://aiatlasgraph.com/t/preferences.md) › DPO i optymalizacja offline

## Description

- PL: Uczenie bezpośrednio na parach odpowiedź wybrana–odrzucona, bez osobnego modelu nagrody. Tańsze obliczeniowo od RL.
- EN: Training directly on chosen–rejected answer pairs, with no separate reward model. Computationally cheaper than RL.

## In one sentence

- PL: To bezpośrednie uczenie modelu na parach odpowiedzi wybranych i odrzuconych.
- EN: This directly trains a model on pairs of preferred and rejected responses.

## Problem it solves

- PL: Masz porównania dobrych i słabszych odpowiedzi, ale osobny model oceny oraz trening z nagrodami komplikują proces.
- EN: You have comparisons of better and worse responses, but a separate evaluator and reward-based training complicate the process.

## What it does

- PL: Reguła treningu zwiększa względną szansę wybranej odpowiedzi wobec odrzuconej, odnosząc zmianę do modelu referencyjnego bez osobnego uczenia nagrody.
- EN: The training rule raises the preferred response's relative likelihood, comparing changes against a reference model without training a separate reward model.

## Everyday example

- PL: Na parach odpowiedzi klientom uczysz model wybierać jasne wyjaśnienie zamiast rozwlekłego tekstu pomijającego problem.
- EN: Using paired customer replies, you train a model to favour clear explanations over lengthy text that misses the problem.

## This concerns you if you…

- PL: masz pary odpowiedzi z zaznaczonym wyborem
- PL: szukasz prostszego treningu preferencji
- EN: have response pairs with marked preferences
- EN: seek simpler preference training

## Keywords

IPO · KTO · ORPO · SimPO · beta parameter · TRL DPOTrainer · preference pairs

## How it works

- PL: Dla preferowanej i odrzuconej odpowiedzi oblicza się logarytmy ilorazów prawdopodobieństw polityki i modelu referencyjnego. Strata logistyczna na różnicy tych wartości uczy względnej preferencji bez osobnego modelu nagrody i pętli generowania próbek.
- EN: For preferred and rejected responses, log probability ratios compare the policy with a reference model. A logistic loss on their difference learns relative preference without a separate reward model or rollout loop.

## Limits

- PL: Jakość zależy od par i zgodności ich rozkładu z przyszłym użyciem. Błędne preferencje oraz stronniczość długości przenoszą się na model; siła odniesienia i regularizacja wymagają doboru.
- EN: Quality depends on pairs and their distribution matching future use. Incorrect preferences and length bias transfer to models; reference strength and regularisation require selection.

## Key terms

- PL: **niejawna nagroda**: Wartość wynikająca z relacji prawdopodobieństw polityki i odniesienia.
- PL: **strata logistyczna**: Cel klasyfikacji dopasowujący prawdopodobieństwo wyboru preferowanej odpowiedzi.
- EN: **implicit reward**: A value derived from policy-to-reference probability relationships.
- EN: **logistic loss**: A classification objective fitting the probability of choosing the preferred response.

## Know first

- [Statystyka i niepewność (Statistics and uncertainty)](https://aiatlasgraph.com/t/probability.md)
- [Etykietowanie i feedback (Annotation and feedback)](https://aiatlasgraph.com/t/annotation.md)

## Examples

- PL: DPO · IPO · KTO · pary on-policy z rejection sampling
- EN: DPO · IPO · KTO · on-policy pairs from rejection sampling

## Subtopics (2 direct, 2 in total)

- [Iteracyjne DPO na świeżych danych preferencji (Iterative DPO with newly generated preference data)](https://aiatlasgraph.com/t/onlinedpo.md): Repeated rounds of DPO in which the current model generates answer pairs and a human, reward model or judge rates them.
- [Optymalizacja preferencji bez modelu referencyjnego (Reference-free preference optimization)](https://aiatlasgraph.com/t/refreepo.md): DPO variants that need no frozen copy of the model as a reference point.

## Related topics

Untyped, symmetric "see also" links.

- [Zbieranie danych preferencji (porównania odpowiedzi) (Preference data collection (response comparisons))](https://aiatlasgraph.com/t/preferencedatacollection.md)

## Sources

- [LLM Course (Maxime Labonne)](<https://github.com/mlabonne/llm-course>) `mlabonne-llm-course` · by Maxime Labonne

---

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