Improving LoRA with Variational Learning

Bai Cong, Nico Daheim, Yuesong Shen, Rio Yokota, Mohammad Emtiyaz Khan, Thomas Möllenhoff · DOI

Abstract

Low-Rank Adaptation (LoRA) has become the standard for parameter-efficient fine-tuning (PEFT) of Large Language Models. However, standard LoRA often suffers from overconfidence and can underperform compared to full-parameter fine-tuning. We present IVON-LoRA, a method that replaces the standard AdamW optimizer with the IVON variational learning algorithm. This approach provides a Bayesian posterior "for free," significantly improving model calibration and accuracy without the computational overhead typical of Bayesian methods. Furthermore, IVON-LoRA enables novel techniques such as uncertainty-guided pruning and test-time compute scaling.

Introduction

Low-Rank Adaptation (LoRA) is widely utilized for its efficiency, yet it frequently results in models that are poorly calibrated—meaning they are overconfident in their predictions. Previous attempts to integrate Bayesian uncertainty into LoRA, such as Laplace-LoRA or BLoB, often involve complex post-hoc approximations (like KFAC Hessian estimates) or additional training passes, which can degrade raw accuracy.

IVON-LoRA addresses these challenges by integrating a variational-Bayesian objective directly into the optimization process. By swapping the AdamW optimizer for IVON, practitioners can obtain a diagonal Gaussian posterior over the LoRA weights with negligible computational cost.

Figure 1: Overview of IVON-LoRA. (a) Comparison of standard LoRA and IVON-LoRA architectures. (b) Accuracy vs. training time, showing IVON-LoRA achieves higher accuracy at similar speeds. (c) Example of improved calibration on a reasoning prompt.

Methodology

The core innovation of IVON-LoRA is the use of the IVON optimizer. Unlike AdamW, which seeks a single point estimate, IVON minimizes a variational objective to learn both a mean ($\mu$) and a variance ($\sigma^2$) for each parameter in the LoRA matrices $A$ and $B$.

Variational Learning for Free

IVON leverages the optimizer's scale vector—an online estimate of the diagonal Hessian—to adapt the learning rate. This same scale vector provides the variance estimate for the posterior distribution. Implementation-wise, IVON-LoRA is nearly identical to standard LoRA fine-tuning, requiring no custom architectures or extra data passes.

Uncertainty-Guided Pruning (UGP)

The availability of per-parameter variance allows for Uncertainty-Guided Pruning. Rather than pruning based on weight magnitude, UGP removes parameters with the highest posterior variance. These parameters represent the components the model is most uncertain about; removing them serves as an effective regularizer, improving calibration without sacrificing accuracy.

Inference Strategies

At inference time, users can choose between two modes:

  1. Mean-only: Use the learned means for the weights, incurring zero additional inference cost while still benefiting from the improved training objective.
  2. Posterior Sampling: Sample multiple sets of weights from the learned distribution to perform advanced decoding, such as Minimum Bayes Risk (MBR) decoding.

Experimental Setup

The authors evaluated IVON-LoRA across several benchmarks:

  • Commonsense Reasoning: WinoGrande, ARC, OpenBookQA, and BoolQ.
  • Reasoning & Code: GSM8k and Conala.
  • Out-of-Distribution (OOD): MMLU subsets (Chemistry, Physics, Biology, etc.).
  • NLU: The GLUE benchmark.

Results and Discussion

Accuracy and Calibration

On Llama-3.2-3B, IVON-LoRA (mean-only) improved accuracy by 1.3% and reduced the Expected Calibration Error (ECE) by 5.4% compared to AdamW. Unlike other Bayesian baselines that often see performance drops when sampling, IVON-LoRA maintained its lead, slashing ECE from 18.7 to 10.1 while outperforming AdamW in accuracy.

Test-Time Compute Scaling

One of the most powerful features of IVON-LoRA is its support for test-time scaling. By sampling different models from the posterior, practitioners can generate a diverse set of reasoning paths.

Figure 6: Accuracy vs. n-best size for GSM8k. IVON-LoRA shows superior scaling performance as more samples are used for decoding compared to AdamW and the mean-only baseline.

As shown in Figure 6, scaling up to 512 sampled outputs across 64 IVON-sampled models resulted in a 3.7% accuracy boost on the GSM8k benchmark. This demonstrates that the learned posterior captures meaningful diversity that can be exploited at test time.

Computational Efficiency

Profiling on an NVIDIA RTX 4090 confirms that IVON's overhead is minimal, accounting for less than 1% of the per-step running time compared to AdamW. This makes it a practical drop-in replacement for standard fine-tuning pipelines.

Conclusion

IVON-LoRA demonstrates that Bayesian benefits in LLM fine-tuning do not have to come at a high computational or accuracy cost. By learning a posterior distribution through the optimizer, it provides better-calibrated models and enables new capabilities like uncertainty-guided pruning and effective test-time scaling. Future work will investigate the non-Gaussian nature of the weight increment $\Delta W = AB$ and explore more sophisticated variational approximations for large-scale models.

Summary updated

BibTeX
@misc{cong2025improving,
  author = {Bai Cong and Nico Daheim and Yuesong Shen and Rio Yokota and Mohammad Emtiyaz Khan and Thomas Möllenhoff},
  title = {{Improving LoRA with Variational Learning}},
  year = {2025},
  eprint = {2506.14280},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.14280},
}
Figure