atlas

Research map / Large language models / Agents, code and math

AlphaVerus: Bootstrapping Formally Verified Code Generation through Self-Improving Translation and Treefinement

ICML 2025 · Large language models › Agents, code and math · approach: Execution-based code verification · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes AlphaVerus, a self-improving framework that bootstraps verified Rust (Verus) code generation by translating Dafny programs with Llama-3.1-70B, using Treefinement (REBASE tree search over verifier-feedback refinements) and a critique phase to filter reward hacks, with no finetuning.

Problem

Verified code generation in mainstream languages like Rust (Verus) is hampered by scarce training data and the complexity of formal proofs, and self-generated specifications can be gamed (reward hacking).

Approach

Iteratively translate programs from a resource-rich verification language (Dafny) into Verus via exploration, a tree-search refinement (Treefinement) guided by verifier-derived scores, and a critique stage (rule-based, comparison LLM, exploit LLM) that filters misaligned specs; the collected exemplars are used as few-shot prompts with no weight updates.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add Treefinement with REBASE after exploration (ablation)AlphaVerus using Llama 3.1 70B · HumanEval (verified)Pass@256: 27.1% -> 32.9%Helped
add Treefinement with REBASE after exploration (ablation)AlphaVerus using Llama 3.1 70B · MBPP (verified)Pass@256: 59.1% -> 65.7%Helped
replace Treefinement with single-turn linear self-refinement (ablation)AlphaVerus using Llama 3.1 70B · HumanEval (verified)Pass@256: 32.9% -> 29.4%Hurt
replace Treefinement with single-turn linear self-refinement (ablation)AlphaVerus using Llama 3.1 70B · MBPP (verified)Pass@256: 65.7% -> 61.5%Hurt
replace Treefinement with multi-turn linear self-refinement (ablation)AlphaVerus using Llama 3.1 70B · HumanEval (verified)Pass@256: 32.9% -> 29.4%Hurt
replace Treefinement with multi-turn linear self-refinement (ablation)AlphaVerus using Llama 3.1 70B · MBPP (verified)Pass@256: 65.7% -> 62.8%Hurt
replace REBASE with best-first search (ablation)Treefinement using Llama 3.1 70B · HumanEval (verified)Pass@256: 32.9% -> 28.2%Hurt
replace REBASE with best-first search (ablation)Treefinement using Llama 3.1 70B · MBPP (verified)Pass@256: 65.7% -> 61.5%Hurt
add Dafny2Verus-Collection few-shot exemplarsLlama 3.1 8B · HumanEval (verified)Pass@K: 11.8% -> 18.8%Helped
add Dafny2Verus-Collection few-shot exemplarsQwen-32B · HumanEval (verified)Pass@K: 14.1% -> 27.1%Helped
add Dafny2Verus-Collection few-shot exemplarsGPT-4o · HumanEval (verified)Pass@K: 27.1% -> 37.7%Helped
remove the critique phase from iterative translation (ablation)AlphaVerus · DafnyBench translationcorrect translationsHurt

Surprising findings

Limitations

Experimental setup

Datasets: DafnyBench HumanEval-Verus MBPP-verified

Benchmarks: HumanEval-Verus MBPP-verified

Metrics: pass@256 pass@k

Baselines: GPT-4o few-shot Llama 3.1 70B few-shot Single-Turn Linear Self-Refine Multi-Turn Linear Self-Refine Best-First Search SAFE (DSCoder-33B) AutoVerus

Builds on: REBASE AutoVerus expert iteration

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy