When should you use token-level F1 vs exact match in a QA evaluation?
Exact match is all or nothing and unambiguous for canonical-form answers; token F1 gives partial credit for phrasing variation but can also reward hallucinated spans that happen to overlap.
Imagine grading a one-line answer on a quiz. With exact match you are a strict teacher: the answer matches the key word for word, or it gets a zero. That is fair when the answer is a date or a name, because there is one right way to write it. Token F1 is a lenient teacher who gives partial credit for getting some of the words right. That helps when students phrase the same fact differently. But the lenient teacher has a blind spot: a student who writes the right name with the wrong date still earns points for the matching words, even though the answer is factually wrong. So strict grading is safe for short, fixed answers, and lenient grading is useful for varied phrasing, as long as you remember it can reward near-misses that are actually wrong.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: what exact match and token F1 each measure, the precision-recall decomposition of F1, when each is appropriate (canonical spans vs varied phrasing), the hallucinated-overlap failure mode, and when to escalate to semantic or judge-based eval.
Real products, models, and research that use this idea.
- The SQuAD benchmark reports exact match and token F1 side by side as the standard extractive QA leaderboard pair.
- Natural Questions and TriviaQA use normalised exact match plus token F1 for short-answer evaluation.
- RAGAS scores answer correctness with semantic similarity and claim entailment instead of token overlap for free-form RAG answers.
- DeepEval and Promptfoo expose exact match and F1 as built-in metrics but recommend judge-based scoring for open-ended outputs.
- OpenAI Evals ships exact-match graders for structured-answer tasks and model-graded checks for free-form ones.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does SQuAD report both exact match and token F1 rather than picking one?
QHow would you detect that a high token F1 is hiding a factual error?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating token F1 as strictly better than exact match. F1 rewards overlap, so an answer with the right entity but wrong date can score high while being factually wrong.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.