Step 3: Build a small instruction dataset (starter set)
This is where the real work begins. Your dataset is the single most important part of this project. A small, high-quality dataset will outperform a large, messy one every time. So we're going to start small—really small—and focus on quality over quantity.
The goal here is to create a set of instruction-response pairs that reflect the behavior you want your model to learn. If you want your model to write concise, helpful explanations, then every example in your dataset should be a concise, helpful explanation. If you want it to respond in a friendly, conversational tone, then every example should use that tone. Consistency is everything.
Create a file at data/raw.json and start writing examples. Here's a minimal starter set to give you a sense of the format:
[ { "instruction": "Explain gradient accumulation in simple terms.", "input": "", "output": "Gradient accumulation lets you train with a small batch size by adding gradients over several steps before updating the model. It's like pretending you used a bigger batch without needing more GPU memory." }, { "instruction": "Summarize this text in one sentence.", "input": "Instruction tuning teaches a model to follow prompts more reliably by training on instruction-response examples.", "output": "Instruction tuning improves prompt-following by training models on examples of instructions paired with ideal responses." }, { "instruction": "Write a polite customer support reply.", "input": "Customer says: 'My package arrived damaged. What do I do?'", "output": "I'm sorry your package arrived damaged. Please send us a photo of the item and packaging, and we'll help you with a replacement or refund as quickly as possible." }]Each example has three fields:
instruction: What you want the model to do. This should be clear and specific.input: Optional context or additional information. If the instruction is self-contained, you can leave this empty.output: The ideal response. This is what the model will learn to generate.
Notice how these examples are short, focused, and consistent in tone. That's intentional. When you're starting out, it's better to have 50 really good examples than 500 mediocre ones. You can always add more later.
Important: This project works best if your dataset has a consistent "voice." If you want a calm, helpful tone, keep that tone in every output. If you want a formal, technical tone, keep that tone in every output. Mixing tones in the same dataset will confuse the model, especially when it's small.
For your first training run, aim for 100–500 examples. That might sound like a lot to write manually, but you can scale later. Once you've proven the pipeline works with a small dataset, you can expand it by:
- Writing more examples yourself
- Using a larger model (like GPT-4) to generate synthetic examples, which you then review and edit
- Adapting existing datasets (like Alpaca or Dolly) to match your tone and use case
But for now, focus on getting 50–100 high-quality examples written. This will be enough to see real improvement in your model's behavior, and it will give you a baseline to iterate from.
One more tip: as you write examples, ask yourself, "Would I be happy if the model generated this exact response?" If the answer is no, revise the output until it's something you'd be proud to ship. Your model will only be as good as the examples you give it.