|
--- |
|
license: cc-by-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_Commercial. The MathPile_Commercial is |
|
governed by the CC BY-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 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 |
|
--- |
|
|
|
<br> |
|
|
|
**🔥Update**: |
|
|
|
|
|
- [2024/01/06] We released the commercial-use version of MathPile, namely `MathPile_Commercial`. |
|
<br> |
|
|
|
# Dataset Card for Dataset Name |
|
|
|
<!-- Provide a quick summary of the dataset. --> |
|
|
|
`MathPile_Commercial` is a commercial-use version of [MathPile](https://huggingface.co/datasets/GAIR/MathPile), obtained by culling documents that are prohibited from commercial use in the MathPile (latest version, i.e., `v0.2`). Specifically, we conducted a non-commercial use detection in the source data, utilizing the license information in the metadata for arXiv sources and employing keyword matching for other sources. As a result, we have excluded approximately 8,000 documents from the latest version of MathPile, comprising 7,350 from arXiv, 518 from Creative Commons sources, 68 from textbooks, and 8 from Wikipedia. This version of the dataset contains around 9.2 billion tokens. |
|
|
|
|
|
MathPile is a diverse and high-quality math-centric corpus comprising about 9.5 billion tokens, which is significantly different from the previous work in the following characteristics: |
|
|
|
|
|
<div align="center"> |
|
<img src="./imgs/mathpile-key-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-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 |
|
|
|
|
|
[email protected], [email protected] |
|
|