Research map / Large language models / Reasoning and chain of thought
SecCodePRM: A Process Reward Model for Code Security
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 SecCodePRM, a 7B step-level process reward model fine-tuned from Qwen2.5-Coder that scores code prefixes for security, applied to vulnerability detection and best-of-N secure code generation.
Problem
Vulnerability detection and secure code generation typically need complete programs and give only end-of-program feedback, which is costly and degrades on long code; the paper targets real-time, prefix-level security assessment.
Approach
Train a classification-head PRM on the Qwen2.5-Coder-7B backbone that emits a safe/vulnerable margin at each step separator, with step labels derived from contrastive diffs of vulnerable vs. patched code and caller-function propagation, then aggregate step rewards with risk-sensitive weighting for detection and use them to rank candidates for inference-time scaling.
Key results
- On PrimeVul Paired classification, SecCodePRM reports 96.83% accuracy and 96.73 F1 versus 72.50% accuracy for LLMxCPG.
- On PreciseBugs full-code VD, SecCodePRM reaches F1 0.59 versus 0.48 for MSIVD.
- On partial-code VD, SecCodePRM (7B) gets F1 50.17 on SVEN versus at most 25.52 for GPT-oss-120B, and F1 90.00 on PreciseBugs.
Surprising findings
- Larger general-purpose LLMs achieve high accuracy but low F1 on partial-code vulnerability detection, indicating conservative predictions that miss vulnerable code.
- Secure-code inference scaling also improves functional correctness on LiveCodeBench for QC2.5-32B (SecCodePRM pass@1 55.19 vs 53.23 for baselines).
Limitations
- Training and evaluation focus mainly on C, C++, and Python; generalization to other languages and paradigms is underexplored.
- Unclear generalization to zero-day or novel vulnerability patterns outside the known CWE distribution.
- Step labels rely on heuristic propagation and diff-based alignment, which may be ambiguous for unpaired data.
Experimental setup
Datasets: BigVul SVEN PrimeVul ReposVul PreciseBugs CWEval LiveCodeBench
Benchmarks: SVEN PrimeVul PreciseBugs ReposVul CWEval LiveCodeBench
Metrics: accuracy precision recall F1 pair-wise P-C/P-V/P-B/P-R SR@k pass@k safe@k
Baselines: VulSim VulBERTA ReGVD LLMxCPG CodeT5 CodeBERT UniXcoder StarCoder2 CodeGen2.5 Qwen2.5-PRM-7B GPT-3.5 GPT-4
Builds on: Qwen2.5-Coder CodeQL Gestalt Pattern Matching
Closest papers by meaning
- ProSec: Fortifying Code LLMs with Proactive Security Alignment (ICML 2025 · similarity 0.88)
- Instruction Tuning for Secure Code Generation (ICML 2024 · similarity 0.87)
- SEC-bench: Automated Benchmarking of LLM Agents on Real-World Software Security Tasks (NeurIPS 2025 · similarity 0.87)
- IRIS: LLM-Assisted Static Analysis for Detecting Security Vulnerabilities (ICLR 2025 · similarity 0.87)
- MOSAIC-Bench: Measuring Compositional Vulnerability Induction in Coding Agents (NeurIPS 2026 · similarity 0.87)
- Reasoning Through Execution: Unifying Process and Outcome Rewards for Code Generation (ICML 2025 · similarity 0.86)
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.
