Fine-Tuning
by @ivangdavila
Fine-tune LLMs with data preparation, provider selection, cost estimation, evaluation, and compliance checks.
clawhub install fine-tuningπ About This Skill
name: Fine-Tuning slug: fine-tuning description: Fine-tune LLMs with data preparation, provider selection, cost estimation, evaluation, and compliance checks.
When to Use
User wants to fine-tune a language model, evaluate if fine-tuning is worth it, or debug training issues.
Quick Reference
| Topic | File |
|-------|------|
| Provider comparison & pricing | providers.md |
| Data preparation & validation | data-prep.md |
| Training configuration | training.md |
| Evaluation & debugging | evaluation.md |
| Cost estimation & ROI | costs.md |
| Compliance & security | compliance.md |
Core Capabilities
1. Decide fit β Analyze if fine-tuning beats prompting for the use case 2. Prepare data β Convert raw data to JSONL, deduplicate, validate format 3. Select provider β Compare OpenAI, Anthropic (Bedrock), Google, open source based on constraints 4. Estimate costs β Calculate training cost, inference savings, break-even point 5. Configure training β Set hyperparameters (learning rate, epochs, LoRA rank) 6. Run evaluation β Compare fine-tuned vs base model on task-specific metrics 7. Debug failures β Diagnose loss curves, overfitting, catastrophic forgetting 8. Handle compliance β Scan for PII, configure on-premise training, generate audit logs
Decision Checklist
Before recommending fine-tuning, ask:
Fine-Tune vs Prompt Decision
| Signal | Recommendation | |--------|----------------| | Format/style inconsistency | Fine-tune β | | Missing domain knowledge | RAG first, then fine-tune if needed | | High inference volume (>100K/mo) | Fine-tune for cost savings | | Requirements change frequently | Stick with prompting | | <50 quality examples | Prompting + few-shot |
Critical Rules
Common Pitfalls
| Mistake | Fix | |---------|-----| | Training on inconsistent data | Manual review of 100+ samples before training | | Learning rate too high | Start with 2e-4 for SFT, 5e-6 for RLHF | | Expecting new knowledge | Fine-tuning adjusts behavior, not knowledge β use RAG | | No baseline comparison | Always test base model on same eval set | | Ignoring forgetting | Mix 20% general data to preserve capabilities |
β‘ When to Use
User wants to fine-tune a language model, evaluate if fine-tuning is worth it, or debug training issues.