返回
Code Structure-Guided Transformer for Source Code Summarization
DOI:10.1145/3522674.png)
摘要
En 中文
Code summaries help developers comprehend programs and reduce their time to infer the program functionalities during software maintenance. Recent efforts resort to deep learning techniques such as sequenceto-sequence models for generating accurate code summaries, among which Transformer-based approaches have achieved promising performance. However, effectively integrating the code structure information into the Transformer is under-explored in this task domain. In this article, we propose a novel approach named SG-Trans to incorporate code structural properties into Transformer. Specifically, we inject the local symbolic information (e.g., code tokens and statements) and global syntactic structure (e.g., dataflow graph) into the self-attention module of Transformer as inductive bias. To further capture the hierarchical characteristics of code, the local information and global structure are designed to distribute in the attention heads of lower layers and high layers of Transformer. Extensive evaluation shows the superior performance of SG-Trans over the state-of-the-art approaches. Compared with the best-performing baseline, SG-Trans still improves 1.4% and 2.0% on two benchmark datasets, respectively, in terms of METEOR score, a metric widely used for measuring generation quality.
Keyword:
Code summary
Transformer
multi-head attention
code structure
期刊
A
IF:
6.2
论文数:
1.2K
被引数:
3.4K
机构
引用论文
An empirical analysis of the impact of software development problem factors on software maintainability软件开发问题因素对软件可维护性影响的实证分析
CRaDLe: Deep code retrieval based on semantic Dependency LearningCRaDLe: 基于语义依赖学习的深度代码检索
NEURAL NETWORKS
IF6.3
没有更多内容

