cs.AIOct 26, 2026

How Stable Are LLM-Generated Proofs Under Program Refactoring? A Stress Test for Verifiable Code Generation

Authors: Aravind Mandiga, Guoming Li

Organizations: University of Georgia, Athens, USA

Abstract

Benchmarks for verifiable code generation usually test a proof against one fixed implementation. We ask whether the same proof remains valid after a program refactoring that preserves behavior. We introduce RefactorProof, which derives 458 Lean-certified variants from the 185 VERINA tasks that compile in our pinned environment while holding the specification and evaluated proof fixed byte-for-byte. VERINA supplies reference proofs for 46 tasks, all from its basic split; the primary model-versus-reference comparisons further match on 21-25 short, non-recursive tasks. Structural refactorings expose substantial brittleness across proof sources: task-normalized structural PSR is 4.3% for the supplied references and 13.3-26.8% for the specialized provers. On the matched tasks, specialized prover proofs nevertheless have higher overall unchanged-proof survival than the supplied reference artifacts: +15.6 points for DeepSeek-Prover-V2-7B, +18.8 for Goedel-Prover-V2-32B, and +20.3 for Goedel-Prover-V2-8B; all three 95% CIs exclude zero. The ordering persists after excluding universally survived T1 variants, under family-balanced aggregation, and under alternative deployable valid-proof selection rules. However, unchanged-proof failure is not the same as high repair cost: predefined one-identifier edits repair 51/54 eligible reference structural failures and 58/85 eligible prover failures. RefactorProof therefore measures unchanged-proof stability under program refactoring, not the cost of maintaining a proof after it breaks.

Figures & tables

Appendix figures & tables8 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Proof-Refactor: Refactoring Generated Formal Proofs into Modular Artifacts

    Jun 2, 2026Yiming Fu, Peixuan Liu, Zichen Wang +1Interactive Theorem ProvingLean Theorem Proving

  2. Lean Refactor: Multi-Objective Controllable Proof Optimization via Agentic Strategy Search

    May 18, 2026Jialin Lu, Soonho Kong, Rodrigo Stehling +4Large Language Model-Guided OptimizationLean Theorem Proving

  3. P3^{3}: Joint Program-and-Proof Planning for Verified Code Generation

    Aug 10, 2026Zenan Li, Ziran Yang, Peiyang Song +2Code GenerationFormal Verification