Synthèse automatique
Cadre de décision pour choisir une stratégie de distillation de connaissances (par réponse, par caractéristiques, par relations ou en cascade) afin de compresser un grand modèle en un modèle plus petit.
Points forts
- Arbres de décision explicites avec seuils concrets (similarité de tâche, ratio de compression, valeur d'alpha selon l'environnement de déploiement)
- Catalogue de modes d'échec avec symptômes, règles de détection chiffrées et correctifs associés
- Couvre aussi bien le choix d'architecture que la coordination multi-agents (distillation hiérarchique, en ensemble, en ligne)
- Distingue clairement les contraintes mobiles/edge des contextes critiques (médical, financier) pour le réglage d'alpha
Limites
- Aucun code ni détail d'implémentation d'entraînement n'est fourni
- Les seuils (task_similarity > 0.8, variance > 20 %) sont heuristiques et non étayés par des benchmarks
- Le document est tronqué : le mode d'échec « Hierarchical Rigidity » n'est pas complet
À utiliser lorsqu'il faut planifier la compression d'un grand modèle et arbitrer entre fidélité, taille et latence avant d'écrire du code d'entraînement.
À éviter si l'on cherche du code de distillation prêt à l'emploi, des hyperparamètres validés empiriquement ou des résultats comparatifs mesurés.
Analyse de sécurité
SûrThe skill is a purely instructional guide about knowledge distillation techniques. It declares no tools, contains no executable commands, no network or file system interactions, and no destructive or exfiltrating instructions. There is no meaningful execution risk.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
I need to shrink a fine-tuned BERT classifier to run on Android. Given my task similarity to the teacher is around 0.85 and I need roughly 8x compression, which distillation strategy should I use and what temperature should I set?My distilled student model is more confident than the teacher on predictions that turn out to be wrong, and calibration is poor. Walk me through the temperature blindness failure mode and how to fix the training setup.I'm distilling a large diagnostic model for a clinical triage application where accuracy matters more than size. What alpha should I use, and should I add a cascade with the teacher as backup?license: Apache-2.0 name: knowledge-distillation-deep description: Deep analysis of knowledge distillation techniques for compressing large models into smaller efficient ones category: Research & Academic tags:
- knowledge-distillation
- model-compression
- deep-learning
- transfer-learning
SKILL: Knowledge Distillation and Intelligent Compression
Version: 1.0
Domain: AI/ML System Design, Agent Architecture, Knowledge Transfer
Cognitive Load: Medium (requires understanding of model training, system tradeoffs)
DECISION POINTS
Primary Decision Tree: Choosing Distillation Strategy
Given: [Task Type, Model Size Constraint, Accuracy Target]
IF task_similarity(student, teacher) > 0.8:
├── Use Response-Based Distillation
│ ├── Temperature T = 3-6 for classification
│ ├── Temperature T = 1-3 for regression
│ └── Focus on soft label matching
│
ELIF abstraction_level_needed == "high":
├── Use Feature-Based Distillation
│ ├── Match intermediate layer activations
│ ├── Use attention transfer if available
│ └── Preserve semantic representations
│
ELIF compression_ratio > 10x:
├── Use Cascade Architecture
│ ├── Small model handles confidence > 0.9 cases
│ ├── Large model backup for confidence < 0.9
│ └── Route based on input complexity score
│
ELSE:
└── Use Relation-Based Distillation
├── Match similarity matrices between samples
├── Preserve ranking relationships
└── Focus on structural knowledge transfer
Secondary Decision: Setting Alpha (Size vs Accuracy Priority)
IF deployment_environment in ["mobile", "edge", "embedded"]:
├── SET α = 0.6-0.8 (prioritize size)
└── Accept accuracy loss for resource constraints
ELIF application_domain in ["safety_critical", "medical", "financial"]:
├── SET α = 0.1-0.3 (prioritize accuracy)
└── Use larger models, cascade for uncertainty
ELIF can_dynamically_route == True:
├── SET α = 0.5 for base model
├── Build multiple checkpoints at different α values
└── Route based on input difficulty estimation
ELSE:
└── SET α = 0.4-0.6 (balanced approach)
Tertiary Decision: Agent Coordination Pattern
IF environment_stability == "static" AND task_distribution_known == True:
└── Use Hierarchical Distillation (teacher → student)
ELIF multiple_experts_available == True:
├── Use Ensemble Distillation
├── Weight teachers by domain expertise
└── Student learns from weighted combination
ELIF need_continuous_adaptation == True:
├── Use Online Distillation
├── Agents co-evolve simultaneously
└── Bidirectional knowledge flow
ELSE:
└── Use Self-Distillation with iterative refinement
FAILURE MODES
1. Accuracy Mirage
Symptoms: High average accuracy (>90%) but catastrophic failures on edge cases Diagnosis: Standard metrics hide stratified performance degradation Detection Rule: If per-class accuracy variance > 20% or minority class accuracy < 70% of overall accuracy Fix: Implement stratified validation with per-class thresholds; use weighted loss functions for rare classes
2. Temperature Blindness
Symptoms: Student model overconfident, poor calibration, loses "dark knowledge" Diagnosis: Training with temperature=1.0, ignoring probability distribution structure Detection Rule: If student confidence > teacher confidence on incorrect predictions Fix: Use temperature T=3-20 during distillation training; add calibration validation step
3. Capacity Cliff Crash
Symptoms: Model works fine until slight compression increase causes dramatic accuracy drop Diagnosis: Hit minimum capacity threshold for task complexity Detection Rule: If >5% accuracy drop from <10% parameter reduction Fix: Set hard minimum model size; use pruning instead of architecture changes; implement cascade routing
4. Hierarchical Rigidity
Symptoms: System can't adapt to new patterns; student errors persist despite available corrections Diagnosis: Fixed teacher-student roles prevent bidirectional learning Detection Rule: If student discovers edge cases but can't update teacher knowledge Fix: Implement feedback loops; use ensemble loss functions; enable peer learning between agents
5. Compression Amplification Bias
Symptoms: Compressed model maintains average performance but amplifies existing biases Diagnosis: Distillation preserves teacher's biases while losing error correction capacity Detection Rule: If demographic parity decreases >10% or fairness metrics degrade disproportionately Fix: Use bias-aware distillation loss; oversample minority classes; validate on adversarial fairness benchmarks
WORKED EXAMPLES
Example 1: Mobile Deployment Scenario
Context: Deploying sentiment analysis to mobile app, 50MB model limit, 200ms latency requirement Teacher: 800MB BERT model, 95% accuracy, 1.2s inference Constraints: α = 0.7 (heavily prioritize size), maintain >90% accuracy
Decision Process:
- Task similarity high (same domain) → Response-based distillation
- Compression ratio 16x → Expect significant accuracy loss, need mitigation
- Temperature selection: T=4 for sentiment (discrete classes with similarity structure)
Implementation:
- Train 50MB DistilBERT student on soft labels from BERT teacher
- Temperature T=4 during training, T=1 during inference
- Achieve 91.2% accuracy (3.8% drop) with 16x compression
- Add uncertainty threshold: defer to cloud API when confidence <0.85
Outcome: DS = 0.7×(50/800) + 0.3×(1-91.2/95) = 0.7×0.0625 + 0.3×0.04 = 0.056 (excellent score) Trade-off: 3.8% accuracy loss for 16x size reduction and 10x speed improvement
Example 2: Safety-Critical Multi-Agent System
Context: Autonomous vehicle perception, multiple specialized agents for object detection, depth estimation, trajectory planning Constraints: α = 0.2 (heavily prioritize accuracy), 99.9% reliability requirement
Decision Process:
- Different tasks per agent → Feature-based distillation for shared representations
- Safety critical → Cascade architecture with redundancy
- Multi-expert system → Ensemble distillation with specialist weighting
Implementation:
- Large teacher models for each perception task
- Medium student agents learn shared feature representations
- Tiny monitoring agent validates cross-agent consistency
- Cascade: students handle confidence >0.95, teachers handle edge cases
Agent Architecture:
- Object detection student: 100MB (from 500MB teacher)
- Depth estimation student: 80MB (from 400MB teacher)
- Trajectory planning: Keep full teacher (no compression for final decisions)
- Monitor agent: 10MB, watches for inconsistencies
Outcome: System maintains 99.92% safety threshold while reducing compute by 60% Trade-off: Modest efficiency gain for maintained safety with reduced single points of failure
Example 3: Collaborative Research Assistant Agents
Context: Multi-agent system for scientific literature analysis, agents specialize in different domains but share knowledge Constraints: Dynamic environment, new papers daily, agents must learn from each other
Decision Process:
- Dynamic environment → Online distillation with peer learning
- Different specializations → Relation-based distillation for structural knowledge
- Continuous adaptation needed → Bidirectional knowledge flow
Implementation:
- 5 specialist agents (biology, chemistry, physics, computer science, medicine)
- Each agent maintains domain expertise but learns general patterns from peers
- Weekly ensemble sessions where agents teach each other via attention transfer
- Self-distillation within each agent to compress learned knowledge
Mechanism:
- Agent A discovers new pattern in biology papers
- Shares attention weights and feature representations with other agents
- Other agents evaluate if pattern applies to their domains
- Successful transfers update shared knowledge base
Outcome: Collective accuracy improves 8% over 6 months vs. isolated training Trade-off: Increased coordination complexity for better adaptation and knowledge sharing
QUALITY GATES
- [ ] Distillation Score (DS) calculated with explicit α parameter and documented rationale
- [ ] Stratified validation completed with per-class accuracy thresholds set and met
- [ ] Temperature parameter tuned (T>1 during training) and calibration validated
- [ ] Capacity cliff analysis performed - confirmed model size is above minimum threshold
- [ ] Failure mode monitoring implemented for bias amplification and edge case degradation
- [ ] Adversarial test suite created covering out-of-distribution and minority class scenarios
- [ ] If compression ratio >5x, cascade architecture evaluated and routing strategy defined
- [ ] If multi-agent system, coordination pattern chosen and feedback loops implemented
- [ ] Deployment readiness confirmed with latency, memory, and accuracy benchmarks met
- [ ] Rollback plan prepared with performance monitoring alerts and degradation thresholds
NOT-FOR BOUNDARIES
Do NOT use this skill for:
- Simple rule-based systems with <1000 parameters (use direct optimization instead)
- Single-task agents with abundant computational resources (compression unnecessary)
- Systems where interpretability is primary requirement (use interpretable-models skill instead)
- Real-time systems with <10ms latency requirements (use hardware-acceleration skill instead)
- Prototype/research phases before performance requirements defined (premature optimization)
Delegate to other skills:
- For model architecture selection → use
neural-architecture-searchskill - For hardware optimization → use
model-deployment-optimizationskill - For interpretable AI requirements → use
explainable-ai-designskill - For federated learning scenarios → use
distributed-learning-coordinationskill - For adversarial robustness → use
adversarial-defense-strategiesskill
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/deep-knowledge-distillation-mrwakg1g' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/deep-knowledge-distillation-mrwakg1g/download' --output '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md.part' && mv '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md.part' '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md' && test -s '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/knowledge-distillation-deep' && cp -R '.skill-downloads/deep-knowledge-distillation-mrwakg1g' '.claude/skills/knowledge-distillation-deep'Cursor
test -f '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md' && test -s '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/knowledge-distillation-deep' && cp -R '.skill-downloads/deep-knowledge-distillation-mrwakg1g' '.cursor/skills/knowledge-distillation-deep'Codex
test -f '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md' && test -s '.skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/knowledge-distillation-deep' && cp -R '.skill-downloads/deep-knowledge-distillation-mrwakg1g' '.agents/skills/knowledge-distillation-deep'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/deep-knowledge-distillation-mrwakg1g'openskills read 'deep-knowledge-distillation-mrwakg1g'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/deep-knowledge-distillation-mrwakg1g/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Créer des cartes interactives avec kepler.gl
Data & IA
Création de cartes interactives et export HTML autonome avec le package Python keplergl, à partir de données géospatiales (DataFrame, GeoJSON, CSV).
Optimisation de paramètres par agent
Data & IA
Guide d'optimisation de systèmes configurables avec objectif mesurable, via des essais bornés et une recommandation fondée sur des preuves.
Relance des visiteurs ICP
Data & IA
Identifiez les utilisateurs inscrits correspondant au profil client idéal mais qui n'ont pas activé, et rédigez des messages de relance personnalisés pour les réengager.