DAFNY CODE GENERATION · QWEN3-8B-BASE

Code thatcomes with a proof.

AI can write code that looks right and still break its spec. I’m building Proof-Pilot: an open 8B model for Dafny that aims to return code with a machine-checked proof. A developer tool and API are the product direction.

Open weights and local use are the goal. Dafny decides which outputs count as verified.

GitHub profile
HOW IT WORKS

A spec in.
Proof-backed code out.

The model proposes a Dafny method and proof. Dafny checks the candidate against the original specification and reports failed proof obligations.

  1. 01
    Specification

    Defines what the program must satisfy.

  2. 02
    Candidate

    Proposes a Dafny program and proof.

  3. 03
    Dafny verifier

    Checks the candidate against the spec.

  4. 04
    Verified

    Accepted only when Dafny confirms it.

COUNTTO · LOOP INVARIANTILLUSTRATIVE

method CountTo(n: nat) returns (i: nat)
ensures i == n
{
i := 0;
// loop candidates below
}

CANDIDATE AREJECTED
while i < n
  invariant i < n
{
  i := i + 1;
}

Not maintainedAfter the last iteration i = n, so i < n fails. It also fails at entry when n = 0.

CANDIDATE BACCEPTED
while i < n
  invariant i <= n
{
  i := i + 1;
}

Holds throughout; at exit, !(i < n) and i <= n imply i == n.

01Write a spec
02Get code + proof
03Verifier confirms
WHY NOW

AI writes more code
than teams can review.

Generated code can look convincing and still violate its spec. A proof checked by a machine gives teams a concrete correctness check alongside tests and review.

WHO IT'S FOR

For code that must meet a spec.

The first focus is Dafny programs where correctness can be stated and checked.

01

Engineers shipping AI-written code

Potential fit for teams in finance, infrastructure, embedded software, and security, where a spec violation can be expensive.

02

Teams using Dafny

Writing proofs takes time. This project tests whether an 8B model can reduce that effort. Dafny has been used in AWS’s formally verified authorization engine. Read the case study

03

Researchers and open-source builders

The release target is model weights, training code, evaluation logs, and a reproducible benchmark harness.

PRODUCT DIRECTIONOpen model first. Then a developer tool and API.

WHY THIS APPROACH

Why build
for Dafny?

Open weights give teams more control over where a model runs. Dafny gives the project a concrete way to check its output.

Open weights

The release target includes weights so teams can inspect the model and run it in their own environment.

Dafny checks the result

A program counts as verified only when the checker accepts it against the original specification.

Dafny-specific

Start from Qwen3-8B-Base and focus training and evaluation on Dafny programs with proofs.

ROADMAP

The next steps.

  1. Evaluation protocolDefined
  2. Harness + canary runNext
  3. Public baselineNot run
  4. SFTAfter baseline
  5. Verifier-feedback RLAfter SFT
  6. Open releaseRelease target
TECHNICAL PLANMETHOD · BUDGET · MEASUREMENT

Technical roadmap

How we’ll train and measure it. The evaluation protocol, budget, and results will be documented for reproduction.

PROJECT SNAPSHOT

Plan at a glance

BASE MODELQwen3-8B-Base

8B open-weight starting point

FIRST EXPERIMENTFull benchmark baseline

DafnyBench + MBPP-DFY, before training

GPU-HOUR PLAN~1,000 GPU-hours

1–8 × RTX PRO 6000 or comparable H100-class GPUs

METHODBaseline → SFT → RL

Measure each phase before moving to the next

WHAT WE'RE SHIPPINGModel, logs, and report

Weights, verifier logs, ablations, and benchmark results

Dafny/Z3 verification runs on CPU workers and is budgeted separately.

TRAINING PLAN

Benchmark first

The planning budget totals about 1,000 H100-equivalent GPU-hours. Compute is not allocated; the estimate assumes 1–8 RTX PRO 6000 or comparable GPUs.

01 / BENCHMARK METHOD

Base model → Dafny verifier

