arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2406.17255cs.CL
收藏

MPCODER:基于显式与隐式风格表示学习的多用户个性化代码生成器

MPCODER: Multi-user Personalized Code Generator with Explicit and Implicit Style Representation Learning

Zhejiang University(浙江大学);Zhejiang Police College(浙江警察学院)

Zhenlong Dai, Chang Yao, WenKang Han, Ying Yuan, Zhipeng Gao, Jingyuan Chen

AI总结:

本文提出MPCoder,通过显式残差学习与隐式对比学习训练多用户风格适配器,实现多用户个性化代码生成,并提出了新的风格相似度评估指标。

摘要:

大型语言模型(LLMs)在辅助开发者日常开发方面展现出巨大潜力。然而,大多数研究侧重于生成正确的代码,鲜有研究探讨如何利用LLMs生成个性化代码。为弥补这一空白,我们提出了MPCoder(多用户个性化代码生成器),为多个用户生成个性化代码。为更好地学习编码风格特征,我们利用显式编码风格残差学习来捕获语法代码风格标准,并利用隐式风格学习来捕获语义代码风格约定。我们通过对比学习训练了一个多用户风格适配器,以更好地区分不同用户的隐式特征表示,最终实现多用户的个性化代码生成。我们进一步提出了一种新的评估指标,用于估计不同编码风格代码之间的相似度。实验结果表明了我们的方法在这一新任务上的有效性。

英文摘要:

Large Language Models (LLMs) have demonstrated great potential for assisting developers in their daily development. However, most research focuses on generating correct code, how to use LLMs to generate personalized code has seldom been investigated. To bridge this gap, we proposed MPCoder (Multi-user Personalized Code Generator) to generate personalized code for multiple users. To better learn coding style features, we utilize explicit coding style residual learning to capture the syntax code style standards and implicit style learning to capture the semantic code style conventions. We train a multi-user style adapter to better differentiate the implicit feature representations of different users through contrastive learning, ultimately enabling personalized code generation for multiple users. We further propose a novel evaluation metric for estimating similarities between codes of different coding styles. The experimental results show the effectiveness of our approach for this novel task.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