LIVEยทThe trends shaping tomorrow's world.
AI

RAG vs Fine-Tuning

RAG adds knowledge at answer time; fine-tuning changes model behavior. Compare how each works, what the research shows, and when to combine them.

Use retrieval-augmented generation (RAG) when the model needs to know things: facts that change, private documents, or anything you want it to cite. Use fine-tuning when the model needs to behave differently: follow a format, adopt a tone, or perform a narrow task more reliably. The research supports that split. In a direct comparison of the two for adding knowledge, RAG consistently beat unsupervised fine-tuning, and many production systems end up using both.

Two different levers

A language model has two places to get what it needs to answer: its weights, set during training, and its context window, the text you give it with the request.

  • RAG works on the context window. At question time, the system searches an external collection and puts the most relevant passages into the prompt. The model's weights don't change. The original 2020 paper called this pairing "parametric" memory (the weights) with "non-parametric" memory (a searchable index) [1].
  • Fine-tuning works on the weights. You continue training a pretrained model on examples of the inputs and outputs you want, so the behavior is built in and doesn't need to be described in every prompt.

That distinction explains most of the practical differences. Anything stored in an index can be edited, deleted, permission-filtered and cited. Anything stored in weights is hard to inspect, hard to remove, and requires another training run to change.

For a full walk-through of the retrieval pipeline, see our explainer on what retrieval-augmented generation is. For the model underneath both approaches, see how large language models work.

How fine-tuning works today

Full fine-tuning updates every weight in the model, which is expensive for large models. Much fine-tuning now uses parameter-efficient methods, and one of the most widely used is LoRA.

LoRA (Low-Rank Adaptation), introduced by Edward Hu and colleagues in 2021, freezes the original weights and trains two small "low-rank" matrices per adapted layer, whose product is the weight update [2]. Compared with fully fine-tuning GPT-3 175B with the Adam optimizer, the authors reported that LoRA cut the number of trainable parameters by 10,000 times and GPU memory needs by three times, while matching or beating full fine-tuning quality on the models they tested [2]. Because the update can be merged back into the original weights after training, it adds no inference latency [2][4].

Hugging Face's PEFT documentation highlights a practical upside: since the base model stays frozen, you can keep several small, portable LoRA adapters for different tasks on top of one base model [4].

QLoRA went further in 2023, training LoRA adapters on top of a model quantized to 4 bits. Its authors reported fine-tuning a 65-billion-parameter model on a single 48 GB GPU while preserving full 16-bit fine-tuning task performance [3].

Fine-tuning methods also differ in what the training data looks like. OpenAI's documentation, for example, describes supervised fine-tuning on examples of correct responses, and preference fine-tuning (DPO) on pairs of better and worse responses [7].

What the research says about adding knowledge

The most direct test is a 2023 study by Oded Ovadia and colleagues, "Fine-Tuning or Retrieval?" [5]. They compared unsupervised fine-tuning with RAG on knowledge-intensive tasks across several subjects. Their conclusion: fine-tuning offered some improvement, but RAG consistently outperformed it, both for knowledge the model had seen during pretraining and for entirely new knowledge [5]. They also found that models struggle to learn new facts through unsupervised fine-tuning, and that exposing the model to many variations of the same fact may help [5].

The RAG paper itself demonstrated the update advantage concretely. By swapping a December 2018 Wikipedia index for a December 2016 one, the authors changed which world leaders the model named, with no retraining. With the 2016 index, it answered 70% of questions about 2016 leaders correctly; with the 2018 index, accuracy on those same questions fell to 12% [1].

Neither result means fine-tuning is useless. It means fine-tuning is a weak tool for injecting facts, which is the job most people first try to use it for.

The two combine well

A useful middle ground is to fine-tune a model to be better at RAG. RAFT (Retrieval-Augmented Fine-Tuning), from Tianjun Zhang and colleagues, trains a model on questions paired with a mix of helpful and "distractor" documents, teaching it to ignore the distractors and quote the relevant passage in a chain-of-thought answer [6]. The authors reported consistent gains on domain-specific RAG across PubMed, HotpotQA and Gorilla datasets [6].

The lesson generalizes: retrieval supplies the knowledge, and fine-tuning can improve how the model uses it.

Side-by-side comparison


RAG

Fine-tuning

What changes

The prompt (context)

The model's weights

Best at

Supplying facts, especially changing or private ones

Shaping behavior: format, tone, task skill

Updating knowledge

Re-index the changed documents

Retrain

Citations

Natural: you know which passages were used

Not inherent

Removing information

Delete it from the index

Retrain, and verification is difficult

Access control

Filter retrieval per user

Everyone using the model gets the same weights

Up-front work

Build ingestion, chunking, indexing, retrieval

Collect and clean training examples, run training

Per-request cost

Longer prompts (retrieved text) plus a search

Can shorten prompts by building instructions in [7]

Main failure mode

Right passage isn't retrieved

Model doesn't absorb facts; behavior drifts

How to decide

The decision table below is our editorial reasoning, built from the mechanisms above and the cited studies. It isn't a benchmark result. The logic: knowledge that needs to be current, attributable, removable or permission-scoped should live outside the weights, because only an index offers those properties. Behavior that you'd otherwise have to describe in every prompt is a candidate for training, because that's what weights encode well.

Your requirement

Lean toward

Reasoning

Answers must reflect documents that change weekly or daily

RAG

Updating an index is immediate; retraining isn't [1]

Answers must cite sources

RAG

The system knows exactly which passages it supplied

Different users may see different data

RAG

Retrieval can filter by permissions; weights can't

You must be able to delete information on request

RAG

