mlsanityData to 7 Oct 2026

Enhancing Source Code Security with LLMs: Demystifying The Challenges and Generating Reliable Repairs

arXiv 2409.00571 ↗First posted 1 Sep 2024cs.CR cs.AIcited by 4

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

  1. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  2. 2017Proximal Policy Optimization Algorithmscited by 14,441
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  6. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  7. 2023The Falcon Series of Open Language Modelscited by 526
  8. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  9. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  10. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
  11. 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
  12. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
32 more
  1. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
  2. 2015Contextual Markov Decision Processescited by 213
  3. 2022What Language Model Architecture and Pretraining Objective Work Best for Zero-Shot Generalization?cited by 149
  4. 2023MotionGPT: Finetuned LLMs Are General-Purpose Motion Generatorscited by 145
  5. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
  6. 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 124
  7. 2019Neural Machine Translation with Byte-Level Subwordscited by 115
  8. 2021Examining Zero-Shot Vulnerability Repair with Large Language Modelscited by 105
  9. 2020Dos and Don'ts of Machine Learning in Computer Securitycited by 98
  10. 2023The Programmer's Assistant: Conversational Interaction with a Large Language Model for Software Developmentcited by 95
  11. 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 94
  12. 2022Lost at C: A User Study on the Security Implications of Large Language Model Code Assistantscited by 87
  13. 2023VIGC: Visual Instruction Generation and Correctioncited by 80
  14. 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
  15. 2022VulBERTa: Simplified Source Code Pre-Training for Vulnerability Detectioncited by 51
  16. 2019Does BLEU Score Work for Code Migration?cited by 49
  17. 2023Large Language Models and Simple, Stupid Bugscited by 45
  18. 2023A New Era in Software Security: Towards Self-Healing Software via Large Language Models and Formal Verificationcited by 42
  19. 2024On the Prospects of Incorporating Large Language Models (LLMs) in Automated Planning and Scheduling (APS)cited by 40
  20. 2020VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detectorcited by 37
  21. 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
  22. 2023The FormAI Dataset: Generative AI in Software Security Through the Lens of Formal Verificationcited by 32
  23. 2023Towards Human-Bot Collaborative Software Architecting with ChatGPTcited by 31
  24. 2021Automatic Program Repair with OpenAI's Codex: Evaluating QuixBugscited by 24
  25. 2023AIBugHunter: A Practical Tool for Predicting, Classifying and Repairing Software Vulnerabilitiescited by 17
  26. 2023Pre-trained Model-based Automated Software Vulnerability Repair: How Far are We?cited by 15
  27. 2023Binary Code Summarization: Benchmarking ChatGPT/GPT-4 and Other Large Language Modelscited by 13
  28. 2024Code Security Vulnerability Repair Using Reinforcement Learning with Large Language Modelscited by 10
  29. 2023REEF: A Framework for Collecting Real-World Vulnerabilities and Fixescited by 8
  30. 2023An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graphcited by 5
  31. 2021Towards Making Deep Learning-based Vulnerability Detectors Robustcited by 4
  32. 2019How to Avoid Making a Billion-Dollar Mistake: Type-Safe Data Plane Programming with SafeP4cited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 1; 2025: 1; 2026: 2.

4 papers.