# TRPO i naturalny gradient polityki

EN: **Trust region policy optimisation and natural policy gradient** · id `trpo` · aliases: TRPO, trust region policy optimization, natural policy gradient, NPG

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Uczenie ze wzmocnieniem i decyzje](https://aiatlasgraph.com/t/decisions.md) › [Algorytmy RL](https://aiatlasgraph.com/t/rlalgorithms.md) › [Gradient polityki (REINFORCE)](https://aiatlasgraph.com/t/policygradient.md) › TRPO i naturalny gradient polityki

## Description

- PL: Optymalizacja polityki z ograniczeniem dywergencji KL między starą a nową polityką (region zaufania), spokrewniona z naturalnym gradientem i wyprowadzona z teoretycznej granicy monotonicznej poprawy.
- EN: Policy optimisation constrained by the KL divergence between old and new policy (a trust region), related to the natural gradient and derived from a theoretical monotonic-improvement bound.

## In one sentence

- PL: Metoda poprawiania zachowania programu małymi, bezpiecznymi krokami, żeby jedna zła zmiana nie zepsuła wszystkiego.
- EN: A method to improve a program's behaviour in small, safe steps so one bad change does not ruin everything.

## Problem it solves

- PL: Zbyt duża zmiana sposobu działania potrafi w jednej chwili zniszczyć to, czego program uczył się godzinami.
- EN: A change to behaviour that is too big can destroy in an instant what a program learned over hours.

## What it does

- PL: Jak trener, który każdego dnia zmienia technikę zawodnika tylko odrobinę, sprawdzając, czy wyniki się nie pogarszają.
- EN: Like a coach who changes an athlete's technique only slightly each day, checking that results do not get worse.

## Everyday example

- PL: Symulowany robot uczy się chodu bez nagłych upadków, bo każda poprawka różni się niewiele od poprzedniego stylu chodzenia.
- EN: A simulated robot learns to walk without sudden collapses, because each tweak barely differs from its previous gait.

## This concerns you if you…

- PL: trening twojego agenta nagle się załamuje po dobrej passie
- PL: chcesz zrozumieć, skąd wzięły się popularne metody ostrożnych kroków
- EN: your agent's training suddenly collapses after a good run
- EN: want to understand where popular cautious-step methods came from

## Keywords

natural policy gradient · Fisher information matrix · conjugate gradient · KL constraint · surrogate objective · monotonic improvement · MuJoCo locomotion

## How it works

- PL: Naturalny gradient skaluje krok przez odwrotność macierzy informacji Fishera, mierząc zmianę w przestrzeni rozkładów, a nie parametrów. TRPO maksymalizuje zastępczą funkcję celu z ważeniem istotności przy ograniczeniu średniej KL, rozwiązując problem metodą gradientu sprzężonego i przeszukiwaniem liniowym.
- EN: The natural gradient scales the step by the inverse Fisher information matrix, measuring change in distribution space rather than parameter space. TRPO maximises an importance-weighted surrogate objective under a mean-KL constraint, solved with conjugate gradient and a line search.

## Limits

- PL: Obliczenia drugiego rzędu są kosztowne i komplikują implementację, zwłaszcza przy dużych sieciach i współdzielonych parametrach. W praktyce w dużej mierze zastąpiło go prostsze PPO; gwarancje teoretyczne słabną przez przybliżenia.
- EN: Second-order computation is costly and complicates implementation, especially with large networks and shared parameters. In practice it was largely replaced by the simpler PPO; theoretical guarantees weaken under approximations.

## Key terms

- PL: **dywergencja KL**: Miara, jak bardzo dwa rozkłady prawdopodobieństwa różnią się od siebie.
- PL: **region zaufania**: Obszar wokół obecnej polityki, w którym przybliżenie celu jest wiarygodne.
- PL: **macierz Fishera**: Opisuje, jak czuły jest rozkład na zmiany parametrów.
- EN: **KL divergence**: A measure of how much two probability distributions differ.
- EN: **trust region**: A neighbourhood of the current policy where the objective approximation is reliable.
- EN: **Fisher matrix**: Describes how sensitive a distribution is to parameter changes.

## Know first

- [Teoria informacji: entropia i dywergencja KL (Information theory: entropy, cross-entropy and KL divergence)](https://aiatlasgraph.com/t/infotheory.md)
- [Spadek gradientu i optymalizacja ciągła (Gradient descent and continuous optimisation)](https://aiatlasgraph.com/t/mathoptimization.md)

## Related topics

Untyped, symmetric "see also" links.

- [Proximal Policy Optimization (PPO) (Proximal policy optimization (PPO))](https://aiatlasgraph.com/t/ppo.md)

## Sources

- [OpenAI Spinning Up — Part 2: Kinds of RL Algorithms](<https://spinningup.openai.com/en/latest/spinningup/rl_intro2.html>) `spinningup-rl-taxonomy` · by Joshua Achiam / OpenAI
- [Trust Region Policy Optimization](<https://arxiv.org/abs/1502.05477>) `trpo-2015` · by John Schulman; Sergey Levine; Philipp Moritz; Michael I. Jordan; Pieter Abbeel

---

AI Atlas revision 128 (2026-11-04) · HTML: https://aiatlasgraph.com/t/trpo · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-11-04
