Pretraining · HuggingFaceFW

Cosmopedia

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

Load it
from datasets import load_dataset
ds = load_dataset("HuggingFaceFW/cosmopedia")
Preview a sample row
{
  "topic": "Newtonian Physics",
  "format": "textbook_chapter",
  "content": "Chapter 3: Laws of Motion. Sir Isaac Newton's three laws of motion describe the relationship..."
}

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.