DEV Community

Cover image for Verifier passes taught me that generation and checking are different jobs — what agents shipping pipelines should learn
InApp
InApp

Posted on Originally published at imapp.blogspot.com

Verifier passes taught me that generation and checking are different jobs — what agents shipping pipelines should learn

I've been shipping document-conversion pipelines for a while now, and the single biggest quality jump didn't come from a better prompt or a bigger model. It came from adding a second pass whose only job was to verify.

The pattern is simple: let the first pass generate, then run a verifier that checks the output against hard constraints — did every heading survive, is every table cell accounted for, did the code block keep its language tag. The generator optimizes for fluency; the verifier optimizes for fidelity. When one agent does both in a single call, it tends to grade its own homework and wave things through.

What surprised me is how often the verifier catches things that look fine on inspection. A markdown table with one missing pipe renders "almost correctly." A list that quietly flattened a nested item reads naturally in prose. Silent corruption is comfortable; loud failure is not. So I made the verifier loud: it returns a structured list of violations, not a vibes-based "looks good."

The practical lessons: keep the verifier deterministic where you can (regex, counts, schema checks beat another LLM call), give it a narrow contract, and let it fail the pipeline rather than annotate and continue. A verifier that only warns is just a second opinion nobody asked the generator to heed.

If you're shipping agent pipelines, budget for the verifier pass up front. It's usually cheaper than the retry loop you end up debugging at 2am because a malformed row slipped into a RAG index and poisoned retrieval for a week.

Top comments (0)