The code and data of We-Math 2.0.
170
stars
28
commits
Python
primary language
Aug 30, 2025
updated
🤗 MathBook-Standard | 🌐 Webpage | 🤗 MathBook-Pro |
✨ Stay tuned — we will continue to share updates as our work on multimodal reasoning progresses!
[2025.08.15] 🌐 We-Math 2.0 homepage is live at we-math2.github.io. 🚀
[2025.08.15] 📄 We-Math 2.0 paper is now available on arXiv. 🚀
[2025.08.15] 📦 We-Math 2.0 dataset is now available on Hugging Face Datasets. 🚀
[2025.05.16] 🎉 We-Math is accepted by ACL 2025 🎉
[2025.02.20] 🎉 We-Math is officially supported by VLMEvalKit for fast evalution 🚀.
[2024.07.02] We-Math is accessible at https://arxiv.org/abs/2407.01284.
[2024.07.02] The We-Math dataset is accessible at Huggingface Datasets.
[2024.07.02] The We-Math homepage can be accessed at https://we-math.github.io/.
We-Math 2.0 is a unified system designed to comprehensively enhance the mathematical reasoning capabilities of Multimodal Large Language Models (MLLMs).
It integrates a structured mathematical knowledge system, model-centric data space modeling, and a reinforcement learning (RL)-based training paradigm to achieve both broad conceptual coverage and robust reasoning performance across varying difficulty levels.
The key contributions of We-Math 2.0 are fourfold:
Extensive experiments show that MathBook-RL consistently outperforms existing baselines on four widely-used benchmarks and achieves strong results on MathBookEval, demonstrating superior generalization in mathematical reasoning.
The MathBook Knowledge System is organized as a five-level hierarchy covering 491 knowledge points and 1,819 fundamental principles.
It is systematically derived from trusted sources such as Wikipedia and open-source textbooks, refined through hierarchical clustering, and further revised by human experts to ensure accuracy and completeness.
You can visit our project website to explore the complete knowledge system.
Building on the MathBook Knowledge System, MathBook-Standard is a dataset featuring comprehensive principle-level knowledge annotations and carefully curated problems to ensure broad, balanced coverage across mathematical domains, with particular focus on underrepresented areas.
To foster deeper conceptual understanding, MathBook-Standard employs a dual-expansion strategy:
This enables the creation of diverse problem sets that promote conceptual flexibility and adaptability.
Below, we present an example of the multi-images-per-question component of the dataset, which can be retrieved via its underlying knowledge principles.
You can view the full collection on our project website.
Building on the MathBook Knowledge System, MathBook-Pro introduces a pivotal three-dimensional difficulty modeling framework that systematically characterizes mathematical problem complexity from a model-centric perspective.
Each seed problem is positioned within a structured difficulty space defined by three orthogonal axes:
By varying a single dimension at a time and progressively composing transformations across multiple dimensions, each seed problem is expanded into seven progressive difficulty levels.
This enables structured, gradual learning for MLLMs and creates a robust foundation for enhancing reasoning performance across varying levels of complexity.
Below, we showcase the multi-level difficulty component of MathBook-Pro, illustrating its progressive design across the three complexity dimensions.
You can visit our project website to see the use of MathBook-Pro in the Dynamic Scheduling RL strategy.
Cold-Start Fine-tuning.
Supervised fine-tuning on MathBook-Standard (covering all 491 knowledge points), instilling awareness of the knowledge system and guiding knowledge-driven chain-of-thought reasoning.
Progressive Alignment RL.
A curriculum-based RL procedure with two phases:
Pre-aligned RL.
Using MathBook-Standard, where each group contains multiple variants of the same knowledge principle.
A mean-based reward is computed over variants sharing the same knowledge principle, encouraging reasoning consistency and robustness based on knowledge mastery rather than individual instances.
Dynamic Scheduling RL.
Using MathBook-Pro, each base problem $x_0=(q_0, a_0, I_0)$ follows a progressive trajectory that increases difficulty along knowledge, visual, and contextual dimensions:
$$ x_0 \to \phi_s(x_0) \to (\phi_s \circ \phi_v)(x_0) \to (\phi_s \circ \phi_c)(x_0) \to (\phi_s \circ \phi_v \circ \phi_c)(x_0) $$
where $\phi_s$ adds knowledge points, $\phi_v$ increases visual complexity, and $\phi_c$ increases contextual abstraction.
If the model fails at $\phi(x)$ after succeeding at $x$, we trigger incremental learning via an auxiliary set $\Delta(x,\phi)$ that isolates the newly introduced factor:
In this step, we will describe how to perform a cold start for the SFT stage using the ms-swift repository. Please first set up the environment for ms-swift.
pip install ms-swift -U
Our SFT dataset consists of two parts: 200 pure text samples and 800 samples with associated images. Download the SFT dataset from 🤗MathBook-SFT and refer to the script below for fine-tuning. (We found that in some versions, you may need to change the mathbook_sft.jsonl paths to absolute paths.)
nproc_per_node=8
NPROC_PER_NODE=$nproc_per_node \
MASTER_PORT=29500 \
MAX_PIXELS=4194304 \
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
swift sft \
--model_type qwen2_5_vl \
--model Qwen/Qwen2.5-VL-7B-Instruct \
--num_train_epochs 1 \
--train_type full \
--deepspeed zero2 \
--tuner_backend peft \
--torch_dtype bfloat16 \
--weight_decay 0.1 \
--warmup_ratio 0.03 \
--eval_steps 1000 \
--attn_impl flash_attn \
--output_dir checkpoint \
--dataset mathbook_sft.jsonl \
--per_device_train_batch_size 1
you can install our additional environment as follow:
pip install -r requirements.txt
Both RL stages are developed based on the EasyR1 codebase to fit our workflow.
For data preparation, you can directly download Parquet-format datasets from 🤗MathBook-Standard and 🤗MathBook-Pro for training.
cd pre_align
python3 -m verl.trainer.main \
config=pre_align_r1v.yaml
cd dynamic_scheduling
python3 -m verl.trainer.main \
config=dynamic_scheduling_r1v.yaml
python scripts/model_merger.py --local_dir checkpoints/easy_r1/exp_name/global_step_1/actor
Our dataset are distributed under the CC BY-NC 4.0 license.
If you find We-Math 2.0 useful for your your research and applications, please kindly cite using this BibTeX:
@article{qiao2025we,
title={We-Math 2.0: A Versatile MathBook System for Incentivizing Visual Mathematical Reasoning},
author={Qiao, Runqi and Tan, Qiuna and Yang, Peiqing and Wang, Yanzi and Wang, Xiaowan and Wan, Enhui and Zhou, Sitong and Dong, Guanting and Zeng, Yuchen and Xu, Yida and others},
journal={arXiv preprint arXiv:2508.10433},
year={2025}
}
For any questions or feedback, please reach out to us at qrq@bupt.edu.cn or qiunatan@bupt.edu.cn.
Python
97.4%
Shell
2.0%
The code and data of We-Math 2.0.
170
stars
28
commits
Python
primary language
Aug 30, 2025
updated
🤗 MathBook-Standard | 🌐 Webpage | 🤗 MathBook-Pro |
✨ Stay tuned — we will continue to share updates as our work on multimodal reasoning progresses!
[2025.08.15] 🌐 We-Math 2.0 homepage is live at we-math2.github.io. 🚀
[2025.08.15] 📄 We-Math 2.0 paper is now available on arXiv. 🚀
[2025.08.15] 📦 We-Math 2.0 dataset is now available on Hugging Face Datasets. 🚀
[2025.05.16] 🎉 We-Math is accepted by ACL 2025 🎉
[2025.02.20] 🎉 We-Math is officially supported by VLMEvalKit for fast evalution 🚀.
[2024.07.02] We-Math is accessible at https://arxiv.org/abs/2407.01284.
[2024.07.02] The We-Math dataset is accessible at Huggingface Datasets.
[2024.07.02] The We-Math homepage can be accessed at https://we-math.github.io/.
We-Math 2.0 is a unified system designed to comprehensively enhance the mathematical reasoning capabilities of Multimodal Large Language Models (MLLMs).
It integrates a structured mathematical knowledge system, model-centric data space modeling, and a reinforcement learning (RL)-based training paradigm to achieve both broad conceptual coverage and robust reasoning performance across varying difficulty levels.
The key contributions of We-Math 2.0 are fourfold:
Extensive experiments show that MathBook-RL consistently outperforms existing baselines on four widely-used benchmarks and achieves strong results on MathBookEval, demonstrating superior generalization in mathematical reasoning.
The MathBook Knowledge System is organized as a five-level hierarchy covering 491 knowledge points and 1,819 fundamental principles.
It is systematically derived from trusted sources such as Wikipedia and open-source textbooks, refined through hierarchical clustering, and further revised by human experts to ensure accuracy and completeness.
You can visit our project website to explore the complete knowledge system.
Building on the MathBook Knowledge System, MathBook-Standard is a dataset featuring comprehensive principle-level knowledge annotations and carefully curated problems to ensure broad, balanced coverage across mathematical domains, with particular focus on underrepresented areas.
To foster deeper conceptual understanding, MathBook-Standard employs a dual-expansion strategy:
This enables the creation of diverse problem sets that promote conceptual flexibility and adaptability.
Below, we present an example of the multi-images-per-question component of the dataset, which can be retrieved via its underlying knowledge principles.
You can view the full collection on our project website.
Building on the MathBook Knowledge System, MathBook-Pro introduces a pivotal three-dimensional difficulty modeling framework that systematically characterizes mathematical problem complexity from a model-centric perspective.
Each seed problem is positioned within a structured difficulty space defined by three orthogonal axes:
By varying a single dimension at a time and progressively composing transformations across multiple dimensions, each seed problem is expanded into seven progressive difficulty levels.
This enables structured, gradual learning for MLLMs and creates a robust foundation for enhancing reasoning performance across varying levels of complexity.
Below, we showcase the multi-level difficulty component of MathBook-Pro, illustrating its progressive design across the three complexity dimensions.
You can visit our project website to see the use of MathBook-Pro in the Dynamic Scheduling RL strategy.
Cold-Start Fine-tuning.
Supervised fine-tuning on MathBook-Standard (covering all 491 knowledge points), instilling awareness of the knowledge system and guiding knowledge-driven chain-of-thought reasoning.
Progressive Alignment RL.
A curriculum-based RL procedure with two phases:
Pre-aligned RL.
Using MathBook-Standard, where each group contains multiple variants of the same knowledge principle.
A mean-based reward is computed over variants sharing the same knowledge principle, encouraging reasoning consistency and robustness based on knowledge mastery rather than individual instances.
Dynamic Scheduling RL.
Using MathBook-Pro, each base problem $x_0=(q_0, a_0, I_0)$ follows a progressive trajectory that increases difficulty along knowledge, visual, and contextual dimensions:
$$ x_0 \to \phi_s(x_0) \to (\phi_s \circ \phi_v)(x_0) \to (\phi_s \circ \phi_c)(x_0) \to (\phi_s \circ \phi_v \circ \phi_c)(x_0) $$
where $\phi_s$ adds knowledge points, $\phi_v$ increases visual complexity, and $\phi_c$ increases contextual abstraction.
If the model fails at $\phi(x)$ after succeeding at $x$, we trigger incremental learning via an auxiliary set $\Delta(x,\phi)$ that isolates the newly introduced factor:
In this step, we will describe how to perform a cold start for the SFT stage using the ms-swift repository. Please first set up the environment for ms-swift.
pip install ms-swift -U
Our SFT dataset consists of two parts: 200 pure text samples and 800 samples with associated images. Download the SFT dataset from 🤗MathBook-SFT and refer to the script below for fine-tuning. (We found that in some versions, you may need to change the mathbook_sft.jsonl paths to absolute paths.)
nproc_per_node=8
NPROC_PER_NODE=$nproc_per_node \
MASTER_PORT=29500 \
MAX_PIXELS=4194304 \
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
swift sft \
--model_type qwen2_5_vl \
--model Qwen/Qwen2.5-VL-7B-Instruct \
--num_train_epochs 1 \
--train_type full \
--deepspeed zero2 \
--tuner_backend peft \
--torch_dtype bfloat16 \
--weight_decay 0.1 \
--warmup_ratio 0.03 \
--eval_steps 1000 \
--attn_impl flash_attn \
--output_dir checkpoint \
--dataset mathbook_sft.jsonl \
--per_device_train_batch_size 1
you can install our additional environment as follow:
pip install -r requirements.txt
Both RL stages are developed based on the EasyR1 codebase to fit our workflow.
For data preparation, you can directly download Parquet-format datasets from 🤗MathBook-Standard and 🤗MathBook-Pro for training.
cd pre_align
python3 -m verl.trainer.main \
config=pre_align_r1v.yaml
cd dynamic_scheduling
python3 -m verl.trainer.main \
config=dynamic_scheduling_r1v.yaml
python scripts/model_merger.py --local_dir checkpoints/easy_r1/exp_name/global_step_1/actor
Our dataset are distributed under the CC BY-NC 4.0 license.
If you find We-Math 2.0 useful for your your research and applications, please kindly cite using this BibTeX:
@article{qiao2025we,
title={We-Math 2.0: A Versatile MathBook System for Incentivizing Visual Mathematical Reasoning},
author={Qiao, Runqi and Tan, Qiuna and Yang, Peiqing and Wang, Yanzi and Wang, Xiaowan and Wan, Enhui and Zhou, Sitong and Dong, Guanting and Zeng, Yuchen and Xu, Yida and others},
journal={arXiv preprint arXiv:2508.10433},
year={2025}
}
For any questions or feedback, please reach out to us at qrq@bupt.edu.cn or qiunatan@bupt.edu.cn.
Python
97.4%
Shell
2.0%