Qwen2.5 Technical Report

An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jiaxi Yang, Jingren Zhou, Junyang Lin, Kai Dang, Keming Lu, Keqin Bao, Kexin Yang, Le Yu, Mei Li, Mingfeng Xue, Pei Zhang, Qin Zhu, Rui Men, Runji Lin, Tianhao Li, Tingyu Xia, Xingzhang Ren, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yu Wan, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, Zihan QiuarXiv 2024 · DOI

TL;DR

The Qwen team has released Qwen2.5, a new family of large language models (LLMs) that significantly advance pre-training data scale (18 trillion tokens) and post-training techniques, leading to improved reasoning, long-context handling, and instruction following. Qwen2.5-72B-Instruct demonstrates competitive performance against much larger models like Llama-3-405B-Instruct, while Qwen2.5-Turbo and Qwen2.5-Plus offer impressive cost-effectiveness.

What Problem Does This Paper Address?

The rapid evolution of large language models (LLMs) has created a demand for increasingly capable and versatile models. While previous iterations of Qwen have shown promise, there's a continuous need to push the boundaries of performance, particularly in areas like common sense reasoning, expert knowledge acquisition, and the ability to handle complex, long-form inputs and instructions. The authors aim to address this by scaling up the foundational pre-training data and refining post-training methods to enhance human preference alignment, improve performance on specialized tasks (math, coding), and enable more robust instruction following. Furthermore, they aim to provide a diverse range of models, from small, efficient ones suitable for edge devices to powerful proprietary variants, catering to various use cases and resource constraints.

Methods

Qwen2.5 builds upon the Transformer architecture, incorporating several key advancements:

  • Massive Pre-training Data Scaling: The pre-training dataset has been significantly expanded from 7 trillion tokens to 18 trillion tokens, with a focus on diverse domains including knowledge, coding, and mathematics. This larger dataset is crucial for developing robust common sense, expert knowledge, and reasoning capabilities.
  • Enhanced Post-training:
    • Supervised Fine-Tuning (SFT): Over 1 million high-quality SFT examples were used, with a particular emphasis on long-sequence generation, mathematics (chain-of-thought data), coding, instruction following, structured data understanding, and logical reasoning.
  • Multi-stage Reinforcement Learning (RL): This includes both offline RL (using Direct Preference Optimization - DPO) and online RL (using Group Relative Policy Optimization - GRPO). These techniques are designed to align model outputs with human preferences, improving truthfulness, helpfulness, conciseness, relevance, harmlessness, and debiasing.
  • Long-Context Capabilities: Techniques like YARN (Yet Another RoPE extensioN) and Dual Chunk Attention (DCA) are employed to extend context length, enabling models to process significantly longer sequences (up to 1 million tokens for Qwen2.5-Turbo).
  • Mixture-of-Experts (MoE) for Proprietary Models: Qwen2.5-Turbo and Qwen2.5-Plus utilize MoE architectures to achieve a balance of performance, latency, and cost.
  • Improved Tokenizer: The tokenizer vocabulary has been expanded to include more control tokens for enhanced functionality.

Datasets

  • Pre-training: 18 trillion tokens of high-quality, diverse data.
  • Supervised Fine-tuning (SFT): Over 1 million samples, including data from Qwen2.5-Math and Qwen2.5-Coder, as well as synthetic data and curated datasets for various tasks.
  • Reinforcement Learning (RL): Approximately 150,000 training pairs for DPO, and a separate dataset for GRPO training.
  • Evaluation Benchmarks: A comprehensive suite of standard benchmarks including MMLU, MMLU-Pro, BBH, ARC-C, TruthfulQA, Winogrande, HellaSwag, GPQA, TheoremQA, MATH, GSM8K, HumanEval, MBPP, MultiPL-E, LiveCodeBench, IFEval, MT-Bench, Arena-Hard, RULER, LV-Eval, and Longbench-Chat. In-house benchmarks for English, Chinese, and multilingual tasks were also used.

Key Insights and Ideas

  • Data Scale is King (Still): The significant increase in pre-training data from 7T to 18T tokens is highlighted as a primary driver for Qwen2.5's improved capabilities, underscoring the continued importance of data scale in LLM development.
  • Post-training Matters Immensely: The paper emphasizes how sophisticated post-training techniques, particularly RL and DPO, are critical for aligning LLMs with human preferences and achieving top-tier performance on complex tasks.
  • Long Context is Becoming Standard: The successful implementation of techniques like YARN and DCA to handle context lengths up to 1 million tokens signifies a major step towards LLMs that can process and reason over much larger amounts of information.
  • Efficiency Through MoE: Qwen2.5-Turbo and Qwen2.5-Plus demonstrate that MoE architectures can offer a compelling trade-off between computational cost and performance, making advanced LLMs more accessible.
  • Specialized Models as Foundation: Qwen2.5 serves as a strong base for developing specialized models (e.g., for math, coding), showcasing its versatility and the effectiveness of its foundational training.

Key Results

  • Qwen2.5-72B-Instruct: Achieves competitive performance against Llama-3-405B-Instruct (which is ~5x larger) on various benchmarks. It outperforms many open and proprietary models.
  • Qwen2.5-Turbo & Qwen2.5-Plus: Offer superior cost-effectiveness while performing competitively against GPT-4o-mini and GPT-4o.
  • Long Context Performance: Qwen2.5 models demonstrate strong performance on long-context benchmarks like RULER and LV-Eval, with Qwen2.5-Turbo achieving 100% accuracy on a 1M-token passkey retrieval task.
  • Efficiency Gains: The sparse attention mechanism in Qwen2.5-Turbo reduces computational load by 12.5x for 1M token sequences, and TTFT is improved by 3.2x to 4.3x across hardware configurations.
  • Model Diversity: A wide range of open-weight models are available, from 0.5B to 72B parameters, catering to diverse needs.

Limitations and Future Work

  • Limitations:
    • The paper acknowledges that current reward model evaluation benchmarks may not perfectly predict the performance of RL models trained with them, suggesting a potential for over-optimization on specific benchmarks.
  • While improvements in capturing cultural nuances are noted for Qwen2.5, further refinement is still possible.
  • Future Work:
    • Iterative Refinement of Foundational Models: Continue to improve base and instruction-tuned LLMs by incorporating broader, more diverse, and higher-quality data.
  • Multimodal Models: Develop a unified framework to integrate various modalities (textual, visual, auditory) for seamless end-to-end information processing.
  • Enhanced Reasoning Capabilities: Focus on improving reasoning through strategic scaling of inference compute resources.

Summary updated

BibTeX
@misc{yang2024qwen,
  author = {An Yang and Baosong Yang and Beichen Zhang and Binyuan Hui and Bo Zheng and Bowen Yu and Chengyuan Li and Dayiheng Liu and Fei Huang and Haoran Wei and Huan Lin and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Yang and Jiaxi Yang and Jingren Zhou and Junyang Lin and Kai Dang and Keming Lu and Keqin Bao and Kexin Yang and Le Yu and Mei Li and Mingfeng Xue and Pei Zhang and Qin Zhu and Rui Men and Runji Lin and Tianhao Li and Tingyu Xia and Xingzhang Ren and Xuancheng Ren and Yang Fan and Yang Su and Yichang Zhang and Yu Wan and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zihan Qiu},
  title = {{Qwen2.5 Technical Report}},
  year = {2024},
  eprint = {2412.15115},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.15115},
}
Figure