Datasets:
task_categories:
- text-generation
language:
- en
- de
- fr
- es
- it
pretty_name: Red Pajama V2 Data Foundation
Getting Started
The full RedPajama-V2 dataset is a data foundation that includes over 100B text documents coming from 84 CommonCrawl snapshots and processed using the CCNet pipeline. Out of these, there are 30B documents in the corpus that additionally come with quality signals.
Check out our blog post for more details on the build process, dataset structure and schema.
To familiarize yourself with the dataset, you can load the sample dataset using:
from datasets import load_dataset
ds = load_dataset("togethercomputer/RedPajama-Data-V2", name="sample")
To download a the dataset for a specific combination of {partition} x {snapshot_id} x {language}
, you can run
from datasets import load_dataset
ds = load_dataset("togethercomputer/RedPajama-Data-V2",
name="sample",
partition="head_middle",
snapshots=["2023-06", "2022-49"],
languages=["en", "de"])
Alternatively, you can also directly download the files using the following instructions, using English data from the
2023-06
snapshot and the head_middle
partition as an example. The full set of CC snapshots included in the dataset
is given in _CC_SNAPSHOT_IDS
, and the available partitions are tail
and head_middle
. The available language tags
are en
, de
, fr
, es
, it
.
CC_SNAPSHOT="2023-06"
LANG="en"
PARTITION="head_middle"
BASE_URL="https://data.together.xyz/redpajama-data-v2/v1.0.0/"
listings_file="${LANG}-${CC_SNAPSHOT}-${PARTITION}.txt"
wget "${BASE_URL}/listings/${listings_file}"
# download documents
while read line; do
url="${BASE_URL}/documents/${line}.json.gz"
dest="documents/${line}.json.gz"
mkdir -p $(dirname $dest)
wget "$line" -O "$dest"
done <"${LANG}-${CC_SNAPSHOT}-${PARTITION}.txt"
# download other components
COMPS=("quality_signals" "minhash" "duplicates")
for comp in "${COMPS[@]}"; do
while read line; do
url="${BASE_URL}/${comp}/${line}.${comp}.json.gz"
dest="${comp}/${line}.${comp}.json.gz"
mkdir -p $(dirname $dest)
wget "$line" -O "$dest"
done <"${LANG}-${CC_SNAPSHOT}-${PARTITION}.txt"
done
A full set of scripts to recreate the dataset, including the quality signals, can be found here.
Dataset Summary
RedPajama-V2 is an open dataset for training large laguage models and includes over 100B text documents. Out of these, 30B documents come with quality annotations.
Quality Annotations
Annotation Tag | Description | Category | Reference |
---|---|---|---|
ccnet_bucket | head, middle or tail bucket of the perplexity score | ccnet | ccnet |
ccnet_language_score | score of the language identification model | ccnet | ccnet |
ccnet_length | number of characters | ccnet | ccnet |
ccnet_nlines | number of lines | ccnet | ccnet |
ccnet_original_length | number of characters before in-document line deduplication | ccnet | ccnet |
ccnet_original_nlines | number of lines before in-document line deduplication | ccnet | ccnet |
ccnet_perplexity | perplexity of an LM trained on Wikipedia | ccnet | ccnet |
rps_doc_books_importance | Given a bag of {1,2}-wordgram model trained on Books p, and a model trained on the source domain q, This is the logarithm of the ratio p(doc)/q(doc). | ML Heuristics | Importance Resampling (Xie et al.) |
rps_doc_openwebtext_importance | Given a bag of {1,2}-wordgram model trained on OpenWebText p, and a model trained on the source domain q, this is the logarithm of the ratio p(doc)/q(doc). | ML Heuristics | Importance Resampling (Xie et al.) |
rps_doc_wikipedia_importance | Given a bag of {1,2}-wordgram model trained on Wikipedia articles p, and a model trained on the source domain q, this is the logarithm of the ratio p(doc)/q(doc). | ML Heuristics | Importance Resampling (Xie et al.) |
rps_doc_ml_wikiref_score | Fasttext classifier prediction for the document being a Wikipedia reference. This is the same fasttext model used in the RedPajama-1T dataset. Only applies to English data.. | ML Heuristics | LLaMA, RedPajama-1T |
rps_doc_ml_palm_score | Fasttext classifier prediction for the document being a Wikipedia article, OpenWebText sample or a RedPajama-V1 book. Only for English data. | ML Heuristics | PaLM, GLaM |
rps_doc_ml_wikipedia_score | Fasttext classifier prediction for the document being a Wikipedia article. This is used for non-English data | ML Heuristics | - |
rps_doc_curly_bracket | The ratio between the number of occurrences of '{' or '}' and the number of characters in the raw text. | Natural Language | C4 |
rps_doc_frac_all_caps_words | The fraction of words in the content that only consist of uppercase letters. This is based on the raw content. | Natural Language | Pretrainerβs Guide |
rps_doc_frac_lines_end_with_ellipsis | The fraction of lines that end with an ellipsis, where an ellipsis is defined as either "..." or "β¦". | Natural Language | RefinedWeb, Gopher |
rps_doc_frac_no_alph_words | The fraction of words that contain no alphabetical character. | Natural Language | RefinedWeb, Gopher |
rps_doc_lorem_ipsum | The ratio between the number of occurrences of 'lorem ipsum' and the number of characters in the content after normalisation. | Natural Language | C4 |
rps_doc_mean_word_length | The mean length of words in the content after normalisation. | Natural Language | RefinedWeb, Gopher |
rps_doc_stop_word_fraction | The ratio between the number of stop words and the number of words in the document. Stop words are obtained from https://github.com/6/stopwords-json. | Natural Language | RefinedWeb, Gopher |
rps_doc_symbol_to_word_ratio | The ratio of symbols to words in the content.. Symbols are defined "#", "...", and "β¦". | Natural Language | RefinedWeb, Gopher |
rps_doc_frac_unique_words | The fraction of unique words in the content. This is also known as the degeneracy of a text sample. Calculated based on the normalised content. | Natural Language | Pretrainerβs Guide |
rps_doc_unigram_entropy | The entropy of the unigram distribution of the content. This measures the diversity of the content and is computed using sum(-x / total * log(x / total)) where the sum is taken over counts of unique words in the normalised content. | Natural Language | - |
rps_doc_word_count | The number of words in the content after normalisation. | Natural Language | RefinedWeb, Gopher |
rps_lines_ending_with_terminal_punctution_mark | Indicates whether a line ends with a terminal punctuation mark. A terminal punctation mark is defined as one of: ".", "!", "?", "β". | Natural Language | C4 |
rps_lines_javascript_counts | The number of occurrences of the word "javascript" in each line. | Natural Language | C4 |
rps_lines_num_words | The number of words in each line. This is computed based on the normalised text. | Natural Language | C4, RefinedWeb |
rps_lines_numerical_chars_fraction | The ratio between the number of numerical characters and total number of characters in each line. This is based on the normalised content. | Natural Language | RefinedWeb |
rps_lines_start_with_bulletpoint | Whether the lines that start with a bullet point symbol. The following set of unicodes are considered a bullet point: \u2022 (bullet point), \u2023 (triangular bullet point), \u25B6 (black right pointing triangle), \u25C0 (black left pointing triangle), \u25E6 (white bullet point), \u25A0 (black square), \u25A1 (white square), \u25AA (black small square), \u25AB (white small square), \u2013 (en dash). | Natural Language | RefinedWeb, Gopher |
rps_lines_uppercase_letter_fraction | The ratio between the number of uppercase letters and total number of characters in each line. This is based on the raw text. | Natural Language | RefinedWeb |
rps_doc_num_sentences | The number of sentences in the content. This is calculated using the regular expression r'\b[^.!?]+[.!?]*' . |
Natural Language | C4 |
rps_doc_frac_chars_dupe_10grams | The fraction of characters in duplicate word 10grams. This operates on the lower-cased, punctuation removed content. It is also ensured that characters in overlapping ngrams are only counted once. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_frac_chars_dupe_5grams | The fraction of characters in duplicate word 5grams. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_frac_chars_dupe_6grams | The fraction of characters in duplicate word 6grams. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_frac_chars_dupe_7grams | The fraction of characters in duplicate word 7grams. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_frac_chars_dupe_8grams | The fraction of characters in duplicate word 8grams. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_frac_chars_dupe_9grams | The fraction of characters in duplicate word 9grams. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_frac_chars_top_2gram | The fraction of characters in the top word 2gram. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_frac_chars_top_3gram | The fraction of characters in the top word 3gram. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_frac_chars_top_4gram | The fraction of characters in the top word 4gram. | Repetitiveness | RefinedWeb, Gopher |
rps_doc_ldnoobw_words | The number of sequences of words that are contained in the List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words blocklist. The blocklist is obtained from GitHub. | toxicity | C4 |
rps_doc_ut1_blacklist | A categorical id corresponding to the list of categories of the domain of the document. Categories are obtained from the UT1 blacklist. The list is obtained from UT-Capitole. | toxicictiy | RefinedWeb |
Document Counts for the Annotated part of the dataset
en | de | fr | es | it | Total | |
---|---|---|---|---|---|---|
# Documents | 24.5B | 2.7B | 2.2B | 2.3B | 1.2B | 32.9B |
Languages
English, German, French, Italian, Spanish
Dataset Structure
The dataset is structured into four components, each following the same key structure:
βββ documents
βββ 2018-43
βββ 0000
βββ en_head.json.gz
βββ ...
βββ it_middle.json.gz
βββ quality_signals
βββ 2018-43
βββ 0000
βββ en_head.signals.json.gz
βββ ...
βββ it_middle.json.gz
βββ duplicates
βββ 2018-43
βββ 0000
βββ en_head.duplicates.parquet
βββ ...
βββ it_middle.duplicates.parquet
βββ minhash
βββ 2018-43
βββ 0000
βββ en_head.minhash.parquet
βββ ...
βββ it_middle.minhash.parquet
Documents files, which contain the text, folow the schema defined by CCNet, and the quality signals follow the schema
{
"id": "2018-43/0000/en_head.json.gz/0",
"id_int": 7972430436813205988,
"metadata": {
"cc_segment": "crawl-data/...",
"cc_net_source": "2018-43/0000/en_head.json.gz",
"url": "...",
"source_domain": "...",
"language": "en",
"snapshot_id": "2018-43"
},
"quality_signals": {
"ccnet_original_length": [
[
0,
7033,
8711.0
]
],
...,
"rps_doc_stop_word_fraction": [
[
0,
7033,
0.45121107
]
],
"rps_lines_num_words": [
[
0,
25,
2
],
...,
[
6980,
7033,
10
]
]
}
}
where signal scores are encoded as a list of tuples (start, end, score)
, where start
and end
are the locations in
the
raw_content
string where the score
applies.
Dataset Creation
The dataset is based on 84 snapshots provided by Common Crawl.
Citation
To cite RedPajama-V2, please use:
@software{together2023redpajama-v2,
author = {Together Computer},
title = {RedPajama-Data-v2: a living data foundation for training open LLM models},
month = October,
year = 2023,
url = {https://github.com/togethercomputer/RedPajama-Data}
}
License
Please refer to the Common Crawl Foundation Terms of Use for the data. The code used to load and process the dataset is licensed under the Apache 2.0 license.