fine tuning vs rag

Fine-Tuning vs RAG vs Prompting: How to Choose

Table of Contents

Short answer. The choice in fine tuning vs RAG vs prompting depends on why your answers fail. Start with a prompt and a test set of 20 or more questions with expected answers. If the model lacks facts, add them: paste a small, stable source into the prompt, use retrieval (RAG) for large or changing documents, and call an API for live records. If it has the facts but keeps getting format, tone or labels wrong, test fine-tuning, starting at about 50 good examples (OpenAI’s guidance; Google’s says 100 or more). Check availability first: OpenAI ends new self-serve fine-tuning jobs for every organization on December 15, 2026.

Written by the AgileFever editorial team. Facts checked on November 26, 2026 against the official pages of the organizations named in this post. AgileFever sells training for some of the topics covered here, and we say so wherever it applies. Technical facts come from OpenAI, Anthropic, Google Cloud, AWS, Microsoft and OWASP documentation.

Most fine tuning vs RAG debates start with the technique. Start with ten wrong answers instead. Read each one and ask: did the model lack the information, or did it have it and behave badly? OpenAI’s accuracy guide, checked November 26, 2026, calls these in-context and learned memory problems. It also warns that the three methods are not a ladder you climb in order, because each fixes a different fault.

What each method changes

Prompting changes the instructions and examples you send. Retrieval augmented generation (RAG) searches your documents at question time and adds the best passages to the request. Fine-tuning trains further on your examples and changes the model’s weights. Microsoft’s Foundry documentation says that training does not replace retrieval for current information.

Prompting now often includes everything else in the request, such as tool results and history. Our post on prompt engineering vs context engineering covers that side.

Fine tuning vs RAG vs prompting: comparison table

Question Prompting RAG Fine-tuning
Data you need Instructions, a few examples, a test set Clean documents with owners and dates, plus test questions mapped to the right source Labelled input and output pairs that match production, plus a held-out set
Cost drivers Input and output tokens; long prompts repeat on each call Embedding, index storage, search, retrieved tokens, pipeline upkeep Training tokens and epochs, model storage or hosting, retraining
Latency Grows with prompt length; caching can cut it Adds a search step before generation Can shorten prompts, which may lower latency
Freshness As fresh as the text you paste As fresh as your last index update Frozen at training time
Control Edit and roll back in minutes Choose sources, filter by permission, show citations Stronger hold on format and style; harder to inspect or undo one learned habit
What to evaluate Pass rate per test case Retrieval hit rate and answer grounding, scored separately Fine-tuned against baseline on held-out cases
Typical failure Instructions ignored on unusual inputs Wrong or noisy passages retrieved Overfits; learns your examples’ mistakes

Cost and latency rows follow AWS Bedrock model customization pages, Microsoft Foundry training documentation and Anthropic prompt caching documentation. The rest is our working guidance.

The decision flowchart

Use this fine tuning vs RAG flowchart once for each group of failed answers.

Decision flowchart: prompting, tool call, RAG or fine-tuning
Test set of 20+ realquestions with answers?NoBuild it firstYesDoes a clear prompt withexamples hit your target?YesShip promptingNoFailing on a live record(order, balance, ticket)?YesTool or API callNoFailing on missing or olddocuments? Small, stable set?YesPut it in the promptNoMissing or old documents,large, changing or restricted?YesUse RAGNoRight facts, wrong format,tone or label, again and again?YesTest fine-tuningNoFix instructions, split the task or try another model.Then run the same test set again.

Our decision rule, built on the failure diagnosis in OpenAI’s accuracy guide. More than one box can apply: handle each group of failures separately.

The first box matters most. Without expected answers you cannot tell whether a change helped. OpenAI’s guide treats a good prompt plus 20 or more questions with ground truth as the baseline to reach before anything advanced. To grow that set, see how to evaluate an LLM application.

When fine tuning beats RAG, with published numbers

OpenAI’s guide includes a test on correcting Icelandic sentences, scored with BLEU, a text-similarity score out of 100. The task needed a learned skill, not new facts. Fine-tuning won, and adding retrieval on top made the result worse.

BLEU score by method, Icelandic sentence correction

Higher is better. Older models, one task.

GPT-4, no examples62
GPT-4, 3 examples in the prompt70
GPT-3.5 Turbo fine-tuned on 1,000 examples78
GPT-4 fine-tuned on 1,000 examples87
GPT-4 fine-tuned, plus RAG83

Source: OpenAI, Optimizing LLM Accuracy guide, checked November 26, 2026. The models are older ones; read the chart for the pattern, not as a current benchmark.

In company work, fine tuning vs RAG often goes the other way. A policy question fails because the model never saw the policy. No amount of training on writing style supplies a clause that changed last week.

When RAG wins, and when you can skip it

RAG earns its effort when the source is too large to send each time, changes often, differs by user permission, or must be cited. It also brings a new thing to tune: search. As a starting point, OpenAI’s retrieval guide says its vector stores split files into 800-token chunks with a 400-token overlap by default.

Search quality can move a lot. Anthropic’s contextual retrieval article (September 2024) measured how often the right passage was missing from the top 20 results across its test datasets.

Retrieval failure rate in the top 20 chunks

Lower is better.

Standard embeddings5.7%
Contextual embeddings3.7%
Plus contextual keyword search (BM25)2.9%
Plus reranking1.9%

Source: Anthropic, Contextual Retrieval, checked November 26, 2026. Your documents will give different figures.

Worked example: paste the handbook or retrieve from it (illustrative)

The same Anthropic article suggests that a knowledge base under 200,000 tokens, about 500 pages, can go straight into the prompt. Take a 120-page handbook at 400 tokens a page: 48,000 tokens. Compare it with sending five 800-token passages, or 4,000 tokens, over 1,000 questions. Question and answer tokens are left out.

Approach Document tokens per question Per 1,000 questions Billed like this many ordinary input tokens
Whole handbook, no caching 48,000 48 million 48 million
Whole handbook, every call after the first read from cache 48,000 48 million About 4.9 million
Five retrieved passages 4,000 4 million 4 million, plus indexing and search

Illustrative example. The cached row uses Anthropic’s standard multipliers, checked November 26, 2026: cache reads at 0.1 times the input price and one 5-minute cache write at 1.25 times (some models read cheaper). 999 reads x 4,800 plus one write of 60,000.

Caching nearly closes the token gap, with no pipeline to build. It holds only while calls arrive often enough to keep the cache alive: the default lifetime is 5 minutes, refreshed on use, with a 1-hour option at a higher write rate. Long prompts have a quality cost too. Anthropic’s context window documentation says accuracy and recall degrade as token count grows, so test the full-document version before choosing it.

What you can still fine-tune today

Many comparison guides assume every provider will train a model for you. Check the current status before you plan, because it changed this year.

Provider Status on November 26, 2026 What to do
OpenAI Closed to organizations with no earlier jobs since May 7, 2026; since July 2, also to those with no fine-tuned inference in 60 days. No new self-serve jobs for anyone from December 15, 2026 (moved up from January 6, 2027). Do not start a new project here. Existing models run until their base model is retired. Dates: OpenAI’s deprecations page.
Anthropic The Claude API does not offer fine-tuning. Use prompting, caching and retrieval, or ask your Anthropic contact.
Google No tunable model in the Gemini API or AI Studio. Gemini Enterprise Agent Platform lists supervised tuning, including Gemini 3.8 Flash, 3.5 Flash and 3.1 Flash-Lite. Choose a 3.x model. The tuning list still shows 2.5 models, whose listed retirement date was October 20, 2026.
AWS Bedrock The fine-tuning table still lists Claude 3 Haiku and Llama models that are end-of-life or Legacy. Legacy models accept no new jobs. Look at Amazon Nova 2 Lite, Micro, Lite or Pro, and read the model card before uploading data.
Microsoft Foundry Training documentation lists OpenAI and open-weight models. Training and deployment retire on separate dates: for gpt-4.1-mini, deployment retires October 14, 2027, and training no earlier than April 14, 2027 for existing customers. Note both dates in the project plan.
AWS Bedrock fine-tuning table: status of its 15 listed models

Our count, matching AWS’s fine-tuning table against its model lifecycle and model card pages, November 26, 2026. Claude 3 Haiku is counted by its status in US West (Oregon), the listed tuning region.

  • End-of-life: 6
  • Legacy, no new jobs: 3
  • Active Nova text models: 4
  • Titan image and embedding models: 2
Plan an exit before you train. A fine-tuned model is tied to a base model with a retirement date. Keep the training file, the test set and the baseline scores in your own storage so you can repeat the work elsewhere.

Open-weight models you host are another route, using methods such as LoRA. You then own the serving, patching and capacity work.

How to combine prompting, RAG and fine-tuning

The fine tuning vs RAG question often ends with both. They fix different faults, so they can stack. Add one layer at a time and keep it only if the test score improves.

Combination Use it when Watch for
Prompt plus RAG Answers depend on documents that change Tell the model to cite the passage and to say when nothing relevant was found
Prompt plus tool calls Answers depend on live records or actions Permissions and approval for actions that change data
Fine-tuning plus RAG Facts change, and answers must follow a strict style or reasoning pattern Train on examples that include retrieved passages, as OpenAI’s guide advises
Retrieved examples in the prompt Different inputs need different examples Examples that are similar in wording but wrong in label
Distillation A large model works but a smaller one is needed for volume or speed Provider terms, and a quality drop on rare cases

Neither retrieval nor training is a security control. OWASP’s prompt injection entry says research shows RAG and fine-tuning do not fully mitigate those attacks, and a retrieved document can carry hostile instructions. See prompt injection and guardrails.

Four illustrative use cases, decided

