ml-fine-tuning
Installation
SKILL.md
ML Fine-Tuning
Overview
Use this skill for adapting pretrained models to new tasks, domains, styles, instructions, modalities, or constraints. Fine-tuning is not always the right first step: compare prompting, retrieval-augmented generation, feature extraction, classical heads, and smaller task-specific models before training a large foundation model.
Choose the Adaptation Method
| Method | Use when | Trade-offs |
|---|---|---|
| Prompting/system instructions | Behavior change is simple and context fits | No training cost; limited persistence and control |
| RAG | Need factual/domain knowledge that changes or must be cited | Requires retrieval quality, chunking, and grounding evaluation |
| Feature extraction + head | Small labeled dataset and strong pretrained embeddings | Efficient; limited deep adaptation |
| Partial fine-tuning | Need domain adaptation with limited compute | Must choose layers carefully |
| Full fine-tuning | Large dataset, high task specificity, enough compute | Highest cost and forgetting risk |
| LoRA/adapters/PEFT | Need efficient adaptation and many variants | Slight capacity limits; target modules matter |
| QLoRA | Fine-tune large LLMs on constrained GPUs | Quantization and optimizer choices affect stability |
| Preference tuning/RLHF/DPO | Need behavior alignment to preferences | Reward/preference data quality dominates |
| Distillation | Need smaller/faster deployable model | Requires teacher quality and representative data |