Instruction fine-tuning for safe code generationInstruction Tuning for Secure Code Generation
AI summary
The authors propose SafeCoder, which combines safety fine-tuning with standard instruction fine-tuning to improve the safety of code generated by large language models. The method performs safety-centric fine-tuning using a diverse, high-quality dataset collected through an automated pipeline, and jointly optimizes safety and utility. The authors report that, on multiple mainstream models and datasets, SafeCoder improves safety by about 30% while maintaining utility.