mlsanityData to 7 Oct 2026

A Metamorphic Testing Approach to Diagnosing Memorization in LLM-Based Program Repair

arXiv 2604.21579 ↗First posted 23 Apr 2026cs.SE cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

LLM-based automated program repair (APR) techniques have shown promising results in reducing debugging costs. However, prior results can be affected by data leakage: large language models (LLMs) may memorize bug fixes when evaluation benchmarks overlap with their pretraining data, leading to inflated performance estimates. In this paper, we investigate whether we can better reveal data leakage by combining metamorphic testing (MT) with negative log-likelihood (NLL), which has been used in prior work as a proxy for memorization. We construct variant benchmarks by applying semantics-preserving transformations to two widely used datasets, Defects4J and GitBug-Java. Using these benchmarks, we evaluate the repair success rates of seven LLMs on both original and transformed versions, and analyze the relationship between performance degradation and NLL. Our results show that all evaluated state-of-the-art LLMs exhibit substantial drops in patch generation success rates on transformed benchmarks, ranging from -4.1% for GPT-4o to -15.98% for Llama-3.1. Furthermore, we find that this degradation strongly correlates with NLL on the original benchmarks, suggesting that models perform better on instances they are more likely to have memorized. These findings show that combining MT with NLL provides stronger and more reliable evidence of data leakage, while metamorphic testing alone can help mitigate its effects in LLM-based APR evaluations.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 42 of its 65 references that are in the map. First posted on arXiv 23 Apr 2026.

Builds on

42 of 65 references.

References · 42

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
  5. 2023Mistral 7Bcited by 3,065
  6. 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,928
  7. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  8. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  9. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  10. 2024A Survey on Large Language Models for Code Generationcited by 646
  11. 2023A Comprehensive Overview of Large Language Modelscited by 639
  12. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
30 more
  1. 2023Don't Make Your LLM an Evaluation Benchmark Cheatercited by 194
  2. 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 144
  3. 2023Keep the Conversation Going: Fixing 162 out of 337 bugs for 0.42 each using ChatGPTcited by 125
  4. 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 106
  5. 2024Benchmarking Benchmark Leakage in Large Language Modelscited by 102
  6. 2022Natural Attack for Pre-trained Models of Codecited by 72
  7. 2023A Survey of Learning-based Automated Program Repaircited by 55
  8. 2023Estimating Contamination via Perplexity: Quantifying Memorisation in Language Model Evaluationcited by 47
  9. 2024Large Language Model for Vulnerability Detection and Repair: Literature Review and the Road Aheadcited by 41
  10. 2024A Systematic Literature Review on Large Language Models for Automated Program Repaircited by 37
  11. 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
  12. 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarkscited by 34
  13. 2024Source Code Summarization in the Era of Large Language Modelscited by 30
  14. 2023A Critical Review of Large Language Model on Software Engineering: An Example from ChatGPT and Automated Program Repaircited by 29
  15. 2023Traces of Memorisation in Large Language Models for Codecited by 26
  16. 2025A Survey of LLM-based Automated Program Repair: Taxonomies, Design Paradigms, and Applicationscited by 24
  17. 2021Adversarial Robustness of Deep Code Comment Generationcited by 22
  18. 2024Hybrid Automated Program Repair by Combining Large Language Models and Program Analysiscited by 22
  19. 2024How Far Can We Go with Practical Function-Level Program Repair?cited by 16
  20. 2024GitBug-Java: A Reproducible Benchmark of Recent Java Bugscited by 13
  21. 2019Empirical Review of Java Program Repair Tools: A Large-Scale Experiment on 2,141 Bugs and 23,551 Repair Attemptscited by 12
  22. 2023A Survey on Automated Program Repair Techniquescited by 12
  23. 2024Are Large Language Models Memorizing Bug Benchmarks?cited by 11
  24. 2024On Inter-dataset Code Duplication and Data Leakage in Large Language Modelscited by 10
  25. 2014Automated Fixing of Programs with Contractscited by 4
  26. 2025Evaluating the Generalizability of LLMs in Automated Program Repaircited by 3
  27. 2025Metamorphic Testing of Deep Code Models: A Systematic Literature Reviewcited by 3
  28. 2022CLAWSAT: Towards Both Robust and Accurate Code Modelscited by 2
  29. 2024Exploring and Lifting the Robustness of LLM-powered Automated Program Repair with Metamorphic Testingcited by 2
  30. 2024Addressing Data Leakage in HumanEval Using Combinatorial Test Designcited by 1

Built on by

Not cited yet.