Towards Precise Knowledge Distillation for Large Language Models via Knowledge Probing

Jiajun Liu, Yao He, Wenjun Ke, Peng Wang, Ziyu Shang, Guozheng Li, Zijie XuNeurIPS 2026

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:

  1. 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.
  2. 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.
Figure 1: We use Llama 3.1-8B for the teacher model and Llama 3.2-1B for the student model to probe a sample from databricks-dolly-15k. (a) shows the prediction results of the student model for the first 6 tokens. (b) shows the output probability of each layer of the teacher model after layer normalization on the first 6 tokens, which reflects how confident each layer is for each token. (c) shows the number of neurons activated in each layer of the teacher model for the output of the token movies, which is determined by the value of the cumulative gradient greater than 0.2 during probing.

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.
Stage 3: Distilling Hidden Representations

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

Abstract

Knowledge distillation (KD) has become a widely adopted approach for compressing large language models (LLMs). Existing distillation paradigms for LLMs can be broadly categorized into black-box and white-box approaches. Black-box methods typically transfer the chains of thought (CoTs) generated by teacher models to student models, yet they fail to convey the intrinsic knowledge embedded within teacher models. White-box methods aim to alleviate this limitation by leveraging internal representations from teacher models. However, they still face two major challenges. First, it is difficult to identify which knowledge is essential for distillation in student models. Second, it is challenging to transfer this key knowledge from teacher models accurately. To tackle these challenges, we propose KPD, a novel Knowledge Probing-based white-box Distillation framework for LLMs, which is designed to precisely distill the knowledge that the student model lacks and can be incorporated into diverse distillation approaches. Specifically, to identify critical knowledge gaps in student models, we introduce an uncertainty-based probing method that extracts tokens prone to student errors as critical knowledge. To locate the corresponding knowledge in the teacher model, we utilize integrated-gradient-based attribution to probe where such knowledge is stored and then distill the target layers. Extensive experiments across multiple datasets demonstrate that KPD boosts traditional distillation methods by 0.34%-4.56% in Rouge-L scores.
BibTeX
@inproceedings{liu2026towards,
  author = {Jiajun Liu and Yao He and Wenjun Ke and Peng Wang and Ziyu Shang and Guozheng Li and Zijie Xu},
  title = {{Towards Precise Knowledge Distillation for Large Language Models via Knowledge Probing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ZR1esHm9Cz},
}
Figure