---
title: Qwen2.5-instruct Models
url: https://www.emergentmind.com/topics/qwen2-5-instruct-models-3a12e49b-6877-4992-954a-e2da8ab3d090
type: topic
---

# Qwen2.5-instruct Models

Qwen2.5-instruct models are a suite of instruction-tuned large language models developed atop the Qwen2.5 foundation, with specific emphasis on enhanced reasoning, data quality, cross-lingual utility, and mathematical or code-centric expertise. Their architecture and training pipeline systematically integrate self-improvement loops, iterative supervised/reinforcement tuning, and advanced evaluation methods. The series includes general-purpose, mathematics-focused, code-focused, and multilingual variants, establishing new benchmarks on numerous tasks in open-domain reasoning, competitive mathematics, bilingual performance, and specialized code generation.

## 1. Architecture and Pipeline Innovations

Qwen2.5-instruct models are built on large-scale transformer-based architectures with sizes ranging from 0.5B up to 72B parameters. Base models are pre-trained on a highly curated multi-domain corpus of up to 18 trillion tokens, covering general text, code, and mathematical content (including Qwen Math Corpus v2 and 5.5T code tokens for code-centric variants) [2412.15115, 2409.12122, 2409.12186].

Key architectural features include:
- **Grouped Query Attention (GQA):** Efficient key/value cache utilization for scaling up inference [2412.15115].
- **Long-context support:** Built-in ability to handle up to 32K tokens natively, with proprietary and later open-weight variants (e.g., Qwen2.5-1M) expanding support to 1M tokens using techniques like Dual Chunk Attention (DCA) and YARN [2501.15383].
- **Mixture-of-Experts (MoE):** Proprietary models (Qwen2.5-Turbo, Qwen2.5-Plus) replace standard FFN with MoE layers, improving cost-performance trade-offs for API-deployed scenarios [2412.15115].

Distinctive training methodologies employed include:
- **Self-improvement pipeline:** Early math instruct models are used to generate large-scale synthetic data, producing iterative cycles where reward models (RMs) trained via massive sampling guide SFT and RL stages [2409.12122].
- **Tool-Integrated Reasoning (TIR):** Post-training data includes explicit examples of tool usage (e.g., Python execution traces) to improve both step-wise and exact computation capabilities, especially in mathematical and code domains [2409.12122, 2411.05934].
- **Bilingual (and later cross-lingual) instruction tuning:** Both English and Chinese CoT and TIR data are included in SFT and RL phases, enabling robust cross-lingual performance [2409.12122].

## 2. Self-Improvement, SFT, and Reinforcement Learning

The Qwen2.5-instruct pipeline is designed around a multi-stage self-improvement philosophy, with significant algorithmic innovations:

**Pre-training Stage:**
- Qwen2-Math-Instruct generates synthetic, high-quality mathematical data, augmenting the base pre-training set (Qwen Math Corpus v2) and ensuring coverage of complex, multi-step queries [2409.12122].

**Post-training Stage:**
- Reward Model (RM) Training: Millions of SFT-generated samples are labeled for correctness; a math-specific RM is trained with a listwise loss:
  $$
  \mathcal{L}_{\text{rm}}(\theta) = -\frac{1}{k(6-k)} \mathbb{E}_{(x, y_+, y_-)\sim D} \left[\log\,\sigma(r_\theta(x, y_+) - r_\theta(x, y_-))\right]
  $$
  where $r_\theta(x, y)$ outputs the RM score for input $x$ and candidate $y$, $k$ counts the positives among 6 candidates, and $\sigma$ is the sigmoid [2409.12122].

- SFT/Iterative Cycles: The RM is iteratively used to select high-quality samples for further SFT, followed by retraining the RM itself as models improve.

- RL Stage: The final (ultimate) RM guides reinforcement learning using *Group Relative Policy Optimization (GRPO)*, with the group-level average reward as a baseline and a listwise ranking loss:
  $$
  \mathcal{J}_{\text{GRPO}}(\theta) = \mathbb{E}_{q,\{o_i\}} \left[\frac{1}{G}\sum_{i=1}^G (\text{clipped advantage terms} - \beta \cdot \text{KL divergence})\right]
  $$
  This approach, as opposed to earlier pairwise ranking, enhances sample efficiency and directness of reward signal [2409.12122].

- **Inference Integration:** At test time, the RM is used to rank $N$ candidates (“best-of-$N$” sampling, *RM@N*), outperforming majority voting for reliable output selection and probabilistic calibration [2409.12122].

## 3. Specialized Variants: Math, Coding, Multilingual, and Domain

### Mathematical Reasoning (Qwen2.5-Math-Instruct)

- Pre-training corpus exceeds 1T tokens of mathematical data, ensuring strong parameterization for step-by-step (CoT) and TIR reasoning.
- State-of-the-art accuracy on competitive and school-level math datasets:
    - SOTA score of 66.8 on MATH benchmark for the 72B Instruct model.
    - Tool-integrated mode achieves scores near 80 on MATH even for 1.5B models; 7B models match or surpass preceding 72B models [2409.12122].
- Bilingual reasoning (English/Chinese) is robust, with explicit gains on Chinese-oriented benchmarks (CMATH, GaoKao) [2409.12122].

### Code Generation (Qwen2.5-Coder)

