Design the evaluation for a document understanding feature: users upload invoices and scanned forms and ask questions about them.
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
The structural decision is to separate perception from reasoning, because they fail differently and the fix is different.
Full worked answer
The structural decision is to separate perception from reasoning, because they fail differently and the fix is different.
Perception: can the model read what is on the page. Grade this as structured field extraction against annotated ground truth: invoice number, dates, line items, totals. Code-graded with normalisation, since dates, currency and whitespace differences are parser noise, not model error. Reasoning: given what it read, is the answer right. Run this against the ground-truth extraction to isolate it.
The split earns its keep in diagnosis. "Total is wrong" is useless. "It read 1,240 as 1.240 and then reasoned correctly" is a preprocessing fix; "it read every field correctly and summed wrong" is a different fix entirely. Without the split you will tune prompts against an OCR problem.
For open-ended questions you need a judge, and here is the trap: the judge has to see the image too. A text-only judge grading against a human caption inherits every blind spot of that caption, and you end up evaluating the caption. A vision judge is expensive and brings its own bias surface, so keep as much as possible on code-graded extraction.
Slices matter more here than in text, and they are physical: resolution and DPI, rotation and skew, handwriting versus print, multi-page versus single, language and script, photograph versus clean scan, and layout type (tables, dense prose, charts). Failures cluster hard on these.
Add perturbation robustness, which text evals rarely need: downscale, JPEG-compress, rotate a few degrees, and check the answer does not flip. If it does, you have a fragile feature regardless of pass rate.
Cost and latency: image tokens dominate, so track tokens per page and cost per document, not per request.
On ground truth, be realistic. Annotating one document is minutes, not seconds. Start at ~100-200 documents stratified across those slices, and buy the rest with production failures. Public multimodal benchmarks will not predict performance on your document distribution.
What a good answer covers
- The structural decision is to separate perception from reasoning, because they fail differently and the…
- Perception: can the model read what is on the page
- Grade this as structured field extraction against annotated ground truth
- Code-graded with normalisation, since dates, currency and whitespace differences are parser noise, not…
- Reasoning: given what it read, is the answer right
In the glossary: Judge (LLM-as-judge)
Interviewer follow-ups to expect
How would you evaluate a 40-page document where the answer requires two facts from different pages?
Your vision judge costs more than the feature. What now?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep