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-1B-4K

A plug-and-play, pre-tokenized English storytelling dataset with approximately 929 million training tokens and a ready-to-use 4,000-token Byte-Level BPE tokenizer.

Taleweave-1B-4K is designed to make training a language model from scratch as straightforward as possible.

Instead of starting with raw text and spending time collecting stories, cleaning documents, training a tokenizer, encoding the entire dataset, and converting everything into a format suitable for model training, you can start directly with the prepared training data.

The tokenizer is already trained. The stories are already cleaned. The text is already tokenized. The training data is already stored in a ready-to-use binary format.

Download the files, load the tokenizer, memory-map the token stream, and start training.

Taleweave is intended for developers, researchers, students, and anyone experimenting with small language models who wants to spend more time building models and less time preparing datasets.

Why Taleweave?

Preparing a dataset for language-model pretraining can involve several separate steps:

  1. Finding and combining suitable text sources.
  2. Cleaning and filtering raw documents.
  3. Training a tokenizer and defining its vocabulary.
  4. Encoding millions of documents into token IDs.
  5. Adding document boundary tokens.
  6. Converting the resulting token stream into an efficient training format.

Taleweave-1B-4K already handles this preparation.

It provides a consistent dataset and its corresponding tokenizer, so you don't need to repeat the entire preprocessing pipeline before beginning your experiment.

Ready to train, right out of the repository

  • Pre-trained tokenizer: A custom 4,000-token Byte-Level BPE tokenizer is included.
  • Pre-tokenized data: Nearly 930 million tokens are already encoded.
  • Efficient storage: Token IDs are stored as a flat uint16 binary array.
  • Document boundaries: Each story is separated using a dedicated end-of-text token.
  • Consistent vocabulary: The included tokenizer matches the token IDs in the training file.
  • Simple loading: Download the files with huggingface_hub and access the data using NumPy memory mapping.

The goal is simple: download, load, and train.

Dataset Overview

Specification Details
Dataset name Taleweave-1B-4K
Repository AlmostNobody/taleweave-1b-4k
Training tokens 929,495,205
Storage format uint16
Training data size Approximately 1.77 GB
Cleaned stories encoded 2,922,413
Vocabulary size 4,000
Tokenization Byte-Level BPE
Language English
Primary purpose Language-model pretraining
Dataset format Flat binary token stream

Source Datasets

Taleweave combines two English storytelling datasets:

The sources are combined into a 50/50 interleaved training stream. Once the smaller source is exhausted, the remaining stream continues from the larger source.

The resulting collection provides short-form stories and children's fiction for training compact language models.

Repository Contents

File Description Size
train.bin Flat NumPy uint16 array containing 929,495,205 token IDs ~1.77 GB
tokenizer_4k.json Ready-to-use Byte-Level BPE tokenizer ~0.2 MB

Both files are provided together so that the tokenizer and encoded training data can be used immediately.

Tokenizer Specifications

Taleweave-1B-4K uses a custom Byte-Level BPE tokenizer with a vocabulary size of 4,000 tokens.

Property Configuration
Algorithm Byte-Level BPE
Vocabulary size 4,000
add_prefix_space False
Initial alphabet ByteLevel.alphabet()
Tokenizer file tokenizer_4k.json

Special Tokens

Token ID Purpose
<|endoftext|> 0 Document boundary delimiter
<|pad|> 1 Padding token
<|unk|> 2 Unknown token

Text Processing

The source stories were processed through the following pipeline:

  • Removed non-printable control characters while preserving newline (\n) and tab (\t) characters.
  • Collapsed sequences of three or more consecutive newlines into two newlines.
  • Filtered out stories shorter than 40 characters.
  • Encoded the cleaned stories using the custom 4K Byte-Level BPE tokenizer.
  • Appended the end-of-text token after each story.

Data Preparation and Separation

The dataset preparation process separates tokenizer fitting, validation, and training data.

Split Stories / Tokens
Tokenizer fitting 80,000 stories
Held-out validation 13,742 stories
Validation token count 5,000,000
Training stream 929,495,205 tokens

The tokenizer-fitting and validation stories were separated from the training stream before generating the final train.bin file.

Quickstart — Start Training Immediately

You don't need to train a tokenizer or process raw stories. The repository already contains the encoded data and the tokenizer used to produce it.

1. Install dependencies

pip install numpy huggingface_hub tokenizers

2. Download and load Taleweave

import numpy as np
from huggingface_hub import hf_hub_download
from tokenizers import Tokenizer

repo_id = "AlmostNobody/taleweave-1b-4k"

# Download the pre-tokenized training data
train_path = hf_hub_download(
    repo_id=repo_id,
    filename="train.bin",
    repo_type="dataset"
)

# Download the matching tokenizer
tok_path = hf_hub_download(
    repo_id=repo_id,
    filename="tokenizer_4k.json",
    repo_type="dataset"
)

# Load the tokenizer
tokenizer = Tokenizer.from_file(tok_path)

# Memory-map the training token stream
tokens = np.memmap(
    train_path,
    dtype=np.uint16,
    mode="r"
)

print(f"Dataset loaded: {len(tokens):,} tokens")
print(tokenizer.decode(tokens[:120].tolist()))

That's the entire dataset-loading process. Your training pipeline now has access to the prepared token stream.

3. Generate training batches

The flat token stream can be used to construct fixed-length input and target sequences for causal language-model training.

import numpy as np

def get_batch(tokens, batch_size=64, context_length=256):

    starts = np.random.randint(
        0,
        len(tokens) - context_length - 1,
        size=batch_size
    )

    x = np.stack([
        tokens[i:i + context_length]
        for i in starts
    ])

    y = np.stack([
        tokens[i + 1:i + context_length + 1]
        for i in starts
    ])

    return x, y


x, y = get_batch(
    tokens,
    batch_size=64,
    context_length=256
)

print("Input shape:", x.shape)
print("Target shape:", y.shape)

Convert the resulting arrays into tensors and pass them into your preferred PyTorch training loop.

You can now focus on your model architecture, optimizer, training schedule, and experiments instead of spending time building the dataset pipeline.

Other Taleweave Datasets

Looking for the same plug-and-play approach but with a smaller training dataset?

Check out the other dataset in the Taleweave collection:

Taleweave-74M-4K

A smaller version containing approximately 74 million training tokens, using the same 4,000-token Byte-Level BPE tokenizer approach and ready-to-use binary data format.

Dataset Training tokens Best suited for
Taleweave-74M-4K ~74M Smaller experiments and quick prototypes
Taleweave-1B-4K ~929M Larger pretraining runs

Both datasets follow the same general philosophy: provide the prepared tokenized data and matching tokenizer so users can get straight to training.

Intended Applications

Taleweave-1B-4K is designed for:

  • Pretraining decoder-only Transformer models from scratch.
  • Training small and micro language models.
  • Experiments involving training-token budgets and model scaling.
  • Educational projects involving tokenization and language-model training.
  • Research into compact language models.
  • Rapid prototyping of custom language-model architectures.

Created and published by AlmostNobody.(which is me)

Less time preparing data. More time building models.

Downloads last month
-