Home Knowledge Base Supervised Fine-Tuning (SFT)

Supervised Fine-Tuning (SFT)

What is SFT? Supervised Fine-Tuning trains a pretrained LLM on curated (instruction, response) pairs to follow instructions and produce helpful outputs. It is typically the first step after pretraining.

Data Format

{
  "instruction": "Write a haiku about programming",
  "input": "",
  "output": "Lines of code flow down
Debugging through the night hours
Compiler agrees"
}

Or in conversation format:

{
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Write a haiku about programming"},
    {"role": "assistant", "content": "Lines of code flow down
Debugging through the night hours
Compiler agrees"}
  ]
}

Dataset Recommendations

Dataset Sizes

Use CaseRecommended Size
Domain adaptation1K-10K examples
Instruction following10K-50K examples
Full capability tuning50K-500K examples

Popular Open Datasets

DatasetSizeFocus
OpenAssistant/oasst1161KMulti-turn conversations
Dolly-15K15KDiverse instructions
Alpaca-52K52KGPT-generated instructions
WizardLM196KComplex instruction evolution
CodeAlpaca20KCoding tasks

SFT Best Practices 1. Quality over quantity: 1K excellent examples > 100K mediocre ones 2. Diversity: Cover wide range of tasks and formats 3. Formatting consistency: Same structure across examples 4. Response length: Match desired output length distribution 5. Human review: Verify a sample of training data manually

Training Considerations

supervisedsftfinetune data

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.