RAG or fine-tuning? Choosing the right method for enterprise knowledge needs
Short answer: If the model needs to answer on the basis of an organisation's current documents, the right method is RAG (retrieval-augmented generation). If the model needs to produce consistent output in a particular format, in a particular tone or in the language of a narrow domain, fine-tuning comes into consideration. Most organisations start with prompt and context design and then add RAG; fine-tuning is the last step, reserved for format and behaviour problems that these two cannot solve.
“Let's train the model on our own data” is a sentence heard very often in enterprise AI projects. Most of the time what is actually meant is not training but having the model answer from the organisation's documents. Confusing these two needs leads to unnecessary cost and to knowledge going out of date. In this article we separate the three methods and show which problem each one solves.
Three methods, three different jobs
Prompt and context design. This means steering the model's behaviour through the system prompt, examples and the context provided, without touching its weights. It is the fastest and cheapest method; it is the starting point of every project.
RAG (Retrieval-Augmented Generation). When a question arrives, the relevant document passages are first retrieved from the organisation's knowledge base and the model generates its answer based on those passages. The knowledge lives in the documents rather than inside the model; when a document changes, only the knowledge base is updated.
Fine-tuning. The model's weights go through additional training on the organisation's example data. In enterprise use today this is mostly done with parameter-efficient methods such as LoRA and QLoRA: the model's base weights are frozen while small adapter matrices added to the existing layers are trained.
Which method for which need?
| Need | Right method | Why |
|---|---|---|
| Accurate answers to questions on current procedures, regulations and policies | RAG | The knowledge stays in the document and is reindexed when it changes |
| Showing the source document and page in the answer | RAG | The retrieved passage comes with its source |
| Answers drawn only from documents the user is authorised to see | RAG with permission-aware retrieval | Permissions are applied at query time |
| Output with the same structure every time (for example JSON with specific fields) | Prompting and structured output first, fine-tuning if that is not enough | Format is behaviour, not knowledge |
| A particular correspondence style or reporting language | Prompting, fine-tuning if that is not enough | A behaviour taught through examples |
| Dense terminology of a narrow domain | RAG with an organisational glossary, fine-tuning if needed | Term definitions can be kept in documents |
| Repetitive narrow tasks such as classification or routing | Fine-tuning | A small model can become consistent and fast at this job |
| New events the model does not know about | RAG | Fine-tuning does not reliably add new knowledge |
Why do organisations usually start with RAG?
Enterprise knowledge changes constantly. When a procedure is updated, RAG indexes the new document and uses it from the very next question. Knowledge taught through fine-tuning, by contrast, stays out of date until the model is retrained.
The second reason is verifiability. A RAG answer can show which document it is based on; users and auditors can open the source and check it. Knowledge learned through fine-tuning is spread across the model's weights and its source cannot be shown.
The third reason is permissions and data protection. In RAG, deleting a document from the knowledge base stops that information from being used in answers. Information that enters training data, however, remains in the model; research shows that language models can memorise part of their training data and that this data can be extracted. Fine-tuning on records containing personal data therefore calls for a separate risk assessment; reliably removing a piece of information from a model after the fact is still not a solved problem.
When does fine-tuning really pay off?
Fine-tuning is not a bad method; it only becomes expensive when it is used for the wrong job. It creates value in the following situations:
- When the model does not consistently follow a particular format despite examples given in the prompt.
- When a small model is expected to match the quality of a large model on a narrow and repetitive task; this reduces both latency and hardware requirements.
- When the organisation's correspondence style or report structure is highly distinctive and too detailed to convey through prompting.
The costs of fine-tuning should also be understood from the outset: preparing clean and representative training data takes time; training may need to be repeated with each new base model version; fine-tuning for a narrow task can reduce the model's ability on other tasks; fine-tuning an aligned model can also weaken its safety behaviour. That is why both task performance and safety behaviour are tested again after fine-tuning.
A recommended decision sequence
- Start with prompt and context. Clarify the system prompt, the examples and the output format.
- Build an evaluation set. Prepare a test set made up of the organisation's real questions and the answers expected. Without this set you cannot measure which method works.
- Add RAG. Chunk the documents, index them with an embedding model, generate answers with citations; apply permission rules at query time.
- Separate the errors. Do the remaining errors come from missing knowledge (wrong or incomplete retrieval) or from behaviour (format, tone, task consistency)? Knowledge errors are fixed on the retrieval side.
- If a behaviour problem remains, fine-tune. Start with LoRA or QLoRA and measure against the evaluation set before and after.
In many enterprise systems the outcome is to use both together: a fine-tuned model for format and task, RAG for knowledge.
Frequently asked questions
Does fine-tuning reduce hallucination?
Do our documents go into the model with RAG?
How much data does fine-tuning need?
Can a model that runs inside the organisation be fine-tuned?
Is RAG still needed now that there are models with long context windows?
Related glossary terms
RAG, Fine-tuning, LoRA, QLoRA, Parameter-efficient fine-tuning, Context engineering, System prompt, Structured output, Permission-aware retrieval, Grounding, Hallucination, Catastrophic forgetting, AI memorisation, Machine unlearning
Sources
- Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, 2020
- Hu et al., LoRA: Low-Rank Adaptation of Large Language Models, 2021
- Dettmers et al., QLoRA: Efficient Finetuning of Quantized LLMs, 2023
- Carlini et al., Quantifying Memorization Across Neural Language Models, 2022
- Qi et al., Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!, 2023
- Kirkpatrick et al., Overcoming catastrophic forgetting in neural networks, 2016
- Yao, Xu and Liu, Large Language Model Unlearning, 2023
- Liu et al., Lost in the Middle: How Language Models Use Long Contexts, 2023
Want to build a system that gives accurate answers from your organisation's documents?
Tell us which documents and which questions you will be working with; let's work together on the evaluation set, the retrieval architecture and any fine-tuning plan that may be needed.
Request a technical assessment →