Manuscript Offprint
arXiv:2610.35457Prior Predictive Matching for Bayesian LoRA
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
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 r, 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.
1 INTRODUCTION
Fine-tuning large pretrained models with Low-Rank Adaptation (LoRA) (Hu et al., 2022) restricts parameter updates to a low-dimensional subspace. For a selected weight matrix , LoRA replaces by , where is constrained to have a low-rank factorization. Bayesian extensions of LoRA (e.g., Yang et al., 2024) place a prior over this low-rank update, typically through Gaussian priors on its factors, and use the resulting posterior to quantify uncertainty. This introduces two modeling choices: the rank of the update and the scale of its prior, (or equivalently its precision ). Together, these quantities determine the magnitude and complexity of parameter changes regarded as plausible before observing the fine-tuning data and can therefore have a substantial effect on the resulting posterior.
In existing approaches, these hyperparameters are typically selected either by validation search over the trained models or by maximizing an approximation to the marginal likelihood. Both strategies require fitting the model before the prior hyperparameters can be assessed. This creates a mismatch between the role of the prior and the way it is specified: a quantity intended to encode plausible adaptations before fine-tuning is chosen using the outcome of fine-tuning itself.
For Bayesian matrix factorization (BMF), this mismatch is avoided by prior-predictive matching, which sets the hyperparameters by matching moments of the prior predictive distribution to the data (da Silva et al., 2023). LoRA decomposes the update as and can therefore be viewed as a matrix factorization in parameter space. However, extending prior-predictive matching to LoRA is not immediate. In BMF, the observations are entries of the random matrix generated by the latent factors. In Bayesian LoRA, the observations are input-label pairs , and the latent update affects them only through the nonlinear network. The resulting prior-predictive distribution exhibits entirely different characteristics. Consequently, Bayesian LoRA requires a fundamentally different treatment from standard BMF.
In this paper, we study the prior predictive distribution of Bayesian LoRA and analyze its moments. Our estimators allow the prior hyperparameters to be selected in closed form. They need only the pretrained model and the fine-tuning data, and require neither LoRA optimization nor validation data (Table 1 compares the approaches). We effectively turn the prior specification from a model-selection problem after fine-tuning into a statistical estimation problem before fine-tuning.
Our contributions are as follows:
-
We develop a prior-predictive analysis of Bayesian LoRA that explicitly relates the LoRA prior scale and rank to moments of the induced changes in network outputs.
-
We derive a closed-form prior-predictive estimator for the Bayesian LoRA prior scale that can be computed before fine-tuning, does not require validation over trained models or post-hoc evidence optimization, and separates shared parameter-induced variation from independent observation noise.
-
We evaluate the resulting calibration procedure across controlled and pretrained-model experiments, testing whether prior-predictive calibration recovers appropriate prior scales and whether these scales provide competitive uncertainty quantification and predictive performance after Bayesian LoRA fine-tuning.
The code is available here. The appendices contain the proofs, additional estimators, the details of the experiments, and a further study of fine-tuning under the estimated prior (Appendix I).
where and denote the mean and scale (standard deviation) shared by all entries of , and and the same for . Throughout most of the paper we assume the standard (e.g., Yang et al., 2024) zero means and one shared scale: , . The prior is then induced from equation 1 through .
Throughout the rest of the paper, for brevity, we consider the frozen weights to be part of the network function itself and focus only on one-layer updates: . We explain the generalization to multiple modules in Section 5.
For random , the output is also
Table 1: Prior selection for Bayesian LoRA.
| validation search | marginal likelihood | ours | |
|---|---|---|---|
| available before fine-tuning | ✕ | ✕ | ✓ |
| needs no held-out data | ✕ | ✓ | ✓ |
| one estimate for all ranks | ✕ | ✕ | ✓ |
a random variable conditioned on the input . Therefore, the full generative model for fine-tuning is:
(2)
independently for .
Prior predictive matching. The generative model in equation 2 induces the prior predictive distribution , which describes how the outputs should scatter around the pretrained function under the chosen prior. Then, prior-predictive matching (Gelman et al., 2026) can be used to select the hyperparameters so that simple moments of this distribution agree with the corresponding empirical quantities. This, however, requires expressing the predictive distribution as a function of (Section 3) and identifying which empirical quantities should be matched (Section 4).
3 PRIOR PREDICTIVE MOMENTS
In this section, we find the characteristics of the prior predictive distribution for neural networks with Bayesian LoRA. First, we discuss the moments of the updates (Section 3.1) and then, we show how they can be propagated through the network (Section 3.2).
3.1 Moments of the update
Bayesian LoRA is an instance of Bayesian matrix factorization (BMF) in latent space. Therefore, the moments derived originally for BMF (da Silva et al., 2023) can be extended to Bayesian LoRA:
Lemma 1 (proof in Appendix A). With zero-mean factors of scale , the entries of have mean zero, are mutually uncorrelated, and share the variance :
Their fourth moment is , so the kurtosis equals .
Under the general factor prior equation 1 the mean becomes , the variance becomes , and distinct entries covary only within a row (covariance , through the shared row of U) or within a column (covariance , through the shared column of V).
Uncorrelated entries with a common variance mean that, up to second order, the prior acts on the network like isotropic noise of strength injected into the adapted weights. The variance couples the rank and the scale into one number, and therefore, second-order quantities cannot distinguish a rank-4 prior from a rank-16 prior with a suitably smaller scale. To distinguish them one needs to employ the 6/K kurtosis term. In theory, if the rank itself had to be inferred from data rather than chosen by budget, fourth-order prior-predictive information could be used. We verify it by simulation (Section 7.3).
3.2 Propagation through the network
Let denote the update with its entries stacked into one vector. is the gradient of the network output with respect to . is the corresponding Hessian, with entries . Finally, let and .
We show the propagation of moments of the latent variables to observed quantities (i.e., outputs of the network) for a network with a fixed example input x. For brevity, we consider just a single scalar output (for example, the probability of a single class). The only difference for multiple outputs is the additional dimension for all the objects: for example, the Hessian matrix becomes a tensor of Hessian matrices (one for each output).
The second-order Taylor expansion around the pre-trained network is
(4)
Under the prior the update is random, so for each fixed input the left-hand side of equation 4 is exactly the random output of Section 2, and its moments follow by taking expectations of the right-hand side over the prior, term by term. The linear term vanishes because . The quadratic term is an expectation of a quadratic form in the zero-mean vector . Written out over pairs of entries it is , and since is fixed and for zero-mean entries, . Lemma 1 states that, with zero-mean factors, the entries of are mutually uncorrelated and share the variance . Since each is one entry of , this means when and zero otherwise, so only the diagonal survives and the double sum collapses onto the trace, . Consequently, the mean shift of each output, expected under the prior, is
On the other hand, second moments can be obtained by multiplying two copies of equation 4, taken at inputs and , and then averaging over the prior again. At leading order only the product of the two linear terms survives, and it collapses exactly as before: . The cross terms between a linear and a quadratic factor contain third moments of , which vanish by the sign symmetry of the factors, and products of two quadratic terms are of order and dropped (Appendix A). This yields the prior predictive variance and the predictive covariance between the outputs at two different inputs. It is nonzero because both are functions of the same random draw :
Equations 5 and 6 specify the prior predictive distribution. The pretrained output at each input x is shifted in proportion to the local curvature (equation 5), and the outputs fluctuate jointly around the pretrained function with a covariance given by equation 6. Note that the prior predictive distribution depends on its hyperparameters ( , K) entirely through the single scalar .
Appendix A collects the omitted algebra and the study of the higher-order terms. Section 7.1 studies regions where the approximation is accurate.
3.3 Practical consequences
The prior predictive distribution induced by the prior on depends only on . Consequently, the problem of finding the prior's hyperparameters reduces to estimation of . However, practical LoRA implementations conventionally use rather than , and have the additional fixed scaling hyperparameter , i.e., . The additional multiplier scales the variance from Lemma 1 by , so
Corollary 1. If the data determine an optimal value of , then the optimal prior precision at rank obeys at fixed .
Corollary 1 is the Bayesian counterpart of rank-corrected scaling rules for deterministic LoRA (Kalajdzievski, 2023). It implies that any procedure tuning
must reproduce this scaling, and a prior-predictive estimate transfers across ranks without a new search, because does not depend on the rank. Section 7.5 tests the scaling in fine-tuning.
4 MOMENT MATCHING
In the standard matrix factorization task every observed matrix entry is a new sample from the prior, so ordinary averaging over the observations estimates prior-predictive moments directly. On the other hand, in Bayesian LoRA there is just one draw , evaluated at many inputs and read out through noisy labels, as in equation 2. Therefore, averaging over examples finds the expectations over inputs and over label noise, but not over the prior itself, making the estimation problem more challenging.
4.1 Basics
We start with a binary classification problem, where the network scalar output (as specified in Section 3.2) is the probability of the positive class. Let , and . The first expression denotes the pretrained probability at training input , a known number obtained by running the pretrained network. The second is the probability under the realized draw. It is not observable because is not, and the observed label is , i.e., . The third is the observable residual for example .
From equation 5 we get the expected residual:
(8)
where because is exactly the random output (Section 2), evaluated at the prior draw that generated the data.
We also abbreviate , , .
4.2 Binary classification estimator
The most straightforward use of equation 8, suggested by matrix-factorization matching, is to average both sides over the dataset and solve for . This naive aggregate estimator fails for several reasons, primarily because binary labels satisfy , so every statistic computed from a single example informs only the first moment, which by equation 5 carries just a weak second-order trace signal. In addition, on roughly balanced tasks the traces change sign and cancel in the sum. The details are discussed in Appendix B.
On the other hand, by equation 6, the prior scale determines the covariance between the outputs at different inputs. Since all labels share the single draw , the residuals of different examples are correlated, which allows us to estimate . Each residual is the functional shift of the draw plus the label noise, with . Given , the labels are independent with , so the noise terms are also independent across examples and satisfy . We identify the dependence of the residuals on by taking the expectation of for two examples jointly over the draw and the label noise (as in the model equation 2). Conditioning on , every term of the product that contains or has zero expectation, and by equation 6
(9)
Equation 9 gives one equation for every pair of examples, and it does not suffer from the problems of the naive estimator (Appendix B). We estimate from these equations by least squares. Minimizing gives .
An efficient implementation of the estimator does not require forming the pairs. Summing over all pairs and subtracting the terms with yields and , where has the per-example gradients as its rows, because and . Hence, the cross-covariance estimator for binary classification tasks is
Its complexity is linear in the number of examples. The subtracted terms are exactly the same-example terms, whose observation noise does not cancel.
4.3 Regression estimator
For regression tasks the likelihood in equation 2 is Gaussian: , with observation-noise variance . The derivation of equation 9 assumes only that the label noise has zero mean given the draw and is independent across examples. Both also hold for regression. Therefore, equation 9 and equation 10 can be applied directly to the residuals , and need not be known. If is known, the per-example second moments yield the following alternative estimator:
4.4 Multiclass estimator
For multiclass models and tasks (with outputs and classes), the residuals are vectors with entries , the gradients need to be computed per class, and the pair equations range over pairs of example-and-class rows. Since the label noise is dependent across the classes of one example, we use only products of residuals from different examples. Let have the class gradients of example as its rows, and let have all of them. Repeating the procedure of the binary estimator, we obtain
which reduces to equation 10 for C = 1.
5 IMPLEMENTATION
The estimators in Section 4 require per-example gradients with respect to each adapted weight matrix. Explicitly storing these gradients can be prohibitively expensive for large models, such as Transformer-based MLMs or LLMs, where many high-dimensional matrices are adapted over thousands of examples. We therefore develop an implementation that estimates the required quantities in one pass over the training data, without storing the full gradient matrices.
Multiple adapters. LoRA is typically applied to multiple weight matrices throughout the network. Let index the adapted modules. Under independent priors across adapters, their first-order contributions are uncorrelated, and the cross-example covariance decomposes as
where denotes the gradient associated with adapter for example . When a common scale is shared across adapters, as in the standard Laplace-LoRA prior, the inner products can be summed and equation 10 applies directly. Allowing a separate scale for each adapter instead yields an -dimensional least-squares problem, which is dominated by noise at typical single-task sample sizes (Appendix B). We therefore use a shared scale in our experiments.
5.1 Gradient sketches
To implement the estimator efficiently, we replace the per-example gradients by random sketches. For a linear
Algorithm 1 Closed-form prior precision for LoRA
1: Residuals .
2: One forward and backward pass: independent sketches by equation 14 per module.
3: by equation 10 on the sketches, squared inner products across the two.
4: return , or maximal precision if .
layer, the per-example gradient in matrix form, , is a sum of outer products over token positions, , where is the layer input and is the gradient of the scalar output with respect to the layer output.
Our estimators depend on these gradients only through inner products, which can be preserved in expectation by random projections. Let and be Gaussian sketch matrices with rows, normalized such that . We replace each gradient by the two-sided sketch
Because the sketch is linear in , it can be accumulated directly from the projected token-level factors without forming the full gradient matrix. Moreover, .
The denominator of equation 10 contains squared inner products. Squaring a single sketched estimate introduces a positive bias due to the sketch variance. We therefore use two independent sketches and multiply the corresponding inner-product estimates, which yields an unbiased estimator of the squared inner product (Appendix C).
5.2 Algorithm
Algorithm 1 requires a single forward-backward pass over the training set. If , the estimated cross-example signal is non-positive and we set the prior precision to its maximum value. The resulting estimate depends only on the pretrained model and the task data, and is therefore available before fine-tuning. It can be used directly as the Bayesian prior precision or as the corresponding regularization strength during optimization (Appendix I). By Corollary 1, the same computation applies to all LoRA ranks.
6 RELATED WORK
Our work relates to Bayesian treatments of LoRA, prior predictive analyses of neural networks, prior predictive matching, and the selection of the prior precision for Laplace approximations.
Bayesian LoRA. Bayesian treatments of LoRA differ mainly in how they approximate the posterior over the adapter weights. In particular, there exist variants based on a post-hoc Laplace approximation (Yang et al., 2024), variational inference during fine-tuning (Wang et al., 2024), stochastic weight averaging (Onal et al., 2024), and ensembles of adapters (Wang et al., 2023; Doan et al., 2025). In all of them, the prior scale is either fixed in advance or tuned after training. Hierarchical and meta-learned priors (Eide and Frigessi, 2024; Kim and Hospedales, 2025; Zhang et al., 2025) instead learn a shared prior from many related tasks. Our estimate is complementary: it sets the prior scale of a single task from its own data, before fine-tuning, and, in principle, can be combined with any of these posterior approximations. However, there also exist some other variants of Bayesian LoRA using a slightly different structure of the update, which places the posterior on a small matrix inside a projected low-rank subspace rather than on the projection matrices (Marszałek et al., 2025; Dubovik et al., 2026). Our derivations can be adapted to these structures with few changes, but this is beyond the scope of this paper.
Prior predictive analysis of neural networks. The distribution of the outputs of standard networks under random weights has been studied at initialization and in the infinite-width limit. In this limit it becomes a Gaussian process (Neal, 1996; Lee et al., 2018), and training of the linearized network is governed by the neural tangent kernel (Jacot et al., 2018). At finite width, the prior predictive is known in closed form and becomes increasingly heavy-tailed as depth grows relative to width (Noci et al., 2021; Zavatone-Veth and Pehlevan, 2021). It is analogous to the excess kurtosis 6/K of a rank-K update (Lemma 1).
Moments of the outputs under random weights also guide practical choices of scale. For example, signal propagation analyses use them to choose the initialization scale at which deep networks remain trainable (Schoenholz et al., 2017). Noci et al. (2022) extend this analysis to transformers. These analyses choose a scale as the depth grows, whereas rank-stabilized LoRA applies a related argument to the rank. It scales the adapter by so that the size of its output and of its gradients does not change with the rank during fine-tuning (Kalajdzievski, 2023). However, to our knowledge, no such rule existed for the prior precision of Bayesian LoRA. Corollary 1 provides the first one: it states how the precision must change with the rank so that the prior predictive stays fixed.
Function-space methods specify it either directly as a stochastic process (Sun et al., 2019) or by choosing the weight prior so that the functions it induces match a target process (Tran et al., 2022; Sendera et al., 2025). Meanwhile, Fortuin et al. (2021) empirically studied which weight priors suit trained networks.
In contrast, we propagate a factorized prior on the update through a second-order expansion around the pretrained weights, at finite width, and use the resulting moments to estimate the prior scale from data.
Prior predictive matching. Several approaches specify the prior through the predictions it implies. Predictive complexity priors define the prior by comparing the predictions of the model with those of a simpler reference model (Nalisnick et al., 2021). Prior predictive matching instead chooses the hyperparameters so that statistics of the prior predictive distribution agree with target values. It connects prior elicitation, which translates knowledge about observable quantities into prior distributions (Mikkola et al., 2024), with prior predictive checks, a standard step of the Bayesian workflow (Gabry et al., 2019). In elicitation, the targets are judgments of an expert, and Hartmann et al. (2020) fit them by stochastic optimization, which, however, works only for simple shallow models. By contrast, for BMF, da Silva et al. (2023) obtain the targets from the data and match prior predictive moments of the observed entries in closed form. da Silva et al. (2026) study when tensor ranks are identifiable from such moments. Closed-form empirical Bayes solutions also exist for fully observed variational matrix factorization (Nakajima et al., 2013).
Bayesian LoRA, however, differs in that the observations depend on the update only through the nonlinear pretrained network and share a single draw of it (Section 4).
Precision selection and calibration. The standard ways to choose the prior precision of a Laplace approximation are maximization of the marginal likelihood (MacKay, 1992; Immer et al., 2021a; Antorán et al., 2022) and validation search. Both require a trained (in our case: already a fine-tuned) model.
In contrast, our estimate needs neither a trained model nor validation data. However, when validation data are available, it can additionally use them to fit a temperature (Guo et al., 2017). This optional step allows it to match validation search in test NLL (Section 7.4).
7 EXPERIMENTS
In this Section, we first validate the theoretical approximations and parameter recovery in controlled experiments, where the data-generating prior is known (Sections 7.1 to 7.3). Then, we evaluate the estimated prior precision on RoBERTa-large, considering predictive performance, calibration, the dependence on the LoRA rank, and out-of-distribution detection (Sections 7.4 to 7.6).

