atlas

Research map / Large language models / Instruction and fine-tuning

ProSec: Fortifying Code LLMs with Proactive Security Alignment

ICML 2025 · Large language models › Instruction and fine-tuning · approach: Calibration and knowledge in LLM tuning · 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 ProSec, a proactive security alignment pipeline that synthesizes CWE-triggering coding instructions and builds preference data (secure fixes vs. vulnerable code plus utility-preserving pairs) for an extra offline preference-optimization stage on post-trained code LLMs.

Problem

Code LLMs frequently generate insecure code, and existing security alignment via instruction tuning on sparse real-world vulnerability data (SafeCoder) is data-limited and hard to integrate into multi-stage post-training pipelines.

Approach

Synthesize vulnerability-inducing instructions from CWE definitions with a general LLM, sample vulnerable and fixed code from the target model itself, and apply preference optimization (SimPO) as an extra stage, with training-dynamics-based selection of utility-preserving normal pairs.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
align with ProSec rather than SafeCoderPhi3-mini-Inst · PurpleLlamaVulnerable Code Ratio (Avg.): 44.72 v.s. 33.47Helped
align with ProSec rather than SafeCoderCodeLlama-7B-Inst · PurpleLlamaVulnerable Code Ratio (Avg.): 40.33 v.s. 26.04Helped
align with ProSec rather than the original modelPhi3-mini-Inst · HumanEval-Multipass@1 (Avg.): 32.39 -> 34.15Helped
align with ProSec rather than the original modelCodeLlama-7B-Inst · MXEvalpass@1 (Avg.): 34.52 -> 39.89Helped
use ProSec training-dynamics selection instead of random selection at D_norm ratio 0.1 (ablation)preference data selection · sampled PurpleLlama subsetVul (%): 6.02 -> 5.92Helped
use ProSec training-dynamics selection instead of random selection at D_norm ratio 0.1 (ablation)preference data selection · sampled MXEval subsetUtil (%): 12.30 -> 15.28Helped
use ProSec training-dynamics selection instead of random selection at D_norm ratio 0.3 (ablation)preference data selection · sampled PurpleLlama subsetVul (%): 32.78 -> 27.54Helped
use ProSec training-dynamics selection instead of random selection at D_norm ratio 0.7 (ablation)preference data selection · sampled PurpleLlama subsetVul (%): 30.92 -> 25.58Helped
add -r(x_n,y_f) to f (ablation)training-dynamics influence score · sampled PurpleLlama subsetVul (%): 23.02 -> 23.17No clear effect
replace g with DECREASE (ablation)training-dynamics influence score · sampled PurpleLlama subsetVul (%): 23.02 -> 27.12Hurt
replace g with DECREASE (ablation)training-dynamics influence score · sampled MXEval subsetUtil (%): 45.94 -> 46.44Helped
add D_norm examples to SafeCoder alignment data (ablation)SafeCoder alignment · sampled PurpleLlama subsetVul (%): 33.1 -> 34.4No clear effect

Surprising findings

Limitations

Experimental setup

Datasets: Infinity-Instruct (code subset) SafeCoder dataset PurpleLlama HumanEval-Multi MXEval

Benchmarks: PurpleLlama HumanEval-Multi MXEval

Metrics: vulnerable code ratio pass@1

Baselines: SafeCoder SafeCoder-Inst iterative refinement Phi3-mini-Inst CodeLlama-7B-Inst

Builds on: SimPO SafeCoder Infinity-Instruct Kendall Tau correlation

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