Code Security Vulnerability Repair Using Reinforcement Learning with Large Language Models
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
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023StarCoder: may the source be with you!cited by 790
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 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
- 2015Contextual Markov Decision Processescited by 213
- 2022What Language Model Architecture and Pretraining Objective Work Best for Zero-Shot Generalization?cited by 149
8 more
- 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 124
- 2022Lost at C: A User Study on the Security Implications of Large Language Model Code Assistantscited by 87
- 2023How Secure is Code Generated by ChatGPT?cited by 77
- 2023Large Language Models and Simple, Stupid Bugscited by 45
- 2020VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detectorcited by 37
- 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
- 2021Automatic Program Repair with OpenAI's Codex: Evaluating QuixBugscited by 24
- 2023An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graphcited by 5
Built on by
Citing papers per year: 2024: 4; 2025: 4; 2026: 2.
10 papers.
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2024Constrained Decoding for Secure Code Generationcited by 35
- 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Modelscited by 23
- 2025Training Language Models to Generate Quality Code with Program Analysis Feedbackcited by 11
- 2025Tests as Prompt: A Test-Driven-Development Benchmark for LLM Code Generationcited by 5
- 2024Enhancing Source Code Security with LLMs: Demystifying The Challenges and Generating Reliable Repairscited by 4
- 2025BitsAI-Fix: LLM-Driven Approach for Automated Lint Error Resolution in Practicecited by 0
- 2025AVIATOR: Towards AI-Agentic Vulnerability Injection Workflow for High-Fidelity, Large-Scale Code Security Datasetcited by 0
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoringcited by 0
- 2026From Evaluation to Optimisation: Hierarchy-Aware Training Signals for CWE Prediction in Pythoncited by 0
- 2026From Evaluation to Optimisation: Hierarchy-Aware Training Signals for CWE Prediction in Python23 Jul 2026
- 2026Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring1 May 2026
- 2025AVIATOR: Towards AI-Agentic Vulnerability Injection Workflow for High-Fidelity, Large-Scale Code Security Dataset28 Aug 2025
- 2025BitsAI-Fix: LLM-Driven Approach for Automated Lint Error Resolution in Practice5 Aug 2025
- 2025Training Language Models to Generate Quality Code with Program Analysis Feedback28 May 2025
- 2025Tests as Prompt: A Test-Driven-Development Benchmark for LLM Code Generation13 May 2025
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024Enhancing Source Code Security with LLMs: Demystifying The Challenges and Generating Reliable Repairs1 Sep 2024
- 2024Constrained Decoding for Secure Code Generation30 Apr 2024
- 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Models29 Apr 2024