Enhancing Source Code Security with LLMs: Demystifying The Challenges and Generating Reliable Repairs
Not on the map. Why?
Abstract (arXiv)
With the recent unprecedented advancements in Artificial Intelligence (AI) computing, progress in Large Language Models (LLMs) is accelerating rapidly, presenting challenges in establishing clear guidelines, particularly in the field of security. That being said, we thoroughly identify and describe three main technical challenges in the security and software engineering literature that spans the entire LLM workflow, namely; textbftextit(i) Data Collection and Labeling; textbftextit(ii) System Design and Learning; and textbftextit(iii) Performance Evaluation. Building upon these challenges, this paper introduces textttSecRepair, an instruction-based LLM system designed to reliably textitidentify, textitdescribe, and automatically textitrepair vulnerable source code. Our system is accompanied by a list of actionable guides on textbftextit(i) Data Preparation and Augmentation Techniques; textbftextit(ii) Selecting and Adapting state-of-the-art LLM Models; textbftextit(iii) Evaluation Procedures. textttSecRepair uses a reinforcement learning-based fine-tuning with a semantic reward that caters to the functionality and security aspects of the generated code. Our empirical analysis shows that textttSecRepair achieves a textit12% improvement in security code repair compared to other LLMs when trained using reinforcement learning. Furthermore, we demonstrate the capabilities of textttSecRepair in generating reliable, functional, and compilable security code repairs against real-world test cases using automated evaluation metrics.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 44 of its 89 references that are in the map. First posted on arXiv 1 Sep 2024.
Builds on
44 of 89 references.
References · 44
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2023The Falcon Series of Open Language Modelscited by 526
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
32 more
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2015Contextual Markov Decision Processescited by 213
- 2022What Language Model Architecture and Pretraining Objective Work Best for Zero-Shot Generalization?cited by 149
- 2023MotionGPT: Finetuned LLMs Are General-Purpose Motion Generatorscited by 145
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
- 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 124
- 2019Neural Machine Translation with Byte-Level Subwordscited by 115
- 2021Examining Zero-Shot Vulnerability Repair with Large Language Modelscited by 105
- 2020Dos and Don'ts of Machine Learning in Computer Securitycited by 98
- 2023The Programmer's Assistant: Conversational Interaction with a Large Language Model for Software Developmentcited by 95
- 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 94
- 2022Lost at C: A User Study on the Security Implications of Large Language Model Code Assistantscited by 87
- 2023VIGC: Visual Instruction Generation and Correctioncited by 80
- 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
- 2022VulBERTa: Simplified Source Code Pre-Training for Vulnerability Detectioncited by 51
- 2019Does BLEU Score Work for Code Migration?cited by 49
- 2023Large Language Models and Simple, Stupid Bugscited by 45
- 2023A New Era in Software Security: Towards Self-Healing Software via Large Language Models and Formal Verificationcited by 42
- 2024On the Prospects of Incorporating Large Language Models (LLMs) in Automated Planning and Scheduling (APS)cited by 40
- 2020VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detectorcited by 37
- 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
- 2023The FormAI Dataset: Generative AI in Software Security Through the Lens of Formal Verificationcited by 32
- 2023Towards Human-Bot Collaborative Software Architecting with ChatGPTcited by 31
- 2021Automatic Program Repair with OpenAI's Codex: Evaluating QuixBugscited by 24
- 2023AIBugHunter: A Practical Tool for Predicting, Classifying and Repairing Software Vulnerabilitiescited by 17
- 2023Pre-trained Model-based Automated Software Vulnerability Repair: How Far are We?cited by 15
- 2023Binary Code Summarization: Benchmarking ChatGPT/GPT-4 and Other Large Language Modelscited by 13
- 2024Code Security Vulnerability Repair Using Reinforcement Learning with Large Language Modelscited by 10
- 2023REEF: A Framework for Collecting Real-World Vulnerabilities and Fixescited by 8
- 2023An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graphcited by 5
- 2021Towards Making Deep Learning-based Vulnerability Detectors Robustcited by 4
- 2019How to Avoid Making a Billion-Dollar Mistake: Type-Safe Data Plane Programming with SafeP4cited by 2
Built on by
Citing papers per year: 2024: 1; 2025: 1; 2026: 2.
4 papers.
- 2025Large Language Models for Code Generation: A Comprehensive Survey of Challenges, Techniques, Evaluation, and Applicationscited by 26
- 2024Helping LLMs Improve Code Generation Using Feedback from Testing and Static Analysiscited by 6
- 2026CIPHER: Cryptographic Insecurity Profiling via Hybrid Evaluation of Responsescited by 1
- 2026SemOPT: Fixing Semantic Errors in LLM-based Optimization Modeling via Reward-Guided Searchcited by 0
- 2026SemOPT: Fixing Semantic Errors in LLM-based Optimization Modeling via Reward-Guided Search29 Sep 2026
- 2026CIPHER: Cryptographic Insecurity Profiling via Hybrid Evaluation of Responses1 Feb 2026
- 2025Large Language Models for Code Generation: A Comprehensive Survey of Challenges, Techniques, Evaluation, and Applications3 Mar 2025
- 2024Helping LLMs Improve Code Generation Using Feedback from Testing and Static Analysis19 Dec 2024