The Short Answer: Knowledge Goes in RAG, Behaviour Goes in Fine-Tuning
Most teams reach this question right after they've picked a model and seen it fail on their own data. The answers are confidently wrong about your pricing, or correct but in a format nobody can use. Those are two different failures, and they have two different fixes.
If the model is missing information, give it the information when it answers. That's retrieval-augmented generation (RAG): search your own content for the passages relevant to each question and put them in the prompt. If the model has the information but handles it badly, change the model's behaviour. That's fine-tuning: train it further on examples of the output you want.
This article assumes you've already chosen a base model. If you haven't, our guide to choosing an AI model for production covers how to compare quality, latency and cost first, because the right model can remove the need for either technique.

What RAG Actually Does
RAG adds a search step in front of the model. The technique was described in a 2020 paper from Facebook AI Research, Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, which paired a language model with a searchable index of documents it consults while generating an answer. Production systems still follow the same basic shape.
- Your documents are split into chunks, converted into embeddings (numerical representations of meaning), and stored in an index, usually a vector database, often alongside a keyword index.
- When a user asks a question, the system searches that index for the most relevant chunks, and the user's access rights decide which chunks they're allowed to see.
- The best matches are placed in the prompt with an instruction to answer from them and cite them.
- The model writes the answer, and the application shows the sources it used.
The model itself never changes. Update a policy document and the next answer reflects it, with no retraining. That's why RAG suits support assistants, internal knowledge search and any AI chatbot that has to answer from content your team edits every week.
Where RAG goes wrong is retrieval, not generation. If the search step returns the wrong chunk, the model answers fluently from the wrong source. Most of the engineering effort in a serious RAG development project goes into chunking, hybrid search, reranking and testing whether the right passage actually came back.
What Fine-Tuning Actually Does
Fine-tuning continues a model's training on your own examples, usually pairs of an input and the ideal output. The model's weights shift so that it produces outputs like your examples without being told every time. It's the right tool when you can show the model what good looks like but struggle to describe it in a prompt.
Typical wins are consistent structured output, a house writing style, classification into your own categories, or a narrow task done thousands of times a day where a shorter prompt saves real money. Full fine-tuning updates every weight. Most teams now use parameter-efficient methods such as LoRA instead. The original LoRA paper reported cutting trainable parameters by 10,000 times and GPU memory by 3 times compared with fully fine-tuning GPT-3 175B, which is why fine-tuning open-weight models became practical for ordinary teams.
You don't need a huge dataset to find out whether it helps. OpenAI's supervised fine-tuning guide recommends starting with 50 well-crafted examples, and says that if 50 make no difference you should rethink the task or prompt before adding more. The training data matters far more than the volume, so most of the work is curating examples, not running training jobs. If you're weighing a fully custom model, our enterprise LLM development guide covers training pipelines, deployment and governance in depth.
Check your provider before planning fine-tuning
OpenAI's own documentation now says it is winding down its fine-tuning platform: it is no longer open to new users, and eligible existing customers can create training jobs until January 6, 2027. Fine-tuning remains available on other platforms, including Google's Vertex AI for Gemini models, Amazon Bedrock for selected models, and open-weight models you host yourself. Confirm current availability for your model before you commit to it.
Model and region support changes often, so check the live Vertex AI tuning documentation and Amazon Bedrock fine-tuning guide rather than relying on any list printed in an article, including this one.
RAG vs Fine-Tuning Side by Side
The table compares the two on the questions that usually decide a real project. Read it as a description of typical behaviour, not a guarantee; a well-built system of either kind can beat a poorly built one of the other.
How RAG and fine-tuning compare on the factors that usually decide a project
| Factor | RAG | Fine-tuning |
|---|---|---|
| What it changes | What the model sees at answer time | How the model behaves on every answer |
| Best at | Facts, documents, data that changes, answers with sources | Format, tone, style, narrow repeated tasks |
| Keeping content current | Update the index; no retraining | Retrain on new examples |
| Showing sources | Built in: it can cite the passages it used | Not available: knowledge is inside the weights |
| Access control | Can filter by each user's permissions at query time | Anything in training data may surface for any user |
| Main up-front work | Cleaning, chunking and indexing content; retrieval tuning | Curating and labelling a high-quality example set |
| Ongoing cost driver | Longer prompts per request, plus index hosting | Retraining and re-evaluating when the base model changes |
| Typical failure | Wrong or missing passage retrieved | Confident answers that drift from your facts |
Two rows decide more projects than the rest: access control and sources. If different users may only see different documents, or if answers must be traceable for compliance, RAG is close to mandatory. That's especially true in healthcare app development and fintech app development, where an answer often needs to show exactly which document it came from.
What the Research Says About Teaching Models New Facts
The most common mistake is fine-tuning a model on company documents and expecting it to know them. Two independent studies point the same way. In Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMs, researchers found that RAG consistently outperformed unsupervised fine-tuning, both for knowledge the model had seen before and for entirely new knowledge, and that models struggle to learn new facts this way.
A Google Research and Technion study, Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations?, found that models learn new-knowledge examples much more slowly than familiar ones, and that once learned, those examples increased the model's tendency to hallucinate. The authors conclude that models gain factual knowledge mainly in pre-training, and fine-tuning mostly teaches them to use what they already know.
The two techniques aren't rivals, though. A Microsoft case study on agriculture questions, RAG vs Fine-tuning: Pipelines, Tradeoffs, and a Case Study on Agriculture, reported an accuracy gain of over 6 percentage points from fine-tuning and a further gain of about 5 points when RAG was added on top. That's one domain and one study, so treat it as evidence that the gains can stack, not as a number to expect.
Check Whether You Need Either One
Before building retrieval or training data, test the cheapest option: put the knowledge straight into the prompt. Context windows are now large enough that small knowledge bases fit whole. Anthropic's guidance in its contextual retrieval write-up is that a knowledge base under about 200,000 tokens, roughly 500 pages, can simply be included in the prompt, with prompt caching keeping repeat requests faster and cheaper.
This works for a product manual, a single policy handbook or a fixed FAQ set. It stops working when the content grows past the window, changes per user, or makes every request slow and expensive. A short test with your real questions will tell you which side of that line you're on, and it's a sensible first step in any generative AI development project.
How to Decide: Six Questions to Ask First
Work through these in order. The first question that gets a clear yes usually points to the answer.
- Does all the knowledge fit in the prompt, and is it the same for every user? If yes, start with long-context prompting and caching.
- Do answers depend on information that changes weekly, or that the model has never seen? If yes, you need RAG.
- Must answers show their sources, or respect different users' permissions? If yes, you need RAG.
- Is the model getting the facts right but the format, tone or structure wrong, even with a well-written prompt? If yes, try fine-tuning.
- Are you running one narrow task at very high volume, where a shorter prompt or smaller model would cut costs? If yes, fine-tuning a smaller model is worth testing.
- Do you need current facts and a consistent output style together? Then plan for both, but build RAG first.
The table below applies those questions to common project types. It's an editorial starting point, not a rule; your evaluation results should have the final word.
Common LLM projects and the approach that usually fits
| Project | Usual starting point | Why |
|---|---|---|
| Customer support assistant over help-centre articles | RAG | Content changes often and answers should link to the article |
| Internal search across HR, IT and policy documents | RAG with permission filtering | Different staff may see different documents |
| Extracting fields from invoices into a fixed JSON schema | Fine-tuning, after prompting is tested | The knowledge is on the page; the problem is consistent structure |
| Ticket or email classification into your own categories | Fine-tuning a small model | Narrow, repetitive, high volume, and easy to collect labelled examples |
| Insurance or banking assistant quoting policy terms | RAG, possibly plus fine-tuning for tone | Terms must be current and traceable; tone can be trained later |
| Assistant answering from one 80-page product manual | Long-context prompting | Fits in the context window; retrieval adds complexity without benefit |
Insurance is a good example of the combined case. Our article on chatbots in insurance covers the claims and policy questions these assistants handle, and nearly all of them depend on current policy wording that only retrieval can keep accurate.
When to Use Both, and in What Order
Combining the two is the most common outcome for mature systems: fine-tune for behaviour, retrieve for facts. A support assistant might be fine-tuned to always answer in your brand voice and a fixed structure, while RAG supplies the current policy text it quotes. Each layer fixes the problem it's good at.

