Skip to content

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
View on GitHub

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 -y

Installs 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

Similar to Knowledge Distillation

More AI Agents & LLM Apps