mlsanityData to 7 Oct 2026

Code Security Vulnerability Repair Using Reinforcement Learning with Large Language Models

arXiv 2401.07031 ↗First posted 13 Jan 2024cs.CR cs.AI cs.SEcited by 10

Not on the map. Why?

Abstract (arXiv)

With the recent advancement of Large Language Models (LLMs), generating functionally correct code has become less complicated for a wide array of developers. While using LLMs has sped up the functional development process, it poses a heavy risk to code security. Code generation with proper security measures using LLM is a significantly more challenging task than functional code generation. Security measures may include adding a pair of lines of code with the original code, consisting of null pointer checking or prepared statements for SQL injection prevention. Currently, available code repair LLMs generate code repair by supervised fine-tuning, where the model looks at cross-entropy loss. However, the original and repaired codes are mostly similar in functionality and syntactically, except for a few (1-2) lines, which act as security measures. This imbalance between the lines needed for security measures and the functional code enforces the supervised fine-tuned model to prioritize generating functional code without adding proper security measures, which also benefits the model by resulting in minimal loss. Therefore, in this work, for security hardening and strengthening of generated code from LLMs, we propose a reinforcement learning-based method for program-specific repair with the combination of semantic and syntactic reward mechanisms that focus heavily on adding security and functional measures in the code, respectively.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 20 of its 33 references that are in the map. First posted on arXiv 13 Jan 2024.

Builds on

20 of 33 references.

References · 20

  1. 2022Training language models to follow instructions with human feedbackcited by 15,712
  2. 2017Proximal Policy Optimization Algorithmscited by 14,441
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
  5. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  6. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  7. 2023StarCoder: may the source be with you!cited by 790
  8. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  9. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  10. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  11. 2015Contextual Markov Decision Processescited by 213
  12. 2022What Language Model Architecture and Pretraining Objective Work Best for Zero-Shot Generalization?cited by 149
8 more
  1. 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 124
  2. 2022Lost at C: A User Study on the Security Implications of Large Language Model Code Assistantscited by 87
  3. 2023How Secure is Code Generated by ChatGPT?cited by 77
  4. 2023Large Language Models and Simple, Stupid Bugscited by 45
  5. 2020VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detectorcited by 37
  6. 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
  7. 2021Automatic Program Repair with OpenAI's Codex: Evaluating QuixBugscited by 24
  8. 2023An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graphcited by 5

Built on by

Cited by year (2026 to 7 Oct)

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

10 papers.