Reproduce “Large Language Models for Code: Security Hardening and Adversarial Testing” on OpenResearch
Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Jingxuan He, Martin Vechev
Researchers at ETH Zurich's SRI Lab developed SVEN, a learning-based method that uses prefix-tuning to control the security properties of large language model (LLM) generated code. SVEN increased the security rate of CodeGen-2.7B from 59.1% to 92.3% for secure generation, and reduced it to 36.8% for adversarial testing, all while maintaining functional correctness.
Key insights
- Continuous prefix-tuning provides a lightweight and modular mechanism to impose fine-grained security control on LLMs without extensive model retraining.
- Applying region-specific loss functions for "changed" (security-sensitive) and "unchanged" (neutral) code areas is essential to balance security property guidance with functional correctness preservation.
- Meticulously curated, high-quality training data, even if smaller in scale, outperforms larger and noisier datasets for achieving precise control over code generation properties.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.