LLM Fine-Tuning with LoRA and QLoRA / Decide before you train

Decide when fine-tuning is the right tool

Lesson 3 of 29. Open to read. No account needed.

Fine-tuning is the most expensive way to change what a language model does. You need examples, training time and evaluation, and the result must be retrained whenever the base model or the task changes. Before you train anything, decide whether a cheaper tool would do the job, and write down what success means.

In this lesson you will:

  • compare four alternatives to fine-tuning for a described need;
  • choose with a short sequence of questions;
  • write a fine-tuning brief for the course task, fixing the baseline, the acceptance metric, the data and the budget before any training run.

Five ways to change what a model produces

ToolWhat it changesCost and limits
A clearer promptThe instructions the model reads every timeCheapest to try. The prompt is processed on every call, and a small model may not follow long instructions reliably
Few-shot examples in the promptA handful of worked input and output pairs shown with every requestNo training. Each example lengthens every request, and the model must still generalise from a few cases
RetrievalThe facts placed in the prompt, fetched at the moment of the questionThe right tool for facts that change or must be cited. Needs a search system over your documents
Ordinary codeNothing about the model: the program does the jobExact and cheap when the rules can be written down. Breaks on inputs the rules did not foresee
Fine-tuningThe model's own behaviour, learned from many examplesNeeds a few hundred good examples or more, training and evaluation, and retraining when anything changes. Good at consistent formats, styles and label sets. Poor at teaching facts

Two points about fine-tuning matter for every decision:

  • It changes behaviour, not knowledge you can rely on. A few hundred examples teach a model how to answer: in what format, in what style, with which labels. They are a poor way to teach what is true, especially facts that change.
  • It costs more than the training run. You have to collect and check the examples, measure against a baseline, check for side effects, and retrain when the base model or the task changes. A prompt change is undone in seconds.

Choose with four questions

Ask these in order; the first "yes" usually decides.

Choosing a method. Four questions in order: Is the output fixed by rules you can write down? If yes, use ordinary code. Does it depend on facts that change or must be cited? If yes, use retrieval or put the facts in the prompt. Does a clear prompt with a few examples reach the target on validation data? If yes, use prompting. Do you have hundreds of good examples of a consistent format, style or label set? If yes, fine-tune with LoRA; if no, collect examples first or rethink the task.

Follow the questions top to bottom. A "yes" leads right to a method; a "no" leads down to the next question.

  1. Is the output fixed by rules you can write down? Then write code. It is exact, cheap and testable.
  2. Does the answer depend on facts that change, or must it cite sources? Then fetch the facts at answer time (retrieval), or put them in the prompt. Fine-tuning would bake in facts that go out of date.
  3. Does a clear prompt, perhaps with a few examples, reach your target on validation data? Then stop: prompting is cheaper to run and to change. You only know by measuring, which is why the course measures a baseline before training.
  4. Do you have hundreds of good examples of a consistent behaviour? That means a format, a style or a fixed set of labels. If so, fine-tuning is a reasonable choice, and LoRA keeps it cheap. If not, collect and check examples first, or rethink the task.

The questions are a starting point, not a law. Real systems often combine tools: retrieval for the facts and a fine-tuned adapter for the format, for example.

The course task, judged honestly

Apply the questions to the course task: turning Larkmoor Outdoor Centre equipment reports into five-field records.

  1. Rules? For the course's data, yes. The reports are generated from fixed wording: "smells of damp" always means cleaning, and "No rush." always means low priority. In the course's own check, a short program using the keyword lists that generate the reports got 99 of the 100 validation records exactly right, where the fine-tuned adapter got 30. The course uses this task because results can be measured exactly, not because fine-tuning is the best tool for it. Real staff would write "the mud's caked on the trolley wheels again" and many other phrasings no keyword list foresees. That is where a learned model earns its cost.
  2. Changing facts? No. The record describes the report itself.
  3. Prompt good enough? It must be measured. The baseline lesson does this, and the course model scored 1% valid records zero-shot.
  4. Examples? Yes: the course supplies 400 training examples of one consistent format and label set.

So for messy real reports, the decision would be: measure the prompt baseline first, and fine-tune if it falls short. That is the path the course follows.

Write a fine-tuning brief

A brief is a short document you write before training, so that the result is judged against a standard you could not adjust after seeing it. Create the notes folder and save this as ~/finetune-practice/notes/brief.md:

mkdir -p ~/finetune-practice/notes
# Fine-tuning brief

## Task
<!-- One sentence: what goes in, what comes out. -->

## Output contract
<!-- The exact format a correct reply must have. -->

## Data
<!-- Where examples come from, how many, the splits, their licence, and how
personal data is kept out. -->

## Baselines to beat
<!-- What you will measure before training, on which split. -->

## Acceptance metric and threshold
<!-- The measure, its threshold, and on which split it is decided. It must be
possible to fail. -->

## Budget
<!-- Time and memory per training run, and how many runs. -->

## Stopping rule
<!-- When you stop trying: success, or the evidence that fine-tuning is not
the right tool. -->

## Side effects to check
<!-- What else could get worse. -->

Fill in each section for the course task. Use what you know from course orientation: the task, the 400, 100 and 100 example splits, and the 15-minute budget per run on a laptop CPU. Then compare with the model answer below.