- Multi-stage pre-training (file-level, repo-level, instruction) incorporates FIM (Fill-In-the-Middle) strategies and specialized tokens for code segment prediction and repository comprehension [2409.12186].
- Balanced data mixing (Code:Text:Math at 70:20:10) yields optimal performance on code and reasoning tasks.
- SOTA on HumanEval, MBPP, BigCodeBench; above 60% on several languages in MultiPL-E for 7B+ models, with excellent OOD generalization (e.g., RepoEval, CrossCodeEval, CodeEditorBench) [2409.12186].

### Multilingual and Domain Adaptation

- The same architectural and SFT innovations enable downstream fine-tuning for other languages and domains (e.g., Amadeus-Verbo for Portuguese [2506.00019], Bengali Olympiad math [2411.05934], and domain-specific customization such as CFD simulation setup [2504.09602]).
- Bilingual SFT and explicit cross-lingual datasets are systematically integrated into the workflow, yielding strong performance in varied linguistic environments.

## 4. Performance Evaluation and Benchmarks

Qwen2.5-instruct models have established state-of-the-art or highly competitive results on an array of public benchmarks across domains and languages, including:

| Variant                                  | Domain        | Benchmarks                                      | Noteworthy Result(s)              |
|-------------------------------------------|--------------|-------------------------------------------------|------------------------------------|
| Qwen2.5-Math-Instruct-72B                 | Math         | MATH, GSM8K, AMC23, AIME24, CMATH, GaoKao       | 66.8 on MATH (SOTA); SFT + TIR: 80 |
| Qwen2.5-Coder-7B/32B                      | Code         | HumanEval, MBPP, MultiPL-E, BigCodeBench        | Outperforms larger DS-Coder-33B    |
| General Qwen2.5-72B-Instruct              | Reasoning/NLP| MMLU, ARC, TruthfulQA, HellaSwag, WinoGrande    | Matches/Exceeds Llama-3-405B       |
| Domain-finetuned (e.g. Bengali, CFD)      | Local/domain | Bengali Olympiad, NL2FOAM (CFD tasks)           | Domain SOTA, <7B model outperforms 72B general |

These results are consistently realized with smaller models (1.5B/7B) matching or surpassing older much larger models due to advanced data and training protocols [2409.12122, 2409.12186, 2412.15115, 2411.05934, 2504.09602].

## 5. Technical Details: Parameters, Decontamination, and Sampling

### Training Protocols and Scaling

- Open-weight variants scale from 0.5B to 72B parameters; batch sizes, learning rates, and epochs are tailored to model size (e.g., 72B: batch 256, 3 epochs, LR from $5\times 10^{-6}$ to $7\times 10^{-7}$, 4096 tokens per sample) [2409.12122].

- Scaling laws for LR and batch size are empirically determined, maintaining efficient optimization at scale [2412.15115].

### Data Decontamination

- Rigorous decontamination (e.g., 13-gram matching with thresholds) ensures no overlap between training sets and evaluations on public math and reasoning datasets [2409.12122].

### Inference Sampling and Tool Use

- Best-of-$N$ sampling plus RM-guided selection (RM@N) consistently beats majority voting, especially on hard problems [2409.12122].
- Tool-Integrated Reasoning (TIR) operationalizes calls to external Python or computational tools, providing accurate arithmetic and symbolic computation, embedded directly into inference chains [2411.05934].

## 6. Impact and Significance

Qwen2.5-instruct exemplifies a new methodological standard for specialized, high-accuracy, cross-lingual LLM development:
- Demonstrates that iterative self-improvement—anchored by mathematical and code-specific RMs and regular SFT/RL cycles using synthetic and real data—enables smaller models to reliably outperform much larger generic LLMs in domain tasks [2409.12122, 2409.12186].
- Bilingual and domain-specific adaptation ensures broad usability and accessibility across research/theoretical, enterprise, and educational settings.
- By deploying “inference-time RM guidance,” Qwen2.5-instruct establishes a generalizable paradigm for robust sample filtering, trust calibration, and output selection in LLM deployment—directly addressing model reliability and bias [2409.12122, 2412.15115, 2508.18427].
- Open-source release, permissive licensing, and reproducible training/evaluation pipelines further position Qwen2.5-instruct as a foundational asset for continued research and industrial application.

## 7. Limitations and Considerations

- While iterative SFT/RL with RMs drives pronounced gains, overall performance on some high-difficulty problems remains sensitive to data coverage, RM calibration, and prompt engineering [2409.12122, 2411.05934].
- Domain-specific improvements may require additional cycles of synthetic data generation and RM retraining as real benchmarks evolve.
- Scaling to new modalities (e.g., vision-language) or domains depends on careful curation of task-specific data and reward signals.

## References (by arXiv id)

- Qwen2.5-Math Technical Report [2409.12122]
- Qwen2.5-Coder Technical Report [2409.12186]
- Qwen2.5-32B for Bengali Math [2411.05934]
- Qwen2.5 Technical Report [2412.15115]
- Fine-tuning Qwen2.5-7B-Instruct for CFD [2504.09602]
- On-Device Qwen2.5 [2504.17376]
- DistilQwen2.5 [2504.15027]
- Amadeus-Verbo Qwen2.5-PT [2506.00019]
- EICAP Benchmark/EI Assessment [2508.06196]
- Tracing Positional Bias in Finance [2508.18427]

This comprehensive design—iterative self-improvement, robust RL tuning, cross-lingual evaluation, and best-of-N RM sampling—affirms Qwen2.5-instruct as a versatile, high-accuracy framework for mathematical, code, and general reasoning in contemporary LLM research and deployment.

Source: https://www.emergentmind.com/topics/qwen2-5-instruct-models-3a12e49b-6877-4992-954a-e2da8ab3d090