SecCoderX: Online reinforcement learning secure code generation based on a vulnerability reward modelSecure Code Generation via Online Reinforcement Learning with Vulnerability Reward Model
Researchers propose SecCoderX, an online reinforcement learning framework for functionality-preserving secure code generation; experiments show it improves the effective security rate (ESR) by about 10% over unaligned models, while the authors say prior methods often reduce ESR by 14-54%. Addressing the paradox between functionality and security in existing safety alignment methods, the framework reuses mature vulnerability detection resources in two places: synthesizing diverse, realistic vulnerability-inducing coding tasks for online RL sampling, and training a reasoning-based vulnerability reward model to provide scalable, reliable security supervision. The two components are unified in an online reinforcement learning loop, enabling code LLMs to generate secure and functionally intact code. Code, datasets and model checkpoints are open-sourced at https://github.com/AndrewWTY/SecCoderX.