ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Fang, Chunrong, Sun, Weisong, Chen, Yuchen, Chen, Xiao, Wei, Zhao, Zhang, Quanjun, You, Yudu, Luo, Bin, Liu, Yang, Chen, Zhenyu
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866910509865893888
author Fang, Chunrong
Sun, Weisong
Chen, Yuchen
Chen, Xiao
Wei, Zhao
Zhang, Quanjun
You, Yudu
Luo, Bin
Liu, Yang
Chen, Zhenyu
author_facet Fang, Chunrong
Sun, Weisong
Chen, Yuchen
Chen, Xiao
Wei, Zhao
Zhang, Quanjun
You, Yudu
Luo, Bin
Liu, Yang
Chen, Zhenyu
contents (Source) code summarization aims to automatically generate succinct natural language summaries for given code snippets. Such summaries play a significant role in promoting developers to understand and maintain code. Inspired by neural machine translation, deep learning-based code summarization techniques widely adopt an encoder-decoder framework, where the encoder transforms given code snippets into context vectors, and the decoder decodes context vectors into summaries. Recently, large-scale pre-trained models for source code are equipped with encoders capable of producing general context vectors and have achieved substantial improvements on code summarization. However, although they are usually trained mainly on code-focused tasks and can capture general code features, they still fall short in capturing specific features that need to be summarized. This paper proposes a novel approach to improve code summarization based on summary-focused tasks. Specifically, we exploit a multi-task learning paradigm to train the encoder on three summary-focused tasks to enhance its ability to learn code-summary alignment, including unidirectional language modeling (ULM), masked language modeling (MLM), and action word prediction (AWP). Unlike pre-trained models that mainly predict masked tokens in code snippets, we design ULM and MLM to predict masked words in summaries. Intuitively, predicting words based on given code snippets would help learn the code-summary alignment. Additionally, we introduce the domain-specific task AWP to enhance the ability of the encoder to learn the alignment between action words and code snippets. The extensive experiments on four datasets demonstrate that our approach, called ESALE significantly outperforms baselines in all three widely used metrics, including BLEU, METEOR, and ROUGE-L.
format Preprint
id arxiv_https___arxiv_org_abs_2407_01646
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization
Fang, Chunrong
Sun, Weisong
Chen, Yuchen
Chen, Xiao
Wei, Zhao
Zhang, Quanjun
You, Yudu
Luo, Bin
Liu, Yang
Chen, Zhenyu
Software Engineering
Artificial Intelligence
68-04
D.2.3; I.2.7
(Source) code summarization aims to automatically generate succinct natural language summaries for given code snippets. Such summaries play a significant role in promoting developers to understand and maintain code. Inspired by neural machine translation, deep learning-based code summarization techniques widely adopt an encoder-decoder framework, where the encoder transforms given code snippets into context vectors, and the decoder decodes context vectors into summaries. Recently, large-scale pre-trained models for source code are equipped with encoders capable of producing general context vectors and have achieved substantial improvements on code summarization. However, although they are usually trained mainly on code-focused tasks and can capture general code features, they still fall short in capturing specific features that need to be summarized. This paper proposes a novel approach to improve code summarization based on summary-focused tasks. Specifically, we exploit a multi-task learning paradigm to train the encoder on three summary-focused tasks to enhance its ability to learn code-summary alignment, including unidirectional language modeling (ULM), masked language modeling (MLM), and action word prediction (AWP). Unlike pre-trained models that mainly predict masked tokens in code snippets, we design ULM and MLM to predict masked words in summaries. Intuitively, predicting words based on given code snippets would help learn the code-summary alignment. Additionally, we introduce the domain-specific task AWP to enhance the ability of the encoder to learn the alignment between action words and code snippets. The extensive experiments on four datasets demonstrate that our approach, called ESALE significantly outperforms baselines in all three widely used metrics, including BLEU, METEOR, and ROUGE-L.
title ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization
topic Software Engineering
Artificial Intelligence
68-04
D.2.3; I.2.7
url https://arxiv.org/abs/2407.01646