Lesson 1.4 · 7 min read · about 50 min to master at a very slow pace

Prompting, RAG or Fine-tuning?

The three ways to adapt an LLM to a client's problem, what each one changes, and a simple decision rule: prompt first, add retrieval for knowledge, fine-tune only for behaviour you cannot prompt.

Not startedJump to quiz

Three levers

ApproachWhat it changesGood forCost to change
PromptingThe instructions and examplesFormat, tone, rules, simple tasksMinutes
RAGThe facts the model sees for each requestPrivate, large or changing knowledge; citationsUpdate the index
Fine-tuningThe model's weightsConsistent style or format at scale; narrow skills; smaller cheaper modelsNew dataset and training run

Knowledge versus behaviour

The most useful question is: is the model missing knowledge, or doing the wrong thing?

  • Missing knowledge (the client's policies, products, contracts, last week's prices): use RAG. Fine-tuning is a poor way to store facts: they are hard to update, cannot be cited, and the model still blends them with invented ones.
  • Wrong behaviour (wrong format, wrong tone, ignores a rule): fix the prompt first. If the prompt works but is huge, or a smaller model needs to copy a large model's behaviour, consider fine-tuning.

The default path

  1. Write the prompt and a small eval set (Section 5). Measure.
  2. If answers lack facts, add retrieval. Measure again.
  3. If behaviour is still inconsistent after real prompt work, collect a few hundred good examples and fine-tune. Measure again.

Three client requests

  • "Answer staff questions from our 2,000-page HR handbook, which changes monthly." → RAG: large, private, changing, needs citations.
  • "Turn sales call notes into our CRM format." → Prompting with structured output; fine-tune later only if volume makes a smaller model worth it.
  • "Write product descriptions exactly in our brand voice, 50,000 per month." → Prompt first; at that volume, fine-tuning a smaller model on approved examples can cut cost and improve consistency.

The common mistake

"We need to train the model on our documents" is usually a request for RAG, not fine-tuning. Clarify with the client what they want: answers grounded in their documents, with sources.

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

First passCan I combine RAG and fine-tuning?

Yes. A fine-tuned model can still receive retrieved documents. For example, you might fine-tune a small model to always answer in a strict citation format and use RAG to supply the facts. Start with one change at a time so your evals show which one helped.

Going deeperDoesn't a long-context model make RAG unnecessary for small document sets?

For a few dozen pages that rarely change, putting everything in the prompt (with prompt caching) can be simpler than building retrieval. Measure cost and accuracy. Once the documents grow, change often, or need access control per user, retrieval wins.

Cheatsheet

Prompting vs RAG vs fine-tuning

Prompting changes instructions; RAG changes the facts per request; fine-tuning changes the weights.

Knowledge or behaviour?

Missing facts → RAG. Wrong behaviour → better prompt, then fine-tuning only if prompting is not enough.

"Train it on our docs"

Usually means RAG: grounded answers with sources. Fine-tuning is a poor way to store changing facts.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1applyA law firm wants answers from its 30,000 internal memos, updated weekly, with sources. Which approach fits?
Q2conceptWhich problem is fine-tuning best suited to?
Q3diagnoseA client says: "Your bot keeps giving the old refund policy. Can you retrain it?" The bot uses RAG. What should you check first?
Q4conceptWhat is the recommended order for adapting an LLM to a new task?
Q5interpretAfter careful prompting, a large model writes perfect product descriptions, but at 50,000 a month it is too expensive. What does this suggest?