arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.19121cs.CL
收藏

面向代码大语言模型的代码比较微调

Code Comparison Tuning for Code Large Language Models

Yufan Jiang, Qiaozhi He, Xiaomin Zhuang, Zhihua Wu

AI总结:

提出代码比较微调(CCT)方法,通过在 token 和序列级别引入比较机制提升代码大语言模型处理细微代码错误和修复 Bug 的能力,在 HumanEvalFix 基准上 pass@1 得分超越指令微调最多 4 分。

摘要:

我们提出了代码比较微调(CCT),一种简单有效的代码大语言模型(Code LLMs)微调方法,以更好地处理细微代码错误。具体而言,我们将比较的概念整合到指令微调中,在 token 和序列级别上,使模型能够辨别代码中哪怕是最轻微的偏差。为了将原始代码与包含手动添加代码错误的错误版本进行比较,我们使用 token 级别偏好损失进行详细的 token 级别比较。此外,我们结合代码片段创建新的指令微调样本进行序列级别比较,从而增强模型的 Bug 修复能力。在 HumanEvalFix 基准上的实验结果表明,CCT 在多种代码大语言模型上的 pass@1 得分比指令微调高出最多 4 分,且广泛的分析证明了我们方法的有效性。

英文摘要:

We present Code Comparison Tuning (CCT), a simple and effective tuning method for code large language models (Code LLMs) to better handle subtle code errors. Specifically, we integrate the concept of comparison into instruction tuning, both at the token and sequence levels, enabling the model to discern even the slightest deviations in code. To compare the original code with an erroneous version containing manually added code errors, we use token-level preference loss for detailed token-level comparisons. Additionally, we combine code segments to create a new instruction tuning sample for sequence-level comparisons, enhancing the model's bug-fixing capability. Experimental results on the HumanEvalFix benchmark show that CCT surpasses instruction tuning in pass@1 scores by up to 4 points across diverse code LLMs, and extensive analysis demonstrates the effectiveness of our method.

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

↑