CodeFort: Robust Training for Code Generation Models
Yuhao Zhang, Shiqi Wang, Haifeng Qian, Zijian Wang, Mingyue Shang,, Linbo Liu, Sanjay Krishna Gouda, Baishakhi Ray, Murali Krishna Ramanathan,, Xiaofei Ma, Anoop Deoras

TL;DR
CodeFort is a framework that enhances the robustness of code generation models by employing diverse data augmentation and training strategies, significantly improving their resistance to code perturbations and errors.
Contribution
We introduce CodeFort, a comprehensive framework that generalizes code perturbations and integrates multiple robust training strategies to improve code generation model robustness.
Findings
Increased robust pass rates from 14.79 to 21.74.
Reduced robustness drop rate from 95.02% to 54.95%.
Supports high-throughput training with various strategies.
Abstract
Code generation models are not robust to small perturbations, which often lead to incorrect generations and significantly degrade the performance of these models. Although improving the robustness of code generation models is crucial to enhancing user experience in real-world applications, existing research efforts do not address this issue. To fill this gap, we propose CodeFort, a framework to improve the robustness of code generation models, generalizing a large variety of code perturbations to enrich the training data and enabling various robust training strategies, mixing data augmentation, batch augmentation, adversarial logits pairing, and contrastive learning, all carefully designed to support high-throughput training. Extensive evaluations show that we increase the average robust pass rates of baseline CodeGen models from 14.79 to 21.74. We notably decrease the robustness drop…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Model-Driven Software Engineering Techniques · Software Engineering Research
MethodsCodeGen
