Model Editing for LLMs4Code: How Far are We?
Not on the map. Why?
Abstract (arXiv)
Large Language Models for Code (LLMs4Code) have been found to exhibit outstanding performance in the software engineering domain, especially the remarkable performance in coding tasks. However, even the most advanced LLMs4Code can inevitably contain incorrect or outdated code knowledge. Due to the high cost of training LLMs4Code, it is impractical to re-train the models for fixing these problematic code knowledge. Model editing is a new technical field for effectively and efficiently correcting erroneous knowledge in LLMs, where various model editing techniques and benchmarks have been proposed recently. Despite that, a comprehensive study that thoroughly compares and analyzes the performance of the state-of-the-art model editing techniques for adapting the knowledge within LLMs4Code across various code-related tasks is notably absent. To bridge this gap, we perform the first systematic study on applying state-of-the-art model editing approaches to repair the inaccuracy of LLMs4Code. To that end, we introduce a benchmark named CLMEEval, which consists of two datasets, i.e., CoNaLa-Edit (CNLE) with 21K+ code generation samples and CodeSearchNet-Edit (CSNE) with 16K+ code summarization samples. With the help of CLMEEval, we evaluate six advanced model editing techniques on three LLMs4Code: CodeLlama (7B), CodeQwen1.5 (7B), and Stable-Code (3B). Our findings include that the external memorization-based GRACE approach achieves the best knowledge editing effectiveness and specificity (the editing does not influence untargeted knowledge), while generalization (whether the editing can generalize to other semantically-identical inputs) is a universal challenge for existing techniques. Furthermore, building on in-depth case analysis, we introduce an enhanced version of GRACE called A-GRACE, which incorporates contrastive learning to better capture the semantics of the inputs.
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Builds on 50 of its 72 references that are in the map. First posted on arXiv 11 Nov 2024.
Builds on
50 of 72 references.
References · 50
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2023Qwen Technical Reportcited by 3,344
- 2020Supervised Contrastive Learningcited by 2,829
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2023A Survey of Large Language Modelscited by 2,576
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2023A Survey on Large Language Model based Autonomous Agentscited by 2,242
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2022Survey of Hallucination in Natural Language Generationcited by 2,075
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
38 more
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2023A Survey on Evaluation of Large Language Modelscited by 1,242
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,135
- 2022Mass-Editing Memory in a Transformercited by 1,001
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2021Fast Model Editing at Scalecited by 498
- 2023Editing Large Language Models: Problems, Methods, and Opportunitiescited by 372
- 2022A Systematic Evaluation of Large Language Models of Codecited by 363
- 2023MQuAKE: Assessing Knowledge Editing in Language Models via Multi-Hop Questionscited by 300
- 2022Aging with GRACE: Lifelong Model Editing with Discrete Key-Value Adaptorscited by 271
- 2023Evaluating the Ripple Effects of Knowledge Editing in Language Modelscited by 242
- 2020Modifying Memories in Transformer Modelscited by 224
- 2023Knowledge Editing for Large Language Models: A Surveycited by 194
- 2023PMET: Precise Model Editing in a Transformercited by 173
- 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
- 2024A Comprehensive Study of Knowledge Editing for Large Language Modelscited by 163
- 2023CodeBERTScore: Evaluating Code Generation with Pretrained Models of Codecited by 102
- 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 100
- 2023EasyEdit: An Easy-to-use Knowledge Editing Framework for Large Language Modelscited by 98
- 2022Natural Attack for Pre-trained Models of Codecited by 75
- 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 72
- 2023Massive Editing for Large Language Models via Meta Learningcited by 63
- 2024Arctic-Embed: Scalable, Efficient, and Accurate Text Embedding Modelscited by 61
- 2024Bugs in Large Language Models Generated Code: An Empirical Studycited by 60
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 53
- 2023Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Studycited by 44
- 2023Unveiling the Pitfalls of Knowledge Editing for Large Language Modelscited by 43
- 2023How Do Large Language Models Capture the Ever-changing World Knowledge? A Review of Recent Advancescited by 33
- 2022On the Importance of Building High-quality Training Datasets for Neural Code Searchcited by 30
- 2024MIKE: A New Benchmark for Fine-grained Multimodal Entity Knowledge Editingcited by 25
- 2021Project-Level Encoding for Neural Source Code Summarization of Subroutinescited by 24
- 2022CoCoSoDa: Effective Contrastive Learning for Code Searchcited by 22
- 2023DUnE: Dataset for Unified Editingcited by 19
- 2024CodeUpdateArena: Benchmarking Knowledge Editing on API Updatescited by 19
- 2023CCT5: A Code-Change-Oriented Pre-Trained Modelcited by 18
- 2024Compositional API Recommendation for Library-Oriented Code Generationcited by 10
- 2024SWEA: Updating Factual Knowledge in Large Language Models via Subject Word Embedding Alteringcited by 7
Built on by
Citing papers per year: 2024: 1; 2025: 6; 2026: 3.
10 papers.
- 2025CODEMENV: Benchmarking Large Language Models on Code Migrationcited by 13
- 2025CODESYNC: Synchronizing Large Language Models with Dynamic Code Evolution at Scalecited by 8
- 2025Stand on The Shoulders of Giants: Building JailExpert from Previous Attack Experiencecited by 6
- 2024LSAQ: Layer-Specific Adaptive Quantization for Large Language Model Deploymentcited by 4
- 2025Rethinking Autonomy: Preventing Failures in AI-Driven Software Engineeringcited by 4
- 2025Integrating Expert Knowledge into Logical Programs via LLMscited by 3
- 2025Understanding Robustness of Model Editing in Code LLMscited by 1
- 2026Towards Knowledge Alignment in Code LLMs: Contrastive Unlearning for Evolving APIscited by 1
- 2026Diagnosing Knowledge Gaps in LLM Tool Use: An Agentic Benchmark for Novel API Acquisitioncited by 0
- 2026Mind the Gaps: From Failure Attribution to Closed-Form Repair of Code Language Modelscited by 0
- 2026Mind the Gaps: From Failure Attribution to Closed-Form Repair of Code Language Models4 Oct 2026
- 2026Towards Knowledge Alignment in Code LLMs: Contrastive Unlearning for Evolving APIs29 Jun 2026
- 2026Diagnosing Knowledge Gaps in LLM Tool Use: An Agentic Benchmark for Novel API Acquisition2 Jun 2026
- 2025Understanding Robustness of Model Editing in Code LLMs5 Nov 2025
- 2025Stand on The Shoulders of Giants: Building JailExpert from Previous Attack Experience25 Aug 2025
- 2025Rethinking Autonomy: Preventing Failures in AI-Driven Software Engineering15 Aug 2025
- 2025CODEMENV: Benchmarking Large Language Models on Code Migration1 Jun 2025
- 2025CODESYNC: Synchronizing Large Language Models with Dynamic Code Evolution at Scale23 Feb 2025
- 2025Integrating Expert Knowledge into Logical Programs via LLMs17 Feb 2025
- 2024LSAQ: Layer-Specific Adaptive Quantization for Large Language Model Deployment24 Dec 2024