mlsanityData to 7 Oct 2026

MESIA: Understanding and Leveraging Supplementary Nature of Method-level Comments for Automatic Comment Generation

arXiv 2403.17357 ↗First posted 26 Mar 2024cs.SE cs.AIcited by 2

Not on the map. Why?

Abstract (arXiv)

Code comments are important for developers in program comprehension. In scenarios of comprehending and reusing a method, developers expect code comments to provide supplementary information beyond the method signature. However, the extent of such supplementary information varies a lot in different code comments. In this paper, we raise the awareness of the supplementary nature of method-level comments and propose a new metric named MESIA (Mean Supplementary Information Amount) to assess the extent of supplementary information that a code comment can provide. With the MESIA metric, we conduct experiments on a popular code-comment dataset and three common types of neural approaches to generate method-level comments. Our experimental results demonstrate the value of our proposed work with a number of findings. (1) Small-MESIA comments occupy around 20% of the dataset and mostly fall into only the WHAT comment category. (2) Being able to provide various kinds of essential information, large-MESIA comments in the dataset are difficult for existing neural approaches to generate. (3) We can improve the capability of existing neural approaches to generate large-MESIA comments by reducing the proportion of small-MESIA comments in the training set. (4) The retrained model can generate large-MESIA comments that convey essential meaningful supplementary information for methods in the small-MESIA test set, but will get a lower BLEU score in evaluation. These findings indicate that with good training data, auto-generated comments can sometimes even surpass human-written reference comments, and having no appropriate ground truth for evaluation is an issue that needs to be addressed by future work on automatic comment generation.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 22 of its 59 references that are in the map. First posted on arXiv 26 Mar 2024.

Builds on

22 of 59 references.

References · 22

  1. 2017Attention Is All You Needcited by 59,932
  2. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  3. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  4. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  5. 2022Few-shot training LLMs for project-specific code-summarizationcited by 128
  6. 2023Human-like Summarization Evaluation with ChatGPTcited by 126
  7. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  8. 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
  9. 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 71
  10. 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
  11. 2021On the Evaluation of Neural Code Summarizationcited by 47
  12. 2022Automatic Code Documentation Generation Using GPT-3cited by 37
10 more
  1. 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
  2. 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
  3. 2020Code to Comment "Translation": Data, Metrics, Baselining & Evaluationcited by 28
  4. 2022Are We Building on the Rock? On the Importance of Data Preprocessing for Code Summarizationcited by 22
  5. 2023EditSum: A Retrieve-and-Edit Framework for Source Code Summarizationcited by 18
  6. 2023Developer-Intent Driven Code Comment Generationcited by 16
  7. 2019A Survey of Automatic Generation of Source Code Comments: Algorithms and Techniquescited by 15
  8. 2021AST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarizationcited by 11
  9. 2022A Decade of Code Comment Quality Assessment: A Systematic Literature Reviewcited by 5
  10. 2021Speculative Analysis for Quality Assessment of Code Commentscited by 2

Built on by

Cited by year

Citing papers per year: 2025: 2.

2 papers.