When to fine-tune (and when not to)

A decision process across prompting, RAG and fine-tuning, with the costs and risks of each.

Advanced about 3 h

The picture

  1. 01

    Prompt baseline

    measured

  2. 02

    Add RAG

    if knowledge is missing

  3. 03

    Fine-tune

    if behaviour is wrong

  4. 04

    Evaluate

    vs baseline

  5. 05

    Maintain

    retrain, monitor

What fine-tuning is good for

Fine-tuning shifts a model's behaviour: output format and style, tone, following a house policy, a narrow classification or extraction task, tool-calling conventions, or shrinking a large model's skill onto a small, cheap one. It is a poor way to teach facts that change or that must be cited. Retrieval does that better, and a fine-tuned fact is hard to update or audit.

The decision process

Is the prompted baseline good enough?  ── yes ─▶ ship it, monitor
        │ no
Is the failure missing or changing knowledge?  ── yes ─▶ RAG (and measure again)
        │ no
Is it format, style, a narrow skill, latency or cost?  ── yes ─▶ fine-tune
        │
Still failing? ─▶ clearer task definition, better data, a stronger base model

Always start with a measured prompted baseline. Many projects fine-tune before they have tried few-shot examples and a structured output schema, and never learn what the baseline would have achieved.

What it costs

  • Data: hundreds to a few thousand high-quality examples is often enough for style or format; quality beats quantity (the LIMA result).
  • Compute: with LoRA, a 7B-class model can be tuned on a single GPU in hours.
  • Evaluation: you need a held-out set and regression checks, or you cannot tell improvement from drift.
  • Maintenance: the base model gets superseded; your data and eval set are the durable assets, so you can re-run on a newer base.
  • Hosting: a custom model must be served, or you use a vendor's fine-tuning service and accept its constraints.

Risks

  • Catastrophic forgetting: gains on the target task, losses elsewhere. LoRA and low learning rates reduce it; check general benchmarks.
  • Overfitting to a narrow style, including your data's errors.
  • Safety regressions: fine-tuning can weaken refusals. Re-test safety behaviour after tuning.
  • Contamination: examples from your test set in your training set.

Fine-tuning and RAG together

They are complements. Fine-tune for how to answer (format, citation style, abstaining), and retrieve for what to answer from. Several of the strongest systems do both.

A quick feasibility check

def worth_it(baseline_acc, target_acc, queries_per_month, saved_cost_per_query, tuning_cost, months=12):
    gain_per_query = saved_cost_per_query
    saving = queries_per_month * months * gain_per_query
    return {"net": saving - tuning_cost, "accuracy_gain": target_acc - baseline_acc}

Plug in measured numbers. If you cannot fill in baseline_acc yet, you are not ready to fine-tune.

Common mistakes

  • Fine-tuning to inject facts that will change next quarter.
  • No baseline, so no way to claim improvement.
  • Evaluating on training-distribution examples only.

Exercises

  1. Pick a task, measure zero-shot, few-shot and RAG baselines, and write a one-page justification for or against fine-tuning.
  2. Find one fact-heavy and one format-heavy use case in your work and place each on the decision chart.

You are done when you can…

  • Run the decision process on a real task and justify the outcome with measurements
  • List the failure types that fine-tuning fixes and the ones it does not
  • Estimate the data, compute and maintenance cost of a fine-tune