All skills
microsoft avatar

/finetuning

@04d245b
by microsoftmicrosoft/skills3.1k stars
351

Fine-tune models on Microsoft Foundry using SFT (supervised), DPO (preference), or RFT (reinforcement with graders). Covers dataset preparation, training job submission, deployment, and evaluation. USE FOR: fine-tune, SFT, DPO, RFT, training data, grader, distillation, fine-tuned model, training job, large file upload, calibrate grader, deploy fine-tuned model, evaluate fine-tuned model. DO NOT USE FOR: general model deployment without fine-tuning (use deploy-model), agent creation (use agents), prompt optimization without training (use prompt-optimizer).

Use this Skill: https://skilld.dev/gh/microsoft/skills/finetuning

This session only. Nothing lands on disk.

workflowsdiagnose-poor-results.md

≈601 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Diagnosing Poor Results

When your fine-tuned model performs worse than expected, work through this checklist top-down (most common causes first).

Diagnostic Table

# Symptom Likely Cause Fix
1 Training loss → 0, validation loss rises Overfitting 1) Deploy earlier checkpoint. 2) Reduce epochs. 3) Lower LR. 4) Add more diverse data. Overfitting ratio > 1.5 is concerning.
2 High correctness, low conciseness (or reverse) Dataset style mismatch Verbose: Add concise examples, use "Be concise" system prompt, filter to shortest correct examples. Terse: Add detailed examples, increase dataset with quality-filtered data.
3 Model seems good on spot-check but auto-eval is low Evaluation rubric issue Manually grade 10 examples vs. LLM judge. Check: Is judge model strong enough? Is rubric clear? Do reference answers match desired output?
4 Garbage, empty outputs, or errors Deployment/client bug Check: wrong model format (→ HTTP 500), AzureOpenAI on project endpoint (→ "api-version not allowed"), low capacity (→ timeouts), wrong deployment name. Test with curl.
5 RFT model scores below base model RFT-specific issue See RFT section below.

RFT-Specific Diagnosis

Signal Meaning Fix
Train-val grader gap > 0.2 Model gaming the grader Use stricter/more deterministic grader (Python execution > LLM judge)
Grader too easy High grader scores but bad outputs Add multi-criteria grading (syntax + semantic)
Grader too noisy Random signal, no learning Use deterministic grader or increase val set size
All of the above fail RFT may not suit this task Switch back to SFT

Escalation Path

If nothing above helps:

  1. Try a different base model — some fine-tune better for certain tasks
  2. Increase dataset 2x-5x with synthetic data
  3. Simplify the task — fine-tune for a narrower sub-task first
  4. Try prompt engineering instead — sometimes a well-crafted system prompt beats fine-tuning
  5. Combine approaches — prompt engineering + fine-tuning together

Red Flags: Don't Fine-Tune

  • Base model already scores > 9.0 (minimal headroom)
  • Task changes frequently (constant retraining needed)
  • < 50 examples and can't generate synthetic data
  • "Correct" output is highly subjective

Source: SKILL.md on GitHub

2 warnings1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides a robust toolkit for fine-tuning and evaluating models on Microsoft Foundry. It includes administrative scripts for job management and data processing. There are security considerations regarding the dynamic execution of user-supplied scripts and the invocation of the Azure CLI, which are standard for the skill's intended developer use-case.

  • Socket1mo

    1 alert: gptSecurity

  • Snyk1mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 04d245b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
metadata
{
  "author": "Microsoft",
  "version": "0.0.0-placeholder"
}

README badge

README badge for microsoft/skills/finetuning