Abstract
Accurate uncertainty quantification of large language models (LLMs) provides credibility measure over their outputs. However, fine-tuned LLMs often struggle with overconfidence in uncertain predictions due to the limitations in the models' ability to generalize with limited data. Existing parameter efficient fine-tuning (PEFT) uncertainty quantification methods for LLMs focus on post fine-tuning stage and fall short of calibrating epistemic uncertainty. To address these limitations, we propose Functional-Level Uncertainty Quantification for Calibrated Fine-Tuning (UQ4CT), which captures and calibrates epistemic uncertainty over the space of functions that map input prompts to outputs. We implement UQ4CT during the fine-tuning stage via a mixture-of-experts framework that hierarchically decomposes the functional space. We demonstrate that UQ4CT reduces Expected Calibration Error (ECE) by more than $25\%$ while maintaining high accuracy across $5$ benchmarks. Even under distribution shift, UQ4CT maintains superior ECE performance with high accuracy, showcasing improved generalizability.
Introduction
Fine-tuned Large Language Models (LLMs) are notoriously overconfident, often asserting falsehoods with high certainty. When these models are fine-tuned on small, specialized datasets, they tend to "overfit" in terms of confidence—learning the task but losing the ability to signal when they are guessing. This lack of reliable uncertainty quantification is a major hurdle for deploying LLMs in safety-critical fields like healthcare or climate science.
UQ4CT (Functional-Level Uncertainty Quantification for Calibrated Fine-Tuning) addresses this by calibrating the model during the fine-tuning process using a Mixture-of-Experts (MoE) framework. By aligning the model's internal routing logic with its actual predictive correctness, UQ4CT reduces calibration error by over 25% without sacrificing accuracy.
Methodology: UQ4CT
UQ4CT introduces a hierarchical Mixture-of-Experts (MoE) architecture using Low-Rank Adaptation (LoRA). Instead of a single LoRA adapter per layer, UQ4CT uses an ensemble of LoRA experts. A "router" dynamically selects which experts to use for a given input prompt.
The core of UQ4CT is a two-pronged approach:
- Functional-Level Uncertainty (FLU): Uncertainty is defined based on the weights the router assigns to different experts. If the router spreads its weights across many experts, the FLU is high.
- Calibration Loss: A novel training loss penalizes the model if its internal uncertainty (the router's weights) doesn't match its actual success. If the model predicts correctly, the loss pushes the FLU toward high confidence; if it's wrong, it pushes it toward uncertainty.
This approach makes calibration a first-class citizen of the loss function, forcing the model to learn "honest" routing weights. Furthermore, UQ4CT provides a calibrated confidence score in a single forward pass, making it highly scalable compared to ensemble methods.
Experimental Evaluation
The researchers evaluated UQ4CT on five multiple-choice question-answering benchmarks, covering common-sense reasoning (BoolQ, ARC-Easy, ARC-Challenge, OpenBookQA) and domain-specific knowledge (ClimateQA). To test robustness, they examined performance under distribution shift using MMLU subtasks (Computer Science, Engineering, Law, and Health) for a model fine-tuned on general science.
UQ4CT consistently outperformed state-of-the-art baselines, including Monte Carlo Dropout and Laplace-LoRA, in terms of Expected Calibration Error (ECE).
- In-Distribution Performance: On benchmarks like BoolQ and OBQA, UQ4CT achieved over a 25% reduction in ECE compared to standard LoRA while maintaining or slightly improving accuracy.
- Robustness to Distribution Shift: The method proved remarkably robust. When tested on larger distribution shifts, UQ4CT maintained the lowest ECE among all tested methods, demonstrating superior generalizability.
Discussion and Future Work
The primary limitation of UQ4CT is its reliance on a clear metric for predictive correctness, which is straightforward for multiple-choice tasks but challenging for open-ended generation. Future work will involve adapting UQ4CT to these problems, potentially using LLM-as-a-judge or other semantic evaluation techniques to drive the calibration loss. By aligning internal routing logic with actual predictive correctness, UQ4CT offers a path toward more reliable and trustworthy LLMs in specialized domains.
Summary updated