[Paper Review] Code to Comment Translation: A Comparative Study on Model Effectiveness & Errors
This paper conducts a comparative study of three state-of-the-art neural code summarization models—CodeBERT, NeuralCodeSum, and code2seq—on the Funcom dataset using both automatic metrics and manual error analysis. It finds CodeBERT outperforms the others in quantitative metrics and identifies a comprehensive, empirically derived taxonomy of model errors, offering actionable insights for improving future code summarization systems.
Automated source code summarization is a popular software engineering research topic wherein machine translation models are employed to "translate" code snippets into relevant natural language descriptions. Most evaluations of such models are conducted using automatic reference-based metrics. However, given the relatively large semantic gap between programming languages and natural language, we argue that this line of research would benefit from a qualitative investigation into the various error modes of current state-of-the-art models. Therefore, in this work, we perform both a quantitative and qualitative comparison of three recently proposed source code summarization models. In our quantitative evaluation, we compare the models based on the smoothed BLEU-4, METEOR, and ROUGE-L machine translation metrics, and in our qualitative evaluation, we perform a manual open-coding of the most common errors committed by the models when compared to ground truth captions. Our investigation reveals new insights into the relationship between metric-based performance and model prediction errors grounded in an empirically derived error taxonomy that can be used to drive future research efforts
Motivation & Objective
- To evaluate the performance of three leading neural code summarization models—CodeBERT, NeuralCodeSum, and code2seq—on the Funcom dataset using standard automatic metrics.
- To investigate the qualitative failure modes of these models by manually analyzing discrepancies between generated summaries and ground truth captions.
- To develop an empirically grounded error taxonomy that captures recurring prediction errors across models, enabling targeted improvements in future research.
- To provide open-source resources, including trained models, code, and annotated examples, to support reproducibility and further research in code summarization.
Proposed method
- Quantitative evaluation using three standard machine translation metrics: smoothed BLEU-4, METEOR, and ROUGE-L.
- Manual open-coding of model predictions against ground truth captions to identify and categorize common error types.
- Application of qualitative research techniques adapted from open coding (Miles et al., 2013) to systematically derive error categories from model outputs.
- Use of the Funcom dataset, which contains Java method-level code snippets paired with human-annotated natural language comments.
- Statistical significance testing to validate performance differences between models, particularly between CodeBERT and the other two.
- Public release of all annotations, guidelines, code, and trained models via GitHub and Zenodo for reproducibility and community use.
Experimental results
Research questions
- RQ1How do CodeBERT, NeuralCodeSum, and code2seq compare in terms of automatic metric scores (BLEU-4, METEOR, ROUGE-L) on the Funcom dataset?
- RQ2What are the most frequent and systematic error types made by these models when generating code summaries compared to ground truth?
- RQ3How do error patterns differ across model architectures (e.g., sequence-based vs. structure-based models)?
- RQ4To what extent do reference-based metrics like BLEU and ROUGE-L correlate with human-identifiable errors in code summarization?
- RQ5Can a grounded, empirically derived error taxonomy be constructed to guide future model improvements in code summarization?
Key findings
- CodeBERT achieved the highest performance across all three metrics, with a smoothed BLEU-4 score of 24.15, a METEOR score of 30.34, and a ROUGE-L score of 35.65, significantly outperforming NeuralCodeSum and code2seq.
- The qualitative analysis revealed a range of recurring error modes, including semantic omission, incorrect entity references, and syntactic incoherence, which were not fully captured by automatic metrics.
- Error patterns varied significantly across models: CodeBERT made fewer factual errors but occasionally omitted key semantic elements, while code2seq struggled with syntactic correctness and entity alignment.
- The study found that reference-based metrics such as BLEU and ROUGE-L provide only a partial picture of model quality, as they fail to detect many semantically meaningful errors.
- A detailed error taxonomy was constructed from manual annotation, identifying 12 distinct error categories, including 'incorrect variable reference', 'missing return value description', and 'overly generic summary'.
- The authors released a comprehensive set of annotated examples and training resources on GitHub and Zenodo, enabling replication and extension of the study.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.