SCOPE: Leveraging Subgoal Critiques for Code Generation

📅 2026-07-07
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge that code generated by large language models often appears syntactically correct yet violates critical semantic constraints implicit in natural language specifications, which existing methods struggle to explicitly identify. To this end, the paper introduces SCOPE, a novel framework that incorporates, for the first time, a Lean theorem prover–based three-component structured semantic feedback mechanism—comprising subgoals, gap analysis, and a robustness checklist—and integrates it with supervised fine-tuning, process-aligned reinforcement learning (combining dense and sparse rewards), and feedback-guided reasoning. This approach substantially enhances the model’s ability to understand and adhere to semantic constraints. Experimental results demonstrate that SCOPE achieves pass@1 scores of 39.4% on LiveCodeBench V6 and 42.6% on BigCodeBench (Hard), significantly outperforming baselines such as Reflexion, with corrections that are notably more localized and precise.
📝 Abstract
Code generation with large language models (LLMs) remains unreliable because generated programs can appear correct while still violating key semantic requirements in the natural language specification. Existing feedback-based methods improve over coder-only generation, but they often rely on unstructured critique or execution signals that do not explicitly identify what the code is semantically missing. We present SCOPE, a prover-initialized subgoal critic for code generation. SCOPE adapts a Lean-oriented prover model to produce three parseable feedback fields for downstream code generation: subgoals, gap analysis, and a robustness checklist. Our approach combines supervised fine-tuning, process-aligned reinforcement learning (RL), and feedback-guided inference, with two complementary rewards during RL: a dense reward for structured critique quality and a sparse reward based on whether the critique improves the coder's execution score. Experiments show that SCOPE improves over the compared feedback baselines. On LiveCodeBench V6, SCOPE achieves 39.4% pass@1, compared with 36.6% for Reflexion and 20.6% for the coder-only baseline. On BigCodeBench (Hard), it reaches 42.6%, surpassing Reflexion at 36.5% and coder-only generation at 34.5%. Further analysis shows that SCOPE's gains are concentrated in tasks with concrete semantic constraints and that its code corrections are more localized than Reflexion's.
Problem

Research questions and friction points this paper is trying to address.

code generation
semantic requirements
structured critique
large language models
feedback-based methods
Innovation

Methods, ideas, or system contributions that make the work stand out.

subgoal critique
structured feedback
prover-initialized critic
process-aligned reinforcement learning
code generation
🔎 Similar Papers
2024-08-22arXiv.orgCitations: 2