Skip to content

Prompting vs fine-tuning vs RAG

A decision guide: which lever changes behaviour, which one adds knowledge, and what each one costs.

7 MIN READUPDATED 2026-11-18Models & foundations
ORIGINAL DIAGRAM · 4 STEPS1Write a baseline prompt2Add retrieved context if3Add few-shot examples if4Fine-tune only when pro…

Original flow diagram from note steps — not a copied image

§ 01Key concepts
PromptingInstructions and examples supplied at inference time; fastest to change.
Fine-tuningUpdating model weights on your data to change style, format or specialised behaviour.
RAGRetrieving external knowledge and placing it in the prompt before generation.
GroundingTying claims in an answer to supplied sources.
§ 02When to use
  • Answers need facts that change often → prefer RAG.
  • Output format, tone or domain phrasing must be consistent → consider fine-tuning.
  • The task is new or unclear → start with prompting and evaluation.
§ 03How it works
  1. 01Write a baseline prompt and a small evaluation set.
  2. 02Add retrieved context if answers lack facts or citations.
  3. 03Add few-shot examples if the format is inconsistent.
  4. 04Fine-tune only when prompt and RAG cannot reach the required behaviour.
§ 04Use cases & scenarios

Policy assistant with weekly changes

Context
A support assistant answers questions about a returns policy that changes every week.
Problem
Fine-tuned answers sound confident but go stale after each policy update.
Approach
Retrieve the current versioned policy with RAG and instruct the model to cite it.
Outcome
Answers track the latest policy with traceable sources.

Strict JSON for a ticketing system

Context
A support agent must hand structured data to a ticketing system.
Problem
The model wraps the JSON in prose or changes field names.
Approach
Start with a few-shot prompt and a schema; fine-tune only if format still drifts on the golden set.
Outcome
Machine-readable output without an unnecessary training cycle.
§ 05Examples

Choose a lever for a support assistant

yaml
support_assistant:
  policy_changes_weekly: rag        # return current rules with citations
  strict_json_output: prompt        # few-shot + schema in the prompt
  domain_phrasing: fine_tune        # stable tone, not new facts
  unknown_task: prompt_first        # baseline + golden set before spending

Name the failure first: missing knowledge points to RAG, inconsistent behaviour points to prompting or fine-tuning.

Compare levers on one golden set

text
case 42: "What is the return window for a leased device?"
  prompt_only       -> wrong (stale fact in the prompt)
  prompt + RAG      -> correct, cites policy-v3
  prompt + finetune -> fluent, still wrong (no new facts)

Run every candidate through the same labelled cases. Fine-tuning changes behaviour, not knowledge.

§ 06Trade-offs

Prompting

Up: Cheap, instant iteration

Down: Limited by context length and model instructions

RAG

Up: Fresh, source-grounded knowledge

Down: Retrieval errors become answer errors

Fine-tuning

Up: Stable specialised behaviour

Down: Data prep, training and evaluation overhead

§ 07Implementation checklist
  • Define the failure you are trying to fix before choosing a lever.
  • Keep a golden evaluation set for every change.
  • Combine RAG and fine-tuning when both knowledge and behaviour matter.
  • Re-evaluate after any model upgrade.
§ 08Configuration reference
KeyTypical valueNote
retrieval_top_k5–10Only for the RAG path.
few_shot_count2–5Diminishing returns beyond this.
eval_set_size50+Enough cases to detect regressions.
§ 09Troubleshooting
SymptomCauseFix
Fine-tuned model still hallucinatesFine-tuning does not add factsUse retrieval for knowledge.
RAG answers ignore sourcesWeak instruction or poor retrievalStrengthen grounding prompt and rerank.
§ 10Frequently asked questions

Can I fine-tune instead of RAG?

Only if the knowledge is static and behaviour—not freshness—is the problem. RAG is better for changing documents.

Do these approaches conflict?

No. Most production systems use prompt + RAG, and add fine-tuning for consistent format or domain style.

More in Models & foundations