Senior interview question
You want to automatically flag answers that are probably wrong, using the model's token probabilities. How would you design and validate that?
Model answer
Treat probability as a signal to validate, not a verdict. On our 14 prompts, four right answers, including " Tokyo" at 0.1186, were less probable than the wrong " Sydney" at 0.216, and the GPT-4 report found post-training weakened calibration.
So log the probabilities, flag low ones for review, and measure on labelled traffic how many real errors the flag catches and how many good answers it wrongly flags. Recheck after any model or prompt change. For free-form answers, Kadavath et al. ask the model whether its answer is true and use that probability.
Practise the rest
11 Hallucination questions, 492 in all, each with a model answer. Free.
More Hallucination interview questions
- What is a hallucination, and why can a next-token predictor produce one so fluently?
- GPT-2 small completes 'The capital of Australia is the city of' with Sydney. Walk me through why a model does that.
- Why do long generated answers leave more room for hallucination than one-word answers?
- You're shipping a support bot that answers from your company's policy documents. What do you put in place to reduce hallucination, and how do you evaluate it?
- Design how a chatbot falls back when it doesn't know the answer, covering uncertainty, retrieval and tools.
- How would you measure an LLM's answer quality and detect hallucinations against the context it was given? Then implement the evaluation component.