Settings

These settings need JavaScript, which is off in this browser, so choosing one changes nothing.

Changes apply as you choose them.

Theme
Font
Why these fonts?

Choose the font you find easiest to read. Studies have not found that special "dyslexia fonts" help people read faster or more accurately. More space between letters and words does help some readers, so try the spacing setting too.

Text size
Reading layout
Letter and word spacing
Line spacing
More reading controls

Focus mode hides the Map and Help links, the breadcrumb and the footer, so only the page you are reading is left.

Reading voice and speed

Emma is a computer voice, made with the open Kokoro model. Her readings are saved on this site. Where a part has no Emma reading yet, your device's own voice reads it.

Reading speed

The number is how many times faster than normal. 1.5 is one and a half times as fast. The voice keeps its pitch.

Move or delete progress
Move your progress

This device's save code:

Or open this restore link on the other device:

Lesson 5.6

Prompt, RAG or fine-tune?

After this lesson you can choose between prompting, RAG and fine-tuning for a task.

About 9 minutes, or 16 with the Deep layers

Reading depth for every section

In short

  • Three ways to shape an AI for a job: tell it, give it documents, or train it more.
  • Missing or old facts call for documents. A wrong style or format calls for better instructions and examples, then training.
  • OpenAI's guide says to start with a prompt and test it. The test, not a feeling, shows if the simple way is enough.

Three ways to shape an AI for a job

A model is the AI program that writes the replies. There are three main ways to shape one for a job. We use guides from OpenAI and Anthropic, two companies that make AI models.

Prompt it. A prompt is the text you send the model. It can hold instructions, background and a few examples of a good answer.

Give it documents. This is called RAG, short for retrieval-augmented generation. When a question comes in, the system finds the right documents. It sends them with the question.

Fine-tune it. Fine-tuning means training the model a bit more, on examples of the job done well.

The names come from the makers’ own pages. OpenAI’s guide calls the first one prompt engineering. It lists three parts: relevant context, clear instructions and example outputs. Giving a few examples is called few-shot learning.

RAG is short for retrieval-augmented generation. Anthropic’s glossary says the documents are passed into the context window, which it calls the amount of text a model can look back on when it writes new text. It says the data is retrieved at runtime, which means when the question is sent.

Anthropic’s glossary describes fine-tuning as further training of a pretrained model. Pretrained means it was first trained on a large amount of text. Fine-tuning then uses additional data.

What each one changes

Prompting and RAG change what the model is given for one request. Fine-tuning changes the model itself, because it trains it more.

Fine-tuning is its own job. You prepare examples, run the training, and then test the new model.

OpenAI’s guide splits a model’s problems in two. A facts problem is when the model lacks facts, or they are out of date or private. A behaviour problem is when the format, tone or style is wrong.

Lesson 5.5, Answers from your documents, shows how finding documents works. Lesson 5.1, How a chatbot is made, shows how a model is trained in the first place.

Anthropic’s glossary says fine-tuning “causes the model to start representing and mimicking the patterns and characteristics of the fine-tuning dataset”. The same glossary says RAG data is retrieved when the query is sent.

OpenAI’s fine-tuning page lists four parts: build the examples, upload them, run the training job, and evaluate the result. Evaluate means test. OpenAI’s guide says a model’s problems fall into two kinds. In the first, the model lacks facts because they were not in its training, are out of date, or are private. In the second, the format is inconsistent, the tone or style is wrong, or the reasoning is not followed steadily.

Start with the lightest that works

By the lightest way, we mean the one that changes the least. A prompt changes only what you send.

OpenAI’s guide calls prompting “prompt engineering”. It says this is “typically the best place to start”. It says prompting is often the only method needed for summaries, translation and code.

The guide also says the three are not a ladder. They solve different problems, so pick the one that fits the problem.

So start with a prompt and test. If the test shows missing facts or the wrong style, move to the tool that fits.

Combining tools is not always better. In one OpenAI example, adding documents to a model that was already fine-tuned made its test score go down.

The guide’s closing advice is to get as much accuracy as you can from the basic methods before reaching for RAG or fine-tuning. It says to let the accuracy target be the goal, not to jump for RAG and fine-tuning because they seem the most sophisticated.

The guide also says prompting often does not scale. A prompt may need more material than fits, or steadier behaviour than a few examples give. That is when the other two come in.

It says the methods can be combined: they are “additive, not exclusive”. Combining is not always better. In OpenAI’s own example, fixing Icelandic sentences, adding RAG to a model that was already fine-tuned made the test score go down. OpenAI says the extra material added noise. That is one task and one model.

Which tool for the job?

Which tool for the job? shows six made-up jobs, one at a time. For each one, you pick from four choices. They are: prompt it, give it documents, fine-tune it, or start with a prompt and test.

The fourth choice is for a job that does not clearly point to one tool. You try a prompt first and let a test decide.

