A base model can continue text. How do we make it a useful assistant?
A pretrained model may be good at predicting text without reliably behaving like an instruction-following assistant. Post-training adds targeted examples and preference signals to shape how the model responds.
Start with the simplest idea: show the model many pairs of instruction → desired response and continue training on them. This is supervised fine-tuning (SFT).
Supervised fine-tuning — teach by example
One tiny SFT example
Across many curated pairs, training increases the probability of response patterns that match the desired behavior.
Preference feedback — choose between responses
Sometimes there is more than one plausible answer. Evaluators can compare two candidates and indicate which better follows the desired criteria.
Preference signal
RLHF (reinforcement learning from human feedback) is one family of methods that uses human preference information to shape model behavior. Modern post-training can also use other preference-optimization approaches; the core beginner idea is that feedback about better and worse responses becomes a training signal.
Demonstrations and comparisons supply different training signals. The branches below show alternatives for using preferences; they are not steps that every application must run in sequence.
Post-training can use demonstrations and preferences
Why LoRA exists — specialize without updating every base weight
Full fine-tuning can update an enormous number of parameters. LoRA (Low-Rank Adaptation) keeps the original weight matrix frozen and learns small additional low-rank matrices whose update is combined with the base model during use.
Base model stays frozen; a small learned adapter changes the effective transformation
A frozen base weight matrix W is shown alongside two small trainable matrices A and B. Their low-rank product contributes an adapter update while W remains unchanged.
A tiny LoRA parameter count
Suppose a base matrix is 512 × 512 and we choose LoRA rank 8. One adapter matrix has 512 × 8 = 4,096 parameters and the other has 8 × 512 = 4,096.
The original 512 × 512 base matrix remains frozen in standard LoRA adapter training. Updating W directly would violate that assumption.
The parameter count describes the adapter matrices, not a second full copy of the base model. Keep the frozen and trainable paths separate when reading the figure.
LoRA learns a small low-rank update beside a frozen matrix
Prompting, RAG, or fine-tuning?
Match the intervention to the problem
If the model already follows the desired style but simply lacks current private information, full fine-tuning is usually the wrong first tool. That is the problem RAG is designed to address.
Why the next lesson matters
Fine-tuning can change behavior. But what if the model's behavior is fine and the missing piece is today's private or current information?
Retrieval-Augmented Generation (RAG) →Summary / Key Takeaways
- Supervised fine-tuning trains on curated instruction–response pairs to shape desired behavior.
- Preference feedback compares candidate responses and can be used by RLHF or other post-training methods.
- Alignment can improve behavior but does not guarantee truth, safety, or correctness.
- LoRA keeps base weights frozen and learns small low-rank adapter matrices.
- A 512×512 matrix with rank-8 LoRA uses 4,096 + 4,096 = 8,192 adapter matrix parameters in the toy example.
- Prompting changes the input, RAG supplies external evidence, and fine-tuning changes learned behavior.