Introduction
Every team building on large language models reaches the same fork. The model is capable, but it does not know your products, your policies, or your customers, and it does not always answer the way you need. Two techniques come up straight away: retrieval-augmented generation (RAG) and fine-tuning.
They are often presented as rivals. In practice, they solve different problems. RAG changes what the model knows at the moment it answers. Fine-tuning changes how the model behaves every time it answers. Choosing the wrong one costs months: teams fine-tune a model to teach it facts that go stale in a week, or build a retrieval pipeline to fix a formatting problem that a few hundred training examples would solve.
This guide is for CTOs, product leads, and engineering teams deciding how to customize an LLM for a real product. It explains what each technique changes, compares them side by side, summarizes what the research shows, and gives a decision guide by use case, with realistic effort estimates. It closes with the process we use at iTech Soft Solutions on our own AI products and client projects.
The Short Answer
- Use RAG when the problem is knowledge. The model needs facts it was never trained on, facts that change, or facts that differ by user and permission level.
- Use fine-tuning when the problem is behavior. The model needs a consistent format, tone, classification scheme, or narrow skill that prompting alone cannot hold reliably.
- Use both when you need both. A support assistant that must answer from today's policies and always respond in a strict structure is a RAG system with a fine-tuned model inside it.
- Try prompting first. A clear system prompt with good examples solves more problems than either technique, at a fraction of the cost. Our prompt engineering guide covers how.
What RAG Changes, and What It Doesn't
Retrieval-augmented generation adds a search step before the model answers. The user's question is used to find relevant passages in your own content (documents, tickets, product data, policies), and those passages are placed in the prompt alongside the question. The model then answers from that context.
What RAG changes:
- Knowledge. The model can use information it never saw in training, including content written this morning.
- Freshness. Update the source documents and the next answer reflects the change. There is no retraining.
- Permissions. Retrieval can filter by user, team, or tenant, so each person only gets answers from content they are allowed to see.
- Traceability. Answers can cite the passages they came from, so users and auditors can check them.
What RAG does not change:
- The model's style, format, or reasoning habits. If the base model rambles, it rambles with better facts.
- Weak retrieval. If search returns the wrong passages, the model answers confidently from the wrong context. Most RAG failures are retrieval failures.
Our RAG development guide covers architecture, vector databases, and advanced retrieval techniques in depth.
What Fine-Tuning Changes, and What It Doesn't
Fine-tuning continues training a model on your own examples, so its weights shift toward the behavior those examples show. There are three common methods:
- Supervised fine-tuning. You provide input and ideal-output pairs, and the model learns to produce outputs like them.
- Preference fine-tuning. You provide pairs of a better and a worse answer, and the model learns to prefer the better one. Direct Preference Optimization (DPO) is a common form.
- Reinforcement fine-tuning. A grader scores the model's answers during training, and the model learns to maximize the score. It suits tasks where correctness can be checked, such as extraction or classification against a known answer.
Fine-tuning can update all of a model's weights or only a small set of added parameters. Parameter-efficient methods such as LoRA make this far cheaper: the original LoRA paper (Hu et al., 2021) reports that, compared with full fine-tuning of GPT-3 175B, it "can reduce the number of trainable parameters by 10,000 times and the GPU memory requirement by 3 times."
What fine-tuning changes:
- Format and structure. Outputs that always follow your schema, template, or field order.
- Tone and voice. Consistent brand language across thousands of responses.
- Narrow skills. Classification against your categories, extraction from your document types, routing, and domain shorthand.
- Prompt length and cost. Behavior that once needed long instructions and many examples in every prompt can be trained in, which shortens prompts and can allow a smaller, cheaper model.
What fine-tuning does not change well:
- Facts. Fine-tuning is an unreliable way to teach a model new information (see the research below), and every update to those facts means another training run.
- Permissions. A fine-tuned model has no concept of who is asking. Anything in the training data can surface for any user.
- Traceability. The model cannot point to where a trained-in fact came from.
Where You Can Fine-Tune Today
Fine-tuning options depend on the provider and model, and they change often:
- OpenAI's API documents supervised, DPO, and reinforcement fine-tuning methods.
- Amazon Bedrock's documentation history records reinforcement fine-tuning added in December 2025, and reinforcement fine-tuning for open-weight models through OpenAI-compatible APIs in February 2026.
- Google Vertex AI offers supervised fine-tuning for Gemini models.
- Open-weight models can be fine-tuned on your own infrastructure, which keeps training data in-house.
Not every model can be fine-tuned, and the list of tunable models changes. Check the provider's current documentation before you plan around a specific one.

RAG vs Fine-Tuning Side by Side
| Factor | RAG | Fine-tuning |
|---|---|---|
| What it changes | What the model knows when it answers | How the model behaves on every answer |
| Best for | Facts, documents, changing data, per-user content | Format, tone, classification, narrow skills |
| Keeping it current | Update the documents; no retraining | Retrain when behavior or data changes |
| Per-user permissions | Yes, enforced at retrieval | No; training data is visible to every user |
| Citations | Yes, from retrieved passages | No |
| Upfront effort | Ingestion, chunking, search, evaluation | Collecting and cleaning training examples, training runs, evaluation |
| Running cost | Search infrastructure plus longer prompts | Hosting or premium pricing for the tuned model; shorter prompts |
| Main failure mode | Wrong passages retrieved | Overfitting, or forgetting general ability |
| Model portability | High; swap the model and keep the pipeline | Low; tuning is tied to one base model |
The last row matters more than it looks. Model releases arrive every few months. A RAG pipeline usually moves to a new model with a configuration change and a re-run of your evaluations. A fine-tuned model has to be tuned again on the new base, if the new model supports tuning at all.
What the Research Says
Two studies are useful for this decision.
RAG is better for injecting knowledge. In Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMs (Ovadia et al., 2023), the authors compared unsupervised fine-tuning with RAG for teaching models facts. Their conclusion: "RAG consistently outperforms it, both for existing knowledge encountered during training and entirely new knowledge." They also found that models struggle to learn new facts through fine-tuning, and that showing many variations of the same fact during training may help.
Combining them can beat either alone. RAFT: Adapting Language Model to Domain Specific RAG (Zhang et al., 2024) fine-tunes a model specifically for answering from retrieved documents. Training examples include distractor passages, and, in the authors' words, "we train the model to ignore those documents that don't help in answering the question." The model also learns to quote the passage that supports its answer. The authors report consistent gains over baselines on PubMed, HotpotQA, and Gorilla datasets.
Both papers point the same way: retrieval supplies knowledge, and fine-tuning teaches the model how to use it.
A Decision Guide by Use Case
| Use case | Start with | Why |
|---|---|---|
| Internal knowledge assistant (policies, wikis, SOPs) | RAG | Content changes and access differs by team |
| Customer support answers | RAG, then fine-tune for tone if needed | Answers must match current policy and cite it |
| Structured extraction from invoices, contracts, or forms | Fine-tuning (or strong prompting first) | The task is a fixed format applied to many documents |
| Ticket or lead classification | Fine-tuning | A narrow, repeatable skill against your own categories |
| Brand-voice content drafting | Fine-tuning | Tone and structure, not facts |
| Product or pricing Q&A | RAG | Prices and specs change; answers must be current |
| Legal or compliance research | RAG with citations | Every claim must trace to a source |
| Domain assistant answering from manuals in a strict format | Both | Facts from retrieval, format from tuning |
| Code assistant for an internal codebase | RAG | The codebase changes daily |
| High-volume, low-latency task on a small model | Fine-tuning | Trains in behavior so a smaller model can do the job |
When to Combine Them
Combine the two when you have both a knowledge problem and a behavior problem, and only after each has been measured on its own. Common patterns:
- A tuned generator over retrieval. RAG supplies the facts; a fine-tuned model formats the answer, follows the house style, or produces a strict schema. This is the RAFT idea applied to production.
- A tuned retriever or reranker. Fine-tune the embedding or reranking model on your own queries and documents, so search understands your terminology. This often improves answers more than tuning the generator.
- Tuned helper models. Small fine-tuned models handle routing, query rewriting, or classification around a general model that does the main answering.
Agents follow the same logic. An agent that calls tools and reads data through retrieval or an MCP server gets its knowledge from those systems, not its weights. Our AI agents development guide covers how to design those systems.
Cost and Effort: What to Expect
These are iTech's planning estimates from delivery experience, not quotes. They assume reasonably clean source data and an existing product to integrate with. We express effort in engineer-weeks so you can apply your own rates.
| Approach | What is included | Typical timeline | Indicative effort |
|---|---|---|---|
| Prompting with examples | System prompt, examples, evaluation set | Days to 2 weeks | Under 2 engineer-weeks |
| Production RAG | Ingestion, chunking, hybrid search, permissions, citations, evaluation | 4 to 10 weeks | 6 to 16 engineer-weeks |
| Fine-tuning on a hosted model | Data collection and cleaning, training runs, evaluation, deployment | 3 to 8 weeks | 4 to 12 engineer-weeks |
| Combined system | Production RAG plus a tuned generator or reranker | 8 to 16 weeks | 12 to 26 engineer-weeks |
Two costs are easy to miss:
- Data preparation. For fine-tuning, collecting and cleaning a few hundred to a few thousand high-quality examples is usually the largest task. For RAG, cleaning and structuring source documents plays the same role.
- Evaluation. Neither approach can be judged by trying a few questions. You need a test set built from real user requests, scored before and after every change. Budget for it from the start.
Running costs differ in shape. RAG adds search infrastructure and longer prompts on every call. Fine-tuned models may carry higher per-token pricing or hosting costs, but can shorten prompts and sometimes let you move to a smaller model. Which is cheaper depends on your traffic, so model it with your own volumes. Our LLM integration guide covers the wider cost picture.
Data, Privacy, and Compliance
The two approaches handle sensitive data very differently, and this often decides the question.
- RAG keeps data where it is. Documents stay in your store, retrieval enforces access rules, and removing a document removes it from future answers.
- Fine-tuning bakes data into the model. Personal or confidential data in training examples can resurface in outputs for any user. Removing it means retraining. Strip or mask personal data from training sets.
- Hosted tuning sends data to a provider. Check where training data and the tuned model are stored, and what the provider's retention terms are. Open-weight models tuned on your own infrastructure avoid this.
Local rules apply too. For Malaysian businesses, the Personal Data Protection Act and its 2024 amendments shape how training data and retrieved content must be handled. Our AI development team in Malaysia designs for those requirements from the start.
How We Decide on Client Projects
This is the process we follow on our own AI products and client work:
- Collect real requests. Gather 50 to 200 real or realistic user requests, with what a good answer looks like for each. This becomes the evaluation set.
- Baseline with prompting. Write a strong system prompt with examples and measure it against the set. Many projects stop here.
- Diagnose the failures. Sort the failed cases. Wrong or missing facts point to RAG. Right facts in the wrong format, tone, or category point to fine-tuning.
- Fix the bigger problem first. Usually that is knowledge, so we build retrieval first and measure again.
- Fine-tune only on a measured gap. If a specific behavior still fails after prompting and retrieval, we collect examples of that behavior and tune for it, then measure again.
- Keep evaluating. Every model upgrade, prompt change, or new document set is re-scored against the same test set before release.
The point of this order is that every step is justified by numbers, not by which technique sounds more advanced.
Common Mistakes
- Fine-tuning to teach facts. The model learns facts unreliably, cannot cite them, and needs retraining whenever they change.
- Building RAG to fix a behavior problem. Better context will not make a model follow a strict format if the base model resists it.
- Skipping the evaluation set. Without one, you cannot tell whether a change helped.
- Blaming the model for retrieval failures. When RAG answers are wrong, check what was retrieved before changing anything else.
- Training on unrepresentative examples. A fine-tuned model copies its training data, including its mistakes and gaps.
- Ignoring model upgrades. A tuned model can fall behind a newer base model that would have done the job with prompting alone.
- Putting personal data in training sets. It can resurface for the wrong user, and removing it means retraining.
Frequently Asked Questions
Is RAG better than fine-tuning? Neither is better in general. RAG is better for giving a model knowledge, especially knowledge that changes or differs by user. Fine-tuning is better for making a model behave consistently, such as following a format, tone, or classification scheme. Many production systems use both.
Can fine-tuning teach a model new facts? Only unreliably. Research comparing the two, such as Ovadia et al. (2023), found that RAG consistently outperformed unsupervised fine-tuning for injecting knowledge, including entirely new facts. Fine-tuned facts also cannot be cited and go stale until you retrain.
Is fine-tuning cheaper than RAG? It depends on volume. Fine-tuning has upfront data and training costs, and tuned models may cost more per token or need dedicated hosting. RAG adds search infrastructure and longer prompts on every request. Fine-tuning can reduce prompt length or allow a smaller model, which helps at high volume. Model both with your own traffic.
Do we need a vector database for RAG? Usually, but not always. Most production RAG systems use vector search, often combined with keyword search. Small or highly structured knowledge bases can work with keyword search or direct database queries. We choose the store to fit your data.
How much data do we need to fine-tune? It depends on the task and method, but quality matters more than quantity. A few hundred clean, representative examples can shift format or tone. Harder skills need more. Start small, measure against an evaluation set, and add data where the model still fails.
Can we use RAG and fine-tuning together? Yes. A common pattern is a RAG pipeline that supplies the facts, with a fine-tuned model that answers in your required format or style. You can also fine-tune the retrieval components, such as an embedding model or reranker, so search understands your terminology.
Which is better for data privacy? RAG generally gives more control. Data stays in your own store, access rules apply at retrieval time, and deleting a document removes it from future answers. Data used for fine-tuning becomes part of the model and can resurface for any user, so it should be cleaned of personal and confidential information first.
Final Thoughts
RAG and fine-tuning are not competing answers to one question. RAG decides what the model knows. Fine-tuning decides how it behaves. Most teams should start with prompting and a solid evaluation set, add retrieval when the failures are about knowledge, and fine-tune only when a specific behavior still falls short after that.
The teams that get this right are the ones that measure. A test set built from real user requests turns the choice from an opinion into a number, and keeps it honest as models change.
If you are deciding how to customize an LLM for your product, iTech Soft Solutions can help you choose, build, and evaluate the right approach. Our LLM integration services cover prompting, retrieval, fine-tuning, and evaluation, and our RAG systems team builds production retrieval pipelines. Contact our team to talk through your use case.