Then you read our reading and the reasons. Nothing is counted or saved.

Our readings are ours. They are built from the guides in this lesson. They are not rules from any maker.

Every job is invented. Each answer lists what the choice changes, what it costs in data and effort, and how we would test it. We give no prices, because makers change them.

A different team, with different test results, could choose differently. That is the point of the last option. It means: try the simplest thing, and let the test decide.

Try it: Which tool for the job?

We made up six jobs. Nothing in them is real: no company and no person.

For each job, pick the tool you think fits best. Then read our reading and the reasons.

Our readings come from guides by OpenAI and Anthropic, and from two studies. They are ours, not rules from any maker. A team with different test results could choose differently.

Job 1

A team wants a short summary after each meeting. They paste in the meeting notes and ask for five bullet points. Nothing else is needed.

Which tool fits this job best?

Nothing is counted or saved.

Job 1: the answer

Our reading: Prompt it

Why: OpenAI's guide says prompting is often the only method needed for summaries, translation and code.

What it changes: The input only. You write instructions and, if needed, one example of a good summary.

Cost and data: No training and no store of documents. You write the prompt and check it.

How we would test it: Take ten past meetings where the team knows what mattered. Check that each summary has those points and no invented ones.

Job 2

A company wants staff to ask questions about its 300-page human resources (HR) handbook, which holds staff policies. The handbook changes every month. Staff need answers that match this month's text.

Which tool fits this job best?

Our reading: Give it documents (RAG)

Why: The facts are private and they change. OpenAI's guide lists out-of-date and private knowledge as reasons to send the model better background, such as documents. Anthropic's glossary says RAG suits tasks that need up-to-date information.

What it changes: The input. The system finds the right pages for each question and sends them with it.

Cost and data: The handbook must be searchable and updated each month.

How we would test it: Ask questions with known answers from this month's handbook, including what changed. Were the right pages found? Does the answer match them?

Job 3

A publisher wants every reply from its chat helper to follow its house style: short sentences, a friendly greeting and no jargon.

Which tool fits this job best?

Our reading: Start with a prompt, then test

Why: In OpenAI's guide, style is a behaviour problem. It says a few examples in the prompt should make results more consistent. Training comes later.

What it changes: First the input only: the style rules and a few example replies. Consider training only if the style still slips.

Cost and data: A few good example replies and the written style rules. Training would need many more examples.

How we would test it: Write test requests. Check each reply against the style rules. If many miss, add examples and test again.

Job 4

A support team sorts tickets into eight types. A ticket is a recorded request for help. A prompt with examples, tried on 200 tickets with known types, keeps mixing up two types. Staff have already sorted thousands of past tickets.

Which tool fits this job best?

Our reading: Fine-tune it

Why: The prompt was tested. The problem is steady behaviour, not missing facts. OpenAI's pages list classification as a use of fine-tuning. Sorting these tickets into types is classification.

What it changes: The model. It trains on correctly sorted tickets.

Cost and data: It needs correct examples that look like real tickets. Here they exist. Training is a separate job. OpenAI's guide advises starting with about 50 good examples.

How we would test it: Hold some sorted tickets back from training. Compare the new model with the prompt on them.

Job 5

A law firm wants an assistant that can answer questions from its 2,000 case files. A colleague says to fine-tune the model on all of them.

Which tool fits this job best?

Our reading: Give it documents (RAG)

Why: Two studies found fine-tuning a weak way to add facts. One found RAG did better in its tests. The other found new facts are learned slowly, then make wrong answers more likely. One study tested three models and the other tested one.

What it changes: The input. The system looks up the files for each question.

Cost and data: The files must be searchable. A new or changed file is added to what the system searches.

How we would test it: Ask questions the files answer, and some they do not. Check that answers match the files.

Job 6

A school wants a kind, plain homework helper. It must follow the school's policy pages on when to ask a teacher.

Which tool fits this job best?

Our reading: Start with a prompt, then test

Why: The job has a facts part (policy) and a behaviour part (tone). OpenAI's guide says to find which part fails, then pick the fix that fits.

What it changes: First the input: tone instructions and the policy pages. Add more only if the test shows a need.

Cost and data: A prompt is the least to try. Add document search if facts go missing, training if tone slips.

How we would test it: Test policy and tone questions. Mark each miss as wrong fact or wrong tone. Change one thing, then test again. Adding RAG can lower a score, as in OpenAI's own example.

In every job, a test comes before the choice. The simple way comes first, and a test says if it is enough.

In OpenAI's guide the tools can be combined, so a real job may end with more than one.

These are six invented jobs. They do not cover every job. The guides can change, so check the maker's page on the day.

What each one needs

A prompt needs a clear idea of a good answer, and a way to check it.

RAG needs good documents. It also needs the right ones to be found. A RAG system can fail in two places: it finds the wrong pages, or the model misuses the right ones.

