Reproduce “Functional and Secure Code Generation with Task Vectors” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Felix Wang, Anudeep Das, Mei Nagappan, N. Asokan
SecVecCoder, a method utilizing task-vector arithmetic, modulates coding Large Language Models to generate code that is both functional and secure. This approach achieved an average 36.1% relative improvement in simultaneous functionality and security (sec-pass@1) over base models, while reducing training costs by up to 92% and incurring minimal inference latency.
Key insights
- Localized Preference Optimization (LPO) is effective in creating negatively correlated secure and insecure task vectors, which are crucial for effective steering.
- The 'Secure-Anchored' task-vector operator, combining the secure fine-tuned direction with the negation of the insecure direction, proves optimal for simultaneously improving functionality and security.
- Explicitly suppressing insecure code patterns using the insecure task vector is a critical component for achieving high sec-pass rates, demonstrating its necessity beyond merely promoting secure code.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.