issdandavis commited on
Commit
3ce13f6
·
verified ·
1 Parent(s): 5ee79e5

fix: normalize README line endings so the YAML frontmatter parses

Browse files
Files changed (1) hide show
  1. README.md +221 -221
README.md CHANGED
@@ -1,221 +1,221 @@
1
- ---
2
- language:
3
- - en
4
- - zh
5
- license: apache-2.0
6
- size_categories:
7
- - 100B<n<1T
8
- task_categories:
9
- - text-generation
10
- pretty_name: UltraData-Math
11
- arxiv: xxxx.xxxxx
12
- tags:
13
- - llm
14
- - pretraining
15
- - math
16
- - data-synthesis
17
- - data-filtering
18
- - high-quality
19
- - mathematical-reasoning
20
- - mirror
21
- configs:
22
- - config_name: UltraData-Math-L3-Conversation-Synthetic
23
- data_files: data/UltraData-Math-L3/Conversation-Synthetic/*.parquet
24
- - config_name: UltraData-Math-L3-Multi-Style-Synthetic
25
- data_files: data/UltraData-Math-L3/Multi-Style-Synthetic/*.parquet
26
- - config_name: UltraData-Math-L3-QA-Synthetic
27
- data_files: data/UltraData-Math-L3/QA-Synthetic/*.parquet
28
- - config_name: UltraData-Math-L3-Textbook-Exercise-Synthetic
29
- data_files: data/UltraData-Math-L3/Textbook-Exercise-Synthetic/*.parquet
30
- - config_name: UltraData-Math-L2-preview
31
- data_files: data/UltraData-Math-L2-preview/**/*.parquet
32
- - config_name: UltraData-Math-L1
33
- data_files: data/UltraData-Math-L1/**/*.parquet
34
- default_config_name: UltraData-Math-L3-Conversation-Synthetic
35
- ---
36
- <!-- scbe-status -->
37
- > **Status: mirror of an upstream dataset.** Not original SCBE work and not an SCBE experiment: this is a copy of the public UltraData-Math corpus (290B+ tokens, 181.2M rows, 552 GB). Kept as a pretraining source. Original SCBE data: [scbe-aethermoore-training-data](https://hf.co/issdandavis/scbe-aethermoore-training-data).
38
-
39
- # UltraData-Math
40
-
41
- <div align="center">
42
- <img src="assets/ultradata-math-logo.png" width="600"/>
43
- </div>
44
-
45
- <p align="center">
46
- <a href="https://huggingface.co/datasets/openbmb/UltraData-Math">🤗 Dataset</a> | <a href="https://github.com/UltraData-OpenBMB/UltraData-Math">💻 Source Code</a> | <a href="https://huggingface.co/datasets/openbmb/UltraData-Math/blob/main/README_ZH.md">🇨🇳 中文 README</a>
47
- </p>
48
-
49
- ***UltraData-Math*** is a large-scale, high-quality mathematical pre-training dataset totaling **290B+ tokens** across three progressive tiers—**L1** (170.5B tokens web corpus), **L2** (33.7B tokens quality-selected), and **L3** (88B tokens multi-format refined)—designed to systematically enhance mathematical reasoning in LLMs. It has been applied to the mathematical pre-training of the [MiniCPM Series](https://huggingface.co/collections/openbmb/minicpm4) models.
50
-
51
- ## 🆕 What's New
52
-
53
- - **[2026.02.09]**: **UltraData-Math**, a large-scale high-quality mathematical pre-training dataset with 290B+ tokens across three progressive tiers (L1/L2-preview/L3), is now available on Hugging Face. Released as part of the [UltraData](https://ultradata.openbmb.cn/) ecosystem. 🔥🔥🔥
54
- - **[2026.02.10]**: **UltraData-Math** tops the Hugging Face Datasets Trending list, reaching the #1 spot! ⭐️⭐️⭐️
55
-
56
- ## 📚 Introduction
57
-
58
- High-quality pre-training data is crucial for enhancing the mathematical reasoning capabilities of large language models (LLMs). However, existing mathematical pre-training data construction schemes have the following shortcomings:
59
-
60
- - **HTML Parsing**: General parsers (such as trafilatura, readability) are mainly designed for news/article parsing, lacking specialized processing for mathematical formulas and other content, often leading to formula structure destruction or loss; meanwhile, mathematical discussions on forum-like pages are difficult to extract completely.
61
- - **Data Quality**: Existing datasets generally lack a systematic quality grading mechanism, with high-value mathematical content mixed with low-quality noise.
62
- - **Data Diversity**: Mainstream datasets mostly originate from textbooks or competition question banks, lacking mathematical discussions and application scenarios in real web pages; synthetic data formats are single, difficult to cover diverse needs such as multi-turn dialogues and multi-style expressions.
63
-
64
- To address these issues, we propose ***UltraData-Math***—a large-scale high-quality pre-training dataset for mathematical reasoning tasks. This dataset is developed based on the [UltraData](https://ultradata.openbmb.cn/blog/position-paper) L0-L4 Tiered Data Management Framework, containing four progressive levels:
65
-
66
- - **L0 Raw Data**: Develops a mathematical parser based on *magic-html*, combined with *w3m* layout preservation rendering and multi-level fallback strategies, standardizing MathML, KaTeX, and AsciiMath into LaTeX format.
67
- - **L1 Filtered Data**: Cleans noise through heuristic rules and performs document-level deduplication.
68
- - **L2 Selected Data**: Uses proprietary large models to annotate seed data and distills it into a lightweight embedding classifier to achieve efficient quality grading of the full corpus.
69
- - **L3 Refined Data**: Produces structured content with clear reasoning through rewriting, synthetic generation, and refinement in various formats such as Q&A, multi-turn dialogues, multi-style rewriting, and knowledge-grounded textbooks.
70
-
71
- Experiments show that on the MiniCPM-1.2B architecture, ***UltraData-Math*** achieves a score of **37.02pp** on the MATH500 benchmark, an improvement of **+3.62pp** compared to Nemotron-CC 4plus; it achieves **61.79pp** on GSM8K, an improvement of **+3.34pp**, while maintaining code generation and general knowledge capabilities.
72
-
73
- ***UltraData-Math*** has been applied to the mathematical pre-training of the [MiniCPM Series](https://huggingface.co/collections/openbmb/minicpm-4-6841ab29d180257e940baa9b) models.
74
-
75
- - **[UltraData-Math-L1](https://huggingface.co/datasets/openbmb/UltraData-Math)**: Large-scale high-quality mathematical pre-training dataset, containing 170.5B tokens of web mathematical corpus.
76
- - **[UltraData-Math-L2](https://huggingface.co/datasets/openbmb/UltraData-Math-L2)**: High-quality mathematical pre-training dataset selected by the quality model, containing 33.7B tokens of high-quality web mathematical corpus.
77
- - **[UltraData-Math-L3](https://huggingface.co/datasets/openbmb/UltraData-Math-L3)**: High-quality refined mathematical dataset, containing 88B tokens of multi-format refined data (Q&A, multi-turn dialogues, knowledge textbooks, etc.).
78
-
79
- ## 🏗️ Data Processing Pipeline
80
-
81
- To break through the limitations of existing mathematical datasets in quality and diversity, we established a refined grading standard centered on "mathematical content integrity" and "information density". ***UltraData-Math*** adopts the **L0-L4 Tiered Data Management Framework** proposed by the [UltraData](https://ultradata.openbmb.cn/blog/position-paper) paper. Through standardized level definitions, it achieves orderly management and efficient flow of mathematical data assets. Each level represents higher data purity and mathematical value, while also corresponding to a more refined degree of processing.
82
-
83
- <div align="center">
84
- <img src="assets/ultradata-math-pipeline.png" width="900"/>
85
- </div>
86
-
87
- ### L0: Raw Data Parsing and Standardization
88
-
89
- **Goal**: Address the poor support of general HTML parsers for mathematical formulas and maximize the preservation of mathematical semantics in web pages.
90
-
91
- The L0 phase mainly processes raw web data obtained from sources such as Common Crawl. Given the specificity of mathematical web pages, we develop specialized parsing strategies through the [UltraData-Math-Parser](https://huggingface.co/spaces/openbmb/UltraData-Math-L0-Parser) instead of directly using general parsers like trafilatura or readability.
92
-
93
- - **Unified Parsing Mode**: Automatically identifies page types to ensure complete content extraction as much as possible.
94
- - **Multi-level Fallback Strategy**: To prevent data loss due to parsing failures, we implement a multi-level fallback mechanism to ensure text content is captured even if structured parsing fails.
95
- - **Mathematical Formula Standardization**: We unify different mathematical expressions in web pages into standard LaTeX format, achieving data format normalization for unified model learning.
96
-
97
- ### L1: Heuristic Cleaning and Filtering
98
-
99
- **Goal**: Remove format noise and improve data readability and standardization.
100
-
101
- After obtaining text containing complete mathematical formulas, we clean the L0 data through a series of heuristic rules:
102
-
103
- - **Format Repair**:
104
- - Clean invisible characters, garbled text, and unnatural continuous line breaks.
105
- - Remove irrelevant web noise such as navigation bars, footers, ad pop-ups, and "read more".
106
- - **Content Filtering**:
107
- - *Length Filtering*: Remove overly short text fragments, which usually lack context and are difficult to support effective mathematical reasoning training.
108
- - *Language Identification*: Ensure the dataset is composed mainly of high-quality English and Chinese mathematical content.
109
- - *Document Deduplication*: Perform deduplication at the document level to prevent duplicate content from biasing model training.
110
-
111
- ### L2: Selection Based on Quality Models
112
-
113
- **Goal**: Identify core corpora with high value from massive data.
114
-
115
- Although L1 data has a clean format, the content quality varies. The L2 phase introduces a model-based quality assessment system:
116
-
117
- - **Seed Data Annotation**: Use proprietary large models to score a portion of seed data across multiple dimensions.
118
- - **Classifier Training and Distillation**: Train lightweight embedding classifiers based on annotated data to equip them with the ability to identify high-value mathematical content.
119
- - **Full-scale Inference**: Use the trained classifier to score and screen L1 data in full.
120
- - *Retention*: Content containing detailed problem-solving steps, mathematical concept explanations, and high-level academic discussions.
121
- - *Exclusion*: Simple stacking of nouns, meaningless lists of numbers, juvenile content, or noise from non-mathematical fields.
122
-
123
- ### L3: Refined Data
124
-
125
- **Goal**: Produce structured content with clear reasoning and explicit educational intent through rewriting, synthetic generation, and refinement, achieving textbook-quality standards and ensuring maximum learnability.
126
-
127
- Natural web data is mostly declarative text, lacking structured reasoning steps and diverse pedagogical formats. To enhance the model's chain-of-thought (CoT) capabilities and multi-turn interaction skills, we build the L3 refined data layer through the [UltraData-Math-Generator](https://huggingface.co/spaces/openbmb/UltraData-Math-L3-Generator):
128
-
129
- - **Q&A Pair Generation**: Use high-performance models to rewrite declarative documents into "Question-Answer" pairs, constructing QA-style data with explicit reasoning steps.
130
- - **Multi-turn Dialogue Synthesis**: Simulate "Teacher-Student" tutoring scenarios to generate multi-turn dialogue data containing follow-up questions, corrections, and guidance.
131
- - **Multi-style Rewriting**: Rewrite single-source data into multiple styles (such as rigorous textbook style, competition problem-solving style, intuitive popular science style) to improve model generalization.
132
- - **Knowledge Point Textbook Generation**: Generate systematic textbook-like content based on specific knowledge points to ensure the model masters core mathematical concepts.
133
- - **Format Repair and Enhancement**: Fix formatting issues in the source data (e.g., broken LaTeX formulas, inconsistent notation) and enhance content coherence to achieve textbook-quality standards.
134
-
135
- Based on the above methodology, we produce the following ***UltraData-Math*** datasets:
136
-
137
- | Dataset | # Tokens | # Documents |
138
- |:---|:---:|:---:|
139
- | UltraData-Math-L1 | 170.5B | 85.6M |
140
- | UltraData-Math-L2-preview | 33.7B | 14.98M |
141
- | UltraData-Math-L3 | 88B | 81.4M |
142
-
143
- ## 🚀 Quick Start
144
-
145
- You can load the dataset directly from Hugging Face:
146
-
147
- ```python
148
- from datasets import load_dataset
149
-
150
- # Load UltraData-Math-L1
151
- ds = load_dataset("openbmb/UltraData-Math", "UltraData-Math-L1")
152
-
153
- # Load UltraData-Math-L2-preview
154
- ds = load_dataset("openbmb/UltraData-Math", "UltraData-Math-L2-preview")
155
-
156
- # Load UltraData-Math-L3 (default: Conversation-Synthetic)
157
- ds = load_dataset("openbmb/UltraData-Math", "UltraData-Math-L3-Conversation-Synthetic")
158
-
159
- # Other L3 configs:
160
- # - UltraData-Math-L3-Multi-Style-Synthetic
161
- # - UltraData-Math-L3-QA-Synthetic
162
- # - UltraData-Math-L3-Textbook-Exercise-Synthetic
163
- ```
164
-
165
- ## 📈 Experimental Results
166
-
167
- We evaluated data quality using the **Decay Verification** method: continuing pre-training of a **MiniCPM-1.2B** base model (pre-trained on 1.3T tokens with **MiniCPM3-4B** tokenizer) with **~100B tokens** (30% target data + 70% general data). We used [OpenCompass](https://github.com/open-compass/opencompass) as our evaluation framework. Evaluation benchmarks include:
168
-
169
- - **General English:** MMLU, ARC-E, ARC-C, BigBench Hard (BBH), CommonSenseQA, HellaSwag, OpenbookQA, PIQA, SIQA, Winogrande
170
- - **General Chinese:** C-Eval, CMMLU
171
- - **Math Reasoning:** MATH500, GSM8K, Math-Bench, R-Bench-Math
172
- - **Code Reasoning:** MBPP, HumanEval
173
-
174
- ### Effectiveness of L0 Parsing Strategy
175
-
176
- To fairly compare different parsing strategies, we conducted experiments on a data subset sampled from the **2023-2024** distribution. We re-parsed the raw HTML from this source using different parsers. This comparison demonstrates the **effectiveness of our L0 Parser** against other parsers.
177
-
178
- <div align="center">
179
- <img src="assets/ultradata-math-l0-parser-comparison.png" width="700"/>
180
- </div>
181
-
182
-
183
- ### Pipeline Effectiveness (L1 vs L2 vs L3)
184
-
185
- To validate the effectiveness of our L0-L3 tiered framework, we conducted ablation studies comparing models trained on different tiers of UltraData-Math. Unlike the L0 parser comparison above (which used a 2023-2024 subset), these results are based on the **full dataset**. Results demonstrate that higher-tier data (L3) significantly boosts mathematical reasoning (MATH500, GSM8K) and general capabilities.
186
-
187
- <div align="center">
188
- <img src="assets/ultradata-math-l1l2l3-comparison.png" width="700"/>
189
- </div>
190
-
191
- ### Full Evaluation Results
192
-
193
- To compare against existing public mathematical pre-training datasets, we trained models independently on each dataset using the same model architecture and training budget (~100B tokens). The baselines include [Nemotron-CC-Math](https://huggingface.co/datasets/nvidia/Nemotron-CC-Math-v1), [MegaMath-Web-Pro](https://huggingface.co/datasets/LLM360/MegaMath), and [FineMath](https://huggingface.co/datasets/HuggingFaceTB/finemath). All models are evaluated under identical conditions for a fair comparison:
194
-
195
- <div align="center">
196
- <img src="assets/ultradata-math-full-comparison.png" width="700"/>
197
- </div>
198
-
199
- ## ❤️ Acknowledgements
200
-
201
- - **L0 Parsing Layer**: [magic-html](https://github.com/opendatalab/magic-html), [w3m](http://w3m.sourceforge.net/), [trafilatura](https://github.com/adbar/trafilatura)
202
- - **L3 Synthesis Layer**: [Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct), [Qwen3-32B](https://huggingface.co/Qwen/Qwen3-32B), [GLM-4.5](https://huggingface.co/zai-org/GLM-4.5)
203
- - **Seed Data**: [Nemotron-CC-Math](https://huggingface.co/datasets/nvidia/Nemotron-CC-Math-v1), [MegaMath](https://huggingface.co/datasets/LLM360/MegaMath), [FineMath](https://huggingface.co/datasets/HuggingFaceTB/finemath)
204
-
205
- ## 📖 Citation
206
-
207
- If you find **UltraData-Math** useful in your research, please consider citing:
208
-
209
- ```bibtex
210
- @misc{ultradata-math,
211
- title={UltraData-Math},
212
- author={UltraData Team},
213
- year={2026},
214
- url={https://huggingface.co/datasets/openbmb/UltraData-Math},
215
- publisher={Hugging Face}
216
- }
217
- ```
218
-
219
- ## 📜 License
220
-
221
- This project is licensed under the [Apache 2.0](./LICENSE) license.
 
1
+ ---
2
+ language:
3
+ - en
4
+ - zh
5
+ license: apache-2.0
6
+ size_categories:
7
+ - 100B<n<1T
8
+ task_categories:
9
+ - text-generation
10
+ pretty_name: UltraData-Math
11
+ arxiv: xxxx.xxxxx
12
+ tags:
13
+ - llm
14
+ - pretraining
15
+ - math
16
+ - data-synthesis
17
+ - data-filtering
18
+ - high-quality
19
+ - mathematical-reasoning
20
+ - mirror
21
+ configs:
22
+ - config_name: UltraData-Math-L3-Conversation-Synthetic
23
+ data_files: data/UltraData-Math-L3/Conversation-Synthetic/*.parquet
24
+ - config_name: UltraData-Math-L3-Multi-Style-Synthetic
25
+ data_files: data/UltraData-Math-L3/Multi-Style-Synthetic/*.parquet
26
+ - config_name: UltraData-Math-L3-QA-Synthetic
27
+ data_files: data/UltraData-Math-L3/QA-Synthetic/*.parquet
28
+ - config_name: UltraData-Math-L3-Textbook-Exercise-Synthetic
29
+ data_files: data/UltraData-Math-L3/Textbook-Exercise-Synthetic/*.parquet
30
+ - config_name: UltraData-Math-L2-preview
31
+ data_files: data/UltraData-Math-L2-preview/**/*.parquet
32
+ - config_name: UltraData-Math-L1
33
+ data_files: data/UltraData-Math-L1/**/*.parquet
34
+ default_config_name: UltraData-Math-L3-Conversation-Synthetic
35
+ ---
36
+ <!-- scbe-status -->
37
+ > **Status: mirror of an upstream dataset.** Not original SCBE work and not an SCBE experiment: this is a copy of the public UltraData-Math corpus (290B+ tokens, 181.2M rows, 552 GB). Kept as a pretraining source. Original SCBE data: [scbe-aethermoore-training-data](https://hf.co/issdandavis/scbe-aethermoore-training-data).
38
+
39
+ # UltraData-Math
40
+
41
+ <div align="center">
42
+ <img src="assets/ultradata-math-logo.png" width="600"/>
43
+ </div>
44
+
45
+ <p align="center">
46
+ <a href="https://huggingface.co/datasets/openbmb/UltraData-Math">🤗 Dataset</a> | <a href="https://github.com/UltraData-OpenBMB/UltraData-Math">💻 Source Code</a> | <a href="https://huggingface.co/datasets/openbmb/UltraData-Math/blob/main/README_ZH.md">🇨🇳 中文 README</a>
47
+ </p>
48
+
49
+ ***UltraData-Math*** is a large-scale, high-quality mathematical pre-training dataset totaling **290B+ tokens** across three progressive tiers—**L1** (170.5B tokens web corpus), **L2** (33.7B tokens quality-selected), and **L3** (88B tokens multi-format refined)—designed to systematically enhance mathematical reasoning in LLMs. It has been applied to the mathematical pre-training of the [MiniCPM Series](https://huggingface.co/collections/openbmb/minicpm4) models.
50
+
51
+ ## 🆕 What's New
52
+
53
+ - **[2026.02.09]**: **UltraData-Math**, a large-scale high-quality mathematical pre-training dataset with 290B+ tokens across three progressive tiers (L1/L2-preview/L3), is now available on Hugging Face. Released as part of the [UltraData](https://ultradata.openbmb.cn/) ecosystem. 🔥🔥🔥
54
+ - **[2026.02.10]**: **UltraData-Math** tops the Hugging Face Datasets Trending list, reaching the #1 spot! ⭐️⭐️⭐️
55
+
56
+ ## 📚 Introduction
57
+
58
+ High-quality pre-training data is crucial for enhancing the mathematical reasoning capabilities of large language models (LLMs). However, existing mathematical pre-training data construction schemes have the following shortcomings:
59
+
60
+ - **HTML Parsing**: General parsers (such as trafilatura, readability) are mainly designed for news/article parsing, lacking specialized processing for mathematical formulas and other content, often leading to formula structure destruction or loss; meanwhile, mathematical discussions on forum-like pages are difficult to extract completely.
61
+ - **Data Quality**: Existing datasets generally lack a systematic quality grading mechanism, with high-value mathematical content mixed with low-quality noise.
62
+ - **Data Diversity**: Mainstream datasets mostly originate from textbooks or competition question banks, lacking mathematical discussions and application scenarios in real web pages; synthetic data formats are single, difficult to cover diverse needs such as multi-turn dialogues and multi-style expressions.
63
+
64
+ To address these issues, we propose ***UltraData-Math***—a large-scale high-quality pre-training dataset for mathematical reasoning tasks. This dataset is developed based on the [UltraData](https://ultradata.openbmb.cn/blog/position-paper) L0-L4 Tiered Data Management Framework, containing four progressive levels:
65
+
66
+ - **L0 Raw Data**: Develops a mathematical parser based on *magic-html*, combined with *w3m* layout preservation rendering and multi-level fallback strategies, standardizing MathML, KaTeX, and AsciiMath into LaTeX format.
67
+ - **L1 Filtered Data**: Cleans noise through heuristic rules and performs document-level deduplication.
68
+ - **L2 Selected Data**: Uses proprietary large models to annotate seed data and distills it into a lightweight embedding classifier to achieve efficient quality grading of the full corpus.
69
+ - **L3 Refined Data**: Produces structured content with clear reasoning through rewriting, synthetic generation, and refinement in various formats such as Q&A, multi-turn dialogues, multi-style rewriting, and knowledge-grounded textbooks.
70
+
71
+ Experiments show that on the MiniCPM-1.2B architecture, ***UltraData-Math*** achieves a score of **37.02pp** on the MATH500 benchmark, an improvement of **+3.62pp** compared to Nemotron-CC 4plus; it achieves **61.79pp** on GSM8K, an improvement of **+3.34pp**, while maintaining code generation and general knowledge capabilities.
72
+
73
+ ***UltraData-Math*** has been applied to the mathematical pre-training of the [MiniCPM Series](https://huggingface.co/collections/openbmb/minicpm-4-6841ab29d180257e940baa9b) models.
74
+
75
+ - **[UltraData-Math-L1](https://huggingface.co/datasets/openbmb/UltraData-Math)**: Large-scale high-quality mathematical pre-training dataset, containing 170.5B tokens of web mathematical corpus.
76
+ - **[UltraData-Math-L2](https://huggingface.co/datasets/openbmb/UltraData-Math-L2)**: High-quality mathematical pre-training dataset selected by the quality model, containing 33.7B tokens of high-quality web mathematical corpus.
77
+ - **[UltraData-Math-L3](https://huggingface.co/datasets/openbmb/UltraData-Math-L3)**: High-quality refined mathematical dataset, containing 88B tokens of multi-format refined data (Q&A, multi-turn dialogues, knowledge textbooks, etc.).
78
+
79
+ ## 🏗️ Data Processing Pipeline
80
+
81
+ To break through the limitations of existing mathematical datasets in quality and diversity, we established a refined grading standard centered on "mathematical content integrity" and "information density". ***UltraData-Math*** adopts the **L0-L4 Tiered Data Management Framework** proposed by the [UltraData](https://ultradata.openbmb.cn/blog/position-paper) paper. Through standardized level definitions, it achieves orderly management and efficient flow of mathematical data assets. Each level represents higher data purity and mathematical value, while also corresponding to a more refined degree of processing.
82
+
83
+ <div align="center">
84
+ <img src="assets/ultradata-math-pipeline.png" width="900"/>
85
+ </div>
86
+
87
+ ### L0: Raw Data Parsing and Standardization
88
+
89
+ **Goal**: Address the poor support of general HTML parsers for mathematical formulas and maximize the preservation of mathematical semantics in web pages.
90
+
91
+ The L0 phase mainly processes raw web data obtained from sources such as Common Crawl. Given the specificity of mathematical web pages, we develop specialized parsing strategies through the [UltraData-Math-Parser](https://huggingface.co/spaces/openbmb/UltraData-Math-L0-Parser) instead of directly using general parsers like trafilatura or readability.
92
+
93
+ - **Unified Parsing Mode**: Automatically identifies page types to ensure complete content extraction as much as possible.
94
+ - **Multi-level Fallback Strategy**: To prevent data loss due to parsing failures, we implement a multi-level fallback mechanism to ensure text content is captured even if structured parsing fails.
95
+ - **Mathematical Formula Standardization**: We unify different mathematical expressions in web pages into standard LaTeX format, achieving data format normalization for unified model learning.
96
+
97
+ ### L1: Heuristic Cleaning and Filtering
98
+
99
+ **Goal**: Remove format noise and improve data readability and standardization.
100
+
101
+ After obtaining text containing complete mathematical formulas, we clean the L0 data through a series of heuristic rules:
102
+
103
+ - **Format Repair**:
104
+ - Clean invisible characters, garbled text, and unnatural continuous line breaks.
105
+ - Remove irrelevant web noise such as navigation bars, footers, ad pop-ups, and "read more".
106
+ - **Content Filtering**:
107
+ - *Length Filtering*: Remove overly short text fragments, which usually lack context and are difficult to support effective mathematical reasoning training.
108
+ - *Language Identification*: Ensure the dataset is composed mainly of high-quality English and Chinese mathematical content.
109
+ - *Document Deduplication*: Perform deduplication at the document level to prevent duplicate content from biasing model training.
110
+
111
+ ### L2: Selection Based on Quality Models
112
+
113
+ **Goal**: Identify core corpora with high value from massive data.
114
+
115
+ Although L1 data has a clean format, the content quality varies. The L2 phase introduces a model-based quality assessment system:
116
+
117
+ - **Seed Data Annotation**: Use proprietary large models to score a portion of seed data across multiple dimensions.
118
+ - **Classifier Training and Distillation**: Train lightweight embedding classifiers based on annotated data to equip them with the ability to identify high-value mathematical content.
119
+ - **Full-scale Inference**: Use the trained classifier to score and screen L1 data in full.
120
+ - *Retention*: Content containing detailed problem-solving steps, mathematical concept explanations, and high-level academic discussions.
121
+ - *Exclusion*: Simple stacking of nouns, meaningless lists of numbers, juvenile content, or noise from non-mathematical fields.
122
+
123
+ ### L3: Refined Data
124
+
125
+ **Goal**: Produce structured content with clear reasoning and explicit educational intent through rewriting, synthetic generation, and refinement, achieving textbook-quality standards and ensuring maximum learnability.
126
+
127
+ Natural web data is mostly declarative text, lacking structured reasoning steps and diverse pedagogical formats. To enhance the model's chain-of-thought (CoT) capabilities and multi-turn interaction skills, we build the L3 refined data layer through the [UltraData-Math-Generator](https://huggingface.co/spaces/openbmb/UltraData-Math-L3-Generator):
128
+
129
+ - **Q&A Pair Generation**: Use high-performance models to rewrite declarative documents into "Question-Answer" pairs, constructing QA-style data with explicit reasoning steps.
130
+ - **Multi-turn Dialogue Synthesis**: Simulate "Teacher-Student" tutoring scenarios to generate multi-turn dialogue data containing follow-up questions, corrections, and guidance.
131
+ - **Multi-style Rewriting**: Rewrite single-source data into multiple styles (such as rigorous textbook style, competition problem-solving style, intuitive popular science style) to improve model generalization.
132
+ - **Knowledge Point Textbook Generation**: Generate systematic textbook-like content based on specific knowledge points to ensure the model masters core mathematical concepts.
133
+ - **Format Repair and Enhancement**: Fix formatting issues in the source data (e.g., broken LaTeX formulas, inconsistent notation) and enhance content coherence to achieve textbook-quality standards.
134
+
135
+ Based on the above methodology, we produce the following ***UltraData-Math*** datasets:
136
+
137
+ | Dataset | # Tokens | # Documents |
138
+ |:---|:---:|:---:|
139
+ | UltraData-Math-L1 | 170.5B | 85.6M |
140
+ | UltraData-Math-L2-preview | 33.7B | 14.98M |
141
+ | UltraData-Math-L3 | 88B | 81.4M |
142
+
143
+ ## 🚀 Quick Start
144
+
145
+ You can load the dataset directly from Hugging Face:
146
+
147
+ ```python
148
+ from datasets import load_dataset
149
+
150
+ # Load UltraData-Math-L1
151
+ ds = load_dataset("openbmb/UltraData-Math", "UltraData-Math-L1")
152
+
153
+ # Load UltraData-Math-L2-preview
154
+ ds = load_dataset("openbmb/UltraData-Math", "UltraData-Math-L2-preview")
155
+
156
+ # Load UltraData-Math-L3 (default: Conversation-Synthetic)
157
+ ds = load_dataset("openbmb/UltraData-Math", "UltraData-Math-L3-Conversation-Synthetic")
158
+
159
+ # Other L3 configs:
160
+ # - UltraData-Math-L3-Multi-Style-Synthetic
161
+ # - UltraData-Math-L3-QA-Synthetic
162
+ # - UltraData-Math-L3-Textbook-Exercise-Synthetic
163
+ ```
164
+
165
+ ## 📈 Experimental Results
166
+
167
+ We evaluated data quality using the **Decay Verification** method: continuing pre-training of a **MiniCPM-1.2B** base model (pre-trained on 1.3T tokens with **MiniCPM3-4B** tokenizer) with **~100B tokens** (30% target data + 70% general data). We used [OpenCompass](https://github.com/open-compass/opencompass) as our evaluation framework. Evaluation benchmarks include:
168
+
169
+ - **General English:** MMLU, ARC-E, ARC-C, BigBench Hard (BBH), CommonSenseQA, HellaSwag, OpenbookQA, PIQA, SIQA, Winogrande
170
+ - **General Chinese:** C-Eval, CMMLU
171
+ - **Math Reasoning:** MATH500, GSM8K, Math-Bench, R-Bench-Math
172
+ - **Code Reasoning:** MBPP, HumanEval
173
+
174
+ ### Effectiveness of L0 Parsing Strategy
175
+
176
+ To fairly compare different parsing strategies, we conducted experiments on a data subset sampled from the **2023-2024** distribution. We re-parsed the raw HTML from this source using different parsers. This comparison demonstrates the **effectiveness of our L0 Parser** against other parsers.
177
+
178
+ <div align="center">
179
+ <img src="assets/ultradata-math-l0-parser-comparison.png" width="700"/>
180
+ </div>
181
+
182
+
183
+ ### Pipeline Effectiveness (L1 vs L2 vs L3)
184
+
185
+ To validate the effectiveness of our L0-L3 tiered framework, we conducted ablation studies comparing models trained on different tiers of UltraData-Math. Unlike the L0 parser comparison above (which used a 2023-2024 subset), these results are based on the **full dataset**. Results demonstrate that higher-tier data (L3) significantly boosts mathematical reasoning (MATH500, GSM8K) and general capabilities.
186
+
187
+ <div align="center">
188
+ <img src="assets/ultradata-math-l1l2l3-comparison.png" width="700"/>
189
+ </div>
190
+
191
+ ### Full Evaluation Results
192
+
193
+ To compare against existing public mathematical pre-training datasets, we trained models independently on each dataset using the same model architecture and training budget (~100B tokens). The baselines include [Nemotron-CC-Math](https://huggingface.co/datasets/nvidia/Nemotron-CC-Math-v1), [MegaMath-Web-Pro](https://huggingface.co/datasets/LLM360/MegaMath), and [FineMath](https://huggingface.co/datasets/HuggingFaceTB/finemath). All models are evaluated under identical conditions for a fair comparison:
194
+
195
+ <div align="center">
196
+ <img src="assets/ultradata-math-full-comparison.png" width="700"/>
197
+ </div>
198
+
199
+ ## ❤️ Acknowledgements
200
+
201
+ - **L0 Parsing Layer**: [magic-html](https://github.com/opendatalab/magic-html), [w3m](http://w3m.sourceforge.net/), [trafilatura](https://github.com/adbar/trafilatura)
202
+ - **L3 Synthesis Layer**: [Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct), [Qwen3-32B](https://huggingface.co/Qwen/Qwen3-32B), [GLM-4.5](https://huggingface.co/zai-org/GLM-4.5)
203
+ - **Seed Data**: [Nemotron-CC-Math](https://huggingface.co/datasets/nvidia/Nemotron-CC-Math-v1), [MegaMath](https://huggingface.co/datasets/LLM360/MegaMath), [FineMath](https://huggingface.co/datasets/HuggingFaceTB/finemath)
204
+
205
+ ## 📖 Citation
206
+
207
+ If you find **UltraData-Math** useful in your research, please consider citing:
208
+
209
+ ```bibtex
210
+ @misc{ultradata-math,
211
+ title={UltraData-Math},
212
+ author={UltraData Team},
213
+ year={2026},
214
+ url={https://huggingface.co/datasets/openbmb/UltraData-Math},
215
+ publisher={Hugging Face}
216
+ }
217
+ ```
218
+
219
+ ## 📜 License
220
+
221
+ This project is licensed under the [Apache 2.0](./LICENSE) license.