# Normalizacja warstw (BatchNorm, LayerNorm, RMSNorm)

EN: **Normalisation layers (BatchNorm, LayerNorm, RMSNorm)** · id `normalization` · aliases: normalization layers, normalizacja, batch normalization, BatchNorm, layer normalization, LayerNorm, RMSNorm, pre-norm, QK-norm

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) › Normalizacja warstw (BatchNorm, LayerNorm, RMSNorm)

## Description

- PL: Warstwy przeskalowujące aktywacje, które często ułatwiają stabilny trening głębokich sieci. BatchNorm używa statystyk mini-batcha i jest typowy dla CNN; LayerNorm normalizuje cechy pojedynczego przykładu i jest powszechny w transformerach; RMSNorm upraszcza LayerNorm i jest często stosowany w nowszych LLM, zwykle w układzie pre-norm.
- EN: Layers that rescale activations and often help stabilise deep-network training. BatchNorm uses mini-batch statistics and is typical in CNNs; LayerNorm normalises features within one example and is common in transformers; RMSNorm simplifies LayerNorm and is often used in newer LLMs, usually in a pre-norm layout.

## In one sentence

- PL: To przeskalowywanie sygnałów wewnątrz sieci, żeby łatwiej było ją uczyć.
- EN: This rescales signals inside a network to make training easier.

## Problem it solves

- PL: Sygnały w kolejnych warstwach mogą mieć bardzo różne wielkości, co utrudnia stabilne poprawianie modelu.
- EN: Signals across layers can have very different magnitudes, making stable model updates harder.

## What it does

- PL: Wybrane grupy wartości są sprowadzane do porównywalnej skali, a dodatkowe ustawienia pozwalają modelowi dostosować ich zakres.
- EN: Selected groups of values are brought to comparable scales, with additional settings letting the model adjust their range.

## Everyday example

- PL: Podczas treningu głębokiej sieci dodajesz warstwy przeskalowujące sygnały i sprawdzasz, czy uczenie przebiega stabilniej.
- EN: When training a deep network, you add layers that rescale signals and check whether learning becomes more stable.

## This concerns you if you…

- PL: trening sieci jest niestabilny
- PL: poznajesz sposób regulowania sygnałów między warstwami
- EN: find network training unstable
- EN: study how signals are regulated between layers

## Keywords

BatchNorm · LayerNorm · RMSNorm · pre-norm · post-norm · QK normalization

## How it works

- PL: Aktywacje skaluje się za pomocą statystyk wybranej grupy elementów, a uczone współczynniki przywracają elastyczność reprezentacji. Warianty różnią się osiami agregacji i użyciem centrowania; normalizacja względem batcha wymaga uzgodnienia statystyk treningu i inferencji.
- EN: Activations are scaled using statistics over selected element groups, with learned coefficients restoring representational flexibility. Variants differ in aggregation axes and centring; batch-based normalisation requires reconciling training and inference statistics.

## Limits

- PL: Małe lub niereprezentatywne batche destabilizują statystyki zbiorcze. Miejsce normalizacji wpływa na gradienty; jej zastosowanie nie zastępuje poprawnego skalowania wejścia ani doboru optymalizatora.
- EN: Small or unrepresentative batches destabilise aggregate statistics. Normalisation placement affects gradients; it cannot replace suitable input scaling or optimiser choice.

## Key terms

- PL: **oś normalizacji**: Wymiar danych, wzdłuż którego zbierane są statystyki przeskalowania.
- PL: **średnia bieżąca**: Wygładzana statystyka treningowa wykorzystywana później przy inferencji.
- EN: **normalisation axis**: A data dimension across which rescaling statistics are collected.
- EN: **running mean**: A smoothed training statistic later used during inference.

## Know first

- [Rozkłady prawdopodobieństwa (Probability distributions)](https://aiatlasgraph.com/t/distributions.md)
- [Algebra liniowa: wektory i macierze (Linear algebra: vectors and matrices)](https://aiatlasgraph.com/t/linearalgebra.md)

## Examples

- PL: BatchNorm · LayerNorm · RMSNorm · pre-norm vs post-norm · QK-norm

## Related topics

Untyped, symmetric "see also" links.

- [Stabilność treningu i skoki straty (Training stability)](https://aiatlasgraph.com/t/trainingstability.md)

## Sources

- [Neural Networks: Zero to Hero (course repository)](<https://github.com/karpathy/nn-zero-to-hero>) `karpathy-zero-to-hero` · by Andrej Karpathy
- [Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift](<https://arxiv.org/abs/1502.03167>) `batchnorm-2015` · by Sergey Ioffe, Christian Szegedy
- [Layer Normalization](<https://arxiv.org/abs/1607.06450>) `layernorm-2016` · by Jimmy Lei Ba, Jamie Ryan Kiros, Geoffrey E. Hinton
- [Root Mean Square Layer Normalization](<https://arxiv.org/abs/1910.07467>) `rmsnorm-2019` · by Biao Zhang, Rico Sennrich
- [The Big LLM Architecture Comparison — From DeepSeek V3 to GLM-5](<https://magazine.sebastianraschka.com/p/the-big-llm-architecture-comparison>) `raschka-llm-arch-comparison` · by Sebastian Raschka

---

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