Knowledge distillation in deep learning

From curiositech/windags-skills · View interactive version

Knowledge distillation in deep learning is an AI agent skill from the GitHub repository curiositech/windags-skills. Design deployment-focused distillation systems that balance model size, accuracy, calibration, and cascade escalation under real resource limits. Best for teacher-student compression, threshold design, and failure-aware deployment. Activate on "model compression", "teacher- student", "distillation s

How to use this skill

Skill file

Knowledge Distillation In Deep Learning

Use this skill when the core design question is how to compress a capable model into something smaller, cheaper, or more routable without hiding unacceptable losses in calibration, robustness, or edge-case performance.

When to Use

NOT for Boundaries

This skill is not the primary fit for:

Core Mental Models

Knowledge Is Multi-Representational

Distillation can transfer logits, soft labels, feature maps, or other internal structure. Deployment success depends on choosing the representation that preserves the behavior you actually care about.

Size-Accuracy Tradeoffs Need An Explicit Policy

The paper's distillation-score framing matters because it forces the team to say what it is optimizing for. Mobile and edge deployments tolerate more loss than safety-critical paths. If the priority is hidden, the system will drift toward accidental risk.

Abstraction Level Should Drive Capacity

Low-level feature extraction can often live in smaller students. High-level semantic or reasoning-heavy decisions usually require more capacity. Uniform compression across all layers or roles is usually the wrong move.

Cascades Beat Wishful Compression

When the input distribution has easy and hard cases, a small-first, large-backup cascade often dominates "one tiny model for everything." Distillation should support escalation, not eliminate it.

Compression Amplifies Existing Weaknesses

Compressed models often fail first on rare classes, borderline examples, and out-of-distribution inputs. Average accuracy can stay high while the risk profile becomes much worse.

Decision Points

See the richer flow, quadrant, and sequence diagrams in diagrams/INDEX.md.

flowchart TD
  A[Deployment distillation request] --> B{What is the hard constraint?}
  B -->|Latency, memory, battery| C[Prioritize smaller student]
  B -->|Safety or quality floor| D[Prioritize accuracy and calibration]
  C --> E{Do easy and hard inputs differ sharply?}
  D --> E
  E -->|Yes| F[Design cascade or backup escalation]
  E -->|No| G[Single student may be acceptable]
  F --> H{What must transfer?}
  G --> H
  H -->|Decision behavior| I[Response-based distillation]
  H -->|Internal abstractions| J[Feature-based distillation]
  H -->|Confidence and structure| K[Multi-level or relation-aware transfer]
  I --> L[Validate slices, calibration, and OOD behavior]
  J --> L
  K --> L

1. Set The Tradeoff Policy Up Front

2. Decide Whether A Cascade Is Mandatory

3. Match Capacity To Abstraction

4. Validate Beyond Headline Accuracy

Failure Modes

Worked Examples

Example 1: Mobile Vision Model With Safety Escalation

Example 2: Multi-Agent Review Stack

Quality Gates

References And Visuals

Shibboleths

Surface understanding says "the student only lost 2% accuracy, so ship it."

Deeper understanding says:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.