Qwen2.5-Math Release Notes

Qwen has announced the release of Qwen2.5-Math, a series of specialized mathematical Large Language Models (LLMs) designed for high-precision reasoning in English and Chinese. The series introduces Tool-Integrated Reasoning (TIR) alongside Chain-of-Thought (CoT) to improve computational accuracy and solve complex algorithmic tasks, positioning the flagship 72B model as a leading open-source mathematical LLM.

Model Lineup and Capabilities

Qwen2.5-Math is available in several configurations to balance performance and efficiency:

  • Base Models: Qwen2.5-Math-1.5B, 7B, and 72B.
  • Instruction-Tuned Models: Qwen2.5-Math-1.5B-Instruct, 7B-Instruct, and 72B-Instruct.
  • Reward Model: Qwen2.5-Math-RM-72B, used for data construction and reinforcement learning.

While the previous Qwen2-Math series focused on English CoT, Qwen2.5-Math expands support to both Chinese and English and introduces Tool-Integrated Reasoning (TIR). TIR allows the models to use tools (such as a Python interpreter) for precise computation and symbolic manipulation, addressing the inherent limitations of CoT in handling complex calculations like matrix eigenvalues or quadratic equation roots.

Technical Improvements and Training Pipeline

Qwen2.5-Math models were developed by upgrading the Qwen2-Math base models through three primary methods:

  1. Synthesized Data: Using Qwen2-Math-72B-Instruct to generate high-quality mathematical pre-training data.
  2. Expanded Corpus: Aggregating more high-quality mathematical data from books, web sources, and code, specifically increasing Chinese language data. The Qwen Math Corpus v2 grew from 700B to over 1T tokens.
  3. Parameter Initialization: Leveraging the Qwen2.5 series base model for improved language understanding and code generation.

For the instruction-tuned models, Qwen utilized a math-specific reward model (Qwen2.5-Math-RM-72B) to construct Supervised Fine-Tuning (SFT) data via Rejection Sampling and to guide reinforcement learning using Group Relative Policy Optimization (GRPO).

Performance Benchmarks

Qwen2.5-Math demonstrates significant gains over its predecessor and competes with leading closed-source models:

General Mathematics

  • Flagship Performance: Qwen2.5-Math-72B-Instruct outperforms Qwen2-Math-72B-Instruct by an average of 4.4 points in English and 6.1 points in Chinese.
  • TIR Advantage: Under the TIR setting (RM@8), the 72B-Instruct model achieved a score of 92.9 on the MATH benchmark.
  • Efficiency: The Qwen2.5-Math-7B-Instruct model surpasses the previous Qwen2-Math-Instruct 72B in performance, achieving MATH scores of 83.6 (CoT) and 85.3 (TIR).
  • Small Model Capability: The 1.5B-Instruct model achieves a MATH score of approximately 80 when using a Python interpreter.

Complex Competition Math

On the AIME 2024 benchmark, where closed-source models like Claude 3 Opus, GPT-4 Turbo, and Gemini 1.5 Pro solved only 1 or 2 out of 30 questions, Qwen2.5-Math-72B-Instruct solved 9 problems in Greedy CoT mode and 12 in TIR mode. With reward model assistance, the 7B-Instruct model solved up to 21 problems.

Evaluation Integrity and Decontamination

To prevent data leakage and ensure unbiased results, Qwen implemented a strict decontamination process:

  • 13-gram Matching: Used to exclude potentially contaminated training samples after text normalization.
  • Longest Common Subsequence (LCS): A ratio exceeding 0.6 was used to identify contamination, particularly for common mathematical expressions.
  • Dataset Filtering: Samples were filtered against a wide array of test sets, including GSM8K, MATH, Minerva Math, Olympiad Bench, and AIME 24, among others.

Implementation and Demos

Qwen provides two primary ways to experience the models:

  • TIR Demo: Integrated into Qwen-Agent, allowing users to run code locally to utilize Tool-Integrated Reasoning.
  • Multi-modal Demo: Available on Hugging Face and Modelscope, combining Qwen2-VL for OCR and Qwen2-Math for reasoning to process images, text, or sketches of math problems.

Sources