Definition

Exact-match evaluation checks whether a system output equals an expected value under a predefined comparison rule. A strict comparison requires the same characters in the same order, including capitalization, punctuation, and whitespace.

Some evaluations normalize both values before comparing them. They might trim surrounding whitespace or convert text to lowercase. The result is still an exact match, but it is exact after that declared transformation. Each case usually receives a binary pass or fail, and the overall score is the share of passing cases.

Simple example

A support classifier must return one of three labels: billing, technical, or account. For one test case, the expected value is account.

An output of account passes a strict exact-match check. Account, account., and The category is account all fail, even though a person can infer the same label. If the application contract permits differences in letter case, the evaluator can normalize case before comparison. It should not silently ignore differences that the contract considers meaningful.

Why it matters

Exact matching is useful when a task has one canonical answer or a tightly defined output contract. It is cheap to run and easy to reproduce, which makes it practical for regression tests in an evaluation harness. When a case fails, the expected and actual values show what differed. No separate model-based grader is needed.

The method works well for classification labels and structured fields after parsing. Applied to raw output, exact matching can catch formatting changes that would break a downstream consumer. It does not award partial credit or explain why an answer differs.

One important nuance

Equivalent meaning does not imply an exact match. If the expected answer is Pass a cancellation token, an output such as Use CancellationToken for the request may express the same guidance and still fail. That makes raw exact matching a poor choice for summaries and support replies.

Decide normalization rules before running the evaluation. If a task allows many valid answers, use a check that reflects the real requirement. That might mean comparing parsed fields or executing generated code. Open-ended text may need a reviewed rubric instead. Otherwise, the score may measure wording more than correctness.