基于大语言模型的自动代码修复综述
Summary
This survey maps how large language models are changing automated program repair (APR), which aims to generate patches for faulty code without manual effort. The authors place APR in three stages: traditional, deep-learning-based, and LLM-based. Traditional approaches rely on search, templates or constraint solving. Deep-learning approaches use networks such as RNNs and LSTMs. They argue that LLMs understand code semantics and syntax better and can fix harder defects with more varied patches.
The survey covers CCF-A venue papers from January 2019 to May 2024. It sorts LLM-based APR into two families borrowed from NLP tasks:
- Cloze style: the faulty code is masked and the model fills the gap.
- Neural machine translation style: the model "translates" buggy code into fixed code.
Tools in each family are compared by model type, model size, defect class, programming language, and strengths and weaknesses. The authors also review benchmarks, evaluation metrics and empirical studies, and they outline open challenges. For Chinese-language readers, the survey is a useful structured entry point into LLM-driven repair research.
Key points
- Since 2022, papers on LLM-based APR have outnumbered those on traditional and deep-learning APR, and the gap keeps growing.
- Defects are grouped into programming errors, software bugs and security vulnerabilities. Models are adapted to repair through either pretrain-finetune or prompt engineering; AlphaRepair, for example, works through prompting alone.
- Cited example: VulRepair, built on T5, raised vulnerability-repair success from 23% to 44%. Other tools discussed include TYPEFIX, Gamma, TransplantFix, CoCoNuT, SelfAPR, RAP-Gen and ITER.
- Benchmarks referenced include Defects4J, QuixBugs, Vul4J, Bugs.Jar, BEARS, ManySStuBs4J, TSSB-3M and MegaDiff. Code models mentioned include CodeBERT, GraphCodeBERT, CodeT5+ and GPT-C.
- The authors propose four future directions: faster repair, better patch quality, stronger generalization, and end-to-end repair pipelines.
Cite
@article{2025,
title = {{基于大语言模型的自动代码修复综述}},
author = {许鹏宇 and 况博裕 and 苏铓 and 付安民},
journal = {计算机研究与发展 (Journal of Computer Research and Development)},
year = {2025},
doi = {10.7544/issn1000-1239.202440467},
url = {https://doi.org/10.7544/issn1000-1239.202440467}
}References
- Piscataway, NJ: IEEE, 2019: 102−113 find
- [29] Liu Kui, Koyuncu A, Kim D, et al. TBar: Revisiting template-based automated program repair[C]//Proc of the 28th ACM Int Symp on Software Testing and Analysis. New York: ACM, 2019: 31−42 find
- [30] Ghanbari A, Benton S, Zhang Lingming. Practical program repair via bytecode mutation[C]//Proc of the 28th ACM Int Symp on Software Testing and Analysis. New York: ACM, 2019: 19−30 find
- [31] Afzal A, Motwani M, Stolee K T, et al. SOSRepair: Expressive semantic search for real-world program repair[J]. IEEE Transactions on Software Engineering, 2021, 47(10): 2162−2181 find
- [32] Niu Cuicui, Pan Zhengzhi, Liu Hai. Framework and approaches of differentially private generative adversarial networks: A survey[J]. Journal of Guizhou Normal University: Natural Sciences, 2022, 40(4): find
This page in Markdown → https://md.research.elamur.ai/free/papers/xu-2025-large-language-model/