Generative AI · Advanced level

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

  1. Write 100 instruction–response pairs for a narrow task (for example rewriting notices into plain language).
  2. Review them for consistency.
  3. Format them with the chat template.
  4. 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

  1. Why use the model's chat template?

    Show answer

    So training matches how the model is prompted in use.

  2. 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.