File size: 3,398 Bytes
0bf36fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
license: other
language:
- en
task_categories:
- text-generation
tags:
- gpt2
- tokenized
- long-context
- pretraining
size_categories:
- 10B<n<100B
---

# BluScriptCP tokenized token buckets (b1, b2, b3)

Pre-tokenized GPT-2 data for long-context training in the BluScriptCP / Context
Parallelism project. These are the three mid-length buckets of a token-bucketed,
deduplicated CommonCrawl-derived corpus (`new_full_2025_51+47`, dclm+betr).

Documents are bucketed by GPT-2 token length into half-open ranges `[lo, hi)`.
Only b1, b2 and b3 are published here.

| bucket | token range | shards | documents | GPT-2 tokens | size |
|---|---|---|---|---|---|
| `b1_4096_8192` | [4,096, 8,192) | 96 | 2,571,614 | 13,977,775,051 | 28.0 GB |
| `b2_8192_16384` | [8,192, 16,384) | 96 | 634,512 | 6,990,738,341 | 14.0 GB |
| `b3_16384_32768` | [16,384, 32,768) | 96 | 142,657 | 3,027,863,374 | 6.1 GB |
| **total** | | **288** | **3,348,783** | **23,996,376,766** | **48.1 GB** |

## Format

Tokenizer is `tiktoken` encoding `gpt2` (vocab 50,257), applied with
`encode_ordinary`, which treats `<|endoftext|>`-like text as ordinary tokens.

Each of the 288 shards has three files under `<bucket>/`:

| 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.