Model answer

# Fine-tuning brief

## Task
Turn one Larkmoor Outdoor Centre equipment report into one JSON record.

## Output contract
One JSON object with exactly the keys asset, equipment, category, location
and priority, in that order; category from repair, cleaning, replacement or
inspection; priority from low, normal, high or urgent; nothing after it.

## Data
The course generator: 400 training, 100 validation and 100 test examples,
no report in two splits. Written for the course; no personal data.

## Baselines to beat
On the validation split: the untuned model zero-shot, and the same model
with three examples in the prompt. Greedy decoding.

## Acceptance metric and threshold
Decided on the validation split. Accept an adapter only if it gives at
least 95% valid records, and an exact-match rate at least 20 percentage
points above the better baseline, with no field worse than in that
baseline. The test split is scored once, for the chosen adapter only.

## Budget
At most 15 minutes and 8 GB of memory per training run on a 4-core CPU;
at most ten runs.

## Stopping rule
Stop when the threshold is met. If ten runs fail to beat the better
baseline by 20 points, report that fine-tuning did not pay off for this
model, and try a larger model or a different approach.

## Side effects to check
General replies to requests outside the task, and memorisation of
training examples.

Why these choices:

  • The threshold can fail. A model that outputs the same record for every report would get 100% valid records, but almost no exact matches, so the exact-match condition stops it passing.
  • It is relative to the better baseline. If a three-example prompt already did well, a fine-tune that only matched it would not be worth its cost.
  • The test split is reserved. Every decision uses validation data, so the final test figure is a fair estimate.
  • The stopping rule allows "no". A brief that cannot conclude "fine-tuning did not help" is not a brief.

The adapter in Train your first LoRA adapter reached 100% valid records and 30% exact matches against a zero-shot baseline of 1% and 0%. Whether it passes this brief also depends on the three-example baseline, which you measure in Measure a baseline.

When your result differs

What you see in your briefWhy it is a problemFix
The metric is the training lossLoss falls as the model fits its training data, whether or not the task gets betterUse task metrics on the validation split
The threshold is "as good as possible"It can never fail, so it decides nothingState a number and a split
The baseline is "the untuned model" with no measurementYou cannot tell whether training helpedName the baselines, their prompts and the split they are measured on
The test split appears in more than one placeRepeated use turns it into a second validation splitUse it once, at the end
No budgetRuns grow until the cost is never compared with the gainState time, memory and number of runs

Your turn: find the weaknesses

A colleague wrote this brief for the same task. Find at least three weaknesses, and say what to change, before reading on.

# Brief
Task: make the model good at equipment reports.
Data: our 600 examples.
Metric: training loss below 0.1.
We will check the test split after each run to pick the best settings.
Budget: as long as it takes.

Hints

  • Ask of each line: could this line ever make the project stop or fail?
  • Compare the data and metric lines with the sections of the template.

Answer and reasoning

Any three of these, among others:

  1. The task has no output contract. "Good at" cannot be checked. State the exact record format.
  2. The data line names no splits, so training and evaluation data may overlap. Split 400, 100 and 100, with no report in two splits.
  3. Training loss is not an acceptance metric. A run can reach a loss below 0.1 with few exact matches; the tested adapter ended at 0.05 with 30%. Use valid-record and exact-match rates on the validation split.
  4. No baseline, so there is no evidence that training helped.
  5. The test split is used to choose settings. After many checks it no longer measures performance on unseen data. Choose on validation; test once.
  6. No budget or stopping rule. The project can never conclude that fine-tuning did not pay off.

A common mistake is to fix only the metric. A good metric on a split that was used to choose settings still gives an optimistic answer.

Reset and cleanup

Keep ~/finetune-practice/notes/brief.md: the evaluation lessons check adapters against it. Nothing else was created.

Check your understanding

Choose a method for each need, and give the deciding question:

  1. Fill in the centre's opening hours, which change each season, when staff ask.
  2. Convert dates written as "next Saturday" into ISO dates, given today's date.
  3. Rewrite staff notices in the centre's friendly house style, from 600 examples of before and after.
  4. Answer questions about the safety policy, quoting the paragraph used.
  5. Sort reports into the centre's four categories, from 2,000 labelled messy real reports, where a clear prompt reached 60% and the target is 90%.
  6. Count the reports per location each week.

Answer all six before reading on.

Answers

  1. Retrieval, or put the hours in the prompt (question 2): the facts change.
  2. Ordinary code (question 1): date arithmetic has exact rules, though a model might help to parse unusual phrasings.
  3. Fine-tuning (question 4): a consistent style with many examples, once a prompt has been measured and fallen short.
  4. Retrieval (question 2): the answer must cite its source.
  5. Fine-tuning (questions 3 and 4): the prompt was measured and fell short of the target, and there are many labelled examples of a fixed label set.
  6. Ordinary code (question 1): it is counting, once each report has a location.

24 more lessons in the full course

Course access opens every lesson and adds revision notes, the Quick Reference, saved progress, bookmarks and your own notes.

INR 199 plus 18% GST. 90 days of online access. No auto-renewal.

Get the full course

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy