Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Ye, Tong, Wu, Lingfei, Ma, Tengfei, Zhang, Xuhong, Du, Yangkai, Liu, Peiyu, Ji, Shouling, Wang, Wenhai
Format: Preprint
Veröffentlicht: 2023
Schlagworte:
Online-Zugang:https://arxiv.org/abs/2305.11074
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866929296763781120
author Ye, Tong
Wu, Lingfei
Ma, Tengfei
Zhang, Xuhong
Du, Yangkai
Liu, Peiyu
Ji, Shouling
Wang, Wenhai
author_facet Ye, Tong
Wu, Lingfei
Ma, Tengfei
Zhang, Xuhong
Du, Yangkai
Liu, Peiyu
Ji, Shouling
Wang, Wenhai
contents Automatically generating human-readable text describing the functionality of a program is the intent of source code summarization. Although neural language models achieve significant performance in this field, they are limited by their inability to access external knowledge. To address this limitation, an emerging trend is combining neural models with external knowledge through retrieval methods. Previous methods have relied on the sentence-level retrieval paradigm on the encoder side. However, this paradigm is coarse-grained, noise-filled and cannot directly take advantage of the high-quality retrieved summary tokens on the decoder side. In this paper, we propose a fine-grained Token-level retrieval-augmented mechanism (Tram) on the decoder side rather than the encoder side to enhance the performance of neural models and produce more low-frequency tokens in generating summaries. Furthermore, to overcome the challenge of token-level retrieval in capturing contextual code semantics, we also propose integrating code semantics into individual summary tokens. The results of extensive experiments and human evaluation show that our token-level retrieval-augmented approach significantly improves performance and is more interpretable.
format Preprint
id arxiv_https___arxiv_org_abs_2305_11074
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Tram: A Token-level Retrieval-augmented Mechanism for Source Code Summarization
Ye, Tong
Wu, Lingfei
Ma, Tengfei
Zhang, Xuhong
Du, Yangkai
Liu, Peiyu
Ji, Shouling
Wang, Wenhai
Artificial Intelligence
Automatically generating human-readable text describing the functionality of a program is the intent of source code summarization. Although neural language models achieve significant performance in this field, they are limited by their inability to access external knowledge. To address this limitation, an emerging trend is combining neural models with external knowledge through retrieval methods. Previous methods have relied on the sentence-level retrieval paradigm on the encoder side. However, this paradigm is coarse-grained, noise-filled and cannot directly take advantage of the high-quality retrieved summary tokens on the decoder side. In this paper, we propose a fine-grained Token-level retrieval-augmented mechanism (Tram) on the decoder side rather than the encoder side to enhance the performance of neural models and produce more low-frequency tokens in generating summaries. Furthermore, to overcome the challenge of token-level retrieval in capturing contextual code semantics, we also propose integrating code semantics into individual summary tokens. The results of extensive experiments and human evaluation show that our token-level retrieval-augmented approach significantly improves performance and is more interpretable.
title Tram: A Token-level Retrieval-augmented Mechanism for Source Code Summarization
topic Artificial Intelligence
url https://arxiv.org/abs/2305.11074