On the Impact of Code Comments for Automated Bug-Fixing: An Empirical Study
Antonio Vitale, Emanuela Guglielmi, Simone Scalabrino, Rocco Oliveto

TL;DR
This study empirically examines how the presence of comments in code affects the performance of Large Language Models in automated bug fixing, revealing that comments significantly enhance bug-fixing accuracy especially when present during both training and inference.
Contribution
It demonstrates that comments improve bug-fixing accuracy in LLMs and highlights the importance of comments detailing implementation for effective automated bug fixing.
Findings
Comments can improve bug-fixing accuracy by up to three times.
Training with comments does not harm performance when comments are absent.
Implementation-focused comments are particularly beneficial for bug fixing.
Abstract
Large Language Models (LLMs) are increasingly relevant in Software Engineering research and practice, with Automated Bug Fixing (ABF) being one of their key applications. ABF involves transforming a buggy method into its fixed equivalent. A common preprocessing step in ABF involves removing comments from code prior to training. However, we hypothesize that comments may play a critical role in fixing certain types of bugs by providing valuable design and implementation insights. In this study, we investigate how the presence or absence of comments, both during training and at inference time, impacts the bug-fixing capabilities of LLMs. We conduct an empirical evaluation comparing two model families, each evaluated under all combinations of training and inference conditions (with and without comments), and thereby revisiting the common practice of removing comments during training. To…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Engineering Techniques and Practices · Software Testing and Debugging Techniques
