# Propagacja wsteczna (backpropagation)

EN: **Backpropagation** · id `backprop` · aliases: backpropagation, backprop, propagacja wsteczna, wsteczna propagacja błędu, autograd, automatic differentiation

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Sieci i modele generatywne](https://aiatlasgraph.com/t/neural.md) › [Podstawy sieci neuronowych](https://aiatlasgraph.com/t/neuralbasics.md) › Propagacja wsteczna (backpropagation)

## Description

- PL: Algorytm liczenia gradientu straty względem parametrów sieci: przejście w przód oblicza wynik, a przejście wstecz propaguje po grafie obliczeń pochodne zgodnie z regułą łańcuchową. Z tych gradientów korzystają optymalizatory gradientowe; biblioteki zwykle wyznaczają je przez automatyczne różniczkowanie.
- EN: An algorithm for computing the gradient of the loss with respect to network parameters: the forward pass computes the output, while the backward pass propagates derivatives through the computation graph using the chain rule. Gradient-based optimisers use these gradients; libraries usually obtain them through automatic differentiation.

## In one sentence

- PL: To obliczanie, jak zmiany poszczególnych ustawień sieci wpłynęłyby na jej błąd.
- EN: This calculates how changing individual network settings would affect its error.

## Problem it solves

- PL: Sieć ma wiele ustawień, a sprawdzanie każdej możliwej poprawki osobno byłoby zbyt kosztowne.
- EN: A network has many settings, and testing every possible adjustment separately would be too costly.

## What it does

- PL: Po obliczeniu wyniku przenosi informację o zmianie błędu wstecz przez warstwy; algorytm uczenia wykorzystuje ją do aktualizacji ustawień.
- EN: After calculating a result, it passes error-change information backwards through the layers; the learning algorithm uses it to update settings.

## Everyday example

- PL: Po błędnym rozpoznaniu kwiatu trening oblicza kierunki zmian połączeń i wykorzystuje je do następnej poprawki modelu.
- EN: After misidentifying a flower, training calculates adjustment directions for the connections and uses them for the next model update.

## This concerns you if you…

- PL: chcesz zrozumieć uczenie sieci
- PL: sprawdzasz, skąd algorytm wie, co poprawiać
- EN: want to understand network training
- EN: wonder how an algorithm knows what to adjust

## Keywords

chain rule · reverse-mode differentiation · computation graphs · PyTorch autograd · micrograd · gradient accumulation

## How it works

- PL: Przejście w przód zapisuje wartości pośrednie grafu, a przejście odwrotne propaguje gradient straty przez lokalne pochodne. Reguła łańcuchowa sumuje wpływy wszystkich ścieżek na dany parametr, przekazując optymalizatorowi gradient całego celu.
- EN: A forward pass records intermediate graph values, and a reverse pass propagates loss gradients through local derivatives. The chain rule sums all paths' contributions to each parameter, supplying the optimiser with the full objective gradient.

## Limits

- PL: Przechowywanie aktywacji zużywa pamięć, a ich ponowne obliczanie czas. Długie iloczyny pochodnych mogą zanikać lub eksplodować; operacje dyskretne wymagają osobnych estymatorów albo przybliżeń.
- EN: Storing activations consumes memory, while recomputation consumes time. Long derivative products can vanish or explode; discrete operations require separate estimators or approximations.

## Key terms

- PL: **reguła łańcuchowa**: Zasada obliczania pochodnej złożenia z pochodnych jego składników.
- PL: **różniczkowanie odwrotne**: Obliczanie pochodnych wielu wejść przez propagację od wyjściowej wartości skalarnej.
- EN: **chain rule**: A rule computing a composition's derivative from its component derivatives.
- EN: **reverse-mode differentiation**: Computing derivatives for many inputs by propagating from a scalar output.

## Know first

- [Rachunek różniczkowy i gradienty (Calculus and gradients)](https://aiatlasgraph.com/t/calculus.md)
- [Algebra liniowa: wektory i macierze (Linear algebra: vectors and matrices)](https://aiatlasgraph.com/t/linearalgebra.md)

## Examples

- PL: graf obliczeń · reguła łańcuchowa · autograd (PyTorch) · micrograd
- EN: computational graph · chain rule · autograd (PyTorch) · micrograd

## Related topics

Untyped, symmetric "see also" links.

- [Rachunek różniczkowy i gradienty (Calculus and gradients)](https://aiatlasgraph.com/t/calculus.md)
- [Spadek gradientu i optymalizacja ciągła (Gradient descent and continuous optimisation)](https://aiatlasgraph.com/t/mathoptimization.md)

## Sources

- [Dive into Deep Learning — table of contents](<https://d2l.ai/>) `d2l-toc` · by Aston Zhang, Zachary C. Lipton, Mu Li, Alexander J. Smola
- [Learning representations by back-propagating errors](<https://www.nature.com/articles/323533a0>) `rumelhart-backprop-1986` · by David E. Rumelhart, Geoffrey E. Hinton, Ronald J. Williams
- [Neural Networks: Zero to Hero (course repository)](<https://github.com/karpathy/nn-zero-to-hero>) `karpathy-zero-to-hero` · by Andrej Karpathy

---

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