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
| Provider | HuggingFaceFW |
| Category | Pretraining |
| Size | 25B Tokens |
| License | Apache 2.0 |
| Downloads | 400k |
| Tags | Synthetic, Education, Textbook |
from datasets import load_dataset
ds = load_dataset("HuggingFaceFW/cosmopedia")
Related datasets
- FineWeb — Pretraining or continued pretraining on high-quality English web text
- Python-Edu — Continued pretraining for Python code understanding
- SlimPajama — Efficient English pretraining on a heavily deduplicated corpus
- FineWeb 2 — Pretraining or continued pretraining in languages other than English
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