Choose between prompting, retrieval and parameter updates for knowledge-intensive applications.
This is one focused step in the 60-lesson course. Use the retrieval check before moving on.
Lesson goal
Choose between prompting, retrieval and parameter updates for knowledge-intensive applications.
The core idea
RAG puts relevant source material in the context at answer time. Training changes behaviour or representations across many examples. They solve different problems.
Mental model
Picture it this way. RAG puts relevant source material in the context at answer time. Training changes behaviour or representations across many examples. They solve different problems. The important question is what assumption this picture makes, and whether that assumption fits the data.
Mathematical core
A RAG system retrieves documents d given query q, builds context c = retrieve(q), then generates y from q and c. Its quality depends on retrieval, context use and citation checks.
Worked example
A policy assistant should retrieve the current policy version rather than fine-tune last year's text into the weights. Fine-tuning may still help it follow the desired response format.
When to use it
It earns a place when
Use retrieval for changing, private or citation-sensitive knowledge. Use fine-tuning for stable behaviour, style or task transformation.
You can evaluate it against a credible baseline.
Its output fits the decision and data constraints.
Do not make it the default when
Do not call a vector database a guarantee of grounding. Retrieved text can be irrelevant, incomplete, malicious or misread.
A simpler model has not been tested.
The data or target definition is still unclear.
Failure modes
Watch for this. Chunking, query formulation, stale indexes, lost-in-the-middle effects and unsupported synthesis can all break RAG.
When a result looks surprisingly good, inspect the split, target timing, error slices and data-generating process before celebrating.
Practice
Use this as a small experiment rather than a recipe to copy blindly. Change one thing, record the result and explain the change.
Do this. Build a ten-document retrieval test. Measure whether the right passage is retrieved, whether the answer is supported, and whether the system admits missing evidence.
Retrieval check
Answer from memory first. The buttons reveal feedback, but the durable step is explaining why.
1. What does RAG change at answer time?
2. Why use fine-tuning instead of retrieval for a style task?
3. What must a grounded answer pass?
Transfer prompt. Describe one real problem where this model or idea would be a sensible candidate. Name the target, the main risk and the metric you would inspect.
Primary source
Hugging Face LLM Course. Use the source for the deeper treatment after you can explain the lesson's core idea without looking.