This skill helps you curate high-quality fine-tuning data for LLMs by enforcing quality, formatting, and distribution guidelines.
npx playbooks add skill sundial-org/skills --skill training-data-curation
Best practices for gathering and preparing training data for LLM fine-tuning.
Quality over quantity. Llama 2 used only 27,540 high-quality SFT examples and outperformed models trained on larger noisy datasets [[1]](#references). Focus on clean, diverse, well-formatted data.
Garbage in, garbage out. The model will learn patterns from your data—including errors, biases, and formatting issues. Inspect samples manually before training.
Match the target distribution. Training data should reflect the tasks and style you want the model to perform. If you want formal responses, don't train on casual chat data.
Use the messages format (OpenAI/Anthropic/Tinker standard) [[5]](#references):
{"messages": [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]}
{"role": "system", "content": "..."}Requires paired comparisons [[2]](#references):
{"prompt": "...", "chosen": "...", "rejected": "..."}
chosen and rejected must respond to the same promptFor KTO, pairs aren't required—just binary labels on completions [[7]](#references):
{"prompt": "...", "completion": "...", "label": true/false}
Needs ranked responses [[1]](#references):
{"prompt": "...", "responses": ["best", "second", "worst"]}
Before training, verify:
| Issue | Detection | Fix | Source |
|-------|-----------|-----|--------|
| Duplicates | Hash-based dedup | Remove exact matches, MinHash for near-dupes | [[3]](#references) |
| Boilerplate | Keyword filter | Remove "subscribe", "cookie policy", etc. | [[8]](#references) |
| Repetitive text | N-gram analysis | Flag if <30% unique trigrams | [[4]](#references) |
| Low-quality text | Alpha ratio | Remove if <50% alphabetic characters | [[8]](#references) |
| Wrong language | Language detection | fastText classifier, filter to target | [[3]](#references) |
| Too short | Length check | Minimum 3-5 sentences, 100+ words for documents | [[8]](#references) |
High quality:
Medium quality:
Use with caution:
| Dataset Size | Use Case | Source |
|--------------|----------|--------|
| 100-1K | Quick experiments, specific behaviors | — |
| 1K-10K | Production SFT, domain adaptation | — |
| 10K-100K | Comprehensive instruction tuning | [[1]](#references) |
| 1M+ preference pairs | Large-scale RLHF | [[1]](#references) |
Llama 2 used ~27K SFT examples and 1M+ preference comparisons [[1]](#references).
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.