arXiv:2411.04156cs.SEcs.AI2024-11被引 10

Crystal模型通过优化训练策略,让大模型同时精通代码与自然语言生成。

Crystal: Illuminating LLM Abilities on Language and Code

  • 分两阶段调整代码与文本比例,提升语言与编程能力融合。
  • 仅用1.4万亿token达到媲美Llama 2和Code Llama的性能。
  • 适合关注高效多模态训练的大模型研究者或开发者。

专注于代码生成的大语言模型(代码LLM)如StarCoder和Code Llama,在软件开发中日益重要。为实现代码与自然语言双重能力,需解决二者学习过程中的复杂交互问题。现有研究缺乏对混合代码与自然语言预训练策略的系统探索。本文提出一种双阶段预训练策略,通过调整代码/语言比例,使单一模型同时具备强语言与编程能力。所获模型Crystal在自然语言与代码任务上分别达到Llama 2与Code Llama水平,且仅使用1.4万亿令牌,低于Llama 2和Code Llama超过2万亿令牌的用量。分析表明该策略在多数基准上持续提升性能。此外,仅以代码为中心的数据微调未带来效率或性能增益,凸显数据配方设计的重要性。为推动社区研究,我们开源全部预训练细节,包括数据集、代码、日志及136个检查点。

原文摘要 · Abstract (English)

Large Language Models (LLMs) specializing in code generation (which are also often referred to as code LLMs), e.g., StarCoder and Code Llama, play increasingly critical roles in various software development scenarios. It is also crucial for code LLMs to possess both code generation and natural language abilities for many specific applications, such as code snippet retrieval using natural language or code explanations. The intricate interaction between acquiring language and coding skills complicates the development of strong code LLMs. Furthermore, there is a lack of thorough prior studies on the LLM pretraining strategy that mixes code and natural language. In this work, we propose a pretraining strategy to enhance the integration of natural language and coding capabilities within a single LLM. Specifically, it includes two phases of training with appropriately adjusted code/language ratios. The resulting model, Crystal, demonstrates remarkable capabilities in both domains. Specifically, it has natural language and coding performance comparable to that of Llama 2 and Code Llama, respectively. Crystal exhibits better data efficiency, using 1.4 trillion tokens compared to the more than 2 trillion tokens used by Llama 2 and Code Llama. We verify our pretraining strategy by analyzing the training process and observe consistent improvements in most benchmarks. We also adopted a typical application adaptation phase with a code-centric data mixture, only to find that it did not lead to enhanced performance or training efficiency, underlining the importance of a carefully designed data recipe. To foster research within the community, we commit to open-sourcing every detail of the pretraining, including our training datasets, code, loggings and 136 checkpoints throughout the training.

大模型代码生成预训练多模态

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