Abstract
Despite their widespread use, large language models (LLMs) are known to hallucinate incorrect information and be poorly calibrated. This makes the uncertainty quantification of these models of critical importance, especially in high-stakes domains, such as autonomy and healthcare. Prior work has made Bayesian deep learning-based approaches to this problem more tractable by performing inference over the low-rank adaptation (LoRA) parameters of a fine-tuned model. While effective, these approaches struggle to scale to larger LLMs due to requiring further additional parameters compared to LoRA. In this work we present Scalable Bayesian Low-Rank Adaptation via Stochastic Variational Subspace Inference (ScalaBL). We perform Bayesian inference in an $r$-dimensional subspace, for LoRA rank $r$. By repurposing the LoRA parameters as projection matrices, we are able to map samples from this subspace into the full weight space of the LLM. This allows us to learn all the parameters of our approach using stochastic variational inference. Despite the low dimensionality of our subspace, we are able to achieve competitive performance with state-of-the-art approaches while only requiring ${\sim}1000$ additional parameters. Furthermore, it allows us to scale up to the largest Bayesian LLM to date, with four times as a many base parameters as prior work.
1. Introduction
Large Language Models (LLMs) have become ubiquitous, yet they suffer from a well-documented "confidence problem." They frequently hallucinate facts with total conviction and are often poorly calibrated—meaning their predicted probabilities do not accurately reflect their actual performance. In high-stakes fields like healthcare or autonomous systems, knowing when a model is "unsure" is critical for safety and reliability.
Bayesian Deep Learning (BDL) offers a principled approach to uncertainty quantification by learning a distribution over model weights rather than a single point estimate. However, scaling BDL to models with billions of parameters remains a significant challenge. While Parameter-Efficient Fine-Tuning (PEFT) methods like Low-Rank Adaptation (LoRA) have made fine-tuning large models more accessible, existing Bayesian extensions (e.g., BLoB) still face scalability issues. These methods typically treat one of the LoRA matrices as a distribution, adding millions of parameters as the model's embedding dimension grows, creating memory bottlenecks for the largest "frontier" models.
2. Methods: Stochastic Variational Subspace Inference
The core innovation of ScalaBL is the use of Stochastic Variational Subspace Inference. In standard LoRA, the weight update is represented as $W = W_0 + BA$. Previous Bayesian LoRA methods attempted to learn a distribution over the entire $A$ matrix, which scales with the embedding dimension $d$.
ScalaBL simplifies this by inserting a tiny $r \times r$ diagonal matrix $s$ between the $B$ and $A$ matrices: $$W = W_0 + B \text{diag}(s) A$$
By repurposing the learned LoRA matrices $A$ and $B$ as fixed projection matrices, the authors perform Bayesian inference only on the vector $s$. This approach has several advantages:
- Subspace Dimension: Inference occurs in an $r$-dimensional space (typically $r=8$), independent of the LLM's size.
- Variational Inference: The mean and variance of $s$ are learned using the "reparameterization trick" to maximize the Evidence Lower Bound (ELBO).
- Efficiency: While previous methods required $O(r \times d)$ additional parameters, ScalaBL only requires $2r$ additional parameters per layer.
3. Experimental Setup
The authors evaluated ScalaBL across several challenging benchmarks to test both in-distribution and out-of-distribution (OOD) performance:
- In-Distribution Reasoning: Winogrande (Small/Medium), ARC (Easy/Challenge), OpenBookQA, and BoolQ.
- Out-of-Distribution (OOD): MMLU-Chemistry and MMLU-Physics (testing models trained on OpenBookQA).
- Models: Primary experiments utilized the Qwen2.5 family (7B and 32B) and Llama-2-7b.
4. Key Results and Insights
ScalaBL demonstrates that modeling the "singular values" (the $s$ vector) of the adaptation is sufficient to capture meaningful uncertainty, leading to several key findings:
- Massive Parameter Efficiency: For a 7B parameter model, ScalaBL adds only ~1,000 parameters total—a 2000× reduction compared to previous state-of-the-art methods like BLoB.
- Unprecedented Scaling: ScalaBL is the first Bayesian LoRA approach to successfully scale to a 32-billion parameter model. Previous methods often exceeded the memory limits of 80GB A100 GPUs at this scale.
- Competitive Performance: Despite its minimal parameter overhead, ScalaBL achieves accuracy and Expected Calibration Error (ECE) competitive with or better than BLoB and Deep Ensembles, particularly in OOD scenarios.
- Robustness: ScalaBL proved more robust to changes in LoRA rank $r$ than BLoB, which sometimes saw performance degradation as the rank increased.
5. Conclusion and Future Work
ScalaBL represents a significant step toward making Bayesian uncertainty quantification practical for the largest LLMs. By decoupling the number of variational parameters from the model's embedding dimension, it enables scalable inference on frontier models.
However, limitations remain. Like other Bayesian Model Averaging methods, ScalaBL requires multiple forward passes at test time, increasing latency. Additionally, while effective for multiple-choice classification, extending this approach to open-ended text generation is a critical area for future research. Future work may also explore more complex subspace constructions to capture even richer uncertainty information without sacrificing the scalability that makes ScalaBL unique.
Summary updated