Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Knowledge distillation techniques for model compression: logit-level, feature-level, and relation-based distillation. KD-Lib library and practical workflows for training student models.
.claude/skills/mkurman-knowledge-distillation/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-18 | ✗→✓ | ▲ Improved | -54% | 0% |
| case-15 | ✓→✓ | = Same ✓ | -36% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 11% | 0% |
| case-05 | ✓→✓ | = Same ✓ | -2% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 0% | 0% |
Knowledge distillation transfers knowledge from a larger teacher model to a smaller student model. Combined with pruning and quantization, it forms the critical middle step in the P-KD-Q compression pipeline.
bashuv pip install kd-lib
pythonfrom kd_lib import distill import torch.nn.functional as F def kd_loss(student_logits, teacher_logits, labels, temperature=4.0, alpha=0.5): soft_targets = F.softmax(teacher_logits / temperature, dim=-1) soft_prob = F.log_softmax(student_logits / temperature, dim=-1) kd = F.kl_div(soft_prob, soft_targets, reduction="batchmean") * (temperature ** 2) ce = F.cross_entropy(student_logits, labels) return alpha * kd + (1 - alpha) * ce
| Method | What it transfers | Best For | |---|---|---| | Logit distillation | Output probability distribution | Classification, generation | | Feature distillation | Intermediate hidden states | Transformer layers | | Relation distillation | Relationships between representations | Structured outputs | | Self-distillation | Model teaches itself | No teacher needed | | Online distillation | Teacher & student train jointly | Both models improve |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-15 | pass→pass | 12,862 | 6,536 | -49% | 1 | 1 | 0% | 2,013 | 1,290 | -36% | 0 | 0 | — |
case-01 | fail→fail | 11,338 | 7,924 | -30% | 1 | 1 | 0% | 2,270 | 1,885 | -17% | 0 | 0 | — |
case-02 | fail→fail | 17,478 | 14,967 | -14% | 1 | 1 | 0% | 2,937 | 2,844 | -3% | 0 | 0 | — |
case-03 | fail→fail | 13,898 | 8,405 | -40% | 1 | 1 | 0% | 2,752 | 2,109 | -23% | 0 | 0 | — |
case-04 | pass→pass | 10,221 | 9,770 | -4% | 1 | 1 | 0% | 2,012 | 2,243 | +11% | 0 | 0 | — |
case-05 | pass→pass | 11,992 | 10,036 | -16% | 1 | 1 | 0% | 2,307 | 2,268 | -2% | 0 | 0 | — |
case-06 | pass→pass | 11,668 | 9,905 | -15% | 1 | 1 | 0% | 2,453 | 2,445 | -0% | 0 | 0 | — |
case-07 | pass→pass | 4,914 | 1,534 | -69% | 1 | 1 | 0% | 851 | 584 | -31% | 0 | 0 | — |
case-08 | pass→pass | 10,113 | 1,916 | -81% | 1 | 1 | 0% | 1,735 | 680 | -61% | 0 | 0 | — |
case-09 | pass→pass | 6,926 | 2,806 | -59% | 1 | 1 | 0% | 1,244 | 780 | -37% | 0 | 0 | — |
case-10 | pass→pass | 9,550 | 5,803 | -39% | 1 | 1 | 0% | 1,652 | 1,429 | -13% | 0 | 0 | — |
case-11 | pass→pass | 6,509 | 3,830 | -41% | 1 | 1 | 0% | 1,061 | 993 | -6% | 0 | 0 | — |
case-12 | pass→pass | 10,431 | 4,686 | -55% | 1 | 1 | 0% | 1,722 | 1,098 | -36% | 0 | 0 | — |
case-13 | pass→pass | 14,961 | 12,552 | -16% | 1 | 1 | 0% | 2,402 | 2,180 | -9% | 0 | 0 | — |
case-14 | pass→pass | 7,085 | 6,214 | -12% | 1 | 1 | 0% | 1,223 | 1,357 | +11% | 0 | 0 | — |
case-16 | pass→pass | 9,922 | 2,524 | -75% | 1 | 1 | 0% | 1,562 | 767 | -51% | 0 | 0 | — |
case-17 | pass→pass | 15,317 | 11,771 | -23% | 1 | 1 | 0% | 2,567 | 2,535 | -1% | 0 | 0 | — |
case-18 | fail→pass | 14,147 | 4,655 | -67% | 1 | 1 | 0% | 2,532 | 1,169 | -54% | 0 | 0 | — |
case-19 | pass→pass | 7,664 | 1,668 | -78% | 1 | 1 | 0% | 1,261 | 542 | -57% | 0 | 0 | — |
case-20 | pass→pass | 5,926 | 4,624 | -22% | 1 | 1 | 0% | 1,054 | 1,147 | +9% | 0 | 0 | — |
case-21 | pass→pass | 9,430 | 4,399 | -53% | 1 | 1 | 0% | 1,770 | 1,219 | -31% | 0 | 0 | — |
case-22 | pass→pass | 14,479 | 11,209 | -23% | 1 | 1 | 0% | 2,781 | 2,455 | -12% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.