The short answer
RAG and fine-tuning solve different problems. RAG leaves the model unchanged and gives it passages from your own documents at each question, so answers stay current and can cite sources. Fine-tuning changes the model with your examples, so it learns a style, a format or a narrow task. Knowledge problems need RAG. Behaviour problems need fine-tuning.
Search for RAG vs fine-tuning and most of the first page belongs to platform vendors. Most of them define both terms well. Fewer help you choose.
The questions that decide real projects tend to come late. Who may see which answer? What happens when the model you started from is retired? Can a model be made to forget something? And what does the research say about teaching facts by fine-tuning?
At Aptibit we build both kinds of system, so we have no reason to favour either. This guide is about the choice. Our LLM fine-tuning guide covers the method itself in detail.
What is the difference between RAG and fine-tuning?
RAG and fine-tuning solve different problems. Retrieval-augmented generation leaves the model unchanged and gives it passages from your own documents at each question. Answers stay current and can cite sources. Fine-tuning changes the model with your examples, so it learns a style, a format or a narrow task. Knowledge problems need RAG. Behaviour problems need fine-tuning.
Both are ways to fit a large language model to your organisation. They work at different points. RAG acts at the moment a question is asked. Fine-tuning acts once, before the model goes live, and its effect stays in every answer.
NIST describes RAG as a system where a model is paired with a separate search over a knowledge base. The search finds relevant text and hands it to the model in context. NIST adds that this lets a model's knowledge change without the need for retraining.
The technique was named in a 2020 paper by Patrick Lewis and colleagues. They found that models drawing on retrieved passages wrote more specific, more varied and more factual text than models working from memory alone.
NIST defines fine-tuning as a training step that starts from a pre-trained model and adds task or domain information. The model's internal weights change. What it learns travels with it into every answer, relevant or not.
A simple picture helps. RAG is an open book exam. Fine-tuning is the months of practice before it. Practice shapes how you write. The open book supplies the facts.
RAG vs fine-tuning, side by side
Eleven points decide most projects. Each one follows from the same split: RAG changes what the model reads, and fine-tuning changes the model.
| Point | RAG | Fine-tuning |
|---|---|---|
| What it changes | The input. The model sees your passages next to each question. | The model itself. The effect applies to every answer it gives. |
| Freshness | As current as your index. AWS notes RAG can take in new documents in a few minutes. | Frozen on the day training ended. AWS notes a run takes a few hours to days. |
| Citing sources | Can show the passage behind each claim, so a reader can check it. | Cannot point to where it learned something. AWS records the same limit. |
| Hallucination | Answers rest on retrieved text, and the model can be told to decline. It still fails when search returns the wrong passage. | Tuning on unfamiliar facts can make invention worse. |
| Data you need | Your documents, current and tidy, with their access rules. | Curated pairs of inputs and ideal outputs. Quality matters far more than count. |
| Upfront cost | Connecting systems, preparing content and building search. | Building examples, training and evaluation. |
| Running cost | Longer prompts on every query, plus the search service. | Short prompts. A small tuned model can be far cheaper to serve. |
| Speed | Adds a search step, and longer prompts take longer to read. | Answers directly. A small tuned model answers faster still. |
| Access control | Each search can be limited to what the person asking may see. | Knows the same things for every user. |
| When the model changes | Swap in the new model and rerun your test set. | Tied to the exact model it was trained on. A new model means training again. |
| Privacy and erasure | Delete a document, reindex, and it leaves future answers. | Absorbed into the weights. It cannot be reliably removed short of retraining without it. |
Two rows deserve a second look. Access control matters because enterprise search tools filter results per user. Microsoft's Azure AI Search, for example, documents security filters that trim results by user or group. A tuned model has no such switch.
Erasure matters because the law can demand it. Under Article 17 of the GDPR, a person can ask for their personal data to be erased without undue delay. Removing a document from an index is simple. Removing what a model learned is not.
Why is RAG preferred over fine-tuning?
RAG is preferred for most business assistants because most business questions are about facts. Prices, policies, contracts and product details all live in documents. They change, and people want to see where an answer came from. RAG handles all three.
AWS gives the same starting advice. For a system that answers questions from your own documents, its guidance recommends that you start from a RAG-based approach.
Research backs this up. Oded Ovadia and colleagues compared the two ways of adding knowledge. In their study, RAG consistently beat unsupervised fine-tuning, both for facts the model had seen before and for new ones. They also found models struggle to learn new facts through fine-tuning.
- It stays current. Change a document and reindex. No new training run.
- It shows its work. Each answer can link to the passage it used.
- It respects permissions. Each search can be limited to what that person may read.
- It keeps you free to switch models. The knowledge sits in your index, not in one model's weights.
- It forgets on request. Delete the source and it leaves future answers.
What are the limitations of RAG?
RAG is only as good as its search. If the right passage is not found, or is found but ranked low, the model answers from the wrong text. This is the most common failure we see.
Scott Barnett and colleagues studied RAG systems in research, education and medicine. Their report lists seven failure points. One finding stands out: you can only fully check a RAG system once it is in use. So plan to measure it after launch, not just before.
- Whole-document questions. AWS notes that RAG does not work well when summarising whole documents. Search returns pieces, not the full text.
- Long contexts. Nelson Liu and colleagues found models use information at the start or end of a long input best. Accuracy drops when the answer sits in the middle.
- Messy content. Old versions, duplicates and scanned files with no text all lower answer quality.
- Extra time per answer. The search step and longer prompts add delay.
- Owners needed. Someone must own the content and keep it correct.
None of these is a reason to fine-tune instead. They are reasons to build search with care. Our guide to enterprise RAG covers how to measure and fix retrieval.
Which is better? Seven questions that decide it
Choose RAG when answers must come from documents that change, when people need to see the source, or when different users may see different documents. Choose fine-tuning when the model must follow a fixed format, write in your style, or run small and fast on modest hardware. Many production systems use both.
Neither is better in general. Work through these questions in order.
- Does the answer depend on facts that are private, change often or must be cited? If yes, you need retrieval. Fine-tuning cannot keep pace with change, and it cannot show its sources.
- Do different people have different rights to see the information? If yes, that knowledge belongs in RAG, where each search is filtered for the person asking. Keep it out of the examples a model learns from.
- Is the problem how the model answers, not what it knows? A fixed report format, a house tone, a special vocabulary or a narrow sorting task all point to fine-tuning. Try prompting first.
- Can a clear prompt with a few examples already do the job? Test it. If it can, stop there.
- Is the knowledge small and stable enough to fit in the model's context? If so, consider loading it whole, the approach now called CAG, before building search.
- Do volume, speed or hardware limits force a small model? A small model tuned for one task can often do it well on far cheaper hardware. This is one of the best reasons to fine-tune.
- Who will look after it? A RAG system needs someone who owns the content. A tuned model needs someone who can rebuild it when the model it came from changes.
RAG vs fine-tuning vs prompt engineering
Prompt engineering is the first choice to test, and it often wins. Prompting means writing clear instructions and a few worked examples into the request. It costs almost nothing. It also shows how far the model can go before you spend on anything else.
The ladder has three rungs. Start with prompting, and build a test set of real questions with known good answers. Add RAG when the failures are about missing or out-of-date knowledge. Add fine-tuning when the failures are about behaviour that prompting cannot hold.
Behaviour failures look like this: formats that drift, the wrong tone, or a narrow task done in a different way each time. Each rung should be justified by measured failures on the rung below. So never skip the test set.
There are good reasons to skip a rung. Go straight to RAG when the knowledge is private and large, because no prompt can hold a whole document store. Skip RAG when the task needs no outside facts, such as sorting emails. Plan for fine-tuning early when the system must run on modest hardware inside your own network. There, a small tuned model may be the only practical choice. Our guide to self-hosted LLMs covers that case.
How to combine RAG and fine-tuning
The best production systems often use both. Fine-tune for behaviour and format. Use RAG for facts.
Take an insurer building an assistant for its claims team. Handlers want a draft decision letter in the house format and tone, citing the right clause. The policy wordings change every year. Every claim involves a different customer's file.
Fine-tuning teaches the model the letter: its layout, its phrasing, how reasons are given and how a decline is worded with care. RAG supplies the facts: the current policy wording, the customer's schedule and the claim file, filtered to what that handler may see. When the wording changes next year, the index updates. The model needs no new training.
A further step is to tune the model on examples that include retrieved passages, some useful and some not. Tianjun Zhang and colleagues at Berkeley call this RAFT. It trains the model to ignore unhelpful passages and to quote the right one. AWS points to the same work and calls the combination the best of both worlds.
RAG vs CAG
Cache-augmented generation (CAG) skips search altogether. The whole knowledge base is loaded into the model's context once. The model's working state for that text is cached, and every question reuses it.
The idea was set out in December 2024 in a paper by Brian Chan and colleagues, titled Don't Do RAG. For a limited, manageable knowledge base, they found CAG removes search delay and cuts search errors while keeping answers relevant.
CAG wins when the material is small and stable: a product manual, a policy handbook, one set of contracts. There is no search to tune and no chance of fetching the wrong passage.
RAG wins when the knowledge outgrows the context window, changes often or must be filtered per person. Everything loaded into a CAG system is visible to every user, so it shares the permissions problem of fine-tuning. Very long contexts also slow each answer and cost more to serve than a few retrieved passages.
Where MCP fits
MCP is not a third option in this contest. The Model Context Protocol is an open standard for connecting AI applications to outside systems: files, databases, tools and workflows. It governs how a model reaches information and takes action. It does not change what the model knows.
The pieces fit together well. A RAG search can be offered to a model as an MCP tool. Live facts that should never be indexed, such as an order's status this minute, are better fetched by a tool call. And a tuned model can be trained to use those tools well. Our post on MCP and AI agents goes further.
What is fine-tuning in machine learning?
In machine learning, fine-tuning is further training of a model that has already learned general patterns. You train it on a smaller set of examples from one task or field. The model keeps its broad skills and picks up a specific behaviour.
It is far cheaper than training from scratch, because the hard, general learning is already done. For language models, most fine-tuning now trains a small add-on rather than the whole model. Our LLM fine-tuning guide explains the methods.
Is fine-tuning still worth it?
Yes. What has been debunked is fine-tuning as a way to teach facts. Fine-tuning as a way to shape behaviour is very much alive.
Two studies make the point. The first, by Ovadia and colleagues, found RAG beat fine-tuning for adding knowledge, and that models struggle to learn new facts by tuning. The second, by Zorik Gekhman and colleagues, found models learn new facts through fine-tuning far more slowly than familiar ones.
Gekhman's team found something worse. As those new facts were finally learned, the model's tendency to hallucinate rose. Their reading is that models gain most of their knowledge in pre-training, and fine-tuning teaches them to use it better.
That is where fine-tuning still earns its place. Fixed formats, special tasks, house style and small models that do one job cheaply and fast, often inside a client's own network.
Cost
RAG is usually cheaper to start and cheaper to keep current. Fine-tuning can be cheaper to run at high volume.
| Cost line | RAG | Fine-tuning |
|---|---|---|
| Largest upfront cost | Connecting source systems, cleaning content and keeping permissions in step | Building and checking good examples |
| Compute | Indexing your documents, and the search service | Training runs. Often the smaller line with efficient methods |
| Per query | Longer prompts, because passages ride along with each question | Short prompts. A small tuned model can be cheap to serve |
| Keeping current | Cheap. Change a document and reindex | Another round of data, training and testing |
| When the model changes | Rerun your test set on the new model | Train again on the new model |
For RAG, the largest cost is rarely the AI. It is the plumbing: connecting systems, cleaning content and keeping access rules right. After launch, you pay per query for longer prompts and for search. Updates are cheap.
For fine-tuning, the largest cost is preparing good examples and testing the result. The hidden cost is repetition. Every change in the model, the task or the house style means another round.
At high volume the balance can shift. A small tuned model with a short prompt can serve a narrow task for much less than a large model reading passages on every call. Run the numbers on your expected volume, not on the pilot.
Common mistakes
- Fine-tuning to teach facts. This is the most costly mistake on the list. The model learns the facts poorly, cannot cite them, cannot forget them and may invent more freely. Put facts in retrieval.
- Blaming the model for poor search. Teams often swap the model when a RAG system answers badly. The usual cause is that search never found the right passage. Check search first: was the right passage returned, and how high did it rank?
- Training on data some users must not see. Once it is in the weights, any user can draw it out with the right question.
- Fine-tuning before trying a better prompt. Many behaviour problems vanish with a clearer instruction and three good examples.
- Measuring nothing. Without a fixed test set, every change is judged by whoever tried it last.
How Aptibit approaches the choice
Every engagement starts with the use case: what the system must do, what data it will use and how success will be measured. We show where generative AI pays off, and where a simpler approach is better.
When knowledge is the problem, we build assistants that answer from your own approved documents and show their sources. That is the core of our RAG development services. When behaviour is the problem, we compare leading open models for fit, speed, cost and licensing. Then we tune the best starting point on your material, through our LLM fine-tuning services.
When the system must act, we build an agent connected to your systems. It asks a person before high-impact actions and keeps a record of every action.
We test against your real tasks, not generic scores. Where privacy demands it, we run the whole system on your own servers, even with no internet link at all. You see working software every two weeks.
Cost depends on scope. We give you a clear estimate after a short discovery call. And if a better prompt solves the problem, we will tell you before you spend the budget.
Sources
- NIST CSRC Glossary, retrieval augmented generation
- NIST CSRC Glossary, fine-tuning
- Lewis et al. (2020), Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, arXiv 2005.11401
- AWS Prescriptive Guidance, Comparing Retrieval Augmented Generation and fine-tuning
- Ovadia et al. (2023), Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMs, arXiv 2312.05934
- Gekhman et al. (2024), Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations?, arXiv 2405.05904
- Chan et al. (2024), Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Tasks, arXiv 2412.15605
- Zhang et al. (2024), RAFT: Adapting Language Model to Domain Specific RAG, arXiv 2403.10131
- Barnett et al. (2024), Seven Failure Points When Engineering a Retrieval Augmented Generation System, arXiv 2401.05856
- Liu et al. (2023), Lost in the Middle: How Language Models Use Long Contexts, arXiv 2307.03172
- Model Context Protocol, What is the Model Context Protocol (MCP)?
- Microsoft Learn, Security filters for trimming results in Azure AI Search
- GDPR Article 17, Right to erasure
Questions
Which is better, fine-tuning or RAG?
Neither is better in general, because they solve different problems. RAG is better for knowledge that is private, changing or must be cited, and it can respect each user's permissions. Fine-tuning is better for shaping behaviour: format, tone and narrow tasks done the same way. For a system that answers from your documents, start with RAG. Add fine-tuning only for behaviour that prompting cannot fix.
When should you use RAG vs fine-tuning?
Use RAG when the answer depends on facts in your documents, especially facts that change, need a source or differ by user. Use fine-tuning when the model knows enough but answers the wrong way: the wrong format, tone or level of detail. Fine-tuning also fits when a small model must do one task cheaply and fast. Try a clear prompt before either.
Is fine-tuning debunked?
No. What research has undermined is fine-tuning as a way to add facts. One 2023 study found RAG beat fine-tuning for adding knowledge. A 2024 study found that teaching new facts by fine-tuning raised the model's tendency to hallucinate. Fine-tuning is still valuable for fixed formats, house style, special tasks and small models tuned to do one job well.
When to use RAG vs an LLM on its own?
RAG is not an alternative to a language model. It is a way of feeding one. Use a model on its own for general knowledge, drafting, and work on text the user pastes into the request. Add RAG when the answer lives in your own documents or changed after the model was trained. Add it too when a reader must be able to check the source.
What is the difference between RAG and CAG?
RAG searches your documents for each question and passes the best passages to the model. Cache-augmented generation (CAG) loads the whole knowledge base into the model's context once. It caches that and reuses it for every question, so there is no search step. CAG suits small, stable collections. RAG suits large or changing ones, and any case where users have different permissions.
Can you combine RAG and fine-tuning?
Yes, and many of the strongest systems do. Tune the model for behaviour, such as a fixed report format or a house tone. Use RAG to supply current facts at the moment of each question. A further step tunes the model on examples that include retrieved passages, some useful and some not. It learns to rely on the right ones.
How does MCP relate to RAG and fine-tuning?
The Model Context Protocol (MCP) is an open standard for connecting AI applications to tools and live systems. It is not a way of adding knowledge, so it works alongside both. A RAG search can be offered to a model as an MCP tool. Live data can be fetched through tool calls. A tuned model can be trained to use those tools well.
Is RAG cheaper than fine-tuning?
Usually cheaper to start and to keep current, but not always cheaper to run. RAG's main costs are connecting systems and preparing content, and updates are cheap. Fine-tuning costs centre on building examples, training and testing, repeated whenever the model changes. At high volume on a narrow task, a small tuned model with short prompts can cost less per query.
Does Aptibit build RAG systems and fine-tuned models?
Yes. Aptibit builds assistants that answer from your own approved documents and show their sources. We also tune leading open models on your material where that helps. Every engagement starts with the use case, and systems can run entirely on your own servers. Cost depends on scope. We give you a clear estimate after a short discovery call.











