Improving Automatic Source Code Summarization via Deep Reinforcement Learning

Code summarization provides a high level natural language description of the function performed by code, as it can benefit the software maintenance, code categorization and retrieval. To the best of our knowledge, most state-of-the-art approaches follow an encoder-decoder framework which encodes the...

Full description

Saved in:
Bibliographic Details
Published in:2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE) pp. 397 - 407
Main Authors: Wan, Yao, Zhao, Zhou, Yang, Min, Xu, Guandong, Ying, Haochao, Wu, Jian, Yu, Philip S.
Format: Conference Proceeding
Language:English
Published: ACM 01.09.2018
Subjects:
ISSN:2643-1572
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Abstract Code summarization provides a high level natural language description of the function performed by code, as it can benefit the software maintenance, code categorization and retrieval. To the best of our knowledge, most state-of-the-art approaches follow an encoder-decoder framework which encodes the code into a hidden space and then decode it into natural language space, suffering from two major drawbacks: a) Their encoders only consider the sequential content of code, ignoring the tree structure which is also critical for the task of code summarization; b) Their decoders are typically trained to predict the next word by maximizing the likelihood of next ground-truth word with previous ground-truth word given. However, it is expected to generate the entire sequence from scratch at test time. This discrepancy can cause an exposure bias issue, making the learnt decoder suboptimal. In this paper, we incorporate an abstract syntax tree structure as well as sequential content of code snippets into a deep reinforcement learning framework (i.e., actor-critic network). The actor network provides the confidence of predicting the next word according to current state. On the other hand, the critic network evaluates the reward value of all possible extensions of the current state and can provide global guidance for explorations. We employ an advantage reward composed of BLEU metric to train both networks. Comprehensive experiments on a real-world dataset show the effectiveness of our proposed model when compared with some state-of-the-art methods.
AbstractList Code summarization provides a high level natural language description of the function performed by code, as it can benefit the software maintenance, code categorization and retrieval. To the best of our knowledge, most state-of-the-art approaches follow an encoder-decoder framework which encodes the code into a hidden space and then decode it into natural language space, suffering from two major drawbacks: a) Their encoders only consider the sequential content of code, ignoring the tree structure which is also critical for the task of code summarization; b) Their decoders are typically trained to predict the next word by maximizing the likelihood of next ground-truth word with previous ground-truth word given. However, it is expected to generate the entire sequence from scratch at test time. This discrepancy can cause an exposure bias issue, making the learnt decoder suboptimal. In this paper, we incorporate an abstract syntax tree structure as well as sequential content of code snippets into a deep reinforcement learning framework (i.e., actor-critic network). The actor network provides the confidence of predicting the next word according to current state. On the other hand, the critic network evaluates the reward value of all possible extensions of the current state and can provide global guidance for explorations. We employ an advantage reward composed of BLEU metric to train both networks. Comprehensive experiments on a real-world dataset show the effectiveness of our proposed model when compared with some state-of-the-art methods.
Author Zhao, Zhou
Xu, Guandong
Wu, Jian
Yang, Min
Yu, Philip S.
Ying, Haochao
Wan, Yao
Author_xml – sequence: 1
  givenname: Yao
  surname: Wan
  fullname: Wan, Yao
  organization: College of Computer Science and Technology, Zhejiang University,Hangzhou,China
– sequence: 2
  givenname: Zhou
  surname: Zhao
  fullname: Zhao, Zhou
  organization: College of Computer Science and Technology, Zhejiang University,Hangzhou,China
– sequence: 3
  givenname: Min
  surname: Yang
  fullname: Yang, Min
  organization: Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences,China
– sequence: 4
  givenname: Guandong
  surname: Xu
  fullname: Xu, Guandong
  organization: Advanced Analytics Institute, University of Technology Sydney,Sydney,Australia
– sequence: 5
  givenname: Haochao
  surname: Ying
  fullname: Ying, Haochao
  organization: College of Computer Science and Technology, Zhejiang University,Hangzhou,China
– sequence: 6
  givenname: Jian
  surname: Wu
  fullname: Wu, Jian
  organization: College of Computer Science and Technology, Zhejiang University,Hangzhou,China
– sequence: 7
  givenname: Philip S.
  surname: Yu
  fullname: Yu, Philip S.
  organization: USA Institute for Data Science, Tsinghua University,Beijing,China
BookMark eNotjk9LxDAUxKMouLvu2YOXfIGuL3lN0x6X-m-hIrgK3pa0eZWITUrbXdBPbxady8DM8GPm7MwHT4xdCVgJkaoblJiLVK-OLiE7YfOYAqoC9fspm8ksxUQoLS_Ychw_AUDmGpRUM_a06fohHJz_4Ov9FDozuYZvw35oiJfBEt_uu84M7icWwfODM_yWqOcv5Hwb4qojP_GKzOAj45Kdt-ZrpOW_L9jb_d1r-ZhUzw-bcl0lRmo1JToFRBTQWrLKYKFyU2etQCFySJURlIGkOh62FjQVpMDoHJpMSy1rhRYX7PqP64ho1w8uXvzeFXAU4i-G506o
ContentType Conference Proceeding
DBID 6IE
6IL
CBEJK
RIE
RIL
DOI 10.1145/3238147.3238206
DatabaseName IEEE Electronic Library (IEL) Conference Proceedings
IEEE Proceedings Order Plan All Online (POP All Online) 1998-present by volume
IEEE Xplore All Conference Proceedings
IEEE Xplore: IEL
IEEE Proceedings Order Plans (POP All) 1998-Present
DatabaseTitleList
Database_xml – sequence: 1
  dbid: RIE
  name: IEEE Electronic Library (IEL)
  url: https://ieeexplore.ieee.org/
  sourceTypes: Publisher
