Skip to content
mentoor

Fine-tune, RAG or prompt?

For engineers

A support assistant gives stale, invented and badly formatted answers. Sort the gaps, build the eval set, try prompts, add retrieval, fine-tune only on evidence, and price build, buy or wrap.

Before you train anything, name the gap: a model that lacks facts needs retrieval, a model that behaves badly needs better prompts first, and only a measured, stable behaviour gap justifies fine-tuning. Build the test set before you choose, then let the numbers pick the fix.

The situation

Northwind Outdoor sells camping gear online. Its support team answers about 1,800 tickets a week: return windows, warranty cover, "will this tent fit a 4-person family", delivery times. The team built a first assistant on a hosted model. Three complaints reached the product manager, Dana:

  • It quotes a 60-day return window. The policy changed to 30 days in September.
  • It invents tent specifications that are not in the catalogue.
  • Replies are chatty, but the support lead wants three short parts: a one-line answer, the policy quote, and the next step.

An engineer says: "Let's fine-tune a model on our old tickets. That fixes all three." Dana wants proof before spending money.

Why it matters

The three complaints look like one problem ("the model is wrong") and are really three. The first two are knowledge gaps: the facts are missing, stale or unknown. The third is a behaviour gap: the model knows enough but does not follow the house style. Training on old tickets would teach the old 60-day policy into the weights, where it cannot be cited, checked or updated without another training run.

How the work goes

  1. Sort each complaint as knowledge or behaviour. Facts that change, are private or must be quoted belong in retrieval or a tool. Format, tone and consistent labels are behaviour.
  2. Build the eval set first. Take 150 real tickets, cover every ticket type and customer type, add edge cases such as an empty message, a non-English message and a policy question the company does not answer, and write grading criteria where there is no single right wording. Version the set.
  3. Measure a prompt baseline. Put the three-part format in the instructions, add three short examples, and use structured output. Run the eval. This costs hours, not weeks.
  4. Add retrieval for the facts. Index the current policy pages and the catalogue, give the model only the passages found, and tell it to say when the passages do not answer. Re-run the eval and read the failures: are they missing passages, bad ranking or a model that ignored the passage?
  5. Fine-tune only on evidence. If format errors stay high after prompting and examples, and you have hundreds of approved, current replies, a small tuning run may help. Compare it with the prompt baseline on the same set, and price the upkeep: new data, re-training on every policy change, and a re-test whenever the base model changes.
  6. Choose build, buy or wrap. A finished support-agent product, a wrapper over a frontier API, and a self-hosted open-weight model differ in speed, control and total cost. Decide with the eval results and a full cost line, not the demo.

Before and after

Before: "Fine-tune on 12,000 old tickets." The tickets contain the old return window, three agents' different styles and a few wrong answers. After: retrieval supplies the current 30-day policy, a prompt sets the format, and the eval set shows which gaps remain.

What goes wrong

  • Training facts into weights. The model repeats the September policy until the next run, and nobody can see where an answer came from.
  • Judging by demo. Five good answers in a meeting say nothing about the 150 tickets you did not try.
  • Hiding the upkeep. A tuned model has a data pipeline, a re-test and a retirement date. The one-off training cost is the small part.
  • Reaching for a bigger system first. If a prompt and three examples fix the format, a training pipeline is cost with no benefit.

The skill in this scenario is the order of questions: what is missing, how will we know, what is the cheapest fix that passes, and what will it cost to keep.

Steps

  1. Sort each complaint into knowledge or behaviour

    Skill: train-when

    Write each complaint on one line and label it. Stale or invented facts are knowledge gaps: route them to retrieval or a tool. The wrong answer shape is a behaviour gap: try prompting first. Training is not an option yet, because nothing has been measured.

    Complaint triage
    ComplaintGapFirst fix
    Quotes the old 60-day return windowKnowledge (changed fact)Retrieve the current policy
    Invents tent specificationsKnowledge (missing fact)Retrieve the catalogue; allow "I do not know"
    Replies are long and unstructuredBehaviour (format)Instructions, examples, structured output
  2. Build the eval set before choosing a fix

    Skill: evals-datasets

    Sample 150 real tickets across return, warranty, fit and delivery questions. Add edge cases: an empty message, a message in Spanish, a question the policy does not answer. Store a reference answer where one exists and grading criteria where it does not. Record where each case came from and version the set.

    Eval set plan, version 1
    150 cases
    SliceCasesGrading
    Returns and refunds40Reference answer
    Warranty25Reference answer
    Product fit and specs40Criteria: matches catalogue
    Delivery20Reference answer
    Edge and adversarial25Criteria: refuses or escalates
  3. Measure a prompt baseline

    Skill: train-when

    Add the three-part format to the instructions, three short examples and a structured-output schema. Run the eval set and record format pass rate and factual pass rate separately. Every later change is compared with this number.

    Baseline run
    CheckPass rate
    Three-part format91%
    Facts match current policy62%
    Specs match catalogue55%
  4. Add retrieval for the facts and read the failures

    Skill: rag-when

    Index the current policy pages and the catalogue. Pass the top passages with the question and tell the model to answer only from them. Re-run the set and sort every failure: passage not found, wrong passage ranked first, or passage found and ignored.

  5. Fine-tune only if a measured behaviour gap remains

    Skill: train-when

    If format errors stay high after prompting and examples, and you hold hundreds of current, approved replies, run a small tuning job and compare it with the prompt baseline on the same eval set. Price the upkeep: new data, retraining after policy changes, and a re-test whenever the base model changes.

  6. Choose build, buy or wrap with the full cost line

    Skill: aipm-build-buy

    Compare a vendor support-agent product, a wrapper over a frontier model API and a self-hosted open-weight model. Count integration, evals, retraining, hosting, monitoring and the cost of being locked in, not only the price per token. Pick the cheapest option that passes the eval set.

Skills this scenario uses

Where to study