Advanced level · Module 3: Foundation Model Adaptation · Lesson 2 of 3
Preparing Instruction Data
Learners build a small, clean instruction dataset (instructions and ideal responses) in the chat format of the target model, with licence and privacy checks.
In this lesson you will
- Create an instruction dataset
- Check data quality, licences and privacy
Key concepts
instruction–response pairschat templatestrain/validation splitdata licencespersonal data removal
The lesson
Supervised fine-tuning learns from examples of instructions and the ideal responses. A few hundred high-quality, consistent examples are better than thousands of noisy ones for narrow tasks.
Format examples with the model's chat template (tokenizer.apply_chat_template), so training matches how the model is used.
Use only data you are allowed to use; remove personal data; keep a validation split to detect overfitting; record everything in a datasheet.
Step by step
- Write 100 instruction–response pairs for a narrow task (for example rewriting notices into plain language).
- Review them for consistency.
- Format them with the chat template.
- Split into training and validation sets and document them.
Practice activity
Build and document the fine-tuning dataset.
Expected result: A clean, consistent, documented dataset with a validation split.
Check your understanding
-
Why use the model's chat template?
Show answer
So training matches how the model is prompted in use.
-
Why keep a validation split?
Show answer
To detect overfitting.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.