EasyDeepLearn
LLMs & GenAI · section 14 of 18

Hallucinations & reliability

5 interview questions on hallucinations & reliability, each answered in full. Free to read, no account needed.

Why do LLMs hallucinate and how do you reduce hallucinations?

medium
  • LLMs generate the most probable next token — they don't have a truth check.
  • Hallucinations arise when the model lacks knowledge, when the prompt is ambiguous, or when it 'commits' to a plausible-sounding continuation.
  • Mitigations: retrieval-augmented generation (ground in cited sources), lower temperature and constrained decoding, explicit 'say you don't know' instructions, tool use, self-consistency and verifier models, and evaluation with factuality benchmarks.
#hallucinations#reliabilityPermalink & quiz →

Name three types of LLM hallucination.

medium
  • (1) Factual: model states false facts confidently ('Marie Curie was born in 1876' — she was 1867).
  • (2) Faithfulness (in RAG): model contradicts or adds beyond the retrieved context.
  • (3) Intrinsic: internal contradictions within a single response.
  • (4) Extrinsic: plausible-sounding but unverifiable additions (fake citations, fake case law).
  • Different failure modes need different mitigations — RAG helps factual + extrinsic; system-prompt discipline helps intrinsic; self-consistency helps most types.
#hallucinations#reliabilityPermalink & quiz →

Can LLMs leak their training data?

hard
  • Yes — Carlini et al. (2020, 2023) demonstrated 'training data extraction' attacks: with carefully chosen prompts, models regurgitate verbatim training text, sometimes including PII.
  • Risk factors: (1) memorization of frequent/near-duplicate documents; (2) low temperature decoding; (3) targeted prompts using known prefixes.
  • Mitigations: aggressive dedup in training data, differential privacy training (expensive quality hit), unlearning techniques, filter PII from training corpora, and rate-limit obvious extraction attempts.
#safety#reliabilityPermalink & quiz →

What copyright / IP issues arise with LLMs in production?

hard
  • (1) Training data: many LLMs are trained on copyrighted works (books, code, images) — ongoing lawsuits (NYT v OpenAI, Getty v Stability).
  • (2) Output: models can regurgitate copyrighted text verbatim (rare but possible).
  • (3) Code: models can output code covered by copyleft licenses (GPL) without attribution — Copilot lawsuit.
  • Mitigations: attribute sources where possible, offer indemnification (OpenAI, Microsoft, Anthropic do for enterprise), keep an audit trail of prompts/outputs, and consult legal for high-risk domains (music, film).
#safety#production#reliabilityPermalink & quiz →

What are the main failure modes of LLM agents?

hard
  • (1) Infinite loops: repeated tool calls with slight variations, spending tokens forever.
  • Fix: maxsteps\operatorname{max}_{\mathrm{steps}}, loop detection, cost caps.
  • (2) Wrong tool selection: LLM chooses a tool that can't solve the problem.
  • Fix: better tool descriptions, tool-selection few-shot.
  • (3) Bad arguments: hallucinated JSON, missing fields.
  • Fix: structured output / JSON schema.
  • (4) Ignoring tool errors: model plows through on stale info.
  • Fix: explicit error handling in the prompt.
  • (5) Reward-hacking: model finds shortcuts (fake  toolcall  to  skip  actual  work)(\mathrm{fake}\;\mathrm{tool}_{\mathrm{call}}\;\mathrm{to}\;\mathrm{skip}\;\mathrm{actual}\;\mathrm{work}).
  • Fix: verification steps.
#agents#reliabilityPermalink & quiz →

Practise LLMs & GenAI