SuperAPI AI Directory

RedPajama-Data

RedPajama-Data is an open-source project maintained by Together Computer that provides code for preparing large-scale datasets used to train large language models. Its RedPajama-V2 dataset contains more than 100 billion text documents from 84 CommonCrawl snapshots, of which 30 billion documents come with quality signals and 20 billion documents have been deduplicated. The repository contains pipeline code for building quality classifiers, computing quality signals, exact and fuzzy deduplication, and supports running with Docker and Apptainer; the dataset is also available on HuggingFace.

Open website

About this tool

RedPajama-Data is an open-source repository for preparing training data for large language models, mainly containing the construction code for the RedPajama-V2 dataset. According to the official description, RedPajama-V2 is an open dataset containing more than 100 billion text documents from 84 CommonCrawl snapshots, processed using the CCNet pipeline. Of these, 30 billion documents come with quality signals and 20 billion documents have been deduplicated. The dataset is also published on HuggingFace. For the code of the RedPajama-1T dataset, refer to the rp_v1 branch of the repository.

In terms of main capabilities, the repository provides a three-stage pipeline: 1) prepare artifacts, including building quality classifiers, training a bag-of-ngram generative model for importance weight computation, obtaining a list of bad words from the LDNOOBW repository, and obtaining the latest blacklist URLs from the UT1 blacklist; 2) compute quality signals, including minhash signatures for subsequent fuzzy deduplication; 3) deduplicate, including content-based exact deduplication (implemented using bloomfilter) and locality-sensitive hashing fuzzy deduplication based on minhash signatures.

In terms of usage, you first need to copy configs/rp_v2.0.conf to, for example, configs/default.conf and configure the environment variables. You can build an image with the provided Dockerfile and run it, or run the scripts in a non-container environment, but the scripts assume that docker and apptainer are installed. Before running, you need to install s5cmd and configure an S3 configuration file in order to pull data from the S3 bucket. If you do not use the provided Docker container to run steps 1 and 2, you need to set the PYTHONHASHSEED environment variable to a consistent value (such as 42) to ensure consistency of the hash function in DSIR weight computation. Step 1 requires first downloading the English Wikipedia reference classifier and placing it at ${DATA_ROOT}/wikiref-model/en/en-model.bin, then running the corresponding command from the repository root, and specifying the path of a list file containing the keys of the ccnet data to be processed; you can set max_workers for the number of parallel processes. This step generates an id for use in the next step. Step 2 requires ensuring that the environment variables are set, then running the quality signal computation command. In the deduplication of step 3, the content-baseddeduplication is implemented in app/src/bloomfilter.py and can run independently of the previous step, but the data needs to be stored in an S3 bucket and run from the app directory. Note that you need to choose the correct capacity (greater than the number of documents), otherwise the error rate cannot be guaranteed and more false positives will occur. This implementation is based on the pybloomfiltermmap3 library. Fuzzy deduplication runs locality-sensitive hashing on the minhash signatures generated in step 1 and needs to use the same configuration as the quality signal step, running from the repository root. The implementation is based on polars and has been tested on 200 million documents on a machine with 64 cores and 500G of memory.

The applicable scenarios are mainly research and engineering teams preparing large-scale text datasets for large language model training, especially users who need to reproduce or perform data cleaning, quality filtering, and deduplication based on the RedPajama-V2 process. In terms of limitations, the official materials do not provide specific details on fees, pricing, platform compatibility, or performance guarantees; running depends on Docker, Apptainer, s5cmd, and S3 storage, and some steps have high computational resource requirements. The use of the dataset itself is subject to the Common Crawl Foundation terms of use, and the complete license terms are in the repository LICENSE file.