TL;DR
When shrinking giant language models into smaller, nimbler "student" models, standard techniques tend to blindly copy everything from the "teacher" model, wasting effort on things the student already knows or pulling from the wrong parts of the teacher's brain. This paper introduces KPD (Knowledge Probing-based Distillation), a surgical approach that first quizzes the student to find its blind spots, then scans the teacher to see exactly where that missing knowledge lives before transferring it. Adding this targeted tutoring boosts nine existing distillation methods across multiple model families with barely any extra training time.
What Problem Does This Paper Address?
To run Large Language Models (LLMs) on everyday hardware, we often use knowledge distillation—training a compact student model to mimic a massive teacher model. "Black-box" distillation just trains the student on the teacher's text outputs, missing out on the rich internal representations of how the teacher actually "thinks." "White-box" distillation fixes this by aligning the internal hidden layers of both models, but it hits two major snags:
- What to teach? Most methods treat every word in a sentence equally. In reality, a student model usually nails common words ("Some", "of", "the") and only stumbles on specific, knowledge-heavy tokens (like "movies" in a query about 1980s cinema). Looking only at the teacher's final output doesn't help spot these gaps, because late teacher layers tend to be uniformly confident across all words.
- Where to find it? Knowledge isn't spread evenly across a neural network like peanut butter. Specific facts and circuits live in specific intermediate layers. Guessing which layers to copy—say, just grabbing the last few—often misses the actual neural circuitry responsible for the knowledge the student lacks.
Methods
Instead of a blind data dump, KPD acts as a plug-and-play, three-stage diagnostic and transfer pipeline that wraps around standard distillation losses:
- Stage 1: Student Uncertainty Probing (What is missing?) KPD runs training examples through the student model and measures prediction uncertainty ($1 - \text{probability}$) for each token. It flags the top-$k_1$ tokens where the student hesitates most as "key tokens"—a custom study guide of the student's blind spots.
- Stage 2: Teacher Neuron Attribution (Where does it live?) Taking those exact stumbling-block tokens, KPD probes the teacher's feed-forward networks using integrated gradients—a technique that scales a neuron's weight from zero to its true value to measure how much it influences the target prediction. Layers with the highest count of strongly activated neurons (excluding the final layer, which is already used in standard distillation) are selected as the teacher's "key knowledge layers."
- Stage 3: Isometric Representation Distillation (How to transfer it?) Because the teacher is deeper than the student, KPD uses an isometric (proportional) mapping to pair each chosen teacher layer with a student layer at the equivalent relative depth (e.g., 75% of the way through both networks). It projects both models' hidden states into vocabulary logits using their original output heads and minimizes the KL divergence between them, alongside standard supervised fine-tuning and output distillation losses.
Datasets
The authors did not introduce new benchmarks, opting instead to test generalization across standard general-purpose and specialized datasets:
- Domain-Agnostic: Distilled exclusively on Databricks-Dolly-15k, then evaluated both in-domain (Dolly) and out-of-distribution on Self-Instruct, Vicuna Evaluation, Super-Natural Instructions (S-NI), and Unnatural Instructions (UnNI).
- Domain-Specific (Medical & Legal): Distilled on GenMedGPT (medical) and Lawyer-Instruct + USTerms (legal). Evaluated on MMLU subsets: Clinical Knowledge, Professional Medicine, College Medicine, International Law, and Professional Law.
Key Insights and Ideas
- Knowing where beats knowing what: Ablation studies revealed a fascinating asymmetry: replacing the student's uncertain tokens with random ones hurt performance, but replacing the teacher's probed layers with random layers caused a much steeper drop (up to 4.08 Rouge-L points lost). Localizing the exact depth of knowledge inside the teacher is the real secret sauce.
- Proportional depth matters: Injecting deep teacher knowledge into the student's early layers flops, and cramming it all into the final layers underperforms. Mapping layers proportionally preserves the natural hierarchy of how transformers build meaning from syntax up to abstract concepts.
- A tiny probe goes a long way: You don't need to run expensive gradient attributions over your entire training set. Performance completely saturates after probing just 100 examples, adding only ~4.3% to 5.3% to total training wall-clock time.
- Less is more for hyper-parameters: Probing too many tokens ($k_1 > 5$) or too many layers ($k_2 > 3$) actually degrades or plateaus performance, likely because pulling in lower-uncertainty tokens and less-relevant layers dilutes the training signal with noise.
Key Results
Tested across three teacher-student pairs (Llama2-7B $\rightarrow$ TinyLlama-1.1B, Llama3.1-8B $\rightarrow$ Llama3.2-1B, and Qwen2.5-7B $\rightarrow$ Qwen2.5-1.5B) and nine baselines (including KD, SeqKD, GKD, MiniLLM, and Distillm):
- General Tasks: KPD improved every single baseline, boosting Rouge-L scores by 0.34% to 4.56% (for instance, jumping vanilla KD on Qwen2.5-1.5B from 23.20 to 27.76 on Dolly). In head-to-head blind evaluations judged by
gpt-4-turbo, KPD-augmented models won 50%–63% of the time against their un-probed counterparts. - Specialized Domains: On medical and legal MMLU tasks, KPD raised average accuracy by 2%–6% across Llama3.2 and Qwen2.5 (and up to 7% on specific tasks), shining brightest on knowledge-heavy subjects like Professional Medicine and International Law.
- Causal Verification: When the authors artificially intervened on the teacher layers selected by KPD, the teacher's log-probability on key tokens plunged by 0.47—a 4.3$\times$ larger drop than intervening on random layers (0.11), proving those layers genuinely house the target knowledge.
Limitations and Future Work
Not discussed in the paper. (Note: While the text included here ends right after the conclusion, one practical constraint visible from the methodology is that projecting intermediate hidden states directly through the models' vocabulary output heads assumes the teacher and student share the exact same tokenizer and vocabulary—distilling across mismatched model families isn't addressed in the main text.)
Summary updated