A Transformer-based Approach for Source Code Summarization

05/01/2020
by   Wasi Uddin Ahmad, et al.
6

Generating a readable summary that describes the functionality of a program is known as source code summarization. In this task, learning code representation by modeling the pairwise relationship between code tokens to capture their long-range dependencies is crucial. To learn code representation for summarization, we explore the Transformer model that uses a self-attention mechanism and has shown to be effective in capturing long-range dependencies. In this work, we show that despite the approach is simple, it outperforms the state-of-the-art techniques by a significant margin. We perform extensive analysis and ablation studies that reveal several important findings, e.g., the absolute encoding of source code tokens' position hinders, while relative encoding significantly improves the summarization performance. We have made our code publicly available to facilitate future research.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/14/2022

Source Code Summarization with Structural Relative Position Guided Transformer

Source code summarization aims at generating concise and clear natural l...
research
05/18/2023

Tram: A Token-level Retrieval-augmented Mechanism for Source Code Summarization

Automatically generating human-readable text describing the functionalit...
research
02/09/2016

A Convolutional Attention Network for Extreme Summarization of Source Code

Attention mechanisms in neural networks have proved useful for problems ...
research
11/17/2021

GN-Transformer: Fusing Sequence and Graph Representation for Improved Code Summarization

As opposed to natural languages, source code understanding is influenced...
research
12/01/2021

Graph Conditioned Sparse-Attention for Improved Source Code Understanding

Transformer architectures have been successfully used in learning source...
research
04/19/2021

Code Structure Guided Transformer for Source Code Summarization

Source code summarization aims at generating concise descriptions of giv...
research
12/29/2020

SIT3: Code Summarization with Structure-Induced Transformer

Code summarization (CS) is becoming a promising area in recent natural l...

Please sign up or login with your details

Forgot password? Click here to reset