paper-with-me

Papers

PurpCode: Reasoning for Safer Code Generation

2025-07-25 · Jiawei Liu, Nirav Diwan, Zhe Wang, Haoyu Zhai, Xiaona Zhou, Kiet A. Nguyen, Tianjiao Yu, Muntasir Wahed, Yinlin Deng, Hadjer Benkraouda, Yuxiang Wei, Lingming Zhang, Ismini Lourentzou, Gang Wang arxiv

We introduce PurpCode, the first post-training recipe for training safe code reasoning models towards generating secure code and defending against malicious cyberactivities. PurpCode trains a reasoning model in two stages: (i) Rule Learning, which explicitly teaches the model to reference cybersafety rules to generate vulnerability-free code and to avoid facilitating malicious cyberactivities; and (ii) Reinforcement Learning, which optimizes model safety and preserves model utility through diverse, multi-objective reward mechanisms. To empower the training pipelines with comprehensive cybersafety data, we conduct internal red-teaming to synthesize comprehensive and high-coverage prompts based on real-world tasks for inducing unsafe cyberactivities in the model. Based on PurpCode, we develop a reasoning-based coding model, namely PurpCode-32B, which demonstrates state-of-the-art cybersafety, outperforming various frontier models. Meanwhile, our alignment method decreases the model overrefusal rates in both general and cybersafety-specific scenarios, while preserving model utility in both code generation and common security knowledge.

📄 PDF Abstract BibTeX arXiv:2507.19060

Code (0)

등록된 구현이 없습니다.

Tasks

Reinforcement LearningCode Generation

Similar Papers 제목 키워드 기반

SaFeR-VLM: Toward Safety-aware Fine-grained Reasoning in Multimodal Models

2025-10-08 · Huahui Yi, Kun Wang, Qiankun Li, Miao Yu 외 arxiv

Multimodal Large Reasoning Models (MLRMs) demonstrate impressive cross-modal reasoning but often amplify safety risks under adversarial or unsafe prompts, a phenomenon we call the \textit{Reasoning Tax}. Existing defense…

Reinforcement LearningMultimodal Reasoning

SaFeR-ToolKit: Structured Reasoning via Virtual Tool Calling for Multimodal Safety

2026-03-03 · Zixuan Xu, Tiancheng He, Huahui Yi, Kun Wang 외 arxiv

Vision-language models remain susceptible to multimodal jailbreaks and over-refusal because safety hinges on both visual evidence and user intent, while many alignment pipelines supervise only the final response. To addr…

SafeRAG: Benchmarking Security in Retrieval-Augmented Generation of Large Language Model

2025-01-28 · Xun Liang, Simin Niu, Zhiyu Li, Sensen Zhang 외

The indexing-retrieval-generation paradigm of retrieval-augmented generation (RAG) has been highly successful in solving knowledge-intensive tasks by integrating external knowledge into large language models (LLMs). Howe…

BenchmarkingLanguage ModelingLanguage ModellingLarge Language Model+3

How Does the Thinking Step Influence Model Safety? An Entropy-based Safety Reminder for LRMs

2026-01-07 · Su-Hyeon Kim, Hyundong Jin, Yejin Lee, Yo-Sub Han arxiv

Large Reasoning Models (LRMs) achieve remarkable success through explicit thinking steps, yet the thinking steps introduce a novel risk by potentially amplifying unsafe behaviors. Despite this vulnerability, conventional…

SafeRedir: Prompt Embedding Redirection for Robust Unlearning in Image Generation Models

2026-01-13 · Renyang Liu, Kangjie Chen, Han Qiu, Jie Zhang 외 arxiv

Image generation models (IGMs), while capable of producing impressive and creative content, often memorize a wide range of undesirable concepts from their training data, leading to the reproduction of unsafe content such…

Image Generation