[ ABORT TO HUD ]
SEQ. 1
SEQ. 2
SEQ. 3
When & How to Fine-Tune
Customizing Model Behavior
Fine-tuning trains an existing OpenAI model on your own dataset to customize its behavior, tone, format, or domain knowledge. It does NOT add new knowledge - it adjusts HOW the model responds.
Decision Framework
| Try First | Then Try | Last Resort |
|---|---|---|
| Prompt Engineering | RAG (Retrieval) | Fine-Tuning |
| 90% of use cases | Domain knowledge | Behavior/format changes |
Fine-Tuning Workflow
- Prepare Data: Create a JSONL file of example conversations
- Upload: Upload the training file via the Files API
- Train: Create a fine-tuning job specifying the base model
- Evaluate: Test the fine-tuned model against your eval set
- Deploy: Use your custom model ID in API calls
// Training data format (JSONL):
{"messages": [
{"role": "system", "content": "You are a concise legal assistant."},
{"role": "user", "content": "Summarize this contract clause..."},
{"role": "assistant", "content": "Key terms: ..."}
]}
// Create fine-tuning job:
const job = await openai.fineTuning.jobs.create({
training_file: "file-abc123",
model: "o3-mini-mini",
hyperparameters: { n_epochs: 3 }
});
Best Practices
- Start with 50-100 high-quality examples - quality over quantity
- Always create a validation set (20% of data) to detect overfitting
- Fine-tune the smallest model that meets your needs (Mini > Pro)
- Use checkpoints to save intermediate states
🎯 Rule: Fine-tuning is for changing behavior/format, NOT for adding knowledge. Use RAG for knowledge injection.
⌨ HANDS-ON LABLaunch a Fine-Tuning Job
⭐ +200 XPPrompt engineering got you 90% there - the tone is still wrong. Run the full fine-tuning workflow: upload training data, create the job, poll until your custom model exists.
1Upload your JSONL training file to the Files API with purpose fine-tune.
2Create the fine-tuning job pointing at your uploaded file and a base model.
3Poll the job until it succeeds and note the fine_tuned_model ID you'll use in production.
OBJECTIVE 1 / 3 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 3
What should you try BEFORE fine-tuning?
Nothing - always fine-tune first
Prompt engineering and RAG - they solve 90%+ of use cases without fine-tuning costs
Switching to a different provider
Rebuilding from scratch