Abstract
Instruction tuning is a supervised fine-tuning approach that significantly improves the ability of large language models (LLMs) to follow human instructions. We propose SelfCodeAlign, the first fully transparent and permissive pipeline for self-aligning code LLMs without extensive human annotations or distillation. SelfCodeAlign employs the same base model for inference throughout the data generation process. It first extracts diverse coding concepts from high-quality seed snippets to generate new tasks. It then samples multiple responses per task, pairs each with test cases, and validates them in a sandbox environment. Finally, passing examples are selected for instruction tuning. In our primary experiments, we use SelfCodeAlign with CodeQwen1.5-7B to generate a dataset of 74k instruction-response pairs. Finetuning on this dataset leads to a model that achieves a 67.1 pass@1 on HumanEval+, surpassing CodeLlama-70B-Instruct despite being ten times smaller. Across all benchmarks, this finetuned model consistently outperforms the original version trained with OctoPack, the previous state-of-the-art method for instruction tuning without human annotations or distillation. Additionally, we show that SelfCodeAlign is effective across LLMs of various sizes, from 3B to 33B, and that the base models can benefit more from alignment with their own data distribution. We further validate each component's effectiveness in our pipeline, showing that SelfCodeAlign outperforms both direct distillation from GPT-4o and leading GPT-3.5-based distillation methods, such as OSS-Instruct and Evol-Instruct. SelfCodeAlign has also led to the creation of StarCoder2-Instruct, the first fully transparent, permissively licensed, and self-aligned code LLM that achieves state-of-the-art coding performance.
Abstract (translated)
指令调优是一种监督微调方法,可以显著提升大型语言模型(LLMs)遵循人类指令的能力。我们提出了一种名为SelfCodeAlign的全透明且无限制的管道方案,用于在无需大量人工标注或蒸馏的情况下自我对齐代码LLMs。SelfCodeAlign在整个数据生成过程中使用同一基础模型进行推理。它首先从高质量的种子片段中提取多样化的编码概念以生成新任务。然后为每个任务采样多个响应,并将每个响应与测试用例配对,在沙盒环境中验证它们的有效性。最后,选择通过验证的例子用于指令调优。在我们的主要实验中,我们使用SelfCodeAlign和CodeQwen1.5-7B生成了一个包含74k个指令-响应对的数据集。基于该数据集进行微调后的模型在HumanEval+上的pass@1达到67.1%,超越了比其大十倍的CodeLlama-70B-Instruct。在整个基准测试中,与之前无需人工标注或蒸馏的最佳方法OctoPack训练的原始版本相比,这个微调后的模型始终表现更好。此外,我们展示了SelfCodeAlign在各种规模LLMs(从3B到33B)中的有效性,并且基础模型可以从与其数据分布的对齐中获得更多好处。我们进一步验证了管道各组件的有效性,结果表明SelfCodeAlign的表现优于直接从GPT-4o进行蒸馏以及基于GPT-3.5的领先蒸馏方法(如OSS-Instruct和Evol-Instruct)。通过SelfCodeAlign,还诞生了StarCoder2-Instruct——首个全透明、许可开放且自我对齐的代码LLM,在编码性能上达到了业界最佳水平。
URL
https://arxiv.org/abs/2410.24198