Figure 1: Ratio of moments of the network output to their second-order predictions (Equations 5 and 6). Shaded: (the range used in Section 7.2).
In the controlled experiments, is drawn from the factor prior (equation 1), and predictions are computed using a full nonlinear network. We parameterize the strength of the induced functional perturbation by , where is the average of over the inputs. By equation 6, is the average prior variance of the output.
7.1 Accuracy of the second-order approximation
We first evaluate the quality of the moment approximations (equation 5 and equation 6), on which our estimators depend. Figure 1 compares them against Monte Carlo estimates for a small tanh network (Appendix E).
The approximation is accurate for . In this range, the variance error is below 2% for , while the mean-shift error is at most 17%. At fixed , the results are nearly invariant to , as predicted in Section 3.2. The main exception is , where the first neglected term depends on the kurtosis (Appendix A).
For stronger priors, the second-order expansion overestimates both moments as the nonlinear output saturates. The discrepancy becomes substantial beyond and exceeds 50% at . Since the estimator inverts these moments, this regime produces an upward bias in . We therefore restrict the experiment in Section 7.2 (scale recovery) to the regime where the approximation is accurate.
7.2 Recovery of the prior scale
We next test whether the cross-covariance estimator recovers the prior scale from a single task (Figure 2). Each task draws one update at the true , generates N labels according to equation 2, and estimates

