Abstract
Large language models (LLMs) deliver remarkable performance but are costly to deploy, motivating knowledge distillation (KD) for efficient inference. Existing KD objectives typically match student and teacher probabilities via softmax, which blurs valuable logit information. While direct logit distillation (DLD) mitigates softmax smoothing, it fails to account for logit shift invariance, thereby restricting the solution space. We propose Concrete Score Distillation (CSD), a discrete score-matching objective that overcomes both softmax-induced smoothing and restrictions on the optimal solution set. We resolve the training instability and quadratic complexity of discrete score-matching in autoregressive LLMs, and the resulting CSD objective aligns relative logit differences across all vocabulary pairs between student and teacher with flexible weighting. We provide both mode-seeking and mode-covering instances within our framework and evaluate CSD on task-agnostic instruction-following and task-specific distillation using GPT-2-1.5B, OpenLLaMA-7B, and GEMMA-7B-IT. Experiments show that CSD consistently surpasses recent KD objectives, achieves favorable fidelity-diversity trade-offs, and yields complementary gains when combined with on-policy techniques, demonstrating its scalability and effectiveness for LLM distillation.
Introduction
Knowledge distillation (KD) is a critical technique for making Large Language Models (LLMs) efficient for deployment. By training a smaller "student" model to mimic a larger "teacher," we can achieve high performance with significantly lower computational costs. Traditionally, KD relies on matching the teacher’s softmax-normalized probability distributions using Kullback-Leibler (KL) divergence. However, this standard approach suffers from significant limitations that hinder the transfer of "dark knowledge" from the teacher to the student.
The Limitations of Current KD Objectives
The authors identify three primary flaws in existing distillation methods:
- Softmax Smoothing: The softmax function is inherently "peaky." It can map vastly different logit vectors to nearly identical probability distributions, effectively hiding the fine-grained relationships between minority tokens.
- The Zero-Probability Problem: In modern LLMs with massive vocabularies, the vast majority of tokens have near-zero probabilities. Standard KL-divergence provides almost no gradient signal for these tokens, preventing the student from learning the teacher's full distribution.
- The Rigidity of Direct Logit Distillation (DLD): While matching raw logits directly (DLD) avoids softmax smoothing, it is overly restrictive. LLMs are "logit shift invariant"—adding a constant to all logits does not change the output distribution. DLD forces the student to match exact logit values, which is unnecessary and can be difficult for smaller models to achieve.
Concrete Score Distillation (CSD)
To address these issues, the authors introduce Concrete Score Distillation (CSD). This method adapts "score matching" to the discrete domain of language tokens by matching the relative differences between logits rather than absolute probabilities or exact logit values.
Key Methodological Innovations
- Relative Logit Matching: Instead of matching $P(\text{token } A)$, CSD matches the log-ratio of probabilities between pairs of tokens: $\log(P(A)/P(B))$. In logit terms, this simplifies to matching the difference $(f[A] - f[B])$ between the student and teacher.
- Logit Shift Invariance: By focusing on differences, CSD naturally incorporates an additive constant "slack" ($C$). This expands the space of optimal solutions ($\Theta^*_{CSD}$), providing the student model with more flexibility during training compared to the rigid $\Theta^*_{DLD}$ set.
- Linear Time Complexity: A naive implementation of pairwise differences would be $O(|V|^2)$. The authors derive a mathematical factorization that reduces the gradient computation to linear time $O(|V|)$, making CSD as computationally efficient as standard KL-divergence.
- Flexible Weighting: CSD includes a weighting framework that allows it to be configured as either "mode-seeking" (focusing on high-probability tokens) or "mode-covering" (capturing the entire distribution).
Experimental Results
The researchers evaluated CSD across diverse benchmarks, including instruction following (Dolly, Vicuna), task-specific distillation (summarization, translation, math), and general chat.
- Superior Performance: In GPT-2 distillation, CSD achieved an average ROUGE-L score of 20.65, significantly outperforming standard KL (16.68) and DLD (20.39).
- Robustness in Mathematical Reasoning: On the GSM8K benchmark, CSD maintained a stable 25.78% accuracy, whereas several traditional KD losses collapsed to 0% accuracy due to their inability to handle the strict formatting and logic required.
- Fidelity-Diversity Trade-off: CSD demonstrated a superior Pareto frontier, better balancing the need to follow the teacher's choices (fidelity) with the ability to generate diverse and creative text.
Conclusion
Concrete Score Distillation (CSD) offers a robust and efficient alternative to traditional probability-based distillation. By leveraging logit shift invariance and matching relative logit differences, CSD captures the teacher's internal logic more faithfully while providing the student with a more flexible learning objective. Future work includes automating the discovery of optimal weighting functions and integrating CSD into more complex RLHF and DPO pipelines.
Summary updated