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.

taleweave-74m-4k

taleweave-74m-4k is a pre-tokenized, 16-bit unsigned integer (uint16) narrative corpus engineered for training compact, sub-10M-parameter language models from scratch with zero runtime tokenization overhead. It interleaves stories from roneneldan/TinyStories and ajibawa-2023/Children-Stories-Collection under a shared 4,000-token Byte-Pair Encoding (BPE) vocabulary.

Key Specifications

Property Specification
Training Corpus (train.bin) 74,000,000 token IDs (uint16, ~148.0 MB raw binary)
Validation Split (val.bin) Held-out evaluation split (uint16), sampled prior to training stream
Tokenizer (tokenizer_4k.json) Byte-Level BPE, vocab_size = 4000
Special Tokens `<|endoftext
Data Access Pattern Flat contiguous token stream designed for np.memmap
Target Scale Micro / tiny causal language models (~1M–10M parameters)

Design Rationale

Sub-10M-parameter language models face strict embedding bottlenecks and compute constraints:

  • Compact Embedding Footprint: Large vocabularies (32K–128K tokens) consume a disproportionate share of parameters in small transformers. A 4,000-token BPE vocabulary keeps embedding and unembedding tables lean so capacity goes into attention and feed-forward layers.
  • Zero-Copy Streaming via np.memmap: Storing token IDs as flat uint16 arrays (2 bytes per token) allows fast, low-memory random window sampling across context lengths (block_size such as 128, 256, or 512) without loading full text corpora into RAM.
  • Controlled Token-Budget Experimentation: Designed as a fixed-tokenizer, fixed-validation foundation for comparing token regimes (such as 150M vs. 1B total token updates) on identical architectures.

Data Pipeline & Preprocessing

  1. Validation Holdout First: Samples are drawn from both roneneldan/TinyStories and ajibawa-2023/Children-Stories-Collection to form a dedicated val.bin split before assembling the training stream, preventing data leakage.
  2. Text Sanitization & Filtering: Strings are stripped of non-printable/non-ASCII control characters, collapsed on excessive blank lines, and filtered to exclude short, low-context fragments.
  3. Tokenizer Training: A 4,000-token Byte-Level BPE tokenizer is fit on a mixed sample of sanitized stories to balance subword coverage across simple and varied narrative prose.
  4. Binary Serialization: Each story is encoded and terminated with <|endoftext|>, then serialized sequentially as little-endian uint16 token IDs up to the 74,000,000-token cap.

Usage Example

import numpy as np
import torch
from tokenizers import Tokenizer

tokenizer = Tokenizer.from_file("tokenizer_4k.json")
train_data = np.memmap("train.bin", dtype=np.uint16, mode="r")
val_data = np.memmap("val.bin", dtype=np.uint16, mode="r")

def get_batch(split: str, block_size: int = 256, batch_size: int = 32, device: str = "cpu"):
    data = train_data if split == "train" else val_data
    max_start = len(data) - block_size - 1
    ix = np.random.randint(0, max_start, size=(batch_size,))
    x = np.stack([data[i : i + block_size].astype(np.int64) for i in ix])
    y = np.stack([data[i + 1 : i + 1 + block_size].astype(np.int64) for i in ix])
    return torch.from_numpy(x).to(device), torch.from_numpy(y).to(device)

xb, yb = get_batch("train", block_size=128, batch_size=4)
print("Batch shapes:", xb.shape, yb.shape)
print("Sample decode:\n", tokenizer.decode(xb[0].tolist()))
Downloads last month
23

Models trained or fine-tuned on AlmostNobody/taleweave-74m-4k