CodeFort: Robust Training for Code Generation Models
Not on the map. Why?
Abstract (arXiv)
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 rate from 95.02% to 54.95% against code-syntax perturbations.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 28 of its 38 references that are in the map. First posted on arXiv 11 Apr 2024.
Builds on
28 of 38 references.
References · 28
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,415
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2023StarCoder: may the source be with you!cited by 799
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
- 2022The Stack: 3 TB of permissively licensed source codecited by 359
- 2018Adversarial Logit Pairingcited by 224
16 more
- 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 125
- 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 103
- 2020Contrastive Code Representation Learningcited by 76
- 2022Natural Attack for Pre-trained Models of Codecited by 75
- 2019Adversarial Examples for Models of Codecited by 63
- 2022CodeAttack: Code-Based Adversarial Attacks for Pre-trained Programming Language Modelscited by 53
- 2020Semantic Robustness of Models of Source Codecited by 45
- 2021Multilingual training for Software Engineeringcited by 43
- 2020Adversarial Robustness for Codecited by 38
- 2019Augment your batch: better training with larger batchescited by 37
- 2021Generating Adversarial Computer Programs using Optimized Obfuscationscited by 22
- 2021Adversarial Robustness of Deep Code Comment Generationcited by 22
- 2022ContraCLM: Contrastive Learning For Causal Language Modelcited by 18
- 2023One Adapter for All Programming Languages? Adapter Tuning for Code Search and Summarizationcited by 16
- 2023CONCORD: Clone-aware Contrastive Learning for Source Codecited by 5
- 2021On Adversarial Robustness of Synthetic Code Generationcited by 3
Built on by
Citing papers per year: 2025: 3; 2026: 1.
4 papers.
- 2025Understanding and Bridging the Planner-Coder Gap: A Systematic Study on the Robustness of Multi-Agent Systems for Code Generationcited by 4
- 2025CCCI: Code Completion with Contextual Information for Complex Data Transfer Tasks Using Large Language Modelscited by 2
- 2025Prompt Stability in Code LLMs: Measuring Sensitivity across Emotion- and Personality-Driven Variationscited by 1
- 2026An Initial Exploration of Contrastive Prompt Tuning to Generate Energy-Efficient Codecited by 0
- 2026An Initial Exploration of Contrastive Prompt Tuning to Generate Energy-Efficient Code3 Mar 2026
- 2025Understanding and Bridging the Planner-Coder Gap: A Systematic Study on the Robustness of Multi-Agent Systems for Code Generation12 Oct 2025
- 2025Prompt Stability in Code LLMs: Measuring Sensitivity across Emotion- and Personality-Driven Variations17 Sep 2025
- 2025CCCI: Code Completion with Contextual Information for Complex Data Transfer Tasks Using Large Language Models29 Mar 2025