0:00Intro: MOFUSA Tech Academy
Welcome to MOFUSA Tech Academy. Beyond learning, towards mastery.
0:09The assistant that does not sound like Brightcart
Brightcart's assistant is accurate now, but it still doesn't quite sound like Brightcart. The company's support team has a warm, plain, first-name style, and a signature promise: "we'll make it right". The prompt asks for that style, and the model follows it for a while, then drifts back to sounding generic. Someone suggests fine-tuning: actually training the model on Brightcart's best replies. Others say just improve the prompt, or that it's really a knowledge problem for retrieval. Who's right? Today: what fine-tuning is, when it's worth it, when it backfires, and a simple rule for choosing between prompting, retrieval and fine-tuning.
0:55Where this fits in the course
Season Five, Module Nineteen: fine-tuning. First stop: when to fine-tune, and when not to.
1:03What is fine-tuning? SFT, preference tuning, distillation
Fine-tuning means continuing to train a pre-trained model on your own data, so its weights change. It's the transfer learning from episode thirty, applied to foundation models. It comes in a few forms. Supervised fine-tuning trains on examples of prompts and ideal replies. Preference tuning trains on pairs of better and worse replies, like the D-P-O from episode forty. Continued pre-training feeds the model lots of raw text from a specialised domain. And distillation trains a smaller model to imitate a larger one, which we'll explore in the next module.
1:42Good reasons to fine-tune
There are good reasons to fine-tune. Consistent style and format: the model always sounds like Brightcart, and always produces exactly the right structure, without long instructions in every prompt. Task specialisation: routing tickets into forty internal categories with subtle differences. Reliability: following a complicated procedure every single time, not just usually. Cost and speed: a small model, fine-tuned for one job, can sometimes match a much larger general model on that job, at a fraction of the cost and delay.
And specific behaviours: exactly when to escalate, and how to phrase a polite refusal. There's a bonus too. Once behaviour lives in the weights, prompts can be shorter, which saves tokens on every request, remember those thirty million monthly tokens just for prompt examples.
2:41Reasons not to fine-tune (yet)
But there are real reasons to hold back. Better prompting or retrieval might already solve the problem, and they're cheaper and quicker to change. Fine-tuning needs high-quality data, often hundreds to thousands of carefully prepared examples, which is the subject of the next module, plus the skills to train and evaluate. When a better base model comes out, you may have to fine-tune all over again. And there are risks. Training narrowly on one task can make a model worse at others, something called catastrophic forgetting.
Fine-tuning can also weaken a model's safety behaviour, sometimes even when the training data is completely harmless, so safety evaluations must be re-run after every fine-tune. And facts baked into weights go stale: change a policy, and you'd have to retrain.
3:34RAG vs fine-tuning: knowledge vs behaviour
Here's a simple rule that resolves most debates. Ask whether it's a knowledge problem or a behaviour problem. Knowledge problems are about facts the model doesn't have, or facts that change: policies, prices, stock levels, order status. Use retrieval and tools: they give citations and stay fresh without retraining. Behaviour problems are about how the model works: its style, format, procedure, specialisation or efficiency. Try prompting first, and fine-tune if that's not enough. A handy test: if you gave the model the right document, would it answer correctly?
If yes, you have a knowledge problem: fix retrieval. If it still answers badly, or in the wrong style, it's a behaviour problem. And many real systems need both: Brightcart's voice and procedures fine-tuned in, with policies retrieved fresh at question time.
4:33A decision workflow: prompt, RAG, fine-tune
So here's the workflow. First, prompt well, and measure. If facts are missing or out of date, add retrieval and tools, and measure again. If the style, format or reliability still falls short, or you need a smaller, cheaper model, then collect good data and fine-tune, starting with the efficient methods we'll meet in two episodes. Evaluate on the full scorecard, including general abilities and safety, and compare against your best prompted system, with error bars. Ship only if it's genuinely better at an acceptable cost.
For Brightcart, prompting fixed most problems and retrieval fixed the policy answers. The remaining issue, the voice drifting back to generic, is a behaviour problem. So the plan is a small supervised fine-tune on about fifteen hundred of the support team's best replies, which we'll prepare in the data module, tested against the prompted version.
5:32Try it yourself: a fine-tuning business case
Here's an illustrative business case. Option A: a large model with five examples in every prompt, about two hundred and sixty dollars a month. Option B: a small model fine-tuned on Brightcart's replies, needing no examples, about forty-six dollars a month, plus two hundred dollars to fine-tune it once. How long until option B pays for itself? Pause.
Under a month. But that only counts if the small model passes the same evaluation gates as the large one, and if someone is prepared to maintain it: retraining when policies or the base model change. The money is the easy part of the decision; the quality bar and the upkeep are the hard parts.
6:23Pause & Predict: knowledge or behaviour?
Sort these needs into knowledge or behaviour. The returns window changes next month. Replies must always sound like Brightcart. The catalogue changes every week. Ticket summaries must always fill the same eight fields. Pause.
The returns window and the catalogue are knowledge that changes: update the documents behind retrieval, never the model's weights. The voice and the fixed format are behaviour. Try prompting and structured output first, and fine-tune if they're still not consistent enough. Put knowledge in documents; teach behaviour through training.
7:06Catastrophic forgetting
Fine-tuning can make a model forget. Train it narrowly on fifteen hundred support replies, and its support style may improve, while other abilities slip: perhaps it starts replying in English to customers who wrote in Polish, or becomes less careful about unsafe requests. This is called catastrophic forgetting. The defences: mix some general examples into the training data, use parameter-efficient methods that change less of the model, and re-run the full evaluation suite, not just the task you were improving.
7:42Fine-tuning can weaken safety
Researchers have found that fine-tuning can weaken a model's safety behaviour, sometimes even when the training data looks completely harmless. The careful refusals added during post-training can partly wear away. So Brightcart has a firm rule: after every fine-tune, re-run the red-team set and the safety tests, compare with the original model, and block the release if safety has dropped. Never assume the safety you started with survives training.
8:12How much data do you need?
How many examples does fine-tuning need? It depends on the task. Changing format or style can work with a few hundred excellent examples. Teaching a harder, specialised task may need thousands. But quality and coverage matter more than the raw count. Brightcart's plan is fifteen hundred carefully chosen replies, covering every ticket category and language, each reviewed by a senior agent. In episode seventy-three, we'll see exactly how performance grows as examples are added.
8:47The maintenance bill
A fine-tuned model is something you now own and maintain. When a better base model is released, you'll want to fine-tune it again and re-evaluate. When policies or tone guidelines change, the dataset needs updating and the model retraining. When customer questions drift, new examples are needed. Every version should store its dataset, its training settings and its evaluation report together. That maintenance is a real, ongoing cost to include in the decision.
9:18Other forms of fine-tuning, briefly
Fine-tuning comes in several forms. Supervised fine-tuning, on pairs of prompts and ideal replies, is the most common. Preference tuning, on chosen and rejected replies, captures subtler differences in quality, as we saw in episode forty. Continued pre-training on large amounts of specialised text, like legal or medical writing, adds domain fluency, but a shop rarely needs it. And distillation uses a large model's outputs to train a smaller one, which we'll explore in episode seventy-five.
9:53How to evaluate a fine-tuned model
Before Brightcart ships its fine-tuned model, it faces exactly the same tests as the prompted version. The golden set with every gate and check. A validated judge for the Brightcart voice. Every language slice. The red-team and safety sets. And latency and cost. The rule is written in advance: ship only if it matches or beats the baseline on every gate, improves voice consistency by more than the noise, and costs no more. Writing the rule first stops anyone moving the goalposts afterwards.
10:31What to try before fine-tuning
Before fine-tuning, what should you try first? Pause and list a few. A clearer prompt. Better examples. Structured output for formats. Retrieval for knowledge. A different base model that may already behave the way you want. Only when those have been tried and measured does fine-tuning make sense. It's a powerful tool, but it's rarely the first one to reach for.
11:03How prompt caching changes the sums
One more thing can change the business case: caching. Option A's five examples are identical on every request, so they sit in the stable start of the prompt. Many providers charge less for re-used, cached tokens, and process them faster. Re-run the sums with that discount, and the gap between the two options narrows. Always compare fine-tuning against the best version of the alternative, not the most expensive one. One caveat: this corner of AI moves quickly. These examples were current when we made this video, and they may look different on the day you watch it.
11:43A fine-tuning run, step by step
Here's a fine-tuning run, step by step. Clean the fifteen hundred examples, put them in the model's chat template, and remove any personal data. Split them: thirteen hundred and fifty for training, a hundred and fifty for validation, and never the golden test set. Train for just a few passes over the data, with a modest learning rate. Watch the training and validation losses, and stop if validation starts rising, exactly as in episode twenty-six. Then run the full evaluation plan, and register the model alongside the exact dataset version that produced it.
12:23Myth vs Fact: fine-tune on your documents?
Myth: fine-tune the model on your documents so it "knows" your policies. Fact: fine-tuning is an unreliable way to add facts. They can get blurred or mixed up, they can't be cited, and they go stale the moment a policy changes. Use retrieval for knowledge, and fine-tuning for behaviour.
12:44One-minute recap
Let's recap. Fine-tuning continues training a model on your own data, through supervised examples, preferences, domain text or distillation. It's good for consistent style and format, specialised tasks, reliability, and smaller, cheaper models. It costs data, expertise and maintenance, and risks forgetting and weaker safety. Use retrieval for knowledge and fine-tuning for behaviour, and climb the ladder in order: prompt, then retrieve, then fine-tune, evaluating at every step. One sentence to remember: retrieve what changes, and train how to behave.
13:24Next: memory maths and quantisation
Mission complete. Brightcart's diagnosis is clear: the voice drift is a behaviour problem, so a small, careful fine-tune is planned, while policies stay in retrieval. But before training anything, Dev asks a very practical question: how much memory does fine-tuning a seven-billion-parameter model actually take? The answer surprises most people. Memory maths, number formats and quantisation, next. See you on the map.