# Trening od zera / pretraining

EN: **Training from scratch and pretraining** · id `pretraining`

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Trenowanie i dostrajanie](https://aiatlasgraph.com/t/training.md) › Trening od zera / pretraining

## Description

- PL: Nauczenie modelu od początkowych wag. Pretraining to etap przygotowujący do dalszego użycia lub adaptacji.
- EN: Teaching a model from initial weights. Pretraining is the stage that prepares it for later use or adaptation.

## In one sentence

- PL: To podstawowy etap uczenia modelu wzorów w dużym zbiorze danych, zanim zostanie dopasowany do konkretnych zadań.
- EN: This initial stage teaches a model patterns in a large dataset before it is adapted to specific tasks.

## Problem it solves

- PL: Model z początkowymi ustawieniami nie zna wzorów języka lub obrazu potrzebnych do dalszego użycia.
- EN: A model with initial parameters lacks the language or image patterns needed for later use.

## What it does

- PL: Powtarzane ćwiczenia na danych dostarczają błędu do poprawiania ustawień, tworząc podstawę późniejszych umiejętności i dostrajania.
- EN: Repeated exercises on data produce error signals that adjust parameters, building a foundation for later abilities and adaptation.

## Everyday example

- PL: Model językowy ćwiczy na wielu tekstach przewidywanie dalszego ciągu, zanim dostanie przykłady rozmów z użytkownikiem.
- EN: A language model practises predicting continuations across many texts before receiving examples of user conversations.

## This concerns you if you…

- PL: chcesz zrozumieć, skąd bierze się model bazowy
- PL: planujesz podstawowe uczenie na dużym zbiorze danych
- EN: want to understand where a base model comes from
- EN: plan foundational training on a large dataset

## Keywords

self-supervised learning · causal language modeling · masked language modeling · data mixtures · BPE · cross-entropy loss · scaling laws · compute-optimal training · RoPE scaling · curriculum learning

## How it works

- PL: Na dużym zbiorze optymalizuje się cel nadzorowany lub samonadzorowany, budujący reprezentacje i podstawowe zdolności modelu. Dobór architektury, mieszanki danych i harmonogramu określa, jakie zależności parametry zachowają przed dalszą adaptacją.
- EN: A large dataset supports supervised or self-supervised objectives building model representations and foundational capabilities. Architecture, data mixtures and schedules determine which relationships parameters retain before further adaptation.

## Limits

- PL: Koszt i pokrycie danych ograniczają wyuczone zdolności. Cel treningowy nie gwarantuje zgodności z instrukcjami; błędy, uprzedzenia i zapamiętane fragmenty mogą przechodzić do dalszych etapów.
- EN: Costs and data coverage constrain learned capabilities. Training objectives cannot guarantee instruction alignment; errors, biases and memorised fragments can carry into later stages.

## Key terms

- PL: **samonadzór**: Tworzenie sygnału uczącego z samych danych bez osobnej ręcznej etykiety.
- PL: **model bazowy**: Model po wstępnym treningu, przed dostosowaniem do konkretnego zachowania.
- EN: **self-supervision**: Deriving learning signals from data without separate manual labels.
- EN: **base model**: A model after initial training, before adaptation to specific behaviour.

## Know first

- [Propagacja wsteczna (backpropagation) (Backpropagation)](https://aiatlasgraph.com/t/backprop.md)
- [Tokenizacja tekstu (BPE, WordPiece, SentencePiece) (Text tokenisation (BPE, WordPiece, SentencePiece))](https://aiatlasgraph.com/t/tokenization.md)

## Examples

- PL: Cele uczenia · tokenizacja · mini model
- EN: Objectives · tokenisation · small model

## Subtopics (6 direct, 6 in total)

- [Maskowane modelowanie języka (MLM) (Masked language modelling (MLM))](https://aiatlasgraph.com/t/mlm.md): A pretraining objective for encoders: the model restores masked tokens from context on both sides.
- [Mid-training (późna faza pretrainingu) (Mid-training)](https://aiatlasgraph.com/t/midtraining.md): A late pretraining phase on a smaller, carefully chosen data mix (e.g. maths, code, reasoning, long documents), usually while the learning rate is annealed. It strengthens selected capabilities before post-training.
- [Prawa skalowania i budżet obliczeń (Scaling laws and compute-optimal training)](https://aiatlasgraph.com/t/scalinglaws.md): Predictable relationships between model size, data, compute and quality. They let you plan a large training run from small ones and choose the ratio of parameters to tokens.
- [Przewidywanie następnego tokenu (modele autoregresyjne) (Next-token prediction objective)](https://aiatlasgraph.com/t/nexttoken.md): A common pretraining objective for autoregressive language models: predict the next token from the preceding ones. The error is typically optimised as cross-entropy.
- [Przewidywanie wielu tokenów naraz (multi-token prediction) (Multi-token prediction)](https://aiatlasgraph.com/t/multitoken.md): An auxiliary pretraining objective: from each position the model predicts several upcoming tokens with separate heads.
- [Wydłużanie okna kontekstu (Context window extension)](https://aiatlasgraph.com/t/contextextension.md): Further training intended to improve performance on sequences longer than those used previously — often by modifying positional encoding and training on long examples.

## Related topics

Untyped, symmetric "see also" links.

- [Dobór mieszanki danych (DoReMi, RegMix) (Data mixture optimisation)](https://aiatlasgraph.com/t/datamixing.md)
- [Modele bazowe dla szeregów czasowych (Time-series foundation models)](https://aiatlasgraph.com/t/tsfoundation.md)
- [Strategie zrównoleglania treningu (Training parallelism strategies)](https://aiatlasgraph.com/t/parallelism.md)
- [Syntetyczne dane do pretrainingu (przepisywanie, podręczniki) (Synthetic pretraining data: rephrasing and textbooks)](https://aiatlasgraph.com/t/pretrainsynthetic.md)
- [Teoria informacji: entropia i dywergencja KL (Information theory: entropy, cross-entropy and KL divergence)](https://aiatlasgraph.com/t/infotheory.md)

## Courses

- [Build and Train an LLM with JAX](<https://www.deeplearning.ai/courses/build-and-train-an-llm-with-jax>)

## Sources

- [Stanford CS336 · Language Modeling from Scratch (2025)](<https://cs336.stanford.edu/spring2025/>) `cs336` · reference: Budowa modeli, dane, trening, systemy, inferencja i post-training.
- [Berkeley CS185/285 · Deep Reinforcement Learning (2026)](<https://rail.eecs.berkeley.edu/deeprlcourse/>) `rl` · reference: Uczenie przez wzmacnianie, imitacja, sterowanie i RL dla LLM.
- [DeepLearning.AI — course catalogue](<https://www.deeplearning.ai/courses>) `dlai` · course catalogue: 42 topic labels with counts, about 130 courses.

---

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