Preparing Training Data
The part that decides everything.
A fine tuned model copies your examples, including their mistakes. If your best support replies are mixed in with your worst, it'll learn both. So preparing data is where the real work happens.

- Models copy your examples
- Including the mistakes
- The real work is here
The format
Most tools expect a file with one example per line, called JSONL. Each example is a little conversation. A system message, a user message, and the ideal reply. Run it. Two examples are written out. A real project would have hundreds to thousands, and they'd be reviewed by people who know what a great reply looks like.
import json
examples = [
{"messages": [
{"role": "system", "content": "You are Scribe, the Bright Books assistant."},
{"role": "user", "content": "where's my book"},
{"role": "assistant", "content": "Sorry for the wait! Share your order number and I'll check."}]},
{"messages": [
{"role": "system", "content": "You are Scribe, the Bright Books assistant."},
{"role": "user", "content": "it came torn"},
{"role": "assistant", "content": "I'm so sorry. I'll send a free replacement today."}]},
]
with open("train.jsonl", "w") as f:
for e in examples:
f.write(json.dumps(e) + "\n")
print("Examples:", len(examples))
print(open("train.jsonl").read()[:120], "...")Examples: 2
{"messages": [{"role": "system", "content": "You are Scribe, the Bright Books assistant."}, {"role": "user", "content": ...Five rules for good data
Five rules. Use real conversations, not invented ones. Keep only your best examples. Cover the hard cases, not just the easy ones. Hold back a test set. And remove private information, because a model can repeat what it's seen. A few hundred excellent examples will beat thousands of average ones.
Summary
Your model is only as good as the examples that you give it. Next, how fine tuning works on a modest machine, without retraining billions of weights.
Key takeaways- JSONL conversations
- Quality over quantity
- Remove private data