UC Berkeley's VERINA Exposes o3's Brutal 3.2% Score on Provable Code
A new Lean-based benchmark exposes how badly frontier LLMs fail at writing formal proofs, even when they nail the code itself.
ProTakeaways
- UC Berkeley and Meta FAIR released VERINA, a 189-task Lean benchmark for verifiable code generation.
- Evaluates code, specification, and proof generation independently and in end-to-end compositions.
- OpenAI o3 tops the leaderboard with 72.6% code, 52.3% spec, and only 4.9% proof pass@1.
- Specialist provers reach 11.2% pass@1; iterative Lean-feedback refinement pushes proofs to about 20%.
- Novel evaluator combines LLM theorem proving with property-based testing via Lean's plausible tactic.
- Dataset on Hugging Face, harness on GitHub, accepted at ICLR 2026.
Writing code with an LLM is easy. Proving that code actually does what you claim is a completely different sport, and a new benchmark from UC Berkeley and Meta FAIR shows just how far current models are from playing it well. VERINA (Verifiable Code Generation Arena) is a hand-curated benchmark in Lean 4 that measures whether an LLM can jointly produce code, a formal specification, and a machine-checkable proof that the two agree. The headline number is brutal: OpenAI's o3, the strongest model tested, achieves a 72.6% code correctness rate, 52.3% for specification soundness and completeness, and a mere 4.9% proof success rate.
Why correctness needs more than unit tests
LLMs are already shipping a meaningful fraction of production code, but they cannot give formal guarantees about what they write. The proposed fix is verifiable code generation, which the authors describe as jointly generating code, specifications, and proofs of code-specification alignment. If the model emits all three, a compiler like Lean can mechanically check that the implementation truly satisfies the spec, no human review required.
The catch is that existing benchmarks only measure slices of this pipeline. HumanEval and MBPP test code but ignore specs and proofs. DafnyBench and miniCodeProps only score proof generation. Clover and Dafny-Synthesis touch all three tasks but bundle spec and proof into a single score and rely on small hand-written sets. VERINA is the first benchmark to evaluate all three tasks independently, and their compositions, on the same problems.
What is actually inside
VERINA consists of 189 manually curated coding tasks in Lean, with detailed problem descriptions, reference implementations, formal specifications, and extensive test suites. Each instance is structured around five artifacts:
- A natural language description of the problem (median 110 words)
- A ground truth Lean implementation
- A formal specification split into a pre-condition and post-condition
- An optional Lean proof (provided for 46 of the 189 tasks to help quality assurance)
- A comprehensive test suite with positive and negative cases achieving 100% line coverage
Problems come from three sources: MBPP-DFY-50, CloverBench, and student submissions to a Berkeley theorem-proving course that pulled harder tasks from LeetCode and LiveCodeBench. The last group turns out to be substantially harder and is broken out separately as Verina-B (student-authored) versus Verina-A (Dafny translations). Every sample was reviewed by at least two authors, and the authors also stress that ground truth specs were deliberately crafted so they cannot be trivially converted into the implementation, forcing models to genuinely reason rather than copy.
The clever part: judging specifications automatically
The tricky evaluation problem is grading a generated specification. A spec should be both sound (only accepts correct programs) and complete (accepts all correct programs), which is essentially a logical equivalence with the ground truth. VERINA handles this with a hybrid evaluator:
- First, try to prove soundness or completeness formally with an LLM-based theorem prover.
- If proving is inconclusive, fall back to running the relationship against the test suite using Lean's
decide. - If that still leaves quantified variables open, use the plausible tactic to do property-based testing, generating diverse concrete inputs.
- Repeat the whole process on the negation to distinguish "unknown" from a genuine counterexample.
This matters because current LLM provers rarely close the loop: proof success rates are very low, below 4% across all cases, while testing recognizes more than 40% of generated specifications as sound and complete. Property-based testing carries most of the weight today, but the framework is designed to lean harder on formal proofs as provers get better.
How the frontier models actually do
The team evaluated ten general-purpose LLMs and three theorem-proving specialists. The difficulty ordering is consistent across every model tested: code is easiest, specs are harder, proofs are close to impossible in a single shot.
| Task | Best general model (o3) | Best specialist |
|---|---|---|
| Code generation (pass@1) | 72.6% | n/a |
| Spec soundness + completeness | 52.3% | n/a |
| Proof generation (pass@1) | 4.9% | 11.2% (Goedel Prover V2 32B) |
| End-to-end (code + spec + proof) | 3.2% | n/a |
Proof generation is the clear bottleneck. Specialist provers help but do not rescue the numbers: Interestingly, iterative refinement using Lean compiler feedback can increase the proof success rate to 22.2% with 64 refinement steps. However, this approach significantly raises costs and the 22.2% success rate is still insufficient. Feeding the Lean error message back into the model reliably beats independent resampling at the same query budget, which is a useful signal about where compute should go.
What the failures actually look like
The paper's failure analysis is where things get concrete for anyone thinking about building verification tooling. A few consistent patterns emerge across models:
- Hallucinated APIs. o4-mini happily calls a non-existent
Int.xorthat isn't in Lean 4's standard library, producing syntactically clean code that won't compile. - Silent capitulation. Claude Sonnet 3.7 resorts to cheat codes like
sorryin nearly half of its failed proofs, essentially telling Lean "trust me" rather than finishing the argument. - Unsolved goals. Gemini 2.5 Flash more often just runs out of tactics with the goal still open, a different failure signature than Claude's.
- Ecosystem unfamiliarity. Errors from unknown identifiers, tactics, and constants make up 15 to 30 percent of proof failures across every model, suggesting these systems have not internalized Lean's actual standard library.
- Missing edge cases in specs. Models routinely produce specs that omit the
n = 0case, drop uniqueness constraints, or use strict inequalities where the ground truth allows equality.
There is also an interesting asymmetry: providing the ground truth spec to CodeGen consistently improves code quality, but providing ground truth code to SpecGen barely helps and sometimes hurts. Verbose implementations appear to over-constrain the specification model rather than guide it.
Getting it and using it
Everything is open. The dataset lives on Hugging Face and the evaluation harness is on GitHub. Each task ships as a description.txt, a task.lean file with the ground truth, and JSON files with positive and rejected inputs. The paper has been accepted at ICLR 2026.
VERINA is not a training corpus. At 189 tasks, it's a benchmark with detailed task descriptions, high-quality codes and specifications in Lean, and extensive test suites with full line coverage aimed at measuring progress rather than fueling it. The problems are also intentionally small and standalone, so strong performance here would be a floor for real verification work on kernels or compilers, not a ceiling. But given that the current floor is a 3.2 percent end-to-end score for the best available model, there is room to move.