Training Language Models to Generate Quality Code with Program Analysis Feedback
Not on the map. Why?
Abstract (arXiv)
Code generation with large language models (LLMs), often termed vibe coding, is increasingly adopted in production but fails to ensure code quality, particularly in security (e.g., SQL injection vulnerabilities) and maintainability (e.g., missing type annotations). Existing methods, such as supervised fine-tuning and rule-based post-processing, rely on labor-intensive annotations or brittle heuristics, limiting their scalability and effectiveness. We propose REAL, a reinforcement learning framework that incentivizes LLMs to generate production-quality code using program analysis-guided feedback. Specifically, REAL integrates two automated signals: (1) program analysis detecting security or maintainability defects and (2) unit tests ensuring functional correctness. Unlike prior work, our framework is prompt-agnostic and reference-free, enabling scalable supervision without manual intervention. Experiments across multiple datasets and model scales demonstrate that REAL outperforms state-of-the-art methods in simultaneous assessments of functionality and code quality. Our work bridges the gap between rapid prototyping and production-ready code, enabling LLMs to deliver both speed and quality.
Key facts. Cited by 12 papers in the map (data through 14 Oct 2026). Builds on 16 of its 37 references that are in the map. First posted on arXiv 28 May 2025.
Builds on
16 of 37 references.
References · 16
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 358
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 155
- 2023Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Modelscited by 138
- 2024StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedbackcited by 77
- 2024Instruction Tuning for Secure Code Generationcited by 68
- 2025Teaching Language Models to Critique via Reinforcement Learningcited by 42
- 2024Constrained Decoding for Secure Code Generationcited by 37
4 more
- 2024PromSec: Prompt Optimization for Secure Generation of Functional Source Code with Large Language Models (LLMs)cited by 19
- 2023B-Coder: Value-Based Deep Reinforcement Learning for Program Synthesiscited by 17
- 2024SecCoder: Towards Generalizable and Robust Secure Code Generationcited by 14
- 2024Code Security Vulnerability Repair Using Reinforcement Learning with Large Language Modelscited by 10
Built on by
Citing papers per year: 2025: 4; 2026: 8.
12 papers.
- 2025A Survey of Reinforcement Learning for Large Reasoning Modelscited by 180
- 2025Learning to Optimize Multi-Objective Alignment Through Dynamic Reward Weightingcited by 23
- 2025A Comprehensive Survey on Benchmarks and Solutions in Software Engineering of LLM-Empowered Agentic Systemcited by 15
- 2026Controlled Self-Evolution for Algorithmic Code Optimizationcited by 12
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detectioncited by 4
- 2026Uncovering Cross-Objective Interference in Multi-Objective Alignmentcited by 2
- 2026Learning to Generate Secure Code via Token-Level Rewardscited by 2
- 2026Towards Pareto-Optimal Tool-Integrated Agents with Pareto Ranking Policy Optimizationcited by 2
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Codecited by 1
- 2025Position: Vibe Coding Needs Vibe Reasoning: Improving Vibe Coding with Formal Verificationcited by 0
- 2026Characterizing Overconfident Failure in LLM-Based Code Generationcited by 0
- 2026LintEval: Benchmarking LLMs on Linter-Guided File Refactoringcited by 0
- 2026LintEval: Benchmarking LLMs on Linter-Guided File Refactoring14 Oct 2026
- 2026Characterizing Overconfident Failure in LLM-Based Code Generation8 Oct 2026
- 2026Towards Pareto-Optimal Tool-Integrated Agents with Pareto Ranking Policy Optimization15 Jun 2026
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026Learning to Generate Secure Code via Token-Level Rewards26 Feb 2026
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detection15 Feb 2026
- 2026Uncovering Cross-Objective Interference in Multi-Objective Alignment6 Feb 2026
- 2026Controlled Self-Evolution for Algorithmic Code Optimization12 Jan 2026
- 2025Position: Vibe Coding Needs Vibe Reasoning: Improving Vibe Coding with Formal Verification31 Oct 2025
- 2025A Comprehensive Survey on Benchmarks and Solutions in Software Engineering of LLM-Empowered Agentic System10 Oct 2025
- 2025Learning to Optimize Multi-Objective Alignment Through Dynamic Reward Weighting14 Sep 2025
- 2025A Survey of Reinforcement Learning for Large Reasoning Models10 Sep 2025
Similar, not cited
Close in wording, no citation either way
- 2024Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generation
- 2025Integrating Symbolic Execution into the Fine-Tuning of Code-Generating LLMs
- 2025Improving LLM-Generated Code Quality with GRPO
- 2024Process Supervision-Guided Policy Optimization for Code Generation
- 2025Enhancing the Non-Functional Quality Compliance of LLM-Generated Code through Quality-Aware Preference Learning
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testing
- 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning
- 2025Seed-Coder: Let the Code Model Curate Data for Itself