Exploring continual learning in code intelligence with domain-wise distilled prompts

Shuo Liu, Jacky Keung, Zhen Yang*, Fang Liu, Fengji Zhang, Yicheng Sun

*Corresponding author for this work

Research output: Journal Publications and ReviewsRGC 21 - Publication in refereed journalpeer-review

Abstract

Context: Software programs evolve constantly in practice, leading to domain shifts that cannot be fitted in the traditional offline manner. Recently, a few Continual Learning (CL) studies on code intelligence emerged, which learn a sequence of datasets one by one. We criticize existing rehearsal-based CL methods heavily rely on retraining historical samples, bringing about an extra training burden and the risk of data disclosure. Objective: To overcome the above limitations, in this paper, we leverage the superiority of prompts in eliciting pre-trained knowledge to realize a rehearsal-free method. Methods: We first explore the performance of vanilla prompt tuning in the CL scenario, finding that inheriting the previous Pre-trained Language Model (PLM) parameters is appropriate and prompt stability should be emphasized. Therefore, we propose an effective method named Prompt Tuning with Domain-wise Distillation (PTDD), which can distill prompts and optimize PLMs with a two-sided learning objective, thus improving PLMs’ performance in diverse domains. Results: We conduct experiments on three widely-studied code intelligence tasks, including Code Summarization, Code Vulnerability Detection, and Code Clone Detection. We evaluate PTDD in comparison with a series of baselines. Experimental results indicate the effectiveness of PTDD. For instance, PTDD surpasses fine-tuning by 2.55%, 11.12%, and 2.25% in the three tasks, respectively. Moreover, we interpret the effectiveness of PTDD by prompt visualization, and discuss its performance in the low-resource scenario, where the improvement of PTDD becomes stark with fewer training samples and can reach up to 69.09%. Conclusion: To the best of our knowledge, our work conducts the first experimental study to explore the performance of prompt tuning within the CL setting in the code intelligence field. The research findings indicate the effectiveness of PTDD and contribute to a deeper understanding of the capability of prompts. © 2025 Elsevier B.V.
Original languageEnglish
Article number107775
JournalInformation and Software Technology
Volume185
Online published15 May 2025
DOIs
Publication statusOnline published - 15 May 2025

Funding

This work is supported in part by the General Research Fund of the Research Grants Council of Hong Kong and the research funds of the City University of Hong Kong, Hong Kong (Grant No. 6000796 , 9229109 , 9229098 , 9220103 , 9229029 ), also by the Natural Science Foundation of Shandong Province, China (Grant No. ZR2024QF093 ) and National Natural Science Foundation of China (Grant No. 62302021 ).

Research Keywords

  • Code intelligence
  • Continual learning
  • Pre-trained language models
  • Prompt tuning

Fingerprint

Dive into the research topics of 'Exploring continual learning in code intelligence with domain-wise distilled prompts'. Together they form a unique fingerprint.

Cite this