Manuscript Offprint

arXiv:2610.17358

claimcheck: Measuring and Improving Specification Faithfulness

Martin Amster, One An, Holly Baker, Fernanda Graciolli, Simon Henniger, Nada Amin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Martin Amster*

Universidad de Buenos Aires

Buenos Aires, Argentina

mamster@dc.uba.ar

Holly Baker*

PolicingLab

Dublin, Ireland

baker@policinglab.org

Simon Henniger†

Harvard University

Cambridge, MA 02138, USA

shenniger@fas.harvard.edu

One An*

University of Pennsylvania

Philadelphia, PA 19104, USA

onean@engineering.upenn.edu

Fernanda Graciolli

Midspiral, Inc.

Cambridge, MA 02139, USA

fernanda@midspiral.com

Nada Amin†

Harvard University & Midspiral, Inc.

Cambridge, MA 02138 & MA 02139, USA

namin@seas.harvard.edu

Abstract

Formal verification proves that a program satisfies its specification, but says nothing about whether the specification captures what the author meant. As LLMs increasingly write both code and specifications, a gap between the author's natural-language requirement and the specification becomes a live risk. A machine-checked proof of a property narrower than the one requested is worthless but passes every check. Closing this gap is solving the spec formalization problem: given a natural-language requirement, produce a formal artifact whose meaning matches it. To measure the gap, we curate an end-to-end benchmark for spec formalization spanning four formal languages: Dafny contracts and Lean 4, Isabelle and Rocq theorem statements. Each of its 3,234 rows pairs a natural-language requirement with a formal artifact and a label established by execution, by proof, or by the benchmark it is drawn from. A third of the rows are meaning-preserving rewrites of the artifact that keep the faithful label, so a judge cannot score by detecting that a row was edited.

We introduce claimcheck, a tool that detects incorrect formalizations: the formal artifact is translated back into plain English by a model that never sees the requirement, and a separate model, the judge, decides whether the informalization and the requirement express the same guarantee. On all four languages it gains 8.2 to 9.8 points of macro recall over a single call shown the requirement and the artifact, and 4.2 to 6.0 over that call handed the same list of meaning-preserving rewrites. Showing the judge the artifact as well costs 1.4 to 4.5 points. Across four judges that also see the artifact, the gain shrinks as the judge gets stronger, to within a point of the informed single call for the strongest.

*Equal contribution, listed in alphabetical order; Apart Secure Program Synthesis fellows.

†Equal advising.

NeurIPS 2026 Workshop on AI for Verifiable Coding.

Figure

Figure 1: One claimcheck run, on a Dafny contract from CloverBench whose postcondition was weakened (class C2). Like the sorting example, the contract still verifies and is satisfied by returning zero. Step 1 translates the contract into English without ever seeing the requirement, so the informalization can only report what the contract says. Step 2 compares the informalization with the requirement and names the discrepancy; it never sees the contract. Colours follow the data: blue is the natural-language requirement, amber the formal artifact, green its informalization. A single-call baseline shown both sides at once scores lower on all four languages (Table 2).

1 Introduction

As models get better at writing code, the programmer's job shifts toward saying what a program should do rather than how it should do it. Spec-driven development already works this way: the developer states the requirement in English, and the implementation is generated from it. The hard part moves from writing the code to knowing whether it does what was asked. For most of what a model produces there is no automatic way to tell, and checking falls to a human or to another model [Zheng et al., 2023]. Formal languages are the exception. Here the requirement is first written down as a specification: a precise statement of what the program must guarantee, in a form a machine can check. A verifier then proves that the code meets that specification on every possible input. But the verifier only ever sees the specification. It never sees the natural-language requirement that specification was written from, so it cannot tell whether the specification asked for the right thing.

Suppose the requirement is to sort a list. The specification says the output must be in increasing order, and the code is proved to satisfy it. Now take a program that ignores its input and returns an empty list. Nothing in an empty list is out of order, so that program meets the specification too, and the same proof would go through. The specification never said the output has to contain the same items as the input. This is the part no verifier covers. In our Dafny [Leino, 2010] slice every row we labelled defective still passes verification, so a verified artifact can carry an assurance it has not earned. We call the task of getting it right spec formalization: given a natural-language requirement, produce a formal artifact whose meaning matches it.

We introduce claimcheck, a tool that checks whether a formal artifact means what its natural-language requirement asks for. The direct way to check this is to show a model both the requirement and the specification and ask whether they agree [Cabral et al., 2026, Zhang et al., 2026, Lu et al., 2025]. The trouble is that the requirement gives the answer away. A model that has just read sort a list expects the specification to describe sorting, and is biased toward agreeing that it does. Telling the model not to do this is an instruction it can fail to follow, so claimcheck separates reading the specification from judging it. A first model, the informalizer, puts the specification into plain English — its preconditions, its postcondition, its scope — without ever seeing the requirement, so what it writes can only report what the specification says. We call this the informalization [Wu et al., 2022,

Amrollahi et al., 2026]. A second model, the judge, then compares the informalization against the requirement (Figure 1). What it compares is two English texts, one saying what was asked for and the other what the artifact guarantees, and the one it reads was written before the requirement could shape it. We also report the variant that hands the judge the artifact alongside the informalization; it is the weaker of the two on all four of our languages, by 1.4 to 4.5 points of macro recall.

References (41)