LLM training from scratch: 90M → 2.7B on one GPU
Collection
Data cleaning, custom tokenizer, 167-run speedrun, scaling probes, a 2.67B pretrained on one B200 in 38h, then SFT and reasoning. ~300 W&B runs. • 24 items • Updated
n_shards int64 | shard_paths list | total_tokens int64 | samples list |
|---|---|---|---|
100 | [
"mix_000000.bin",
"mix_000001.bin",
"mix_000002.bin",
"mix_000003.bin",
"mix_000004.bin",
"mix_000005.bin",
"mix_000006.bin",
"mix_000007.bin",
"mix_000008.bin",
"mix_000009.bin",
"mix_000010.bin",
"mix_000011.bin",
"mix_000012.bin",
"mix_000013.bin",
"mix_000014.bin",
"mix_000015.bin"... | 10,000,000,000 | [
{
"shard": "mix_000000.bin",
"n_tokens": 100000000,
"n_eot": 125151,
"doc_density": 0.00125151,
"text_excerpt": " soldiers were guarding each gate. In the Muslim quarter, we found snack shops and graffiti. The streets were narrow, paved with stone and the buildings were so old! Wires and lines w... |
A 10-billion-token pretraining dataset, GPT-2 BPE tokenized, assembled as a diverse mix of web text, books, Wikipedia, code, academic papers, Q&A and instruction-formatted conversations.
Built to train a ~500M parameter from-scratch GPT-2-style transformer (see juliannunezb/transformer-lm-500m).
| Source | Mix % | Tokens | Notes |
|---|---|---|---|
| fineweb | 40.4% | 4,039,999,700 | reused from kjj0/fineweb10B-gpt2 |
| fineweb_edu | 15.2% | 1,514,999,900 | reused from karpathy/fineweb-edu-100B-gpt2-token-shards |
| openwebtext | 10.1% | 1,009,999,900 | reused from chanind/openwebtext-gpt2 |
| pg19 | 10.1% | 1,009,999,900 | tokenized from manu/project_gutenberg (en) — Project Gutenberg books |
| wikipedia | 7.6% | 757,499,900 | tokenized from wikimedia/wikipedia config 20231101.en |
| github | 7.6% | 757,499,900 | tokenized from codeparrot/github-code-clean (Python/JavaScript/Go) |
| stackexchange | 5.1% | 505,000,000 | tokenized from HuggingFaceH4/stack-exchange-preferences (Q + top-scoring A) |
| instruct | 4.0% | 405,000,000 | tokenized from teknium/OpenHermes-2.5 + databricks/databricks-dolly-15k |
| Total | 100.0% | 9,999,999,200 |
Each .bin file is an llm.c-compatible shard:
[ header: 256 × int32 ]
offset 0: magic = 20240520
offset 4: version = 1
offset 8: n_tokens = N
offset 12..1023: reserved (zeros)
[ body: N × uint16 token IDs, each < 50257 ]
tiktoken.get_encoding("gpt2") (vocab size 50257).<|endoftext|> (id 50256) separates documents within a shard and also
marks the boundary between sources inside a mixed shard.import numpy as np
from huggingface_hub import hf_hub_download
def load_shard(shard_idx: int) -> np.ndarray:
path = hf_hub_download(
repo_id="juliannunezb/mixed-pretrain-10b-gpt2",
filename=f"mix_{shard_idx:06d}.bin",
repo_type="dataset",
)
with open(path, "rb") as f:
header = np.frombuffer(f.read(1024), dtype=np.int32)
assert header[0] == 20240520 and header[1] == 1
n = int(header[2])
tokens = np.frombuffer(f.read(n * 2), dtype=np.uint16)
return tokens
shard = load_shard(0) # first shard: ~100M uint16 token IDs
print(shard[:20]) # e.g. array([ 464, 368, 2321, ...], dtype=uint16)
Decode back to text with tiktoken:
import tiktoken
enc = tiktoken.get_encoding("gpt2")
print(enc.decode(shard[:200].tolist()))
Built with tokenize_and_mix.py on 2026-04-21 20:24:01 UTC.
Tokenization ran against the HEAD of each source at that time.
kjj0/fineweb10B-gpt2karpathy/fineweb-edu-100B-gpt2-token-shardschanind/openwebtext-gpt2manu/project_gutenberg (split en) — Project Gutenberg bookswikimedia/wikipedia (config 20231101.en)codeparrot/github-code-clean (configs Python-all, JavaScript-all, Go-all)HuggingFaceH4/stack-exchange-preferences — Q + top-scoring answer textteknium/OpenHermes-2.5databricks/databricks-dolly-15k<|endoftext|> (50256).# Path: <repo_path>\n to provide
structural context and are restricted to .py, .js, .ts, .go.User: <instruction>
Assistant: <response>
Dolly entries that include a context field embed it between the user turn
and the assistant turn (see the pipeline script for exact formatting).fineweb → fineweb_edu → openwebtext → pg19 → wikipedia → github → arxiv → stackexchange → instruct, separated by <|endoftext|> at each boundary.0 ≤ token_id < 50257 on every shard (asserts in writer).sanity.json.sanity.json for excerpts.This dataset is a derivative of multiple sources. The most restrictive upstream license governs each subset:
| Source | License |
|---|---|
| FineWeb / FineWeb-Edu | ODC-By 1.0 |
| OpenWebText | CC0 |
| PG-19 | Apache 2.0 (pre-1919 public-domain books) |
| Wikipedia | CC-BY-SA 3.0 / 4.0 |
| RedPajama github | permissive licenses (MIT/BSD/Apache) upstream |
| RedPajama arxiv | arXiv terms of use |
| RedPajama stackexchange | CC-BY-SA 4.0 |
| OpenHermes 2.5 | varies per upstream (see dataset card) |
| Databricks Dolly 15k | CC-BY-SA 3.0 |
Redistribute accordingly. This dataset is intended for research and pretraining of open language models.