Skip to the page

LLM basics for builders · core

Why models make things up, and prompt, RAG or fine-tune

A model predicts likely text and has no built-in check against a source of truth, so it can invent facts. The builder reduces this by supplying facts and checking outputs, and by choosing the cheapest fix first: prompt, then RAG, then fine-tuning.

The notes

What you must know

  • The model predicts likely next tokens. Nothing inside it checks a source of truth. Training rewards fluent, confident answers, so it fills gaps with text that sounds right.
  • Its knowledge stops at a cutoff date, and rare facts are stored poorly.
  • Kinds: invented facts, wrong or invented citations, answers that contradict the given context, and invented tool arguments such as an order id that does not exist.
  • App-level fixes: supply the facts (retrieval, tools, database lookups), say to answer only from the context and to say when it is not there, ask for citations and check them in code, use enums and schemas, and keep temperature low for factual tasks.
  • Order of effort: start with a better prompt (cheapest and fastest to change). Add RAG when the model needs facts it does not have or facts that change. Fine-tune for a behaviour, format, tone or narrow skill that prompting cannot do reliably.
  • Fine-tuning is a poor way to add facts: it is hard to update, gives no citations and still hallucinates. RAG gives fresh facts, sources and per-user access control.
  • LoRA trains small adapter matrices instead of all the weights. It is cheap, and one base model can serve many adapters.

The red pen

Common traps: mistake → fix

  • Mistake: Hallucination is a bug that the next model version will remove

    Fix: it comes from how the model works, so you design around it.

  • Mistake: Fine-tune the model on our documents so it knows our products

    Fix: fine-tuning teaches style and skills, not reliable facts; use RAG for facts.

  • Mistake: Telling the model never to make things up is enough

    Fix: add real facts, checks and a way to say I do not know.

Easy to hard

Questions interviewers ask, easy to hard

  1. Why do language models hallucinate?
  2. What can you do about it in your app?
  3. A manager says: fine-tune a model on our documents. What do you say?
  4. When would you fine-tune instead of using RAG?
  5. What is LoRA and why is it popular?

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview