A Transformer-based Approach for Source Code Summarization
Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, Kai-Wei, Chang

TL;DR
This paper presents a Transformer-based method for source code summarization that effectively captures long-range dependencies, outperforming previous techniques and emphasizing the importance of relative positional encoding.
Contribution
The study demonstrates that a simple Transformer model with relative positional encoding significantly improves source code summarization performance over existing methods.
Findings
Relative positional encoding enhances summarization accuracy.
Transformer model outperforms state-of-the-art techniques.
Code is publicly available for future research.
Abstract
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Topic Modeling · Natural Language Processing Techniques
MethodsLinear Layer · Absolute Position Encodings · Position-Wise Feed-Forward Layer · Residual Connection · Byte Pair Encoding · Dense Connections · Label Smoothing · *Communicated@Fast*How Do I Communicate to Expedia? · Adam · Softmax
