| Prompting | Instructions and examples supplied at inference time; fastest to change. |
| Fine-tuning | Updating model weights on your data to change style, format or specialised behaviour. |
| RAG | Retrieving external knowledge and placing it in the prompt before generation. |
| Grounding | Tying claims in an answer to supplied sources. |
- 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.
- 01Write a baseline prompt and a small evaluation set.
- 02Add retrieved context if answers lack facts or citations.
- 03Add few-shot examples if the format is inconsistent.
- 04Fine-tune only when prompt and RAG cannot reach the required behaviour.
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.
Choose a lever for a support assistant
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 spendingName the failure first: missing knowledge points to RAG, inconsistent behaviour points to prompting or fine-tuning.
Compare levers on one golden set
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.
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
| Option | Upside | Cost |
|---|---|---|
| Prompting | Cheap, instant iteration | Limited by context length and model instructions |
| RAG | Fresh, source-grounded knowledge | Retrieval errors become answer errors |
| Fine-tuning | Stable specialised behaviour | Data prep, training and evaluation overhead |
- 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.
| Key | Typical value | Note |
|---|---|---|
| retrieval_top_k | 5–10 | Only for the RAG path. |
| few_shot_count | 2–5 | Diminishing returns beyond this. |
| eval_set_size | 50+ | Enough cases to detect regressions. |
| Symptom | Cause | Fix |
|---|---|---|
| Fine-tuned model still hallucinates | Fine-tuning does not add facts | Use retrieval for knowledge. |
| RAG answers ignore sources | Weak instruction or poor retrieval | Strengthen grounding prompt and rerank. |
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
Language models: tokens, context and inference
The mental model behind an LLM call: tokenisation, context windows, sampling controls and why outputs are probabilistic.
Embeddings and vector search
How text becomes vectors, what similarity actually means, and when a vector index is the right tool.
Model selection: capability, cost and latency
A practical framework for choosing a model per task instead of defaulting to the largest one.