Skip to content
Courses/Fine-tuning and post-training for LLMs/High-quality instruction datasets

High-quality instruction datasets

Fine-tuning quality depends more on the dataset than on the training command. A small, clean, and representative dataset beats thousands of noisy examples.

  • Create useful instruction examples for SFT.
  • Split train, validation, and test without contaminating results.
  • Remove sensitive data, duplicates, and mediocre responses.

Simple format

Terminal
{"instruction":"Classify the email","input":"Hi, I'd like to change my invoice...","output":"categoria: facturacion\nprioridad: media\naccion: pedir numero de factura"}
{"instruction":"Draft a brief reply","input":"Customer asks for delivery timeframe","output":"Hi, thanks for reaching out. The estimated timeframe is..."}
{"instruction":"Extract fields","input":"Quote for 3 annual licenses","output":"{"producto":"licencia anual","cantidad":3}"}

Cleaning checklist

Controlled synthetic data

Generating examples with another model can speed things up, but treat it as a draft. Each synthetic batch needs a goal, desired distribution, review, and a way to detect duplicates or overly similar phrasing.

Terminal
synthetic_batch:
  goal: "billing support emails"
  count: 200
  variation:
    - angry_tone
    - incomplete_data
    - corrective_invoice
    - out_of_scope_request
  controls:
    real_pii: false
    review_sample: 50
    deduplicate_by_similarity: true
    include_refusals: true

The best synthetic data usually starts from a real taxonomy: categories, frequent errors, tones, constraints, and examples the model must refuse. Without taxonomy, you only produce pretty text.

  • No emails, phone numbers, national IDs, keys, or real names unless you have a legal basis.
  • No duplicate examples between train and test.
  • No contradictory responses for the same instruction.
  • Include real-world errors from the domain, not only perfect cases.
  • Include examples where the model should reject or ask for clarification.
Terminal
dataset/
  train.jsonl
  validation.jsonl
  test.jsonl
  README.md
  data_card.md
  redactions.log
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue