# Why LLM evals lie until you build a real gold set

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

- **Published:** 2026-11-24
- **Tags:** ai, engineering
- **Canonical:** https://nbarwicki.com/blog/33-ai-pipeline-evals/

---

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.



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.



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.



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.



### 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):

| Iteration | What changed | Correct (of 165) | Wrong | Review published | Unneeded review | Output tokens | p50 latency | Cost / sub |
|---|---|---:|---:|---:|---:|---:|---:|---:|
| 1. Baseline | Full schema, 64-char hashes, per-field quotes | 112 | 12 | 13 | 17 | 1,007 | 12.4 s | $0.00134 |
| 2. Policy in code | `1 ml = 1 g` default + Polish-label routing in code | 127 | 2 | 15 | 12 | 956 | 10.0 s | $0.00136 |
| 3. Compact schema | Photo numbers (`1`, `2`) instead of hashes, keep quotes | 125 | 6 | 14 | 10 | 520 | 7.2 s | $0.00107 |
| 4. No quotes | Dropped per-field quotation fields completely | 130 | 6 | 15 | 5 | 272 | 6.0 s | $0.00093 |
| 5. Final (shipped) | Bare compact schema + search-ready naming rules | 135 | 6 | 13 | 0 | ~260 | ~6.0 s | ~$0.00100 |

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



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:



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.**