Use case (illustrative) Main failure in testing Decision Evidence that would change it
HR policy assistant, 120 pages, updated quarterly Quotes policies it never saw Whole handbook in a cached prompt, with section citations Many more documents, per-country access rules or sparse traffic: move to RAG
Support ticket router with 30 fixed labels Confuses similar labels despite clear definitions Improve definitions and examples; then test fine-tuning on a few hundred labelled tickets Labels change monthly: stay with prompting plus retrieved examples
Order status chatbot Invents delivery dates Tool call to the order system; prompt controls the wording Questions about return policy appear: add that document to the prompt
Engineering search across thousands of manuals Misses error codes and cites old versions RAG with keyword plus embedding search, version filters and reranking Right passage retrieved but answer format still wrong: tune the prompt, then consider fine-tuning

The router shows the fine tuning vs RAG split cleanly. Labels are a behaviour to learn, and the data already exists in closed tickets. Check those labels first. A model trained on inconsistent routing repeats it.

Pilot checklist

Settle fine tuning vs RAG with evidence from your own data. A small pilot is enough.

Run the pilot in this order
1
Write the target
State the pass rate you need and what a wrong answer costs. Name who signs off.
2
Build the test set
Use 20 or more real questions with expected answers. Include unanswerable and hostile ones. Hold some back.
3
Score a prompt baseline
Record pass rate, tokens per call and response time on the same cases.
4
Label each failure
Missing fact, live record, wrong behaviour or bad retrieval. Count each group.
5
Change one thing
Fix the largest group. Re-run every case, including ones that passed before.
6
Check the lifecycle
Note the model’s retirement date, the fine-tuning cutoff if any, and the data residency rules.
7
Decide
Keep the layer only if the gain covers its upkeep. Name an owner for index updates or retraining.
Who should not fine-tune yet. Skip it if your examples disagree with each other, if the failures come from missing facts, if nobody will retrain the model later, or if a prompt already meets the target.

Mistakes to avoid

These errors turn a fine tuning vs RAG choice into rework.

Mistake Better move
Training a model to remember prices or policies Retrieve them or call the system that holds them
Building a vector database for 30 pages Paste the pages and test; add retrieval when size or access rules demand it
Judging RAG only by the final answer Check first whether the right passage was retrieved
Adding training examples when 50 good ones changed nothing Rethink the task or prompt first, as OpenAI’s fine-tuning guide advises
Copying a provider’s tuning list without checking dates Open the model’s lifecycle page on the same day
Comparing methods on different test questions Freeze one set and run every option against it

Learning to build all three

For self-study, follow free LLM courses in 2026 and, if code is new to you, the Python for AI roadmap. For exam options, read our LLM certification guide.

We sell the Gen AI BootCamp, so weigh this section with that in mind. As listed on November 26, 2026, it is 72 hours of live training over 9 weeks, with separate modules on prompt engineering, RAG and fine-tuning. Its projects include a RAG chatbot with a vector database and LangChain, and a support ticket classifier fine-tuned on an open-source model, with LoRA, QLoRA and PEFT covered. The page says basic Python knowledge can be beneficial. See it for current schedules. If your team only needs to write better prompts, a bootcamp is more than you need.

Questions people ask

Is RAG better than fine-tuning?

Neither is better in general. RAG supplies facts at question time, so it suits changing or private documents and answers that need citations. Fine-tuning changes behaviour, so it suits consistent format, tone or classification. Diagnose your failed answers first, then pick the method that addresses the larger group.

Can I use RAG and fine-tuning together?

Yes. Use retrieval for the facts and a tuned model for the way answers are written or reasoned. Train on examples that contain retrieved passages, so training matches production. Test the combination against each method alone: in OpenAI’s Icelandic example, adding RAG lowered the fine-tuned score from 87 to 83.

How many examples do I need to fine-tune a model?

It depends on the task. OpenAI’s guide gives 10 as its minimum and suggests starting with 50 well-made examples. Google’s tuning documentation points to 100 or more, and to hundreds or thousands for supervised tuning. Quality and similarity to production inputs matter more than raw count.

Does fine-tuning stop hallucinations?

No. Training can make behaviour more consistent, but it does not supply current facts, and a tuned model can still state wrong ones. Give the model the source, ask it to cite it, allow it to say it does not know, and score grounding on your test set.

Do long context windows make RAG unnecessary?

For a small, stable source, often yes: send it whole and cache it. Retrieval still helps when documents are large, change often or have access limits. Anthropic’s documentation also warns that accuracy and recall degrade as the context grows, so measure before deciding.

Can I still fine-tune OpenAI models?

Only some existing users, and only briefly. As checked on November 26, 2026, new self-serve training jobs end for every organization on December 15, 2026. Models you have already tuned keep running until OpenAI retires the base model underneath them.

Contact Us

    By checking the box, you consent to receive registrations, class reminders, updates, support text messages from AgileFever at the provided number. Message and data rates may apply. Message frequency varies (typically 1–2 msgs/week). To end messaging from us, you may always reply with STOP. You may also reply with HELP for more information. Check Privacy Policy and Terms & Conditions.