Prior Predictive Matching for Bayesian LoRA
Abstract
Bayesian variants of Low-Rank Adaptation (LoRA) provide principled uncertainty estimation when fine-tuning large foundation models, but require specifying the prior over the low-rank weight updates. We address this hyperparameter selection problem by introducing a closed-form prior-predictive estimator that operates before fine-tuning. We analyze a second-order expansion of the network and quantify how the low-rank prior drives function-space deviations from the pretrained outputs. We also show that these prior-predictive quantities depend on the prior only through the product of the adaptation rank and the fourth power of the prior scale. Because the training targets share a single draw of the latent weight update, we can leverage the covariance between example residuals to derive a moment-matching estimator. Furthermore, our theoretical analysis establishes that the optimal prior precision scales as with the rank , allowing a single estimate to generalize across all ranks. Controlled experiments across regression and classification tasks validate our approximation and show that our estimator recovers the true prior scale. On RoBERTa-large, our approach improves predictive negative log-likelihood (NLL) and calibration over both MAP and marginal-likelihood selection without requiring validation data, while achieving competitive out-of-distribution detection.
Figures & tables
| validation search | marginal likelihood | ours | |
|---|---|---|---|
| available before fine-tuning | ✓ | ||
| needs no held-out data | ✓ | ✓ | |
| one estimate for all ranks | ✓ |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| test NLL | ||||||||
|---|---|---|---|---|---|---|---|---|
| ours | validation search | |||||||
| task | at | + T | + T | |||||
| AG News | 4 | 2,512 | 3,340 | 0.308 0.009 | 0.367 0.113 | 0.302 0.003 | 0.306 0.003 | 0.305 0.005 |
| 8 | 1,585 | 2,362 | 0.304 0.009 | 0.380 0.129 | 0.303 0.011 | 0.304 0.014 | 0.301 0.005 | |
| 16 | 631 | 1,670 | 0.301 0.005 | 0.411 0.128 | 0.300 0.008 | 0.301 0.006 | 0.301 0.007 | |
| 32 | 398 | 1,181 | 0.306 0.007 | 0.448 0.134 | 0.305 0.006 | 0.305 0.007 | 0.303 0.005 | |
| training examples | ||||
| 64 | 256 | |||
| test NLL | ||||
| zero-shot | 0.746 | 0.746 | 0.746 | 0.746 |
| MAP | 1.007 0.149 | 0.875 0.136 | 0.747 0.035 | 0.473 0.039 |
| marginal likelihood | 1.336 0.018 | 1.250 0.019 | 1.034 0.021 | 0.354 0.019 |
| ours | 0.458 0.054 | 0.423 0.109 | 0.395 0.147 | 0.277 0.012 |
| training examples | ||||
| 64 | 256 | |||
| test NLL | ||||
| zero-shot | 0.461 | 0.461 | 0.461 | 0.461 |
| MAP | 0.936 0.055 | 0.895 0.062 | 0.807 0.060 | 0.635 0.048 |
| marginal likelihood | 0.644 0.015 | 0.593 0.009 | 0.514 0.011 | 0.284 0.004 |
| ours | 0.477 0.069 | 0.416 0.020 | 0.331 0.020 | 0.296 0.006 |
| training examples | ||||
|---|---|---|---|---|
| 64 | 256 | |||
| AG News, OOD inputs from SST-2 | ||||
| marginal likelihood | 0.360 0.168 | 0.396 0.038 | 0.745 0.063 | 0.946 0.006 |
| ours | 0.861 0.017 | 0.829 0.077 | 0.871 0.051 | 0.904 0.002 |
| validation search | 0.885 0.024 | 0.838 0.092 | 0.892 0.040 | 0.922 0.005 |
| CR, OOD inputs from AG News | ||||
Bayesian LoRA
Bayesian low-rank adaptation (LoRA) adds probabilistic parameter-efficient updates to estimate uncertainty while fine-tuning large models.
See all 18 papers