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

探索语言模型借助辅助函数的代码生成能力

Exploring Language Model's Code Generation Ability with Auxiliary Functions

POSTECH(浦项科技大学);Yonsei University(延世大学)

Seonghyeon Lee, Sanghwan Jang, Seongbo Jang, Dongha Lee, Hwanjo Yu

AI总结:

本研究通过构建HumanExtension评估集,系统探究了代码预训练语言模型利用辅助函数的能力,发现其具备自我改进潜力但调用不足,并公开了代码与数据集。

摘要:

辅助函数是提升语言模型代码生成能力的有用组件。然而,关于它们如何影响代码生成的系统性探索尚未开展。在这项工作中,我们全面评估了近期代码预训练语言模型利用编码在其中的辅助函数的能力。首先,我们构建了一个人工制作的评估集,称为HumanExtension,其中包含两个函数的示例,其中一个函数辅助另一个函数。借助HumanExtension,我们设计了多项实验,以多方面的视角检验它们的能力。我们的评估过程能够全面理解在提示中包含辅助函数在有效性和鲁棒性方面的作用。额外的实现风格分析捕捉了模型在访问辅助函数时的各种实现模式。通过这一分析,我们发现了模型利用辅助函数的良好能力,包括通过逐步实现两个函数而展现的自我改进行为。然而,我们的分析也揭示了模型调用辅助函数的行为利用不足,这提示了未来通过激发模型中编码的辅助函数调用能力来增强其实现的方向。我们发布了我们的代码和数据集,以促进这一研究方向。

英文摘要:

Auxiliary function is a helpful component to improve language model's code generation ability. However, a systematic exploration of how they affect has yet to be done. In this work, we comprehensively evaluate the ability to utilize auxiliary functions encoded in recent code-pretrained language models. First, we construct a human-crafted evaluation set, called HumanExtension, which contains examples of two functions where one function assists the other. With HumanExtension, we design several experiments to examine their ability in a multifaceted way. Our evaluation processes enable a comprehensive understanding of including auxiliary functions in the prompt in terms of effectiveness and robustness. An additional implementation style analysis captures the models' various implementation patterns when they access the auxiliary function. Through this analysis, we discover the models' promising ability to utilize auxiliary functions including their self-improving behavior by implementing the two functions step-by-step. However, our analysis also reveals the model's underutilized behavior to call the auxiliary function, suggesting the future direction to enhance their implementation by eliciting the auxiliary function call ability encoded in the models. We release our code and dataset to facilitate this research direction.

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

↑