RedPajama

On this page 7

RedPajama is an open-source initiative that builds and publishes pretraining corpora for large language models, together with models trained on them. In the domain of training data for artificial intelligence, it is best known for RedPajama-Data-1T, a reproduction of the data recipe described for the original LLaMA models, and for RedPajama-Data-V2, a much larger web corpus shipped with precomputed quality signals instead of a single fixed filter.

The project was launched in April 2023 by Together AI with academic and nonprofit partners, including Ontocord.ai, ETH DS3Lab, Stanford CRFM, Hazy Research and MILA. Its central goal was reproducibility: a corpus whose sources, processing scripts and composition are fully documented, so that researchers can study how data choices shape model behavior.

How RedPajama-Data-1T reproduces a known recipe

RedPajama-Data-1T recreates the mixture of seven source slices that the LLaMA paper reported, reaching roughly 1.2 trillion tokens in total. Each slice was collected and cleaned with open scripts, so anyone can rebuild the corpus or swap one component for another.

The table below lists the approximate token counts per slice, which show that filtered web text dominates the mixture while curated sources add specialized knowledge.

SliceApproximate tokensMain processing
CommonCrawl878 billionCCNet pipeline, quality classifier
C4175 billionStandard C4 cleaning rules
GitHub59 billionLicense filter, file-level deduplication
Books26 billionPublic-domain books, near-duplicate removal
arXiv28 billionLaTeX cleanup, preamble removal
Wikipedia24 billionTwenty languages, boilerplate removal
StackExchange20 billionTop sites, question and answer pairs
Approximate composition of RedPajama-Data-1T

The web portion was processed with CCNet, which splits pages by language, removes duplicate paragraphs and scores text by perplexity under a reference language model. A linear classifier then kept pages that resembled Wikipedia-referenced content, which approximates the quality filtering used for LLaMA.

RedPajama-Data-V2 and its quality signals

RedPajama-Data-V2, released in October 2023, takes a different approach: it ships raw-but-annotated web data and leaves the final filtering decision to the user. It covers 84 CommonCrawl snapshots and five languages, namely English, French, German, Spanish and Italian, with over 100 billion documents.

After exact and fuzzy deduplication, the released head and middle partitions hold roughly 30 trillion tokens. Every document carries more than 40 quality annotations, such as perplexity scores, word counts, repetition ratios, rule-based heuristics from C4 and Gopher, and classifier scores, plus MinHash signatures for further near-duplicate removal.

The following table groups these signals by purpose, which helps when designing a custom filtering recipe.

Signal familyExamplesTypical use
Natural language heuristicsWord count, mean word length, punctuation ratioRemove fragments and lists
Repetition measuresDuplicate n-gram fractions, repeated linesDrop spam and templated pages
Model-based scoresCCNet perplexity, fastText classifiersFavor well-formed prose
Toxicity and content flagsWord-list matches, URL blocklistsReduce harmful content
Deduplication dataMinHash signatures, exact hashesFuzzy deduplication at chosen thresholds
Main families of quality signals in RedPajama-Data-V2

How RedPajama compares with other open corpora

RedPajama belongs to a family of open pretraining corpora that differ mainly in scale, source mix and how much filtering is applied before release. Choosing among them is a question of whether a team wants a ready-made mixture or raw material for its own curation.

CorpusApproximate scaleDistinguishing feature
RedPajama-Data-1T1.2 trillion tokensReproduction of a published mixture
RedPajama-Data-V230 trillion deduplicated tokensAnnotated web data, filtering left to users
The PileAbout 300 billion tokensTwenty-two curated, diverse sources
C4About 156 billion tokensSingle cleaned CommonCrawl snapshot
DolmaAbout 3 trillion tokensDocumented mixture with open tooling
FineWebAbout 15 trillion tokensHeavily ablated web filtering pipeline
RedPajama next to related open datasets

Unlike FineWeb, which publishes one filtered result chosen through ablation experiments, RedPajama-Data-V2 publishes the signals behind such decisions. This makes it suitable for data-centric research, although it requires more engineering effort before training.

Models and practical use

The project also trained the RedPajama-INCITE models with 3 billion and 7 billion parameters, using compute from the INCITE program on the Summit supercomputer. These base, instruction-tuned and chat variants served mainly as evidence that the corpus works rather than as state-of-the-art systems.

In practice, teams use RedPajama in several ways, summarized in the decision table below. The key choice is how much curation work the team is prepared to do itself.

SituationRecommended choiceReason
Replicating a baselineRedPajama-Data-1TFixed, documented mixture
Studying filtering effectsRedPajama-Data-V2 with signalsFilters can be varied cheaply
Multilingual European modelRedPajama-Data-V2 language subsetsFive languages with consistent processing
Small experimentsSampled subsets of either releaseFull corpora need petabyte-scale storage
Choosing a RedPajama release for a project

Limitations and common misconceptions

RedPajama is open but not free of legal and quality risks. Its contents come from public sources, yet the individual documents keep their original copyrights and licenses, so training data licensing must still be assessed for each use.

  • A reproduction is not the original: RedPajama-Data-1T follows the published recipe, but the exact LLaMA data were never released, so results can differ.
  • Unfiltered does not mean unusable: the V2 head and middle partitions are deduplicated, yet they still need user-defined quality filters.
  • Signals are not ground truth: perplexity and classifier scores encode the biases of their reference models and can remove dialects or niche topics.
  • Benchmark contamination is possible: web snapshots may contain test sets, so decontamination checks remain the responsibility of the model builder.
  • The Books slice changed over time: a portion was withdrawn after copyright concerns, so versions of the corpus are not identical.

Stripped to the essentials

Language models learn by reading huge amounts of text. RedPajama is a giant, openly shared library of such text. Anyone can download it and see exactly what went in.

The first version copied a known recipe of text sources. The second version is much larger. It labels each page with quality notes, so each team can decide what to keep. Think of it as a market that sells ingredients with nutrition labels instead of a finished meal.

Where it is applied

A university research group wants to know whether stricter web filtering improves a small language model. It downloads a sample of about 100 billion English tokens from RedPajama-Data-V2, including the quality signals and MinHash signatures, instead of crawling the web itself.

The group builds three subsets: one with only fuzzy deduplication, one that also applies Gopher-style heuristic rules, and one that keeps only documents with low perplexity scores. It then trains three 1-billion-parameter models on 50 billion tokens each and evaluates them on reading comprehension and commonsense benchmarks.

Because every filter is a simple threshold on precomputed signals, the group prepares all three subsets in days rather than weeks. The heuristic subset gives the best average benchmark score, and the team publishes its thresholds so that others can reproduce the result exactly.