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

AICoderEval:提升大语言模型在AI领域代码生成能力

AICoderEval: Improving AI Domain Code Generation of Large Language Models

Fudan University(复旦大学);University of Toronto(多伦多大学);East China Normal University(华东师范大学)

Yinghui Xia, Yuyan Chen, Tianyu Shi, Jun Wang, Jinsong Yang

AI总结:

本文构建了面向真实AI任务的代码生成基准AICoderEval,并提出智能体框架CoderGen及微调模型AICoder,显著提升了LLMs在任务特定代码生成上的表现。

摘要:

自动化代码生成是大语言模型(LLMs)的一项关键能力。然而,在真实场景中评估这一能力仍然具有挑战性。以往的方法更多关注低层次的代码生成,例如模型加载,而不是生成面向真实任务的高层次代码,例如各领域中的图像转文本、文本分类等。因此,我们构建了AICoderEval,这是一个基于HuggingFace、PyTorch和TensorFlow、聚焦于多个领域真实任务的数据集,并配套了用于评估和增强LLMs任务特定代码生成能力的综合指标。AICoderEval包含用于对这些任务进行自动化评估的测试用例和完整程序,覆盖自然语言处理、计算机视觉和多模态学习等领域。为促进该领域的研究,我们在\url{https://huggingface.co/datasets/vixuowis/AICoderEval}开源了AICoderEval数据集。随后,我们提出了CoderGen,一个基于智能体的框架,用于帮助LLMs在所构建的AICoderEval上生成与真实任务相关的代码。此外,我们训练了一个更强大的任务特定代码生成模型,名为AICoder,该模型基于AICoderEval在llama-3上进行微调。我们的实验证明了CoderGen在提升LLMs任务特定代码生成能力方面的有效性(原始模型pass@1提升12.00%,ReAct Agent的pass@1提升9.50%)。AICoder也优于当前的代码生成LLMs,表明AICoderEval基准具有很高的质量。

英文摘要:

Automated code generation is a pivotal capability of large language models (LLMs). However, assessing this capability in real-world scenarios remains challenging. Previous methods focus more on low-level code generation, such as model loading, instead of generating high-level codes catering for real-world tasks, such as image-to-text, text classification, in various domains. Therefore, we construct AICoderEval, a dataset focused on real-world tasks in various domains based on HuggingFace, PyTorch, and TensorFlow, along with comprehensive metrics for evaluation and enhancing LLMs' task-specific code generation capability. AICoderEval contains test cases and complete programs for automated evaluation of these tasks, covering domains such as natural language processing, computer vision, and multimodal learning. To facilitate research in this area, we open-source the AICoderEval dataset at \url{https://huggingface.co/datasets/vixuowis/AICoderEval}. After that, we propose CoderGen, an agent-based framework, to help LLMs generate codes related to real-world tasks on the constructed AICoderEval. Moreover, we train a more powerful task-specific code generation model, named AICoder, which is refined on llama-3 based on AICoderEval. Our experiments demonstrate the effectiveness of CoderGen in improving LLMs' task-specific code generation capability (by 12.00\% on pass@1 for original model and 9.50\% on pass@1 for ReAct Agent). AICoder also outperforms current code generation LLMs, indicating the great quality of the AICoderEval benchmark.

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

↑