Prompting vs RAG vs Fine-Tuning
A decision framework for picking the cheapest technique that solves the problem, and recognizing when fine-tuning actually pays off.
Intermediate · about 2 hours · difficulty 2/5
Learn first: RAG Fundamentals, Why and How to Evaluate LLM Apps
Fine-tuning is often the first idea and rarely the right first step. The three main levers solve different problems.
What each lever changes
- Prompting changes instructions and examples at request time. Fast to iterate, zero training cost. Try this first, always.
- RAG gives the model knowledge it does not have: your documents, fresh data, per-user content. Knowledge changes daily; retrieval handles that, training does not.
- Fine-tuning changes behaviour: a consistent format or style, a narrow classification task, domain jargon, or making a small model perform like a large one on one task.
Good reasons to fine-tune
- You have a well-defined, high-volume task and want lower cost and latency with a smaller model.
- Prompts have become huge because of many examples, and you want that behaviour baked in.
- You need a style or format that prompting cannot make reliable.
- You must run a model on-premise or on-device and it needs a boost on your task.
Bad reasons
- "The model does not know our product" (use RAG).
- You have no eval set, so you cannot tell whether training helped.
- You have fewer than a few hundred good examples and have not tried few-shot prompting.
Costs to remember
Data collection and cleaning, training runs, hosting a custom model, re-training when base models improve, and losing easy access to newer base models.
Good enough to move on
Given a product problem, you can argue which lever to use first, what evidence would justify fine-tuning, and how you would measure success.
Key concepts
- Knowledge vs behaviour problems
- Prompting first
- When RAG is the answer
- Cost and latency motivations
- Hidden costs of custom models
Mini project
Write a one-page decision memo for three scenarios (a support bot over changing docs, a high-volume ticket classifier, and a brand voice writer) recommending prompting, RAG or fine-tuning with the evidence you would collect.
Check yourself
Why is fine-tuning a poor way to teach a model your company's latest pricing?
Free resources
- OpenAI docs: model optimization (OpenAI)
- Hugging Face LLM Course (Hugging Face)