Multi-Agent Proof Pipeline: A Practical Guide to Generation, Review, and Formal Verification
This article explains how to structure a multi-agent proof pipeline for high-stakes tasks such as mathematical proofs, where a single generation pass is not enough. It covers why self-review by the same agent is not independent evidence, how to split work across four mutually exclusive roles, how to build reusable prompt templates that include prior failure notes, how to run cross-review in isolated groups with structured issue reports, and how to use formal verification as the final machine gate with rollback on failure. A practical checklist and common pitfalls are included for teams that want to try the workflow.
1. Starting From a Real Scenario: Where the Risk of “Generate and Merge” Lies
A common pattern in many teams looks like this: you ask a coding assistant to generate a piece of code, add “check for bugs” in the same session, get a reply saying “no issues found,” and merge directly into the main branch. The problem is that the generator and the reviewer share the same context, the same weights, and the same memory. Its “self-confirmation” does not count as independent evidence. This is especially dangerous for tasks like mathematical proofs, where one wrong step can bring down the entire argument.
The practice this article draws on works the other way around: a difficult proof task was produced by a generative agent in about 103 minutes, compiled into a 43-page document, then cross-checked by four independent agents split into two groups, and finally moved into formal verification. What is worth copying is not “who won,” but the second half of the sentence that follows: once the proof exists, who reviews it, how, and when is the review complete.
2. Why Math and Formalization Need a Pipeline
Mathematical proofs have two properties that rule out single-pass generation:
- Local errors are invisible: a wrong symbol or a swapped quantifier order still reads naturally.
- Verification is far cheaper than generation: a machine checking a proof line by line costs orders of magnitude less than a human writing it.
Formal languages (commonly discussed in industry as the interactive theorem prover approach) exploit the second property: if a human gets one step wrong, the compiler will not pass it. The workflow can therefore be designed as three stages—generate, review, formalize—gradually converging an untrusted natural-language artifact into something a machine can check.
A schematic skeleton of the flow:
[Problem definition] -> [Context and failure experience archive]-> [Generator agent: produce a complete proof draft]-> [Reviewer agents x N: independent review, report issues only, no rewriting]-> [Formalization: compile line by line, roll back on failure]-> [Human: set the problem / make the call / archive]
3. Division of Labor Across Four Roles (Reusable as Is)
The reference practice wrote the whole pipeline into a process document, with a four-role table at its core. Abstracted, it looks like this:
| Role | Responsibility | Input | Output | Key constraint |
|---|---|---|---|---|
| Problem setter (human) | Define the problem, decide “is it proved” | Conjecture, background | Task description | Does not join generation, avoids anchoring |
| Generator | Produce the complete proof | Background + blockers + past failures | Proof draft | Submits only a complete draft, not fragments |
| Reviewers (multiple) | Find gaps and circular reasoning | Proof draft | Issue list | No rewriting, no filling gaps |
| Formalizer | Compile and verify line by line | Draft | Pass/fail with location | Failure must trigger rollback |
The value of this table is mutually exclusive responsibilities: the generator does not review its own draft, reviewers do not patch holes for the generator, and the formalization step answers only to the compiler.
4. Prompts Are Not About “Well Written,” They Are About “Complete Context”
An easily overlooked detail: the prompt for that task was not written ad hoc. Another agent drafted it first, making three things explicit—the problem background, where it got stuck, and what had already been tried. Meanwhile, the working directory held a large batch of note files left over from several earlier failed rounds.
A reusable prompt structure:
## GoalProve conjecture A (complete proof, not an outline)## Known background- Relevant definitions and existing results- Dependencies on conjectures B/C## Blockers- Attempted path 1: reason for failure- Attempted path 2: reason for failure## Delivery requirements- A single complete document, compilable- Each lemma annotated with its dependencies
The key point: failure experience is an asset, not garbage. Structuring and archiving past failures significantly reduces repeated mistakes.
5. What Makes Cross-Review Actually “Independent”
What matters about the four review agents is not the number but the independence. Practical measures:
- Group isolation: two groups review separately and cannot see each other’s conclusions, avoiding convergence.
- Report only, no edits: reviewers output an issue list (location, type, severity) and do not rewrite the text.
- Classify and grade: distinguish “fatal gap / circular reasoning / notation inconsistency / wording that could be improved.”
- Convergence rule: only when fatal issues reach zero does the work move to formalization; non-fatal issues go to a to-do list.
A schematic review report format:
- id: R-07location: Lemma 3.2type: circular_reasoningseverity: fataldetail: the conclusion depends on an equivalent form of the proposition to be proved
6. Formal Verification: The Last Machine Safety Net
No matter how careful natural-language review is, it remains probabilistic. The point of formalization is to turn “looks correct” into “compiles.” Engineering notes:
- Layer the formalization: formalize the core lemmas first, then the main theorem, instead of rolling everything out at once.
- Roll back on failure: a compile failure must return to the generation stage; patching things up inside the formalization layer is not allowed.
- Traceable dependencies: annotate each result with the lemma numbers it depends on, forming a dependency graph.
- Pin versions: formalization scripts correspond one-to-one with draft versions, avoiding “the draft changed but the proof was never re-run.”
7. Implementation Checklist: What a Team Can Try Next Week
- Create a process document such as
PROCESS.mdthat spells out the four roles and the entry/exit conditions. - Templatize prompts with four sections: goal / background / blockers / delivery requirements.
- Archive failure notes as structured files organized by “path—failure reason—reusable conclusion.”
- Separate review from generation, with reviewers emitting a structured issue list.
- Add formalization as the final gate, with automatic rollback on failure.
- Keep only two things for humans: setting the problem and making the call.
8. Common Pitfalls
- Treating self-confirmation as review: re-checking in the same context is the same as not checking.
- Reviewers rewriting directly: this hides the distribution of issues and loses statistical meaning.
- Skipping formalization: natural-language pass rates are high, but confidence does not rise.
- Attempting full formalization in one shot: costly and hard to localize; proceed in layers.
9. Conclusion
The core of this method is not a particular tool but an organizational pattern: generation separated from review, review separated from formalization, machines handling verification, and humans defining the problem and making the final decision. When “doing a proof” becomes “assembling a team,” correctness no longer depends on a single lucky run but is guaranteed by the structure of the process.