Base
Qwen3-8B-Base
Phase 1
Full DafnyBench + MBPP-DFY baseline
SFT data
Verifier-passing examples from the Dafny repository after per-file license review, plus model-generated tasks outside benchmark splits. Exclude DafnyBench and MBPP-DFY evaluation tasks; record sources and hashes.
Phase 2
LoRA/QLoRA SFT on eligible examples; keep benchmark test splits out of training
Phase 3
Verifier-feedback RL, with GRPO-style training as a candidate recipe

Freeze task IDs, splits, prompts, and tool versions. Report accepted programs, sample counts, and verifier outcomes.

02 / GPU-HOUR BUDGET

Allocation by phase

Phase 0 · CanaryLoad model, pin Dafny/Z3, test the end-to-end harness and measure throughput.Milestone: reproduce the harness.
~20GPU-hours
Phase 1 · BaselineFull DafnyBench + MBPP-DFY evaluation; pass@1/8/32 across about 900 tasks with up to 32 samples each. The ~30-hour estimate assumes vLLM single-pass sampling, with no repair loop or prompt sweep.Confirm runtime on the canary. If the full run exceeds budget, report a measured subset and revise compute before training.
~30GPU-hours
Phase 2 · SFTLoRA/QLoRA on license-cleared Dafny examples and verifier-passing generated programs; no test-split leakage.Milestone: compare against the baseline on held-out tasks.
~250GPU-hours
Phase 3 · Verifier-feedback RLDafny verdict as reward; evaluate a GRPO-style approach.Milestone: compare against SFT and check for reward hacking.
~600GPU-hours
Evaluation + releaseFinal benchmarks, ablations, weights, logs, and report.Final phase.
~100GPU-hours

Provisional H100-equivalent GPU-hour estimate, not measured throughput. Start with the canary; continue to SFT/RL based on results.

03 / SUCCESS CRITERIA

What a useful result means

  • 01

    Measure and publish the base-model baseline before SFT or RL.

  • 02

    Report pass@1/8/32 and the number of programs accepted by Dafny.

  • 03

    Record task splits, samples, prompts, model checkpoints, and Dafny/Z3 versions for reproducibility.

  • 04

    Compare unique verified programs per GPU-hour across training stages.

04 / RISKS & MITIGATION

What could change the plan

  • RUNTIME

    Runs exceed the estimate. Prioritize complete baseline coverage and report the exact sample budget.

  • DATA

    Training data overlaps evaluation tasks. Freeze public splits and exclude test tasks before SFT.

  • REWARD

    RL exploits verifier feedback. Check accepted outputs against original specifications and publish ablations.

  • SCOPE

    Training does not beat the baseline. Publish the baseline and negative result; stop the next phase.

EVALUATION

Dafny benchmarks

Measure the base model before fine-tuning.

BenchmarkTaskStarting performanceNext step
DafnyBench ↗750+ Dafny files · TMLR 2025Add the annotations and proofs a program needs to verifyNot measuredFull protocol, pass@1/8/32
MBPP-DFY ↗Dafny version of the MBPP test set · FSE 2024Write a verified Dafny method from a description and its specNot measuredFull protocol, pass@1/8/32
PASS@K

Only programs Dafny verifies against the original spec count. Report the exact task and sample count; label any partial run as a subset measurement. Save full pass@1/8/32 reporting for runs that complete the benchmark protocol. DafnyBench protocol

BUILT ON

Related work

AlphaVerus studies verifier-guided translation to Verus with a 70B model. Proof-Pilot tests direct Dafny generation from an 8B base. Verifier-feedback training is an approach to evaluate here, not a novelty claim. AlphaVerus paper

OPEN RELEASE

Open release.

The release target includes model weights and the files needed to inspect training and reproduce the evaluation.

  • Model weights
  • Training code
  • Evaluation logs
  • Apache-2.0 license
DAFNY · CODE VERIFICATION6TO7  ·  PROOF-PILOT
TEAM + CONTACT

Built at 6to7.

Follow the work or get in touch.

EARLY ACCESS

Get early access

Email to follow the build and hear when a testable version is available.

7 on the waitlist

Email to join the waitlist