arXiv:2409.02326cs.CLcs.AI2024-09被引 6

用三阶段精炼数据训练出高效代码模型,关键在数据与下游任务分布对齐。

Arctic-SnowCoder: Demystifying High-Quality Data in Code Pretraining

  • 分三阶段逐步筛选高质量代码数据,融合过滤、标注和合成生成
  • 仅用5550亿词元训练,性能超越1万亿词元训练的同类模型
  • 适合追求高性价比代码预训练的开发者与研究者

近期研究表明,高质量数据对语言模型预训练至关重要,但其确切定义仍不明确。聚焦代码领域,我们提出 Arctic-SnowCoder-1.3B,一个基于 5550 亿词元分三阶段逐步优化的数据进行高效预训练的基础代码模型:(1) 使用 5000 亿标准质量代码词元进行通用预训练,经基础过滤、去重与去污染处理;(2) 基于第一阶段数据,利用训练好的 BERT 风格质量标注器筛选出 500 亿高质量代码词元,正样本来自高质量代码文件,并结合 Magicoder 与 StarCoder2-Instruct 的指令数据继续预训练;(3) 使用 Llama-3.1-70B 生成 50 亿合成数据作为种子,采用 Magicoder 方法增强预训练。尽管训练数据有限,Arctic-SnowCoder-1.3B 在 BigCodeBench(侧重实际编程挑战)上表现优于类似规模模型,相较 Phi-1.5-1.3B 提升 36%;在所有评估基准中均超过预训练于 1 万亿词元的 StarCoderBase-3B。其性能还媲美训练于数万亿词元的领先小型基础代码模型,例如在 HumanEval+ 上超越预训练于 3.3 万亿词元的 StarCoder2-3B,且在 BigCodeBench 上保持竞争力。评估分析全面支持设计选择,最重要发现是:高质量数据的核心在于其与下游应用分布的一致性。

原文摘要 · Abstract (English)

Recent studies have been increasingly demonstrating that high-quality data is crucial for effective pretraining of language models. However, the precise definition of "high-quality" remains underexplored. Focusing on the code domain, we introduce Arctic-SnowCoder-1.3B, a data-efficient base code model pretrained on 555B tokens through three phases of progressively refined data: (1) general pretraining with 500B standard-quality code tokens, preprocessed through basic filtering, deduplication, and decontamination, (2) continued pretraining with 50B high-quality tokens, selected from phase one by a BERT-style quality annotator trained to distinguish good code from random data, using positive examples drawn from high-quality code files, along with instruction data from Magicoder and StarCoder2-Instruct, and (3) enhanced pretraining with 5B synthetic data created by Llama-3.1-70B using phase two data as seeds, adapting the Magicoder approach for pretraining. Despite being trained on a limited dataset, Arctic-SnowCoder achieves state-of-the-art performance on BigCodeBench, a coding benchmark focusing on practical and challenging programming tasks, compared to similarly sized models trained on no more than 1T tokens, outperforming Phi-1.5-1.3B by 36%. Across all evaluated benchmarks, Arctic-SnowCoder-1.3B beats StarCoderBase-3B pretrained on 1T tokens. Additionally, it matches the performance of leading small base code models trained on trillions of tokens. For example, Arctic-SnowCoder-1.3B surpasses StarCoder2-3B, pretrained on over 3.3T tokens, on HumanEval+, a benchmark that evaluates function-level code generation, and remains competitive on BigCodeBench. Our evaluation presents a comprehensive analysis justifying various design choices for Arctic-SnowCoder. Most importantly, we find that the key to high-quality data is its alignment with the distribution of downstream applications.

代码生成数据质量模型效率

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。