π€ AI Summary
This work addresses the challenge that code generated by large language models often violates implicit semantic constraints, while existing feedback mechanisms lack structured correctness guidance. To bridge this gap, the paper introduces formal proof graphs into code generation trainingβa novel approach that aligns program implementation graphs with Lean proof flow graphs to enable structural correspondence and knowledge transfer between verification and code synthesis. The proposed method integrates program dependence graphs, proof trajectory extraction, graph-guided supervised fine-tuning, and a verification-to-code knowledge fusion mechanism. Evaluated on LiveCodeBench v6 and BigCodeBench Hard, it increases the number of solved problems by 31.6% and 43.8%, respectively, substantially outperforming baseline approaches such as standard supervised fine-tuning (SFT) and CodeRL.
π Abstract
Code large language models (LLMs) can generate syntactically plausible programs that nevertheless violate hidden semantic constraints. Existing execution-feedback training methods identify whether a completed program fails, but provide limited supervision about how a correct solution should be organized. We introduce GraphAlignCoder, a training framework that transfers explicit correctness structure into code generation.
GraphAlignCoder constructs an implementation graph that captures control and dependence among program regions. In parallel, a constrained Lean pipeline produces proof traces, from which we extract a formal proof-flow graph. The model first learns executable code together with graph-derived descriptions of why individual program regions are correct, and then consolidates this knowledge into code generation. GraphAlignCoder consistently outperforms the base model, code-only SFT, and CodeRL across all benchmarks. Compared with CodeRL, it increases the solved count from 38 to 50 on LiveCodeBench v6 and from 16 to 23 on BigCodeBench Hard, corresponding to relative gains of 31.6% and 43.8%, while also improving BigCodeBench Full from 359 to 363 tasks. The ablation study further shows that verification-graph injection produces the initial reasoning gain, while verification to code consolidation is essential for robust cross-benchmark transfer.