Course contents · Lesson 12 of 15

Fine-Tuning vs RAG vs Prompting: Which One When?

Retrieval-Augmented Generation · Lesson 12 of 15 · 7 min Foundations

Your team wants an assistant that answers customer questions about your return policy, in your brand's friendly voice. One colleague says "we need to fine-tune a model", another says "just use RAG", and a third says "write a better prompt". The debate usually gets framed as fine-tuning vs RAG, but prompting is the third option, and often the right one to try first. This lesson shows what each one changes and how to choose.

The picture below shows the three options as three ways of briefing that new hire. The sections after it take them one at a time.

Three cards: a sticky note reading 'Reply in 3 bullets' pinned to a request for prompting, a person handed an open manual for RAG, and a person in a graduation cap with a stack of example cards for fine-tuning
The same new hire, three ways: a note changes one request, a manual changes what they read, and a course changes the person.

Prompting: tell it each time

Prompting means putting your instructions, context and examples into the request itself, as in Prompt Engineering Basics. Nothing about the model changes; only the text you send does. It is the cheapest and quickest option: you edit a few words, and the very next request uses them.

Its limits come from the context window. Everything the model needs must fit into every request, and with hosted models you pay for those tokens every time. A prompt also cannot add facts the model lacks unless you paste them in yourself, which is a hand-made version of RAG.

RAG: hand over the manual

With RAG, software looks up the relevant passages in your documents at question time and adds them to the prompt. It fits best when the knowledge is private, too large to paste in, or changes often: policies, product catalogues, support articles and prices.

Updating is easy: change the document and index it again, and the next answer uses the new version. Answers can point to their sources, and the search can respect who is allowed to see what. The cost is a pipeline to build and run, with chunking, embeddings and a vector database, and answers are only as good as the passages the search finds.

Fine-tuning: send them on a course

Fine-tuning continues the training of an existing model on your own examples, often hundreds to thousands of pairs of "this input should get this output". It is the learning loop from How Does Machine Learning Work?, so the model's weights really change. Afterwards the new behaviour is built in, without long instructions in every request.

It is best for behaviour: a steady tone or house style, a strict output format, or a narrow skill such as sorting support tickets into your own 40 categories. It can sometimes let a smaller, cheaper model do one narrow job about as well as a larger model with a long prompt.

It is weaker for teaching facts. A model may absorb some facts from the examples, but unreliably; it cannot tell you where it learned them; and every change means preparing data and training again. It also needs good examples and a model you are allowed to fine-tune: either a hosted model whose provider offers it, or an open-weight model, one whose weights are published for anyone to download.

Which one first? Combine and compare

A simple order works for most projects. Start with a better prompt. If answers are missing facts, add RAG. If the style or format is still wrong after good prompts with examples, consider fine-tuning. Check each step on a handful of real questions before you move on to the next.

Flowchart: not getting what you need, then improve the prompt; if facts are missing, add RAG and check again; if style or format is still off, consider fine-tuning; otherwise it is good enough, keep testing
Each step fixes a different gap: the prompt sets the task, RAG supplies missing facts, and fine-tuning is kept for behaviour that prompting cannot pin down.

They are not rivals. Every RAG system still sends a prompt, and a fine-tuned model can still use RAG. A support assistant might be fine-tuned to write in the brand's voice, receive passages from the current return policy for its facts, and get a prompt that sets the task.

Table comparing prompting, RAG and fine-tuning on what changes, setup effort, running cost, updating, showing sources and what each is best for
From left to right, setup gets heavier and updates get slower, so each step should earn its place by fixing something the earlier ones could not.

The table also shows why the order matters for cost. A prompt costs almost nothing to set up, apart from your time writing it. RAG adds a search and longer prompts to every request. Fine-tuning adds a training bill and data work before you see any result, and the work comes back each time you want to change its behaviour.

Check yourself

Your product prices change every week. Would you fine-tune a model or use RAG?

RAG: you update the price list and index it again, with no retraining, and the answer can cite the current list.

After careful prompting with examples, replies still drift from your strict format across thousands of requests. What next?

Consider fine-tuning on examples of the correct format, because this is a behaviour problem rather than a missing-facts problem.

Can a fine-tuned model also use RAG?

Yes. Fine-tuning shapes how the model behaves, while RAG supplies current facts in each prompt, so the two work together.