Build in this order. Start with prompting, add RAG and measure it, then fine-tune only if a behaviour gap remains that prompting can't close. If you fine-tune a model that will later use RAG, train it on examples that include retrieved passages, so it learns to answer from context rather than from memory.
The same thinking applies to agents. An agent that looks up live order data or edits records is doing retrieval through tools, and our explainer on MCP, A2A and the AI agent protocols shows how those connections are standardised. If your plan involves agents taking actions rather than only answering questions, scope it with an AI agent development team from the start, because permissions and failure handling change the architecture.
What Each Approach Costs to Build and Run
Neither approach has a standard price, because the cost depends on your data more than the technique. What you can predict is where the money goes. The table separates one-time work from recurring costs so you don't count the same effort twice.
Where the money goes in a RAG build versus a fine-tuning project
| Cost area | RAG | Fine-tuning |
|---|---|---|
| Data work (one-time) | Cleaning, deduplicating and chunking documents; mapping permissions | Writing or labelling input and output examples; reviewing quality |
| Build (one-time) | Ingestion pipeline, index, retrieval, reranking, source citations | Training runs, hyperparameter tests, comparison with the base model |
| Evaluation (one-time, then repeated) | Test set checking retrieval accuracy and answer accuracy | Test set checking output quality against the base model |
| Per request (recurring) | Extra input tokens for retrieved passages; search calls | Often fewer prompt tokens; hosting or a provider premium for the tuned model |
| Maintenance (recurring) | Keeping ingestion in sync with source systems; index hosting | Retraining when the base model is retired or the task changes |
The hidden cost of fine-tuning is base model retirement. When a provider retires the model you tuned, you rebuild and re-evaluate on a new one. RAG's hidden cost is data plumbing: connecting the index to CRMs, wikis and file stores, which is usually AI integration work rather than model work, plus ongoing data engineering and analytics to keep content clean.
For budget ranges across scopes, see our breakdown of AI development cost. Staffing matters as much as technique: RAG needs strong search and data engineers, and you can hire RAG developers for that work specifically, while fine-tuning needs people who can design training data and judge model output. If you'd rather add that skill to your own team, you can hire LLM developers with training and evaluation experience.
Security and Data Risks You Need to Plan For
Each approach has its own risk profile. With fine-tuning, anything in the training data can come back out in an answer, to any user. Never train on data that some users shouldn't see, and strip personal data from examples unless you have a clear legal basis to use it.
RAG's risks are listed in the OWASP Top 10 for LLM applications as LLM08:2025 Vector and Embedding Weaknesses. They include data leaking across users or tenants through weak access controls, poisoned documents carrying hidden instructions, and source text being recovered from embeddings. OWASP's recommended controls are permission-aware vector stores, validating what enters the knowledge base, and keeping detailed retrieval logs.
- Enforce the user's permissions at retrieval time, not in the prompt. A prompt instruction is not an access control.
- Partition indexes by tenant or sensitivity level when you serve more than one customer.
- Validate and sanitise documents on ingestion, including hidden text in PDFs and web pages.
- Log which passages were retrieved for each answer, so you can investigate a bad response.
- Have the index, storage and keys reviewed alongside the rest of your cloud security setup, not as a separate experiment.
A Practical Next Step
Collect 30 to 50 real questions or tasks with known good answers before you build anything. Run them against the base model with a good prompt, then with the relevant documents in context. The results will usually show whether your gap is knowledge or behaviour, and that one test settles most RAG vs fine-tuning debates faster than any architecture discussion.
If the results are mixed, or the project touches regulated data, an AI consulting review of the test set and architecture before the build is cheaper than discovering the wrong choice after launch.
