StarCoder 2 and The Stack v2: The Next Generation

📄 arXiv: 2402.19173v1 📥 PDF

作者: Anton Lozhkov, Raymond Li, Loubna Ben Allal, Federico Cassano, Joel Lamy-Poirier, Nouamane Tazi, Ao Tang, Dmytro Pykhtar, Jiawei Liu, Yuxiang Wei, Tianyang Liu, Max Tian, Denis Kocetkov, Arthur Zucker, Younes Belkada, Zijian Wang, Qian Liu, Dmitry Abulkhanov, Indraneil Paul, Zhuang Li, Wen-Ding Li, Megan Risdal, Jia Li, Jian Zhu, Terry Yue Zhuo, Evgenii Zheltonozhskii, Nii Osae Osae Dade, Wenhao Yu, Lucas Krauß, Naman Jain, Yixuan Su, Xuanli He, Manan Dey, Edoardo Abati, Yekun Chai, Niklas Muennighoff, Xiangru Tang, Muhtasham Oblokulov, Christopher Akiki, Marc Marone, Chenghao Mou, Mayank Mishra, Alex Gu, Binyuan Hui, Tri Dao, Armel Zebaze, Olivier Dehaene, Nicolas Patry, Canwen Xu, Julian McAuley, Han Hu, Torsten Scholak, Sebastien Paquet, Jennifer Robinson, Carolyn Jane Anderson, Nicolas Chapados, Mostofa Patwary, Nima Tajbakhsh, Yacine Jernite, Carlos Muñoz Ferrandis, Lingming Zhang, Sean Hughes, Thomas Wolf, Arjun Guha, Leandro von Werra, Harm de Vries

分类: cs.SE, cs.AI

发布日期: 2024-02-29


💡 一句话要点

提出StarCoder2以推动代码生成模型的责任发展

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

关键词: 大型语言模型 代码生成 数据集构建 模型训练 性能评估

📋 核心要点

  1. 现有的代码生成模型在处理低资源语言和复杂推理任务时表现不佳,限制了其应用范围。
  2. 论文提出了StarCoder2,通过整合更大规模的训练数据集和优化模型架构,提升了代码生成的准确性和效率。
  3. 实验结果表明,StarCoder2-3B在大多数基准测试中超越同类模型,而StarCoder2-15B在数学和代码推理方面表现优异。

📝 摘要(中文)

BigCode项目专注于负责任地开发大型代码语言模型(Code LLMs),推出了StarCoder2。该项目与软件遗产(Software Heritage)合作,基于其源代码档案构建了The Stack v2,数据集规模是首个StarCoder数据集的四倍。StarCoder2模型在3.3到4.3万亿个标记上进行训练,涵盖3B、7B和15B参数的模型。实验结果显示,StarCoder2-3B在大多数基准测试中超越了同类模型,而StarCoder2-15B则显著优于同规模的其他模型,并在数学和代码推理基准上表现优异。模型权重以OpenRAIL许可证发布,确保训练数据的透明性。

🔬 方法详解

问题定义:本论文旨在解决现有代码生成模型在低资源语言和复杂推理任务中的性能不足,现有方法在这些领域的应用受到限制。

核心思路:论文通过构建一个更大规模的训练数据集The Stack v2,并优化StarCoder模型架构,来提升模型在多种编程语言和任务上的表现。

技术框架:整体架构包括数据收集、模型训练和评估三个主要阶段。数据收集阶段整合了来自Software Heritage的源代码和其他高质量数据源,模型训练阶段使用3B、7B和15B参数的模型进行训练,评估阶段则通过多项基准测试验证模型性能。

关键创新:最重要的技术创新在于数据集的规模和多样性,The Stack v2是首个包含619种编程语言的训练集,且数据量是之前版本的四倍,显著提升了模型的泛化能力。

关键设计:在模型设计上,StarCoder2采用了更深的网络结构和优化的损失函数,以提高训练效率和生成代码的质量。同时,模型权重的开放和训练数据的透明性也是其设计的重要考虑。

🖼️ 关键图片

fig_0
img_1

📊 实验亮点

实验结果显示,StarCoder2-3B在大多数基准测试中超越了同类模型,而StarCoder2-15B在数学和代码推理基准上表现优异,甚至在某些任务中超越了CodeLlama-34B,展现出显著的性能提升。

🎯 应用场景

StarCoder2的研究成果具有广泛的应用潜力,尤其是在软件开发、自动化代码生成和教育领域。其高效的代码生成能力能够帮助开发者提高生产力,同时也为低资源语言的支持提供了新的可能性。未来,该模型可能在开源社区和商业软件开发中发挥重要作用。

📄 摘要(原文)

The BigCode project, an open-scientific collaboration focused on the responsible development of Large Language Models for Code (Code LLMs), introduces StarCoder2. In partnership with Software Heritage (SWH), we build The Stack v2 on top of the digital commons of their source code archive. Alongside the SWH repositories spanning 619 programming languages, we carefully select other high-quality data sources, such as GitHub pull requests, Kaggle notebooks, and code documentation. This results in a training set that is 4x larger than the first StarCoder dataset. We train StarCoder2 models with 3B, 7B, and 15B parameters on 3.3 to 4.3 trillion tokens and thoroughly evaluate them on a comprehensive set of Code LLM benchmarks. We find that our small model, StarCoder2-3B, outperforms other Code LLMs of similar size on most benchmarks, and also outperforms StarCoderBase-15B. Our large model, StarCoder2- 15B, significantly outperforms other models of comparable size. In addition, it matches or outperforms CodeLlama-34B, a model more than twice its size. Although DeepSeekCoder- 33B is the best-performing model at code completion for high-resource languages, we find that StarCoder2-15B outperforms it on math and code reasoning benchmarks, as well as several low-resource languages. We make the model weights available under an OpenRAIL license and ensure full transparency regarding the training data by releasing the SoftWare Heritage persistent IDentifiers (SWHIDs) of the source code data.