A Baidu training method shows a smaller AI can flag a single bad step in a larger AI's math reasoning, but the fix lives in the contrast between successful and failed patches, not the patch text.
A large language model walks through a math problem step by step, lands on a confident-looking answer, and gets it wrong. The error is usually tiny: one bad move buried in a chain of otherwise correct reasoning. A new training framework from Baidu researchers argues those errors are local, not global, and proposes a counterintuitive fix: use a smaller model to find the bug, then teach the larger model from the contrast between when the small fix works and when it doesn't.
The framework, called Woodpecker Distillation, is described in a preprint posted to arXiv by Dayu Wang and colleagues at Baidu, with Wang affiliated at Nanyang Technological University. The authors argue that reasoning failures in strong language models rarely look like the model has lost the plot entirely. They look like a single broken step inside an otherwise coherent solution. If that step can be identified, the trajectory can be corrected, and the rest of the model's prior work is not wasted.
The method takes advantage of that locality. The team runs a large model on a math problem until the model produces a step that turns out to be wrong, then a smaller, cheaper "probe" model writes a short patch that gets inserted right after that bad step. The probe's job is to push the rest of the solution back onto a correct path. Sometimes it works, sometimes it doesn't, and that variability is the point.
The authors report that directly fine-tuning a large model on the rewritten, corrected trajectories does not reliably internalize the fix. A large model that memorizes the small model's exact words is not, by itself, a better reasoner. Once the patch has been inserted, every subsequent token the large model is now more likely to produce has shifted in a particular direction. That shifted distribution is the teacher.
To extract that teacher, the team builds a contrast. The same large model, at the same reasoning prefix, is asked to continue with and without the weak probe's patch. The difference between those two future-token distributions, when the patch leads to a correct solution, becomes the corrective signal. The strong model is then trained to reproduce that distribution at the bug site, so the next time it encounters a similar step, its own continuation already leans toward the right path without the patch having to be there at all.
The evaluation, per the abstract, sits on mathematical reasoning benchmarks. The reported gains are consistent across settings and beat direct imitation of the weak patches, which is the relevant baseline because it isolates the value of the contrast itself. The work has not yet been peer reviewed. The code repository attached to the project points at a related exploration rather than the headline method, so replication questions will turn on whether the contrastive loss behaves the way the abstract claims once other groups run it. The mechanism is also specific to step-by-step reasoning where a single wrong move can be isolated, which is a closer fit to math than to open-ended chat or image-grounded reasoning.
A model working through a word problem might set up a ratio correctly, write the first algebraic step correctly, then drop a sign, miscount a term, or misread a constraint. The setup was fine, the move that follows is not, and the rest of the solution compounds the error. The probe is asked to write a small bridge over that step, often just a sentence or two, and the question is whether the rest of the model's reasoning snaps back into place. In the cases where it does, the contrast between the with-patch and without-patch continuations at that exact prefix is what the strong model is trained to reproduce.
A small, cheap model in the right place can be an auditing layer for a larger one, not just a fallback. Training pipelines can aim at the distribution of the model rather than the words of the patch, which means a strong model can be improved without being retrained on raw human answers. The pattern matters for anyone buying or building reasoning systems, because it splits the audit from the answer.
A practical watch item is whether the contrastive teacher distribution survives contact with longer, multi-step problems where the bad step is harder to localize, and whether the approach generalizes beyond math into the structured-reasoning tasks that show up in agentic workflows. The next external test is independent reproduction on the math reasoning benchmarks the paper reports, since the public code repository points at a related exploration rather than the headline method itself.