Efficient Uncertainty in LLMs through Evidential Knowledge Distillation

Lakshmana Sri Harsha Nemani, P. K. Srijith, Tomasz Kuśmierczyk

TL;DR

This paper introduces a method to distill computationally expensive "uncertainty-aware" teacher LLMs into efficient student models that can estimate uncertainty in a single forward pass. By using Evidential Knowledge Distillation with Dirichlet-distributed outputs and LoRA fine-tuning, the authors achieve up to a 36x speedup while maintaining—and sometimes exceeding—the predictive and calibration performance of the original teacher models.

What Problem Does This Paper Address?

Large Language Models (LLMs) are powerful but notoriously overconfident; they rarely "know what they don't know." To fix this, researchers use Bayesian methods or ensembles (like Bayesian Prompt Ensembles), which provide robust uncertainty estimates by averaging results from multiple model configurations or prompts.

The catch? These methods are slow. They require multiple forward passes (sampling) for every single prediction, making them impractical for real-time applications or deployment on limited hardware. Furthermore, many state-of-the-art models are "black boxes," meaning we can't access their internal weights to apply traditional Bayesian techniques. This paper seeks a way to get "Bayesian-quality" uncertainty estimates with the speed of a standard, single-pass model.

Methods

The authors propose a unified framework for Uncertainty-Aware Knowledge Distillation:

  1. The Teacher: They use Bayesian Prompt Ensembles (BayesPE) as the teacher. This method treats different prompts as "hypotheses" and learns weights for them based on a small validation set. It provides a rich predictive distribution but is slow.
  2. The Student: The student is a pre-trained LLM (Mistral-7B) modified with Low-Rank Adaptation (LoRA). Crucially, the authors replace the standard Softmax classification head with an Evidential Head.
  3. 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.
  4. Distillation Loss: They use a specialized Dirichlet-based distillation loss. Instead of just matching the teacher's "mean" prediction, the student is trained to match the entire shape of the teacher's predictive distribution across multiple samples.
  5. Efficiency: Because the student uses LoRA and a single evidential head, it only requires one forward pass at inference time.

Datasets

The approach was evaluated on four text classification benchmarks:

  • Amazon Reviews Polarity: Sentiment analysis (2 classes).
  • SST-2 (Stanford Sentiment Treebank): Sentiment analysis (2 classes).
  • Yahoo Answers: Topic classification (10 classes).
  • YouTube Comments: Spam detection (2 classes).

To test Out-of-Distribution (OOD) performance, the authors trained models on Amazon Reviews and tested them on the other three datasets to see if the models correctly signaled higher uncertainty on unfamiliar data.

Key Insights and Ideas

  • The "Student Surpasses Teacher" Effect: Surprisingly, the distilled students often outperformed their teachers in calibration. The authors suggest that distillation acts as a regularizer, smoothing out prompt-specific "quirks" from the teacher and producing a lower-noise predictor.
  • Separating Uncertainties: By using Dirichlet outputs, the student can decompose uncertainty into aleatoric (inherent data noise, like a blurry image) and epistemic (model ignorance, like seeing a new language). Standard Softmax students can only capture the former.
  • Black-Box Compatibility: The method only requires the outputs (probabilities) of the teacher model, not its internal weights. This makes it a viable strategy for distilling proprietary models like GPT-4 into smaller, open-source models.
  • LoRA for Distillation: Using LoRA makes the training process extremely lightweight. The student retains the base model's knowledge while the "adapters" learn the specific uncertainty characteristics of the teacher.

Key Results

  • Speed: The student models achieved massive inference speedups, ranging from 11x to 36x faster than the BayesPE teacher.
  • Accuracy & Calibration: The Dirichlet student matched or exceeded the teacher's accuracy across all datasets. Notably, it significantly reduced the Expected Calibration Error (ECE)—on the Yahoo dataset, the student's ECE was 0.042 compared to the teacher's 0.194.
  • OOD Robustness: 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, indicating it is much better at identifying when it is likely to be wrong.

Limitations and Future Work

  • Task Scope: The study is currently limited to classification tasks with discrete labels. It does not yet address open-ended text generation or structured prediction (like translation).
  • Scaling: While tested on 7B parameter models, the authors note that results might vary when scaling to much larger or "sparse" (MoE) architectures.
  • Epistemic Underestimation: The authors admit that the Dirichlet layer can still sometimes underestimate epistemic uncertainty on certain datasets, suggesting that "hierarchical evidential priors" might be a fruitful area for future research.
  • Future Directions: The authors aim to generalize this to regression and sequence-to-sequence tasks and explore "task-adaptive" prompt selection to further refine the teacher's quality before distillation.

Summary updated

BibTeX
@misc{nemani2025efficient,
  author = {Lakshmana Sri Harsha Nemani and P. K. Srijith and Tomasz Kuśmierczyk},
  title = {{Efficient Uncertainty in LLMs through Evidential Knowledge Distillation}},
  year = {2025},
  eprint = {2507.18366},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.18366},
}
Figure