The simplest graders, used way too rarely
Before you reach for an LLM judge, ask: "is there a string check that would settle this?" Most teams skip exact-match and contains because they feel beneath them. They are wrong. These graders are free, deterministic, instantaneous, and catch a surprising fraction of real regressions.
When exact-match works
- Single-token answers (yes/no, true/false, A/B/C/D classification).
- Numeric answers with a fixed format.
- Code generation when the prompt asks for a specific function name.
- Structured fields inside JSON output.
Why 'contains' is the workhorse
For most natural-language tasks, exact match is too strict ("Paris" vs "Paris is the capital of France"). The contains grader checks whether the reference appears anywhere in the output, optionally case-insensitively. It accepts wordy or terse phrasing while still catching outputs that are wrong.
Multi-reference contains
Real questions often have multiple acceptable phrasings. "What is the capital of South Sudan?" can be answered "Juba", "Juba is the capital", or "South Sudan's capital is Juba." Storing a list of acceptable references and matching any one of them keeps the grader strict on substance and lenient on style.