Revisiting the Role of Natural Language Code Comments in Code Translation
Monika Gupta, Ajay Meena, Anamitra Roy Choudhury, Vijay Arya, Srikanta Bedathur

TL;DR
This study empirically demonstrates that natural language code comments, especially those describing overall purpose, significantly improve the accuracy of automated code translation across multiple programming languages, with potential to double performance.
Contribution
It provides the first comprehensive large-scale analysis of comments' impact on code translation, introducing COMMENTRA, a new approach that leverages comments to enhance translation quality.
Findings
Comments describing overall purpose improve translation accuracy
Using comments can potentially double translation performance
Comments have a significant positive impact across multiple languages
Abstract
The advent of large language models (LLMs) has ushered in a new era in automated code translation across programming languages. Since most code-specific LLMs are pretrained on well-commented code from large repositories like GitHub, it is reasonable to hypothesize that natural language code comments could aid in improving translation quality. Despite their potential relevance, comments are largely absent from existing code translation benchmarks, rendering their impact on translation quality inadequately characterised. In this paper, we present a large-scale empirical study evaluating the impact of comments on translation performance. Our analysis involves more than translations, with and without comments, of code samples from two distinct benchmarks covering pairwise translations between five different programming languages: C, C++, Go, Java, and Python. Our results…
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
TopicsNatural Language Processing Techniques · Software Engineering Research · Hate Speech and Cyberbullying Detection
