Nikolas Barwicki AI Product Engineer

Why LLM evals lie until you build a real gold set

Why LLM evals lie without a gold set, and what actually moved production.

Build note Nov 24, 2026 12 min read

A few weeks into building a calorie tracker, I had a production AI pipeline that worked and no real idea how well.

The flow is simple. A user scans a barcode. If the product isn’t in the database, they photograph the front of the package and the nutrition table. A queue worker sends the photos to a vision model with a strict JSON schema. Deterministic code validates and normalizes the output. If the submission is a new product with zero validation warnings, it publishes automatically. Everything else lands in my review queue.

Product submission flow A user scans a barcode of a product not yet in the database, photographs the front and the nutrition table, a queue worker sends the photos to a vision model with a strict JSON schema, and deterministic code validates and normalizes the output. New products with zero warnings publish automatically; everything else goes to the review queue. Scan barcode not in database yet Photograph label front of pack nutrition table Vision model strict JSON schema via queue worker Code validate + normalize NEW + 0 WARNINGS ANYTHING ELSE Auto-publish live immediately Review queue manual check

The scanner supplies identity. The vision model only reads the label.

For the first few weeks, that felt solid. Bad edge cases failed validation, I added rules for them, and the pipeline kept running. Then I built a real eval harness and spent two days staring at actual numbers. Half of what I had been calling progress was noise.

Without a hand-labelled gold set and a scorer that mirrors production decisions, LLM evals don’t just leave you blind — they manufacture confidence out of noise.

Passing validation is not being right

Early on, I mixed up two different gates: is this output well-formed? and is this output true?

My validator checked types, required fields, unit consistency, and quotation rules. When a ketchup label failed because fat was printed as <0,5 g, I added a rule to normalize <0.5 g to 0. Every production bug turned into another deterministic guard. It felt like solid engineering.

Then I pulled 41 real user submissions and graded them by hand against the actual photos.

The validation gate had passed 38 of 41 outputs as clean. My own review said only 15 of 41 product names were right. A vision model had turned “Szynka Roztoczańska pieczona na maśle” into “Szynka”, and the validator stamped it clean and ready to publish.

Breaking down my manual edits by field made the real failure mode clear:

  • Macros and package sizes: 0 changes out of 41. The model was already reading numbers fine.
  • Product name: 25 changes out of 41.
  • Variant / claims: 36 changes out of 41.
Validation pass rate versus hand-graded correctness on 41 submissions The validation gate passed 38 of 41 outputs as clean, while only 15 of 41 product names were right. Manual edits by field: macros and package sizes 0 of 41, product name 25 of 41, variant and claims 36 of 41. 41 REAL SUBMISSIONS, GRADED BY HAND Passed validation 38 / 41 Product name right 15 / 41 MANUAL EDITS BY FIELD Macros & package sizes 0 / 41 Product name 25 / 41 Variant / claims 36 / 41

That audit saved me from tuning the wrong thing. If you don’t look at real outputs next to real inputs before touching prompts, you guess. I would have spent days rewriting nutrition instructions when the actual problem was product identity.

Unlabelled evals get even worse once you put coding agents in the loop. When I started rebuilding the pipeline, my agent began running experiments across prompt variants and reasoning effort levels before my labelled dataset existed. It reported that a new prompt raised the auto-publish rate from 21/36 to 25/36.

It looked like a win. It meant nothing. A prompt that publishes more looks better on a dashboard even when it is publishing bad data. I stopped the session and asked:

“What are you doing without a golden dataset prepared by me?”

Without ground truth, every metric you optimize (pass rate, publish rate, latency) is a proxy you can game by accident.

Why an LLM-as-a-judge fell short

Before committing to hand-labelling, I tested the obvious shortcut: use a stronger vision model as an LLM-as-a-judge.

I gave the judge the original photos, the candidate extraction, and a field-level rubric, with ground truth hidden. Across 51 submissions, it passed 31 and flagged 20. It caught real bugs, including a mozzarella extracted at 76 kcal when the label clearly printed 220 kcal.

I still didn’t wire it into the publish gate, for three reasons:

  1. Uncalibrated judges are just second opinions. Until you measure a judge’s precision, recall on critical errors, and agreement against human labels, you don’t know if its “pass” is safe or if it is silently missing 10% of broken macros.
  2. Same-family blind spots. When the extractor and judge come from the same model family, they tend to misread the same tricky fonts and layouts.
  3. Tooling bugs hide inside the rubric. In my first judge run, the validator demanded a text quote for a boolean field (energyIsLabelStated: false), silently dropping a valid case.

An LLM judge works well for sorting failures so you know what to inspect first. It does not replace a human-verified gold set.

Building an eval harness you can trust

I downloaded every real submission photo from object storage into a gitignored local mirror, hash-verified each file, and wrote a small TypeScript eval harness (~2,000 lines, pennies per full run). Five choices made it actually useful.

Hand-labelled gold, including “do not publish”

I built a small local web UI that puts the original product photos next to a draft extraction so I could check against the actual pixels. I labelled 55 real cases: 47 that should auto-publish and 8 that must route to human review (unreadable photos, glare over the nutrition table, or multi-component packs like meat with a separate sauce sachet).

Happy-path examples only test half the system. In production, knowing when to refuse or route to a human matters just as much.

A 5-bucket scorer that mirrors production

My scorer does not grade raw model JSON in isolation. It runs the exact same validation and normalization functions as the production worker, then sorts every run into one of five outcomes:

  • published_correct — auto-published and matches gold.
  • published_wrong — auto-published with a wrong nutrition, package, or portion value.
  • published_needs_review — auto-published when gold says a human should have checked it.
  • review_correct — sent to review, matching gold.
  • review_unneeded — sent to review when it should have auto-published cleanly.
Five-bucket scorer: pipeline decision against the gold label Grid of gold label (publish, 47 cases; review, 8 cases) against pipeline decision (auto-published; sent to review). Gold publish and auto-published splits into published_correct and published_wrong. Gold publish and sent to review is review_unneeded. Gold review and auto-published is published_needs_review. Gold review and sent to review is review_correct. GOLD SAYS AUTO-PUBLISHED SENT TO REVIEW Publish 47 cases Review 8 cases published_correct matches gold published_wrong wrong nutrition, package, portion review_unneeded should have auto-published published_needs_review a human should have inspected review_correct matches gold

Only wrong nutrition, package, basis, density, or portion values count as published_wrong. Names and variants are tracked separately, because a slightly clumsy product name is better auto-published and fixed later than blocking the user.

My first scorer lumped published_wrong and published_needs_review into a single “wrong” bucket. Splitting them dropped the baseline’s apparent wrong-value count from 16 to 6 and showed what was actually breaking: the pipeline wasn’t making up numbers as often as I thought. It was overconfident on hard labels that belonged in review.

Repeats, immutable runs, and testing the ruler

LLMs are non-deterministic even at low temperature. Across 26 dev cases, extraction decisions flipped between identical runs on 6 to 10 cases. A single-pass eval would have made random variance look like a 15% gain.

Every config runs 3 times (55 cases × 3 = 165 scored runs, about $0.22 per full pass). Every variant is named, cached, and immutable: you never edit a prompt after it runs, you add the next one. I also wrote a planted-error unit test for the scorer itself to verify it catches a mutated nutrient value instead of silently passing.

Dev/holdout split (and how fast you can ruin it)

I split the 55 cases by barcode: 26 in dev for iteration, 29 in holdout (~28% of unique products initially, expanded as I labelled) saved for final checks.

One iteration showed why that split matters. After adding rules for unreadable digits and two-component packs, the new prompt gained +8 correct runs on dev over baseline. On the holdout, it gained zero. Every point of that “improvement” was overfit to the 26 products I had been staring at.

Same prompt change scored on dev and holdout Gain over baseline in correct runs: plus 8 on the 26 dev cases used for iteration, zero on the 29 holdout cases. GAIN OVER BASELINE, CORRECT RUNS Dev 26 cases, iterated on +8 Holdout 29 cases, untouched 0

Treating gold as a living dataset

Your own gold labels will have bugs. On an early run, exact-match scoring penalized the model on a pack of buns because I had misread fibre (3.0 g) as protein (9.6 g). The model was right; my ground truth was wrong.

I fixed that by inspecting every diff where the model disagreed with gold, and by adding acceptable lists for fields like product names where more than one phrasing is genuinely valid.

Schema and policy beat prompt prose

Once the harness was solid, the biggest gain didn’t come from a prompting trick. Most “prompt problems” in production LLM pipelines are schema or policy bugs.

First, I moved business policy out of the prompt and into code. Almost every drink in the dataset was failing validation and landing in my review queue because beverage labels rarely print density. Rather than asking the model to guess density in the prompt, I wrote a rule in code: if no density is printed, assume 1 ml = 1 g. Imported labels with no Polish text were also auto-publishing; adding a boolean flag and routing non-Polish labels to review in code took minutes. Policy in code is deterministic, testable, and won’t drift when you swap models. Keep the prompt for reading the image.

Second, I shaped the output schema for the model, not the database. My baseline prompt forced the vision model to return a large JSON document where every extracted field carried a 64-character SHA-256 photo hash and an exact text quote as “evidence.” That sounded thorough on paper. In practice, models are bad at copying 64-character hashes, and every minor missing quote tripped a validation warning and sent a good product to manual review.

I asked myself if we actually needed any of it. I replaced the 64-character hashes with photo numbers (1, 2) that code maps back to hashes, then dropped per-field quotes completely. Code expands the compact model output into the database schema.

Finally, I tightened the naming rules so products read cleanly in search results: use the product’s own name without repeating the brand or range, keep differentiators and flavour, and map variants to a fixed set of printed claims.

Here is how five clean iterations played out across all 55 gold cases × 3 repeats (165 runs):

