CodeFuse-13B: A Pretrained Multi-lingual Code Large Language Model

📄 arXiv: 2310.06266v2 📥 PDF

作者: Peng Di, Jianguo Li, Hang Yu, Wei Jiang, Wenting Cai, Yang Cao, Chaoyu Chen, Dajun Chen, Hongwei Chen, Liang Chen, Gang Fan, Jie Gong, Zi Gong, Wen Hu, Tingting Guo, Zhichao Lei, Ting Li, Zheng Li, Ming Liang, Cong Liao, Bingchang Liu, Jiachen Liu, Zhiwei Liu, Shaojun Lu, Min Shen, Guangpei Wang, Huan Wang, Zhi Wang, Zhaogui Xu, Jiawei Yang, Qing Ye, Gehao Zhang, Yu Zhang, Zelin Zhao, Xunjin Zheng, Hailian Zhou, Lifu Zhu, Xianying Zhu

分类: cs.SE, cs.AI, cs.LG

发布日期: 2023-10-10 (更新: 2024-01-10)

备注: Accepted by ICSE-SEIP 2024

DOI: 10.1145/3639477.3639719


💡 一句话要点

提出CodeFuse-13B以解决多语言代码理解问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 代码生成 多语言支持 预训练模型 软件工程 人工智能

📋 核心要点

  1. 现有的代码大型语言模型在处理非英语输入时效果不佳,尤其是在多语言代码相关任务中存在明显不足。
  2. CodeFuse-13B是一个开源的预训练代码LLM,专为支持英语和中文提示而设计,能够处理超过40种编程语言的任务。
  3. 在真实场景和标准基准测试中,CodeFuse-13B的表现优于其他同类模型,尤其在中文提示下的代码生成和翻译任务中。

📝 摘要(中文)

代码大型语言模型(Code LLMs)因其在软件工程全生命周期中的广泛应用而受到业界关注。然而,现有模型在理解非英语输入的多语言代码相关任务方面的有效性仍然不足。本文介绍了CodeFuse-13B,一个开源的预训练代码LLM,专为支持英语和中文提示的代码相关任务而设计,支持超过40种编程语言。CodeFuse通过利用高质量的预训练数据集,并在训练过程中进行优化,显著提升了其有效性。通过在真实使用场景、行业标准基准HumanEval-x和专为中文提示设计的CodeFuseEval上进行广泛实验,结果显示CodeFuse-13B在HumanEval的pass@1得分为37.10%,在实际场景中表现优于其他模型。

🔬 方法详解

问题定义:本文旨在解决现有多语言代码大型语言模型在理解和处理非英语输入时的不足,尤其是在代码生成和翻译等任务中。现有方法在多语言支持和实际应用效果上存在明显的局限性。

核心思路:CodeFuse-13B通过构建一个高质量的预训练数据集,并在训练过程中进行优化,旨在提升模型对多语言代码的理解和生成能力。该模型特别设计以支持英语和中文提示,增强了其在多语言环境下的适用性。

技术框架:整体架构包括数据预处理、模型训练和评估三个主要阶段。数据预处理阶段通过程序分析器过滤高质量数据,训练阶段采用优化算法提升模型性能,评估阶段则使用HumanEval-x和CodeFuseEval进行效果验证。

关键创新:最重要的技术创新在于构建了一个专门针对多语言代码任务的预训练数据集,并通过优化训练过程显著提升了模型在中文提示下的表现。这一设计与现有模型的通用性训练方法形成鲜明对比。

关键设计:在模型设计中,采用了特定的损失函数和网络结构,以适应多语言输入的特点。此外,参数设置经过精细调整,以确保模型在处理不同编程语言时的灵活性和准确性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

在实验中,CodeFuse-13B在HumanEval基准测试中取得了37.10%的pass@1得分,显示出其在多语言代码理解和生成任务中的优越性。与其他同类模型相比,CodeFuse在处理中文提示时表现更为出色,显著提升了实际应用效果。

🎯 应用场景

CodeFuse-13B的潜在应用领域包括代码生成、代码翻译、代码注释和测试用例生成等。其在多语言环境下的优越性能使其在国际化软件开发中具有重要价值,能够帮助开发者更高效地处理多种编程语言的任务,提升软件工程的整体效率。

📄 摘要(原文)

Code Large Language Models (Code LLMs) have gained significant attention in the industry due to their wide applications in the full lifecycle of software engineering. However, the effectiveness of existing models in understanding non-English inputs for multi-lingual code-related tasks is still far from well studied. This paper introduces CodeFuse-13B, an open-sourced pre-trained code LLM. It is specifically designed for code-related tasks with both English and Chinese prompts and supports over 40 programming languages. CodeFuse achieves its effectiveness by utilizing a high quality pre-training dataset that is carefully filtered by program analyzers and optimized during the training process. Extensive experiments are conducted using real-world usage scenarios, the industry-standard benchmark HumanEval-x, and the specially designed CodeFuseEval for Chinese prompts. To assess the effectiveness of CodeFuse, we actively collected valuable human feedback from the AntGroup's software development process where CodeFuse has been successfully deployed. The results demonstrate that CodeFuse-13B achieves a HumanEval pass@1 score of 37.10%, positioning it as one of the top multi-lingual code LLMs with similar parameter sizes. In practical scenarios, such as code generation, code translation, code comments, and testcase generation, CodeFuse performs better than other models when confronted with Chinese prompts.