Fixing Performance Bugs Through LLM Explanations

Suryansh Singh Sijwali, Angela Marie Colom, Anbi Guo, Suman Saha · 2025

Performance bugs are a persistent challenge in software engineering, often causing resource waste and latency without breaking functionality. These bugs stem from subtle inefficiencies—such as algorithmic bottlenecks, memory overuse, or redundant computation—making them difficult to detect and resolve. This paper presents a fine-tuned large language model (LLM) designed to detect, fix, and explain real-world performance bugs in Java programs. Trained on 392 labeled bugs from 17 Defects4J projects, our GPT-4o-mini model leverages contextual signals—including code diffs, developer comments, and bug reports—to improve accuracy and interpretability. Each prediction includes a fix and a clear, human-readable explanation of the issue and how it was resolved. The model achieves 83.7% detection accuracy and 90.2% report match rate, outperforming the base model by over 16%. We also propose a structured evaluation framework to assess the technical quality of explanations. Our results demonstrate the potential of LLMs in enabling explainable performance debugging, making automated tools more transparent and helpful to developers.

Read the paper · More papers on PaperTik