IterationWhat changedCorrect (of 165)WrongReview publishedUnneeded reviewOutput tokensp50 latencyCost / sub
1. BaselineFull schema, 64-char hashes, per-field quotes1121213171,00712.4 s$0.00134
2. Policy in code1 ml = 1 g default + Polish-label routing in code1272151295610.0 s$0.00136
3. Compact schemaPhoto numbers (1, 2) instead of hashes, keep quotes125614105207.2 s$0.00107
4. No quotesDropped per-field quotation fields completely13061552726.0 s$0.00093
5. Final (shipped)Bare compact schema + search-ready naming rules1356130~260~6.0 s~$0.00100

The remaining 9 to 11 runs in each row are review_correct, bringing every row to 165.

Eval progression across five pipeline iterations Horizontal bar comparison of five iterations (Baseline, Policy in code, Compact schema, No quotes, Final) across three metrics: Correct out of 165 runs (112, 127, 125, 130, 135), Unneeded reviews (17, 12, 10, 5, 0), and Output tokens per call (1007, 956, 520, 272, 260). ITERATION CORRECT (OF 165) UNNEEDED REVIEWS OUTPUT TOKENS 1. Baseline hashes + quotes 112 17 1007 2. Policy in code 1 ml = 1 g, Polish gate 127 12 956 3. Compact schema photo #s, keep quotes 125 10 520 4. No quotes bare compact output 130 5 272 5. Final (shipped) bare + naming rules 135 0 ~260
Five iterations scored across 55 gold cases × 3 repeats (165 runs). Moving business rules to code and stripping schema overhead drove the real gains — cutting output tokens ~4× and eliminating unneeded reviews.

Moving to the compact schema bumped wrong extractions from 2 back to 6 (still half of baseline’s 12, with all 6 on dev and 0 on holdout in the final version), and dropping quotes kept wrongs flat at 6. In return, output tokens fell roughly 4× (from 1,007 down to ~260), median latency dropped in half (from 12.4 s to ~6 s), cost per submission fell by about 30%, and unneeded reviews went from 17 down to 0. That was an easy tradeoff to ship.

Just as useful were the ideas the harness talked me out of. I stayed on a cheap, fast model by design; testing medium reasoning effort with original image detail pushed median latency to 17.6 s, raised cost, and published fewer products. I also simulated a deterministic 4/4/9 calorie-consistency guard across 21 products. It caught zero real errors and flagged 3 good publishes, so I killed it instead of shipping a check that only sounded smart on paper.

Most of what looked like “caution” in the old pipeline was just the cost of forcing an LLM to output a format it was bad at.

Closing the loop in production, and where evals stop

Offline evals only cover what you already have. Once the compact schema shipped, I built a small admin review panel for a “publish first, review later” flow. Clean products go live right away so users aren’t blocked, and I fix clumsy names or check flagged edge cases on my own time.

Every correction in that admin panel becomes a new gold example, feeding production back into offline tests:

Production extraction pipeline and eval flywheel Top lane shows production flow: User submits barcode and photos, Vision LLM returns compact JSON, Deterministic Gate runs validation and policy rules, splitting into Auto-Publish for clean new products and Review Queue for edge cases. Bottom lane shows the eval flywheel: both outcomes feed an Admin Review Panel where human corrections expand the Gold Dataset, which drives the Eval Harness (3x repeats, 5-bucket scorer) before any prompt or code change is promoted. PRODUCTION PATH EVAL FLYWHEEL Submission barcode + photos R2 + queue Vision LLM compact JSON photo #s, no quotes Deterministic Gate validate + normalize policy in code Auto-Publish clean new product Review Queue warnings / edge cases Admin Review Panel fix errors, QA published human ground truth Gold Dataset publish + review cases dev / holdout split Eval Harness 3x repeats · 5-bucket scorer mirrors production gate REQUEST FLOW FEEDBACK & SCORING PROMOTE ON MEASURED GAIN POST-PUBLISH QA
Production extraction path (top) and the eval flywheel (bottom). Code owns business policy and routing; human corrections in the admin panel feed new gold cases back into the harness.

These numbers still have real limits:

  • Small sample, one labeller. 55 cases from a handful of early users is enough to catch structural bugs, not enough to claim general accuracy.
  • Holdout contamination is real. Once I started inspecting holdout failures to tune naming rules in later iterations, the holdout stopped being clean. Getting an honest estimate now means labelling a fresh batch of unseen submissions and scoring them once.
  • Evals test extraction, not the user experience. The day I moved extraction to the cloud and tested the flow on my phone, the pipeline worked cleanly — and the app gave the user zero feedback after submitting. The tray closed, nothing appeared, and there was no notification when the product published. No offline eval harness would catch that.

If you are shipping an LLM pipeline to production, you don’t need a heavy eval platform on day one. You need 30 to 50 real examples you labelled yourself, a scorer that runs your real production gate, 3× repeats so variance doesn’t fool you, and the discipline to move business rules out of the prompt and into code.

If you can’t tell a smarter model apart from a looser gate, you’re just guessing with better charts.

Newsletter

Get the next one by email

I’ll send you new articles, plus the interesting links, sources, working notes, and behind-the-scenes details that shaped them.

Free. Unsubscribe anytime. Powered by Substack.