Cosmopedia — LLM Pretraining Dataset

A dataset of synthetic textbooks, blog posts, and stories generated by Mixtral-8x7B. Designed to convey high-quality educational content.

Dataset Details

ProviderHuggingFaceFW
CategoryPretraining
Size25B Tokens
LicenseApache 2.0
Downloads400k
TagsSynthetic, Education, Textbook
from datasets import load_dataset
ds = load_dataset("HuggingFaceFW/cosmopedia")

Related datasets

Frequently asked questions

Can I use Cosmopedia commercially?
Yes — Cosmopedia is released under Apache 2.0, a permissive license that allows commercial use, including training models you ship in a product. Check the dataset card for attribution requirements before release.
How much data does Cosmopedia contain, and do I need all of it?
Cosmopedia contains 25B Tokens. You rarely need all of it: for style and format fine-tuning, a few hundred to a few thousand examples are enough — load a slice (e.g. split="train[:1000]") and scale up only if quality plateaus.
What is Cosmopedia best used for?
Synthetic-textbook pretraining for small models (the SmolLM recipe). It belongs to the Pretraining section of our dataset hub, where you'll find alternatives and complementary sets.

← All datasets | Fine-Tuning Guide