We gratefully acknowledge support from
the Simons Foundation and member institutions.
Full-text links:

Download:

Current browse context:

cs.LG

Change to browse by:

References & Citations

DBLP - CS Bibliography

Bookmark

(what is this?)
CiteULike logo BibSonomy logo Mendeley logo del.icio.us logo Digg logo Reddit logo

Computer Science > Machine Learning

Title: Retrieval-Augmented Generation for Code Summarization via Hybrid GNN

Abstract: Source code summarization aims to generate natural language summaries from structured code snippets for better understanding code functionalities. However, automatic code summarization is challenging due to the complexity of the source code and the language gap between the source code and natural language summaries. Most previous approaches either rely on retrieval-based (which can take advantage of similar examples seen from the retrieval database, but have low generalization performance) or generation-based methods (which have better generalization performance, but cannot take advantage of similar examples). This paper proposes a novel retrieval-augmented mechanism to combine the benefits of both worlds. Furthermore, to mitigate the limitation of Graph Neural Networks (GNNs) on capturing global graph structure information of source code, we propose a novel attention-based dynamic graph to complement the static graph representation of the source code, and design a hybrid message passing GNN for capturing both the local and global structural information. To evaluate the proposed approach, we release a new challenging benchmark, crawled from diversified large-scale open-source C projects (total 95k+ unique functions in the dataset). Our method achieves the state-of-the-art performance, improving existing methods by 1.42, 2.44 and 1.29 in terms of BLEU-4, ROUGE-L and METEOR.
Subjects: Machine Learning (cs.LG); Artificial Intelligence (cs.AI)
Cite as: arXiv:2006.05405 [cs.LG]
  (or arXiv:2006.05405v5 [cs.LG] for this version)

Submission history

From: Shangqing Liu [view email]
[v1] Tue, 9 Jun 2020 17:09:29 GMT (424kb,D)
[v2] Sun, 4 Oct 2020 08:06:49 GMT (121kb,D)
[v3] Mon, 23 Nov 2020 11:38:37 GMT (520kb,D)
[v4] Thu, 26 Nov 2020 05:33:27 GMT (519kb,D)
[v5] Thu, 13 May 2021 03:41:22 GMT (571kb,D)

Link back to: arXiv, form interface, contact.