Datasets:
Dataset Viewer
The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
FineWeb-Edu — pre-tokenized for fast LM pretraining (Gemma tokenizer, ArrayRecord/Grain)
Pre-tokenized FineWeb-Edu
(sample/100BT), packed into fixed-length sequences and stored as
ArrayRecord shards for zero-overhead
streaming with Grain. No on-the-fly tokenization
at train time — you read int32 tokens straight off disk.
Format
- Tokenizer:
google/gemma-4-12B-it(vocab size 262144). Documents are separated by the EOS token id1. - Packing: the token stream is concatenated (with EOS between documents) and
split into fixed-length records. Each record is 1025
int32tokens = 4100 bytes, i.e.seq_len = 1024plus one extra token so you can build(input, target)by shifting. - Layout:
90 shards,32B tokens total** (~128 GB).shard_00000.arrayrecord … shard_00089.arrayrecord, ~365M tokens each, ** - Each shard's records are independent and order within/across shards is fixed (deterministic), so training is reproducible and resumable by index.
Quick start (Grain)
import glob
import numpy as np
import grain
from huggingface_hub import snapshot_download
# 1. Download the shards locally (Grain reads local ArrayRecord files)
local = snapshot_download(
"mlnomad/fineweb-edu-gemma4-1024",
repo_type="dataset",
allow_patterns=["*.arrayrecord"],
)
shards = sorted(glob.glob(f"{local}/*.arrayrecord"))
SEQ_LEN = 1024 # records are SEQ_LEN + 1 tokens
def decode(record_bytes):
toks = np.frombuffer(record_bytes, dtype=np.int32) # shape [1025]
return {"input_ids": toks[:-1], "labels": toks[1:]} # causal shift
dataset = (
grain.MapDataset.source(grain.ArrayRecordDataSource(shards))
.shuffle(seed=42)
.map(decode)
.batch(batch_size=32)
)
for batch in dataset:
# batch["input_ids"], batch["labels"]: [32, 1024] int32
...
Streaming / resumable iteration
loader = grain.DataLoader(
data_source=grain.ArrayRecordDataSource(shards),
sampler=grain.IndexSampler(
num_records=len(grain.ArrayRecordDataSource(shards)),
shuffle=True, seed=42, num_epochs=None,
),
operations=[grain.MapOperation(decode), grain.BatchOperation(32)],
worker_count=16, # parallel reader threads
)
it = iter(loader)
# loader.checkpoint()/restore lets you resume at the exact record index.
Reading a single shard without Grain
import numpy as np
from array_record.python.array_record_module import ArrayRecordReader
r = ArrayRecordReader("shard_00000.arrayrecord")
rec = r.read([0])[0] # bytes for record 0
toks = np.frombuffer(rec, dtype=np.int32) # [1025] int32 token ids
Notes
- Built from the
sample/100BTsplit of FineWeb-Edu. The trailing<1025-token remainder of each source file is dropped during packing (negligible). - Token ids index the Gemma vocabulary; decode with the
google/gemma-*tokenizer if you need text.
License & attribution
Derived from FineWeb-Edu (HuggingFaceFW/fineweb-edu), released under ODC-By 1.0. This tokenized derivative is provided under the same terms; please cite FineWeb-Edu.
- Downloads last month
- 428