Prerequisites: Calling LLM APIs in Production (how the API path works), Embeddings & Vector Search (how retrieval finds passages). Helpful: Evals & Tracing — you'll need it to settle the argument below.

The customer says "we need to fine-tune a model on our data." They might be right — but you don't know that yet, and neither do they. Your job is to test the proposal with evidence before anyone burns six weeks and a training budget.

Tuesday, 2:40 PM. You're on a call with Dev, the engineering lead at a logistics company. His team wants an AI assistant that answers driver questions from their 400-page operations manual.

"We've decided to fine-tune," Dev says. "Our data is proprietary, the base model doesn't know our procedures, and we want answers in our voice. How long does fine-tuning take?"

You have a choice. You can say "six to eight weeks" and start collecting training data — or you can ask one question that saves everyone two months: "What exactly do you need the model to do that it can't already do?"

That question is this entire post.

The real question: what is failing — knowledge, behavior, or both?

Dev's request bundles three different needs into one proposed solution. Untangle them before you pick a technology:

  • Knowledge: "The model doesn't know our procedures." The gap is information — facts that live in the manual, not in the model's training data.
  • Behavior: "We want answers in our voice." The gap is how it responds — tone, format, structure, consistency.
  • Freshness: "The manual updates every quarter." The gap is time — whatever you build must track a moving target.

Each gap points at a different tool. That's the whole decision, and it's why "should we fine-tune" is the wrong first question. The right first question is: which gap are we actually trying to close?

First, what an LLM actually does: training vs. inference

An LLM's life has two phases, and the three approaches split across them:

  • Training is when the model's weights are set — expensive, slow, done rarely. This is where the base model learned language, and where fine-tuning would continue the process on your examples.
  • Inference is when the model runs — every API call you make. The weights don't change; the model just reads your input and generates output.

Prompting and RAG live entirely in inference. Nothing about the model changes between your calls — you're either wording the request better or attaching better context to it. Fine-tuning is the only option here that re-enters training — which is exactly why it's the slowest to iterate, the hardest to roll back, and the one you should reach for last, not first.

The three approaches, defined in one paragraph each

Prompt engineering (the API path). You call a hosted model and get better behavior through instructions, examples, and structured output. No weights are updated. Whether anything you send is stored or retained depends on the provider's policies and your deployment's configuration — that's a privacy decision to make explicitly, not a technical guarantee. Your leverage is how precisely you specify the task. Covered in Calling LLM APIs in Production and Prompt & System Design.

RAG (retrieval-augmented generation). You keep the model frozen and give it relevant external information at query time: retrieve the right passages, place them in the prompt, generate the answer grounded in them. The model's underlying knowledge doesn't change — but its answers can draw on your documents, including ones written yesterday. Covered in RAG Systems End-to-End — including the part everyone skips, document ingestion.

Fine-tuning. You continue training the model's weights on your own examples so its behavior changes: tone, format, domain reasoning patterns, task-specific accuracy. The knowledge cutoff doesn't move the way people think it does — fine-tuning teaches the model how to respond far more reliably than what is true.

The one-sentence version

  • Prompting changes what you ask (inference).
  • RAG changes what the model can see right now (inference).
  • Fine-tuning changes how the model behaves by default (training).

What actually changes: a visual

If all three approaches "use an LLM," what's different under the hood? Follow what flows into the model and what comes out changed:

flowchart LR subgraph P[Prompting] P1[Instructions +\nexamples] --> P2[Base LLM\nweights unchanged] --> P3[Answer] end subgraph R[RAG] R1[Retrieve relevant\npassages] --> R2[Base LLM +\nretrieved context] --> R3[Grounded\nanswer] end subgraph F[Fine-tuning] F1[Training\nexamples] --> F2[Updated\nmodel weights] --> F3[Learned\nbehavior] end

Prompting changes the input. RAG supplies retrieved information at request time. Fine-tuning updates model parameters during training. Same model, three completely different theories of where the improvement comes from.

One driver question, three implementations

Let's make it concrete with a single question Dev's drivers actually ask:

"What should I do if my delivery vehicle breaks down?"

Approach A — prompt engineering. The model gets instructions like "Answer concisely and list the next three steps." It follows the format beautifully — but without access to the company manual, it doesn't know the actual breakdown procedure. It may invent plausible-sounding steps that contradict company policy. Format: excellent. Facts: unreliable.

Approach B — RAG. The system retrieves the relevant manual passage — say, "Secure the vehicle, contact dispatch, and open an incident ticket" — and the model answers from that passage, citing the section. The answer is grounded in the company's actual procedure, and when the procedure changes next quarter, updating the document updates every future answer.

Approach C — fine-tuning. The model trains on approved Q&A examples, so it consistently responds in the company's preferred tone and structure. But fine-tuning alone doesn't guarantee it knows the current breakdown procedure — it learned whatever the training examples contained, frozen at training time.

Illustrative scenario

The quoted breakdown procedure is an invented example for teaching, not a verified policy from any real company manual. The pattern it illustrates — format vs. facts vs. learned behavior — is the point.

The key insight most teams miss: RAG and fine-tuning are not mutually exclusive. A company might use RAG for current procedures and fine-tuning for a consistent response style — retrieval keeps the facts fresh, training keeps the voice consistent. Combine methods when the evals justify each one independently, which is exactly what the evaluation section below is for.

The decision flowchart

Start with the beginner version. Every branch is a question about the problem, not the technology:

flowchart TD Q[What is the model\nfailing to do?] --> K[Missing information?\nPrivate manuals, policies,\ncurrent facts] Q --> B[Wrong behavior?\nFormat, tone,\ntask patterns] K --> KR[Try RAG or\ntool-based retrieval] B --> BP[Try prompting\nwith examples first] KR --> E[Evaluate what\nstill fails] BP --> E E --> F{Behavior still inadequate\nand good training\nexamples exist?} F -- Yes --> FT[Test fine-tuning.\nCombine methods\nwhen justified.] F -- No --> S[Ship the simpler\nsolution]

Now the detailed engineering version — the one to walk through with Dev. Note the two branches beginners miss: fast-changing information (which punishes anything frozen, including weights) and the combination exit:

flowchart TD A[“The model can’t do what we need”] --> B{Is the gap\nmissing knowledge\nor fast-changing facts?} B -- “It doesn’t know our\nprocedures, or they\nchange often” --> C[Try RAG first] B -- “It knows enough,\nbut behaves wrong” --> D{Is the behavior gap\nfixable with examples?} D -- “A few examples\nin the prompt fix it” --> E[Prompt engineering] D -- “We need this behavior\non every call, cheaply,\nat scale” --> F[Consider fine-tuning] C --> G{Does retrieval return\nthe right chunks?} G -- Yes --> H[Ship RAG +\nevals] G -- No --> I[Fix ingestion &\nretrieval quality] I --> G H --> HC{Also need consistent\nvoice or format?} HC -- Yes --> HB[Add fine-tuning for\nstyle, keep RAG\nfor facts] HC -- No --> HD[Done] F --> J[Build an eval set\nFIRST,\nthen fine-tune] J --> K{Did the evals\nactually improve?} K -- Yes --> L[Ship it] K -- No --> M[Re-examine: training data\nquality, eval design,\nmodel choice — or the\nproblem was retrieval\nall along]

Notice the shape: most exits point back to cheaper options or to combinations. That's the base rate — most "we need fine-tuning" requests resolve into RAG, prompting, or a deliberate combination once someone asks what the model is actually failing at.

When each one wins

ApproachReaches for it when…
Prompt engineeringThe task fits in context, the model already knows the domain, and you need an answer this week. Few-shot examples fix the format; system instructions fix the tone. Cheapest to build, cheapest to change.
RAGAnswers must come from your documents, and those documents change — manuals update, policies revise, prices move. Retrieval keeps knowledge fresh without retraining anything.
Fine-tuningYou need a persistent behavior change at scale: a specific output format on every call, domain reasoning patterns, or distilling a big model's behavior into a smaller one. You have hundreds of high-quality examples and an eval set to prove it worked.

When each one breaks

Every approach has a characteristic failure mode. The customer will describe the symptom; you diagnose the cause.

