How Fine-Tuning Actually Works

Continue training an existing model on your own data. What it changes, what it cannot change, and why the dataset is the whole job.

On this page

Fine-tuning is training, not prompting. Real gradient updates, real parameter changes, a new set of weights at the end.

The only difference from pretraining is scale and starting point: begin from an already-capable model, continue on a much smaller focused dataset.

The mechanics

Identical to pretraining, just shorter. Show the model an example, have it predict, compare, adjust.

The important difference is what the examples look like. Pretraining uses raw text. Fine-tuning uses input-output pairs in your task’s format:

{"input": "Customer says the app crashes on launch",
 "output": "{\"category\": \"BUG\", \"severity\": \"HIGH\", \"component\": \"startup\"}"}

Loss is usually computed only on the output portion. You are not teaching the model to generate your inputs — only to produce the right output given one.

Two parameters carry most of the risk. Learning rate must be far smaller than pretraining used; too high and the model degrades on everything it previously knew. Epochs — how many passes over your data — should be small, often one to three. More passes memorize rather than generalize.

The dataset is the job

Everything else is mechanical. Dataset quality determines the outcome, and it is where nearly all the effort goes.

Consistency matters more than volume. A hundred examples that agree beat a thousand that contradict each other. Inconsistent labels teach the model that the task is ambiguous, and it will produce ambiguous output.

Cover the boundaries. Examples should include the cases you would get wrong, not just the obvious ones — the same principle as few-shot selection, applied at scale.

Match production distribution. Curated examples are cleaner than reality. If real input contains typos, truncation, and mixed languages, your training data should too.

Format identically to inference. Whatever wrapping you use at serving time must appear in training. A mismatch here produces baffling underperformance.

Include refusals and edge cases. If some inputs have no valid answer, show that. Otherwise the model learns that every input has one.

Practical minimum is a few hundred examples for narrow tasks like classification or formatting; a few thousand for anything involving style or judgment.

Catastrophic forgetting

The characteristic failure. Train hard on a narrow task and the model gets better at it while getting worse at everything else — including general instruction-following you were relying on.

Causes are low learning rate discipline gone wrong, too many epochs, or a dataset too narrow relative to how much you changed.

Mitigations: keep learning rates low and epochs few, mix in some general instruction data alongside your task data, and use parameter-efficient methods that touch far fewer weights. Evaluate on general capability, not just your task — otherwise the regression is invisible until production.

What it is good at

Format and structure reliability. When prompting gets you to 95% and you need higher.

Tone and style. Nearly impossible to specify in prose, straightforward to demonstrate.

Narrow classification at volume. A small fine-tuned model can match a much larger prompted one on one well-defined task, far cheaper per call.

Cost reduction. Moving a long prompt into the weights removes it from every request. At high volume this is the entire argument.

Domain conventions. Specialized notation and drafting patterns — form rather than fact.

What it is bad at

Teaching facts. The critical limitation, covered in RAG or Fine-Tuning?. A fact seen a handful of times becomes a faint pattern that reconstructs into something nearly right — worse than absence, because it is indistinguishable from knowledge.

Anything that changes. Every update means another training run.

Adding capability the base model lacks. Fine-tuning redistributes existing ability. It does not create reasoning that was not there.

Before you fine-tune

Try, in order: better prompting, few-shot examples, a stronger model, constrained output.

If examples work, you have your answer without a training run. Reach for fine-tuning when those have plateaued against a measured gap — which means you need an eval before you start, or you cannot tell whether it helped.

Also budget for repetition. Base models update, and your fine-tune does not come along automatically.

What to remember

  • Fine-tuning is real training on input-output pairs, with loss usually on the output only.
  • Dataset quality is the whole job: consistency over volume, boundary cases, production-matched distribution, identical formatting.
  • Low learning rate, few epochs — otherwise catastrophic forgetting degrades general capability invisibly.
  • Good for format, tone, narrow classification, and cost reduction; bad for facts, changing information, and missing capability.
  • Exhaust prompting and few-shot first, and have an eval before you start.

Next: LoRA and Parameter-Efficient Fine-Tuning