arXiv:2509.07858cs.AI2025-09

用小模型迭代蒸馏生成高质量代码指令数据,降低大模型依赖成本

SCoder: Iterative Self-Distillation for Bootstrapping Small-Scale Data Synthesizers to Empower Code LLMs

  • 通过多检查点采样和多维度评分筛选初始数据
  • 用梯度影响估计筛选关键样本,提升合成数据质量
  • 7B小模型可替代大模型生成优质代码数据,适合资源有限者

现有代码大模型通常依赖从专有大模型中提炼的大规模指令数据进行微调,成本高昂。本文探索使用小型开源大模型(如7B)作为代码指令数据生成器的可行性。我们发现,仅用少量来自专有大模型的优质数据进行训练,即可显著提升小模型的数据生成能力。基于此,提出一种新的迭代自蒸馏方法,逐步将小模型转化为强大合成器,减少对专有模型的依赖并降低成本。具体而言,在每轮迭代中,采用多检查点采样与多维度评分策略选择初始数据;进一步引入基于梯度的影响估计方法,筛选最具影响力的样本用于最终数据过滤。基于这些小模型生成的代码指令数据集,我们构建了SCoder系列代码生成模型,均在DeepSeek-Coder基础上微调,性能达到当前最佳水平,验证了该方法的有效性。

原文摘要 · Abstract (English)

Existing code large language models (LLMs) often rely on large-scale instruction data distilled from proprietary LLMs for fine-tuning, which typically incurs high costs. In this paper, we explore the potential of small-scale open-source LLMs (e.g., 7B) as synthesizers for high-quality code instruction data construction. We first observe that the data synthesis capability of small-scale LLMs can be enhanced by training on a few superior data synthesis samples from proprietary LLMs. Building on this, we propose a novel iterative self-distillation approach to bootstrap small-scale LLMs, transforming them into powerful synthesizers that reduce reliance on proprietary LLMs and minimize costs. Concretely, in each iteration, to obtain diverse and high-quality self-distilled data, we design multi-checkpoint sampling and multi-aspect scoring strategies for initial data selection. Furthermore, to identify the most influential samples, we introduce a gradient-based influence estimation method for final data filtering. Based on the code instruction datasets from the small-scale synthesizers, we develop SCoder, a family of code generation models fine-tuned from DeepSeek-Coder. SCoder models achieve state-of-the-art code generation capabilities, demonstrating the effectiveness of our method.

代码生成小模型自蒸馏数据合成

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