TransCoder:受人类技能启发的统一可迁移代码表示学习
TransCoder: Towards Unified Transferable Code Representation Learning Inspired by Human Skills
AI总结:
针对 CodePTM 逐任务微调成本高、依赖数据的问题,提出 TransCoder,利用可调前缀元学习器获取跨任务与跨语言知识,提升多任务及低资源代码表示性能。
摘要:
代码预训练模型(CodePTM)近来在处理代码克隆检测、代码翻译和代码摘要等多种软件智能任务方面展现出可靠能力。当前将这些模型部署到下游任务的主流方法是在单个任务上进行微调,这通常成本高昂,并且对于大型模型需要充足数据。为解决该问题,本文提出 TransCoder,这是一种用于代码表示学习的统一可迁移微调策略。受人类固有的知识泛化技能启发,TransCoder 促使模型像人类程序员一样学习更好的代码相关元知识。具体而言,我们采用可调前缀编码器作为元学习器,以分别捕获跨任务和跨语言的可迁移知识。此外,训练样本规模较小的任务以及语料库较小的语言都能从本文方法中显著受益。在基准数据集上开展的大量实验清楚表明,本文方法能够在多种代码相关任务上取得优越性能,并促进相互增强。我们还表明 TransCoder 适用于低资源场景。代码可在 https://github.com/QiushiSun/TransCoder 获取。
英文摘要:
Code pre-trained models (CodePTMs) have recently demonstrated a solid capacity to process various software intelligence tasks, e.g., code clone detection, code translation, and code summarization. The current mainstream method that deploys these models to downstream tasks is to fine-tune them on individual tasks, which is generally costly and needs sufficient data for large models. To tackle the issue, in this paper, we present TransCoder, a unified Transferable fine-tuning strategy for Code representation learning. Inspired by human inherent skills of knowledge generalization, TransCoder drives the model to learn better code-related meta-knowledge like human programmers. Specifically, we employ a tunable prefix encoder as the meta-learner to capture cross-task and cross-language transferable knowledge, respectively. Besides, tasks with minor training sample sizes and languages with small corpus can be remarkably benefited from our approach. Extensive experiments conducted on benchmark datasets clearly demonstrate that our method can lead to superior performance on various code-related tasks and encourage mutual reinforcement. We also show that TransCoder is applicable in low-resource scenarios. Our codes are available at https://github.com/QiushiSun/TransCoder.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。