Prompting vs RAG vs fine-tuning
Three ways to make a model do what you need, what problem each solves, and how to choose between them.
On this page
When a general-purpose model doesn't do exactly what your product needs, you have three main levers: prompting, retrieval-augmented generation (RAG) and fine-tuning. They solve different problems, and confusing them is a common interview mistake.
Why interviewers ask this
"What's the difference between RAG and fine-tuning?" and "Our model doesn't know our product. Should we fine-tune it?" test technical judgement. Interviewers want to see that you match the technique to the problem (knowledge vs. behaviour), start simple, consider cost and maintenance, and measure the results with evals.
The framework
Prompting: shaping behaviour with instructions
Clear instructions, examples (few-shot), output formats, role and tone in the system prompt.
- Good for: task definition, tone, format, rules, quick iteration.
- Pros: fastest, cheapest, easiest to change.
- Limits: can't add knowledge the model doesn't have; long prompts add cost and latency.
RAG: adding knowledge at query time
Retrieve relevant documents (from a search index or vector database) for each question, and put them in the prompt as context.
- Good for: private, proprietary or frequently changing knowledge (product docs, policies, customer data); citations.
- Pros: knowledge stays current (update documents, not the model); answers can cite sources; access control per user is possible.
- Limits: quality depends on retrieval: if the right chunk isn't found, the answer suffers. It needs a pipeline (chunking, indexing, ranking) and maintenance.
Fine-tuning: changing the model's behaviour through training
Train the model on many examples of input–output pairs.
- Good for: consistent style or format at scale, specialised tasks where prompting plateaus, and reducing prompt length and latency for high-volume tasks. Sometimes a smaller fine-tuned model can replace a bigger one for a narrow task.
- Pros: consistent behaviour; can be cheaper per call at scale.
- Limits: needs high-quality labelled data (hundreds to thousands of examples); slower to iterate; doesn't reliably teach facts that change; must be redone as base models improve.
Rule of thumb
- Missing knowledge? → RAG.
- Wrong behaviour, format or tone? → Prompting first, fine-tuning if prompting plateaus at scale.
- Often: combine them. A well-prompted model with RAG covers most product needs. Fine-tuning comes later, if ever.
How to decide
- Define the problem precisely: knowledge gap or behaviour gap?
- Start with prompting and measure with evals.
- Add RAG if the model lacks information.
- Consider fine-tuning only if evals show a persistent behaviour gap, you have quality data, and the volume justifies it.
- Compare cost, latency, quality and maintenance for each option.
Worked example
Question: "We're building a support assistant for our SaaS product. The base model gives generic answers and doesn't know our features. Should we fine-tune it?"
Sample answer:
"Probably not as a first step. The problem described is a knowledge gap: the model doesn't know our product. That's what RAG is for.
Why RAG first: our help docs and release notes change every week. With RAG, we update the documents and the assistant knows immediately; with fine-tuning, we'd have to retrain to keep up, and fine-tuning isn't reliable for teaching facts anyway. RAG also gives us citations, which build trust and let us measure groundedness.
Plan:
- Prompting: a system prompt defining scope, tone, citation format, and the rule to answer only from the provided context or escalate.
- RAG: chunk help articles by section, index them, and retrieve the top five chunks per question. Measure retrieval quality separately: does the right article appear in the top five for our eval questions?
- Evals: 300 real support questions with expert answers, measuring correctness, groundedness and correct escalation.
When I'd consider fine-tuning: if, after good prompting and retrieval, we still see behaviour issues at scale, such as inconsistent formatting, failing to follow our escalation style, or if we have huge volume and want a smaller, cheaper model to match a larger one's quality. We'd have training data by then: thousands of resolved conversations rated by support agents.
So: prompt + RAG now, evals throughout, and fine-tuning as an optimisation later if the data justifies it."
Common mistakes
- Fine-tuning to add knowledge, especially changing knowledge.
- Skipping prompting and jumping to complex solutions.
- Ignoring retrieval quality in RAG systems.
- No evals to compare approaches.
- Forgetting maintenance: fine-tuned models need retraining; RAG indexes need updating.
Interviewer tips
What "great" sounds like:
- "Is this a knowledge problem or a behaviour problem? That decides the tool."
- "RAG keeps knowledge current and gives us citations."
- "I'd measure retrieval quality separately from answer quality."
- "Fine-tuning is an optimisation once we have data and scale, not a starting point."
- "I'd compare all options on the same eval set, plus cost and latency."
Practice questions
Answer one in a mock interview and get graded instantly.
1.Our support assistant gives generic answers and doesn't know our product. Should we fine-tune it?
Practice this →2.Explain the difference between RAG and fine-tuning to a non-technical executive.
Practice this →3.When would fine-tuning be worth the cost for an AI product?
Practice this →
Finished reading?
