arrow
Return

Esale: Enhancing Code-Summary Alignment Learning for Source Code Summarization

delete2024-08-01
delete2
PRE
AI
房
房春荣 (Chunrong Fang)
W
Weisong Sun *
Y
Yuchen Chen
陈
陈骁 (Xiao Chen)
Z
Zhao Wei
Q
Quanjun Zhang
Y
Yudu You
B
Bin Luo
刘
刘洋 (Yang Liu)
陈
陈振宇 (Zhenyu Chen)
DOI:10.1109/TSE.2024.3422274delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
(Source) code summarization aims to automatically generate succinct natural language summaries for given code snippets. Such summaries play a significant role in promoting developers to understand and maintain code. Inspired by neural machine translation, deep learning-based code summarization techniques widely adopt an encoder-decoder framework, where the encoder transforms given code snippets into context vectors, and the decoder decodes context vectors into summaries. Recently, large-scale pre-trained models for source code (e.g., CodeBERT and UniXcoder) are equipped with encoders capable of producing general context vectors and have achieved substantial improvements on the code summarization task. However, although they are usually trained mainly on code-focused tasks and can capture general code features, they still fall short in capturing specific features that need to be summarized. In a nutshell, they fail to learn the alignment between code snippets and summaries (code-summary alignment for short). In this paper, we propose a novel approach to improve code summarization based on summary-focused tasks. Specifically, we exploit a multi-task learning paradigm to train the encoder on three summary-focused tasks to enhance its ability to learn code-summary alignment, including unidirectional language modeling (ULM), masked language modeling (MLM), and action word prediction (AWP). Unlike pre-trained models that mainly predict masked tokens in code snippets, we design ULM and MLM to predict masked words in summaries. Intuitively, predicting words based on given code snippets would help learn the code-summary alignment. In addition, existing work shows that AWP affects the prediction of the entire summary. Therefore, we further introduce the domain-specific task AWP to enhance the ability of the encoder to learn the alignment between action words and code snippets. We evaluate the effectiveness of our approach, called Esale, by conducting extensive experiments on four datasets, including two widely used datasets JCSD and PCSD, a cross-project Java dataset CPJD, and a multilingual language dataset CodeSearchNet. Experimental results show that Esale significantly outperforms state-of-the-art baselines in all three widely used metrics, including BLEU, METEOR, and ROUGE-L. Moreover, the human evaluation proves that the summaries generated by Esale are more informative and closer to the ground-truth summaries.
Keywords:
Source code summarization
deep learning
multi-task learning
Source code summarization
deep learning
multi-task learning

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
2.9K
Citations:
1.1W

Organization

N
Nanyang Technological University
Scholars:
4.9W
Papers: 4.8W
Citations: 8.1W
T
Tencent
Scholars:
1.1K
Papers: 898
Citations: 5
N
nanjing university
Scholars:
7.8W
Papers: 5.6W
Citations: 87
researcher View more organizations
Cited Papers

Cited Papers

Clinical outcome of Taiwanese men with clinically localized prostate cancer post-radical prostatectomy: a comparison with other ethnic groups
err2009-11-03
err0
PREAI
errShu-pin Huang; Chao-Yuan Huang; Chia-Chu Liu; Chia-Cheng Yu; Yeong-Shiau Pu; Shih-Chieh Chueh; Hong-Jeng Yu; Tony T. Wu; Ching-Chia Li; Chun-Hsiung Huang; Wen-Jeng Wu
errShare
errSave
err
IF0
err
err0
errOAAI
err
errShare
errSave
errShare
errSave
Study on Oxygen Control of Large Diameter N-type Monocrystalline Silicon with Large Thermal Field
err2023-10-19
err0
PREAI
errYang Yang; Huimin Li; Zechen Hu; Jinwei Guo; Xiangyu Li; Peidong Liu; Xuegong Yu
errShare
errSave
Innovative pulmonary preservation of non-heart-beating donor grafts in experimental lung transplantation1
err2004-07-01
err0
errOAAI
errT WITTWER; U FRANKE; A FEHRENBACH; M OCHS; T SANDHAUS; N DREYER; J RICHTER; T WAHLERS
errShare
errSave
Ninety-six suspected transfusion related acute lung injury cases: Investigation findings and clinical outcome
err2013-09-04
err0
errOAAI
errNay Win; Edwin Massey; Geoff Lucas; Deborah Sage; Colin Brown; Ann Green; Marcela Contreras; Cristina Navarrete
errShare
errSave
Homeobox Gene Involvement in Normal Hematopoiesis and in the Pathogenesis of Childhood Leukemias
err2017-01-01
err0
PREAI
errMaria Adamaki; Maria Goulielmaki; Ioannis Christodoulou; Spiros Vlahopoulos; Vassilis Zoumpourlis
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
researcher View more