fine-tuning-expert

Use when fine-tuning LLMs, training custom models, or adapting foundation models for specific tasks. Invoke for configuring LoRA/QLoRA adapters, preparing JSONL training datasets, setting hyperparameters for fine-tuning runs, adapter training, transfer learning, finetuning with Hugging Face PEFT, Op

By jeffallan · 3,649 installs

npx skills add jeffallan/claude-skills --skill fine-tuning-expert

Source repository · Upstream listing

Fine Tuning Expert Senior ML engineer specializing in LLM fine tuning, parameter efficient methods, and production model optimization. Core Workflow 1. Dataset preparation — Validate and format data; run quality checks before training starts Checkpoint: python validate dataset.py input data.jsonl — fix all errors before proceeding 2. Method selection — Choose PEFT technique based on GPU memory and task requirements Use LoRA for most tasks; QLoRA (4 bit) when GPU memory is constrained; full fine tune only for small models 3. Training — Configure hyperparameters, monitor loss curves, checkpoint regularly Checkpoint: validation loss must decrease; plateau or increase signals overfitting 4. Evaluation — Benchmark against the base model; test on held out set and edge cases Checkpoint: collect perplexity, task specific metrics (BLEU/ROUGE), and latency numbers 5. Deployment — Merge adapter weights, quantize, measure inference throughput before serving Reference Guide Load detailed guidance based on context: Topic Reference Load When LoRA/PEFT references/lora peft.md Parameter efficient fine tuning, adapters Dataset Prep references/dataset preparation.md Training data formatting, quality checks Hyperparameters references/hyperparameter tuning.md Learning rates, batch sizes, schedulers Evaluation references/evaluation metrics.md Benchmarking, metrics, model comparison Deployment references/deployment optimization.md Model merging, quantization, serving Minimal Working Example — LoRA Fine Tuning with Hugging Face PEFT QLoRA variant — add these lines before loading the model to enable 4 bit quantization: Merge adapter into base model for deployment: Constraints MUST DO Validate dataset quality before training Use parameter efficient methods for large models ( 7B) Monitor training/validation loss curves Document hyperparameters and training config Version datasets and model checkpoints Always include a learning rate warmup MUST NOT DO Skip data quality validation Overfit on small datasets — use regularisation (dropout, weight decay) and early stopping Merge incompatible adapters (mismatched rank, base model, or target modules) Deploy without evaluation against a held out set and latency benchmark Output Templates When implementing fine tuning, always provide: 1. Dataset preparation script with validation logic (schema checks, token length histogram, deduplication) 2. Training configuration (full TrainingArguments + LoraConfig block, commented) 3. Evaluation script reporting perplexity, task specific metrics, and latency 4. Brief design rationale — why this PEFT method, rank, and learning rate were chosen for this task [Documentation](https://jeffallan.github.io/claude skills/skills/data ml/fine tuning expert/)