Datasets:
GAIR
/

Languages:
English
ArXiv:
Libraries:
License:
MathPile / README.md
SinclairWang's picture
Update README.md
197d855 verified
---
license: cc-by-nc-sa-4.0
extra_gated_prompt: >-
By using this data, you agree to comply with the original usage licenses of
all sources contributing to MathPile. If the source data of this dataset is
subject to a more restrictive license than CC BY-NC-SA 4.0, then this dataset
conforms to that more stringent licensing. In all other scenarios, it is
governed by the CC BY-NC-SA 4.0 license. Access to this dataset is granted
automatically once you accept the license terms and complete all the required
fields below.
extra_gated_fields:
Your Full Name: text
Organization or Entity you are affiliated with: text
Country or state you are located in: text
Your email: text
What is your intended use(s) for this dataset: text
You AGREE to use this dataset for non-commercial use ONLY: checkbox
You AGREE to comply with the original usage licenses of all sources contributing to this dataset and the license of this dataset: checkbox
You AGREE to cite our paper if you use this dataset: checkbox
You ENSURE that the information you have provided is true and accurate: checkbox
language:
- en
size_categories:
- 1B<n<10B
tags:
- croissant
---
<br>
**🔥Update**:
- [2023/01/06] We release the commercial-use version of MathPile, namely [MathPile_Commercial](https://huggingface.co/datasets/GAIR/MathPile_Commercial).
- [2023/01/06] We release the new version (v0.2, cleaner version) of MathPile. It has been updated to the `main` branch (also the `v0.2` branch). The main updates are as follows:
- fixed a problem with the display of mathematical formulas in the Wikipedia subset, which was caused by the HTML conversion to markdown;
- fixed unclosed caption parentheses in the image environment in arXiv and macro command substitutions (as suggested in [issue 1](https://huggingface.co/datasets/GAIR/MathPile/discussions/1)), as well as improper line wrapping in paragraphs.
- If you would like to download the original MathPile, you can download it by setting the `revision` parameter to `v0.1`.
- [2023/12/29] Thanks for your interest in our dataset. We strongly recommend that you complete all the information on the form when applying to facilitate our review process.
<br>
# Dataset Card for Dataset Name
<!-- Provide a quick summary of the dataset. -->
We introduce MathPile a diverse and high-quality math-centric corpus comprising about 9.5 billion tokens. our work is significantly different from the previous work in the following characteristics:
<div align="center">
<img src="./imgs/mathpile-features.png" width=45%/>
</div>
- **Math-centric**: MathPile uniquely caters to the math domain, unlike general domain-focused corpora like Pile and RedPajama, or multilingual-focused ones like ROOTS and The Stack. While there are math-centric corpora, they're often either closed-sourced, like Google's Minerva and OpenAI's MathMix, or lack diversity, such as ProofPile and OpenWebMath.
- **Diversity**: MathPile draws from a wide range of sources: **Textbooks** (including lecture notes), **arXiv**, **Wikipedia**, **ProofWiki**, **StackExchange**, and **Web Pages**. It encompasses mathematical content suitable for K-12, college, postgraduate levels, and math competitions. **This diversity is a first, especially with our release of a significant collection of high-quality textbooks (~0.19B tokens).**
- **High-Quality**: We adhered to the principle of *less is more*, firmly believing in the supremacy of data quality over quantity, even in the pre-training phase. Our meticulous data collection and processing efforts included a complex suite of preprocessing, prefiltering, cleaning, filtering, and deduplication, ensuring the high quality of our corpus.
- **Data Documentation**: To enhance transparency, we've extensively documented MathPile. This includes a **dataset sheet** (see Table 5 in our paper) and **quality annotations** for web-sourced documents, like language identification scores and symbol-to-word ratios. This gives users flexibility to tailor the data to their needs. We've also performed **data contamination detection** to eliminate duplicates from benchmark test sets like MATH and MMLU-STEM.
<div align="center">
<img src="./imgs/mathpile-overview.png" width=70%/>
</div>
## Dataset Details
Refer to Appendix A in [our paper](https://huggingface.co/papers/2312.17120) for the MathPile Dataset Sheet.
### How to download MathPile?
Currently, we recommend that you download it locally from the command line (such as `huggingface-cli`) instead of the python function `load_dataset("GAIR/MathPile")` (due to a possible network issue), unpack the gz file, and then load the jsonl file. Some commands that might be helpful are as follows
```
$ huggingface-cli download --resume-download --repo-type dataset GAIR/MathPile --local-dir /your/path/ --local-dir-use-symlinks False
$ cd /your/path/
$ find . -type f -name "*.gz" -exec gzip -d {} \;
```
Later we will also support the datasets loading via `load_dataset("GAIR/MathPile")`. Stay tuned.
### Dataset Description
<!-- Provide a longer summary of what this dataset is. -->
- **Curated by:** GAIR Lab, SJTU
- **Funded by [optional]:** GAIR Lab, SJTU
- **Language(s) (NLP):** English
- **License:** CC BY-NC-SA 4.0
### Dataset Sources
<!-- Provide the basic links for the dataset. -->
- **Repository:** https://github.com/GAIR-NLP/MathPile
- **Paper [optional]:** https://huggingface.co/papers/2312.17120
- **Demo [optional]:** https://gair-nlp.github.io/MathPile/
## Uses
<!-- Address questions around how the dataset is intended to be used. -->
### Direct Use
To develop mathematical language models.
<!-- This section describes suitable use cases for the dataset. -->
### Out-of-Scope Use
<!-- This section addresses misuse, malicious use, and uses that the dataset will not work well for. -->
This dataset may be not suitable for scenarios unrelated to mathematics or reasoning.
## Dataset Structure
<!-- This section provides a description of the dataset fields, and additional information about the dataset structure such as criteria used to create the splits, relationships between data points, etc. -->
```
{
"text": ...,
"SubSet": "CommomCrawl" | "StackExchange" | "Textbooks" | "Wikipedia" | "ProofWiki" | "arXiv"
"meta": {"language_detection_score": , "idx": , "contain_at_least_two_stop_words": ,
}
```
## Dataset Creation
### Curation Rationale
<!-- Motivation for the creation of this dataset. -->
To create a diverse and high-quality math-centric corpus, thereby enhancing the mathematical reasoning abilities of language models.
### Source Data
<!-- This section describes the source data (e.g. news text and headlines, social media posts, translated sentences, ...). -->
#### Data Collection and Processing
<!-- This section describes the data collection and processing process such as data selection criteria, filtering and normalization methods, tools and libraries used, etc. -->
We sourced data from Textbooks, lecture notes, arXiv, Wikipedia, ProofWiki, StackExchange, and Common Crawl. Throughout the MathPile development, we meticulously source and
gather data, applying a rigorous and math-specific pipeline. This pipeline encompasses various stages such as preprocessing, prefiltering, language identification, cleaning and filtering, and deduplication,
all aimed at maintaining the high quality of the corpus. Please see [our paper](https://arxiv.org/abs/2312.17120) for more details.
### Annotations
<!-- If the dataset contains annotations which are not part of the initial data collection, use this section to describe them. -->
We provided *quantity annotations* (such as language identification scores and the ratio of symbols to words) for documents from Web pages (i.e., Common Crawl and Wikipedia). These annotations offer future researchers and developers
the flexibility to filter the data according to their criteria, tailoring it to their specific needs.
#### Personal and Sensitive Information
<!-- State whether the dataset contains data that might be considered personal, sensitive, or private (e.g., data that reveals addresses, uniquely identifiable names or aliases, racial or ethnic origins, sexual orientations, religious beliefs, political opinions, financial or health data, etc.). If efforts were made to anonymize the data, describe the anonymization process. -->
The corpus may potentially contain academic emails and the author's name, as seen in papers from sources like arXiv. However, we view this as justifiable and within acceptable bounds.
## Bias, Risks, and Limitations
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
- The decisions made during the data collection and processing phases might not always be optimal.
- Some documents in MathPile may not always be of the highest quality. We are committed to continually refining and optimizing this corpus.
### Recommendations
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
Users should be made aware of the risks, biases and limitations of the dataset.
## Citation
<!-- If there is a paper or blog post introducing the dataset, the APA and Bibtex information for that should go in this section. -->
If you find our work useful or use MathPile, please cite our paper:
```
@article{wang2023mathpile,
title={Generative AI for Math: Part I -- MathPile: A Billion-Token-Scale Pretraining Corpus for Math},
author={Wang, Zengzhi and Xia, Rui and Liu, Pengfei},
journal={arXiv preprint arXiv:2312.17120},
year={2023}
}
```
## Dataset Card Authors
[Zengzhi Wang](https://scholar.google.com/citations?user=qLS4f-8AAAAJ&hl=en)
## Dataset Card Contact
stefanpengfei@gmail.com, zzwang.nlp@gmail.com