Loading…
Loading…
RAG vs fine-tuning, decided: what each changes, cost, freshness, permissions and privacy, how to combine them, and where prompting, CAG and MCP fit in.
RAG changes what the model reads. Fine-tuning changes how the model behaves. Most confusion ends once you separate the two.
Use RAG for facts: anything private, changing or in need of a source. Use fine-tuning for behaviour: format, tone, or a narrow task done the same way every time.
Fine-tuning is a poor way to teach new facts. Research from Microsoft and Google found models learn them slowly this way, and that doing so can increase hallucination.
Permissions decide many projects. RAG can filter what each person sees at search time. A fine-tuned model knows the same things for every user.
Climb the ladder in order: prompting, then RAG, then fine-tuning. Skip a rung only for a clear reason.
The strongest systems often combine both. For a small, stable knowledge base, cache augmented generation (CAG) can beat retrieval altogether.
Search for RAG vs fine tuning and the first page belongs mostly to platform vendors: IBM, Red Hat, Databricks, AWS, Cohere and Google Cloud, with a practitioner thread on Reddit in the middle. Most define both terms well.
The harder part is the decision. In our experience, the questions that decide real projects rarely come first: who is allowed to see which answer, what happens when the base model is retired, whether a model can be made to forget something, and the research showing that fine-tuning is a poor way to teach facts.
At Aptibit, we build both kinds of system, so we have no reason to favour either. This guide is about choosing. Our separate guide to LLM fine-tuning covers how fine-tuning works in detail.
RAG vs fine-tuning is the choice between two ways of adapting a large language model to your organisation. Retrieval augmented generation (RAG) leaves the model unchanged and supplies relevant passages from your own documents each time a question is asked. Fine-tuning trains the model further on your examples, permanently changing how it responds.
NIST defines RAG as a generative AI system in which a model is paired with a separate retrieval system, which finds relevant information in a knowledge base and hands it to the model in context. The technique was named in a 2020 paper by Patrick Lewis and colleagues, who showed that models drawing on retrieved passages wrote more specific and factual answers than models relying on their training alone.
NIST defines fine-tuning as a training step that starts from a pretrained model and adds task or domain specific information. The model's internal weights change. Whatever it learns travels with it into every answer, whether or not it is relevant.
A simple way to hold the difference: RAG is an open book exam, and fine-tuning is the months of practice before it. Practice shapes how you write. The open book supplies the facts.
Eleven dimensions decide most projects. Each follows from one distinction: RAG changes what the model reads, and fine-tuning changes the model.
What it changes. RAG changes the input: the model sees your passages alongside each question. Fine-tuning changes the model itself, so the effect applies to every answer it gives.
Freshness of knowledge. RAG is as current as your index. AWS notes that a RAG system can take in new documents within minutes, while a fine-tuning run takes hours to days. A fine-tuned model knows only what was true on the day its training data was frozen.
Citing sources. RAG can show the passage behind each claim, so a reader can check it. A fine-tuned model cannot point to where it learned something, a limitation AWS's guidance also records.
Hallucination control. RAG grounds answers in retrieved text, and the model can be told to decline when that text does not answer the question. It still fails when search returns the wrong passage. Fine-tuning on unfamiliar facts can make invention worse.
Data needed. RAG needs your documents, current and tidy, together with their access rules. Fine-tuning needs curated examples of inputs paired with ideal outputs, and the quality of those examples matters far more than their number.
Upfront cost. RAG spends on connecting systems, preparing content and building search. Fine-tuning spends on assembling examples, training and evaluation. In both, data work is usually the largest part.
Running cost. RAG adds retrieved passages to every prompt, so each query uses more tokens, and the search service has its own cost. A fine-tuned model can work from short prompts, and a small tuned model can be far cheaper to serve than a large general one.
Latency. RAG adds a search step before the model starts writing, and longer prompts take longer to process. A fine-tuned model answers directly, and a small one answers faster still.
Access control. RAG can limit each search to what the person asking may see, which is how existing document permissions survive. A fine-tuned model knows the same things for every user. If one person must not learn something, it cannot be in the training data.
Maintenance when the base model changes. With RAG, you swap in a new model and rerun your test set. A fine-tune is tied to the exact base model it was trained on. When that model is retired or surpassed, you train again.
Privacy. With RAG, deleting a document and reindexing removes it from future answers. Data used for fine-tuning is absorbed into the weights and cannot be reliably removed short of retraining without it. That matters wherever people have a legal right to erasure.
Neither is better in general. RAG is better for supplying knowledge, and fine-tuning for shaping behaviour. AWS gives the same starting advice: for a system that answers questions from your own documents, begin with RAG. Then work through these questions.
1. 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.
2. Do different people have different rights to see the information? If yes, that knowledge belongs in RAG, where each search can be filtered for the person asking, and never in training data.
3. Is the problem how the model answers rather than what it knows? A fixed report format, a house tone, a specialised vocabulary or a narrow classification done the same way every time all point to fine-tuning, but only after prompting has been tried.
4. Can a well written prompt with a few examples already do the job? Test it first. If it can, stop there.
5. 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 a search system.
6. 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 strongest reasons to fine-tune.
7. Who will maintain it? A RAG system needs someone who owns the content. A fine-tuned model needs someone who can rebuild it when the base model changes.
Prompt engineering vs fine-tuning is the first decision, and prompting usually wins it. Prompting means writing clear instructions and a few worked examples into the request. It costs almost nothing and shows how far the base model can go.
The sensible 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 outdated knowledge. Add fine-tuning when the failures are about behaviour that prompting cannot hold: drifting formats, the wrong tone, or a narrow task done inconsistently. 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 document store. Skip RAG entirely when the task needs no outside knowledge, such as sorting emails or extracting fields from forms. Plan for fine-tuning early when the system must run on modest hardware inside your own network, where a small tuned model may be the only practical option.
The best production systems often use both. Fine-tune for behaviour and format. Use RAG for facts.
Consider an insurer building an assistant for its claims team. Handlers want a draft decision letter in the company's format and tone, with the right clause referenced. The policy wordings change every year, and every claim involves a different customer's documents.
Fine-tuning teaches the model the letter: its structure, 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 retraining.
A further refinement is to fine-tune the model on examples that include retrieved passages, some relevant and some not, so it learns to rely on the right ones and ignore distractions. AWS's guidance recommends combining the two in this way, describing the result as the best of both worlds.
Cache augmented generation (CAG) skips retrieval 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 approach was set out in a December 2024 paper titled Don't Do RAG. Its authors found that for a limited, manageable knowledge base, CAG matched or beat RAG while removing retrieval delays and reducing retrieval errors.
CAG wins when the material is small and stable: a product manual, a policy handbook, a single set of contracts. There is no search step 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 preloaded 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 handful of retrieved passages.
MCP is not a third contestant. The Model Context Protocol is an open standard for connecting a model to tools and live systems: databases, ticketing, CRMs and file stores. It governs how a model reaches information and takes action, not what the model knows.
The pieces fit together naturally. 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 through a tool call than copied into a search index. And a fine-tuned model can be trained to use those tools well.
A simple rule: RAG for what your documents say, MCP for what your systems know right now, and fine-tuning for how the model behaves.
Fine-tuning is very much alive. What has been debunked is fine-tuning as a way to teach facts.
Two studies make the point. In 2023, Microsoft researchers compared the two methods on knowledge tasks. RAG consistently outperformed unsupervised fine-tuning, both for knowledge the model had met before and for entirely new knowledge, and the models struggled to learn new facts through fine-tuning. In 2024, researchers from Google Research and the Technion found that models learn new facts through fine-tuning far more slowly than familiar ones, and that as those facts are learned, the tendency to hallucinate rises.
The second study's conclusion matters: models acquire most of their factual knowledge in pretraining, and fine-tuning teaches them to use it more efficiently. That is exactly where fine-tuning still earns its place: consistent formats, specialised tasks, house style, and small models tuned to do one job cheaply and quickly, often inside a client's own network.
RAG is usually cheaper to start and cheaper to keep current. Fine-tuning can be cheaper to run at high volume.
For RAG, the largest cost is rarely the AI. It is connecting source systems, cleaning content and keeping permissions in step. After launch, you pay per query for longer prompts and for search infrastructure. Updates are cheap: change a document, and reindex it.
For fine-tuning, the largest cost is preparing good examples and evaluating the result. Training compute is often the smaller line, especially with efficient methods that train only a small set of added weights. The hidden cost is repetition. Every change in the base model, the task or the house style means another round of data, training and testing.
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 retrieved passages on every call. Run the numbers on your expected volume, not on the pilot.
Fine-tuning to teach facts. This is the most expensive mistake on the list. The model learns the facts poorly, cannot cite them, cannot forget them, and may invent more freely as a result. Put facts in retrieval.
Blaming the model for poor retrieval. Teams often swap the model or reach for fine-tuning when a RAG system answers poorly. The usual cause is that search never found the right passage. Check retrieval first: was the correct passage returned, and how high did it rank? Our guide to enterprise search with RAG covers how to fix it.
Training on data that 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 disappear with a clearer instruction and three good examples.
Measuring nothing. Without a fixed test set, every change is judged by whoever tried it last.
At Aptibit, every engagement starts with a use case assessment: 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. An assistant of this kind typically takes 4 to 8 weeks to build. When behaviour is the problem, we compare leading open models for fit, speed, cost and licensing, then fine-tune the best starting point on your material. A focused fine-tune typically takes 2 to 3 weeks. When the system must act, we build an agent connected to your systems, with confirmation before high impact actions and 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 infrastructure, even fully air-gapped. You see working software every two weeks, and code, models, data pipelines and documentation belong to you under an IP assignment signed before work begins.
RAG earns its place wherever answers depend on private, changing or sensitive knowledge: policies, contracts, product detail and support content. It keeps answers current, cites its sources, respects each person's permissions and lets you change models freely. Fine-tuning earns its place where behaviour matters more than knowledge: fixed formats, house style, specialised classification and extraction, and small models that must run fast and cheaply, often on your own hardware.
RAG disappoints when retrieval is poor or content is messy and unowned, on questions that need a summary of whole documents or many documents at once, and when every answer must arrive almost instantly. Fine-tuning disappoints when it is used to teach facts, when knowledge changes often, when different users may see different things, when nobody can rebuild it after the base model changes, and when the training data may one day have to be erased.
Neither is better in general, because they solve different problems. RAG is better for supplying 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 consistently. For a system that answers questions from your documents, start with RAG and add fine-tuning only for behaviour that prompting cannot fix.
Use RAG when the answer depends on facts held in your documents, especially facts that change, need a source or differ by user. Use fine-tuning when the model knows enough but answers in the wrong way, such as the wrong format, tone or level of detail, or when a small model must do one task cheaply and fast. Try a well written prompt before either.
No. What research has undermined is fine-tuning as a way to add facts. A 2023 study by Microsoft researchers found RAG consistently beat fine-tuning for injecting knowledge, and a 2024 study from Google Research and the Technion found that teaching new facts through fine-tuning raised hallucination. Fine-tuning remains valuable for consistent formats, house style, specialised tasks and small models tuned to do one job efficiently.
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 supplies in the request. Add RAG when the answer lives in your own documents, changes after the model was trained, or must come with a source that a reader can check.
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, caches it and reuses it for every question, so there is no search step. CAG suits small, stable collections. RAG suits large or changing collections, and any case where users have different permissions.
Yes, and many of the strongest systems do. Fine-tune the model for behaviour, such as a fixed report format or a house tone, and use RAG to supply current facts at the moment of each question. A further refinement trains the model on examples that include retrieved passages, some relevant and some not, so it learns to rely on the right ones and ignore the rest.
The Model Context Protocol (MCP) is an open standard for connecting a model to tools and live systems. It is not a way of adding knowledge, so it complements both techniques. A RAG search can be offered to a model as an MCP tool, live data can be fetched through tool calls, and a fine-tuned model can be trained to use those tools well.
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 preparing examples, training and evaluation, repeated whenever the base model changes. At high volume on a narrow task, a small fine-tuned model with short prompts can cost less per query than RAG on a large model.
Yes. Aptibit builds assistants that answer from your own approved documents and show their sources, typically in 4 to 8 weeks, and fine-tunes leading open models on your material where it helps, with a focused fine-tune typically taking 2 to 3 weeks. Every engagement starts with a use case assessment, and systems can run entirely on your own infrastructure.