Skip to content
Preprint

GraphAlignCoder: Aligning Program and Proof Graphs for Code Generation

Aug 2026 · 0 citations · 32 references
Computer Science

TL;DR

GraphAlignCoder is introduced, a training framework that transfers explicit correctness structure into code generation and consistently outperforms the base model, code-only SFT, and CodeRL across all benchmarks.

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.

View source

Similar papers

Open access Aug 2026

StructFix: a structure-aware reasoning framework for automated program repair with code property graphs

StructFix is proposed, a structure-aware APR framework that grounds masked patch generation in Code Property Graphs (CPGs), and explicitly coupling structural dependencies with masked generation improves repair effectiveness and enables transfer across datasets.

Mengtian Cui, Yang-Fan Liu, Zhibo Lu et al. · 0 citations
Preprint Jul 2026

SCOPE: Leveraging Subgoal Critiques for Code Generation

SCOPE is presented, a prover-initialized subgoal critic for code generation that adapts a Lean-oriented prover model to produce three parseable feedback fields for downstream code generation: subgoals, gap analysis, and a robustness checklist.

Yueke Zhang, Yifan Zhang, Zihan Fang et al. · 0 citations
Preprint Jul 2026

Finetuning Lightweight LLMs for Control Flow Graph Generation

Control Flow Graph (CFG) is an important program representations for software analysis, code understanding, and software maintenance. Traditional CFG generation techniques mainly rely on bytecode or abstract syntax trees. However, these approaches usually require complete, compilable, and syntax error-free code, which limits their applicability to incomplete or erroneous code. Furthermore, they often depend on language specific tools, making it difficult to support multiple programming languages in a unified manner. To address these limitations, this paper investigates the use of fine-tuned lightweight large language models (LLMs) for CFG generation. We first design a unified CFG output format and a task-specific fine-tuning prompt for CFG generation. Then, we construct a dataset based on an existing LeetCode dataset through automatic CFG generation and error augmentation. We evaluate the proposed approach on six lightweight LLM models, including three code-specific LLMs: CodeLlama, QwenCoder, and DeepSeekCoder; and three general purpose LLMs: Llama3.2-3B, Qwen-4B, and Phi-4B. The experimental results show that, through fine-tuning, lightweight LLMs achieve promising results for CFG generation, particularly when the input code is incomplete or erroneous. It also demonstrates cross-language generalization capability on programming language not included in the fine-tuning data.

Hanyu Zhang, Tomoji Kishi · 0 citations
Preprint Aug 2026

Pseudo2CodeQA: A Benchmark for LLM-Based Structured Algorithmic Reasoning in Code Generation

Pseudo2Code, a benchmark designed to systematically evaluate the impact of structured pseudocode on code generation quality and algorithmic faithfulness, is introduced and the Pseudo2Code Agentic Framework is proposed, a multi-stage pipeline that leverages pseudocode as an explicit intermediate reasoning representation for code generation.

Shadikur Rahman, Umme Ayman Koana, S. Danish · 0 citations
Preprint Jul 2026

SciCodePile: A 128GB Corpus and Executable Benchmark for Challenging Scientific Code Generation

Large language models (LLMs) excel at general-purpose code generation, yet how well they handle scientific code remains an open question. Existing datasets and benchmarks are limited in scale, domain coverage, or executable verification, leaving the true gap between current LLMs and reliable scientific code generators inadequately assessed. To address these limitations, we present SciCodePile, the largest scientific code corpus to date, constructed from 37,737 public repositories and collectively comprising 128GB of code that spans multiple computational science disciplines. From this corpus, we further curate an executable benchmark of 200 tasks, each equipped with a sandboxed execution environment and an automated test harness for functional verification. We evaluate 15 LLMs from both open-source and closed-source families on three tasks: prefix-to-suffix completion, fill-in-the-middle infilling, and executable code generation. Results show that scientific code generation remains highly challenging: The best CodeBLEU reaches only 38.13 and 38.37 on the two completion tasks, while the strongest model achieves just 12.30\% Pass@1 on the executable benchmark, underscoring how far current models remain from reliable scientific code generation. To demonstrate the training utility of SciCodePile, we further show that continued pretraining on our corpus improves CodeBLEU by $\times$2.84 on scientific code completion, and instruction tuning on our data improves Pass@1 by $\times$4.79 on the executable benchmark. All code and data are available at https://huggingface.co/SciCodePile.

Weifeng Sun, Ye Fan, Yuchen Chen et al. · 0 citations
Jul 2026

RIP-Guided Graph Evidence for LLM-Based Equivalent Mutant Detection

In recent years, prior work has explored leveraging large language models (LLMs) for equivalent mutant detection. However, representations that rely solely on source-code sequences or abstract syntax trees (ASTs) make it difficult to directly capture—and to exploit in a controllable manner—the semantic information required for equivalence reasoning, such as control dependencies, data dependencies, and path constraints. To address this limitation, we propose an RIP (Reach–Infect–Propagate)-guided, LLM-assisted approach for equivalent mutant detection. We first construct local control-flow graphs (CFGs) and data-flow graphs (DFGs) on the intermediate representations of both the original program and its mutant, and align the subgraphs relevant to the mutation location. We then, from the RIP perspective, statically extract RIP-stage evidence (e.g., path predicates, def–use chains, and control/data dependencies) to form an interpretable graph-evidence representation. Finally, we serialize the paired graph evidence into structured prompts or instruction-style inputs to the LLM, enabling it to classify mutants as equivalent or non-equivalent. Experiments on a dataset built from 10 open-source Java projects show that, compared with multiple classes of classic equivalent mutant detection techniques, our approach improves F1 by 4.81–64.34 percentage points and maintains its advantage under cross-project evaluation. In addition, injecting RIP-structured evidence consistently improves F1 over the code-only setting by roughly 8–12 percentage points.

Lei Hu, Xiangjuan Yao, Changqing Wei et al. · 0 citations