Prompting breaks when the task outgrows the context window or your budget. Stuffing 400 pages into a prompt "works" exactly once — then latency climbs, costs climb, and the model starts ignoring the middle of what you gave it. Prompting also can't fix missing knowledge: no instruction teaches a model your Q3 pricing.
RAG breaks when retrieval is bad — and retrieval is bad more often than anyone admits. Wrong chunks, stale chunks, tables mangled by the chunker, the one paragraph that answers the question split across a chunk boundary. A RAG system with poor ingestion is a confident liar with citations. (This is why ingestion quality gets its own post.) And note the hard limit: neither RAG nor fine-tuning guarantees factual correctness. A retrieved passage can be misread; a fine-tuned model can still hallucinate. Grounding reduces hallucinations — it doesn't eliminate them, which is why answers carrying real consequences need the citation-support checks in Evals & Tracing.
Fine-tuning breaks in three classic ways: it memorizes your examples instead of learning the pattern (great on training data, useless in production); it degrades capabilities the base model already had; and it goes stale — the day your procedures change, the weights don't. It also fails organizationally: weeks of data collection and training before you learn whether the idea works at all.

Details that bite in production

A few realities beginners don't expect — each has ended a real deployment:

  • Document permissions. RAG must respect access control: the retriever must never surface documents the asking user isn't authorized to see. Retrieval over a shared corpus without per-user filtering is a data leak with good latency.
  • Data privacy. Private documents sent to a hosted API, and private examples used for fine-tuning, need explicit retention decisions — what the provider stores, for how long, and under what terms. Get this in writing before the pilot, not after.
  • Versioning. Prompts, retriever configurations, and model snapshots all change. Version each one, and re-run evals on every change — "we only tweaked the prompt" has broken more demos than any model upgrade.
  • How RAG actually finds passages. Retrieval typically uses embeddings and vector search — sometimes combined with keyword or hybrid search. You don't need the math yet; you need to know that retrieval quality is a system you build and measure, not a library you import.

What a fine-tuning dataset actually looks like

Fine-tuning consumes examples, not documents. A single training example is an input-output pair showing the behavior you want:

{
  "messages": [
    {
      "role": "user",
      "content": "My delivery will be late."
    },
    {
      "role": "assistant",
      "content": "I understand. Please notify dispatch and provide your updated ETA."
    }
  ]
}

This is an illustrative training example of a desired response pattern — not a complete dataset, and not a guarantee the behavior will be learned. Real fine-tuning needs hundreds of such pairs, and one rule is non-negotiable: your training examples and your evaluation questions must be separate sets. Grading a model on the examples it trained on tells you it can memorize, not that it can generalize. The eval set from the next section is the honest judge.

The cost and operations dimension

Technical merit isn't the whole decision. Each path has a different operational signature — what it costs to build, what it costs to run, and what rots over time. The sketches below are illustrative order-of-magnitude comparisons, not measurements from a real deployment; your workload's evals are the only numbers that count.

Prompt engineeringRAGFine-tuning
Time to first working versionDays1–3 weeks (ingestion is the work)Weeks to months (data first)
What goes stalePrompt instructions and examples as requirements changeThe document pipelineThe weights, on every content change
Per-query cost driverTokens in the promptTokens + retrieval infraCan be lower per query with the right model and workload — not guaranteed
Hardest skill requiredTask specificationIngestion + retrieval qualityDataset curation + eval design
Easiest to roll backYes — change the promptYes — fix the docs or retrieverNo — retrain or revert weights

How to actually decide: evals, not opinions

Dev is convinced fine-tuning is the answer. You're fairly sure RAG is. Neither of you should win this argument with opinions. Build a small eval set first: 30–50 real questions from Dev's drivers, with known-good answers from the operations manual. Then:

  1. Baseline: run the eval set against plain prompting. Record the score.
  2. RAG: build the minimal retrieval pipeline, run the same set. Record the score.
  3. Compare honestly. If RAG beats prompting on the questions that matter — and failure analysis shows retrieval (not reasoning) as the bottleneck — you have your answer, with evidence Dev can take to his leadership.
  4. Fine-tune only if the evals show a behavior gap that retrieval can't close and you can name what the fine-tune must change. "Make it better" is not a training objective.

What the results look like

Here's the kind of scorecard that settles the argument — illustrative scores for teaching, not measured benchmarks:

Metric (out of 40 questions)PromptingRAGFine-tuned
Correct answers223529
With correct supporting evidence123417
Correct required format363739
Average latency1.1s1.8s1.0s

Read it like an FDE: RAG dominates on questions needing proprietary manual facts and on evidence — the fine-tuned model answers in the right format (39/40) but can't cite what it was never trained to retrieve. That supports choosing RAG for the pilot. It does not establish that RAG is universally superior — on a workload where format consistency is the whole job, the fine-tuned column would tell a different story. The scorecard answers "which approach for this workload," nothing more.

Don't over-claim from a pilot

  • 40 questions settle a pilot, not a production decision. Before broad claims: held-out questions the team never tuned against, manually reviewed edge cases, ambiguous requests, and refusal cases (questions the system should decline).
  • The "supporting evidence" metric needs an explicit rubric — what counts as a correct citation — or two graders will score the same answer differently.
  • Any accuracy number from a benchmark blog post measured their workload, not yours.

This is the Evals & Tracing discipline applied at decision time: the rubric defines correctness before anyone trains anything, and the numbers — not the loudest voice — pick the architecture.

What to tell the customer

Back on the call with Dev. Here's the honest version of the conversation:

"Dev, I hear three separate needs in what you described. One: answers grounded in your manual — that's a knowledge problem, and retrieval solves it without training. Two: answers in your voice — that's a behavior problem, and I'd test whether examples in the prompt fix it before we talk about weights. Three: you want this to keep working when the manual updates — and that's actually an argument against fine-tuning, because weights go stale and pipelines don't."

"Here's my proposal: give me 40 real driver questions and the correct answers from the manual. I'll build the RAG baseline this week and show you the eval scores. If retrieval can't close the gap, then we talk fine-tuning — with the eval set ready to prove it worked."

Dev pauses. "Nobody's ever proposed proving it first," he says. "Let's do that."

That conversation is the job. The technology choice was the easy part — the hard part was refusing to let a confident customer buy six weeks of the wrong work.

CityOps tie-in

You've already lived this decision. In Spine Milestone 4: Ask CityOps, the 311 assistant answers from city procedures — that's the RAG path, and the milestone's eval set is exactly the "prove it first" instrument from this post. If you revisit that milestone now, ask yourself: which of its questions would fine-tuning have answered better? (Spoiler from the field: when the procedures updated mid-project, the teams with retrieval updated a document; the teams imagining fine-tuning would have retrained.)

Field check

  1. A customer says: "Our support bot gives wrong answers about our refund policy." Name two questions you'd ask to determine whether the problem is retrieval, prompting, or a fine-tuning-shaped gap — and what evidence each answer would give you.
  2. Your RAG evals show 60% of failures come from the retriever returning the wrong chunk, 40% from the model misreading a correct chunk. Which do you fix first, and why does the answer matter for the build-vs-train decision?
  3. Someone proposes fine-tuning to "make the model know our Q3 catalog." Explain why this is a knowledge problem rather than a behavior problem — and what breaks the day Q4 arrives.
  4. Your evals show the fine-tuned model nails the response format but can't cite sources, while RAG cites sources but occasionally uses the wrong tone. Sketch the combined architecture you'd propose — and name the eval metric that would justify keeping both.
What good answers look like

1. "Show me a failing question and the chunks retrieved for it" (retrieval evidence) and "What does the prompt instruct the model to do when sources conflict?" (prompting evidence). If the right chunk was retrieved and the answer is still wrong, you're looking at reasoning/format — prompting or fine-tuning territory. If the wrong chunk came back, no amount of training fixes it.

2. Fix retrieval first: it's the bigger slice, it's cheaper to iterate, and every point of retrieval gain lifts the whole system. The build-vs-train implication: if most failures are retrieval, fine-tuning is optimizing the wrong layer.

3. Catalog contents are facts that change on a schedule — the textbook RAG case. Fine-tuned weights would memorize Q3 and confidently quote it in Q4. Retrieval reads the current catalog every time.

4. RAG for facts + fine-tuned model (or few-shot voice examples) for style: retrieve the current procedure, generate in the trained voice. The justifying metric is correct supporting evidence staying high while format correctness rises — each method must earn its place on its own metric.