Figure 2: Recovery of the prior scale: average one standard deviation.
with . We consider regression with Gaussian noise and binary classification with a logistic model. For regression, we additionally compare equation 10 with equation 11 (which is given the true noise level). The prior scales span from to , within the regime validated in Section 7.1. Appendix E covers any remaining details.
Across tasks with positive estimates, is within 4% of the true scale for regression and within 6% for classification. The cross-covariance estimator, which does not use , is as accurate as the second-moment estimator that uses the true noise level. At the smallest classification scale, 5% of tasks yield . These cases are excluded. The standard deviation of across tasks is 11 to 17% of , compared with 9 to 13% for the second-moment estimator. This spread comes mostly from the update itself: each task observes a single draw , whose entries are by chance larger or smaller than the prior scale implies (Section 4).
7.3 Rank information in fourth moments
Second-order moments depend on the rank and prior scale only through and therefore cannot identify K separately (Section 3.1). In this subsection, however, we verify that rank information appears in the fourth moment of the prior predictive.
To first order, the output perturbation for example is , where is the matrix form of . Its kurtosis is
where are the singular values of (Appendix A.3). For a single entry of , , recovering the result of Lemma 1. We estimate the slope of against and set .
The networks contain one tanh layer followed by a linear output for regression and a logistic output for

Figure 3: Recovery of the rank from the kurtosis (Equation 15). Median over 10 repetitions, with interquartile bars. The green line in the right panel ends early, as for larger K the estimates are undefined or outside the plotted range.
classification. Each of 24 examples averages two inputs, so that has rank two (Appendix E). We estimate the kurtosis from 10,000 independent draws of without label noise. This experiment therefore tests identifiability under the prior predictive. It does not estimate K from a single task.
For the linearized output, the median is within 13% of the true rank. At , the nonlinear network agrees with this estimate within 3%. Recovery deteriorates for stronger priors, particularly for classification. This follows from equation 15: the rank enters only through the small correction , making fourth moments more sensitive to the nonlinearity than the second-order quantities used for scale estimation. The experiment thus confirms that the prior predictive contains rank information, but also that this information is fragile under nonlinear distortion.
7.4 Predictive performance
We now turn to Bayesian LoRA fine-tuning of RoBERTa-large (Liu et al., 2019), where the true prior is unknown and the estimated precision is evaluated by its predictive performance. We follow Laplace-LoRA (Yang et al., 2024) and use the pretrained masked-language-model head for classification, so that defines task predictions before adaptation. We consider SST-2, MR, CR, and AG News, with 64 to 4,096 training examples and three seeds.
The posterior is a Kronecker-factored Laplace approximation with prior precision (Daxberger et al., 2021), and predictions use the linearized predictive (Immer et al., 2021b). As is standard for deep networks, the posterior is fitted (in stage 2) after point-wise fine-tuning (=stage 1), so enters only after training and all methods share the point-wise fine-tuned model and its Laplace approximation, differing only in . However, note that our method finds already before fine-tuning, which also allows its use during 1st stage of training (we study it in Appendix I). We compare against the MAP predictor (the fine-tuned weights alone, i.e., , which makes the posterior variance negligible) and two post-training choices used by Laplace-LoRA: maximization of the marginal likelihood and selection of by validation NLL. The latter reserves 20% of the available examples, and henceforth all methods are trained only on the remaining 80%. Appendix H gives the full protocol and per-task results (Tables 3 to 6).
Among methods that do not use the validation set for precision selection, ours achieves the lowest test NLL at every training-set size (Figure 4). It improves over MAP in all 46 runs and over marginal likelihood in all 35 runs up to 1,024 examples. At 64 examples, it is also the only one of these methods to improve over the pretrained model, signifying its robustness for tiny data set sizes. Its ECE is lower than that of MAP and marginal likelihood while its accuracy matches MAP. Finally, we note that the prior estimate takes at most 40 seconds, compared with 30-40 minutes for LoRA fine-tuning.
Validation search achieves a further NLL reduction of 0.03-0.09 nats. However, when validation data are available, fitting a temperature to our predictive distribution (ours + T) reduces this gap to at most 0.01 nats from 256 examples onward. At 64 examples, where the validation set contains only 13 observations, temperature scaling instead increases NLL and ECE for all methods considered.
7.5 Prior precision across LoRA ranks
By Corollary 1, one estimate determines the prior at every rank, with , so the rank can be changed without estimating again.
We test this by fine-tuning on AG News and CR with 1,024 training examples, LoRA ranks from 4 to 64, and three seeds, with the posterior and predictive of Section 7.4. As a reference, is the precision with the lowest validation NLL among values from to (Appendix F).
Figure 5 shows that our is close to at small ranks, but it diverges from the optimum at higher ranks, and its NLL grows with the rank. This is because falls faster than , close to in both tasks (fitted slope -0.99). The faster decrease does not contradict the corollary, which holds for the prior. It arises from a practical choice, the linearized predictive used for

