Learning to Generate Code Comments from Class Hierarchies
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
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
- 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
- 2015A Diversity-Promoting Objective Function for Neural Conversation Modelscited by 1,068
- 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,024
- 2015Pointer Networkscited by 882
- 2019Neural Text Generation with Unlikelihood Trainingcited by 489
- 2015Building End-To-End Dialogue Systems Using Generative Hierarchical Neural Network Modelscited by 207
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2020A Transformer-based Approach for Source Code Summarizationcited by 129
- 2019Don't Say That! Making Inconsistent Dialogue Unlikely with Unlikelihood Trainingcited by 110
- 2015A Neural Network Approach to Context-Sensitive Generation of Conversational Responsescited by 98
- 2016A Convolutional Attention Network for Extreme Summarization of Source Codecited by 90
8 more
- 2020PyMT5: multi-mode translation of natural language and Python code with transformerscited by 80
- 2020Improved Code Summarization via a Graph Neural Networkcited by 79
- 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
- 2018Structured Neural Summarizationcited by 53
- 2020Improved Automatic Summarization of Subroutines via Attention to File Contextcited by 34
- 2020Learning to Update Natural Language Comments Based on Code Changescited by 30
- 2018Automatic Generation of Text Descriptive Comments for Code Blockscited by 18
- 2020TAG : Type Auxiliary Guiding for Code Comment Generationcited by 8
Built on by
Citing papers per year: 2022: 2; 2023: 1; 2024: 1; 2025: 1.
5 papers.
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedbackcited by 45
- 2023RepoFusion: Training Code Models to Understand Your Repositorycited by 40
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2024Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedback25 Mar 2024
- 2023RepoFusion: Training Code Models to Understand Your Repository19 Jun 2023
- 2022Repository-Level Prompt Generation for Large Language Models of Code26 Jun 2022
- 2022An Extractive-and-Abstractive Framework for Source Code Summarization15 Jun 2022