Where do the model's parameters come from?
In the introduction we used “The cat sat on the ____”. The model predicts the next token, compares its probability with the observed continuation, calculates an error, and adjusts its parameters.
Pretraining is this broad learning process repeated across a very large and varied corpus so the model develops general language and pattern-prediction capability.
Training data is not just “more text”
Why preparation matters
How next-token training examples are formed
For a token sequence [t₁, t₂, t₃, t₄], a causal language-model training view can use [t₁, t₂, t₃] as the available inputs while the targets are shifted one step to [t₂, t₃, t₄]. At each position, the target is the token that actually followed the available prefix.
Loss answers: how much probability did we give the correct token?
One common causal-language-model loss is negative log-likelihood. You do not need to memorize logarithms to understand the direction: assigning more probability to the observed next token gives a smaller loss.
Tiny loss comparison
The loss now connects the data preparation to learning: the observed next token supplies the target, the model supplies a probability, and the training loop uses the resulting error to update parameters. Follow those responsibilities through the diagram.
Pretraining is repeated prediction plus parameter updates
A seven-stage flow shows prepared text being tokenized, used for next-token prediction, evaluated with a loss, backpropagated, followed by a parameter update, and repeated.
Pretraining versus fine-tuning
Think of pretraining as broad education and fine-tuning as additional specialist coaching. Fine-tuning starts from an already trained model and continues updating some or all parameters using a narrower dataset or objective.
Two stages, different goals
Why training needs much more memory than the saved weights
A 1-billion-parameter model stored with 16-bit weights is roughly 2 GB of raw weight values as a simple estimate. That does not mean 2 GB is enough to train it.
Training may also need activations, gradients, optimizer state, temporary buffers, and communication overhead. The exact amount depends on the optimizer, precision, sequence length, batch size, checkpointing, hardware, and parallel strategy.
Why the next lesson matters
Pretraining creates a broad language model. How do we teach it to follow instructions, reflect preferences, and specialize efficiently?
SFT, RLHF & LoRA →Summary / Key Takeaways
- Pretraining repeatedly performs next-token prediction, loss calculation, backpropagation, and parameter updates over a broad corpus.
- Data quality, diversity, deduplication, and held-out validation affect what the model learns and how reliably progress is measured.
- Causal training shifts targets so each position learns the token that follows its available prefix.
- Giving the observed next token higher probability reduces negative log-likelihood.
- Fine-tuning continues training an existing model for a narrower goal.
- Raw weight memory is only one part of training memory; activations, gradients, optimizer state, and other overhead also matter.