--- license: other language: - en task_categories: - text-generation tags: - gpt2 - tokenized - long-context - pretraining size_categories: - 10B`-like text as ordinary tokens. Each of the 288 shards has three files under `/`: | file | dtype | contents | |---|---|---| | `part_XX.bin` | `uint16` | GPT-2 token ids, documents concatenated, no separator | | `part_XX.idx.npy` | `int64` | cumulative offsets, length `ndocs + 1` | | `part_XX.meta.json` | - | per-shard document count, token count, verification counters | Token ids fit `uint16` losslessly since the GPT-2 vocabulary is 50,257 < 65,536. **No EOT separator is inserted.** Document boundaries are carried exactly by the index, so a packing step must insert its own delimiter if one is needed. ## Usage ```python import numpy as np stem = "b1_4096_8192/part_00" idx = np.load(stem + ".idx.npy") # int64, ndocs+1 tok = np.memmap(stem + ".bin", dtype=np.uint16, mode="r") # uint16 stream n_docs = len(idx) - 1 doc_0 = tok[idx[0]:idx[1]] # document 0 as a uint16 array of token ids import tiktoken enc = tiktoken.get_encoding("gpt2") print(enc.decode(doc_0.tolist())[:200]) ``` To iterate every document in a shard: ```python for i in range(len(idx) - 1): doc = tok[idx[i]:idx[i + 1]] ``` ## Verification Every document in the source corpus carries a pre-computed `gpt2_tokens` count. Each document's re-tokenized length was compared against it: - **0 count mismatches across all 3,348,783 documents** in these three buckets (and 0 across all 74,643,792 documents of the full 7-bucket corpus). - Document and token totals are an exact match to the corpus `summary.tsv`. - Index integrity checked per shard: `len(bin) == idx[-1]`, `idx[0] == 0`, `idx` strictly increasing, `max(token_id) < 50257`. - Exact text roundtrip: `enc.decode(bin[idx[i]:idx[i+1]])` is byte-identical to the source `content` field on sampled documents from every bucket. ## Not included The other four buckets of the corpus exist but are not published here: `b0_lt_4096` (71.25 M docs, 73.59 B tokens), `b4_32768_65536`, `b5_65536_131072`, `b6_gte_131072`. ## Provenance Derived from CommonCrawl via the DCLM and BETR filtering pipelines, then deduplicated. Records retain their original scores and metadata upstream; only the token ids are published here. Respect the licensing and terms of the underlying CommonCrawl data.