lowob

RAG vs Fine-Tuning: Which One Your Use Case Needs

Retrieval-augmented generation (RAG) gives a model relevant passages from your own documents at the moment it answers. Fine-tuning further trains the model on your examples so that it behaves differently every time. RAG is the tool for knowledge: facts, prices, policies and anything that changes. Fine-tuning is the tool for behaviour: format, tone and consistency on a narrow, repeated task. Most commercial use cases need RAG first, and many never need fine-tuning at all.

Gateway 0ToolingContextRecordReasoningGateway 1Gateway 2Gateway 3
Where this piece sits in The Build Order: the context layer.

What the two terms mean

RAG is a retrieval step placed in front of the model. A question arrives, a search system finds the most relevant passages in an approved set of documents, and those passages go into the prompt alongside the question. The model answers from what it was handed and can point to the source. Our explainer on retrieval-augmented generation covers the mechanics.

Fine-tuning is further training. You give the model hundreds or thousands of example inputs with the outputs you want, and the training run adjusts its weights. OpenAI's documentation lists supervised fine-tuning, which learns from examples of correct responses, and direct preference optimisation, which learns from pairs of better and worse responses. The result is a new model version that behaves differently without being told to in every prompt.

The cleanest statement of the difference comes from OpenAI's guide to optimising accuracy. It says you optimise context when the model lacks knowledge, because it is out of date or the information is proprietary. You optimise the model when results are inconsistent, the formatting is wrong, or the tone and reasoning drift. The guide also notes that the two "stack" rather than compete.

DimensionRAGFine-tuning
What it changesWhat the model reads at answer timeHow the model behaves, through its weights
Best forFacts, policies, prices, account historyFormat, tone, a narrow task done the same way each time
Keeping it currentRe-index the changed documentRun a new training job
Showing its sourceCan cite the passage it usedCannot point to where a learned fact came from
Access controlRetrieval can filter by the user's permissionsWhat the model learned is available to every user of that model
Typical failureRetrieves the wrong or a stale passageStates an outdated fact with full confidence
Place in the brain loopWiringReasoning

What the evidence says

The research points in one direction on knowledge. Ovadia, Brief, Mishaeli and Elisha compared unsupervised fine-tuning with RAG on knowledge-intensive tasks across several subjects. Fine-tuning gave some improvement, but RAG "consistently outperforms it, both for existing knowledge encountered during training and entirely new knowledge."

The agriculture study by Balaguer and colleagues is the strongest case for using both. Testing Llama 2 13B, GPT-3.5 and GPT-4, they reported that fine-tuning raised accuracy by over 6 percentage points and RAG added about 5 more. Farming is a domain with stable knowledge and a large, curated question set. Few commercial teams have either.

Vendor guidance adds the practical case for fine-tuning: more consistent formatting, shorter prompts that save tokens at scale, and the option to train "a smaller, cheaper, faster model" for one task. OpenAI's model optimisation page now also says its fine-tuning platform is closed to new users, with existing fine-tuned models available until their base models are retired. The technique remains available elsewhere, such as on open-weight models, but the change shows where one large provider sees value.

Which to choose

If the answer depends on facts in your documents or systems, use retrieval. If only the shape of the output is wrong, try better prompts and examples first, then consider fine-tuning.

Use caseStart withWhy
Answer questions from the policy library or product documentationRAGKnowledge that changes, and answers need a citation
Brief a seller before a call from CRM, email and ticketsRAG with permission-aware retrievalDifferent users may see different records
Draft proposals in the house structurePrompt and templateA good template usually fixes format without training
Classify thousands of inbound emails into a fixed taxonomyFine-tune a smaller model, if prompting is too slow or costlyNarrow, stable, high volume
Answer with current prices, discounts or termsRAG from the system of recordNever put a price list in model weights
Match the firm's written tone across all outputsPrompt with examples; fine-tune only if inconsistency persistsBehaviour, not knowledge

A short checklist before anyone commissions a fine-tuning project:

  • Is the gap knowledge or behaviour? If the model gives wrong facts, fine-tuning is the wrong tool.
  • Has prompting been tried properly? OpenAI notes that prompt engineering "may be all you need".
  • Is there a labelled set of good examples? Without hundreds of them, there is nothing to train on.
  • Will the facts change within a year? If so, they belong in retrieval, where an update is a re-index.
  • Is there an evaluation set? Both approaches need one, and the long context vs RAG choice depends on it too.

The lowob view

The enterprise brain is a loop: store, wiring, record, reasoning, learning. RAG sits in the wiring. It connects the reasoning layer to the store at the moment of the question, and it can respect who is asking. Fine-tuning changes the reasoning layer itself. Both are legitimate, but neither is where a firm's knowledge should live.

Commercial facts change weekly: who owns an account, what was agreed, which discount was approved and why. Those belong in the store and in the decision record, with an owner and a date, where they can be superseded rather than overwritten. A fine-tuned model holds a frozen snapshot that nobody can audit line by line. The learning stage writes outcomes back to the record, so the next retrieval improves without retraining.

Rent the model and the retrieval tooling. Own the documents, the record and the evaluation set. As we argue in Retrieval Is Not the Bottleneck, the harder problem is usually what the record contains, not how the model reads it.

lowob takeaways

  • Knowledge goes to retrieval. Facts that change belong in documents and records the model reads at answer time.
  • Behaviour goes to prompts first. Fine-tune only when a narrow task stays inconsistent after good prompting.
  • The evidence favours RAG for facts. Published comparisons find fine-tuning a weak way to add new knowledge.
  • Neither is the record. Decisions, owners and outcomes need a home that both approaches can read.

Common questions

What is the difference between RAG and fine-tuning?

RAG retrieves relevant passages from your documents and gives them to the model when it answers. Fine-tuning retrains the model on examples so it behaves differently without being told each time.

Is RAG better than fine-tuning?

For adding knowledge, published studies find RAG more effective. For consistent format, tone or a narrow repeated task, fine-tuning can help, and the two can be combined.

Can you use RAG and fine-tuning together?

Yes. OpenAI describes the two as stacking, and a 2024 agriculture study found accuracy gains from each that added up.

Sources and notes

What Is an AI Agent, and Where Does It Fit in the Brain?

Read next in The Build Order