Can Code Comments Pay for Themselves?
Coding agents write a growing share of code and readily fill it with comments, which add to the token bill of every model that reads the code afterward. We ask whether the comments help these models, and whether a cheap score can tell which ones are worth keeping. We evaluate language models' performance and reasoning cost on programs from four tasks: Python-to-Java translation, output prediction, loop counting, and call-graph recovery. We generate comments from each program's code, then compare the same code with comments, without comments, and with generic filler comments as a control for added text. Comments do not help: across twenty-eight task and model settings spanning four model families, they never detectably outperform either control and, after accounting for their own length, reduce total token use in only one. We test whether reduced uncertainty about code identifies "useful" comments, using the decrease in a proxy language model's negative log-likelihood of the code given each comment. The score distinguishes code-specific comments from filler on every dataset, but does not predict performance gains or which comments are worth keeping. We re-examine a prior study reporting Python-to-Java translation gains from generated comments. We find that code reformatting in that study confounds the comparison: the comments add no detectable gain beyond the reformatting. Overall, reduced uncertainty about code through comments does not imply better language model task performance. Comments containing only information inferable from the code rarely repay their token cost. We release the comments, filler, and scores.
Authors
- Alon Kipnis (ORCID: https://orcid.org/0000-0003-3798-8035)
- Alexander Tsvetkov (ORCID: https://orcid.org/0009-0003-3969-4951)
Institutions
- Reichman University (IL)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-29
- DOI
- https://doi.org/10.5281/zenodo.24660207
- Primary Topic
- Software Engineering Research
- Type
- preprint