arXiv:2610.22698cs.AIOct 2026

Manuscript Offprint

arXiv:2610.22698

Repair, Retry, and the Cost of Hindsight: Verifier Feedback in Formal Theorem Proving

Jack Li, Sophia Li

Abstract

Verifier-guided self-repair conditions a model on feedback from failed attempts before it tries again, without updating model weights. Yet two findings in prior work are in tension: verifier feedback can improve repair of failed outputs, but self-repair itself can provide little-to-no advantage over independent resampling. Here, we provide an empirical reconciliation in Lean theorem proving through controlled one-step experiments that deconstruct repair by holding the preceding failure fixed while varying whether the failed proof is shown, whether the compiler error corresponds to that failure, and how the model is instructed to try again. We test frozen Qwen3.6-27B, a general-purpose model, and DeepSeek-Prover-V2-7B, a specialized prover model, on difficult MiniF2F problems. We find two opposing effects. Displaying the model's failed predecessor reduces success and sharply increases copying of it, while on Qwen adding that attempt's compiler error recovers the loss, to the level of the diagnostic shown alone. Replacing the predecessor with another theorem's failed proof largely removes the degradation on both models; on Qwen, replacing the diagnostic with another problem's error substantially reduces the recovery. Without the failed proof, correct diagnostics show no resolved advantage over wrong-diagnostic controls on either model. The failed-proof penalty persists with and without the retry instruction, whereas Qwen's diagnostic recovery is weaker without it. The predecessor penalty is accompanied by sharply increased copying of the model's own failed proof. Separate 11-problem sequential experiments on both models extend the comparison through 64 attempts: Qwen retains a correct-diagnostic benefit within failed-proof histories, whereas DeepSeek-Prover shows no resolved within-repair recovery. However, these recovery effects do not imply an advantage for self-repair as a test-time technique. In particular, no tested one-step feedback condition establishes an advantage over instruction-only resampling, nor does 64-attempt sequential repair with failed proofs and correct diagnostics at equal token budgets. These findings support interpreting the usefulness of verifier feedback separately from the net performance of self-repair, since a diagnostic can improve repair without overcoming the performance loss from conditioning on a failed attempt.

1 Introduction

Verifier-guided self-repair asks a language model to correct a failed attempt using feedback. Diagnostics can identify what went wrong, yet their apparent value depends on the comparison: proof-repair studies find them crucial [First et al., 2023], while budget-aware evaluations find modest gains that independent resampling can match [Olausson et al., 2024]. Repair prompts bundle a retry instruction,

∗^{*}Equal contributions, order determined by coin flip

NeurIPS 2026 Workshop on AI for Verifiable Coding.

a failure notice, a diagnostic, and the failed attempt. We separate these components to ask whether diagnostics help repair an exposed failure and whether the resulting repair improves over starting fresh.

We study prompt-based feedback on frozen Qwen3.6-27B and DeepSeek-Prover-V2-7B models in Lean theorem proving. Unlike success on finite software tests, an accepted Lean proof establishes a fixed formal statement relative to the environment's definitions and trusted axioms, enabling evaluation without a learned judge. Our controlled one-step experiments hold failed predecessors fixed while varying the retry instruction, failed proof, diagnostic, and replacement context. Sequential experiments on separate 11-problem banks for both models then follow evolving repair histories through 64 attempts.

Our controls extend prior decompositions of repair feedback by separately testing predecessor correspondence and instruction-dependent diagnostic effects. Failed-code replacement asks whether harm is specific to the model's own predecessor rather than generic proof-like context; correct, ordinary-shuffled, and class/length-matched diagnostics test whether recovery depends on correspondence; and instruction crossings test whether that recovery is a property of the diagnostic alone. The fixed-predecessor design isolates these comparisons more directly than an evolving repair loop, while the sequential design tests whether their patterns persist when attempts become history.

Showing each model its own failed proof reduces success and increases predecessor copying, while replacing it with another theorem's failed proof restores performance toward the failure-only scaffold and nearly eliminates copying of the model's own predecessor. On Qwen, adding the correct diagnostic recovers this loss (40 problems, against 41 for the diagnostic alone), mostly on predecessors written in obsolete Lean 3 syntax (an exploratory subgroup), where it also beats a class/length-matched wrong diagnostic; no analogous within-repair recovery is resolved on DeepSeek-Prover. Sequentially, Qwen retains a resolved correct-versus-wrong diagnostic benefit within repair; DeepSeek does not, although its matched difference-of-effects is nominally positive because matched wrong diagnostics perform better in the code-free protocol. No tested feedback condition establishes an advantage over instruction-only retrying in the one-step experiments, and sequential repair remains below or does not resolve an advantage over memoryless retrying at 64 attempts or at equal token budgets. Together, these results separate feedback that helps repair an exposed failure from evidence that repair itself is preferable to starting fresh.