Abstract
Large Language Models (LLMs) often exhibit overconfidence, making them unreliable for high-stakes applications. While Bayesian methods like Bayesian Prompt Ensembles (BayesPE) provide robust uncertainty estimates, they are computationally expensive due to multiple forward passes. This paper presents a framework for Evidential Knowledge Distillation, which distills a teacher's uncertainty-aware predictive distribution into a student model using a Dirichlet-based evidential head. Our approach achieves up to a 36x speedup while maintaining or improving calibration and out-of-distribution (OOD) robustness compared to the teacher.
Introduction
Large Language Models (LLMs) are powerful but notoriously overconfident; they rarely "know what they don't know." To address this, researchers use Bayesian methods or ensembles, such as Bayesian Prompt Ensembles (BayesPE), which provide robust uncertainty estimates by averaging results from multiple model configurations or prompts. However, these methods are computationally demanding, requiring multiple forward passes for every prediction. This makes them impractical for real-time applications or deployment on limited hardware. Furthermore, many state-of-the-art models are "black boxes," preventing access to internal weights for traditional Bayesian techniques. This research seeks a method to obtain "Bayesian-quality" uncertainty estimates with the speed of a standard, single-pass model.
Methodology
The authors propose a unified framework for Uncertainty-Aware Knowledge Distillation:
- The Teacher: Bayesian Prompt Ensembles (BayesPE) serve as the teacher. This method treats different prompts as "hypotheses" and learns weights for them based on a small validation set, providing a rich predictive distribution.
- The Student: A pre-trained Mistral-7B model modified with Low-Rank Adaptation (LoRA). The standard Softmax classification head is replaced with an Evidential Head.
- Evidential Learning: Instead of outputting simple probabilities, the student predicts the parameters ($\alpha$) of a Dirichlet distribution. This allows the model to explicitly model the distribution over class probabilities, capturing both aleatoric and epistemic uncertainty.
- Distillation Loss: A specialized Dirichlet-based distillation loss is used. Instead of matching only the teacher's mean prediction, the student is trained to match the entire shape of the teacher's predictive distribution across multiple samples.
Experimental Setup
The approach was evaluated on four text classification benchmarks:
- Amazon Reviews Polarity and SST-2: Sentiment analysis (2 classes).
- Yahoo Answers: Topic classification (10 classes).
- YouTube Comments: Spam detection (2 classes).
To test Out-of-Distribution (OOD) performance, models were trained on Amazon Reviews and tested on the other three datasets to evaluate their ability to signal higher uncertainty on unfamiliar data.
Key Results and Insights
The distilled student models achieved massive inference speedups, ranging from 11x to 36x faster than the BayesPE teacher. Surprisingly, the students often outperformed their teachers in calibration. This suggests that distillation acts as a regularizer, smoothing out prompt-specific "quirks" from the teacher.
In distribution-shift scenarios, the Dirichlet student showed a much higher "uncertainty response" (higher predictive entropy) than both the teacher and the standard Softmax student. On the Yahoo dataset, the student's Expected Calibration Error (ECE) was 0.042, a significant improvement over the teacher's 0.194.
Conclusion and Future Work
This work demonstrates that evidential knowledge distillation can produce efficient LLMs with high-quality uncertainty estimates. While currently limited to classification, future work aims to generalize this to regression and sequence-to-sequence tasks. The authors also note that while the Dirichlet layer is effective, it can still underestimate epistemic uncertainty, suggesting that hierarchical evidential priors may be a fruitful area for further research.
Summary updated