Teaching a model your stuff: prompting, RAG, and fine-tuning
A model off the shelf knows the public internet up to the day its training stopped. It does not know your regulations, your curriculum, your case notes, or what happened yesterday. There are exactly three ways to fix that, and knowing which one to reach for is the most useful piece of judgement in this entire field.
Look at any AI proposal and say, with reasons, which of the three approaches it needs and which it is over-engineering.
Lesson 1, or at least the idea that a model predicts text and only knows what it was trained on.
Plain-English mode
Each section opens with a short summary before the detail. Turn this off once the vocabulary feels familiar.
Retrieval changes what a model knows. Retraining changes how it behaves. Better instructions are where you always start.
Learn this sentence now and spend the rest of the lesson understanding why it is true. changes what the model knows. changes how the model behaves. is where you always start.
Nearly every architecture question in applied AI comes down to choosing between those three, and usually to combining them. The rest of this lesson is the reasoning behind that sentence, ending with a decision tree you can reuse on any problem somebody brings you.
Answer in your head first, then reveal. Getting it wrong is the part that makes it stick.
Which of the three would you reach for if a model keeps answering in the wrong tone, and which if it keeps citing an outdated policy?
Prompting means putting your instructions and a few examples directly into the request. Nothing is trained, nothing is stored, and you can change your mind in seconds.
is the cheapest and fastest lever you have. You put your instructions and examples directly into the request. No training, no infrastructure, and you can rewrite it and try again in ten seconds. Because the model adapts purely from what you put in front of it, this is called in-context learning. Nothing is being learned permanently. The model is adjusting to what you gave it, for this one request, and then forgetting it entirely.
Four techniques carry most of the value.
- Separate the from the user's question. The system prompt holds the durable rules, the role, and the boundaries: "You are a maths tutor. Never give the final answer. Give one hint at a time." The user prompt is whatever they typed. Keeping them apart means your rules stay stable no matter how the conversation wanders.
- Show examples rather than describing what you want. Asking with no examples is called . Including a handful of worked input-and-ideal-output pairs is called few-shot, and it is the fastest way to pin down a format or a style without retraining anything. If you are struggling to describe the output you want, stop describing and show three of them.
- Ask it to work step by step. This is prompting, and it noticeably improves accuracy on anything with multiple stages, because it gives the model room to work rather than committing to a first guess. do this internally without being asked.
- Force the answer into a fixed shape. If the output feeds into other software rather than a human, demand JSON or a fixed set of fields, using the provider's or function-calling features. This is what turns a chatty model into a component you can build on.
Answer in your head first, then reveal. Getting it wrong is the part that makes it stick.
You need the model's answers to always come back with the same five fields so another system can read them. Prompting or fine-tuning?
RAG means fetching the handful of pages that answer the question and handing them to the model, so it answers from your documents instead of from memory. It is how most real AI systems work.
stands for Retrieval-Augmented Generation, which is a heavy name for a simple idea. Instead of hoping the model memorised your facts, you look up the relevant passages in your own documents at the moment the question is asked, and hand them over with the question. The model then answers from your material and points at where each claim came from. This is the default design for almost every serious organisational AI application, and once you see why, you will spot it everywhere.
- It stays current. Change a regulation and you update one document. Nothing gets retrained.
- It can be checked. Answers point back to the passage they came from, so a human can verify them and an auditor can follow them.
- It respects permissions. You can enforce who is allowed to see which documents at the moment of lookup, which you simply cannot do with facts baked into a model.
- It is cheaper than retraining for knowledge, and it cuts down invented answers substantially, because the model has the actual text in front of it rather than a hazy memory of something like it.
How it works, in three stages
Stage A - Getting your documents ready
Done once, then on updatesPull clean text out of the source files, which may be PDFs, Word documents, scans, tables, or web pages. Split those documents into passages, ideally along natural boundaries like headings and clauses rather than cutting blindly every few hundred words. Convert each passage into a list of numbers, the from lesson one. Store those numbers alongside their metadata (where it came from, what date, who is allowed to see it) in a , which is a store built for finding the nearest matches quickly.
Stage B - Finding the right passages
Every questionConvert the user's question into numbers the same way, then find the passages whose numbers sit closest to it. For real documents full of reference numbers and proper names, combine that meaning-based search with old-fashioned , because meaning-based search alone will happily miss an exact article number. Filter by metadata: the right jurisdiction, the right date range, and what this particular user is permitted to see. Then re-rank, which means a sharper and slower model re-scores the shortlist so you keep only the best three to five.
Stage C - Writing the answer
Every questionAssemble the final request: your system instructions, the passages you just retrieved, and the user's question. Instruct the model to answer only from those passages and to say which passage each claim came from. Then guard the exit: if the lookup came back weak, the system should decline rather than guess. "I do not have a source for that" is a better answer than a confident fabrication, every single time, and it is a design decision somebody has to make on purpose.
Answer in your head first, then reveal. Getting it wrong is the part that makes it stick.
Why does RAG reduce invented answers rather than eliminate them?
What can retrieval do about permissions that a fine-tuned model fundamentally cannot?
Retrieval systems fail in a predictable handful of ways. Knowing the list means you can diagnose a bad answer in minutes rather than blaming the model.
has a known set of failure modes, and being able to run through them is what separates somebody who has built one of these from somebody who has read about them. When an answer comes back wrong, the useful question is never "is the model bad", it is "which link in this chain broke". Here is the table I keep in my head.
Answer in your head first, then reveal. Getting it wrong is the part that makes it stick.
An assistant gives a confident answer that contradicts the policy document it cites. Which failure is that, and which is it not?
Fine-tuning means continuing to train a model on your own examples so a behaviour becomes permanent. Use it to change how a model acts, almost never to teach it facts.
means continuing to train a model on examples you provide, so that a new behaviour, style, or skill is built into the model itself rather than supplied fresh in every request. Reach for it when you want to change how the model acts. Almost never reach for it to teach the model new facts.
Good reasons to fine-tune
- A format, style, or tone you cannot get reliably from . Always producing one exact extraction format, for instance, or always writing in a specific professional register.
- A domain language or dialect the handles badly. A regional Arabic dialect rather than Modern Standard Arabic is the example I have seen make the biggest difference in practice.
- A narrow, high-volume task where a small fine-tuned model matches a big general one at a fraction of the cost and waiting time. This is what makes running on your own hardware realistic.
- Cost and speed. Baking the behaviour in lets you drop a very long prompt from every request, or drop down to a smaller model entirely.
Modern fine-tuning is usually , which means you do not touch most of the model. Rather than adjusting billions of numbers, you freeze nearly all of them and train a small set of new ones. The common method is LoRA, for Low-Rank Adaptation, which slots small adapter layers into the model and trains only those. The intuition is that you are not repainting the building, you are hanging a few things on the walls. It is roughly ninety-nine percent fewer numbers to train, dramatically cheaper, and it means you can keep a library of task-specific adapters and swap them in and out over the same base model.
Answer in your head first, then reveal. Getting it wrong is the part that makes it stick.
A team wants to fine-tune a model monthly so it always knows the current version of their pricing. What do you tell them?
What does LoRA actually change about the economics of fine-tuning?
Work down the list in order and stop at the first thing that works: ordinary software, then prompting, then retrieval, then fine-tuning, then agents.
You will be asked this question in a hundred different disguises, so it pays to have one answer you can walk through out loud.
- 01Does this need AI at all? If the task is fixed, structured, and there is exactly one correct answer, like validating a reference number or calculating a fee, use ordinary software or a rules engine. It is cheaper, faster, fully auditable, and cannot invent anything. Being willing to say "this should not use AI" is a senior signal, not a lack of ambition.
- 02Can better instructions do it? Try that first, properly. It is the cheapest thing to try and the fastest to change your mind about.
- 03Does it need knowledge the model does not have? Add retrieval. Proprietary documents, facts that change, a requirement to cite sources, per-user permissions. This is the default answer for most real knowledge work.
- 04Does it need a behaviour, style, or dialect that will not hold, or does it need to run cheaply on a small model? , usually with , and usually on top of retrieval rather than instead of it.
- 05Does it need to take actions or work through several steps on its own? Now you need an with tools, which is lesson three.
- 06Throughout all of it: decide how you will measure success before you choose the architecture, and pick the smallest thing that clears the bar. Add complexity only where your own measurements prove it is needed.
Answer in your head first, then reveal. Getting it wrong is the part that makes it stick.
A stakeholder opens with "we want to fine-tune a model on all our internal documents". Where does that sit on the tree, and what do you ask?
All five levers on one real job, showing how they stack rather than compete.
A policy team asks whether Article 14 of a new digital services law conflicts with existing data protection rules, or with how other countries have handled the same thing. Here is how the levers combine.
- 01Start with the instructions. The sets the role and the boundaries: act as a legal research assistant, cite every claim, keep source-backed findings separate from your own suggestions, and never make the final policy call.
- 02Use examples to fix the format. Show three examples of the output you want: the issue, the source clause, the comparable jurisdiction, the risk, suggested wording, and a confidence level. The model picks up the format for this request without anything being retrained.
- 03Build the document library. Parse the draft law, the official gazettes, the policy memos, and the comparable laws from elsewhere. Split them by article and clause rather than by arbitrary length, so a legal provision is never cut in half.
- 04Index and search properly. Each clause is converted into numbers and stored with its metadata: jurisdiction, date, version, source, and permission level. Questions are searched against it using both meaning and exact keywords, so "Article 14" matches as a literal string and "cross-border transfer" matches by meaning.
- 05Answer from the sources. The final request carries the system rules, the retrieved clauses, and the question. links the phrase "cross-border transfer" to the data export rule that was fetched. The answer cites the exact clause, and declines when the evidence is thin.
- 06 for behaviour only. If the team needs a consistent legal register or their own risk taxonomy applied every time, that is a fine-tuning job. The text of the law is not. Laws change, and changing things belong in retrieval.
- 07Add an only when the work involves steps. A tightly constrained agent can search the legislation, pull comparisons from other jurisdictions, draft a memo, and route it to a lawyer. Ordinary software still handles the exact dates, article numbers, permissions, and version control, because those need to be right rather than probable.
Answer in your head first, then reveal. Getting it wrong is the part that makes it stick.
In this example, which parts deliberately do not use AI, and why?
This is educational career guidance, not a promise of a job, a salary, or any specific outcome, and not financial or legal advice. Your results depend on your own effort and circumstances. Make big decisions with proper professional advice where it matters.
Unlock every AI lesson
One payment unlocks all 12 AI lessons in full, plus the entire Clinical Pivot Playbook: 8 career maps, 8 personalised 90-day plans, CV and LinkedIn templates, the cold-message bank, the interview answers, the glossary, and the startup list.