Kempner Institute reports AI workers wrote over 100,000 formally verified programs

In short

100,000+ verified programs across three languages; 268 lines average program, three-worker setup; 8.7% → 43.0% Qwen on VerusBench, one attempt; 29.8% vs 23.0% yield per model call, three workers vs one agent (Claude Opus 4.5, Dafny)

Why verified code is hard to get

In a verification-aware language such as Dafny, Verus or Frama-C, a program can come with a precise statement of what it must do and a mathematical proof that it does it, which a tool called a verifier checks mechanically. If an AI writes such a program, a person would only need to read the statement, and could trust the verifier for the rest. That is the authors' pitch.

The catch is training data. The authors note that the largest public dataset of self-contained Dafny programs, DafnyBench, has fewer than 800 files after deduplication, against tens of millions of public Python repositories. Open models are weak at these languages for that reason. Formal Disco tries to manufacture the missing examples, using the verifier as a cheap, trustworthy judge of which ones are correct.

How the system works

(This section is our plain-English summary of the authors' description.)

Everything runs around an "agenda", a shared store of tasks (such as "repair program X") and programs with their verifier feedback. Any number of workers, each backed by a language model, can claim tasks from it. There are three kinds:

The seeds come from two places. One is a random README from a set of 100,000 GitHub repositories, almost none about verification: a cookbook repository, for example, became a verified recipe manager. The other is up to two snippets from the language's reference documentation.

The authors tested whether three workers beat one. With Claude Opus 4.5 on Dafny, a single agent with verifier feedback and 3 repair attempts wrote programs averaging 85 lines, never above 128. The three-worker setup, with the same number of model calls, averaged 268 lines, with the top 10% above 598 lines and the largest above 3,000. Its yield per call was 29.8% against 23.0%.

Diversity as a number

A pile of 100,000 near-copies would be useless, so the authors define a good dataset as one with high entropy over program features, meaning a wide spread of values for things like loop structure, proof length or whether bitvectors are used. A trillion copies of one program would score zero.

They report that the seeds matter. Without READMEs, the most frequent themes in generated Dafny programs were stack, reverse, insert, pop, push, peek and bst: the model kept falling back on textbook data structures. Of 30 Dafny language features they track, corpora built with documentation snippets covered all 30, against 26 without.

Self-improvement without collapse

When a model is trained repeatedly on its own output, it tends to lose variety, a problem often called model collapse. The authors' loop:

The risk is that the model learns to succeed by writing simpler programs. So the authors rank the successful programs by how unusual their feature values are and train only on the top third. In Verus, the Initiator's success rate went from about 11% with Claude to 43% with Qwen at iteration 5, and loop-structure entropy roughly doubled against the Claude corpus in all three languages. By the last iteration the Qwen corpus beat the Claude one on all four targeted features in every language, except lemma proof size in Verus.

Do the programs help on human-written code?

The authors fine-tuned Qwen 2.5-Coder 32B with plain supervised fine-tuning and tested it on benchmarks of human-written programs. All numbers below are theirs.

The last row matters: on proving lemmas, Claude Opus 4.5 remains far ahead. The authors suggest proofs benefit from step-by-step reasoning their fine-tuned model was never trained to produce.

What to keep in mind

Terms in plain English

Where things stand

The code and three datasets (dafny-disco, verus-disco, framac-disco) are public; the Hugging Face collection was last updated on 5 July. The authors say next steps include training on reasoning traces or with reinforcement learning against the verifier, learning which program features to maximise instead of choosing them by hand, and applying the method to interactive theorem provers and formal mathematics.

Sources

Sources

More from AI Research Labs

All stories from AI Research Labs