File size: 1,835 Bytes
b78c6d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: odc-by
language:
- en
size_categories:
- 10B<n<100B
tags:
- byte-level
- language-modeling
- pretraining
---

# FineWeb-Edu as raw bytes (sample-10BT)

[FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu)
(`sample-10BT` config) prepared for **byte-level language modeling**, in the
spirit of [nanoGPT](https://github.com/karpathy/nanoGPT)'s `train.bin` /
`val.bin` — except here there is no tokenizer at all: **one uint8 per UTF-8
byte of text**. ~45 GB total.

Made for training tokenizer-free models (byte-level Transformers,
[H-Nets](https://arxiv.org/abs/2507.07955), etc.) and comparing them against
BPE baselines on identical data.

## Format

Flat binary shards of `uint8`, directly memmap-able:

```
train_00000.bin ... train_000NN.bin   (500 MB each)
val_00000.bin
meta.json
```

- Bytes `0..253`: raw UTF-8 bytes of the text
- Byte `254`: `<|doc|>` document separator (0xFE never occurs in valid UTF-8).
  Every document **starts** with one.
- Byte `255`: reserved, never occurs
- Every 1000th document went to the `val` split; exact document and byte
  counts are in `meta.json`.

## Usage

```python
import numpy as np

shard = np.memmap("train_00000.bin", dtype=np.uint8, mode="r")

# random crop as training example
x = shard[1_000_000 : 1_000_000 + 8192]

# decode back to text
docs = bytes(shard[:100_000]).split(b"\xfe")
print(docs[1].decode("utf-8", errors="replace")[:200])
```

## Provenance

Produced by streaming `HuggingFaceFW/fineweb-edu` `sample-10BT` in order,
encoding each `text` field as UTF-8, and concatenating with separators. No
filtering, shuffling, or other processing was applied (occurrences of bytes
0xFE/0xFF, impossible in valid UTF-8, would be stripped — in practice there
are none). License follows the source dataset (ODC-By, subject to
CommonCrawl ToU).