A Transformer-based Approach for Source Code Summarization
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.
Code (9)
Tasks
Code SummarizationPositionSource Code SummarizationMethods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
Retrieval-based Layer-wise Adaptive Transformer for Source Code Summarization
We propose a model that learns both the sequential and the structural features of code for source code summarization. We adopt the Abstract Syntax Tree (AST) and graph convolution to model the structural information and …
Code SummarizationRetrievalSource Code SummarizationAST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarization
Code summarization aims to generate brief natural language descriptions for source code. As source code is highly structured and follows strict programming language grammars, its Abstract Syntax Tree (AST) is often lever…
Code SummarizationEfficient Extractive Summarization with MAMBA-Transformer Hybrids for Low-Resource Scenarios
Extractive summarization of long documents is bottlenecked by quadratic complexity, often forcing truncation and limiting deployment in resource-constrained settings. We introduce the first Mamba-Transformer hybrid for e…
ViT5: Pretrained Text-to-Text Transformer for Vietnamese Language Generation
We present ViT5, a pretrained Transformer-based encoder-decoder model for the Vietnamese language. With T5-style self-supervised pretraining, ViT5 is trained on a large corpus of high-quality and diverse Vietnamese texts…
Abstractive Text SummarizationDecodernamed-entity-recognitionNamed Entity Recognition+4GN-Transformer: Fusing Sequence and Graph Representation for Improved Code Summarization
As opposed to natural languages, source code understanding is influenced by grammatical relationships between tokens regardless of their identifier name. Graph representations of source code such as Abstract Syntax Tree …
Code Summarization