Skip to content

HexaCoder: Secure Code Generation via Oracle-Guided Synthetic Training DataHexaCoder: Secure Code Generation via Oracle-Guided Synthetic Training Data

arXiv· arXiv:2409.06446· Hossein Hajipour, Lea Schönherr, Thorsten Holz, Mario Fritz·Indexed by this site · 26 days ago· Originally publishedDefenses
AI summary

HexaCoder improves large language models' ability to generate secure code through Oracle-guided synthetic training data, reducing vulnerable code by up to 85% compared with baselines. The method uses a security Oracle to identify vulnerabilities, has an LLM fix them, generates vulnerability-fix code pairs for specific CWE types, and fine-tunes with LoRA, introducing security-related libraries at generation time. Evaluations on three benchmarks across four LLMs show that the method improves security while maintaining relatively high functional correctness.

Read originalarxiv.org