AITraining2U

Programs

Resources

Case Studies

Quick Links

Enquire Now
AI Fundamentals

Fine-tuning, distillation & RLHF: shaping a base model

A freshly pretrained model is a brilliant autocomplete, not an assistant. The techniques that turn it into Claude or ChatGPT — SFT, LoRA, distillation and RLHF — explained.

By AITraining2U Editorial Team 2026-07-24 8 min read
Concept of refining and shaping an AI model after training

Straight out of pretraining, a model is a spectacularly good next-token predictor — but it is not yet helpful, safe, or specialised. Turning that raw base model into a useful assistant is the job of post-training: fine-tuning, distillation and RLHF. Here is what each does and when you would reach for it.

The post-training toolkit

The post-training toolkit 1SFT
Supervised fine-tuning on curated input–output examples.
2LoRA
Trains tiny extra matrices — under 1% of the weights.
3Distillation
A small student model imitates a large teacher.
4RLHF
Human preferences shape a helpful, safe assistant.

Fine-tuning: specialise a model you already have

Fine-tuning continues training a base model on a smaller, curated dataset so it adapts — to your tone of voice, a specific task, or a domain like legal or finance. Because the model already understands language, this is dramatically cheaper than pretraining. Supervised fine-tuning (SFT) on high-quality example inputs and outputs is the most common form.

LoRA: fine-tuning without the bill

Updating all of a model's billions of weights is expensive. LoRA (Low-Rank Adaptation) freezes the original weights and trains only a small set of extra low-rank matrices alongside them:

updated weights ≈ original (frozen) + small trainable A·B

This captures most of the benefit at a fraction of the cost and storage, so you can maintain many lightweight specialised variants of one base model.

Distillation: shrink a big model into a small one

Distillation trains a compact student model to imitate a larger teacher. The student learns from the teacher's rich outputs, inheriting much of its capability in a model that is cheaper and faster to run. It is a major reason the small models of 2026 are so good.

RLHF: making it helpful and safe

The step that most changes user experience is Reinforcement Learning from Human Feedback. Humans compare model responses and rank them; a reward model learns those preferences; the model is then optimised to produce answers people prefer. This is how a base model becomes helpful, honest and harmless — the difference between raw autocomplete and a genuine assistant.

Fine-tune, or just use RAG?

A common question: should you fine-tune or use retrieval-augmented generation? The rule of thumb: fine-tune to change how the model behaves (tone, format, task), and use RAG to change what it knows (your documents, live data). Most production systems use RAG first and fine-tune only when behaviour genuinely needs to change.

The modern post-training stack, in order

Turning a base model into an assistant usually follows a pipeline: pretrain → supervised fine-tuning (SFT) → preference alignment (RLHF, or the simpler DPO that many 2026 teams now use). Each stage does a distinct job — SFT teaches format and task, preference alignment teaches judgement and tone. Skipping alignment is exactly why a raw base model feels like autocomplete rather than a colleague.

LoRA in numbers

Full fine-tuning updates every weight — billions of numbers, and a full-size copy of the model per variant. LoRA instead trains small low-rank matrices, typically well under 1% of the parameters, and stores each specialised variant as a few megabytes. That efficiency is why a single base model can power dozens of tailored versions — and why fine-tuning is now within reach of ordinary teams, not just frontier labs.

Frequently Asked Questions

Fine-tuning takes an already-pretrained base model and trains it a little more on a smaller, targeted dataset so it specialises — in a tone, a task, or a domain. It is far cheaper than pretraining because the model already knows language; you are only adjusting it, not teaching it from scratch.

Fine-tuning changes the model's weights to bake in a behaviour or style. Retrieval-augmented generation (RAG) instead feeds the model relevant documents at query time without changing its weights. Rule of thumb: fine-tune for how the model should behave, use RAG for what facts it should know.

Distillation trains a small 'student' model to imitate a large 'teacher' model, transferring much of the capability into a cheaper, faster model. It is how many compact 2026 models get surprisingly strong — they learned from a bigger model's outputs rather than from raw data alone.

LoRA (Low-Rank Adaptation) is a popular parameter-efficient fine-tuning method. Instead of updating all of a model's billions of weights, it trains a small number of extra low-rank matrices, cutting the cost and storage of fine-tuning dramatically while keeping most of the benefit.

Reinforcement Learning from Human Feedback is how a raw base model becomes a helpful assistant. Humans rank model responses, a reward model learns those preferences, and the model is optimised to produce answers people prefer — making it more helpful, honest and safe.

Build with fine-tuning, RAG and agents

Our AI Engineering course covers post-training, RAG and production AI hands-on. HRDC-claimable for eligible Malaysian employers.