Salvato in:
Dettagli Bibliografici
Autori principali: Gupta, Monika, Meena, Ajay, Choudhury, Anamitra Roy, Arya, Vijay, Bedathur, Srikanta
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:https://arxiv.org/abs/2601.16661
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866917219526508544
author Gupta, Monika
Meena, Ajay
Choudhury, Anamitra Roy
Arya, Vijay
Bedathur, Srikanta
author_facet Gupta, Monika
Meena, Ajay
Choudhury, Anamitra Roy
Arya, Vijay
Bedathur, Srikanta
contents 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 $80,000$ translations, with and without comments, of $1100+$ code samples from two distinct benchmarks covering pairwise translations between five different programming languages: C, C++, Go, Java, and Python. Our results provide strong evidence that code comments, particularly those that describe the overall purpose of the code rather than line-by-line functionality, significantly enhance translation accuracy. Based on these findings, we propose COMMENTRA, a code translation approach, and demonstrate that it can potentially double the performance of LLM-based code translation. To the best of our knowledge, our study is the first in terms of its comprehensiveness, scale, and language coverage on how to improve code translation accuracy using code comments.
format Preprint
id arxiv_https___arxiv_org_abs_2601_16661
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Revisiting the Role of Natural Language Code Comments in Code Translation
Gupta, Monika
Meena, Ajay
Choudhury, Anamitra Roy
Arya, Vijay
Bedathur, Srikanta
Software Engineering
Artificial Intelligence
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 $80,000$ translations, with and without comments, of $1100+$ code samples from two distinct benchmarks covering pairwise translations between five different programming languages: C, C++, Go, Java, and Python. Our results provide strong evidence that code comments, particularly those that describe the overall purpose of the code rather than line-by-line functionality, significantly enhance translation accuracy. Based on these findings, we propose COMMENTRA, a code translation approach, and demonstrate that it can potentially double the performance of LLM-based code translation. To the best of our knowledge, our study is the first in terms of its comprehensiveness, scale, and language coverage on how to improve code translation accuracy using code comments.
title Revisiting the Role of Natural Language Code Comments in Code Translation
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2601.16661