Unit 5 · Evaluation, Safety and Deployment

Lesson 18 · Available to read

Hallucinations, Bias and Failure Modes

Why models make things up, where bias comes from, what calibration means, and how to reduce failures.

Every powerful tool has characteristic failure modes, and knowing them is what separates confident users from careless ones. This lesson explains the most important ways LLMs go wrong, why each happens, and what reduces it.

Eight common LLM failure modes, from hallucination and sycophancy to miscalibration.
Eight common LLM failure modes, from hallucination and sycophancy to miscalibration.

Hallucination

A hallucination is output that is fluent and confident but false or unsupported. Two flavours:

  • Intrinsic — contradicts the source you gave it (a summary that reverses a document's conclusion).
  • Extrinsic — adds claims no source supports (an invented statistic, quote, court case or citation).

Why it happens

  • The objective rewards plausibility. Pretraining teaches the model to produce likely text. Usually likely and true coincide, but nothing in the loss checks truth.
  • Knowledge gaps. For rare facts — a minor historical figure, a niche paper — the model has weak, blurry knowledge but still produces a fluent answer.
  • Incentives to guess. If evaluations and feedback reward a confident answer more than "I don't know", models learn that guessing pays.
  • Snowballing. Once an early token commits to a wrong claim, later tokens build on it to stay consistent.
  • Sampling. Randomness can pick an unlikely, wrong token at a crucial point (Lesson 13).

Fake citations are a classic case: every component is individually plausible, so the combination looks real.

A fabricated citation is built from individually plausible parts — author, year, title, journal — that together may describe a paper that doesn't exist.
A fabricated citation is built from individually plausible parts — author, year, title, journal — that together may describe a paper that doesn't exist.

What helps

  • Grounding — retrieve sources and require answers to cite them (Lesson 15). Then check the citations.
  • Permission to abstain — explicitly allow and request "I don't know" or "not in the sources" (Lesson 14). Labs also train models to abstain when uncertain.
  • Verification — ask the model to check its own claims, cross-check with tools (search, code execution, calculators) or have a second model verify.
  • Lower temperature for factual tasks.
  • Human review wherever errors are costly: medicine, law, finance, anything published.

Calibration

A model is calibrated if its confidence matches its accuracy: among answers it gives with 90% confidence, about 90% should be right. Base models are often reasonably calibrated on their token probabilities; post-training can make stated confidence less reliable, typically overconfident.

A calibration plot: a well-calibrated model lies on the diagonal; an overconfident one says 90% but is right only about 70% of the time.
A calibration plot: a well-calibrated model lies on the diagonal; an overconfident one says 90% but is right only about 70% of the time.

Calibration matters because it tells users when to double-check. Practical tips: ask for confidence levels and reasons, sample several answers and check agreement (disagreement is a warning sign), and test calibration on your own evals.

Bias

LLMs learn from human-written text, which carries the stereotypes and imbalances of its authors and eras. Bias can enter at several points:

  • Data — some groups, languages and viewpoints are over- or under-represented (Lesson 10).
  • Labels and feedback — raters' and annotators' own assumptions shape fine-tuning and alignment (Lessons 11–12).
  • Deployment — how and for whom a system is used.

Harms come in two broad kinds: representational (demeaning or stereotyped portrayals, such as assuming a nurse is a woman and an engineer a man) and allocational (unequal outcomes when models help screen job applicants, loans or benefits). Quality also differs across languages and dialects: a model may be markedly worse for speakers of under-resourced languages.

Measuring and reducing bias

  • Counterfactual tests — swap names, genders, nationalities or dialect in otherwise identical prompts and compare outputs.
  • Bias benchmarks — curated question sets probing stereotypes across many categories.
  • Mitigations — more balanced data, careful filtering, alignment targeted at fair treatment, and monitoring in deployment.
  • Human oversight — LLMs shouldn't make consequential decisions about people on their own.

Mitigation involves trade-offs and value judgements about what "fair" means in each context; it's an ongoing practice, not a one-time fix.

Other failure modes

  • Sycophancy — telling users what they want to hear, agreeing with incorrect claims or flipping answers under pushback. Partly a product of optimising for human approval (Lesson 12).
  • Brittleness — small, meaningless changes in wording, formatting or the order of options can change the answer.
  • Reversal gaps — research found models trained on "A is B" often fail to infer "B is A" (knowing who someone's mother is, but not answering from the mother's side).
  • Unfaithful reasoning — the step-by-step explanation a model writes may not reflect the computation that actually produced its answer.
  • Over-refusal — declining harmless requests because they superficially resemble harmful ones.
  • Long-context lapses — missing information buried in the middle of long inputs (Lesson 7).

A practical stance

Treat LLM output like a draft from a brilliant, well-read but occasionally careless colleague: excellent for getting started and covering ground, but verify facts that matter, give it the sources it needs, design systems that make checking easy (citations, tests, human review) and measure failure rates on your own tasks rather than assuming them.

The takeaway

LLMs fail in characteristic ways — fabricating plausible falsehoods, mirroring biases in their data, flattering users, breaking under rephrasing and sounding more certain than they are; knowing why each happens tells you how to reduce it: grounding and verification, abstention, careful data and alignment, and evaluation across groups.

Practice

0 of 7 attempted

  1. 1Recall

    Define intrinsic and extrinsic hallucination, with an example of each.

    Saved in this browser

  2. 2Explain in your own words

    Give three reasons LLMs hallucinate, in your own words.

    Saved in this browser

  3. 3Calculate

    On 200 answers a model labelled '90% confident', 142 were correct. On 100 answers labelled '60% confident', 61 were correct. Which group is miscalibrated and in which direction?

    Saved in this browser

  4. 4Multiple choice

    Which technique most directly tests for demographic bias in a model's outputs?

  5. 5Explain in your own words

    What is sycophancy, and how is it connected to alignment training?

    Saved in this browser

  6. 6Apply

    You're deploying an LLM to draft answers for a legal-research team. List five safeguards against hallucination and misplaced trust.

    Saved in this browser

  7. 7Explain in your own words

    Why can't you fully trust a model's step-by-step explanation as an account of how it reached its answer?

    Saved in this browser

See what unlocked