Datasets for Fine-Tuning
Briefly
The quality of fine-tuning depends more on the data than on the model size. A good dataset consists of clean, diverse examples of «query → correct response».
What is a Fine-Tuning Dataset
This is a set of examples on which the model learns. For SFT, each example typically looks like this:
User request → Expected response
For DPO, an incorrect response is also added.
Data Formats
JSONL
Each line is one example:
{"instruction": "Translate to English", "input": "Hola", "output": "Hello"}
Alpaca-Format
A popular format for instructions:
{"instruction": "Explain the term token", "input": "", "output": "Token is..."}
ShareGPT
A format with dialogue history:
{"conversations": [{"from": "human", "value": "..."}, {"from": "gpt", "value": "..."}]}
Where to Get Data
- Your own examples — the most valuable: real requests and correct responses.
- Synthetic data — ask a strong model to generate examples.
- Public datasets — on Hugging Face.
How to Prepare Data
- Gather examples.
- Remove duplicates.
- Standardize the format.
- Remove junk and errors.
- Check for contradictions.
- Split into train/validation.
How Much Data is Needed
- For a start: 100–1000 high-quality examples.
- For noticeable style changes: 1000–10 000.
- For complex tasks: tens of thousands and more.
The key is not quantity, but quality and diversity.
Common Mistakes
- too uniform examples;
- incorrect responses in the dataset;
- contradictory instructions;
- leakage of test data into training;
- overfitting to a narrow set of phrases.