Knowledge Distillation for Large Language Models through Residual Learning

Thinh On, Hengzhi Pei, Leonard Lausen, George KarypisICLR 2026

Overview

This paper introduces a novel two-stage knowledge distillation (KD) framework that utilizes residual learning to prevent smaller "student" models from blindly mimicking the errors of larger "teacher" models. By focusing on the differential between student and teacher representations—especially when the teacher's prediction is incorrect—the framework enables students to generalize better. In some scenarios, the student even surpasses the teacher's zero-shot performance while seamlessly handling different tokenizers and architectures.

The Challenge of Knowledge Distillation

Knowledge distillation is the standard approach for shrinking massive Large Language Models (LLMs) into efficient, deployable versions. However, current methods face two major hurdles:

  1. Teacher Bias and Hacking: Most KD methods force the student to match the teacher's output exactly. If the teacher is wrong or biased, the student inherits those flaws. Furthermore, students often "hack" the distillation process by mimicking superficial patterns rather than learning deep semantic knowledge.
  2. Structural Incompatibility: "White-box" distillation, which leverages internal model states, is notoriously difficult when the teacher and student use different tokenizers or architectures (e.g., distilling a Mixture-of-Experts model into a dense model). Aligning these mismatched sequences usually requires complex, manual rules.

Proposed Methodology

To address these challenges, the authors propose a two-stage distillation approach:

Stage 1: Knowledge Compression

The framework first pretrains linear projectors to compress the teacher’s high-dimensional hidden states into a tiny, low-dimensional "alignment space" (e.g., $d_A = 64$). This acts as a semantic bottleneck, filtering out noise and retaining only task-relevant information.

Stage 2: Residual Distillation

Instead of the student trying to perfectly replicate the teacher, it learns to predict tokens based on a residual hidden state.

Residual Distillation Framework

This state is calculated by subtracting the teacher's projected representation from the student's own representation. Crucially, this subtraction is gated by an accuracy mask: it only triggers when the teacher makes an incorrect prediction. This forces the student to actively identify and fill the gaps in the teacher's knowledge, rather than blindly copying it.

Advanced Architectural Support

  • Expert Knowledge Fusion: For Mixture-of-Experts (MoE) teachers, the framework uses a self-attention mechanism to fuse information from all experts, rather than just the top-$k$ used during standard inference.
  • Cross-Model Attention: To handle different tokenizers, tokens are aligned by calculating the similarity between student and teacher hidden states in the low-dimensional alignment space, eliminating the need for explicit token-mapping rules.

Experimental Setup and Key Insights

The models were trained on the Dolly dataset (~11,000 samples) and evaluated across five diverse instruction-following benchmarks: Dolly (test set), Self-Instruction, Vicuna-Eval, Super-Natural Instructions (S-NI), and Unnatural Instruction (UnNI).

Key Insights: * Teacher Errors are Signals: The most counter-intuitive finding is that the teacher's failures are highly informative. By using the residual, the student is incentivized to develop "complementary knowledge"—learning exactly what the teacher doesn't understand. * The Power of Bottlenecks: A very low-dimensional alignment space ($d_A=64$) outperformed larger dimensions. "Squeezing" the teacher's knowledge forces the distillation process to focus on core semantics rather than high-dimensional noise. * Implicit Regularization: Mathematically, residual learning acts as a form of implicit regularization. It pushes the student's gradients away from the teacher's direction when the teacher is wrong, preventing overfitting to mistakes.

Key Results

The framework consistently outperformed state-of-the-art baselines (like DSKD and MultiLevelOT) across various settings.

Performance Results across Benchmarks
  • Same-Tokenizer: In distilling Mixtral-8x7B to Mistral-7B, the student achieved an average score of 30.68, slightly exceeding the teacher's own zero-shot performance (30.67).
  • Cross-Tokenizer: When distilling Mixtral-8x7B into the much smaller TinyLLaMA-1.1B (which uses a different tokenizer), the method achieved a 25.09 average score, a +1.20 improvement over the previous best method.
  • Generalization: Qualitative examples showed the student correctly identifying proper nouns and avoiding hallucinations in cases where both the teacher and standard KD baselines failed.

Limitations and Future Work

  • Task Diversity: The current study focuses heavily on instruction-following. Future work is needed to evaluate this residual approach on reasoning-intensive tasks (like math) or code generation.
  • Hyperparameter Sensitivity: While robust, the scaling factor $\beta$ (balancing student and teacher contributions) is currently calculated at the sequence level. A token-level adaptive $\beta$ might yield even better results.
  • Computational Cost: The projectors are lightweight, but the two-stage process adds an extra step to the training pipeline compared to simple black-box fine-tuning.

Summary updated

BibTeX
@inproceedings{on2026knowledge,
  author = {Thinh On and Hengzhi Pei and Leonard Lausen and George Karypis},
  title = {{Knowledge Distillation for Large Language Models through Residual Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=Dh6KxUxG20},
}
Figure