Notes

Exact Match (EM)

A reading-comprehension system answers “1969” and the gold answer reads “in 1969”. A human marks that correct. Exact match marks it wrong, and that bluntness is the whole point of the metric.

How it is computed
Exact match is the percentage of predictions that are character-for-character identical to the reference, after a normalisation step agreed in advance:

  • lowercase the text, strip punctuation and leading articles, collapse whitespace;
  • score each example 1 or 0 — no partial credit;
  • where several gold answers are allowed, take the best match among them.

Where it fits
EM is the headline number on span-selection and extraction benchmarks: SQuAD reports it beside token-level F1, and slot-filling and entity-linking evaluations do the same. The pairing is deliberate. F1 gives credit for overlapping tokens, so a prediction of “Barack Hussein Obama” against “Barack Obama” scores well on F1 and zero on EM. Read together, the two tell you whether a model is nearly right or precisely right.

Why it matters
Some answers must be exact to be usable — a date copied into a form, a product code, a span handed to a database — and a metric that rewards “close” hides failures that break the pipeline downstream. The cost is that EM punishes legitimate paraphrase, which makes it a poor fit for summarisation or translation, and it quietly rewards models that pick up the reference's surface habits rather than the answer.

Exact match is the fraction of predictions identical to the reference answer after light normalisation — lowercasing, stripping punctuation and articles. Scoring is binary: a prediction is right or it is not, with no credit for partial overlap. It measures whether output is usable verbatim downstream, which is why span-extraction benchmarks such as SQuAD report it alongside token-level F1, the companion metric that shows how close a wrong answer came.

Imagine marking a spelling test. There is no half mark for nearly right — the word matches the answer key, or it does not.

Exact match is that style of marking, applied to software. When a program is asked a question and replies with a short answer, exact match checks whether its reply is word for word the same as the answer the test expects. Differences in capital letters or punctuation are forgiven; nothing else is. It is a tough, honest score, and the right one to use when an answer has to be precisely correct to be of any use at all — a date, a name, a reference code — rather than merely close.