Draft & Co LearnCourse home
Lesson 08 · 17 minutes

Data, RAG and fine-tuning

Use retrieval to ground answers in selected sources, and understand when fine-tuning solves a different problem.

01

Start with source quality

An AI system cannot reliably distinguish a trustworthy source from a poor one just because both are in a folder. Build a source collection deliberately: choose authoritative documents, remove duplicates, record owners and dates, and mark superseded versions. Split documents into passages that retain enough surrounding meaning to be understood. Keep titles and source references attached to each passage. Decide who may add, change or remove content. If two policies disagree, retrieval needs a rule for currency and authority rather than an average of both. Good source governance often improves an answer system more than changing the model, and it gives reviewers a practical way to investigate mistakes.

02

RAG finds material before answering

Retrieval-augmented generation, or RAG, retrieves relevant source passages and supplies them to a language model with the question. Many systems use embeddings—numeric representations of meaning—to find candidates, then rank and select the most useful passages. Retrieval can help with current, private or specialised material without retraining the model. It can still fail: the right passage may be absent, the search may choose a similar but irrelevant passage, or the model may ignore supplied evidence. Ask for source references and test no-answer cases. Review both retrieval and writing: a correct answer built from the wrong passage is not a reliable result.

03

Fine-tuning is not a document search

Fine-tuning performs additional training to adapt a model’s behaviour, style or task performance using prepared examples. It may help produce a consistent classification or follow a specialised format. It is not usually the first choice for making a changing handbook searchable: embedded knowledge is difficult to cite, update and remove, and training does not guarantee factual recall. Try clear prompting and well-governed retrieval before considering fine-tuning. If you do fine-tune, use data you are entitled to use, separate training examples from evaluation examples, and compare against a simpler baseline. The right choice can also be a combination: retrieval for evidence and tuning for a consistent response structure.

Words worth knowing

In plain English.

Source collection
The governed documents and passages a system is allowed to use as evidence.
Embedding
A numeric representation that helps compare the semantic similarity of pieces of content.
Retrieval
Finding and ranking source material that may be relevant to a particular request.
Retrieval-augmented generation (RAG)
Supplying retrieved source passages to a language model so it can draft an answer grounded in them.
Fine-tuning
Additional training that adapts a model using prepared examples for particular behaviour or tasks.
See it in practice

Worked example: answering questions from a club handbook

  1. Choose the current handbook, archive old editions and split the current document into labelled sections with page references.
  2. For ‘When must a key be returned?’, retrieve the membership and key-policy passages rather than unrelated welcome text.
  3. Ask for an answer using only those passages, with section references and ‘Not covered’ when evidence is absent.
  4. Test ordinary questions, ambiguous wording, an outdated-policy question and a question the handbook does not answer.

Why this works: The evaluation covers finding evidence and using it. Version control and explicit no-answer cases expose failures that a polished answer could otherwise hide.

Your turn

Try it for yourself.

Plan a small question-answer prototype for five documents you own or may use. Describe your source-selection rule, one retrieval test, one no-answer test and why you would begin with RAG rather than fine-tuning.

Saved only in this browser. Clearing browser data or resetting course progress will remove it.
View a sample answer

Sample: I would use the latest approved editions of five public club guides, record their publication dates and retain section headings with each passage. One retrieval test would ask about guest access and check that the guest-policy passage appears before an answer is drafted. A no-answer test would ask about a service none of the guides mentions; the expected result is Not covered. I would begin with RAG because the documents may change and I need visible sources, while fine-tuning would add training work without providing those citations.

Check your understanding

Three quick questions.

Answer all three, then check. Nothing is sent anywhere.

Question 1What is the main purpose of retrieval in RAG?
Question 2Which is usually the better first approach for a frequently changing handbook that needs citations?
Question 3Why include a no-answer test?
Keep going

Finished reading and practising?

Mark the lesson complete when you are ready. The quiz is for learning, not a pass/fail gate.

For optional technical study of language-model systems, continue with Hugging Face’s learning resources. Explore further learning ↗