“Try Again” Doesn’t Work. “Here’s Exactly What You Broke” Does.
When an extraction comes back invalid, you have two choices. You can run it again and hope a different sample gets lucky. Or you can send the model its own broken output, the exact validation errors, and the relevant part of the schema, with one instruction: fix these, and change nothing else. The first option barely beats chance. The second recovers the large majority of failures that can be recovered at all. Same model, same document, same temperature. The only difference is whether the feedback contains information the model didn’t already have. I spent last term co-writing a survey arguing that this is how self-correction ought to work. This month I watched it hold on a system where being wrong costs real money.
What a good repair looks like
My first instinct was the plain retry, and its success rate was only slightly better than the original attempt. That makes sense once you think about it: the model made the same mistake for the same reason, and rolling the dice again doesn’t change the reason. Retrying on temperature alone is a lottery ticket, not an engineering strategy.
Feeding back the specific errors changed everything. A repair prompt in our pipeline tells the model that its previous output failed validation, lists the errors exactly as Pydantic reports them, such as a date of 31 February, a unit price written as “1.250,00,” or a currency of “EURO” when the schema allows only EUR, GBP and USD, and shows the schema rules for just those fields. The model no longer has to reread the whole document and rederive every field. It has to correct three named defects, and easier tasks succeed more often.
Two details made it work in practice. The first is keeping the repair prompt small. Early on I resent the entire document along with the errors, which was slower, more expensive and, surprisingly, less accurate, because the model would sometimes re-extract everything from scratch and introduce fresh mistakes. Sending only the broken output and the errors limits the blast radius of the fix. The second is capping the loop. A model that has failed twice on a document will usually fail a third time, so two repair attempts capture almost everything recoverable and anything beyond that is cost without return. After the second failure the document goes to a human reviewer with its full trace attached.
The experiment I’d already run by accident
The part of this I find most satisfying closes a loop that’s been open since April 2025. An earlier version of the pipeline included a step that asked the model, before returning its answer, to review its own extraction carefully and correct any mistakes. That’s pure self-critique with no new information. It produced a negligible improvement, and occasionally it “corrected” a right answer into a wrong one. Replacing it with the validator-driven repair produced a dramatically better recovery rate on the same model and the same documents. The only thing that changed was where the correction signal came from: inside the model, or outside it.
That isn’t a prompt-engineering trick. It’s the intrinsic versus extrinsic distinction the whole survey is built around, showing up in production data on a system nobody designed to test it. The literature explains why. Studies such as Huang and colleagues’ at ICLR 2024 show that asking a model to check its own reasoning without any external signal often makes things worse, and Kamoi and colleagues argue that self-checking can only work when verifying an answer is truly easier than producing it. Asking a model to re-examine its own subtle reasoning asks it to solve a problem as hard as the original while anchored on its first attempt. Asking whether some JSON satisfies a schema is a much easier problem, and a validator solves it perfectly.
Validators are the best critics you’ll ever hire
This has become a design rule for me: look for a deterministic verifier before reaching for a model critic. A Pydantic validator never hallucinates, never gets tired, never flatters the output it’s checking, and points at the exact field that failed, all for essentially no cost. Perfect critics like that are everywhere once you start looking: parsers, schema validators, interpreters, test suites, reconciliation rules and reference data. Where none exists, you can often decompose the question until one does. “Is this summary good?” can’t be verified. “Is each claim in this summary present in the source document?” can, one claim at a time. And if you truly have to use a model as the critic, break the symmetry by using a different model, giving it a different context, or turning the judgment into a narrow extraction task.
What production added that research couldn’t
Production taught me three things the harness never could. Repair rate turns out to be an excellent early warning of drift. If one stage suddenly needs repairs more often, the input has probably changed, perhaps a new client template or a new document format, and that shows up in the traces well before any person notices worse output. You only see it with per-step traces and real volume. The repair budget also turned out to be an economic decision rather than a technical constant: two attempts is roughly the point where the extra recoveries stop justifying the extra cost, and you need real cost data to find that point. And every document that exhausts its repairs and gets fixed by a reviewer is a labelled example of precisely what the system finds hard. A review queue that doesn’t feed your evaluation set is throwing away your most valuable data.
The survey is stronger for all this, because I can now write about the extrinsic case with production evidence rather than a harness I built to make the point. There’s also a second paper hiding in this system. A production self-correcting extraction pipeline, documented with real failure taxonomies and real repair economics, is exactly what industry and system-demonstration tracks exist for. If there’s one thing I’d tell anyone who wants to do research without a PhD, it’s that the best questions come from systems you actually run, because you hit edges nobody has written about yet.
All of this works because extraction comes with verifiers built in: schemas, arithmetic and reference data. The next system I’m working on produces prose, and there’s no validator to write for prose.
Leave a Reply