atlas

Research map / Large language models / Agents, code and math

Training Language Models to Generate Quality Code with Program Analysis Feedback

NeurIPS 2025 · Large language models › Agents, code and math · approach: Code generation benchmarks · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes ReaL, a PPO-based RL framework that rewards LLM code generation with a hybrid of program-analysis quality checks (security and MyPy-based maintainability) and unit-test functionality, evaluated on SecCodePLT+, SafeSQL, and APPS+ with Qwen2.5-Coder-Instruct at 0.5B-7B.

Problem

LLM code generation often produces code that is functionally plausible but insecure (e.g., SQL injection) or poorly maintainable (e.g., missing type annotations); existing fixes rely on costly annotations or brittle rule-based heuristics, and evaluations treat functionality and quality separately.

Approach

Use automated program analysis (an information-flow-style security detector and MyPy-based maintainability checks) as a verifiable, reference-free reward combined with unit-test pass rate in PPO, so the model learns quality code without human-written safe references or per-task rules.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use the hybrid functionality-plus-quality reward instead of SFTReaL, Qwen2.5-Coder-Instruct 0.5B · SecCodePLT+Func.-Qual. pass rate: 0.4573 -> 0.3963Hurt
Use the hybrid functionality-plus-quality reward instead of SFTReaL · SafeSQL, APPS+; 0.5B, 3B, and 7BFunc.-Qual. pass rate: SafeSQL 0.5527 -> 0.6941; 0.6824 -> 0.8471; 0.7294 -> 0.8588; APPS+ 0.1888 -> 0.2909; 0.4046 -> 0.5241; 0.4663 -> 0.6204Helped
Use the hybrid functionality-plus-quality reward rather than functionality-only reward (ablation)ReaL · SecCodePLT+, SafeSQL, and APPS+; 0.5B, 3B, and 7BFunc.-Qual. pass rate: SecCodePLT+ 0.0854 -> 0.3963; 0.2073 -> 0.6037; 0.2866 -> 0.6159; SafeSQL 0.0235 -> 0.6941; 0.0588 -> 0.8471; 0.0353 -> Helped
Add functionality reward to quality-only reward (ablation)ReaL · SecCodePLT+, SafeSQL, and APPS+; 0.5B, 3B, and 7BFunc.-Qual. pass rate: SecCodePLT+ 0.0732 -> 0.3963; 0.1220 -> 0.6037; 0.2866 -> 0.6159; SafeSQL 0.3529 -> 0.6941; 0.5529 -> 0.8471; 0.6353 -> Mixed
Use program-analysis detector rewards instead of safety unit-test rewards (ablation)ReaL · SecCodePLT+ and SafeSQL; 0.5B, 3B, and 7BFunc.-Qual. pass rate: SecCodePLT+ 0.1341 -> 0.3963; 0.2439 -> 0.6037; 0.3171 -> 0.6159; SafeSQL 0.3882 -> 0.6941; 0.7412 -> 0.8471; 0.7647 -> Helped

Surprising findings

Limitations

Experimental setup

Datasets: SecCodePLT+ SafeSQL APPS+ PurpleLLaMA

Benchmarks: SecCodePLT+ SafeSQL APPS+

Metrics: Function pass rate Quality pass rate Func.-Qual. joint pass rate

Baselines: Vanilla SafeCoder SVEN CodeGuard+ PromSec SFT PromptEng Safety unit tests reward

Builds on: PPO Generalized Advantage Estimation SecCodePLT APPS MyPy

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy