MATH / README.md
jaival17's picture
Update README.md
f7c9374 verified
|
Raw History Blame Contribute Delete
5.93 kB
---
pretty_name: MATH (RLVR format)
license: mit
language:
- en
task_categories:
- text-generation
- question-answering
tags:
- math
- reasoning
- rlvr
- reinforcement-learning
- verl
size_categories:
- 10K<n<100K
configs:
- config_name: default
data_files:
- split: train
path: train.parquet
- split: test
path: test.parquet
---
# MATH (RLVR format)
This is the MATH competition-mathematics dataset ([Hendrycks et al., 2021](https://arxiv.org/abs/2103.03874)) in the verl-style RLVR (reinforcement learning with verifiable rewards) format. We used it to train and evaluate **A-NSR** and **CW-NSR** in our paper *Adaptive Negative Reinforcement for LLM Reasoning: Dynamically Balancing Correction and Diversity in RLVR*.
The files are an unmodified copy of the preprocessed MATH data released by Zhu et al. with *The Surprising Effectiveness of Negative Reinforcement in LLM Reasoning* (NeurIPS 2025). The `data_source` field is `TianHongZXY/MATH`. We re-host the data so that our experiments can be reproduced with exactly the same files.
## Dataset summary
| Split | Problems | Use in our paper |
|-------|---------:|------------------|
| `train` | 7,500 | RLVR training (10 epochs, prompt batch size 128) |
| `test` | 5,000 | Evaluation (Pass@k, k = 1 … 256) |
Each problem has a difficulty level (1–5), one of seven subjects, a reference step-by-step solution, and a final answer (`target`). The final answer is used for rule-based reward checking.
### Subject distribution
| Subject | Train | Test |
|---------|------:|-----:|
| Algebra | 1,744 | 1,187 |
| Counting & Probability | 771 | 474 |
| Geometry | 870 | 479 |
| Intermediate Algebra | 1,295 | 903 |
| Number Theory | 869 | 540 |
| Prealgebra | 1,205 | 871 |
| Precalculus | 746 | 546 |
### Difficulty distribution
| Level | Train | Test |
|-------|------:|-----:|
| Level 1 | 564 | 437 |
| Level 2 | 1,348 | 894 |
| Level 3 | 1,592 | 1,131 |
| Level 4 | 1,690 | 1,214 |
| Level 5 | 2,304 | 1,324 |
| `Level ?` (unlabeled in the original data) | 2 | 0 |
## Data fields
| Field | Type | Description |
|-------|------|-------------|
| `level` | string | Difficulty, `"Level 1"` … `"Level 5"` |
| `type` | string | Subject (see table above) |
| `data_source` | string | Always `"TianHongZXY/MATH"` |
| `prompt` | list of `{role, content}` | Chat-format prompt: one `user` message containing the problem statement |
| `ability` | string | Always `"math"` |
| `reward_model.style` | string | Always `"rule"` (rule-based verifiable reward) |
| `reward_model.ground_truth.question` | string | Problem statement |
| `reward_model.ground_truth.solution` | string | Reference solution from MATH, with the answer in `\boxed{}` |
| `reward_model.ground_truth.target` | string | Final answer used for reward computation |
| `extra_info.index` | int | Index within the split |
| `extra_info.split` | string | `"train"` or `"test"` |
### Example
```json
{
"level": "Level 3",
"type": "Algebra",
"data_source": "TianHongZXY/MATH",
"prompt": [{"role": "user", "content": "How many vertical asymptotes does the graph of $y=\\frac{2}{x^2+x-6}$ have?"}],
"ability": "math",
"reward_model": {
"style": "rule",
"ground_truth": {
"question": "How many vertical asymptotes does the graph of $y=\\frac{2}{x^2+x-6}$ have?",
"solution": "The denominator of the rational function factors into $x^2+x-6=(x-2)(x+3)$. ... Therefore, the graph has $\\boxed{2}$ vertical asymptotes.",
"target": "2"
}
},
"extra_info": {"index": 0, "split": "test"}
}
```
## Usage
```python
from datasets import load_dataset
ds = load_dataset("<your-username>/MATH-RLVR")
print(ds["train"][0]["prompt"][0]["content"])
print(ds["train"][0]["reward_model"]["ground_truth"]["target"])
```
The `prompt` field holds only the raw problem. In our experiments with `Qwen2.5-Math-1.5B`, it was wrapped in the following chat template, which is the same as in Zhu et al. and SimpleRL-Zoo:
```
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
{input}
Please reason step by step, and put your final answer
within \boxed{}.<|im_end|>
<|im_start|>assistant
```
The reward is binary: a response is correct if the answer in its final `\boxed{}` matches `target` under a math-equivalence check, and incorrect otherwise.
## Source and license
- **Original dataset:** MATH, by Hendrycks et al. (2021), released under the MIT License: <https://github.com/hendrycks/math>.
- **Preprocessing:** Zhu et al. (2025), <https://github.com/TianHongZXY/RLVR-Decomposed>.
- The MATH problems come from competitions such as AMC 10, AMC 12, and AIME, via the Art of Problem Solving.
## Citation
If you use this dataset, please cite the original MATH paper and the work whose preprocessing we reuse:
```bibtex
@inproceedings{hendrycks2021math,
title = {Measuring Mathematical Problem Solving With the {MATH} Dataset},
author = {Hendrycks, Dan and Burns, Collin and Kadavath, Saurav and Arora, Akul and Basart, Steven and Tang, Eric and Song, Dawn and Steinhardt, Jacob},
booktitle = {NeurIPS Datasets and Benchmarks},
year = {2021}
}
@inproceedings{zhu2025nsr,
title = {The Surprising Effectiveness of Negative Reinforcement in {LLM} Reasoning},
author = {Zhu, Xinyu and Xia, Mengzhou and Wei, Zhepei and Chen, Wei-Lin and Chen, Danqi and Meng, Yu},
booktitle = {NeurIPS},
year = {2025}
}
```
Our paper:
<!-- Replace with the final citation once the paper is published. -->
```bibtex
@article{ingle2026adaptive,
title = {Adaptive Negative Reinforcement for {LLM} Reasoning: Dynamically Balancing Correction and Diversity in {RLVR}},
author = {Ingle, Yash and Chauhan, Jaival and Yadav, Ankit and Mishra, Sudhakar},
year = {2026}
}
```
Code: [A-NSR](https://github.com/Jaival111/Adaptive-Negative-Reinforcement) · [CW-NSR](https://github.com/Jaival111/Confidence-Weighted-NSR)