← News

ResearchSources: arXiv · 30 Nov 2026

arXiv paper tests whether language models can prove code rewrites preserve behavior

Researchers propose a checkable proof format for verifying that model-generated code rewrites keep program behavior, and report that verifier-guided refinement lifts proof acceptance from 56.4% to 80% across five models.

In plain words

When a language model rewrites code, users need assurance the rewrite does not change what the program does. The paper's authors propose a text-based proof format, checked automatically, that models can use to argue a rewrite is behavior-preserving. In their tests, guided refinement of these proofs substantially improved how often the checks accepted them.

What was announced

The authors, writing on arXiv, note that language models increasingly optimize and migrate code, and that trusting such rewrites requires independently checkable arguments that behavior is preserved. They propose a lightweight textual proof format based on relational Hoare logic, a logic for reasoning about pairs of programs, with automatic checks of intermediate claims. Models may leave some claims underived as explicit assumptions, so partial proofs remain checkable while recording how much of each argument the model actually derived.

The evaluation covered five models on 200 equivalent program pairs written in two imperative languages with unfamiliar syntax and guard semantics. In free-form reasoning, every model reached the correct verdict on at least 66% of tasks, but proof acceptance without feedback ranged from 36% to 94%. A verifier-assisted workflow that uses the checks to guide proof refinement raised overall acceptance from 56.4% to 80%, with the two strongest models exceeding 97%. The proof records also showed differences that acceptance rates hide: among accepted proofs, some models derived nearly every step while others left most of the argument as explicit assumptions. The authors say failure patterns give a profile of each model's relative strengths and weaknesses.

What it does not show

  • The evidence is the paper's abstract only; full methodology, implementation details and peer review status are not available in the supplied passages.
  • Results come from the authors' own benchmark of 200 program pairs in two imperative languages, so generalization to other languages or real-world codebases is not established by this evidence.
  • The reported acceptance improvements are the authors' own measurements and have not been independently confirmed.

For security and IT teams

Scope
The paper addresses verification of model-generated code rewrites via checkable equivalence proofs, not a deployed product or tool release.

Sources

Source-support review completed 5 Dec 2026. This story was drafted with AI assistance and checked against retained source passages. Automated checking is not independent verification.

Coverage: arXiv: abstract.

Updates and corrections

No corrections so far.

First published 5 Dec 2026

New to the subject? AI from the Ground Up starts from the beginning.