As pre-trained models automate many code intelligence tasks, a widely used paradigm is to fine-tune a model on the task dataset for each programming language. A recent study reported that multilingual fine-tuning benefits a range of tasks and models. However, we find that multilingual fine-tuning leads to performance degradation on recent models UniXcoder and CodeT5. To alleviate the potentially catastrophic forgetting issue in multilingual models, we fix all pre-trained model parameters, insert the parameter-efficient structure adapter, and fine-tune it. Updating only 0.6\% of the overall parameters compared to full-model fine-tuning for each programming language, adapter tuning yields consistent improvements on code search and summarization tasks, achieving state-of-the-art results. In addition, we experimentally show its effectiveness in cross-lingual and low-resource scenarios. Multilingual fine-tuning with 200 samples per programming language approaches the results fine-tuned with the entire dataset on code summarization. Our experiments on three probing tasks show that adapter tuning significantly outperforms full-model fine-tuning and effectively overcomes catastrophic forgetting.
翻译:随着预先训练的模型自动完成许多代码智能任务,一种广泛使用的范式是对每种编程语言的任务数据集微调模型。最近的一项研究报告称,多语言微调有助于一系列任务和模型。但是,我们发现多语言微调会导致最新的UniXcoder和CodeT5模型性能下降。为了缓解多语言模型中可能发生的灾难性遗忘问题,我们固定了所有预训练模型参数,插入参数有效的结构适配器,然后微调它。与针对每种编程语言的全模型微调相比,适配器调优仅更新全局参数的0.6%,在代码搜索和摘要任务上产生了一致的改进效果,并取得了最先进的结果。此外,我们通过实验证明了它在跨语言和低资源情况下的有效性。针对每种编程语言的多语言微调,每种只使用200个样本,在代码摘要方面接近使用整个数据集微调的结果。我们在三个探测任务上的实验表明,适配器调优显着优于全模型微调,并有效地克服了灾难性遗忘。