Senior interview question
A PM wants to show users a 'confidence' percentage computed from the answer's token probabilities. What's your position, and what would you build instead?
Model answer
Against it: a token probability says how typical the text is after the prompt, not whether it's correct. Asked for the largest planet, GPT-2 small rated " Earth" at 0.0282, slightly above " Jupiter" at 0.0270. The number also moves with sampling settings, and the GPT-4 report found the model much less calibrated after post-training.
Instead, use logprobs internally: log them, flag low-probability answers for review, and check on a labelled set that the flag actually catches errors.
Practise the rest
9 Sampling questions, 492 in all, each with a model answer. Free.
More Sampling interview questions
- What are logits, and how does a model go from them to a whole sentence of output?
- Explain temperature, top-k and top-p. Why would you usually reach for top-p rather than a fixed k?
- Greedy decoding on a small model gives fluent text that soon repeats itself word for word. Why does that happen?
- Your integration tests call a hosted model at temperature 0 and compare the output with an exact string. They fail now and then. What's going on, and what do you change?
- Write beam search that returns each sentence with its probability. How does it differ from greedy decoding?
- Build a bigram next-word predictor that samples the next word in proportion to how often it followed.