mlsanityData to 7 Oct 2026

Learning to Generate Code Comments from Class Hierarchies

arXiv 2103.13426 ↗First posted 24 Mar 2021cs.CL cs.LG cs.SEcited by 5

Not on the map. Why?

Abstract (arXiv)

Descriptive code comments are essential for supporting code comprehension and maintenance. We propose the task of automatically generating comments for overriding methods. We formulate a novel framework which accommodates the unique contextual and linguistic reasoning that is required for performing this task. Our approach features: (1) incorporating context from the class hierarchy; (2) conditioning on learned, latent representations of specificity to generate comments that capture the more specialized behavior of the overriding method; and (3) unlikelihood training to discourage predictions which do not conform to invariant characteristics of the comment corresponding to the overridden method. Our experiments show that the proposed approach is able to generate comments for overriding methods of higher quality compared to prevailing comment generation techniques.

Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 20 of its 41 references that are in the map. First posted on arXiv 24 Mar 2021.

Builds on

20 of 41 references.

References · 20

  1. 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
  2. 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
  3. 2015A Diversity-Promoting Objective Function for Neural Conversation Modelscited by 1,068
  4. 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,024
  5. 2015Pointer Networkscited by 882
  6. 2019Neural Text Generation with Unlikelihood Trainingcited by 489
  7. 2015Building End-To-End Dialogue Systems Using Generative Hierarchical Neural Network Modelscited by 207
  8. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  9. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  10. 2019Don't Say That! Making Inconsistent Dialogue Unlikely with Unlikelihood Trainingcited by 110
  11. 2015A Neural Network Approach to Context-Sensitive Generation of Conversational Responsescited by 98
  12. 2016A Convolutional Attention Network for Extreme Summarization of Source Codecited by 90
8 more
  1. 2020PyMT5: multi-mode translation of natural language and Python code with transformerscited by 80
  2. 2020Improved Code Summarization via a Graph Neural Networkcited by 79
  3. 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
  4. 2018Structured Neural Summarizationcited by 53
  5. 2020Improved Automatic Summarization of Subroutines via Attention to File Contextcited by 34
  6. 2020Learning to Update Natural Language Comments Based on Code Changescited by 30
  7. 2018Automatic Generation of Text Descriptive Comments for Code Blockscited by 18
  8. 2020TAG : Type Auxiliary Guiding for Code Comment Generationcited by 8

Built on by

Cited by year

Citing papers per year: 2022: 2; 2023: 1; 2024: 1; 2025: 1.

5 papers.