Skip to content

Safety hardening and adversarial testing of code large language modelsLarge Language Models for Code: Security Hardening and Adversarial Testing

arXiv· arXiv:2302.05319· CCS 2023· Jingxuan He, Martin Vechev·Indexed by this site · 27 days ago· Originally publishedDefenses
AI summary

The researchers propose SVEN, which steers code large language models to generate safe or unsafe code via continuous vectors targeting specific attributes, without modifying model weights. The method corresponds to their defined task of controllable code generation; on the 2.7B-parameter CodeGen, the proportion of safe code generated by the original model was 59.1%, rising to 92.3% when used for safety hardening and dropping to 36.8% when used for adversarial testing. During training, the authors used a self-built dataset and applied dedicated loss terms to different regions of the code to optimize these vectors. SVEN is close to the original model in functional correctness.

Read originalCCS 2023