GypSum: Learning Hybrid Representations for Code Summarization

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

31 Scopus citations

Abstract

Code summarization with deep learning has been widely studied in recent years. Current deep learning models for code summarization generally follow the principle in neural machine translation and adopt the encoder-decoder framework, where the encoder learns the semantic representations from source code and the decoder transforms the learnt representations into human-readable text that describes the functionality of code snippets. Despite they achieve the new state-of-the-art performance, we notice that current models often either generate less fluent summaries, or fail to capture the core functionality, since they usually focus on a single type of code representations. As such we propose GypSum, a new deep learning model that learns hybrid representations using graph attention neural networks and a pre-trained programming and natural language model. We introduce particular edges related to the control flow of a code snippet into the abstract syntax tree for graph construction, and design two encoders to learn from the graph and the token sequence of source code, respectively. We modify the encoder-decoder sublayer in the Transformer's decoder to fuse the representations and propose a dual-copy mechanism to facilitate summary generation. Experimental results demonstrate the superior performance of GypSum over existing code summarization models.

Original languageEnglish
Title of host publicationProceedings - 30th IEEE/ACM International Conference on Program Comprehension, ICPC 2022
PublisherIEEE Computer Society
Pages12-23
Number of pages12
ISBN (Electronic)9781450392983
DOIs
StatePublished - 20 Oct 2022
Event30th IEEE/ACM International Conference on Program Comprehension, ICPC 2022 - Virtual, Online, United States
Duration: 16 May 202217 May 2022

Publication series

NameIEEE International Conference on Program Comprehension
Volume2022-March
ISSN (Print)2643-7147
ISSN (Electronic)2643-7171

Conference

Conference30th IEEE/ACM International Conference on Program Comprehension, ICPC 2022
Country/TerritoryUnited States
CityVirtual, Online
Period16/05/2217/05/22

Keywords

  • code summarization
  • copy mechanisms
  • deep neural networks
  • graph attention neural networks

Fingerprint

Dive into the research topics of 'GypSum: Learning Hybrid Representations for Code Summarization'. Together they form a unique fingerprint.

Cite this