DistilQwen2.5: Industrial Practices of Training Distilled Open Lightweight Language Models

Chengyu Wang, Junbing Yan, Yuanhao Yue, Jun Huang

TL;DR

DistilQwen2.5 introduces a highly practical, two-stage industrial knowledge distillation (KD) framework that combines multi-agent black-box data augmentation with an efficient top-$K$ white-box logit distillation method. By applying this framework to the open-source Qwen2.5 family (ranging from 0.5B to 7B parameters), the authors significantly boost instruction-following and reasoning capabilities, outperforming the original base models and rivaling models twice their size.

What Problem Does This Paper Address?

Deploying large language models (LLMs) in production is notoriously expensive and computationally demanding, making lightweight models (under 10B parameters) highly desirable for resource-constrained environments. However, smaller models typically struggle with complex reasoning and strict instruction-following.

Knowledge Distillation (KD)—where a small "student" model learns from a large "teacher" model—is a promising solution, but standard approaches hit major roadblocks in industrial settings:

  1. Black-box KD (training only on the text outputs of proprietary APIs) misses out on the rich, fine-grained probability distributions of the teacher.
  2. White-box KD (matching the full logit distributions) is computationally prohibitive, causing massive GPU memory overhead when running large teacher models concurrently with student training. It also fails when the teacher and student use different token vocabularies.

This paper bridges the gap by providing a scalable, hybrid distillation pipeline optimized for real-world efficiency.

Methods

The authors implement a distinct two-stage distillation pipeline:

  1. Multi-Agent Data Augmentation (Black-Box KD): A central controller coordinates powerful proprietary LLMs (like Qwen-max and GPT-4o) acting as specialized agents to curate high-quality training data:

  2. Expansion Agent: Generates diverse instruction variations while preserving the core NLP task category to prevent semantic drift.

  3. Rewriting Agent: Refines instruction-response pairs under strict constraints, explicitly encouraging Chain-of-Thought (CoT) outputs for reasoning tasks.
  4. Selection Agent: Filters out low-quality data based on informativeness, helpfulness, and task balance.
  5. Verification Agent: Double-checks the factual correctness of newly generated instances.
  6. Efficient Model Fusion (White-Box KD): To bypass the massive overhead of standard logit distillation, the authors make a key observation: the sum of the probabilities of a teacher's top-10 tokens is almost always close to 1.

Instead of running the teacher live during student training, they compute the teacher's top-$K$ ($K=10$) logits offline via a distributed process. They introduce a token alignment step to handle vocabulary mismatches and minimize divergence (like Kullback-Leibler Divergence) only over these top-$K$ elements. This drastically cuts down on cloud storage and compute costs.

Figure 2: Functionalities for LLMs/agents used in data augmentation and black-box distillation. Disclaimer: We use the Qwen logo in the figure; however, any LLMs with sufficient capabilities can be used as well.

Datasets

The initial training mix combines popular open-source instruction datasets with proprietary in-house data:

  • OpenHermes 2.5
  • Cleaned Alpaca Dataset
  • LCCD (a large-scale Chinese short-text conversation dataset)

For rigorous evaluation, the authors test the distilled models across three major benchmarks: AlpacaEval 2.0 (length-controlled instruction following), MT-Bench (multi-turn conversation and multitasking), and IFEval (strict prompt constraint verification).

Key Insights and Ideas

  • The Top-10 Logit Sufficiency: Realizing that nearly 100% of the teacher's knowledge is concentrated in the top-10 tokens allows for highly compressed, offline logit storage. This completely decouples the teacher's inference from the student's training loop.
  • Diminishing Returns on Teacher Size: When performing white-box fusion after black-box data augmentation, increasing the teacher size from 14B to 72B yields diminishing returns. This indicates that smaller, more efficient teacher models are entirely sufficient for the final logit-matching phase.
  • Smaller Students Benefit More: The performance leap from distillation is significantly more pronounced for smaller backbones (e.g., 0.5B) than larger ones (7B), showing that ultra-lightweight models have massive, untapped capacity when guided correctly.

Key Results

The DistilQwen2.5 models demonstrate substantial performance gains across all evaluated metrics:

  • Instruction Following: On AlpacaEval 2.0, DistilQwen2.5-1.5B-Instruct achieved a score of 13.69, more than doubling the original Qwen2.5-1.5B baseline score of 6.69.
  • Training Efficiency: The top-$K$ offline logit generation technique achieved a 3× to 5× speedup in inference latency during the data preparation phase compared to vanilla white-box implementations, without any degradation in student performance.
Figure 1: Brief comparison between original Qwen2.5 and DistilQwen2.5 models in terms of AlpacaEval 2.0 (length-controlled) and IFEval scores.
  • Industrial Use Case (SQL Completion): In a real-world deployment on a big data platform, the authors distilled a Qwen2.5-7B model into a compact 3B student model. The 3B student closely matched the 7B teacher's performance (25.5% vs. 26.5% user adoption rate) while delivering a 1.4× inference speedup.

Limitations and Future Work

Despite the impressive gains, the authors note a few key limitations:

  • Error Propagation: The student models are highly dependent on the quality of the teachers and run the risk of inheriting underlying biases, factual errors, or hallucinations present in the proprietary models.
  • Generalizability: While the framework excels on standard benchmarks and specific tasks like SQL completion, its performance across highly niche domains and lower-resource languages still requires broader validation.

For future work, the team plans to explore more dynamic knowledge transfer methods during the model fusion stage and expand the framework to support highly specialized domain-specific applications.

Summary updated

BibTeX
@misc{wang2025distilqwen,
  author = {Chengyu Wang and Junbing Yan and Yuanhao Yue and Jun Huang},
  title = {{DistilQwen2.5: Industrial Practices of Training Distilled Open Lightweight Language Models}},
  year = {2025},
  eprint = {2504.15027},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.15027},
}
Figure