Knowledge Distillation
Compact knowledge distillation guide for shrinking LLMs while keeping teacher behavior through soft targets and reverse KLD.
- CCM score
- 53 of 100
- skills.sh installs
- 1.1K
- GitHub stars
- 14.9K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers teacher-to-student compression, including temperature scaling, soft-target losses, forward and reverse KL, and response distillation on synthetic teacher outputs
- Includes runnable PyTorch loss functions and training loops, plus MiniLLM reverse-KLD guidance drawn from arXiv 2306.08543
- Explains when reverse KL suits generative models better than forward KL, with the mode-seeking versus mode-covering tradeoff stated
- Designed for deploying smaller open-source models that retain most of a larger model's performance at lower inference cost
Install
$ npx -y skills add orchestra-research/ai-research-skills --skill knowledge-distillation -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Knowledge Distillation: Compressing LLMs
When to Use This Skill
Use Knowledge Distillation when you need to:
- Compress models from 70B → 7B while retaining 90%+ performance
- Transfer capabilities from proprietary models (GPT-4) to open-source (LLaMA, Mistral)
- Reduce inference costs by deploying smaller student models
- Create specialized models by distilling domain-specific knowledge
- Improve small models using synthetic data from large teachers
Key Techniques: Temperature scaling, soft targets, reverse KLD (MiniLLM), logit distillation, response distillation
Papers: Hinton et al. 2015 (arXiv 1503.02531), MiniLLM (arXiv 2306.08543), KD Survey (arXiv 2402.13116)
Installation
# Standard transformers
pip install transformers datasets accelerate
# For training
pip install torch deepspeed wandb
# Optional: MiniLLM implementation
git clone https://github.com/microsoft/LMOps
cd LMOps/minillm
pip install -e .
Quick Start
Basic Knowledge Distillation
import torch
import torch.nn.functional as F
from transformers import AutoModelForCausalLM, AutoTokenizer, Trainer, TrainingArguments
Details
- Repository
- github.com/orchestra-research/ai-research-skills
- Categories
- AI Agents & LLM Apps, Data Science & Analytics
- First seen
- Jun 3, 2026
Questions
What does the knowledge-distillation skill do?
It compresses large language models by distilling a big teacher model into a smaller student model. It covers temperature scaling, soft targets, reverse KLD, logit distillation and MiniLLM training strategies.
When should I use the knowledge-distillation skill?
Use it when you need to deploy smaller models while keeping performance, move capabilities from a large model such as GPT-4 into open-source models, or cut inference costs. It also fits creating specialized models from domain-specific knowledge.
How do I install the knowledge-distillation skill?
Run npx -y skills add orchestra-research/ai-research-skills --skill knowledge-distillation -y in your project. The skill then lets your agent apply distillation techniques such as soft-target losses and reverse KL training.
What does the knowledge-distillation skill need to run?
The skill's SKILL.md lists transformers, torch and datasets as dependencies, plus accelerate, deepspeed and wandb for training. The MiniLLM variant needs the LMOps repository cloned and installed separately.
Where does knowledge-distillation sit in its category?
It is listed under AI Agents and LLM Apps on Claude Marketplaces, alongside microsoft-foundry and azure-ai. It stands apart by focusing on compressing models through teacher-student training.
More from orchestra-research/ai-research-skills
All 92- Tensorboard1.1K
- Ray Data1.1K
- Fine Tuning With Trl1.1K
- Prompt Guard1.1K
- Llama Cpp1.1K
- Optimizing Attention Flash1.1K
- Quantizing Models Bitsandbytes1.1K
- Deepspeed1.1K
- Dspy1.1K
- Grpo Rl Training1.1K
- Qdrant Vector Search1.1K
- Pytorch Fsdp21.1K
- Pytorch Lightning1.1K
- Transformer Lens Interpretability1.1K
- Axolotl1.1K
- Clip1.1K
- Langchain1.1K
- Sentence Transformers1.1K
- Huggingface Tokenizers1.1K
- Verl Rl Training1.1K
- Awq Quantization1.1K
- Nanogpt1.1K
- Instructor1.1K
- Long Context1.1K
Similar to Knowledge Distillation
More AI Agents & LLM AppsaxolotlSkillorchestra-research/ai-research-skills1.1K installsReference skill for fine-tuning LLMs with Axolotl, covering YAML configs, LoRA/QLoRA, and preference-tuning methods.
ml-training-recipesSkillorchestra-research/ai-research-skills1.1K installsBattle-tested PyTorch training recipes spanning LLMs, vision, diffusion, and biomedical domains with debugging guidance.
llm-fine-tuning-guideSkillqodex-ai/ai-agent-skills198 installsPractical guide to fine-tuning LLMs covering full tuning, LoRA, QLoRA, and domain-specific data preparation.
llmSkillmindrally/skills767 installsBroad LLM development guidance covering architecture, fine-tuning, distributed training, evaluation, and deployment.
ai-ml-skillsPluginancoleman/ai-design-components535 starsMLOps patterns, prompt engineering, LLM evaluation, and embedding optimization
deep-learning-pythonSkillmindrally/skills898 installsCoding guidelines for PyTorch, Transformers, Diffusers, and Gradio work on LLM and diffusion models.