Figure 4: RoBERTa-large on SST-2, MR, CR and AG News, mean over the four tasks and three seeds. Bottom right: reliability diagram at 4,096 training examples, ten bins of equal size. Solid lines use no validation data. Ours + T adds a temperature fitted on the validation set. The other methods with a temperature, and each task separately, are in Figure 8.
prediction, whose variance scales as rather than as under the prior (Appendix G). Finally, we also note that a temperature fitted on the validation set removes this loss, and ours + T matches validation search with a temperature at every rank (Table 2).
7.6 Detection of out-of-distribution inputs
Finally, we evaluate posterior uncertainty on out-of-distribution (OOD) inputs (Figure 6). For each test input, the linearized predictive gives a Gaussian distribution over the logits (Appendix D). We sample the logits from it, which needs no further passes through the network, and use the mutual information between the prediction and the weights as the uncertainty score. We report the area under the ROC curve (AUROC) for distinguishing the task's test inputs from those of another task: AG News is OOD for the sentiment tasks, and SST-2 is OOD for AG News. The MAP predictor has no posterior and is therefore excluded.
For the three sentiment tasks, our method obtains the highest AUROC at every training-set size, ranging from 0.79 to 0.81. It exceeds validation search in 30 of 34 runs and marginal likelihood in all 34, with the largest gain over marginal likelihood at 64 examples. On AG News, our method obtains AUROC values from 0.83 to 0.90, while validation search is higher by 0.01-

(lowest validation NLL) ours,
(a) AG News

(lowest validation NLL) ours,
(b) CR
Figure 5: Prior precision across LoRA ranks on RoBERTa-large. Left: validation NLL against the prior precision at three ranks for one seed, with its minimum and ours, . Right: of every run against the rank, its least-squares fit, and ours (medians).
0.02. Marginal likelihood is substantially worse in the low-data regime but reaches the highest AUROC at 4,096 examples. Overall, the estimated prior yields competitive OOD uncertainty without using validation data for precision selection.
8 CONCLUSION
We studied the prior predictive distribution for Bayesian LoRA and introduced a closed-form, moment-based method that specifies the prior. The method does not require a validation set and can be applied before fine-tuning.
Using a second-order expansion, we showed that the rank and the factor scale affect the prior-predictive variance only through . Since all examples of a dataset share the same LoRA update, is reflected in the covariance between residuals of different examples. Matching these covariances yields an estimator of , and therefore of the prior precision. Under standard LoRA scaling, this also gives the rank dependence .
Controlled experiments show that the second-order approximation is accurate for sufficiently small prior

