详细信息
Towards Retrieval-Based Neural Code Summarization: A Meta-Learning Approach ( SCI-EXPANDED收录 EI收录)
文献类型:期刊文献
英文题名:Towards Retrieval-Based Neural Code Summarization: A Meta-Learning Approach
作者:Zhou, Ziyi[1];Yu, Huiqun[2,3,4,5,6];Fan, Guisheng[7,8,9,10];Huang, Zijie[11];Yang, Kang[12]
机构:[1]East China Univ Sci & Technol, Comp Sci, Shanghai, Peoples R China;[2]Nanjing Univ, Comp Sci, Nanjing, Peoples R China;[3]East China Univ Sci & Technol ECUST, Comp Sci, Shanghai, Peoples R China;[4]Shanghai Jiao Tong Univ, Comp Sci, Shanghai, Peoples R China;[5]ECUST, Dept Comp Sci & Engn, Comp Sci, Shanghai, Peoples R China;[6]Florida Int Univ, Sch Comp Sci, Miami, FL 33199 USA;[7]Anhui Univ Technol, Comp Sci, Maanshan, Anhui, Peoples R China;[8]East China Univ Sci & Technol ECUST, Comp Sci, Shanghai, Peoples R China;[9]East China Univ Sci & Technol, Comp Sci, Shanghai, Peoples R China;[10]East China Univ Sci & Technol, Dept Comp Sci & Engn, Shanghai, Peoples R China;[11]Shanghai Normal Univ, Comp Sci, Shanghai, Peoples R China;[12]East China Univ Sci & Technol, Comp Sci, Shanghai, Peoples R China
年份:2023
卷号:49
期号:4
起止页码:3008
外文期刊名:IEEE TRANSACTIONS ON SOFTWARE ENGINEERING
收录:;EI(收录号:20230613545959);WOS:【SCI-EXPANDED(收录号:WOS:000978723600090)】;
基金:This work was supported by the National Natural Science Foundation of China under Grant 61772200, and in part by the Shanghai Natural Science Foundation under Grant 21ZR1416300. Recommended for acceptance by Z. Jin.
语种:英文
外文关键词:Code summarization; deep learning; information retrieval; meta-learning
摘要:Code summarization aims to generate code summaries automatically, and has attracted a lot of research interest lately. Recent approaches to it commonly adopt neural machine translation techniques, which train a Seq2Seq model on a large corpus and assume it could work on various new code snippets. However, codes are highly varied in practice due to different domains, businesses or programming styles. Therefore, it is challenging to learn such a variety of patterns into a single model. In this paper, we propose a brand-new framework for code summarization based on meta-learning and code retrieval, named MLCS to tackle this issue. In this framework, the summarization of each target code is formalized as a few-shot learning task, where its similar examples are used as training data and the testing example is itself. We retrieve examples similar to the target code in a rank-and-filter manner. Given a neural code summarizer, we optimize it into a meta-learner via Model-Agnostic Meta-Learning (MAML). During inference, the meta-learner first adapts to the retrieved examples and yields an exclusive model for the target code, and then generates its summary. Extensive experiments on real-world datasets show: (1) Utilizing MLCS, a standard Seq2Seq model is able to outperform previous state-of-the-art approaches, including both neural models and retrieval-based neural models; (2) MLCS can flexibly adapt to existing neural code summarizers without modifying their architecture, and could significantly improve their performance with the relative gain of up to 112.7% on BLEU-4, 23.2% on ROUGE-L, and 31.5% on METEOR; (3) Compared to the existing retrieval-based neural approaches, MLCS can better leverage multiple similar examples, and shows better generalization ability on different retrievers, unseen retrieval corpus and low-frequency words.
参考文献:
正在载入数据...
