Lune

ICML2025顶会

ProSec: Fortifying Code LLMs with Proactive Security Alignment

Xiangzhe Xu, Zian Su, Jinyao Guo, Kaiyuan Zhang, Zhenting Wang, Xiangyu Zhang

摘要

While recent code-specific large language models (LLMs) have greatly enhanced their code generation capabilities, the safety of these models remains under-explored, posing potential risks as insecure code generated by these models may introduce vulnerabilities into real-world systems. Existing methods collect security-focused datasets from real-world vulnerabilities for instruction tuning in order to mitigate such issues. However, they are largely constrained by the data sparsity of vulnerable code, and have limited applicability in the multi-stage post-training workflows of modern LLMs. In this paper, we propose PROSEC, a novel proactive security alignment approach designed to align code LLMs with secure coding practices. PROSEC systematically exposes the vulnerabilities in a code LLM by synthesizing vulnerability-inducing coding scenarios from Common Weakness Enumerations (CWEs) and generates fixes to vulnerable code snippets, allowing the model to learn secure practices through preference learning objectives. The scenarios synthesized by PROSEC trigger 25× more vulnerable code than a normal instruction-tuning dataset, resulting in a security-focused alignment dataset 7× larger than the previous work. Experiments show that models trained with PROSEC are 25.2% to 35.4% more secure compared to previous work without degrading models' utility.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 10 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • 'Tab, Tab, Bug': Security Pitfalls of Next Edit Suggestions in AI-Integrated IDEs 引用了 Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions
  • RESCUE: Retrieval Augmented Secure Code Generation 引用了 Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions
  • Direct Preference Optimization: Your Language Model is Secretly a Reward Model 引用了 Training language models to follow instructions with human feedback
  • SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing Scenarios 引用了 Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions
  • LESS: Selecting Influential Data for Targeted Instruction Tuning 引用了 Training language models to follow instructions with human feedback
  • LESS: Selecting Influential Data for Targeted Instruction Tuning 引用了 Self-Instruct: Aligning Language Models with Self-Generated Instructions
  • PurpCode: Reasoning for Safer Code Generation 引用了 Training language models to follow instructions with human feedback
  • Self-Instruct: Aligning Language Models with Self-Generated Instructions 引用了 Training language models to follow instructions with human feedback
  • Co-PatcheR: Collaborative Software Patching with Component-specific Small Reasoning Models 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper10

  1. PurpCode: Reasoning for Safer Code GenerationJiawei Liu, Nirav Diwan, Zhe Wang, Haoyu Zhai 等NeurIPS 2025 · 20 次引用
  2. RESCUE: Retrieval Augmented Secure Code GenerationJiahao Shi, Tianyi ZhangICLR 2026 · 15 次引用
  3. SecureVibeBench: Benchmarking Secure Vibe Coding of AI Agents via Reconstructing Vulnerability-Introducing ScenariosJunkai Chen, Huihui Huang, Yunbo Lyu, Junwen An 等ACL 2026 · 5 次引用
  4. Co-PatcheR: Collaborative Software Patching with Component-specific Small Reasoning ModelsYuheng Tang, Hongwei Li, Kaijie Zhu, Michael Yang 等NeurIPS 2025 · 2 次引用
  5. 'Tab, Tab, Bug': Security Pitfalls of Next Edit Suggestions in AI-Integrated IDEsYunlong Lyu, Yixuan Tang, Peng Chen, Tian Dong 等CCS 2026 · 1 次引用

它引用的 Paper22

  1. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
  2. Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning 等NeurIPS 2023 · 10,924 次引用
  3. Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code ContributionsHammond Pearce, Baleegh Ahmad, Benjamin Tan, Brendan Dolan-Gavitt 等S&P 2022 · 725 次引用
  4. Self-Instruct: Aligning Language Models with Self-Generated InstructionsYizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu 等ACL 2023 · 540 次引用
  5. LESS: Selecting Influential Data for Targeted Instruction TuningMengzhou Xia, Sadhika Malladi, Suchin Gururangan, Sanjeev Arora 等ICML 2024 · 460 次引用

相关 Paper

  1. Instruction Tuning for Secure Code GenerationJingxuan He, Mark Vero, Gabriela Krasnopolska, Martin T. VechevICML 2024 · 69 次引用
  2. VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security SpecificationsHao Zhu, Jia Li, Cuiyun Gao, Jiaru Qian 等FSE 2026
  3. Teaching an Old LLM Secure Coding: Localized Preference Optimization on Distilled PreferencesMohammad Saqib Hasan, Saikat Chakraborty, Santu Karmaker, Niranjan BalasubramanianACL 2025
  4. CoSec: On-the-Fly Security Hardening of Code LLMs via Supervised Co-decodingDong Li, Meng Yan, Yaosheng Zhang, Zhongxin Liu 等ISSTA 2024 · 10 次引用
  5. RealSec-bench: A Benchmark for Evaluating Secure Code Generation in Real-World RepositoriesYanlin Wang, Ziyao Zhang, Chong Wang, Xinyi Xu 等ACL Findings 2026 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