RAG vs fine-tuning: when to use each

Two ways to make a language model useful for your own work. RAG gives the model your documents at the moment it answers; fine-tuning changes the model itself by training it on your examples. The table compares them using documentation from AWS, Google, IBM, Red Hat, Databricks and OpenAI.

Options compared
2 options compared
Sources cited
16 sources cited
Checked
checked
Where your documents go
Your documents
Prompt
Model

Gives the model knowledge

Changes how the model behaves

What changes
Nothing in the model
The model's weights
Updating knowledge
Minutes
Hours to days
Citing sources
Yes
No

Short answer

  • RAG gives a model knowledge

    It looks up your documents at answer time and can cite them.

  • Fine-tuning shapes behaviour

    It trains the model on your examples for a format, a task or a tone.

  • Try better prompts first, use RAG for facts that change, and fine-tune only when a measured gap remains.

Side by side

How we have used itFrom our own pages, not neutral sources
RAG (retrieval-augmented generation)RAG over legal case documentsRAG with retrieval, re-ranking and an evaluation set. For DecoverAI's legal platform, RAG over case documents on Pinecone and AWS EKS.
Fine-tuningA small model for one taskA fine-tuned small open model (Phi-3.5) for a narrow pharma email task, benchmarked against a larger model on a fixed 150-sample test set.
What changes
RAGNothing in the modelNothing in the model. Relevant passages from your documents are retrieved and added to the prompt when a question comes in.
Fine-tuningThe model's weightsThe model's weights. It is trained further on your labelled examples.
Data you need
RAGYour existing documentsYour existing documents, structured or not: PDFs, wikis, office files, database tables.
Fine-tuningLabelled examples, 100+Labelled examples of input and the output you want. Google's docs suggest 100 or more; supervised tuning typically uses hundreds to thousands.
Cost to build
RAGUsually lowerUsually lower. The work is the data pipeline, the search index and the access rules.
Fine-tuningUsually higherUsually higher: labelling data plus GPU time for training runs. Parameter-efficient methods such as LoRA reduce it.
Cost to run
RAGLonger prompts, plus an indexEvery answer carries the retrieved text, so prompts are longer, and a search index runs alongside the model.
Fine-tuningShorter promptsPrompts can be shorter, and a small tuned model can stand in for a larger one. Serving a fully fine-tuned model can cost more.
Updating knowledge
RAGMinutesMinutes: add or change a document and re-index it.
Fine-tuningHours to daysHours to days per training run, and what the model knows is a snapshot of its training data.
Citing sources
RAGYesYes. Answers can point to the passages they used, so people can check them.
Fine-tuningNoNo. A fine-tuned model does not say where an answer came from.
Main risks
RAGMissed or leaked passagesThe search misses the right passage; a stale or poisoned index; weak access rules that leak data between users.
Fine-tuningHallucination, forgettingMore hallucination when used to answer questions; forgetting earlier skills; training data that can be exposed later.
Best for
RAGChanging documents, cited answersQuestions over your own documents that change, where answers must cite a source.
Fine-tuningFormat, tone, narrow tasksFixed output formats, classification, extraction or tone, or a smaller, cheaper model for one narrow task.

Sources read on 27 November 2026.

Start with prompting

Both Google's and OpenAI's tuning guides say to start with prompt engineering and move to fine-tuning only if needed. If your reference material is small enough to fit in the prompt, you may not need RAG either. Each step adds build and running cost, so take it only when a test shows the simpler step falls short.

Take each step only when you need it
  1. PromptingStart here
  2. RAGAnswers need your changing documents
  3. Fine-tuningA measured gap remains

Build and running cost

When RAG fits

Use RAG when answers depend on documents that change, or when people need to see the source. AWS recommends starting from RAG for question answering over your own documents, because new documents can be added in minutes and answers can cite them.

Production RAG still takes data engineering: ingestion, chunking, an index that stays current, and access rules so each user only retrieves what they are allowed to see.

How RAG answers a question
  1. A question comes in
  2. Search your documentsOnly what this user may see
  3. Add the passages to the prompt
  4. Answer with citationsPeople can check the source

New or changed document: re-index it in minutes.

When fine-tuning fits

Use fine-tuning when the model needs to behave differently, not know more: a strict output format, classification, entity extraction, a house style, or a narrow task where a small tuned model can replace a large general one and cut the cost per call.

It needs a few hundred or more good labelled examples, and someone who can run training and judge the results. Parameter-efficient fine-tuning (PEFT), such as LoRA, trains a small set of extra weights instead of the whole model, which lowers the compute and storage needed.

How fine-tuning changes a model
  1. Labelled examplesA few hundred or more
  2. Training runHours to days; LoRA cuts the compute
  3. Updated weightsA snapshot of the training data
  4. Narrow task outputFormat, extraction, classification or tone

Using both

The two are not exclusive. AWS describes keeping a RAG architecture unchanged while the model that writes the answer is also fine-tuned: retrieval supplies current facts, tuning supplies the format and domain language.

Using both in one system

Retrieval (RAG) supplies

  • Current facts
  • Sources to cite

Fine-tuning supplies

  • The output format
  • Domain language
One answer

How to test the choice

This is how we decide on projects, so treat it as our method rather than a standard:

  • Collect a fixed set of real examples with known right answers before building anything.
  • Score a prompt-only baseline on that set first.
  • Add RAG and score again; fine-tune only if a gap remains that retrieval does not close.
  • Compare accuracy, cost per answer and response time, and rerun the set on every change to prompts, data or model.
Our test loop
  1. Fixed test setReal examples with known right answers
  2. Prompt-only baselineScore it first
  3. Add RAGScore again
  4. Fine-tuneOnly if a gap remains

Rerun the set on every change to prompts, data or model.

A note on OpenAI fine-tuning

OpenAI is winding down self-serve fine-tuning. From 15 December 2026 no organization can create new self-serve fine-tuning jobs; existing fine-tuned models keep running until OpenAI retires their base model. Google's Gemini tuning and fine-tuning of open-weight models with PEFT remain available.

OpenAI self-serve fine-tuning
  1. 15 December 2026No new self-serve fine-tuning jobs
  2. Existing fine-tuned modelsKeep running
  3. Base model retiredIts fine-tuned models go with it

Still available: Gemini tuning, and PEFT on open-weight models.

Frequently asked questions

For answering questions over your own documents it is usually cheaper to start, new documents can be added in minutes instead of a training run, answers can cite their sources, and AWS notes a lower risk of hallucination. Fine-tuning is still the better fit for formats, classification and tone.

Yes, for changing behaviour: formats, classification, extraction and making a small model good at one task. Vendor support is shifting, though. OpenAI stops new self-serve fine-tuning jobs on 15 December 2026, while Google still supports tuning and open-weight models can be fine-tuned with PEFT.

Full fine-tuning updates all of a model's parameters. Parameter-efficient fine-tuning (PEFT), such as LoRA, freezes the original weights and trains a small set of extra ones, which needs far less compute and storage and can work with a smaller dataset.

The API steps are short, but the hard parts are collecting good labelled data, running training and evaluating the result. Vendor guides say it needs experience with model training and evaluation, and often a data scientist.

Yes. Retrieval supplies current facts at answer time, and the model that writes the answer can also be fine-tuned for format and domain language. Test each step against the same set of examples to see what it adds.

Sources

Show the 16 public sources

Find out what to build first

Start with the free AI readiness assessment and get a written report by email, or book a 30-minute strategy call with the founder.

Changelog

  • 1 December 2026: Figures added.
  • 27 November 2026: Page published.