Lune

ASE2020Top-tier venue

Code to Comment "Translation": Data, Metrics, Baselining & Evaluation

David Gros, Hariharan Sezhiyan, Prem Devanbu, Zhou Yu

Abstract

The relationship of comments to code, and in particular, the task of generating useful comments given the code, has long been of interest. The earliest approaches have been based on strong syntactic theories of comment-structures, and relied on textual templates. More recently, researchers have applied deep-learning methods to this task---specifically, trainable generative translation models which are known to work very well for Natural Language translation (e.g., from German to English). We carefully examine the underlying assumption here: that the task of generating comments sufficiently resembles the task of translating between natural languages, and so similar models and evaluation metrics could be used. We analyze several recent code-comment datasets for this task: CodeNN, DeepCom, FunCom, and DocString. We compare them with WMT19, a standard dataset frequently used to train state-of-the-art natural language translators. We found some interesting differences between the code-comment data and the WMT19 natural language data. Next, we describe and conduct some studies to calibrate BLEU (which is commonly used as a measure of comment quality). using "affinity pairs" of methods, from different projects, in the same project, in the same class, etc; Our study suggests that the current performance on some datasets might need to be improved substantially. We also argue that fairly naive information retrieval (IR) methods do well enough at this task to be considered a reasonable baseline. Finally, we make some suggestions on how our findings might be used in future research in this area.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

18 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization) cites On the Evaluation of Neural Code Summarization
  • Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization) cites Retrieval-based neural source code summarization
  • Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization) cites Reassessing automatic evaluation metrics for code summarization tasks
  • Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization) cites Recommending Root-Cause and Mitigation Steps for Cloud Incidents using Large Language Models
  • On the Evaluation of Neural Code Summarization cites Retrieval-based neural source code summarization
  • On the Evaluation of Neural Code Summarization cites Reassessing automatic evaluation metrics for code summarization tasks
  • Reassessing automatic evaluation metrics for code summarization tasks cites Retrieval-based neural source code summarization
  • Recommending Root-Cause and Mitigation Steps for Cloud Incidents using Large Language Models cites NatGen: generative pre-training by "naturalizing" source code
  • Recommending Root-Cause and Mitigation Steps for Cloud Incidents using Large Language Models cites On the Evaluation of Neural Code Summarization
  • Recommending Root-Cause and Mitigation Steps for Cloud Incidents using Large Language Models cites Reassessing automatic evaluation metrics for code summarization tasks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers18

  1. Reassessing automatic evaluation metrics for code summarization tasksDevjeet Roy, Sarah Fakhoury, Venera ArnaoudovaFSE 2021 · 103 citations
  2. NatGen: generative pre-training by "naturalizing" source codeSaikat Chakraborty, Toufique Ahmed, Yangruibo Ding, Premkumar T. Devanbu et al.FSE 2022 · 101 citations
  3. Recommending Root-Cause and Mitigation Steps for Cloud Incidents using Large Language ModelsToufique Ahmed, Supriyo Ghosh, Chetan Bansal, Thomas Zimmermann et al.ICSE 2023 · 93 citations
  4. On the Evaluation of Neural Code SummarizationEnsheng Shi, Yanlin Wang, Lun Du, Junjie Chen et al.ICSE 2022 · 76 citations
  5. Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)Toufique Ahmed, Kunal Suresh Pai, Premkumar T. Devanbu, Earl T. BarrICSE 2024 · 71 citations

Builds on2

  1. Retrieval-based neural source code summarizationJian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun et al.ICSE 2020 · 242 citations
  2. Big code != big vocabulary: open-vocabulary models for source codeRafael-Michael Karampatsis, Hlib Babii, Romain Robbes, Charles Sutton et al.ICSE 2020 · 140 citations

Related papers

  1. On-the-Fly Adapting Code Summarization on Trainable Cost-Effective Language ModelsYufan Cai, Yun Lin, Chenyan Liu, Jinglian Wu et al.NeurIPS 2023 · 12 citations
  2. Retrieve and Refine: Exemplar-based Neural Comment GenerationBolin Wei, Yongmin Li, Ge Li, Xin Xia et al.ASE 2020 · 68 citations
  3. Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related TasksAntonio Mastropaolo, Simone Scalabrino, Nathan Cooper, David Nader-Palacio et al.ICSE 2021 · 9 citations
  4. PyMT5: multi-mode translation of natural language and Python code with transformersColin B. Clement, Dawn Drain, Jonathan Timcheck, Alexey Svyatkovskiy et al.EMNLP 2020 · 24 citations
  5. Learning to Update Natural Language Comments Based on Code ChangesSheena Panthaplackel, Pengyu Nie, Milos Gligoric, Junyi Jessy Li et al.ACL 2020 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines