DeepCode AI Fix: Fixing Security Vulnerabilities with Large Language Models
Not on the map. Why?
Abstract (arXiv)
The automated program repair field has attracted substantial interest over the years, but despite significant research efforts, creating a system that works well for complex semantic bugs such as security vulnerabilities has proven difficult. A promising direction to solve this challenge is by leveraging large language models (LLMs), which are increasingly used to solve various programming tasks. In this paper, we investigate the effectiveness of LLMs for solving code-repair task. We show that the task is difficult as it requires the model to learn long-range code relationships, a task that inherently relies on extensive amounts of training data. At the same time, creating a large, clean dataset for complex program bugs and their corresponding fixes is non-trivial. We propose a technique to address these challenges with a new approach for querying and fine-tuning LLMs. The idea is to use program analysis to limit the LLM's attention mechanism on the portions of code needed to perform the fix, drastically reducing the amount of required training data. Concretely, for training and inference, rather than feeding the entire program to the LLM, we reduce its code to a much shorter snippet that contains the reported defect together with the necessary context - and use that instead. Our evaluation shows that this code reduction approach substantially improves available models such as GPT-4 using few-shot learning, as well as fine-tuning models. To train and evaluate our system, we created a comprehensive code fixing dataset by extensively labeling 156 bug patterns (including 40 security rules), requiring complex interprocedural dataflow to discover. Our best system with Mixtral-8x7B can remove more than 80% of the reported defects while exactly matching the human fix in between 10 and 50% of cases, outperforming baselines based on GPT-3.5 and GPT-4, or based on window-based models like TFix.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 19 of its 56 references that are in the map. First posted on arXiv 19 Feb 2024.
Builds on
19 of 56 references.
References · 19
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,355
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2019ZeRO: Memory Optimizations Toward Training Trillion Parameter Modelscited by 1,278
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2017Learning to Represent Programs with Graphscited by 219
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 144
- 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
- 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2019Getafix: Learning to Fix Bugs Automaticallycited by 40
7 more
- 2019Neural Program Repair by Jointly Learning to Localize and Repaircited by 39
- 2018Nopol: Automatic Repair of Conditional Statement Bugs in Java Programscited by 32
- 2018A Comprehensive Study of Automatic Program Repair on the QuixBugs Benchmarkcited by 17
- 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
- 2017Semantic Code Repair using Neuro-Symbolic Transformation Networkscited by 13
- 2021Sorald: Automatic Patch Suggestions for SonarQube Static Analysis Violationscited by 4
- 2019ENCORE: Ensemble Learning using Convolution Neural Machine Translation for Automatic Program Repaircited by 3
Built on by
Citing papers per year: 2024: 2; 2025: 3; 2026: 2.
7 papers.
- 2024Using AI-Based Coding Assistants in Practice: State of Affairs, Perceptions, and Ways Forwardcited by 44
- 2025PerfCoder: Large Language Models for Interpretable Code Performance Optimizationcited by 3
- 2024Optimizing AI-Assisted Code Generationcited by 2
- 2025Evaluating Software Process Models for Multi-Agent Class-Level Code Generationcited by 2
- 2025AVIATOR: Towards AI-Agentic Vulnerability Injection Workflow for High-Fidelity, Large-Scale Code Security Datasetcited by 0
- 2026Fine-grained Approaches for Confidence Calibration of LLMs in Automated Code Revisioncited by 0
- 2026A Queueing-Theoretic Framework for Dynamic Attack Surfaces: Data-Integrated Risk Analysis and Adaptive Defensecited by 0
- 2026A Queueing-Theoretic Framework for Dynamic Attack Surfaces: Data-Integrated Risk Analysis and Adaptive Defense12 Apr 2026
- 2026Fine-grained Approaches for Confidence Calibration of LLMs in Automated Code Revision8 Apr 2026
- 2025PerfCoder: Large Language Models for Interpretable Code Performance Optimization16 Dec 2025
- 2025Evaluating Software Process Models for Multi-Agent Class-Level Code Generation12 Nov 2025
- 2025AVIATOR: Towards AI-Agentic Vulnerability Injection Workflow for High-Fidelity, Large-Scale Code Security Dataset28 Aug 2025
- 2024Optimizing AI-Assisted Code Generation14 Dec 2024
- 2024Using AI-Based Coding Assistants in Practice: State of Affairs, Perceptions, and Ways Forward11 Jun 2024