DeliveryMethod fulltext_linktorsrc
Discipline Computer Science
EISBN 145035937X
9781450359375
EISSN 2643-1572
EndPage 407
ExternalDocumentID 9000003
Genre orig-research
GroupedDBID 29I
6IE
6IF
6IH
6IK
6IL
6IM
6IN
6J9
AAJGR
AAWTH
ABLEC
ACREN
ADYOE
ADZIZ
AFYQB
ALMA_UNASSIGNED_HOLDINGS
AMTXH
APO
BEFXN
BFFAM
BGNUA
BKEBE
BPEOZ
CBEJK
CHZPO
IEGSK
IPLJI
M43
OCL
RIE
RIL
ID FETCH-LOGICAL-a275t-74033310fded5a3958ab6f13118045a1e602eb157dd07e9e50a780c67272b53d3
IEDL.DBID RIE
ISICitedReferencesCount 287
ISICitedReferencesURI http://www.webofscience.com/api/gateway?GWVersion=2&SrcApp=Summon&SrcAuth=ProQuest&DestLinkType=CitingArticles&DestApp=WOS_CPL&KeyUT=000553784500039&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D
IngestDate Wed Aug 13 06:22:41 EDT 2025
IsDoiOpenAccess false
IsOpenAccess true
IsPeerReviewed false
IsScholarly true
Language English
LinkModel DirectLink
MergedId FETCHMERGED-LOGICAL-a275t-74033310fded5a3958ab6f13118045a1e602eb157dd07e9e50a780c67272b53d3
PageCount 11
ParticipantIDs ieee_primary_9000003
PublicationCentury 2000
PublicationDate 2018-Sept.
PublicationDateYYYYMMDD 2018-09-01
PublicationDate_xml – month: 09
  year: 2018
  text: 2018-Sept.
PublicationDecade 2010
PublicationTitle 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE)
PublicationTitleAbbrev ASE
PublicationYear 2018
Publisher ACM
Publisher_xml – name: ACM
SSID ssj0002870525
ssj0051577
Score 2.58619
Snippet Code summarization provides a high level natural language description of the function performed by code, as it can benefit the software maintenance, code...
SourceID ieee
SourceType Publisher
StartPage 397
SubjectTerms Code summarization
Codes
comment generation
Decoding
deep learning
Deep reinforcement learning
Long short term memory
Measurement
Natural languages
reinforcement learning
Software maintenance
Source coding
Syntactics
Vectors
Title Improving Automatic Source Code Summarization via Deep Reinforcement Learning
URI https://ieeexplore.ieee.org/document/9000003
WOSCitedRecordID wos000553784500039&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV09T8MwED21FQNTgRbxLQ-MpHXiOHZGVKhYqCoKUrfKji-oS1OVpL8f2wkpAwuTI0_RRee7vPN7D-BeMaNzHdlE0mEexMxEgaKxClKOziaJJiquzSbEbCaXy3TegYeWC4OI_vIZjtyjn-WbIqscVDZOfUvLutAVIqm5Wi2e4gZ2_KCzZ8u0EI2UTxjzMXOlKRYjt0bO3uiXl4ovJdP-_17iBIYHTh6Zt9XmFDq4OYP-jykDaXJ0AK8tTEAeq7Lwiqxk4SF6MikMkoWnqzX0S7JfK_KEuCVv6DVUMw8XkkZ29XMIH9Pn98lL0HgmBCoSvAxETBmzLVtu0HDFUi6VTnKnqSNt86ZCTGhkj2cujKECU-RUCUkzP4_VnBl2Dr1NscELIDrnmbQJL0NkMU-l1DzNWGJ_yFTGuUwuYeCis9rWshirJjBXf29fw7HtNWR9PesGeuWuwls4yvbl-mt357_lN-4bnXU
linkProvider IEEE
linkToHtml http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3PT8IwFH5BNNETKhp_24NHB2Vt1-5oUIIRCBFMuJFufTNcGMHB3-_azeHBi6cuPS1veX1v3-v3fQAPmpkoifw8kaJO4nFmfE9Trr1QoLVJooHmhdmEHI3UbBaOa_BYcWEQ0V0-w5Z9dLN8k8YbC5W1Q9fSsj3YF5z7tGBrVYiKHdmJndJeXqilLMV8Oly0mS1OXLbs6luDo19uKq6Y9Br_e41jONux8si4qjcnUMPlKTR-bBlImaVNGFZAAXnaZKnTZCUTB9KTbmqQTBxhrSRgku1Ck2fEFXlHp6IaO8CQlMKrn2fw0XuZdvte6ZrgaV-KzJOcMpY3bYlBIzQLhdJRkFhVHZW3b7qDAfXzA1pIY6jEEAXVUtHYTWQjwQw7h_oyXeIFkCgRscpTXnWQcREqFYkwZkH-S6ZjIVRwCU0bnfmqEMaYl4G5-nv7Hg770-FgPngdvV3DUd55qOKy1g3Us_UGb-Eg3maLr_Wd-67fUNSgvA
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=proceeding&rft.title=2018+33rd+IEEE%2FACM+International+Conference+on+Automated+Software+Engineering+%28ASE%29&rft.atitle=Improving+Automatic+Source+Code+Summarization+via+Deep+Reinforcement+Learning&rft.au=Wan%2C+Yao&rft.au=Zhao%2C+Zhou&rft.au=Yang%2C+Min&rft.au=Xu%2C+Guandong&rft.date=2018-09-01&rft.pub=ACM&rft.eissn=2643-1572&rft.spage=397&rft.epage=407&rft_id=info:doi/10.1145%2F3238147.3238206&rft.externalDocID=9000003