LLM Fine-Tuning Explained
Fine-Tuning LLMs
The Complete Guide
Where fine-tuning sits relative to pre-training, why parameter scale and weight access matter, LoRA and QLoRA vs full vs reinforcement-based fine-tuning — and how to choose and evaluate the right method.
Source: youtube.com/watch?v=Wx1oiBCmxjY · Channel: Aishwarya Srinivasan
Agenda
What We'll Cover
Part I · The Landscape & Methods
- Pre-training vs post-training — where fine-tuning fits
- Fine-tuning at scale — the parameter universe & weight access
- Parameter-efficient fine-tuning — LoRA & QLoRA
- Full fine-tuning
- Reinforcement fine-tuning — verifiable rewards, RLHF, DPO
Part II · Choosing & Doing It Right
- Choosing the right method
- Data quality & evaluation — the real challenges
- Key takeaways
Section 1 · Pre-Training vs Post-Training
From Train-From-Zero to Model-as-a-Service
Pre-training — the labs' job
Foundation labs run massive pre-training jobs on huge GPU clusters over trillions of tokens.
GPT, Claude, Llama, and Gemini are all produced this way. The output is the base model you get out of the box — downloaded or called through an API. You did not train that model; the foundation lab did.
Post-training — fine-tuning is the most common form
Everything that happens after pre-training.
And it is not a new concept: fine-tuning closely mirrors what traditional ML practitioners have done for years — training a model, then adapting it to more specific tasks.
Before LLMs — you owned the pipeline
Train a model from scratch on your own data, fine-tune it on task-specific data, then ship your own model. As a company you owned the entire pipeline.
Today — you adapt, you don't build
The pre-trained model is served to you via API and you fine-tune it for your use case. The crucial shift: no more training from zero — you adapt a model already trained on a great deal of knowledge, changing how much compute, data, and expertise the exercise requires.
Section 2 · Fine-Tuning at Scale
The Parameter Universe
| Model class | Parameter scale |
|---|---|
| Traditional ML models | Hundreds of thousands to a few million |
| Small open models | A few billion |
| Production models (most teams) | 10 to 70 billion |
| Frontier models | Hundreds of billions |
| Models like GLM | Over a trillion |
Why scale is the core challenge
Training memory grows with the number of trainable parameters — a run must hold not only the weights being updated but also the gradients and optimizer state produced along the way. Updating even a fraction of a trillion-parameter model is not something you casually do on a single GPU. Every method in this guide is, one way or another, an answer to this problem of scale.
Section 2 · Access to the Weights
Can You Touch the Weights?
Open-weight — fine-tune it yourself
Llama · Mistral · Qwen · DeepSeek · GLM
Inference providers host the weights and distribute them across GPUs. Because the weights are open, you can change those parameters:
- Download the weights
- Fine-tune on your own GPUs
- Deploy the fine-tuned model yourself
Closed-weight — the provider's service only
Claude · GPT · Gemini
No access to the weights, so you cannot fine-tune from your own infrastructure. You must use the provider's native fine-tuning service — OpenAI's fine-tuning API, Google's inside Vertex AI, Anthropic's own service:
- Submit your data
- Provider runs the job on its infrastructure
- Access the fine-tuned version through their API
Section 3 · Parameter-Efficient Fine-Tuning
LoRA — Do You Really Need All 70B?
The base stays intact
The model's original knowledge remains untouched; LoRA learns a compact adjustment on top of it.
What "low rank" means
Each touched layer learns a small pair of matrices whose product forms the update — living in a much smaller dimensional space than the full weight matrix it adjusts. Because the update merges ahead of time, several fine-tunes of one base model can coexist without multiple full copies.
Section 3 · Parameter-Efficient Fine-Tuning (cont.)
QLoRA — A 70B Model on One H100
Quantization = compression
Weights are stored at a much lower numerical precision than the one used during training, shrinking their memory footprint dramatically at some cost in precision. Because the base is so small in memory, the adaptation itself is still learned precisely.
The default starting point
QLoRA is the default starting point for most teams fine-tuning their own open-source models today. To experiment, start with Hugging Face's PEFT library — it makes getting QLoRA up and running drastically faster.
Section 4 · Full Fine-Tuning
Maximum Flexibility, Maximum Cost
| PEFT (LoRA / QLoRA) | Full fine-tuning | |
|---|---|---|
| What updates | Small injected adapters | Every single parameter |
| Compute | Light — QLoRA fits 70B on one H100 | Expensive and slow — back to billions or trillions of parameters |
| Quality | Usually enough | Most flexibility, usually the best — nothing is held fixed |
| When to use | Default for most teams | Only when PEFT misses the quality bar — very rare in practice |
Section 5 · Reinforcement Fine-Tuning
Three Flavors, One Explosion
Reinforcement fine-tuning has exploded in the last year — three flavors are worth knowing.
1 · Verifiable rewards
The technique behind OpenAI's o-series, DeepSeek R1, and most modern reasoning models.
Take a task whose answer can be automatically verified — a math problem, a coding problem with a runnable test. Correct attempts get rewarded, wrong ones penalized, and the model learns to reason better over time.
2 · RLHF
The classic technique that powered ChatGPT.
Start with preference data collected from humans, train a reward model on it, then use that reward model's signal — through PPO — to steer the language model toward higher-scoring responses.
3 · DPO
Direct preference optimization.
Skips the reward model entirely: it optimizes the language model directly on the preference pairs in a single step — much easier to implement, and the default for preference tuning on open-weight models.
Section 5 · Flavor 1 — Verifiable Rewards
Reward Correct Reasoning — Automatically
Powerful whenever your task has an answer that can be checked automatically: math problems, coding problems where you can run a test.
Section 5 · Flavors 2 & 3 — RLHF vs DPO
Two Routes to Preference Alignment
RLHF — reward model + PPO
- Collect pairs or rankings of model responses
- Human annotators say which responses they prefer
- Train a reward model to predict those preferences
- PPO uses the reward model's signal to update the language model, which samples new responses in turn
DPO — direct preference optimization
- Start from the same preference pairs
- Skip the reward model entirely
- Optimize the language model on the pairs directly, in a single step
Section 6 · Choosing the Right Method
Fine-Tuning Is Not the First Lever
| Goal | Method |
|---|---|
| Better at your domain task or tone | Start with QLoRA — full fine-tuning only if the quality bar isn't met (rare) |
| Style, safety, tone — human preferences | RLHF or DPO on preference data |
| Reasoning on auto-verifiable tasks | Reinforcement fine-tuning with verifiable rewards |
Prompts and context also act as a benchmark: once they are as good as you can make them, the remaining gap is exactly what fine-tuning must close — and you can measure how much improvement it delivered.
Section 7 · The Real Challenges
Bad Data Makes a Good Model Worse
What makes a dataset "bad"
- Wrong answers
- Examples that misrepresent the task you actually care about
- Inconsistent formats that teach contradictory habits
- Examples that contradict what the model already knows
- Too few high-quality samples to steer behavior reliably
The model faithfully absorbs whatever patterns its training data contains — bad patterns become bad behavior.
Evaluation comes first
- Proper eval set — representative, held-out examples that stand for the real task, separate from anything used in training
- Clear metric — a measure you commit to in advance, matching the outcome you care about
Treat fine-tuning like an experiment with a defined baseline and a defined yardstick — not a blind API call.
Key Takeaways
The Complete Checklist
The End
Fine-Tune With Understanding
Fine-tuning is not a blind API call — it is an experiment: know where it fits, start parameter-efficient, and guard data quality above all. A good model with a bad dataset gets worse, not better.
Source: "LLM Fine-Tuning Explained: The Complete Guide" — Aishwarya Srinivasan (youtube.com/watch?v=Wx1oiBCmxjY) · Captions transcribed from Hindi and translated to English.