Developer Tools

GraphAlignCoder lifts code LLM pass rates by 44% with proof graphs

New technique uses Lean proof traces to teach LLMs semantic code correctness.

Deep Dive

Code LLMs often generate programs that look syntactically valid but violate hidden semantic constraints. Existing execution-feedback methods like CodeRL only flag when a program fails, offering limited guidance on how to structure a correct solution. GraphAlignCoder overcomes this by transferring explicit correctness structure into the generation pipeline. It builds an implementation graph that captures control flow and dependencies across program regions, and combines it with formal proof-flow graphs derived from a constrained Lean proving pipeline. The model first learns executable code alongside graph-derived explanations of why each region is correct, then consolidates that knowledge into pure code generation.

Empirically, GraphAlignCoder delivers significant gains across benchmarks. Compared with CodeRL, it raises the solved count on LiveCodeBench v6 from 38 to 50, a 31.6% relative improvement, and from 16 to 23 on BigCodeBench Hard, a 43.8% jump. It also improves BigCodeBench Full from 359 to 363 tasks. Ablation studies reveal that verification-graph injection provides the initial reasoning boost, while the verification-to-code consolidation step is essential for robust transfer across benchmarks. These results suggest that aligning program structure with formal proof structure is a promising path toward more reliable AI-generated code.

Key Points
  • GraphAlignCoder combines an implementation graph (control/data dependence) with a formal proof-flow graph from Lean to train code LLMs.
  • Solves 50 vs. 38 tasks on LiveCodeBench v6 and 23 vs. 16 on BigCodeBench Hard compared to CodeRL.
  • Ablation shows verification-graph injection drives initial gains; verification-to-code consolidation enables cross-benchmark transfer.

Why It Matters

Moves code generation beyond syntax matching to semantic correctness, reducing hidden bugs in AI-written software.

📬 Get the top 10 AI stories daily