Datasets:
Update README.md
Browse files10 unmodified lines1112131415163 unmodified lines2021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888910 unmodified lines- pretraining- gpt2- tokenizedconfigs:- config_name: defaultdata_files:3 unmodified lines# Stew-10B**10,000,000,000 GPT-2 tokens** pre-tokenized and packaged for language-modelpretraining. Available in **two formats** in this repo:| Format | Location | Size | Rows | Best for ||---|---|---|---|---|| **Parquet** (primary) | `data/*.parquet` | 14.55 GB | 4,882,800 | HF `datasets`, streaming, dataset viewer || **Raw uint16 binary** | `data_bin/*.bin` | 18.63 GB | — | nanoGPT-style training, zero-copy `memmap` |Both formats contain the exact same token stream — the parquet files are are-packaging of the `.bin` shards into fixed-length token windows of **2048 tokens** per row.## Mixture (10B tokens)| Source | Config | Share ||---|---|---|| `wikimedia/wikipedia` | `20231101.en` | 25% (2.5B) || `openbmb/Ultra-FineWeb` | `en` | 50% (5.0B) || `mlfoundations/dclm-baseline-1.0` | — | 25% (2.5B) |- Tokenizer: `gpt2` (fast / Rust BPE), vocab size 50257- Every document is terminated with `<|endoftext|>` (token id `50256`)- 20 shards, named `train-XXXXX-of-00020.{parquet,bin}`## Loading — Parquet (recommended)```pythonfrom datasets import load_datasetds = load_dataset("wonder-ai/Stew-10B", split="train", streaming=True)for ex in ds:tokens = ex["input_ids"] # list of 2048 intsbreak```Schema:- `input_ids`: `fixed_size_list<int32>[2048]` — one training window per row## Loading — Raw binary (fastest for training)```pythonimport numpy as npfrom huggingface_hub import hf_hub_downloadpath = hf_hub_download("wonder-ai/Stew-10B","data_bin/train-00000-of-00020.bin",repo_type="dataset",)tokens = np.memmap(path, dtype=np.uint16, mode="r")print(tokens.shape, tokens[:16])```Each `.bin` is a flat little-endian `uint16` stream; the full set reconstructsto 10,000,000,000 tokens in order.## Reconstruction noteThe parquet files were generated from the `.bin` files by reshaping the token stream into 2048-token rows (any trailing tokens that did not fill a full row were dropped per shard).Document boundaries are preserved in both formats via the EOS token.## LicensingEach source retains the licensing of its upstream dataset. Please consult theoriginal dataset cards before use:- Wikipedia: CC BY-SA 3.0 / GFDL- Ultra-FineWeb: see `openbmb/Ultra-FineWeb`- DCLM: see `mlfoundations/dclm-baseline-1.0`10 unmodified lines111213141516173 unmodified lines2122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915010 unmodified lines- pretraining- gpt2- tokenized- pre-tokenizedconfigs:- config_name: defaultdata_files:3 unmodified lines# Stew-10BA 10-billion-token pretraining dataset for language models, already tokenized and ready to feed straight into a training loop.## "Why am I just seeing numbers?"If you opened the dataset viewer and saw rows that look like this:```[464, 2159, 3666, 318, 257, 1332, 286, 262, ...]```...that's not a bug. **This dataset doesn't contain text — it contains the token IDs that text was converted into.**Here's what's going on. Before a language model can learn from text, every word (or piece of a word) has to be mapped to a number using a "tokenizer." The sentence `"The world"` becomes something like `[464, 995]` using the GPT-2 tokenizer. Models don't read letters — they read these integer IDs.Most datasets on the Hub ship the raw text and leave tokenization to you. That works, but tokenizing 10 billion tokens worth of text takes **hours of CPU time** every time someone starts a training run. It's wasted work, repeated by everyone.**Stew-10B skips that step.** The text has already been tokenized once, using the standard GPT-2 tokenizer, and the resulting integer IDs are what's stored here. You get:- **Instant training startup** — no tokenization phase, just load and train- **Deterministic data** — every user sees the exact same token stream, so experiments are reproducible- **Smaller download** — token IDs compress better than raw UTF-8 textThe tradeoff is that the data is no longer human-readable in the viewer. If you want to see what a row actually says, you decode it:```pythonfrom transformers import AutoTokenizertok = AutoTokenizer.from_pretrained("gpt2")print(tok.decode([464, 2159, 3666, 318, 257, 1332, 286, 262]))# -> "The World My is a test of the"```## What's actually in each rowEach row in the parquet files contains **one training window of exactly 2,048 tokens** under the column `input_ids`. That's roughly 1,500 words of English text per row, which is a standard context length for pretraining smaller GPT-style models.Rows are packed back-to-back from the original token stream, with documents separated by the special `<|endoftext|>` marker (token ID `50256`). So within a single row you might find the end of one Wikipedia article, the EOS token, and then the start of a web page — this is the standard "packed sequences" format used by nanoGPT, GPT-NeoX, Megatron, and basically every modern pretraining codebase.## Where the text came fromStew-10B is a careful mix of three well-known English pretraining corpora, blended at the token level to hit exact proportions:| Source | Share | Tokens | What it is ||---|---|---|---|| [`wikimedia/wikipedia`](https://huggingface.co/datasets/wikimedia/wikipedia) (`20231101.en`) | 25% | 2.5B | Clean, encyclopedic English — the "high-quality" anchor || [`openbmb/Ultra-FineWeb`](https://huggingface.co/datasets/openbmb/Ultra-FineWeb) (English split) | 50% | 5.0B | Filtered Common Crawl — broad coverage of the open web || [`mlfoundations/dclm-baseline-1.0`](https://huggingface.co/datasets/mlfoundations/dclm-baseline-1.0) | 25% | 2.5B | DataComp-LM baseline — aggressively filtered web text |The mix is designed to balance **quality** (Wikipedia), **diversity** (FineWeb), and **scale-trained signal** (DCLM) in roughly the proportions that have been shown to work well in recent small-model pretraining recipes.## How to use it### Option 1: Hugging Face `datasets` (easy mode)```pythonfrom datasets import load_datasetds = load_dataset("wonder-ai/Stew-10B-tokenized", split="train", streaming=True)for row in ds:tokens = row["input_ids"] # a list of 2048 integers# ...feed into your modelbreak```Streaming is recommended because the full dataset is around 25 GB and you probably don't want all of it on disk at once.### Option 2: Raw binary files (fast mode)If you're running something like nanoGPT and want zero-overhead access, there's a second copy of the data stored as raw `uint16` binary files under `data_bin/`. These are flat token streams you can memory-map directly:```pythonimport numpy as npfrom huggingface_hub import hf_hub_downloadpath = hf_hub_download("wonder-ai/Stew-10B-tokenized","data_bin/train-00000-of-00020.bin",repo_type="dataset",)tokens = np.memmap(path, dtype=np.uint16, mode="r")print(tokens.shape) # (500_000_000,)print(tokens[:16]) # first 16 token IDs```Each `.bin` file holds 500 million tokens (1 GB), and there are 20 of them. Concatenated in order, they reconstruct the full 10-billion-token stream.## File layout```wonder-ai/Stew-10B-tokenized/├── data/ ← the parquet files (what `datasets` loads)│ ├── train-00000-of-00020.parquet│ ├── train-00001-of-00020.parquet│ └── ... (20 files total)└── data_bin/ ← same tokens as raw uint16 binary├── train-00000-of-00020.bin├── train-00001-of-00020.bin└── ... (20 files total)```Both folders contain the same tokens in the same order. Pick whichever format fits your pipeline.## Technical details- **Tokenizer:** `gpt2` (the fast / Rust implementation from `tokenizers`)- **Vocabulary size:** 50,257- **End-of-document marker:** `<|endoftext|>` (token ID `50256`), inserted after every document- **Sequence length (parquet):** 2,048 tokens per row- **Total tokens:** 10,000,000,000 (exact — enforced during the build)- **Total parquet rows:** approximately 4,882,812- **Parquet schema:** `input_ids: fixed_size_list<int32>[2048]`- **Parquet compression:** zstd level 3- **Binary format:** little-endian `uint16`, no header, no padding## LicensingThis dataset is a derivative work combining three upstream sources. **Each source retains its original license** — you are responsible for complying with all of them if you use this dataset:- **Wikipedia** → CC BY-SA 3.0 and GFDL ([details](https://huggingface.co/datasets/wikimedia/wikipedia))- **Ultra-FineWeb** → see the [original dataset card](https://huggingface.co/datasets/openbmb/Ultra-FineWeb)- **DCLM-baseline** → see the [original dataset card](https://huggingface.co/datasets/mlfoundations/dclm-baseline-1.0)No additional restrictions are imposed by this repository, but the dataset is marked `license: other` because the upstream licenses are mixed and you need to read them yourself before any downstream use.## CitationIf you use Stew-10B in research, please cite the three underlying datasets. This repository is a repackaging and does not claim original authorship of the text content.
README.md+97-36