Deleting from an index is straightforward; removing a fact from trained weights isn't

The model needs new domain facts

RAG first

RAG outperformed unsupervised fine-tuning for knowledge injection [5]

Output must follow a strict format or house style every time

Fine-tuning

Supervised examples teach format; OpenAI lists format and tone among fine-tuning use cases [7]

Prompts are long because of instructions and examples

Fine-tuning

Training can replace in-prompt examples and shorten prompts [7]

A narrow, high-volume task where a smaller, cheaper model would do

Fine-tuning

OpenAI describes fine-tuning to get a smaller model to perform a specific task [7]

The model retrieves the right passages but uses them poorly

Both (e.g., RAFT-style)

Fine-tuning on retrieval-style examples improved domain RAG in RAFT [6]

Your whole knowledge base is under about 200,000 tokens

Neither, at first

Anthropic suggests putting a small knowledge base directly in the prompt [8]

A practical order of operations

  1. Write evaluations first. OpenAI's guidance frames optimization as a loop of evals, prompt engineering and fine-tuning, starting with a baseline [7].
  2. Push prompting as far as it goes. OpenAI's documentation notes that prompt engineering "may be all you need" for some use cases [7].
  3. Add retrieval for knowledge gaps. If failures are about missing or outdated facts, build RAG. Measure retrieval separately from answer quality.
  4. Fine-tune for behavior gaps. If the facts are present but the format, tone or task execution is wrong, consider a LoRA-style fine-tune [2][4].
  5. Combine if needed. If retrieval works but the model is distracted by irrelevant passages, a RAFT-style fine-tune is worth testing [6].

Costs and practical risks

We aren't quoting dollar figures, because prices vary by provider and change often. The cost structure is stable:

  • RAG costs are spread over time: running an index, embedding new documents, and paying for longer prompts on every request. Anthropic notes prompt caching can reduce latency and cost when the same context is reused [8].
  • Fine-tuning costs are concentrated: preparing a high-quality dataset (usually the hardest part) and running training, then repeating that whenever behavior needs to change. LoRA and QLoRA made training much cheaper in hardware terms [2][3], but data work doesn't shrink the same way.
  • Vendor availability can change. As of November 2026, OpenAI's documentation states that it is "winding down the fine-tuning platform": it's closed to new users, existing users can create jobs "for the coming months," and fine-tuned models remain available for inference until their base models are deprecated [7]. If you depend on hosted fine-tuning, check each provider's current status. Open-weight models with LoRA keep the option in your own hands.

Risks on each side:

  • RAG inherits the quality of its documents and is exposed to prompt injection through retrieved text.
  • Fine-tuning can bake in errors or sensitive data from the training set, and narrow training can degrade abilities you didn't test.

Outlook

The two approaches are converging into layers of the same system rather than rivals. Retrieval is moving toward agents that search iteratively (see our explainers on agentic AI and multi-agent systems), often over standard tool interfaces like the Model Context Protocol. Fine-tuning is shifting toward lightweight adapters that teach models to use tools and retrieved evidence well. As hosted fine-tuning options change, as OpenAI's notice shows [7], expect more teams to keep knowledge in retrieval and reserve training for behavior.

Frequently asked questions

Can fine-tuning teach a model new facts?

Somewhat, but poorly compared with retrieval. Ovadia and colleagues found unsupervised fine-tuning gave limited gains and that RAG outperformed it for both familiar and new knowledge [5]. Facts learned through training also can't be cited, updated or removed easily.

Is RAG cheaper than fine-tuning?

It depends on volume and how often your data changes. RAG adds ongoing costs for search and longer prompts; fine-tuning adds data-preparation and training costs each time you update. For frequently changing knowledge, RAG usually avoids repeated training runs.

What is LoRA?

LoRA is a parameter-efficient fine-tuning method that freezes the original model and trains small low-rank matrices added to its layers [2]. It sharply reduces trainable parameters and memory, and the result can be merged into the model so there's no extra inference latency [2][4].

Can I use RAG and fine-tuning together?

Yes. A common pattern is RAG for knowledge plus a fine-tuned model for format or domain behavior. RAFT specifically fine-tunes a model to make better use of retrieved documents and reported gains on domain-specific benchmarks [6].

Should I start with RAG or fine-tuning?

Start with evaluations and prompting. If the model lacks information, add RAG; if it has the information but behaves wrongly, consider fine-tuning [7]. For small knowledge bases, putting the material directly in the prompt may be enough [8].

Sources

  1. Lewis, P. et al. "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks." NeurIPS 2020. arXiv:2005.11401. https://arxiv.org/abs/2005.11401
  2. Hu, E. J. et al. "LoRA: Low-Rank Adaptation of Large Language Models." arXiv:2106.09685. https://arxiv.org/abs/2106.09685
  3. Dettmers, T. et al. "QLoRA: Efficient Finetuning of Quantized LLMs." arXiv:2305.14314. https://arxiv.org/abs/2305.14314
  4. Hugging Face. "LoRA" (PEFT conceptual guide). https://huggingface.co/docs/peft/main/en/conceptual_guides/lora
  5. Ovadia, O. et al. "Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMs." arXiv:2312.05934. https://arxiv.org/abs/2312.05934
  6. Zhang, T. et al. "RAFT: Adapting Language Model to Domain Specific RAG." arXiv:2403.10131. https://arxiv.org/abs/2403.10131
  7. OpenAI. "Model optimization." Developer documentation. https://developers.openai.com/api/docs/guides/model-optimization
  8. Anthropic. "Introducing Contextual Retrieval." September 2024. https://www.anthropic.com/news/contextual-retrieval