The core difference in one picture

Think of a new analyst joining your team. RAG is giving them access to the shared drive and saying “look it up before you answer.” Fine-tuning is sending them on a training course so they write reports in the house style without being told. One changes what they can reference; the other changes how they work.

RAG

Retrieves relevant documents at query time and inserts them into the prompt. Model weights don’t change.

Fine-tuning

Continues training the model on your examples so its weights — and default behaviour — change.

Prompt engineering

Changes only the instructions and examples you send. Cheapest and fastest; always try it first.

How RAG works

RAG splits your documents into chunks, converts each chunk into an embedding and stores it in a vector index. When a user asks a question, the system retrieves the most relevant chunks and adds them to the prompt with an instruction such as “answer only from the context below and cite the source.”

Because knowledge lives outside the model, you update it by re-indexing a document — no retraining. You can also apply per-user permissions at retrieval time, so people only get answers from documents they’re allowed to see. Deep dive: What Is RAG?

How fine-tuning works

Fine-tuning takes a pre-trained model and trains it further on hundreds to thousands of input → ideal-output examples. Modern approaches are usually parameter-efficient (such as LoRA), training small adapter weights instead of the whole model, which keeps costs manageable. Managed fine-tuning is offered by major model providers for some of their models, and open-weight models can be fine-tuned on your own infrastructure.

Fine-tuning shines when you can describe the desired behaviour more easily with examples than with instructions: a strict JSON layout, a brand voice, a classification scheme with subtle edge cases, or a domain-specific writing style. It can also let a smaller, cheaper model match a larger one on one narrow task.

RAG vs fine-tuning: side-by-side comparison

CriterionRAGFine-tuning
What it changesThe context (knowledge) per requestThe model’s weights (behaviour)
Best forPrivate, fresh or citable facts; Q&A over documentsFormat, tone, style; narrow repeatable tasks
Data freshnessUpdate a doc → live in minutesFrozen until you retrain
Citations / traceabilityNatural — you know which chunks were usedNot possible from weights
Hallucination controlStrong when grounded and instructed to abstainDoesn’t fix factual hallucination by itself
Access controlFilter retrieval by user permissionsEverything trained in is available to everyone
Upfront effortChunking, embeddings, vector store, evalsCurated training dataset, training runs, evals
Per-request costHigher — retrieved chunks add input tokensCan be lower — shorter prompts, smaller model
Iteration speedFastSlow (each change = new training run)

Interactive: which one do you need?

Decision helper

Answer five questions about your use case

Based on the trade-offs above. Pick yes or no for each.

1. Does the information change weekly or more often?

2. Do users need sources or citations for answers?

3. Is the knowledge private or permission-restricted?

4. Is the main problem a format, tone or style the model won’t follow consistently?

5. Is it one narrow task run at very high volume where cost per call matters?

When to combine RAG and fine-tuning

The two aren’t rivals. A common mature architecture: RAG supplies the facts, while a fine-tuned model reliably turns those facts into the exact output you need — for instance, a claims assistant that retrieves policy clauses (RAG) and always responds in a regulator-approved structure (fine-tuning). Some teams also fine-tune the model to make better use of retrieved context, such as ignoring irrelevant chunks and abstaining when the answer isn’t there.

The practical order: (1) prompt engineering with examples and structured output → (2) add RAG for missing knowledge → (3) build an evaluation set → (4) fine-tune only for the behaviour gaps your evals still show.

Common mistakes

  • Fine-tuning to “teach the docs.” The model still can’t cite, still goes stale and may blend facts. Use RAG.
  • Blaming the model for bad retrieval. Most weak RAG answers trace back to chunking and retrieval quality — see chunking strategies.
  • No evaluation set. Without 50–200 representative questions with expected answers, you can’t tell whether either approach helped.
  • Skipping prompt engineering. A few good examples in the prompt often close the gap teams try to fine-tune away.
  • Ignoring token costs. Retrieving ten large chunks for every request adds up — measure with the Token Counter and LLM Cost Estimator.
Quick quiz

RAG or fine-tune?