Figure 6: AUROC for separating OOD inputs from the task's own test inputs, with the mutual information as the score, mean over three seeds (left, also over the three tasks). The OOD inputs are AG News for the sentiment tasks and SST-2 for AG News. Per-task results are in Figure 9 and Table 7.
perturbations and that the proposed estimator recovers the prior scale from a single task. We further showed that fourth-order moments allow us to recover information about the rank. On RoBERTa-large, without validation data, the estimated prior improves NLL and calibration over MAP and marginal-likelihood selection and provides competitive OOD detection. Validation search remains slightly better in NLL, but when validation data are available, temperature scaling largely closes this gap.
Limitations and future work. The proposed estimator relies on a local second-order approximation and becomes biased when the LoRA update induces large changes in the network output. Extending the method beyond this local regime, for example through higher-order expansions or alternative approximations to the prior predictive, is a possible direction for future work.
The accuracy of the estimator also varies across tasks because each task provides only one realization of the LoRA update. More efficient estimators that exploit additional structure across examples, tasks, or repeated adaptations could reduce this variability.
The second-order estimator identifies the combined scale but not the rank itself, which must therefore still be chosen separately. Our fourth-order analysis shows that the prior predictive contains information about the rank, but turning this result into a stable estimator from a single task remains open.
Finally, the approach may extend to generative objectives, where next-token prediction is a multiclass problem at every position, as well as to regression tasks at scale and to settings without an immediately available task-aligned output. Such extensions are natural next steps but are beyond the scope of this work.
References
Antorán, J., Janz, D., Allingham, J. U., Daxberger, E., Barbano, R. R., Nalisnick, E., and Hernández-Lobato, J. M. (2022). Adapting the linearised laplace model evidence for modern deep learning. In International Conference on Machine Learning, pages 796–821. PMLR.
da Silva, E. d. S., Klami, A., Mesquita, D., and Urteaga, I. (2026). On the identifiability of tensor ranks via prior predictive matching. In The 29th International Conference on Artificial Intelligence and Statistics.
da Silva, E. d. S., Kuśmierczyk, T., Hartmann, M., and Klami, A. (2023). Prior specification for Bayesian matrix factorization via prior predictive matching. Journal of Machine Learning Research, 24(67):1–51.
Daxberger, E., Kristiadi, A., Immer, A., Eschenhagen, R., Bauer, M., and Hennig, P. (2021). Laplace redux-effortless bayesian deep learning. Advances in neural information processing systems, 34:20089–20103.
Doan, B. G., Shamsi, A., Guo, X.-Y., Mohammadi, A., Alinejad-Rokny, H., Sejdinovic, D., Teney, D., Ranasinghe, D. C., and Abbasnejad, E. (2025). Bayesian low-rank learning (bella): A practical approach to bayesian neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, pages 16298–16307.
Dubovik, V., Marszałek, P., Tabor, J., and Kuśmierczyk, T. (2026). Bayesian fine-tuning in projected subspaces. arXiv preprint arXiv:2605.07706.
Eide, S. and Frigessi, A. (2024). Bora: Bayesian hierarchical low-rank adaption for multi-task large language models. arXiv preprint arXiv:2407.15857.
Fortuin, V., Garriga-Alonso, A., Ober, S. W., Wenzel, F., Rätsch, G., Turner, R. E., van der Wilk, M., and Aitchison, L. (2021). Bayesian neural network priors revisited. arXiv preprint arXiv:2102.06571.
Gabry, J., Simpson, D., Vehtari, A., Betancourt, M., and Gelman, A. (2019). Visualization in bayesian workflow. Journal of the Royal Statistical Society Series A: Statistics in Society, 182(2):389–402.
Gelman, A., Vehtari, A., McElreath, R., Simpson, D., Margossian, C. C., Yao, Y., Kennedy, L., Gabry, J., Bürkner, P.-C., Modrák, M., et al. (2026). Bayesian workflow. Chapman & Hall/CRC.
Guo, C., Pleiss, G., Sun, Y., and Weinberger, K. Q. (2017). On calibration of modern neural networks. In International Conference on Machine Learning, pages 1321–1330. PMLR.
Hartmann, M., Agiashvili, G., Bürkner, P., and Klami, A. (2020). Flexible prior elicitation via the prior predictive distribution. In Proceedings of the 36th Conference on Uncertainty in Artificial Intelligence
(UAI), volume 124 of Proceedings of Machine Learning Research, pages 1129–1138. PMLR.
Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., and Chen, W. (2022). LoRA: Low-rank adaptation of large language models. In The Tenth International Conference on Learning Representations.
Hu, M. and Liu, B. (2004). Mining and summarizing customer reviews. In Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 168–177. ACM.
Hutchinson, M. F. (1989). A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 18(3):1059–1076.
Immer, A., Bauer, M., Fortuin, V., Rätsch, G., and Khan, M. E. (2021a). Scalable marginal likelihood estimation for model selection in deep learning. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 4563–4573. PMLR.
Immer, A., Korzepa, M., and Bauer, M. (2021b). Improving predictions of bayesian neural nets via local linearization. In International conference on artificial intelligence and statistics, pages 703–711. PMLR.
Jacot, A., Gabriel, F., and Hongler, C. (2018). Neural tangent kernel: Convergence and generalization in neural networks. Advances in Neural Information Processing Systems, 31.
Kalajdzievski, D. (2023). A rank stabilization scaling factor for fine-tuning with LoRA. arXiv:2312.03732.
Kim, M. and Hospedales, T. (2025). Lift: Learning to fine-tune via bayesian parameter efficient meta fine-tuning. In International Conference on Learning Representations.
Lee, J., Bahri, Y., Novak, R., Schoenholz, S. S., Pennington, J., and Sohl-Dickstein, J. (2018). Deep neural networks as Gaussian processes. In 6th International Conference on Learning Representations.
Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. (2019). RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692.
MacKay, D. J. (1992). A practical bayesian framework for backpropagation networks. Neural computation, 4(3):448–472.
Marszałek, P., Balazy, K., Tabor, J., and Kuśmierczyk, T. (2025). Minimal ranks, maximum confidence: Parameter-efficient uncertainty quantification for LoRA. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 1260–1271,
Suzhou, China. Association for Computational Linguistics.
Mikkola, P., Martin, O. A., Chandramouli, S., Hartmann, M., Abril Pla, O., Thomas, O., Pesonen, H., Corander, J., Vehtari, A., Kaski, S., et al. (2024). Prior knowledge elicitation: The past, present, and future. Bayesian Analysis, 19(4):1129–1161.
Nakajima, S., Sugiyama, M., Babacan, S. D., and Tomioka, R. (2013). Global analytic solution of fully-observed variational Bayesian matrix factorization. Journal of Machine Learning Research, 14(1):1–37.
Nalisnick, E., Gordon, J., and Hernández-Lobato, J. M. (2021). Predictive complexity priors. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 694–702. PMLR.
Neal, R. M. (1996). Bayesian Learning for Neural Networks. Lecture Notes in Statistics. Springer New York.
Noci, L., Anagnostidis, S., Biggio, L., Orvieto, A., Singh, S. P., and Lucchi, A. (2022). Signal propagation in transformers: Theoretical perspectives and the role of rank collapse. In Advances in Neural Information Processing Systems, volume 35, pages 27198–27211. Curran Associates, Inc.
Noci, L., Bachmann, G., Roth, K., Nowozin, S., and Hofmann, T. (2021). Precise characterization of the prior predictive distribution of deep ReLU networks. In Advances in Neural Information Processing Systems, volume 34, pages 20851–20862. Curran Associates, Inc.
Onal, E., Flöge, K., Caldwell, E., Sheverdin, A., and Fortuin, V. (2024). Gaussian stochastic weight averaging for bayesian low-rank adaptation of large language models. arXiv preprint arXiv:2405.03425.
Pang, B. and Lee, L. (2005). Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics (ACL'05), pages 115–124, Ann Arbor, Michigan. Association for Computational Linguistics.
Schoenholz, S. S., Gilmer, J., Ganguli, S., and Sohl-Dickstein, J. (2017). Deep information propagation. In 5th International Conference on Learning Representations.
Sendera, M., Sorkhei, A., and Kuśmierczyk, T. (2025). Revisiting the equivalence of bayesian neural networks and gaussian processes: On the importance of learning activations. In Chiappa, S. and Magliacane, S., editors, Proceedings of the Forty-first Conference on Uncertainty in Artificial Intelligence, volume 286 of Proceedings of Machine Learning Research, pages 3675–3700. PMLR.
Socher, R., Perelygin, A., Wu, J., Chuang, J., Manning, C. D., Ng, A., and Potts, C. (2013). Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631–1642, Seattle, Washington, USA. Association for Computational Linguistics.
Sun, S., Zhang, G., Shi, J., and Grosse, R. (2019). Functional variational Bayesian neural networks. In International Conference on Learning Representations.
Tran, B.-H., Rossi, S., Milios, D., and Filippone, M. (2022). All you need is a good functional prior for Bayesian deep learning. Journal of Machine Learning Research, 23(74):1–56.
Wang, A., Singh, A., Michael, J., Hill, F., Levy, O., and Bowman, S. R. (2019). GLUE: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations.
Wang, X., Aitchison, L., and Rudolph, M. (2023). LoRA ensembles for large language model fine-tuning. arXiv preprint arXiv:2310.00035.
Wang, Y., Shi, H., Han, L., Metaxas, D. N., and Wang, H. (2024). BLoB: Bayesian low-rank adaptation by backpropagation for large language models. In The 38-th Annual Conference on Neural Information Processing Systems.
Yang, A. X., Robeyns, M., Wang, X., and Aitchison, L. (2024). Bayesian low-rank adaptation for large language models. In The Twelfth International Conference on Learning Representations.
Zavatone-Veth, J. and Pehlevan, C. (2021). Exact marginal prior distributions of finite Bayesian neural networks. In Advances in Neural Information Processing Systems, volume 34, pages 3364–3375. Curran Associates, Inc.
Zhang, L., Snell, J. C., and Griffiths, T. L. (2025). Amortized bayesian meta-learning for low-rank adaptation of large language models. In Proceedings of the 2nd Workshop on Uncertainty-Aware NLP (UncertainNLP 2025), pages 194–199.
Zhang, X., Zhao, J., and LeCun, Y. (2015). Character-level convolutional networks for text classification. In Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc.
Prior Predictive Matching for Bayesian LoRA Supplementary Materials
Appendix A proves the results of Section 3, and Appendix B derives further estimators, among them the naive aggregate and the trace-instrument estimators. Appendix C presents the guarantees of the gradient sketches, and Appendix D the posterior approximations, the predictive and the evidence. Appendix E describes the settings of the toy experiments, Appendix F the protocol and full results of the rank study of Section 7.5, Appendix G explains why the best precision for the linearized predictive scales differently with the rank than under the prior, and Appendix H the setup and per-task results of the RoBERTa-large experiments. Appendix I fine-tunes RoBERTa-large under the estimated prior.
A PROOFS
A.1 Proof of Lemma 1
Fix an entry and write the summands as , so that . Under equation 1 all factor entries are mutually independent, so the are independent across , and within each the two factors are independent of one another. We first consider the zero-mean case , , then the general one.
Mean. Independence of the two factors inside each product yields
Variance. Each product has second moment
and since the are independent with mean zero, their variances add:
Distinct entries are uncorrelated. For , zero means allow us to compute the covariance as a raw second moment, and independence of the block from the block factorizes each term:
We distinguish three cases, which together cover all pairs. If the entries share a row, and , then and are distinct entries of for every , hence independent, so and every term of equation 19 vanishes. If the entries share a column, the same argument applies to the expectations. If they share neither index, both expectations factor into products of zero means. In all three cases the covariance is zero.
Fourth moment. Gaussian factors satisfy , so each product has
Expand by the multinomial theorem and compute the expectations term by term. Each is symmetric about zero and independent of the others, so any term containing some to an odd power has expectation zero. Only two types of terms have nonzero expectation: the pure fourth powers, and the mixed squares with , each carrying the multinomial coefficient over the unordered pairs. Hence
and dividing by the squared variance yields the kurtosis
General factor means. Now consider equation 1 with arbitrary . The mean follows directly: . All remaining computations reduce to the pair moments of factor entries, which follow from independence of distinct entries:
For the variance, insert equation 23 into the double sum for and split it into diagonal and off-diagonal parts:
and subtract to obtain as stated. For two entries in the same row , the expectation is the constant by equation 23, so
and subtracting the product of the means, , leaves : the shared row of is the only surviving source of correlation. The same-column case is the mirror image and yields .
A.2 From equation 4 to equation 5 and equation 6
Abbreviate , , , and , with primes for evaluation at and indices running over the entries of as in Section 3.2, so that the expansion equation 4 reads
The derivation uses two facts about from Lemma 1: its entries have and , with the Kronecker delta.
Mean. Compute the expectation of equation 26 term by term. The linear term is . The quadratic term expands as a double sum over entries,
which, multiplied by , yields the mean shift equation 5.
Second moments. Multiply equation 26 by its copy at and compute the expectations. The product splits into four groups of terms:
(28)
As for the mean, the first line simplifies through the entry covariances:
The second line consists of third moments . Flipping the sign of maps while leaving the zero-mean prior equation 1 unchanged, so the distribution of is symmetric, every odd moment vanishes, and the whole line is zero. The third line is a fourth-moment expression, . Each fourth moment of the entries of is a sum of nonzero products of factor moments, each of order , so it is , and so is the whole line. Passing from the raw second moment to the covariance subtracts the product of the two mean shifts, , which changes nothing at leading order. Altogether,
which is the covariance half of equation 6, and setting yields the variance half, .
The dropped terms. The terms come from the fourth moments of . The entries of are uncorrelated but not independent, because entries in the same row share a row of and entries in the same column share a column of . Entries that share neither a row nor a column behave as independent, . Entries that coincide or share a row or a column do not: , , and the four corners of a rectangle give . These corrections of relative order are where the rank first enters beyond . This is the same fourth-order separation of discussed in Section 3.1, and it is why every second-order prediction in the main text is a function of alone.
A.3 Kurtosis of a linearized output
Let be a fixed matrix with singular values , and let with drawn from the zero-mean factor prior. With the -th column of and the -th row of ,
a sum of independent and identically distributed terms. The entries of and are independent , so their distribution does not change under rotations, and in the singular bases of one term has the distribution of with independent standard normal. Its second moment is . In its fourth moment the terms with an odd power of some or vanish, and , so the fourth moment is
One term therefore has kurtosis with . For a sum of independent and identically distributed terms with mean zero, the excess kurtosis is divided by , which yields equation 15. The second moment of is , in agreement with equation 6.
B ESTIMATOR INSTANCES AND DERIVATIONS
Pair equation and least squares. The derivation of the cross-covariance estimator equation 10 from the pair equation equation 9, including the least-squares step and the two add-and-subtract identities, appears in full in Section 4. This appendix collects the instances and variants that the main text states without proof.
The naive aggregate estimator and why it fails. The most direct use of equation 8 is the one that matrix-factorization matching would suggest: average both sides over the dataset and solve for the single unknown, which yields the naive aggregate estimator
It matches the average observed label against the average predicted output, as one matches the average observed matrix entry in factorization models. It fails here for two separate reasons.

Figure 7: The three estimators of for binary classification on the task of Figure 2. Average one standard deviation, over the tasks with .
The practical reason is a sign cancellation in the denominator. For a binary softmax head the output is the logistic function of the logit margin, , so at the pretrained point the probability is , and applying the chain rule twice there yields a Hessian trace proportional to the second derivative of the logistic function, (see the next paragraph). The factor flips sign at , so on any roughly balanced task the traces nearly cancel in the sum. On the balanced binary task of Section 7.2 (a logistic model with 400,000 examples and a known true prior) we measure , meaning the denominator of equation 31 retains about 0.3 percent of the available signal, and the estimate is dominated by noise. It is non-positive in about half of the tasks and otherwise does not follow the true (Figure 7).
The second, structural reason applies even without this cancellation. Binary labels satisfy , so every statistic computed from a single example is a function of alone and informs only the first moment, which by equation 5 carries only a weak second-order trace signal. The prior scale controls a variance, so Section 4.2 estimates it from the covariance between examples.
The trace of a binary softmax head. Let's write the scalar output as with the logit margin and the logistic function. Applying the chain rule twice yields the weight-space Hessian . When the adapted weights enter the logit linearly, as for an adapter in the layer producing the logits, the second term vanishes and . In general, the first term, the Gauss-Newton part, carries the same factor. Since , the trace inherits the sign flip at that drives the cancellation above.
Regression. In regression, the residuals are . The observation noise is independent across examples, so it drops out of all pairs and the noise level never needs to be known. The per-example second-moment alternative equation 11 can be used when is known and agrees with the covariance form in our simulations.
Multiclass. With classes, the residuals are the vectors , and the gradients are computed for each class. The pair equations read and range over pairs of example and class rows. Within one example the multinomial noise is dependent across classes, so all pairs sharing an example are excluded, which replaces the diagonal subtractions of equation 10 by block subtractions over the blocks of each example. On synthetic data, this estimator recovers the true scale to within a few percent.
Many adapters. Independence of the per-adapter priors makes cross-adapter response terms vanish in expectation, which yields equation 13. The pooled instance sums the sketched inner products over adapters before applying equation 10. The separated instance solves the linear system with the residual-weighted sum of inner products of adapter and the pairwise products of inner products, all computable in sketch space. In simulation the separated covariance system recovers two true scales jointly, and the first-moment analogue fails because the per-adapter trace profiles correlate at 0.74 across examples. At real-task sample sizes the separated system is noise dominated, so the pooled scale is the practical choice.
Token-level generative models. Next-token prediction is a multiclass problem at every token position. A practical instance would use the following: the probability of the observed token as the scalar output, one backward pass per sequence, the residual at each position, and only pairs of positions in different sequences, mirroring the block exclusion above.
A first-moment alternative and its limits. Regressing on by least squares, as equation 8 suggests, yields the trace-instrument estimator , which is consistent but label-noise limited, since the trace signal is second order. Its inputs can be estimated with Hutchinson's method (Hutchinson, 1989), which estimates the trace from a few Hessian-vector products through the identity for random probe vectors with identity covariance. For adapted linear layers the traces can be computed exactly from the activations, because the trace reduces to second derivatives with respect to the layer outputs weighted by squared norms of the layer inputs. Our simulations use the exact form. The variant is useful as a cross-check at large true scales (Figure 7, where it is non-positive in 27 to 54% of the tasks and otherwise overestimates ) and is not used in the main pipeline, which needs only first-order gradients. Per-module variants of equation 10 exist, but at our sample sizes the module-wise systems are noise dominated, so we report the pooled scale.
C SKETCHING AND ITS GUARANTEES
If has independent entries, then , and by independence of the two sides of equation 14 the sketched inner products are unbiased,
including the diagonal entries. Squared inner products acquire a variance bias under a single sketch. Using two independent sketch pairs and multiplying the inner product from one by that from the other removes it, since . All contractions are computed in sketch space, for instance and , with the sketched counterpart of in Section 4.2, so no matrix of size is ever formed. In a test on a controlled model with sketch width , the estimate of is within about ten percent of the exact computation, and the scale, which is its fourth root, within three percent.
D POSTERIOR APPROXIMATIONS, PREDICTIVE, AND EVIDENCE
The pretrained-model experiments use the Laplace approximation of Laplace-LoRA (Yang et al., 2024), computed with its code, which builds on the laplace library (Daxberger et al., 2021). The posterior over the LoRA parameters w, the entries of the factors U and V of all adapted layers, is , where are the trained parameters (Section 7.4), is the Kronecker-factored generalized Gauss-Newton matrix of the training loss at and is the prior precision. Predictions use the linearized predictive (Immer et al., 2021b): the logits at x are Gaussian, centred at those of , with covariance , where is the Jacobian of the logits with respect to w, and the class probabilities are the softmax averaged over samples of the logits. The mutual information of Section 7.6 is the entropy of this averaged prediction minus the average entropy of the sampled predictions.
Marginal likelihood chooses by maximizing the Laplace approximation of the evidence,
with the number of LoRA parameters, by gradient steps on . Validation search performs gradient steps on that lower the NLL of the predictive on the validation set, starting from the marginal-likelihood value. The MAP uses in the same predictive. A temperature replaces the predictive probabilities by , renormalized, and is fitted on the validation set. Appendix H reports the numbers of steps, samples and temperatures.
E TOY EXPERIMENTS
Second-order moments (Section 7.1). The network is a two-layer tanh classifier with 20 inputs and 12 hidden units, with the update on the first layer. The moments are estimated at six inputs from 40,000 draws per
and .
Prior scale (Section 7.2). For regression the network is with 32 inputs and 16 hidden units. Each task has examples and label noise , which keeps the ratio of signal to noise fixed across . For binary classification the network is a logistic model with 32 inputs, and since the Bernoulli noise does not shrink with , each task has examples. There are 80 tasks per scale for regression and 96 for classification.
Rank (Section 7.3). The networks are with 112 inputs and 112 hidden units, followed by a fixed output layer. Each of the 24 examples averages the outputs at two inputs, so that ranges from 0.67 to 0.90. The study is repeated 10 times for each from 10 to 100 and each .
F RANK TRANSFER IN FINE-TUNING
This appendix presents the protocol and the full results of the rank study in Section 7.5. The model, the training and the posterior are those of Appendix H with 1,024 examples, 819 for training and 205 for validation, except that the LoRA rank is . The tasks are AG News and CR. For each run we evaluate the validation and test NLL of the predictive at 41 precisions from to , equally spaced on a log scale, and define as the minimizer of the validation NLL. In every run it lies inside this range. The seeds are 0, 1 and 2 for AG News and 1, 2 and 3 for CR. For CR with seed 0 the evaluation at the 41 precisions failed at two ranks, because the covariance of the logits was numerically not positive definite, and we replaced this seed. We fit the slope of against by least squares with one intercept per task, with a 95% bootstrap interval over the 30 runs.
Each task alone yields the same slope of as the two tasks together, close to , and so do the precisions chosen by validation search and by marginal likelihood. Table 2 reports , and the test NLL at every rank. On AG News one seed yields a much smaller , which explains the large spread of our NLL between seeds. In Figure 5, the validation NLL at is interpolated between the two nearest of the 41 precisions.
Appendix G explains the slope of by the variance of the linearized predictive, which scales as . The runs confirm this scaling. Let be the variance of a logit under this predictive, averaged over the test examples and classes. Within a run, is inversely proportional to the precision. For example, ours and validation search choose precisions up to 30 times apart, yet their products agree within . Across ranks, shows no trend.
Table 2: Rank study on RoBERTa-large with 1,024 training examples. and : median over three seeds. Test NLL: mean over the seeds their standard deviation, at and for each method. “+ T” adds a temperature fitted on the validation set.
| task | test NLL | validation search | ||||||
|---|---|---|---|---|---|---|---|---|
| at | ours | + T | ||||||
| AG News | 4 | 2,512 | 3,340 | |||||
| 8 | 1,585 | 2,362 | ||||||
| 16 | 631 | 1,670 | ||||||
| 32 | 398 | 1,181 | ||||||
| 64 | 158 | 835 | ||||||
| CR | 4 | 631 | 988 | |||||
| 8 | 398 | 699 | ||||||
| 16 | 158 | 494 | ||||||
| 32 | 63 | 349 | ||||||
| 64 | 63 | 247 | ||||||
G RANK SCALING OF THE PRIOR AND OF THE LINEARIZED PREDICTIVE
Corollary 1 holds for the prior, and the measurement of Section 7.5 does not contradict it. The two yield different rank scalings because they concern different predictives. The corollary keeps the prior predictive fixed, and under the prior the variance of is quadratic in . After fine-tuning, the Laplace posterior is used through a predictive linearized at the trained factors. This is the standard practical choice, because the linearized predictive predicts better than a predictive that evaluates the network at samples of the weights (Immer et al., 2021b). Its variance is linear in and, at a fixed , falls as . The difference does not come from the range of the second-order expansion of Section 3.2. It appears even for a network that is linear in , because it comes from the factorization of .
Let's write the factors as their trained values plus a perturbation, and . Then
Under the prior the factors are centred at zero, so, with and replaced by zero, only the last term is present. By equation 7 its entries have variance , and keeping this variance fixed yields .
The Laplace posterior of Appendix D is centred at the trained factors. Its covariance ( is close to in the directions where dominates , which with few training examples and many LoRA parameters are most directions. The linearized predictive replaces the network by its first-order expansion in the LoRA parameters at their trained values. It therefore retains the middle term of equation 32 and omits the last one. If the entries of and are independent with variance , the entry of the middle term has variance
which is linear in . When the entries of the trained factors have a size that does not depend on the rank, each sum grows as , and equation 33 scales as . In LoRA, is initialized with a scale set by the input dimension and at zero, so this holds as long as fine-tuning does not change the scale of the factors with the rank. The runs of Appendix F confirm the resulting scaling for the logits. The precision that keeps the variance of the linearized predictive at the level that predicts best then falls as , the slope measured in Section 7.5.
Our estimate sets the prior, and is the rank scaling of the prior. Used directly as the precision of the linearized predictive, it moves away from the best precision by a factor that grows as , and a temperature fitted on validation data compensates for this (Section 7.5). A rank scaling for the precision of the linearized predictive would have to account for the trained factors through equation 33, and they are not available before fine-tuning.
A predictive that samples the factors from the posterior and evaluates the network at each sample, instead of linearizing it, retains the last term of equation 32. Its variance is then the sum of equation 33 and , which scales with the rank as under the prior. The best precision for this predictive would fall with the rank between and , depending on which of the two parts dominates. We have not evaluated this predictive.
H ROBERTA-LARGE EXPERIMENTS
Data. The test sets are the GLUE validation set of SST-2 (Socher et al., 2013; Wang et al., 2019) (872 examples) and the test sets of MR (Pang and Lee, 2005) (1,066), CR (Hu and Liu, 2004) (753) and AG News (Zhang et al., 2015) (7,600), from the Hugging Face hub (cornell-movie-review-data/rotten_tomatoes, SetFit/SentEval-CR, fancyzhx/ag_news). For each seed the training split is shuffled and its first n examples are kept (for CR at n = 4,096, all 3,012 examples). The first 20% of them, rounded up, form the validation set and the rest the training set.
Classifier and training. Each input is placed in a template with one masked position, “ It was <mask>.” with the label words terrible and great for the sentiment tasks, and “ (<mask>)” with World, Sports, Business and Tech for AG News. The class logits are the scores of the frozen masked-language-model head for these words at the masked position. LoRA with , and dropout 0.1 adapts the query and value projections of all 24 layers, with 786,432 parameters in total. Training uses Adam without weight decay, a batch size of 32, inputs of at most 256 tokens, and 10,000 steps with a learning rate of decayed linearly to zero.
The estimate. is computed at from the training set by Algorithm 1, with sketches of size .
Posterior, choices of and metrics. The Laplace approximation of Appendix D covers all LoRA parameters , with the Kronecker-factored generalized Gauss-Newton matrix , as implemented in the code of Laplace-LoRA (Yang et al., 2024). Predictions average the softmax over 100,000 samples of the logits from the linearized predictive, with the full covariance between classes. Marginal likelihood is maximized by 100 gradient steps with a learning rate of 0.1. Validation search performs 100 gradient steps with a learning rate of 0.1 on the validation NLL, starting from the marginal-likelihood . The MAP uses in the same predictive. A temperature is chosen from 81 values between 0.1 and 10, equally spaced on a log scale, by the validation NLL. ECE uses 10 bins of equal width in confidence.
Table 3: Results on AG News: mean over three seeds ± their standard deviation. Zero-shot does not depend on the seed. Bold: the best value in each column of a block, among the methods without validation data (upper rows) and among those with it (lower rows).
| training examples | ||||
|---|---|---|---|---|
| 64 | 256 | 1,024 | 4,096 | |
| 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 |
| MAP + T | 0.439 ± 0.072 | 0.363 ± 0.020 | 0.314 ± 0.006 | 0.259 ± 0.012 |
| marginal likelihood + T | 1.394 ± 0.164 | 0.937 ± 0.093 | 0.429 ± 0.052 | 0.255 ± 0.007 |
| ours + T | 0.442 ± 0.066 | 0.364 ± 0.016 | 0.307 ± 0.006 | 0.259 ± 0.008 |
| validation search | 0.439 ± 0.070 | 0.367 ± 0.010 | 0.307 ± 0.008 | 0.258 ± 0.008 |
| test ECE | ||||
| zero-shot | 0.034 | 0.034 | 0.034 | 0.034 |
| MAP | 0.119 ± 0.018 | 0.095 ± 0.007 | 0.084 ± 0.002 | 0.064 ± 0.007 |
| marginal likelihood | 0.106 ± 0.065 | 0.311 ± 0.068 | 0.474 ± 0.012 | 0.145 ± 0.011 |
| ours | 0.038 ± 0.016 | 0.039 ± 0.021 | 0.034 ± 0.028 | 0.022 ± 0.002 |
| MAP + T | 0.037 ± 0.041 | 0.021 ± 0.008 | 0.015 ± 0.005 | 0.008 ± 0.002 |
| marginal likelihood + T | 0.134 ± 0.094 | 0.083 ± 0.030 | 0.027 ± 0.035 | 0.013 ± 0.004 |
| ours + T | 0.073 ± 0.042 | 0.041 ± 0.021 | 0.030 ± 0.014 | 0.018 ± 0.004 |
| validation search | 0.071 ± 0.045 | 0.044 ± 0.029 | 0.030 ± 0.012 | 0.018 ± 0.003 |
| test accuracy | ||||
| zero-shot | 0.700 | 0.700 | 0.700 | 0.700 |
| MAP | 0.855 ± 0.021 | 0.887 ± 0.005 | 0.902 ± 0.002 | 0.916 ± 0.006 |
| marginal likelihood | 0.398 ± 0.065 | 0.615 ± 0.071 | 0.842 ± 0.011 | 0.915 ± 0.005 |
| ours | 0.855 ± 0.021 | 0.887 ± 0.005 | 0.902 ± 0.002 | 0.916 ± 0.005 |
| MAP + T | 0.855 ± 0.021 | 0.887 ± 0.005 | 0.902 ± 0.002 | 0.916 ± 0.006 |
| marginal likelihood + T | 0.398 ± 0.065 | 0.615 ± 0.071 | 0.842 ± 0.011 | 0.915 ± 0.005 |
| ours + T | 0.855 ± 0.021 | 0.887 ± 0.005 | 0.902 ± 0.002 | 0.916 ± 0.005 |
| validation search | 0.854 ± 0.022 | 0.887 ± 0.005 | 0.902 ± 0.002 | 0.916 ± 0.005 |
Table 4: Results on CR, as in Table 3. Two seeds at 256 examples.
| training examples | ||||
|---|---|---|---|---|
| 64 | 256 | 1,024 | 4,096 | |
| test NLL | ||||
| zero-shot | 0.448 | 0.448 | 0.448 | 0.448 |
| MAP | 0.688 ± 0.017 | 0.601 ± 0.139 | 0.574 ± 0.054 | 0.440 ± 0.016 |
| marginal likelihood | 0.633 ± 0.011 | 0.552 ± 0.005 | 0.475 ± 0.018 | 0.322 ± 0.009 |
| ours | 0.326 ± 0.049 | 0.322 ± 0.058 | 0.218 ± 0.034 | 0.170 ± 0.013 |
| MAP + T | 0.225 ± 0.015 | 0.218 ± 0.016 | 0.200 ± 0.020 | 0.173 ± 0.002 |
| marginal likelihood + T | 0.312 ± 0.036 | 0.209 ± 0.007 | 0.189 ± 0.025 | 0.160 ± 0.007 |
| ours + T | 0.228 ± 0.031 | 0.214 ± 0.012 | 0.188 ± 0.024 | 0.164 ± 0.008 |
| validation search | 0.235 ± 0.027 | 0.215 ± 0.013 | 0.190 ± 0.028 | 0.165 ± 0.012 |
| test ECE | ||||
| zero-shot | 0.076 | 0.076 | 0.076 | 0.076 |
| MAP | 0.072 ± 0.004 | 0.067 ± 0.009 | 0.060 ± 0.008 | 0.054 ± 0.003 |
| marginal likelihood | 0.390 ± 0.006 | 0.343 ± 0.009 | 0.303 ± 0.015 | 0.191 ± 0.007 |
| ours | 0.042 ± 0.004 | 0.040 ± 0.018 | 0.035 ± 0.006 | 0.023 ± 0.006 |
| MAP + T | 0.037 ± 0.019 | 0.029 ± 0.021 | 0.024 ± 0.015 | 0.014 ± 0.001 |
| marginal likelihood + T | 0.150 ± 0.036 | 0.027 ± 0.016 | 0.022 ± 0.011 | 0.021 ± 0.003 |
| ours + T | 0.053 ± 0.039 | 0.035 ± 0.013 | 0.022 ± 0.006 | 0.023 ± 0.002 |
| validation search | 0.052 ± 0.038 | 0.037 ± 0.012 | 0.023 ± 0.006 | 0.022 ± 0.003 |
| test accuracy | ||||
| zero-shot | 0.810 | 0.810 | 0.810 | 0.810 |
| MAP | 0.923 ± 0.003 | 0.928 ± 0.008 | 0.936 ± 0.009 | 0.940 ± 0.004 |
| marginal likelihood | 0.923 ± 0.001 | 0.926 ± 0.005 | 0.936 ± 0.008 | 0.940 ± 0.003 |
| ours | 0.924 ± 0.003 | 0.928 ± 0.008 | 0.936 ± 0.009 | 0.940 ± 0.004 |
| MAP + T | 0.923 ± 0.003 | 0.928 ± 0.008 | 0.936 ± 0.009 | 0.940 ± 0.004 |
| marginal likelihood + T | 0.923 ± 0.001 | 0.926 ± 0.005 | 0.936 ± 0.008 | 0.940 ± 0.003 |
| ours + T | 0.924 ± 0.003 | 0.928 ± 0.008 | 0.936 ± 0.009 | 0.940 ± 0.004 |
| validation search | 0.923 ± 0.003 | 0.928 ± 0.008 | 0.936 ± 0.008 | 0.940 ± 0.004 |
Table 5: Results on MR, as in Table 3.
| training examples | ||||
| 64 | 256 | 1,024 | 4,096 | |
| test NLL | ||||
|---|---|---|---|---|
| zero-shot | ||||
| MAP | ||||
| marginal likelihood | ||||
| ours | ||||
| MAP + T | ||||
| marginal likelihood + T | ||||
| ours + T | ||||
| validation search | ||||
| test ECE | ||||
| zero-shot | ||||
| MAP | ||||
| marginal likelihood | ||||
| ours | ||||
| MAP + T | ||||
| marginal likelihood + T | ||||
| ours + T | ||||
| validation search | ||||
| test accuracy | ||||
| zero-shot | ||||
| MAP | ||||
| marginal likelihood | ||||
| ours | ||||
| MAP + T | ||||
| marginal likelihood + T | ||||
| ours + T | ||||
| validation search | ||||
Table 6: Results on SST-2, as in Table 3. Two seeds at 4,096 examples.
| training examples | ||||
| 64 | 256 | 1,024 | 4,096 | |
| test NLL | ||||
|---|---|---|---|---|
| zero-shot | ||||
| MAP | ||||
| marginal likelihood | ||||
| ours | ||||
| MAP + T | ||||
| marginal likelihood + T | ||||
| ours + T | ||||
| validation search | ||||
| test ECE | ||||
| zero-shot | ||||
| MAP | ||||
| marginal likelihood | ||||
| ours | ||||
| MAP + T | ||||
| marginal likelihood + T | ||||
| ours + T | ||||
| validation search | ||||
| test accuracy | ||||
| zero-shot | ||||
| MAP | ||||
| marginal likelihood | ||||
| ours | ||||
| MAP + T | ||||
| marginal likelihood + T | ||||
| ours + T | ||||
| validation search | ||||
Table 7: AUROC for separating OOD inputs from each task's test inputs, with the mutual information as the score: mean over three seeds ± their standard deviation (two seeds for CR at 256 and SST-2 at 4,096 examples). Bold: the best value in each column of a block.
| training examples | ||||
|---|---|---|---|---|
| 64 | 256 | 1,024 | 4,096 | |
| AG News, OOD inputs from SST-2 | ||||
| marginal likelihood | ||||
| ours | ||||
| validation search | ||||
| CR, OOD inputs from AG News | ||||
| marginal likelihood | ||||
| ours | ||||
| validation search | ||||
| MR, OOD inputs from AG News | ||||
| marginal likelihood | ||||
| ours | ||||
| validation search | ||||
| SST-2, OOD inputs from AG News | ||||
| marginal likelihood | ||||
| ours | ||||
| validation search | ||||

Figure 8: Figure 4 for each task, with all methods, mean over three seeds.

Figure 9: Figure 6 for each task, mean over three seeds. The OOD inputs are SST-2 for AG News and AG News for the other tasks.
I FINE-TUNING UNDER THE ESTIMATED PRIOR
Since is available before fine-tuning, it can also be used as the prior during training (Section 5), not only in the Laplace approximation fitted after training (Section 7.4). The training then minimizes the sum of the training NLLs plus , the negative log density of the prior on the LoRA parameters , so that the trained model is the mode of the posterior under the estimated prior. All other settings follow Section 7.4 and Appendix H.
Figure 10 compares each method with LoRA trained without and under the prior. The prior improves calibration. In the reliability diagrams (bottom row), the overconfident MAP and the underconfident marginal likelihood both move to the diagonal, and the ECE of both drops sharply. With the MAP itself well calibrated, the precision chosen after training matters much less, and all methods reach a similar NLL. Our method maintains its NLL and improves its calibration slightly, while validation search, which no longer has to temper an overconfident MAP, does not benefit. Accuracy is lower for the smallest training sets, where the prior keeps the adapters close to the pretrained model, and changes little from about a thousand training examples on.
The largest change is for marginal likelihood. With LoRA trained without a prior, it selects precisions orders of magnitude below . With LoRA trained under , it selects precisions close to and matches our method in NLL and calibration, and with little data it detects OOD inputs better than our method with the same training. The Laplace evidence assumes that the trained model is the mode of the posterior under the prior it evaluates (Appendix D), which holds only when LoRA is trained under a prior. Therefore, the two methods can be combined to improve the overall behaviour: sets the prior before and during training, and marginal likelihood refines the precision afterwards, without validation data.



default fine-tune fine-tuned under
Figure 10: Each method with LoRA trained without a prior (gray) and under (magenta), mean over tasks and seeds. The OOD AUROC of the MAP, which has no posterior, uses the maximum probability. Bottom row: reliability diagrams at 4,096 training examples.