AI Hints
Home›Fine-Tuning LLMs Tutorial›Data: Cleaning, Splits and Size
Fine-Tuning LLMs · Lesson 75 of 120

How Much Data?

Enough, but not too much.

⏱ 2 min read▶ Video at 1:55:07🎓 Free
Watch this lesson in the Fine-Tuning LLMs courseWatch on YouTube ↗Full Fine-Tuning LLMs course

Everyone asks this question. How many examples do I need? The honest answer is, it depends. But there are good rules of thumb.

  • How many examples?
  • It depends
  • Good rules of thumb

Rules of thumb

For a format, or a style, like our JSON, a few hundred good examples is often enough. For a narrow skill, like sorting messages, a few hundred to a few thousand. For a hard new skill, many thousands. And for teaching new knowledge, fine-tuning is the wrong tool. Use RAG.

GoalTypical examples
Format or style100s
Narrow task (e.g. intents)100s to 1,000s
Hard new skill10,000s
New knowledgeuse RAG instead

Find out for your task

The best way to know is to measure. Train on one hundred examples, then two hundred, then four hundred. Plot the test score. If it's still rising, more data will help. If it has flattened, more of the same data won't. Improve the variety instead.

keyvalue
Train on100, 200, 400 examples
Measurethe test score each time
Still rising?get more data
Flat?improve variety instead

Summary

Let's recap. A few hundred good examples can teach a format. Narrow tasks need hundreds to thousands. New knowledge belongs in RAG. And measure, by training on growing amounts of data. Next, the system prompt in your training data.

Key takeaways
  • Hundreds for a format
  • Measure with growing data
  • Knowledge → RAG
Next up: System Prompts — in training and in use