Fine-tuning needs a set of examples that match the real job. Start small and test. OpenAI’s fine-tuning page says to set up your tests first.

Anthropic’s prompt guide expects a clear definition of success and some way to test against it before you improve a prompt.

For RAG, Anthropic’s glossary says its effectiveness depends on the quality and relevance of the knowledge base and of what is retrieved. OpenAI’s guide says that retrieval is a second thing to tune. It says supplying too much irrelevant material can drown out the real information.

For fine-tuning, OpenAI’s guide says quality matters more than quantity and recommends starting with 50 or more examples, then testing. That number is that guide’s advice on 9 October 2026, not a rule. OpenAI’s pages list classification, nuanced translation, content in a fixed format and fixing instruction-following failures as uses of supervised fine-tuning. A shorter prompt can save cost at scale. The page also says fine-tuning can be time-consuming.

What a maker offers changes. On 9 October 2026, OpenAI’s page said it was winding down its fine-tuning platform for new users. Anthropic’s glossary said its API did not currently offer fine-tuning. Check the maker’s page on the day.

What two studies found

Two research papers tested what happens when you add new facts by fine-tuning. One tested three models and the other tested one, on set tasks. Neither covers all AI.

One paper found that RAG did better than training a model on plain text to add facts. The other found that models learn new facts slowly from examples. Once a model had learned them, wrong answers became more likely.

Ovadia and colleagues put their paper on arXiv on 10 December 2023. They compared RAG with unsupervised fine-tuning, which is further training on plain text with no question-and-answer labels. They tested three models of the size called 7B (B is short for billion parameters, which are what a model learns in training) on school-subject question sets and on a set about current events. They report that RAG did better, for facts the model had seen and for new ones.

Gekhman and colleagues posted theirs on 9 May 2024, and it appeared at the EMNLP 2024 conference, short for Empirical Methods in Natural Language Processing. They fine-tuned one model, PaLM 2-S, on questions about facts. They changed how many of the training examples held facts that the paper labels Unknown. The model never gave the right answer to those questions in the paper’s tests. Those examples were learned much more slowly. Once learned, they raised the model’s tendency to hallucinate, which the paper uses for giving wrong answers.

The authors conclude that models mostly get their facts in pretraining, and fine-tuning teaches them to use those facts better. That is their reading of their setup.

Test, then decide

A cleverer prompt does not guarantee a true answer. In the guides we read, every way is judged by a test, not by how clever it looks.

First write test questions where you know the right answer. Try the simplest way. Look at what went wrong. Facts missing? Try documents. Wrong style or format? Try better instructions and examples, then training.

Then test again.

OpenAI’s guide says the best output of the prompt stage is a good prompt plus a set of questions with known right answers. It calls that a baseline: the result you compare later changes against. Its fine-tuning page says “Only invest in fine-tuning after setting up evals”, and evals are those tests.

The same guide says to look at why each wrong answer happened, then choose the lever that fits. The notes under each job in the activity follow that order.

Check-in

A shop's chatbot gives last year's opening hours. The hours changed. What kind of problem is this, in OpenAI's guide?

Facts are old or missing. This needs better context, such as documents.

Yes. OpenAI's guide lists out-of-date knowledge as a reason to improve the context the model gets.

The tone is wrong. This needs fine-tuning.

Not this one. The tone is fine here. The guide ties tone and style to the model's behaviour, not to old facts.

The prompt is not clever enough. A cleverer prompt will always fix it.

Not this one. Better wording alone does not give the model the new hours. Put the new hours in the prompt, or let the system find them. The guide says to test, not to assume.

Nothing is wrong. Models always know the latest facts.

Not this one. OpenAI's guide names out-of-date knowledge as a reason to improve the context.

A chatbot's answers are right, but its format is not steady. What does OpenAI's guide say to try first?

A prompt with clear instructions and examples, tested on questions where you know the right answer.

Yes. The guide says prompting is typically the best place to start. It adds examples to make results more consistent.

Fine-tune straight away, because training is the strongest tool.

Not this one. The guide says to get as much as you can from the basic methods first.

Add a pile of documents, because RAG fixes everything.

Not this one. The facts are right here. The problem is the format, which is the model's behaviour, not missing facts.

Skip testing, because the format looks fine to you.

Not this one. The guides we read judge each way by a test, not by a feeling.

Sources (9)

Glossary

model
The AI program that writes the replies. It is trained on a lot of text.
prompt
The text you send a model. It can hold instructions, background and examples.
RAG
Short for retrieval-augmented generation. The system finds documents when a question comes in and sends them with the question.
fine-tuning
Training an already trained model further, on extra examples.
few-shot examples
A few examples of a good answer, put in the prompt to show the model what you want.
test questions
Questions where you already know the right answer, used to check how well a setup works.

Where next

I have finished this lesson