Short answer
Choose RAG when the problem is knowledge: the model must answer from documents that change often, and the answer needs citations. Choose fine-tuning when the problem is behaviour: the model must follow a specific output format, tone or task pattern that prompting cannot reliably produce. If you are unsure, start with prompting, then RAG. Fine-tune only when you have measured that prompting fails at scale. Most product teams need RAG, not fine-tuning, and many need neither at first.
The two are not opposites. RAG injects the right context at inference time. Fine-tuning changes the model's weights in advance. You can combine them, but each adds cost and maintenance, so add one at a time.
What each option actually does
RAG (retrieval-augmented generation) retrieves relevant passages from your own corpus and puts them in the prompt. The original RAG paper by Lewis et al. showed that combining retrieval with generation improves factuality on knowledge-heavy tasks (https://arxiv.org/abs/2005.11401). In practice, RAG is how you make an LLM answer from your contracts, policies or support docs.
Fine-tuning trains a base model on your examples so its weights change. OpenAI documents fine-tuning as a way to improve reliability on a specific task, steer output style and format, and reduce prompt length (https://platform.openai.com/docs/guides/fine-tuning). It does not reliably teach new facts, and facts learned into weights go stale without retraining.
The failure modes differ. RAG fails when retrieval misses the right document, and you will see confident answers from the wrong context. Fine-tuning fails when your training data is thin or biased, and the model will reproduce those errors with no visible trace.
Decision table
| Situation | Choose | Why |
|---|---|---|
| Answers must come from documents that update weekly or daily | RAG | Retrieval picks up new content instantly; weights do not |
| Answer needs a citation or audit trail | RAG | You can show the source passage |
| Model must always output a strict JSON schema, invoice format or house style | Fine-tuning | Weight changes make format adherence far more reliable than prompts |
| Task is repetitive classification or extraction with thousands of labelled examples | Fine-tuning | Cheaper and faster at inference after training |
| Prompt is too long and costs too much | Fine-tuning (or RAG instead) | Fine-tuning shortens prompts; RAG is cheaper to change |
| Knowledge is small and static (under ~50 pages) | Prompting | Just paste the docs; no infrastructure needed |
| You have no labelled examples | RAG or prompting | Fine-tuning quality depends entirely on data quality |
A worked example (hypothetical)
A 40-person fintech startup wants an assistant that answers employee questions from its HR handbook, which changes every quarter.
- Fine-tuning route: hire annotation help, build ~2,000 question-answer pairs, train, then retrain every quarter when the handbook changes. Realistic cost: weeks of engineering plus ongoing data work every cycle.
- RAG route: index the handbook into a vector store, retrieve the top passages per question, generate an answer with citations. Updates are automatic: re-index the new handbook and the answers refresh. Engineering effort is mostly retrieval quality, not data labelling.
The RAG route wins here because knowledge is volatile and citations matter. Now flip it: the same team wants its vendor-review bot to always output a specific risk-memo structure from loose reviewer notes. Prompting produces inconsistent structure about 15% of the time in their tests (hypothetical figure for illustration). After collecting a few thousand correctly formatted memos, fine-tuning on them makes the format reliable. That is the fine-tuning case.
Cost and maintenance trade-offs
RAG costs: a vector store and an embedding pipeline to build and monitor; chunking and retrieval quality tuning; per-query embedding and generation spend. It also carries latency: every query adds a retrieval step. For cost control at inference time, see our guide on reducing LLM API costs.
Fine-tuning costs: curating a clean training set, which is usually the biggest hidden cost; a training run per model update; and re-fine-tuning whenever your task or the base model changes. You inherit model-deprecation risk: if the vendor retires the model, you retrain. Microsoft's RAG overview notes that grounding generation in retrieved sources is a standard pattern for domain answers without retraining (https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview).
Neither approach removes the need for evaluation. Whatever you pick, measure output quality against a fixed test set before and after. Our guide on setting up LLM evals for production covers how to structure that.
A practical order of operations
- Write the strongest prompt you can, with few-shot examples and a strict output schema (structured JSON prompting covers the schema part).
- Build an eval set of 50-200 real inputs with correct outputs.
- Run the prompt model against the eval set. If accuracy meets your bar, ship and stop.
- If failures are about missing knowledge, add RAG: index your corpus, tune retrieval, re-run evals.
- If failures are about format or task behaviour and you have 1,000+ clean examples, fine-tune and re-run evals.
- Combine only if the eval data says both problems exist.
Skipping to fine-tuning first is the most common expensive mistake. It locks you into a training loop before you know whether retrieval, not the model, is the real gap.
FAQ
Can RAG and fine-tuning work together? Yes. A common pattern is a fine-tuned model that is good at formatting and reasoning, paired with retrieval that supplies current facts. Add this only after measuring that each alone falls short.
Does fine-tuning fix hallucinations? Not reliably. If the model invents facts, retrieval grounding plus a rule to answer only from retrieved passages usually helps more than weight changes.
How big should a fine-tuning dataset be? There is no fixed number. Quality and consistency matter more than raw size, but a few hundred examples is rarely enough for reliable behaviour change. OpenAI's fine-tuning guide recommends starting with 50 or more high-quality examples as a baseline to evaluate against (https://platform.openai.com/docs/guides/fine-tuning).
Is RAG always cheaper than fine-tuning? Not per-query necessarily, because RAG adds embedding and longer prompts on every call. But RAG is much cheaper to change, which usually dominates for product teams.
Next step
Write down your five most common user queries, hand-write the correct answers, and run them through a plain prompted model. That single test will usually tell you whether you have a knowledge problem (reach for RAG) or a behaviour problem (consider fine-tuning).
From the Zettaura team: we build AI employees that work on real business documents, and grounding answers in your own files is the core of how we approached ZiaSign's contract review. See how it works at https://ziasign.com.



