Towards Calibrated Robust Fine-Tuning of Vision-Language Models
Authors: Changdae Oh
Hyesu Lim
Mijoo Kim
Dongyoon Han
Sangdoo Yun
Jaegul Choo
Alexander G Hauptmann
Zhi-Qi Cheng
Kyungwoo Song
Venue: NeurIPS 2024 poster (2024)
Keywords: robust fine-tuning
distribution shift
out-of-distribution generalization
vision-language model
uncertainty calibration
Primary area: safety_in_machine_learning

Abstract: Improving out-of-distribution (OOD) generalization during in-distribution (ID) adaptation is a primary goal of robust fine-tuning of zero-shot models beyond naive fine-tuning. However, despite decent OOD generalization performance from recent robust fine-tuning methods, confidence calibration for reliable model output has not been fully addressed. This work proposes a robust fine-tuning method that improves both OOD accuracy and confidence calibration simultaneously in vision language models. Firstly, we show that both OOD classification and OOD calibration errors have a shared upper bound consisting of two terms of ID data: 1) ID calibration error and 2) the smallest singular value of the ID input covariance matrix. Based on this insight, we design a novel framework that conducts fine-tuning with a constrained multimodal contrastive loss enforcing a larger smallest singular value, which is further guided by the self-distillation of a moving-averaged model to achieve calibrated prediction as well. Starting from empirical evidence supporting our theoretical statements, we provide extensive experimental results on ImageNet distribution shift benchmarks that demonstrate the effectiveness of our theorem and its practical implementation.

Towards Calibrated Robust Fine-Tuning of Vision-Language Models
Changdae Oh* University of Wisconsin Madiiso
Hyesu Lim to KAIST AI
Mijoo Kim Chung-Ang University
Dongyoon Han NAVER AI Lab
Sangdoo Yun NAVER AI Lab
Jaegul Choo KAIST AI
Alexander Hauptmann Cameegie Mellon University
Zhi-Qi Chengi Camegie Mellon University
Kyungwoo Songi
Yonsei University
Abstract
Improving out-of-distribution (OOD) generalization during in-distribution (ID) adaptation is a primary goal of robust fine-tuning of zero-shot models beyond naive fine-tuning. However, despite decent OOD generalization performance from recent robust fine-tuning methods, confidence calibration for reliable model output has not been fully addressed. This work proposes robust fine-tuning method that improves both OOD accuracy and confidence calibration simultancously in vision language models. Firstly, show that both OOD classification and OOD calibration errors have a shared upper bound consisting of two terms of ID data: 1) ID calibration error and 2) the smallest singular value of the ID) input covariance matrix. Based on this insight, we design a novel framework that conducts fine- tuning with constrained multimodal contrastive loss enforcing larger smallest singular value, which is further guided by the self-distllaatio of moving-averaaed model achieve calibrated prediction as well. Starting from empirical evidence supporting our theoretical statements, we provide extensive experimental results on ImageNet distribution shift benchmarks that demonstrate the effectiveness of our theorem and its practical implementation. Our code is available here.
Introduction
Foundation models [6] such as CLIP [47] have been extensively utilized on diverse domains via pretrain-fineee finetune approaches. Their generalized knowledge shaped after large-scale pre-training enables them to easily adapt downstream tasks through zero-shot inference fine-tuning. However, it has been steadily reported that a naive fine-tuning approach comprises foundation models' strong out-o--distribution (OOD) generalization capability during adaptation in-distribution (ID) data [61, 30.. To ensure robustness under distribution shifts, a wide range of research has followed [61, 30, 17, 32, 57, 43, 42] so-called robust fine-tuning. Despite the advancements of the robust fine- tuning methods, we are aware that an important criterion for trustworthy machine learning has been overlooked confidence calibration [39, 8] that quantifies how close the confidence of our predictor is to the actual correctness of predictions. As shown in Figure 1, existing robust fine-tuning methods hurt the confidence calibration in terms of expected calibration error (ECE) [40] on OOD data compared to the zero-shot evaluation while they show improvements on OOD accuracy. In this
'Equal contribution (changdae saanngda@@c.wisc.edue hyesulim @ kaist.ac.kr Work partly done at CCamegie Mellon University and "NAVER AI Lab, (Co-correspondence (zhiqic @ cmu,edu; kyungwoo.song
yor.ooossooooososo.a...... yonsei.ac.kr)
38th Conference on Neural Information Processing Systems (NcurIPS 2024).

---

CaRot (Ours)
CaRot (Ours)
62
62
Lipsum-Fi FT
Lipsum- FT
OOD ACC
61
61
LP-FT FT
LP-FT
60
FLYP
60
FLYP
59
Z5
58
58
//
70 81.5
82.0
82.5
83.0
-0.20
-0.15
-0.10
ID ACC
Negative OOD ECE
Figure 1: OOD accuracy vs. ID accuracy (left) and negative OOD ECE (right). To maintain consistency in the plots, where desired values are shown the right side of the x-axis, report negative OOD ECE. ID ACC refers to ImageNet- KK top-1 accuracy; OOD ACC and ECE refer the averaged accuracy and ECE of the five ImageNet distribution shifts (ImageNetV2, ImageNet-R, R, ImageNct-A A, ImageNct-Sketee
and ObjectNet), respectively. Detailed numbers are reported in Table 2 and 3. Note that the competing methods - FLYP [17], LP-FT [30], and Lipsum-FT [42] - immrovee OOD accuracy over the zero-shot baseline (ZS) and naive fine-tuning (FT) but suffer from OOD miscalibration, presumably due concerning generalization solely during fine-tuning. Our CaRot outperforms existing methods on both OOD accuracy and calibration by large margins.
work, introduce calibrated robust fine-tuning method (CaRot) that simultaneously improves confidence calibration and accuracy of the classifier on OOD data.
Confidence calibration is key aspect of reliable machine learning, essential for avoiding high- confidence incorrect predictions in real-world makiing systems. This is particularly crucial in high-stakes tasks like autonomous driving and healthcare applications. After seminal work [18] revealed the miscalibration problem of high-performing neural networks, a plethora of attempts followed to improve the calibration of neural network models through post-hoe adjustments [65, 18, 29, 68, 19] or train-time regularizations [67, 52, 56, 38, 37]. However, many them focus on improving calibration for ID samples, and methods for enhancing OOD calibration usually require OOD samples at train time [63, 16]. Moreover, these approaches commonly focus on calibration alone without ensuring improvement in other quantities, e.g.. accuracy. In this work, explore unified framework that jointly considers calibration and accuracy (particularly on OOD data).
To accomplish low classification and calibration errors on OOD samples with only ID samples in our hands, we conduct theoretical analyses of those OOD errors. To be specific, we derive an upper bound that is shared for OOD classification eтror and OOD calibration error composed with two quantities on ID samples, 1) the reciprocal of the smallest singular value of the normalized covariance matrix of ID data representution and 2) the ID calibration error. Different from the existing bounds focusing on either one of classification or calibration error [5. 72, 63], we address both classification and calibration errors in single unified bound. More importantly, the chief components of our bound can be computed solely with ID samples without relying on any OOD samples, which discerns our approach to existing work [4].
Motivated by our theoretical analysis, we propose new multimodal contrastive loss that promotes the smallest singular value of input image representation to become larger by enforcing the orthogonality of the final projection matrix of the visual encoder. Furthermore, to understand the working mechanism in depth, we present interpretation of our new multimodal contrastive loss as a process of seeking the low-rank approximation of cross-covariance matrix over image-text representations on reduced solution space induced by the orthogonality constraint. Meanwhile, to enhance confidence calibration on ID samples during fine-tuning, we utilize a self-distillation (SD) with an exponential moving average (EMA) teacher model. This EMA SD encourages student model to learn semantic similarity structures of in-batch data representations from teacher predictions across diverse contrastive pairs, appropriately adjusting confidence per instance.
We first validate our new error bounds with synthetic datasets show that the bounds hold empiri- cally. Then, evaluate our method by conducting extensive experiments of fine-tuning CLIP [47] on ImageNet- K [10] classification task under natural distribution shift (ImageNet- VetieeNeeeV///AAAA /2/R/A/Sketc/ and ObjectNet) and synthetic distribution shift (ImageNNetCC.. We demonstrate the effectiveness of our proposed framework for robust generalization and calibration by observing consistent improvements in terms of expected calibration error and accuracy ID/OOD datasets.

---

Summary of contributions. 1) We point out that existing thne-tuning methods do not adequately achieve satisfactory OOD generalization and calibration simultaneously. 2) We provide theoretical analysis for classification and calibration errors on the OOD data and show that they are both bounded from above by the ID calibration error and the smallest singular value of the covariance matrix over the ID) input representation. 3) Based on our theoretical analyses, we devise calibrated robust fine-tuning method, CaRot, as a practical realization of our theorem that reduces the upper bound of OOD classification and calibration errors by conducting constrained multimodal contrastive learning with EMA self-distillation. 4) We present empirical evidence for our theory on a synthetic dataset and demonstrate the efficacy of CaRot via extensive evaluations on ImageNet- IK distribution shifts in terms of accuracy and calibration error on ID and OOD domains.
2 Preliminary
Robust fine-tuning aims to achieve consistently high performance on data from both training distribution (ID) and related but different test distributions (OOD). For validation, we commonly consider covariate shift scenario for the classification task, where both ID and OOD domains share the class categories (J'n = VOOD) and have the same conditional distribution P(Y but have different marginal distributions over input X. That is. (Y)(
PooD(Y but (ix(X) * POoD (X). Here, we evaluate a model that is fine-tuned on a training split of the ID domain, on a test split of ID. and on OOD domains. The term "OOD" is quite general, and we confine the scope of OOD to transformed and related distributions with ID [12]. For example, if our ID data about an object recognition task with images. OOD data is about sensor-noised version of ID, or independently collected data from a different domain targeting the same task.
Confidence calibration is concept of matching the prediction probabilities yielded for different inputs to the expected accuracy on these inputs. In a K K-way classification setting, let X E Rd and Y E {I,..., K} be random variables indicating inputs and labels, respectively. A dataset with N independent samples from the joint distribution P(X, Y) P( is denoted by {(In (orn,Bn)):3 ) Let f be a classifier and (y](=) = á be a confidence, i.e., the maximum of probabilities among K dimensions corresponding to its prediction J. We say model is perfectly- calibrated when Pi- = yاp = p) p. Vp E [0, 1]. As quantitative measure, the model calibration pl]. In practice, we use expected calibration error (ECE) [40]
can be derived as E P(U = uاp = as an empirical approximation of the model calibration, which is a weighted average of bin-wise miscalibration. The ECE divides the confidence score of N samples into M uniform confidence bins (B,) JM mm and takes the mean of the gap between accuracy (ace) and confidence (conf) over the bins weighted by the number of samples in the bins, i.c., ECE = MM
[
|acc[ (Bm) conf(Bm))
m== N
3 Theoretical Analysis on OOD Generalization and Calibration
We first identify the factors that affect OOD generalization and calibration errors under cireumstances where only ID data is accessible. We take inspiration from the generalization bound of domain adap- tation literature [5, 72] while remarkably adapting the analysis to consider both OOD classification error and OOD calibration error at the same time in a more practical way.
Let 'D be domain on input space X' and y {0, 1) be label space for a binary classification.
Among the sufficiently expressive hypothesis functions h: X' X' [0. 1] as a desired calibrated predictor for y, which minimizes the calibration error Eg-D [h(()) - c
in a class H. we define ho ())
[39], where c(x) = E, [1]]((x]]] is the expected value of given a prediction h(x)). That is, ho always produces the calibrated prediction for y given x so that the output confidence (x(x) matches the
expectation of y over the subset of samples that have the same confidence value with ho (z)). Our goal to learn a hypothesis function h(-) that outputs reliable prediction probability on samples from the unseen OOD domain, which is defined by distribution DooD. as well as on the ID domain DID. where the predictor trained on. In essence, the error (h) Eg- ( - (x)x))) should be small for two different domains 'D E (DID, Doon). Here, we focus on the covariate shift scenario ($2) that only the marginal distribution over X' changes while the distribution over y is preserved.
Let the optimal hypothesis /t", which minimizes a combination of errors on both ID and OOD, be h² ;= arg mingew EDD (h) + DDoo (h), and A denote the optimal joint error A := E (h*)- @Doo (h²). Now, we derive new bound for the OOD calibration error and OOD classification error.
3

---

Theorem 3.1. Let h X - 1] be a real-valued function of structure h(x)) = Ei= h (x((i))
where h2 is an arbitrary one- the--immnssonal function, and h is in hypothesis class H. that has pseudo
dimension Pdim((H) (H) di, Din be an N-size empirical distribution on ID domain. If [=[1] have matching marginals for ID and OOD, and (x|1], x²5]) a bi-variate Gaussian for every i, E [d] then for any E (0,1) and for all h, the following bounds hold with probability at least 8:
x [c]
d
(V
N da
i) EDooo (h) S bm (1) + mmin (Dw))
+ + +A+0
(V
log dn
(8)
(1)
d
(v+ log
N dp
da
1
i)) EDo0o [1((z) -
y) -1) BDoo [0o0ol((2) lc(x) E (h) +
+ A +
Omin (EDw))
(2)
where = [ is a covariance matrix with a strictly positive minimum singular value of d-dimensional normalized input ā = (#[1), H[d), where ā [ [[](i]] Var(<<]))) -1/2 and min (M) is the smallest singular value of a matrix M E Rd xdg These theoretical results can be directly applied the intermediate penultimate layer's representation of neural network by setting the input variable x as representation vector as in [4. 73]. From now on, we will assume the input as an image representation from the last layer of the visual encoder in the following sections. Note that 1) the LHS of the first inequality (ineq.(11)) indicates OOD calibration error, 2) two terms in the LHS of the second inequality (ineq. (12)) denote OOD classification error in terms of L2 loss and prediction sharpness on OOD domain, and 3) both inequalities have the same RHS, which contains the empirical estimate of ID calibration error, the reciprocal of the smallest singular value of ID input covariance matrix, and remaining irreducible terms that depend on the problem setup. Intuitively, Theorem 3 implies that pursuing diverse input features while maintaining the calibration of the classifier contributes to improving OOD calibration and generalization simultaneously. We defer the proof and discussion on the tightness of the bound and its assumptions Appendix C.
Based on our analysis, we expect the potential of reducing the upper bound of OOD calibration error and the sum of OOD classification error and prediction sharpness by minimizing the first two terms of RHS in both bounds: the empirical ID calibration error and the reciprocal of minimum singular value of the normalized ID covariance matrix. In $4, we devise realization of this theoretical concept.
4 Method
Our goal is to achieve good OOD generalization and calibration during the ID adaptation of pre- trained models. Motivated by Theorem 3, we propose a new fine-tuning method that increases the smallest singular value of the ID input covariance matrix while improving ID calibration. thereby lowering the upper bound of OOD calibration and generalization errors. By following [61, 30, 17]. we set a vision-language model (VLM), CLIP [47] as our target, which serves as a remarkably strong backbone for zero-shot inference and fine-tuning with ease. We limit the scope of validation to image classification tasks. Note that our theorem is not confined to specific domains or model architectures and thus can be applied beyond CLIP's image classification. See Figure for an overview.
4.1 Robust fine-tuning with constrained multimodal contrastive learning
To adapt a pre-trained VLM on image classification tasks, the cross-entropy loss is the most common choice as an objective function. However, there are emerging shreds of evidence supporting the use of contrastive loss (CL) for robust adaptation [70, 50, 17], especially when the model is pre-trained via CL. Witnessing its empirical success on OOD generalization [17], we leverage a CL-based learning strategy for VLM fine- tuning. CLIP consists of an image encoder (.) = fa. (.WW, and a text encoder ge, (.) = 9ā, (,),,, where encoders are composed with backbone models (Ja, (.), (,99, (.)) and projection matrices (W., E Rd,,xr Wi E Rdox). The encoders produce La-normalized represen- tations compute the similarity between image and text inputs. Given N pairs of (image, text) {(4, T,)NN common form of multimodal contrastive loss (MCL) can be written
1
exp(ffe. go, (T.))
LMCLL =
log
2N
Σ
j=1 exp( (1.) 94, (T)))
(3)
N
exp(Jo. (I.) 9o, (T.)) log
+ R(,., A))
2N
Σ == exp(fe, (e,00,L,,, (1,) go, (T.))

---

W,
EMA update
VLM
Soft label
Gradient update
Encoder
W
90
Teacher
W
I1W, W,
1113
photo of dog
SDD
photo of cat
photu of burger
Student
MCL
8
Output
Hard label
Figure 2: Overview of CaRot. We fine-tune VLM using multimodal contrastive with an orthogonality constraint on visual projection layer (4). and self-distillation Lsn (eq.(5)) that takes predictions of EMA teacher v as soft larget labels to train the student model 0. The darker and the lighter elements denote values closer to and 0, respectively. Both teacher and student models share identical VLM architecture consisting of image fo.. i : W.] and text g0; := 190, Wi] encoders, where W the projection layer. Given (image, text) pair data, the model outputs the pair-wise similarity score for in-batch image-text representations.
where 0 = 18.. }r} are the parameters of image and text encoders and R( 0t) reflects general regularization strategy in CL [7. 21]. We update both image and text encoders during fine-tuning mue-tuning done in the pre-train phase and use OpenAl templates [47] to create (image, text) pairs from downstream classification dataset that consists of (image, class) pairs.
Meanwhile, the basic form of LMCL does not inform anything about the singular value distribution of learned representation. $3, we showed that the reciprocal of the smallest singular value constitutes the shared upper bound, i.e., the larger the smallest singular value is, the lower the upper bound becomes. To encourage this, we put a soft constraint term to LMCL. that enforces the final projection matrix W. of the visual encoder to be orthogonal and hence the output image representation matrix to have a large effective rank, as in below:
LMCL-CoM (0) == (0) Co,, = W. 2
where I is an identity matrix that has the same shape with W W, and Aoc is a strength of the orthogonality constraint' While recklessly increasing the singular values might hinder ID adaptation, our orthogonal constraint mitigates the degradation of performance by pursuing not only the smallest singular values be large but also the largest singular values be small which is important for generalization on ID data [69]. Interestingly, this contrastive loss with regularization terms can be viewed constrained singular value decomposition (SVD) with cross-covariance matrix of image-text representations where the orthogonality constraint is applied.
To be specific, by following Nakada et al. [41], under a linear representation assumption, a gradient descent step of LMCL-com boils down to the maximization of the SVD objective, which aims to find low-rank approximation of the normalized cross-covariance matrix 5(3)² as follow:
exp(W.f, W
arg min LOCCL-oo (W) = W.
log
2N
j= exp WTT,)
exp(W. WiTh)
log
exp(W.l, WTT.) + R(W., Wi) + Aoe NoellW." w,
2N
~ arg max SVD(S(D)) = tr(W. S(3)W:) (p/2)]|W.W?71 subject to ||W w. I|
W;
where we adopt R(W,, Wi) (p/2) W. w/ 1 for p > regularization term to promote the encoders to capture diverse features as in et al. [27]. Here, we assume that the input of LMCL.con is the penultimate representation of VLM's encoders, i.e., (I,, f:) (Sa, (T+), (T:)), and
'While it also possible to inject constraint on the text projection matrix Wi. we only for W. because our concern about the singular value of image representations for downstrcam tasks. We observed degradations of accuracy (I0:-0.01, OOD:-0.1. and ECE (ID: 0.00, 00D:-0.02) by adding the constraint on W,. where 3, and 8.g depend the choice non-linear function
2 *s(3) = & ΣN i By i, over dot product between image and text representations. See Nakada et al. [41] for detailed derivation
5

---

W (W.. Wi is set of projection matrices (i.e., last layers of each encoder). This connection between LMCI, and SVD allows us to understand the working mechanism of our proposed objective. That is, minimizing LMC can be interpreted as finding good rank-r (dimensionality of the image- text projection space) approximation of the cross-modal covariance matrix by seeking the direction of large co-variaa oo-variation among image-text representations, while the solution space is constrained by enforcing an orthogonality condition on the collection of vision-side singular vectors We to achieve the larger effective rank of both the projection matrix W, and the image representation matrix (See Appendix $B for further explanation on the effective rank and the smallest singular value). In $5, we validate that LMCL-con significantly increases the smallest singular values and results in better OOD generalization and calibration on downstream tasks.
4.2 Calibration during robust fine-tuning
In the previous section, we devise new multimodal contrastive loss that promotes large min (DDw). We now address the next component standing for ID calibration, which another crucial component according to our theoretical analysis. While there are numerous approaches to enhance calibra- tion during neural network training [38, 56, 52, 11, we notice the promising results of knowledge distillation- based calibration approaches [64, 71]. These approaches encourage the model to learn from input-dependent smoothed labels that effectively mitigate the overconfidence issue, which is commonly associated with miscalibration. Therefore, we employ self-distillation (SD) method for ID calibration in that distilling the similarity score map would help avoid overconfidence.
Specifically, we first initialize both teacher and student networks with a pre-trained CLIP model (including both image and text encoders); update the student model using gradient descent for every iteration while slowly updating the teacher model that has &b = fwe.. 2 as parameters using EMA with the momentum of at every >> 1 iteration, i.e., & arp + (1 a9. Rather than hosting another VLM or fixed pre-trained CLIP as teacher model, we adopt a self-evolving EMA network as a teacher, observing its successful usage on the weight-space ensemble between homogeneous models [61, 48], robust self-supervised learning methods [2, 45], as well as regularization [71]. With the EMA teacher {fv. (-), Iwr (-)) and the learning student {fe, (-), go, (-)}, we construct self-distillatio loss term for N data pairs
N
(s) N IKKOA KL I147))
(5)
where K L denotes Kullback-Leibler divergence, of softmax fo. (4i) go, (T)) and of softmax( [fe (L go, (-) are student outputs, and of and oh are teacher outputs which are similarly defined by replacing the student parameter @ with that of teacher's th. Presumably, label smoothing (LS) [55] behaves similarly to what we intended, but we argue that LS would be less effective than EMA SD in terms of mitigating overconfidence issues. See Appendix $B.
We complete the learning objective as a summation of LMCL-con and LSD with a coefficient ÄSD. i.e., L = LMCL + AocCoc + Asp The novel combination of these two components contributes to ensuring a larger smallest singular value of image representation and ID calibration simultaneously, which induces calibrated robust fine-tuning (CaRot) on distribution shifts. Note that this objective function is just one of the possible realizations of our upper bound (Theorem 3) on OOD generalization and calibration errors. Further exploration can spawn more practical algorithm in the future.
5 Experiments
In & 5.1, we first show empirical evidence of the error bounds that we derived in $3. We then provide experimental setup and main benchmarking results ($5.2) and present further empirical studies ($5.3).
5.1 Numerical analysis error bounds
Our theoretical analysis in $3 revealed the possibility of managing OOD classification and calibration errors simultaneously by leveraging shared quantity over the ID domain (sum of calibration error term and the singular value term). Before conducting real-world evaluations, we verify the theoretical analysis with a toy experiment that simulates distribution shifts. To be specific, we generate binary classification dataset with 1000-dimensional Gaussian random variables as features where the mean of features are partly shifted across different test environments (ID, OOD). We train

---

three-layer network with regularization terms: Born-Again- Nettin (BAN) self distillltilanoon [13] for calibration (LsD) and the orthogonal constraint (shown eq.(4) for the singular value (Coc). Detailed descriptions of the experimental setup are provided in Appendix $A.1.
poual 00.001
Table 1: The best case values of two terms of RHS (ID miin and IDD ECF) and LHS OOD errors (MSF and ECE) in the bounds of Theorem 3. Reported values are an average of three repeated runs.
0o0 MSE
OGD ECE
0.25
Avg. of Li0,))l ) & ECE
Avg. of 100 & ECE
Method
ID
OOD
mmin (t)
ECE (L)
MSE (L)
(L)
Figure 3: Analysis of error bounds on synthetic data.
Plots the left side show RHS (x-axis) and LHS (y- axis; MSE for ineq.(12) and ECE for incq.(11) of the inequalities $3. We denote
Baseline Loc
2.0887
0.1666
0.2581
0.2477
4.9630
0.1528
0.1932
0.1781
for the mean squared error, Loc for the singular value regulariza- tion, and Lsn for the calibration regularization.
LSD
3.1354
0.1308
0,2170
0.1720
Coc,
LsD
6.5961
0.1391
0.1877
0.1596
Figure visualizes the results of Pearson correlation analysis between the average of 1/ (E and ECE from IDD samples and OOD MSE/ECE over 111 trained models. Here, we observe strong correlations between the average of 1 1//miin (ED.) and ID ECE (x-axis), and OOD classification and calibration errors (y-axis). Additional results on the best models per each regularization term are showcased on the Table I, which also indicates that reducing the upper bound results in better OOD generalization and calibration. These analyses demonstrate that Theorem 3 empirically holds.
5.2 Evaluation on distribution shift benchmarks
Training and evaluation. We adopt CLIP ViT-B/16 as our VLM backbone and evaluate each fine- tuning method, including CaRot, in terms of calibration (with ECE) and accuracy under distribution shifts. For downstream tasks, we consider the ImageNet-1K (IN) classification and regard it as our ID domain. For all methods, optimize the model parameters using the Adam with a batch size of 512 over 10 epochs. Fine-tuned models are evaluated under varying distribution shifts.
Benchmark datasets. We consider IN-V2 [49], IN-R [23]. IN-A [24], IN-S [60], and ObjectNet [3] as natural shifts of the in-distribution dataset (IN). We refer the average performance over these five datasets as Avg. Shifts or OOD throughout the following sections unless it is specified as a different dataset, e.g., IN-C [22] which adopt as synthetic shift scenario occurred by sensory noises.
Table 2: ImageNet accuracy. We report the accuracy on ImageNet and its distribution shift variants by fine- tuning CLIP ViT-B/16 with five methods. The best and the second-best in each column are underlined.
Method
INt
IN-V21
IN-R1
IN-A1
IN-S1
ObjectNetf
Avg. shifts?
Zs
68.33
61.93
77.71
49.95
48.26
54.17
58,39
FT
81.53
71.66
70.14
44.01
49.11
52.56
57.50
LP-FT
82.47
72.71
72.84
49.31
50.28
54.45
59.92
FLYP
82.69
72.73
71.35
48.52
49.84
54.86
59,40
Lipsum-FT
83,30
73.60
75.90
49.90
51.40
54.38
61.04
CaRot (Ours)
83.13
74.11
77.71
51.60
52.71
56.60
62.55
Table 3: ImageNet ECE. Along with Table 2, we report the ECE ImageNet and its distrihution shifts to compare with other fine-tuning methods, which demonstrates our out-of-distribution (OOD) calibration performance. The best and the second-hed hest in each column are underlined (See Figure B for details).
Method
INI
||
IN- IN-V21
IN-RL
IN-AI
IN-SL
ObjectNet
Avg. shifts..
ZS
0.0570
0.0548
0.0541
0.0967
0.0850
0.0780
0.0736
0.0884
0.1468
0.1164
0.3000
0.2544
0.2753
0.2186
LP-FT
0.0505
0.0894
0.0613
0.2051
0.1659
0.2124
0.1468
FLYP
0.0635
0.1171
0.0967
0.2435
0.2200
0,2383
0.1836
Lipsum-FT
0.0384
0.0516
0.0426
0.1290
0.1023
0.1315
0.0914
CaRot (Ours)
0.0470
0.0367
0.0575
0.1240
0.0699
0.1075
0.0791

---

Baseline methods. We benchmark CaRot alongside zero-shot inference (ZS) and fine-tuning methods: standard tine-tuning (FT), LP-FT [30], FLYP [17]. and Lipsum-FT [42]. Refer $A for further details. In Appendix Table B, C, and D, we compare results with post-hoc robustification method (weight ensemble; WiSE-FT [61]) and post-hoe calibration (temperature scaling; TS! [18]) method.
Results on natural shifts. Table 2 both generalization and calibration on OOD data. Under distribution shifts from IN to -R, -A, -S, and ObjectNet, CaRot favorably compares with the existing best fine-tuning methods by margin of 1.51 and 0.0123 for OOD top-1 accuracy and ECE, respectively. averaged over five shifted datasets. See reliability diagrams in Appendix Figure B for deeper insight on calibration. We further report the results with different backbone models, RN50 and ViT-L/14, in Table 7 (See Table H and for details), CaRot consistently outperforms the baseline methods for these backbones, too. Furthermore, in Table 6, we provide additional comparisons with CAR-FT [34], Model Stock [26] and ARF [20]*.
and highlight our argument that CaRot significantly enhances
TLYP
Ca
S 64
02
00
Suraiom
gRANDe onle
mroik nole
Jog compovatoo
mole
makic
KYP
60
Implowes
defisi Lare
atsiie Jamebon
shaslan Joi6
play Aor
Aqpuler, cole
jugg compraaiin
elot pole
Zonm Jkd
Figure 4: IN-C corruption-wise accuracy (top) and ECE (bottom). We evaluate accuracy and ECE over 15 types of image corruption with five corruption severity and report the average performance per corruption. CaRot consistently outperforms baseline methods across diverse corruptions.
Results on synthetic shifts. In real-world applica- tions, distribution shifts are commonly occurred by sensory noises. To evaluate different fine-tuning methods under such synthetic shifts, we adopt a corrupted version of ImageNet (IN-C) with 15 types of image corruptions over five severities. In Figure 4, provide corruption-wise accuracy and ECE of each method averaged by five severities. Overall, CaRot consistently outperforms the base- line methods and the actual amount of improve- ments varying depends the type of corruptions. Specifically, on the relatively coarser granular cor- ruptions such Snow, Frost, Fog, Brightness, and Contrast greatly change the semantics of the image (similar to natural shift), CaRot shows remarkably good performance compared others. Meanwhile, on the finer granular corruptions such as Elastic transform and JPEG compression, the improvements achieved by CaRot become smaller. We present zoom-in results on these two cases in Figure 5.
0V6
0.6
8.4
brighnwea
Abati Joansleen
Figure 5: Closer look at the effectiveness of CaRot on different corruptions. We provide IN-C accuracy on brightness (left) and clastic transform (right) cor- ruptions. CaRot excels on the coarser corruption such as brightness whereas its effectiveness is weakened on the finer corruption such as elastic transform.
5.3 Further empirical studies
Ablation study. In Table 4, we provide results of the ablation study to show the impacts of each component of CaRot. In line with our hypothesis, results confirm that all three components boost OOD accuracy and calibration performance. The comparison of adopting and not adopting LMCL (we followed the naive fine-tuning approach for the latter) ascertains that employing contrastive loss as a fine-tuning objective is superior to cross-entropy loss for ID/OOD accuracy. consistent with the previous observations [17], and even extends to improvements in calibration as well. The ablations of
'ee report the average accuracy over four shifted datasets in Table 6. Results with an asterisk (*) are taken from the original papers. ECE values are included due to the missing evaluations from the original papers.
8

---

Table 4: Ablation study CaRot components. We report accuracy and ECE ImageNet (ID) and its distribution shifts (OOD). OOD values are averaged over five shifts. Values in brackets indicate the performance difference compared to the first row of each sub-table, and the dark green highlights the positive improvement.
LMCL
Loc
LSD
ID Acc.t
ID ECEJ
OOD Acc.t
OOD ECE|
81.53
0.0884
57.50
0.21866
81.45 (-0.08)
0.0874 (-0.0010)
59.10 (+1.60)
0.2051 (-0.0135)
82.18 (+0.65)
0.0601 -203)
60.73 (+3.23) 23)
0.1698 (-0.0488)
v
82.20 (+0.67)
0.0634 (-0.0250)
60.11 (+2.61)
0.1762 (-0.0424)
82.69
0,0635
59.40
0.1836
/
82.51 (-0.18)
0.0651 (+0.0016)
59.51 (+0.11)
0.1803 (-0.0033)
83.03 (4)
0,0523 0112)
62.28 (+2.88)
0.0772 (-0. 1064)
/ 83.13 (+0.44)
0.0470 0165)
62.55 (+3. 15)
0.0791 (-0.1045)
Table Analysis on coefficient terms of CaRot objective. Along with Table we report fine-grained analysis results on each term. We set Aoc as 0.2 and ASo as 1.5 when ablating each other and for all experiments throughout the paper. We select the final values of Aoc and Asn based ID ECE and a (Spp). respectively.
ID
OOD
ID
OOD
Aoe
Acc.t
ECEL
Acc.1
BCEJ
ASD
Acc.1
ECE]
Acc.1
ECEJ
0.0
83.03
0.0523
62.28
0.0772
0.0
82.51
0.0651
59,51
0.1803
0.1
83.18
0.0511
62.42
0.0779
0.5
83.07
0.0482
61.38
0.1377
0.2
83.13
0.0470
62.55
0.0791
1.0
83.23
0.0388
62.21
0.0997
0.5
83.04
0.0478
62.44
0.0798
1.5
83.13
0.0470
62.55
0.0791
1.0
83.09
0.0499
62.49
0.0781
2.0
82.72
0.0634
62.54
0.0781
the orthogonality constraint and adopting self-distillation validate our rationale behind adding the terms to our learning objective, where expect them to lower the upper bound of OOD classification and calibration errors. Together, constraining the singular values of image representation on MCL and distilling EMA teacher's predictions show the best results which aligned with results from the demonstration of error bounds in Fig 3. We speculate that learning diverse features by the singular value regularization while being enforced to contribute to reflecting the in-batch similarity structure by EMA SD induces well-restricted solution space [25] otherwise has risk converged to bad solutions (learning diverse features but noise-sensitive). Besides, Table 5 shows the impact of each component by varying the strength coefficients. We observe that the increased intensity of constraint improves ID and OOD performance to some degree, but there is a slight decline when the intensity is too strong. Meanwhile, the strength of self-distillation positively correlated with OOD accuracy and ECE, but there are negative effects on ID accuracy and ECE, which reflects the inevitable trade-off between ID adaptation and OOD generalization (Table G and F in Appendix provide further details).
Magnitude Singuler Values (=10))
Table ImageNet Ace. (except ObjectNet) with additional baselines.
25
Method
INT
V21
IN
IN-At
IN-St
Avg. shifls?
20
Z3
68.33
61.93
77.71
49.95
48.26
59.46
25
81.53
71.66
70.14
44.01
49,11
58.73
LP-FT
82.17
72.06
70.47
46,29
48.68
59,38
10
CAR-PT+
75.40
62,98
CMCL
FLYP
82.69
72.73
71.35
48.52
49.84
60.61
LIpaun-FT
83.30
73.60
75.90
49.90
51.40
62.70
CMCL con
Model Stock*
84.10
74,80
71.80
51.20
51.80
62.40
G2-
de-ie
ARF
82.70
72.80
75.60
50.30
51.80
62.63
smallest 20 singular values
(Ours)
83.13
77.71
51.60
52.71
64.03
Figure 6: Impact of LMCL-con
Analysis on singular values. Figure 6 illustrates the last 20 singular values of the covariance matrix I'rl where is a standardized image representations over N samples. Our proposed constrained contrastive loss LMCL-con increases the small singular values compared the vanilla contrastive loss LMCLL This result verifies that adding the orthogonality constraint successfully reduces 1/amin (Epr)) the component of the shared upper bound we derived in $3, following our intention.

---

Table 7: ImageNet accuracy and ECE different backbones. We provide summarized results CLIP RN50 and ViT-L/14. The best and the second-best in each column are underlined. (See Table and for details.)
ID
OOD
ID
OOD
Method
Acc.t
ECE!
Acc.t
ECEJ
Acc.t
ECE!
Acc.t
ECE,
ZS
59.83
0.0624
42.52
0.0955
75.55
0.0590
70.93
0.0711
VIT-L/14
RN50
FT
76.21
0.0983
41.97
0.2804
85.26
0.0993
65.98
0.2036
LP-FT
76.25
0.1042
41.62
0.3274
84.74
0.1056
64.11
0.2521
FLYP
76.16
0.0516
42.70
0.2127
86.19
0.0729
71.44
0.1470
CaRot (Ours)
76.12
0.0471
42.71
0.1714
86.95
0.0349
74.13
0.0737
6 Related Work
Robust fine-tuning for visual foundation models. Beyond the ID generalization, there are a lot of works aiming at improving the generalization of fine-tuned models on the OOD domain. Some of
them leverage the strong robustness of pre-trained model through weight-average [61, 26, 53, 44] or regularization [53, 57, 58, 42] whereas others attribute to the robustness during fine-tuning from different part of model backbone [30, 32]. Besides, Goyal et al. [17] claims that aligning the learning objective during pre-training and fine-tuning is crucial for retaining the remarkable OOD generalization capability of the pre-trained model. Although the above methods have provided insights into the extrapolation of foundation models regarding accuracy, confidence calibration has been unexplored. which is crucial for reliable ML applications. We investigate the OOD calibration of fine-tuned CLIP well accuracy and propose unified fine-tuning strategy with theoretical support to achieve superior ID and OOD calibration alongside OOD generalization for the first time.
Confidence calibration. After some early research on calibrated prediction [39, 8], lots of follow-up studies have been conducted. As seminal work, Guo et al. [18] revealed the miscalibration problem of neural networks, then, Minderer et al. [35] and Lenine et al. [33] provided comprehensive analysis on the calibration of modern vision models with consideration on distribution shift. To improve the calibration of predictive models, Temperature Scaling (TS) [18] and Label Smoothing (LS) [55] are two representative methods practice. TS-based approaches learn a temperature parameter itself [18, 16] or model [63, 28] to estimate the temperature to adjust the output probability of models, whereas LS-based methods focus on producing soft labels to mitigating overconfidence issues by a fixed [55, 38], randomized [56], model-based [71, 66] smoothing strategies. However, existing approaches do not consider distribution shifts [71], assume accessibility to target domain [16, 63), assume specific type of distribution shift [59], cannot adjust confidences individually [18, 55]. In this work, we adopt EMA self-distillation as an effective input-dependent calibration method and show that the superior calibration results on in-domain samples can be transferred to other domains (without data from those domains) by pursuing the larger smallest singular value together.
7 Conclusion and Discussion
While there have been numerous research endeavors improve reliability during the model adaptation in the wilds, almost all them meet the desired criteria only in half: OOD generalization or confidence calibration. This work attempts address both OOD generalization and OOD calibration in single framework. We first derive a shared upper bound for OOD classification and calibration errors which is constructed with the ID calibration error and the smallest singular value of ID input representation. We then devise a novel fine-tuning method CaRot, which promotes a larger smallest singular value and calibrated prediction through constrained multimodal contrastive loss and self-distillation. Our theoretical statements and proposed method are empirically validated through extensive experiments.
Limitation and future work. Due to resource constraints, research reached the scale of ViT-L. Exploring validation on the larger models such as ViT-G or VIT-H where the assumptions behind our theory become more realistic would be necessary. Our scope of validation was also limited to CLIP-like VLMs, but Theorem 3 is not specific to VLMs, and investigating the applicability to other types of models such language models would be exciting future work direction.
Impact statement. Our method enhances the foundation models' reliability in multiple dimensions accuracy and confidence calibration, and many downstream applications for society can enjoy benefits from the improved reliability. However, inherent biases learned from ID data can not be removed with our method, and thus may have risk raising potential harms in real-world applications.
10

---

Acknowledgement
We thank the NeurIPS24 reviewers, Soojeong Lee and Jinho Kang, for their constructive feedback. Some parts of experiments are based on the NAVER Smart Machine Learning (NSML) platform [54]. This work was supported by Institute of Information & communications Technology Planning & Evaluation (ITP)) grant funded by the Korea government (MSIT) (RS-2022-001439) I, Al Excellence Global Innovative Leader Education Program) and (No. R----0019--1199077 Artificial Intelligence Graduate School Program(KA)) (AIST)), and the National Research Foundation of Korea(NRF) grant funded by the Korea also supported by the Air Force Research Laboratory under agreement number 10--5000---00000, and by grants from the Defense Advanced Research Projects Agency (DARPA) through gh the GAILA program (award HR001 1990063) and the AIDA program 18-7750-18-00133 The U.S. Govermment authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright notice herein. The views and conclusions expressed in this document are those of the authors and should not be interpreted as representing the official policies or endorsements, either expressed or implied, of the Air Force Research Laboratory or the U.S. Government.
2022R A4A30338744 This work was
References
[1] Arsenii Ashukha, Alexander Lyzhov, Dmitry Molchanov, and Dmitry Vetrov. Pitfalls of in-domain uncertainty estimation and ensembling deep learning. arXiv preprint arXiv:2002.06470, 2020.
[2] Alexei Baevski, Wei-Ning Hsu, Qiantong Xu, Arun Babu, Jiatao Gu, and Michael Auli. Data2vec: general framework for sule-super learning in speech, vision and language. In International Conference Machine Learning, pages 1298-1312. PMLR, 2022.
[3] Andrei Barbu, David Mayo, Julian Alverio, William Luo, Christopher Wang. Dan Gutfreund, Josh Tenenbaum, and Boris Katz. Objectnet: A large-scale bias-controlled dataset for pushing the limits of object recognition models. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
[4] Shai Ben- David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. In Schölkopf. Platt, and Hoffman, editors, Advances Neural Information Processing Systems, volume 19. MIT Press, 2006. URL https: htttps::/prooeediinggg new.ine...pp.. cc/ cc/paper_ (ttp::/eeee44429191111142 24511444422111112277-77----- Paper.pdf.
[5] Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Vaughan. A theory of learning from different domains. Machine Learning, 79:151-175, 05 2010. doi: 10.1007/ $10994-009-5133 -15--44-44
[6] Rishi Bommasani, Drew A Hudson. Ehsan Adeli, Russ Altman. Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021.
[7] Ting Chen, Simon Komblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In Hal Daumé and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 1597-1607. PMLR, 13-18 Jul 2020.
[8] Morris H. DeGroot and Stephen E. Fienberg. The comparison and evaluation of forecasters. Journal of the Royal Statistical Society. Series D (The Statistician), 1983. ISSN 00390526, 14679884.
[9] Mostafa Dehghani. Josip Djolonga, Basil Mustafa, Piotr Padlewski, Jonathan Heek, Justin Gilmer, An- dreas Peter Steiner, Mathilde Caron, Robert Geirhos, Ibrahim Alabdulmohsin, et al. Scaling vision transformers to 22 billion parameters. International Conference on Machine Learning, pages 7480-7512. PMLRR, 2023.
[10] Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Fei-Fei. Imagenet: large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009.
[11] Kefan Dong and Tengyu Ma. First steps toward understanding the extrapolation of nonlinear models to unseen domains. In NewrlPS 2022 Workshop on Distribution Shifts: Connecting Methods and Applications, 2022.
[12] Sebastian Farquhar and Yarin Gal. What 'out-oo is and is not. In NewrIPS ML Safety Workshop. 2022. URL httph:tt///// http:///pppneeeeeeeeeeotrrooooee 2BHQ222

---

[13] Tommaso Furlanello, Zachary Lipton. Michael Tschannen. Laurent Itti, and Anima Anandkumar, Born again neural networks. In International conference on machine learning, pages 1607-1616. PMLR, 2018.
[14] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario March, and Victor Lempitsky. Domain-adversarial training of neural networks. Journal of machine learning research, 17(59), 2016.
[15] Adrià Murriga-Alonso Carl Edward Rasmussen, and Laurence Aitchison. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2018.
[16] Yunye Gong, Xiao Lin, Yi Yao, Thomas G Dietterich, Ajay Divakaran, and Melinda Gervasio. Confidence calibration for domain generalization under covariate shift. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
[17] Sachin Goyal, Ananya Kumar, Sankalp Garg. Zico Kolter, and Aditi Raghunathan. Finetune like you pretrain: Improved finetuning of zero-shot vision models. In /EEE Conference on Computer Vision and Pattern Recognition (CVPR), 2023.
[18] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modemn neural networks. In International Conference on Machine Learning (ICML), 2017.
[19] Kartik Gupta, Amir Rahimi, Thalaiyasingam Ajanthan. Thomas Mensink, Cristian Sminchisescu, and Richard Hartley. Calibration of neural networks using splines. arXiv preprint arXiv:2006. 12800, 2020.
[20] Jinwei Han, Zhiwen Lin, Zhongyisun Sun, Yingguo Gao, Ke Yan, Shouhong Ding, Yuan Gao, and Gui- Song Xia. Anchor-based robust finetuning of vision-language models. arXiv preprint arX14:2404.06244, 2024.
[21] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. Proceedings of the IEFF/CVF Conference on Computer Vision and Puttern Recognition (CVPR), June 2020.
[22] Dan Hendrycks and Thomas Dictterich. Benchmarking neural network robustness to common corruptions and perturbations. International Conference on Learning Representations (ICLR), 2019.
[23] Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang. Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, al. The many faces of robustness: A critical analysis of out-of- distribution generalization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
[24] Dan Hendrycks. Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
[25] Minyoung Huh, Brian Cheung, Tongzhou Wang, and Phillip Isola. The platonic representation hypothesis. International Conference on Machine Learning (ICML), 2024.
[26] Dong-IWan Jang, Sangdoo Yun, and Dongyoon Han. Model stock: All we need is just a few fine-tuned models. arXiv preprint arXiv:2403. 19522, 2024.
[27] Wenlong Ji, Zhun Deng, Ryumei Nakada, James Zou, and Linjun Zhang. The power of contrast for feature learning: A theoretical analysis. Journal of Machine Learning Research, 24(330):1-78, 2023.
[28] Tom Joy, Francesco Pinto, Ser-Nam Lim, Philip HS Torr, and Puncet K Dokania. Sample-dependent adaptive temperature scaling for improved calibration. In AAAI Conference on Artificial Intelligence (AAAI), 2023.
[29] Meelis Kull, Miquel Perello Nieto, Markus Kängsepp, Telmo Silva Filho, Hao Song, and Peter Flach. Beyond temperature scaling: Ohtaining well-calibrated multi-class probabilities with dirichlet calibration. Advances in Neural Information Processing Systems (NeurlPS), 2019.
[30] Ananya Kumar, Aditi Raghunathan, Robbie Jones, Tengyu Ma, and Percy Liang. Fine-tuning can distort pretrained features and underperform -uitt--diistibution. International Conference on Learning Representations (ICLR), 2022.
[31] Jaehoon Lee, Yasaman Bahri, Roman Novak, Samuel S Schoenholz, Jeffrey Pennington, and Jascha Bohl-Dickstein. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018
12

---

[32] Yoonho Lee. Annie S Chen, Fahim Tajwar, Ananya Kumar. Huaxiu Yao, Pency Liang, and Chelsea Finn. Surgical fine-tuning improves adaptation distribution shifts, In International Conference Learning Representations (ICLR), 2023.
[33] Will Vene, Benjamin Pikus, Pranav Raj, and Fernando Amat Gil. Enahling calibration in the zero-shot inference of large vision-language models. arXiv preprint arXiv:2303. 12748, 2023.
[34] Xiaofeng Mao, Yufeng Chen, Xiaojun Jia, Rong Zhang, Hui Xue, and Zhao Li. Context-aware robust fine-tuning. International Journal of Computer Vision (IJCV), 132(5):1685 1700, 2024.
[35] Matthias Minderer, Josip Djolonga, Rob Romijnders, Frances Hubis, Xiaohua Zhai, Neil Houlsby, Dustin Tran, and Mario Lucic. Revisiting the calibration of modern neural networks. Advances in Neural Information Processing Systems (NeurIPS), 34, 2021.
[36] Mehryar Mohri, Afshin Rostamizadeh, and Amect Talwalkar. Foundations of machine learning. MIT press, 2018.
[37] Jishnu Mukhoti, Viveka Kulharia, Amartya Sanyal, Stuart Golodetz, Philip Torr, and Punect Dokania. Calibrating deep neural networks using focal loss. Advances in Neural Information Processing Systems (NeurIPS), 2020.
[38] Rafael Mülerr, Simon Korblithh, and Geoffrey Hinton. When does label smoothing help? Advances in Neural Information Processing Systems (NeurIPS), 2019.
2019.
[39] Allan H. Murphy. Scalar and vector partitions the probability score: : Part i. two-state situation. Journal of Applied Meteorology (1962-1982). 1972.
[40] Mahdi Pakdaman Nacini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In AAAI Conference on Artificial Intelligence (AAAI), 2015.
[41] Ryumei Nakada, Halil Ibrahim Gulluk, Zhun Deng. Wenlong Ji, James Zou, and Linjun Zhang, Under- standing multimodal contrastive learning and incorporating unpaired data. In International Conference on Artificial Intelligence and Statistics, pages 4348 4380. PMLR, 2023.
[42] Giung Nam, Byeongho Heo, and Juho Lee. Lipsum-ft: Robust fine- fine-tuning of zero-shot models using random text guidance. International Conference on Learning Representations (ICIRR), 2024.
[43] Changdae Oh, Junhyuk So, Yongtaek Lim, Hoyoon Byun, Minchul Shin, Jong-June Jeon, and Kyungwoo Song. Geodesic multi-modal mixup for robust funenn Advances in Neural Information Processing Systems (NeurIPS), 2023.
[44] Changdac Oh, Yixuan Li, Kyungwoo Song, Sangdoo Yun, and Dongyoon Han. Dawin: Training-free dynamic weight interpolation for robust adaptation. arXiv preprint arXiv22410.33722, 2024.
[45] Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy V. Vo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel HAZIZA, Francisco Massa. Alaacidin El-Nouby, Mido Assran, Nicolas Ballas, Wojeiech Galuba, Russell Howes, Po- Yao Huang, Shang- Wen Li, Ishan Misra, Michael Rabbat, Vasu Sharma, Gabriel Synnaeve, Hu Xu, Herve Jegou, Julien Mairal, Patrick Labatut, Armand Joulin, and Piotr Bojanowski. DINOv2: learning robust visual features without supervision. Transactions on Machine Learning Research, 2024. ISSN 2835-8856. URL https: / htt////pppp/// //pp/pppeeeveeeeeeeeeeeeeee net/forum? a
[46] Sangdon Park, Osbert Bastani, James Weimer, and Insup Lee. Calibrated prediction with covariate shift via unsupervised domain adaptation. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2020.
[47] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, al. Learning transfcrable visual models from natural language supervision. In International Conference on Machine Learning (ICML), 2021.
[48] Alexandre Ram'e, Kartik Ahuja, Jianyu Zhang, Matthieu Cord, Léon Bottou, and David Lopez- Pazz Model ratatouille; Recycling diverse models for out-of diittrbbittitttoi generalization. In International Conference on Machine Learning (ICML), 2023.
[49] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In International Conference on Machine Learning (ICML), 2019.
[50] Yangjun Ruan, Yann Dubois, and Chris Maddison. Optimal representations for covariate shift. In International Conference on Learning Representations, 2022.
13

---

[51] Frederick Sanders. On subjective probability forecasting, Journal of Applied Meteorology (1962-1982), (2):191-201, 1963.
[52] Murat Sensoy, Lance Kaplan, and Melih Kandemir. Evidential deep learning to quantify classification uncertainty. Advances in Neural Information Processing Systems (NeurIPS), 2018.
[53] Yang Shu, Xingzhuo Guo, Jialong Wu, Ximei Wang. Jianmin Wang, and Mingsheng Long. Clipood: Generalizing clip to out-of-distributions. In International Conference on Machine Learning, pages 31716- 31731. PMLR, 2023.
[54] Nako Sung. Minkyu Kim, Hyunwoo Jo, Youngil Yang, Jingwoong Kim, Leonard Lausen, Youngkwan Kim, Gayoung Lec, Donghyun Kwak, Jung- Woo Ha, et al. Nsml: A machine learning platform that enables you to focus your models. arXiv preprint 1rXivv1712.088 259022 2017.
[55] Christian Szegedy. Vincent Vanhoucke, Sergey loffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
[56] Sunil Thulasidasan, Gopinath Chennupati, Jeff A Bilmes, Tanmoy Bhattacharya, and Sarah Michalak. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. Advunces in Neural Information Processing Systems (NeurIPS), 2019.
[57] Junjiao Tian, Zecheng He, Xiaoliang Dai, Chih-Yar Ma, Yen-Cheng Liu, and 7solt Kira. Trainable projected gradient method for robust fine-tuning, In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2023.
[58] Junjiao Tian, Yen-Cheng Liu, James Smith, and Zsolt Kira. Fast trainable projection for robust fine-tuning. In Advances in Neural Information Processing Systems (NeurIPS), 2023.
[59] Christian Tomani, Sebastian Gruber, Muhammed Ebrar Erdem, Daniel Cremers, and Florian Buettner. Post-hoc uncertainty calibration for domain drift scenarios. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
[60] Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global representations by penalizing local predictive power. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
[61] Mitchell Wortsman, Gabriel Ilharco, Jong Wook Kim. Mike Li. Simon Kornblith, Rebecca Roelofs. Raphael Gontijo Lopes, Hamnaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, et al. Robust fine-tuning of zero-shot models. In IEEE Conference on Compuder Vision and Pattern Recognition (CVPR), 2022.
[62] Greg Yang. Wide feedforward or recurrent neural networks of any architecture are gaussian processes. Advances in Neural Information Processing Systems, 32, 2019.
[63] Yaodong Yu, Stephen Bates, Yi Ma, and Michael Jordan. Robust calibration with multi-domain temperature scaling. Advances in Neural Information Processing Syxtems (NeurIPS), 2022.
[64] Li Yuan, Francis EH Tay, Guilin Li, Tao Wang, and Jiashi Feng. Revisiting knowledge distillation via label smoothing regularization. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
[65] Bianca Zadrozny and Charles Elkan. Transforming classifier scores into accurate multiclass probability estimates. In ACM SIGKDD International Conference Knowledge Discovery and Data Mining (KDD), 2002.
[66] Chang Bin Zhang, Peng-Tao Tao Jiang, Qibin Hou, Yunchao Wei, Qi Han, Zhen Li, and Ming-Ming Cheng. Delving deep into label smoothing. IEEE Transactions on Image Processing, 2021.
[67] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint 1710.0:710009111 2017.
[68] Jize Zhang, Bhavya Kailkhura, and T Yong-Jin Han. Mix-n-match: Ensemble and compositional methods for uncertainty calibration in deep learning. In International Conference Machine Learning (ICML), 2020.
[69] Qi Zhang, Yifei Wang, and Yisen Wang. On the generalization of multi-modal contrastive learning. In International Conference on Machine Learning, pages 41677-41693. PMLR, 2023.
[70] Yifan Zhang, Bryan Hooi, Dapeng Hu, Jian Liang, and Jiashi Feng. Unleashing the power of contrastive self superviedd visual models via contrast- regularzee fine-tuning. Advances in Neural Information Processing Systems, 34:29848 29860, 2021.
14

---

[71] Zhilu Zhang and Mert Sabuncu, Self-distillation as instance-speeifie label smoothing. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
[72] Han Zhao, Shanghang Zhang, Guanhang Wu, José M. F. Moura, Joao P Costeira, and Geoffrey J Gordon. Adversarial multiple source domain adaptation. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
[73] Han Zhao, Remi Tachet Des Combes, Kun Zhang, and Geoflrey Gordon. On learning invariant representa- tions for domain adaptation. International conference on machine learning, pages 7523- 223-- PMLR, 2019.
15

---

Appendix
A Experimental Detail
This section supplements $5 by providing detailed descriptions for experiments to enhance repro- ducibility.
A.1 Details for numerical analysis on error bounds
In $5.1, conducted toy experiments to perform empirical analyses that demonstrate our theoretical findings. We provide the details of the toy experiments using synthetic data.
X2
ID
X2
00D
shape
color
10 train
y
ID test
X1
X1
00D test
feature rescaling
feature suppression
Figure A:
Two-dimensional illustration of the experimental setup for numerical analyses. Note that the actual number of dimensions used for the experiments is set to 1000.
We generate 1000-dimensional Gaussian random variables, where the variables have binary noisy labels (15% of random flip) for the ID train, ID test, and OOD test datasets, For the ID train set, the first 400 dimensions and the second 400 dimensions are correlated with labels, and the remaining 200 dimensions are pero-centered random noises. We build the OOD test set from the ID test set by shifting the mean of the first 400 dimensions and downscaling the second 400 dimensions in half. The remaining 200 dimensions are intact. For example, the feature 2/2 in Figure with labels across train and test in both ID and OOD environments, while the correlation between feature 2 and labels vanish in OOD environment. We train the three-layer multi-layer perceptron networks with four different learning objectives adopting regularization terms for calibration (LsD) and for the smallest singular value (Coc) with varying regularization magnitudes (111 models in total): (i) without regularization (Baseline) (ii) with LSD. (ii) with Loc. and (iv) with LSD and Loc. For Loc. we use an orthogonal constraint over the last weight matrix. For LSD. we adopt Born-Again- -eetoo- (BAN)-style self-distillation [13]. After training,
perfectly correlated
measured omin and ECE on the ID test set and measured the mean squared error (MSE) and ECE on OOD test set. The visualization results of Figure 3 show the correlation between the OOD MSE (or OOD ECE) and its upper bound (average of the standardized smallest singular value of ID feature representation and standardized ID ECE).
A.2 Benchmark datasets
This section supplements the summarized explanations datasets provided in $5.2.
Training and test splits of ImageNet-1K: [10] consist of 1000 classes, and its variants have the entire 1000 subset of the classes. Following Radford al. [47] and Goyal al. [17], we the OpenAl templates to create text descriptions for each class (80 templates per class) for evaluation, and the averaged text representation is used as the final class representation for evaluation. Several related datasets including ImageNet-V2 [49], ImageNet-Rendittee
[23], ImageNet-A [24], ImageNet- Sketch [60], and ObjectNet [3] are employed evaluate robustness of models. These datasets consist of similar semantic classes but are collected from diffrrnt input distributions or styles.
"computed by subtracting the mean and dividing with standard deviation of all 111 models" metric values
16

---

A.3 Baseline methods
This section supplements the summarized explanations of baseline methods discussed in $5.2.
Zero-shot (ZS [47]): Zero-shot classifier is obtained by encoding and averaging text representations of each class using the pre-trained CLIP text encoder.
Standard fine-tuning (FT [61]) Linear classification head is initialized with text representation vectors for each class encoded by pre-trained CLIP text encoder. Image encoder and linear classifier parameters are fine-tuned for 10 epochs with learning rate of 3c-5.
LP-FT [30]: Randomly initialized linear classification head first trained upon frozen image encoder for 5 epochs and then both image encoder and linear head parameters are updated for 5 epochs. For each phase, we use learning rate of le-2 and 3e-5, respectively.
Fine-tuning with contrastive learning (FLYP [17]): Both image and text encoders are updated without additional linear classification heads. To create text representations of training samples, use the OpenAl template similar to the evaluation data. Unlike for evaluation, we do not take an average 80 different templates. Instead, we use 80 versions of text prompts for each class to build training pairs, The training pairs are randomly selected throughout the training steps. We fine-tune the model for 10 epochs (in total, 25K steps) with a learning rate of le-5.
Lipsum-FT [42]: Cross-entropy loss with a regularization term that minimizes the energy gap between image and text is used as fine-tuning objective. We followed the details described in the original paper.
CaRot (Ours): We set the orthogonality constraint coefficient doc 0.2 and self-distillation coefficient ÄSD as 1.5, update frequency for EMA teacher as 500, and EMA final target momentum as 0.9. We linearly increased the EMA momentum by 0.05 for the first 20% iterations. We followed all the other details from FLYP.
B Additional Evaluation Results
In addition to the comparisons of our CaRot with zero-shot, naive fine-tuning, and robust fine- tuning methods in $5, we provide results when applying post-hoc techniques for robustness (weight ensembling) and calibration (temperature scaling). Moreover, we compare our self-distillation-bans soft label with uniform constant label smoothing.
B.1 Comparing approaches
Weight average of fine-tuned and zero-shot (WiSE-FT [61]): Zero-shot and fine-tuned model weights are averaged with a strength of ensembling coefficient. This ensembling technique can be applied to any fine-tuning method. We tune the ensembling coefficient for each method based on the ImageNet ECE value (we picked the value having the lowest ID ECE for each method).
Temperature scaling (TS [18)): Before applying the softmax function to compute output probability distribution, TS divides the logit by temperature 7 E (0, oo). 7 + makes the probability similar to point masses (sharpening), + oo makes uniform distribution (smoothing). Scaling the output distribution does not affect accuracy since it does not change the model prediction (i.c., the probability rank remains the same). Temperature value tuned for each method the ID validation set based on the ECE value.
Label smoothing (LS [55]): LS is regularization strategy that pursues the generalization of classification by utilizing soft labels, which are derived by adding uniform distribution the hard label distribution. The soft label can be viewed as a new target probability distribution where the value of to the target pair is reduced and the value of for the non-target pair increased by the smoothing parameter E (0, 1). Since utilizing soft labels allows the model to pull negative pairs with limited strength, L. is beneficial for calibration beyond generalization by addressing the over-confidence issue [38].
17

---

B.2 Additional result and discussion
Results with WiSE are reported in Table and C. We observe that weight ensembling, which aims to align zero-shot models and fine-tuned models in the model weight space, boosts the overall performance. Still, CaRot shows superior results to the baselines.
Results with TS can be found in Table D. Aligning with previous observations, applying TS significantly improves IDD ECE. However, since TS adjusts the logits assuming that all data instances would have a similar extent of overconfidence (or underconfidence) issue, its positive effect is limited under distribution shifts. Hence, TS does not guarantee attain low calibration error on OOD datasets. It is noteworthy that applying TS even harms OOD ECE of CaRot (compare results with Table 3), which is already calibrated using data-dependent confidence adjustment during fine-tuning.
Results comparing with LS are reported in Table E. In accordance with its capability of improving calibration, LS successfully reduces calibration errors. We observe that our adopted approach, EMA SD, remarkably outperforms L.S, especially on OOD ECE as well as in ID ECE. While LS addresses the over-confidence problem during train time by dispersing the concentrated confidence the target label to non-target labels with a constant amount, self- deff-distillation shows a similar behavior but in a dynamic approach, considering the diversity of data instances [7 We interpret that reflecting the difficulty of input batch and distilling such information is crucial to achieving robust calibration.
We further provide an intuitive interpretation of self-distillation as input-dependent approach to label smoothing as elaborated in Zhang and Sabuncu [71]. EMA SD provides soft labels considering the variation of data instances. For example, classifying dog image from images of airpl ane or car could be less challenging than classifying it from images of cat or wolf. Ideally, a calibrated model should output higher confidence for the former case than for the latter. Instead of providing supervision of constantly adjusted confidence (as in LS),, teacher predictions provide confidence reflecting the input data difficulty. Thereby, the student model can be supervised with high confidence diversity, which leads to a better-calibrated model. Please refer to Zhang and Sabuncu [71] for detailed discussions.
Other types of regularization for larger smallest singular value. We adopted an orthogonality constraint over visual projection matrix W, E Rd xr via ||W/W W. I|e term which pursues the larger effective rank of the visual projection matrix. While we adopt this kind of indirect soft constraint to achieve balanced performance over both ID and OOD generalization, one may wonder about 1) the implication of increased effective rank of W, on the smallest singular value of the covariance matrix and 2) the possibility of leveraging more direct constraints to increase the smallest singular value of the input covariance matrix. This paragraph answers those questions.
Given n samples of d-dimensional visual features and pre-defined projection dimension, let Z, E Raxr and 2, E R"xr denote visual representations obtained by arbitrary projection matrix We E Rd, xr and an orthogonal projection matrix O,, E Rd. xr multiplied with pre- pre-projected visual feature Zu E Raxd, respectively. We can show that the rank of the covariance matrix from 2, is always greater or equal to that of Zu as below,
rank 2.5 -Z)) rank(
(6)
rank(Z, W.)
(7)
S rank Zo Ow)
(8)
rank(2 (2,)
(9)
rank( 2.r 22))
(10)
During minimizing |IWTW, FI the visual projection matrix W, becomes closer to orthogonal matrix Og. and the effective rank of the visual representations' covariance matrix increases. A larger effective rank implies non-diminishing (relatively larger) smallest singular value of matrix, which justifies our implementation of the method.
Meanwhile, we can adopt other constraint terms alternative to orthogonality constraint over visual projection matrix. Using the negative value of the smallest singular value of the visual representation's 's covariance matrix as an additional loss term may be the most natural candidate. The result is provided in Table B.2. While both SVD and orthogonality constraint methods show remarkably better performance in terms of OOD classification and calibration, SVD requires much heavier
18

---

computation compared with the orthogonality constraint term. For simplicity, we advocate the use of orthogonality term thus. Exploring other types of efficient constraint terms will be promising future work direction.
Table A: Comparison between SVD-based regularization and orthogonality constraint term. Both terms are effective in terms of OOD generalization and calibration, but SVD requires a much heavier computation.
ID
OOD
ID-OOD Gap
Time Complexity
Acc. (f)
ECE (4)
Acc. (t)
ECE (4)
Acc. (4)
ECE (4)
FLYP CaRot (SVD)
82.69
0.0635
59.40
0.1836
23.29
0.1201
O(D2N + D
83,05
0.0536
62.40
0.0770
20.65
0.0234
CaRot (Ours)
O(D D²)
83.13
0.0470
62.55
0.0791
20.58
0.0321
Table B: Accuracy on ImageNet and distribution shifts using WiSE-FT [61]. We select the optimal ensem- bling coefficient (i.c., ai for cach method.
Method
IN
IN-V21
IN-R1
IN-A1
IN-St
ObjectNert
Avg. shiftst
ZS
68.33
61.93
77.71
49.95
48.26
54.17
58.39
FT
81.96
72.69
77.19
51.93
53.17
56.83
62,36
LP-FT
82.63
73.14
75.24
51.92
51.99
55.86
61.63
FLYP
82.53
73.65
77.57
54.65
53.23
58.02
63.42
CaRot
82.36
73.72
79.58
54.07
53.96
57.70
63.81
Table ImageNet ECE results with WiSE-FT [61].
Along with Table B, we report the ECE results.
Method
IN|
IN-V2
IN-R
IN-A
IN-SL
ObjectNet.]
Avg. shifts
ZS
0.0570
0.0548
0.0541
0.0967
0.0850
0.0780
0.0736
FT
0.0714
0.0873
0.0744
0.1509
0.1391
0.1528
0.1209
LP-FT
0.0510
0.0895
0.0561
0.1917
0.1587
0.2014
0.1395
FLYP 0.0773
0. 1087
0.0806
0.1963
0.1798
0.1995
0.1530
CaRot
0.0427
0.0416
0.0490
0.1207
0.0731
0.1113
0.0791
B.3 Detailed results from main paper
Coefficient terms ablation. In Table G and F, we present the detailed ablation results of hyper- parameters associated with the methodologies addressed in our paper. These results supplement Table 5.
Different VLM backbones. provide the full results Table in Table and
Visualization of ECE values. Figure B illustrates the reliability diagram of ImageNet ECE results reported in Table 3.
19

---

Table D: ImageNet ECE results with temperature scaling (TS). Supplement to Table 2 and 3, we provide results applying TS. Note that TS is post-hoc method and does not affect accuracy. The temperature selected using IN ECE for each method.
Method
INL
IN-V2]
IN-R
IN-A4
IN-SU
ObjectNet
Avg. shifts.
zs
0.0392
0.0633
0.0532
0.1792
0.1370
0.1760
0.1217
FT
0.0463
0.0786
0.0484
0.1798
0.1408
0.1820
0.1259
LP-FT
0.0382
0.0509
0.0477
0.1450
0.1028
0.1433
0.0979
FLYP
0.0392
0.0633
0.0532
0.1792
0.1370
0.1760
0,1217
Lipsum-Fi FT
0.0380
0.0599
0,0419
0.1445
0.1165
0.1362
0,0998
CaRot
0.0401
0.0527
0.0437
0.1520
0.0802
0.1373
0.0931
Table E: Comparison on and EMA SD. We compare impact LS and EMA SD with LMCL-con as
calibration regularization.
Acc.t IN-A
Method
IN
IN-V2
IN-R
IN-S
ObjectNet
Avg. shifts
82.51
73.18
71.80
48.16
49.78
54.67
59.51
LS
82.53
73.33
71.90
48.33
49.46
54.99
59.60
EMA
SD
83.13
74.11
77.71
51.60
52.71
56.60
62.55
ECE|
0.0651
0.1104
0.0910
0.2459
0.2132
0.2411
0,1803
LS
0.0475
0.0726
0.0526
0.1534
0.1533
0.1993
0.1262
EMA
0.0470
0.0367
0.0575
0.1240
0.0699
0.1075
0.0791
Table Orthogonality constraint hyperparameter. We report impact of orthogonality constraint term of the CaRot objective by ablating its strength coeflicient Anc. We set our final value as 0. 2, tuning based on ID ECE.
Acc.1
Aoc
IN
IN-V2
IN-R
IN-A
IN-S
ObjectNet
Avg. shifts
0.1
83.18
74.10
77.53
51.35
52.66
56,47
62.42
0.2
83.13
74.11
77.71
51.60
52.71
56.60
62.55
0.5
83.04
74.40
77.64
51.04
52.63
56.49
62.44
1.0
83.09
74.35
77.59
51.23
52.65
56.62
62.49
Aoc
ECE,
0.1
0,0511
0,0382
0.0620
0.1190
0.0712
0.0990
0.0779
0.2
0.0470
0.0367
0.0575
0.1240
0.0699
0.1075
0.0791
0.5
0.0478
0.0408
0.0579
0.1253
0.0701
0.1048
0.0798
1.0
0.0499
0.0380
0.0609
0.1201
0.0693
0.1022
0.0781
Table G: Self-distillatio term hyperparameter. We report the impact of the EMA SD of CaRot ohjective by ablating strength coefficient Asp. set our final value as 1.5, tuning based on dminn
Acc.t
ASD
IN
IN-V2
IN-R
IN-A
IN-S
ObjectNet
Avg. shifts
0.5
83.07
74.22
74.37
50.76
51.49
56.08
61.38
1.0
83.23
74.51
76.38
51.05
52.47
56.63
62,21
1.5
83.03
74.13
77.59
50.72
52,49
56.49
62.28
2.0
82.72
74.14
78.25
50.71
53.13
56.49
62.54
AsD
ECE.
0.5
0.0482
0.0791
0.0599
0.2002
0.1533
0.1960
0.1377
1.0
0.0388
0.0544
0.0405
0.1640
0.0914
0.1481
0.0997
1.5
0.0523
0.0401
0.0642
0.1173
0.0732
0.0910
0.0772
2.0
0.0634
0.0467
0.0785
0.1030
0.0796
0.0829
0.0781
20

---

Table H: ImageNet results CLIP ResNet50
Acc.t
Method
IN
IN-V2
IN-R
IN-A
IN-S
ObjectNet
Avg. shifts
ZS
59.83
52.90
60.72
23.25
35.45
40.27
42.52
76.21
64.87
50.66
18.11
33.90
42.32
41.97
LP-FT
76.25
64.48
49.55
18.60
33.33
42.13
41.62
FLYP
76.16
65.10
51.55
20.08
34.24
42.53
42.70
CaRot (Ours)
76.12
65.36
52.16
19.32
34.05
42.67
42.71
ECEJ
ZS
0.0624
0.0559
0.0530
0.2048
0,0740
0,0899
0.0955
FT
0.0983
0.1623
0.1860
0.4692
0.2824
0.3023
0,2804
LP-FT
0.1042
0.1759
0.2709
0.5184
0.3520
0.3197
0.3274
FLYP
0.0516
0.0872
0.1439
0.3872
0.2021
0.2432
0,2127
CaRot (Ours)
0.0471
0.0601
0.0948
0.3435
0.3435
0.2127
0.1714
Table ImageNet results CLIP VIT-L/14
Acc.f
Method
IN
IN-V2
IN-R
IN-A
IN-S
ObjectNet
Avg. shifts
ZS
75.55
69.85
87.85
70.76
59.61
66.59
70.93
84.74
75.32
75.36
55.65
54.44
59.76
64.11
LP-FT
85.26
76.76
80.21
55.95
56.84
60.12
65,98
FLYP
86.19
78.21
83.81
68.85
60.20
66.15
71.44
CaRot (Ours)
86.95
79.28
87.96
72.68
62.66
68.05
74.13
ECE|
ZS
0.0590
0.0686
0.0339
0.0640
0.1037
0.0852
0.0711
0.1056
0.1741
0.1613
0.3151
0.3234
0.2865
0.2521
LP-FT
0.0993
0.1531
0.0872
0.2593
0.2613
0.2572
0.2036
FLYP
0,0729
0.1219
0.0621
0.1443
0.2164
0.1903
0.1470
CaRot (Ours)
0.0349
0.0634
0.0353
0.0732
0.0914
0.1051
0.0737
21

---

IN
IN-V2
IN-R
IN-A
IN-Sketch
ObjectNet
0,0790
zs
13
0.0884
0.1468
0.1166
0.2544
0.
Expected Accuracy t
FT
0.4
0X
30
0.2
04
05
08
1.5
00
01
04
0.5
05
02
34
0.5
35
1.0
02
04
05
01
10
0.0505
0.0894
0.0613
0.2051
0.1659
0.2124
LP-FT
02
04
06
01 1.0
50
05 S5 1O
0.1171
0.0967
0.2435
0.2300
0.2383
FLYP
60
0.5
09
92
0.1
066
08
10
50
0.6
65
50
14
0.1240
0.1075
08
CaRot (Ours)
04
64
02
62
30
08
Confidence
Figure B: Reliability diagram ImageNet ECE, This figure supplements ECE results in Table 3, The value inside cach plot indicates ECE.
22

---

d C Proof and further discussion
In this section, we provide proof for Theorem 3 and some discussions.
Theorem C.1 (Restatement of Theorem 3.). Let h X [0. 1] be a real-valued function of structure
h(xx)= = Di=1 (a((i] where h2 is an arbitrary one-dimensional function, and h is in a hypothesis class H. that has pseudo dimension (H) dh. Din be an N Nisize empirical distribution domain. If (x[[],...., .[]] have matching marginals for ID and OOD, and (x]i], x(i]) a bi-variate Gaussian for every i,J E [d]. then for any ö (0, 1) and for all the following bounds hold with probability at least 6:
ID
+ +0 (v log dn
N
f) EDon (h) S Dm (h)
miin (DDD))
N
(5)
(II)
d
(v
N log
di
1 5
&D (h) + ii) Epoon (1(())-))) DDoon [oomll(()))] ((x))1-11
A A+0
Omiu
(p))
dp
(12)
where E [ is a covariance matrix with a strictly positive minimum singular value of d-dimensional normalized input ã = (#[1),.., [e[])...,fff H[d]), where (-{{: - Varl -1/2 and miin (M) is the smallest singular value of a matrix M E 12d Xd2
Proof. The proof for the above theorem is divided into three steps: 1) the derivation of OOD calibration error bound, 2) the derivation of OOD generalization bound, and 3) the replacement of domain discrepancy term ID and OOD into an ID-depend singular value term.
We first define a domain discrepancy measure H-sqaure disagreement, sdH, between two distributions as below:
Definition C.2 (H-sqqure disagreement), Given two probability distributions DooD and' ID over
imput space X, H. as a hypothesis class containing the hypothesis h(-) : X + [0, 1]. the discrepancy between DOoD andDıp is defined as
sdu(Doon, Din) = sup
ED [((x)) (Ib()) -1(())) -Ep ( [1))))
(13)
N.K'H
The H-square disagreement can be regarded as a variant of H-divergence [5] which adopts mean square error term rather than 0- classification loss or mean absolute error term as in [72].
Proposition C.3 (OOD calibration error bound). Let h X' + [0, 1] be real-valued function
functtionnnn in
hypothesis class H with pseudo dimension Pdūm(H) = dn. If DiD is an empirical distribution constructed by N -isize i.i.d. samples drawn from DiD, then for any 8 (0, 1), and for all h, a bound below hold with probability at least 1 5.
EDow (h) S ED (h) wdw Din) + +
(V log J + dp log -/1 dr.
N
)
(14)
N
Now, likewise Lemma of [72], we start to review a triangle inequality for all h, h², h² E H. for any
D on X, and for error function (D(:, the inequality Ep h²) I ED (h, h²) + ED("", h²) holds. Here, we use ED (h, h/) to denote Eg= (h(()) h (x(x)))). Now, given h" = arg min EDm (h)
EDron (h) and A = ED EDom (h*) we have
&Doo (h) S Dooo (h") + 8 Doop (h, 11*)
@Dooo (h" + DooD (h, lt") EDo h²) + aD (h, li))
S EDooo (h") + |eDoco (h, l1)) ED (h, hn') + E (h, li*)
I EDooo (h*) + &D (h, h²) )²) + sd (DoOD, DiD)
S EDooo (h*) + EDP (h) + EDp (h + sdx (Doon, Dmn)
= =D (h) + sdx (DoOD. DmD) + A.
(15)
23

---

where Ep (h) is defined as Ep(h) := E,- Ez~r((h(a) [z)) and ho == arg meg (x((()) e(x))]²] denotes a desired calibrated predictor of label when e(x) := Eply h())). Here, the first and fourth inequalities in Eq (15) are held by triangular inequality.
The above bound defined over the true population distribution DID and DOOD. For the ID domain, we can confine our analysis to empirical distribution DId with ii.d. samples generated from Din by leveraging generalization bound on single domain regression setting [36, 72J. If Pdim for all h E H. below bound holds with probability at least 5 (See Lemma 5 of Zhao et al. [72]-
da.
(v N
N log J + dp log dr. )
Dooo (h) S Di (1i) + sdoD(DDDD Pι)) A
(16)
The above bound is similar to a regression bound proposed by Zhao et al. [72], but we build the theory based on the squared error rather than the previously adopted absolute error. This slight change allows us two attractive extensions that we will introduce to achieve calibrated robust fine-tuning.
While Proposition C.3 provides guidance pursue OOD calibration, it does not say anything about OOD classification error, which is our primary goal before calibration. Here, we pay attention to the decomposition of the Brier score [39, 46]:
E (((())) 5)²
(((()))<)))))))) E((h(L) c())) +1 Blc(r)*
(17)
classification
calibration
sharppesss
where [[(h(x) - y) is an expected mean-squared classification error and B[e(x))² denotes the sharpness [51] term rewarding the predictor i(-) to produce outputs towards zero or one. By assuming that h(-) is expressive enough to estimate the ground truth expectation function for the label, i.e., c(-),
plugging Eq. (17) into the LHS of Proposition C.3 derives the same (except a constant) upper bound for the sum of classification error and prediction sharpness on OOD samples as in Proposition C.4.
Proposition C.4 (OOD generalization error bound). Let h(.)), H. and Dip have the same definition as in Proposition C.3, then for any ó E 1), and for all h, a bound hold with prob. at least 1-ô,
(V (VN
N log + dr log da
EDoop [D(o)((((x) y) EDooo [c(x]']]]]]]))))(())))) S E (h) + sd (Doon, Dmo) + +A+0
(18)
From domain discrepancy to minimum singular value. The second term 8dz2 (DooD, Dmn) of RHS of Proposition C.3 and Proposition C.4 is defined on both ID and OOD samples, so it hard to control the quantity directly. While existing approaches attempt to learn domain-invarian representa- tions for reducing the similar quantity (e.g., H-divergence) by using unlabeled OOD data [14, 72, 73], the OOD data commonly inaccessible quantity that is solely defined with ID data. Recently, Dong and Ma [II] proved that the domain discrepancy ratio can be bounded from above by reciprocal of the smallest singular value of covariance matrix of ID data as below:
many real-world applications. Therefore, we need
Duco (()))-(((2)) EDD. (h(x) - h² m (EDw))
d
sup W.
(19)
where EDn ED [ix") is covariance matrix of the d-dimensional nomarlized input ă (ā[1),.., ..., R[d)) where ā|i] == (x]i) - E[rli]] Var(=]i]) and amin (M) is the minimum singular value of a matrix M E Rd11
Lemma C.5. Assuming that OOD calibration error is always greater than the ID calibration error and noting that the range of h(-) is [0, 11, the second term sd (DooD. DiD) of RHS in Proposition C.3 and C.4 is bound from above by the smallest singular value of the normalized input covariance matrix. That is,
d
sd (DODD: Dío)
(20)
o min (EDw)
24

---

This can be easily shown by the definition of sdx (DoOD, DID), shx (DOOD, DiD)
sup N.NEH
D [1((z) 1t' (x())) EDD (1()))
(21)
Doon (h(x) - [())))
sup N.
(22)
DR (h(x) (x))²²
(23)
min (EDm)
Where the first inequality is held by the assumption of the Lemma C.5 and the second inequality is held by Theorem 3 of [11].
Finally, we can derive more tractable bound for OOD classification and calibration error by plugging the Lemma C.5 into the Proposition C.3 and Proposition C.4.
Discussion on the tightness of proposed bound Our theoretical analysis was inspired by two previous works that provide OOD generalization error bound [5] and the domain discrepancy bound via the smallest singular value [11]. Intuitively, the inequality of our bounds (ineq. 1)) approaches to equality (becomes tight) under the following conditions:
1. When the outputs of the learned classifier are the same as the outputs of the ideal joint classifier that is trained to minimize both ID and OOD errors [5].
2. Whether the outputs of our classifier or ideal joint classifier are perfectly calibrated [5].
3. The number of training samples N approaches infinite [5].
4. If our classifier is a linear model when the weight vector is the same as the eigenvector corresponding to the smallest eigenvalue the input covariance matrix [11].
5. When the OOD and ID calibration errors satisfy the relationship: &Doo (h,
Dbp (h.h*) (EDp (h,)
Although our bound seems quite loose given the high dimensionality of modern machine learning setup, empirical validation in the paper strongly supports the validity of our
method.
Discussion the gap between reality and assumption Some ground assumptions derive bound. First, we assume that ID and OOD have overlapping marginal distributions, whereas the joint distributions do not overlap much. Second, we assume that hypothesis function has the structure of (xx) Ede (xlii). Finally, we assume the pair-wise bi-variate normality of (x[i), =[i]) for every i.j E dd]. Given that the input x here is the last layer representation of the visual encoder, ID and OOD have overlapping marginals, but we can not guarantee that the joint distributions of input do not overlap much. For example, there would be a high overlap between ImageNet (ID) and ImageNet- V2 (OOD) terms of the input joint distributions, but there would not much overlap in the case of Inagehet-Sketch as OOD. While it depends on the type of OOD, our evaluation shows robust results across datasets. The second assumption over the structure of our hypothesis function is naturally met if our h(-) is linear classifier, which is realistic under the modern representation learning paradigm with heavy feature extractor and a light task-specific head. Lastly, about our last assumption, the representation of neural networks is not usually guaranteed to be pair-wise Gaussian. However, there rich evidence revealing that the outputs of infinitely wide neural networks (whether they MLP [31], convolutional neural network [15]. Transformer [62]) are Gaussian processes (GPs) and GPs ensure that every finite collection of their elements are jointly Gaussian. While our numerical analyses are limited to VIT-L scale models, we believe that the current large-scale modeling
regime spurs us to explore larger widths [9] where our second assumption becomes more valid [31].
25

---

NeurIPS Paper Checklist
1. Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification: In the abstract and introduction, we explicitly state the contributions and scope of this work: (scope) we aim to address out-of-distribution generalization and calibration during fine-tuning of vision-language models, (contributions) 1. observing the problems of existing methods, 2. theoretical analysis on OOD generalization and calibration, 3. devise a novel theory- motiivate method pursuing OOD generalization and calibration simultaneously, 4, extensive empirical results that support our claims. Those are clearly reflected throughout the entire paper.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or
NA answer to this question will not be perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results
be expected to generalize other settings.
It is fine to include aspirational goals as motivation as long is clear that these goals are not attained by the paper.
2. Limitations
Question: Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification:
We present the limitation of this paper at the end of 9-th page and Appendix.
Guidelines:
The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model vell-specificattin, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect on the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and faimess.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, worse outcome might be that reviewers discover limitations that aren't acknowledged
the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
26

---

3. Theory Assumptions and Proofs
Question: For each theoretical result, does the paper provide the full set of assumptions and complete (and correct) proof?
Answer: [Yes]
Justification: Regarding theoretical analysis provided in Section 3 is fully discussed in Appendix C, where we present assumptions in detail and proof in depth.
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated referenced in the statement of any theorems. The proof' can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should properly referenced.
4. Experimental Result Reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main ex- perimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless whether the code and data are provided or not)?
Answer: [Yes]
Justification: Details for reproducibility (experimental setup) are provided in Appendix A.
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is a dataset and/or model, the authors should describe the steps taken make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is specific model and empirical evaluation, may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access the model. In general. releasing code and data often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how replicate the results, access a hosted model (e.g., in the case of large language model), releasing of a model checkpoint, or other means that are appropriate the research performed.
While NeurIPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily a new algorithm, the paper should make clear how to reproduce that algorithm.
(b) the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.
(c) the contribution is a new model (e.g., a large language model), then there should either be way to access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (c.g., to registered users), but it should possible for other researchers have some path reproducing verifying the results.
27

---

reproducible, they 5. Open access to data and code
Does the paper provide open access to the data and code, with sufficient instruc- tions faithfully reproduce the main experimental results, described in supplemental material?
Question:
Answer: [Yes]
Justification: At the end of abstract, we provide a URL link for anonymized code repository that contains example command for reproduction.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurlPS code and data submission guidelines (https://nip) cc/
for more details.
While we encourage the release of code and data, we understand that this might not be possible, so "No" an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (c.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https: /nips. htt//uulccgguuuceee
www.emmmsssiooPooo ssionPolicy) for more details.
The authors should provide instructions on data access and preparation, including how access the raw data, preprocessed data, intermediate data, and generated data, etc.
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information as possible supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.
6. Experimental Setting/Details
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
Answer: [Yes]
Justification: Train and test details are provided in Section 5.2 and in Appendix A.
Guidelines:
The answer NA means that the paper does not include experiments.
The experimental setting should be presented in the core the paper to a level of detail that is necessary to appreciate the results and make sense of them.
The full details can be provided either with the code, appendix, as supplemental material.
7. Experiment Statistical Significance
Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Answer: [No]
Justification: We report statistical significance for toy experiments. However, for large-scale dataset benchmarks (i.e., ImageNet with CLIP ViT-B/16), we do report error bars due to expensive computational costs.
Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results are accompanied by emor bars, confi- dence intervals, or statistical significance tests, least for the experiments that support the main claims of the paper.
28

---

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
The assumptions made should be given (e.g.. Normally distributed errors).
It should be clear whether the error bar is the standard deviation or the standard error of the mean.
is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CL, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that out of range (e.g. negative error rates).
If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments Compute Resources
For each experiment, does the paper provide sufficient information on the com- puter resources (type of compute workers, memory, time execution) needed to reproduce the experiments?
Question:
Answer: [Yes]
Justification:
We reviewed and followed the NeurIPS Code of Ethics.
Guidelines:
The answer NA means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU GPU, internal cluster, or cloud provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental runs as well estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary failed experiments that didn't 't make into the paper).
9. Code Of Ethics
Question: Does the research conducted in the paper conform, in every respect, with the NeurlPS Code of Ethics
Answer: [Yes]
Justification: This paper conforms with the NeurIPS Code of Ethics in every respect.
Guidelines:
The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.
If the authors answer No. they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g., there a special consid- eration due to laws regulations in their jurisdiction).
10. Broader Impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [Yes]
Justification: Both positive and negative impacts are discussed at the end of the paper.
Guidelines:
The answer NA means that there no societal impact of the work performed.
If the authors answer NA or No, they should explain why their work has no societal impact why the paper does not address societal impact.
29

---

Examples of negative societal impacts include potential malicious unintended uses (e.g., disinformation, generating fake profiles, surveillance), faireess considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional unintentional) misuse of the technology.
If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms monitor how system learns from feedback over time, improving the efficiency and accessibility of ML).
11. Safeguards
Does the paper deseribe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification:
This paper does not pose such risks.
Guidelines:
The answer NA means that the paper poses no such risks.
Released models that have high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Licenses for existing assets
Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
Question:
Answer: [Yes]
Justification: We cite the original paper of dataset and methods.
Guidelines:
The answer NA means that the paper does not use existing assets.
The authors should cite the original paper that produced the code package dataset.
The authors should state which version of the asset used and, possible, include URL.
The name of the license (e.g., CC-BY 4.0) should be included for each asset.
For scraped data from a particular source (e.g., website). the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms use in package should be provided. For popular datasets, paperswi thcode. com conddatasess has curated licenses for some datasets. Their licensing guide can help determine the license of dataset.
30

---

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if has changed) should be provided.
If this information is not available online, the authors are encouraged to reach out to the asset's s creators.
13. New Assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [NA]
Justification:
We do not release assets.
Guidelines:
The answer NA means that the paper does not release new assets.
Researchers should communicate the details the dataset/code/mooel as part their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset used.
At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsoureing and Research with Human Subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification:
We do involve research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Including this information the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included the main paper.
According the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects
Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or equivalent approval/review based the requirements of your country or institution) were obtained?
Answer: [NA]
Justification:
We do not involve crowdsourcing research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Depending the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
31


Reviews:
[{"review_id": "hRNM87kpxA", "reviewer": "Reviewer_g5ML", "summary": "This research paper presents a novel fine-tuning approach for improving out-of-distribution (OOD) generalization and calibration in Vision Language Models (VLMs). By identifying a shared upper bound for OOD accuracy and calibration errors, the authors develop a constrained multimodal contrastive loss framework enhanced by self-distillation. Empirical validation and tests on ImageNet benchmarks demonstrate the method's effectiveness in enhancing both OOD accuracy and calibration error.", "questions": "Please see the weaknesses.", "limitations": "The authors discussed one limitation of the work. I don't notice any potential negative societal impact.", "rating": 5, "confidence": 2, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- The proposed approach is well motivated by theory. The connection of out-of-distribution (OOD) generalization and calibration in terms of the smallest singular value of the input covariance matrix of in-distribution (ID) data is interesting and novel to my knowledge.\n- The experiments are extensive and the results are good on both fronts.", "weaknesses": "- The theory part is a bit obscure. Is there an intuitive interpretation of the smallest singular value of ID input covariance matrix in the studied context? How tight is the upper bounds (Theorem 3.1)?\n- Were the main experiments repeated multiple times? If so, can the authors provide the error bars for the main experiments?  - The paper limits the scope to VLM fine-tuning, but does it also apply to fine-tuning other kinds of models?", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "## R1 (g5ML)\n**R1-1**\n> (a) The theory part is a bit obscure. Is there an intuitive interpretation of the smallest singular value of ID input covariance matrix in the studied context? \n\nWe derive the smallest singular value into the bounds for OOD errors through two steps: 1) We frist derive OOD calibration and generalization error bounds with ID calibration error and H-square disagreement between ID and OOD, 2) we then introduce the reciprocal of the smallest singular value of ID covariance matrix as an upper bound of H-square disagreement. By substituting H-square disagreement (which requires access to OOD data) with the smallest singular value term, we now obtain OOD error bounds that depend soley on ID data.\n\nAccording to Theorem 3.1, the upper bound on the OOD classification and calibration errors decreases as the smallest singular value increases. Intuitively, enforcing larger smallest singular values can be interpreted as inducing a larger effective rank of the input representation and its covariance matrix. The effective rank measures how evenly the singular values are distributed, indicating that the model learns more diverse features [1] and is less likely to focus on ID-specific biased attributes, thus improving OOD generalizability. This concept of de-correlating the covariance of input representations to increase the effective rank is well-studied in the context of self-supervised learning, which aims to learn transferable representations [2,3].\n\nMotivated by this theoretical insight, we developed a method that encourages a high effective rank of input representations and their covariance matrix by applying a soft constraint to ensure the last projection layer, $W$, functions as an orthogonal projection matrix, $O$. This ensures that the rank of ID input representation and its covariance matrix produced by our method is closer to the upper bound rank than any other possible projection matrices, $W$, without this constraint as below,\n\n$$\n\\begin{split}\n\\text{rank}(\\tilde{Z}^{T}\\cdot\\tilde{Z}) &= \\text{rank}(\\tilde{Z}) \\\\\\\\\n &= \\text{rank}(W\\cdot Z^{T}) \\\\\\\\\n &\\le \\text{rank}(O\\cdot Z^{T}) \\\\\\\\\n &= \\text{rank}(\\hat{Z}) \\\\\\\\\n &= \\text{rank}(\\hat{Z}^{T}\\cdot\\hat{Z})\n\\end{split}\n$$\n\nwhere $Z$ is input feature before projection, and $\\tilde{Z}$ and $\\hat{Z}$ denote input representations obtained by projection matrix $W$ and $O$, respectively.\n\n> (b) How tight is the upper bounds (Theorem 3.1)?\n\nOur theoretical analysis is inspired by two previous works that provide OOD generalization error bound [4] and the domain descrepancy bound via the smallest singular value [5]. \n\nIntuitively, the inequality of our bounds (1) in the manuscript approaches to equality (becomes tight) under the following conditions:\n* i) When the outputs of learned classifier are same with the outputs of ideal joint classifier that is trained to minimize the both ID and OOD errors [4].\n* ii) Whether the outputs of our classifier or ideal joint classifier are perfectly calibrate [4].\n* iii) The number of training samples $N$ approaches infinite [4].\n* iv) If our classifier is a linear model, when the weight vector is same with the eigen vector corresponding to the smallest eigen value of input covariance matrix [5].\n* v) When the OOD and ID calibration errors satisfy the relationship: $\\varepsilon_{OOD}(h,h^{\\*})=\\varepsilon^{2}_{ID}(h,h^{\\*})$ / $(\\varepsilon _{ID}(h,h^{*}) - 1)$\n\n\nWhile we leave the exact mathematical statement on the tightness of our bounds to future work, we demonstrate the validity of our bounds as shown in Section 5.1. This is further supported by promising results on real datasets presented in Section 5.2. Additionally, we provide empirical validation of the tightness of our OOD calibration error bound in Figure 5 of PDF.\n\nWe compute the right-hand side of our bound as $\\varepsilon_{\\text{ID}}(h)$+ $\\\\frac{1}{\\\\sigma_{min}(\\tilde{\\Sigma_{ID}})}$ +$\\\\Delta$  by neglecting the $\\mathcal{O}(\\cdot)$ term, assuming we have sufficiently large training samples, and we approximate the joint optimal risk $\\Delta$ as a sum of ID and OOD errors from the models trained on ID and OOD train set, simultaneously. We see that the estimated upperbound is placed between the $\\varepsilon_{{OOD}}(h) + 2\\text{std}(\\varepsilon_{OOD}(h))$ and $\\varepsilon_{{OOD}}(h) + 3\\text{std}(\\varepsilon_{{OOD}}(h))$ region in average, which is not significantly deviated from true OOD error.\n\n**R1-2**\n> Were the main experiments repeated multiple times? If so, can the authors provide the error bars for the main experiments?\n\nWe repeated the experiments three times with different random seeds for each method and confirmed that the performance improvement exceeds the error bars. The results are provided in Figure 4 of the attached PDF. We will also update the tables in the manuscript accordingly.\n\n**R1-3**\n> The paper limits the scope to VLM fine-tuning, but does it also apply to fine-tuning other kinds of models?\n\nUnder the main challenge of fine-tuning foundation models without losing their inherent generalizability to unseen domains, we chose CLIP as our primary focus by following previous works [6,7,8,9].\n\nHowever, as the reviwer g5ML pointed out, our theoretical results are not confined to vision-language models (VLMs). Verifying the applicability of our method to other kind of models will further broaden the impact of our method. Therefore, we expanded our experimental scope to vision-only models, specifically DINOv2 [10] pre-trained ViT-base, using DomainBed benchmark [11], and confirmed the effectives of our proposed framework. The results are provided in Table 3 of the attached PDF.\n\nWe see that while ERM++ method already achieve superior performance compared with other baselines, applying CaRot objective to ERM++ further improves its performance in terms of Accuracy and ECE, and shows the best results in two considered datasets.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "X8JO1s2Xpf", "reviewer": "Reviewer_nZD2", "summary": "VLMs have shown to be effective in a wide-area of applications, though they can fail under certain domain shifts. In this work, the authors first observe that the the upper bound of generalization and calibration under domain shifts is bounded by the ID calibration error and the smallest singular value of the ID covariance matrix. Building upon this intuition, the authors then propose a novel fine-tuning scheme for VLMs in the shape of a contrastive objective and a self-distillation technique. Experimental evaluation on Imagenet and quite a few of its variants are presented to show the effectiveness of the proposed approach.", "questions": "I wonder what the authors think about the first weakness I have described above and it would be great to see detailed Imagenet-C results.", "limitations": "The limitations are somewhat discussed in the conclusion. I appreciate the fact that they have stated that they could not include larger models due to computational constraints which prompted me to avoid asking for how the proposed method would perform with larger models trained with much larger data.", "rating": 6, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- The motivation for the work is neatly presented with a clear link between the motivation and the proposed method. While the exact method does not depend on Theorem 3, it is still a good way to explain why the proposed method can serve as a proxy to reduce OoD unreliability of the models. Sections 3 and 5.1 are really helpful in this regard.\n- Throughout the work, the design choices are explained clearly in a technically sound manner with intuitive connections being made between the utilized concepts and the math behind.\n- The experimental benchmarks chosen for evaluation seems to be adequate as it involves a rather wide range of Imagenet variants, from those that are much more similar to Imagenet like ImagenetV2 to Imagenet-S. From the results of these experiments, it can be seen that the proposed method mostly brings significant improvements for the domain-shift settings.", "weaknesses": "- In certain cases, such as Imagenet-R on Table 2 and 3, it appears that the zero-shot CLIP is better than _any_ of the fine-tuning methods including the proposed approach in terms of _both_ the accuracy and calibration. Furthermore, the calibration after fine-tuning with CaRoT is worse than the zero-shot CLIP under harsher domain-shift benchmarks, namely the ObjectNet, Imagenet-{A, S, R}. I wonder how would the Table 2 look like had the model had access to multiple training environments (e.g maybe having a subset of Imagenet-S during fine-tuning, then evaluated on Imagenet-R) as it is often the case for domain generalization benchmarks [A].\n- On Tables 2 and 3, the proposed approach seems to be falling behind of the other methods in terms of Imagenet accuracy, which may limit its usefulness for a wider range of applications.\n- It would have been good to have Imagenet-C [B] here as well, as it is perhaps the most commonly used among these variants for domain shift benchmarking. In particular, having some analyses based different types of corruptions and under different severity levels could have provided more insights into the limitations and strengths of the proposed approach.\n- One of the minor issues I can see with the work is regarding the usage of the term \"OOD\", especially since the benchmarks used vary significantly from Imagenet-V2 (which was designed to be distributionally as similar as possible to the original Imagenet) to Imagenet-S. While I acknowledge that the authors clarify what they mean under Section 2, I still encourage them to check out [C] for a nice template on works involving the term. \n\n\n\n[A] Guljarani et al., \"In search of lost domain generalization\", ICLR 2021\n\n[B] Hendrycks et al., “ Benchmarking Neural Network Robustness to Common Corruptions and Perturbations”, ICLR 2019\n\n[C] Farquhar et al., \"What ‘Out-of-distribution’ Is and Is Not\", NeurIPS-W 2022", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "**R2-1**\n> (a) In certain cases, such as Imagenet-R on Table 2 and 3, it appears that the zero-shot CLIP is better than any of the fine-tuning methods including the proposed approach in terms of both the accuracy and calibration. Furthermore, the calibration after fine-tuning with CaRoT is worse than the zero-shot CLIP under harsher domain-shift benchmarks, namely the ObjectNet, Imagenet-{A, S, R}.\n\nAs the reviewer pointed out, zero-shot CLIP shows strong performance in both terms of accuracy and calibration error. The robust fine-tuning literature focused on preserving (or improving) the OOD accuracy after fine-tuning CLIP on ID data. In this work, we expanded the metrics of interest to OOD calibration error and observed that existing baselines sacrifice the confidence calibration as well as OOD generalization errors. As shown in Table 1 and 2 in the manuscript, compared with other fine-tuning methods, CaRot achieves the best accuracy in all OOD datasets and minimum calibration error in four out of five OOD datasets. \n\nWe agree that improving OOD generalization and calibration error beyond zero-shot CLIP should be the ultimate goal of robust fine-tuning research, and we leave this as our future work.\n\n> (b) I wonder how would the Table 2 look like had the model had access to multiple training environments (e.g maybe having a subset of Imagenet-S during fine-tuning, then evaluated on Imagenet-R) as it is often the case for domain generalization benchmarks [A].\n\nWe appreciate the reviewer for suggesting such a meaningful evaluation setup to investigate the versatility of CaRot. As recommended, we conducted experiments on multi-source domain generalization with DomainBed [11]. We used PACS and VLCS datasets, where each dataset consists of four domains of the same class labels (i.e., covariate shift). Following the leave-one-out setting, we train the model on three domains and test on the unseen remaining domain (please refer to global response for details). \n\nThe results in Table 3 of the attached PDF show that CaRot on top of ERM++ achieves the best performance on three out of four cases in terms of Accuracy and all four cases in terms of ECE. Especially, on PACS dataset of training-domain validation model selection setup, CaRot improves the accuracy of ERM++ from 95.0 to 96.2 and ECE of ERM++ from 0.025 to 0.013 that are signifcant given that the absolute performance of ERM++ is already very competative. This indicates that CaRot can be effectively adopted in setups where multiple training domains are available, enhancing both the accuracy and calibration of the algorithm.\n\n\n**R2-2**\n\nWe acknowledge the reviewer's concern regarding the marginal underperformance of CaRot on ID (ImageNet) data compared to Lipsum-FT. However, the performance gain on the OOD data (61.04 -> 62.55; **2.5%**), which is significantly larger than the loss of ID performance (83.30 -> 83.13; **0.2%**), implies better effective robustness of CaRot. This robustness is crucial for many safety-critical real-world applications, where the ability to generalize to unseen data is often more important than slight improvements on the training data.\n\n**R2-3**\n\nWe appreciate the reviewer's suggestion, and we evaluated CaRot on ImageNet-C [13] consisting of 15 synthetic corruptions with five severities. We report the results averaged over severities in Figure 1 of the attached PDF. The results show that CaRot consistently outperforms other fine-tuning methods in terms of Accuracy and ECE across all corruption types. Specifically, for the coarser corruption such as Snow, Forst, Fog, Bightness and Contrast that are more natural type of shifts compared to others, CaRot greatly ourperforms baseline methods whereas on the finer corruption such as Elastic transform the performance gain by CaRot relatively diminishes. Due to the space constraints, we attached box plots only for brightness and elastic transform in Figure 2 of the PDF.\n\n**R2-4**\n\nWe appreciate the reviewers suggestion on clarifying the terminology of \"OOD\". We will clarify the term in the manuscript regarding the recommended reference.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "zt4Yppwibl", "reviewer": "Reviewer_a8to", "summary": "his paper aims to improve the accuracy and reduce the calibration error on OOD data for fine-tuning VLM models. The authors first demonstrate that the OOD calibration error and the OOD classification error can be bounded by the ID calibration error and the smallest singular value of the ID input covariance matrix. To address this, the authors apply orthogonal regularization to increase the smallest singular value and use self-distillation to improve the ID calibration. Several experiments on distribution-shifted datasets validate the effectiveness of the proposed method.", "questions": "Please refer to the weaknesses.", "limitations": "Limitations have been discussed and no negative societal impact has been identified.", "rating": 6, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "The paper is well-organized and clearly presented. The theoretical finding that OOD accuracy and calibration error can be bounded by ID error and the smallest singular value is both novel and insightful. The proposed fine-tuning method is simple and intuitive. Numerical analysis of the error bounds and empirical validation on ImageNet OOD benchmarks make the proposed method convincing.", "weaknesses": "(1) Some of the notations are misleading. In line 86, the subscript of $x$ denotes the  $n$-th sample in $\\mathcal{D} $. However, in line 113, the subscript of $x$ denotes the value of the $i$-th dimension of $x$.\n\n(2) Some of the assumptions are not realistic. In line 113, the authors suppose the hypothesis $h_i$ is a one-dimensional function, each applying to one dimension of the input, which does not hold most of the time. Besides, the authors assume each dimension pair is Gaussian. I am unsure whether the conclusion of Theorem 3.1 still holds if these two assumptions are violated.\n\n(3) The orthogonal constraint is too strong. The finding of Theorem 3.1 states that lifting the smallest singular value is enough to reduce calibration and classification errors. However, the authors implement an orthogonal constraint in the learning procedure, enforcing the features to be an orthogonal basis, which leads to a smaller largest singular value. In Table 3, we can see that applying such regularization alone reduces ID accuracy. I wonder whether applying a regularization that only increases the smallest singular value could achieve higher performance.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "**R3-1**\n\nThank you for pointing out the misleading notations. We will revise the notation in the theorem (line 113) as $x[i], \\; i=1,...,d$.\n\n\n**R3-2**\n\nWe appreciate reviewer's interest and details look on our theorem! As we noted at line 112 of our manuscript, we set the input $x$ as a representation vector produced by the projection layer of CLIP image encoder without lose of generality. Then, our hypothesis function $h(\\cdot)$ be a single linear layer classification head that maps the representation vector $x$ to the one-dimensional logit range over $[0,1]$. Here, if we drop the bias term at this classification head, the weight vector $[a_{1},...,a_{d}]$ of $h(\\cdot)$ conducts linear combination over $x$, i.e., $h(x)=\\sum_{i=1}^{d} h_{i}(x_{i})=a_{1}x_{1}+...+a_{d}x_{d}$, and our first assumption always holds.\n\nAbout the second assumption of pairwise Gaussian property, as the reviewer a8to's concerns, the representation of modern neural networks are not necessary joint Gaussian for every $(x_{i},x_{j})$. However, our empirical validation with 111 shallow and narrow multi-layer perceptron (MLP) networks in Section 5.1. (See Fig 3.) presents strong evidence that support the validaity of our bounds, and the results of experiments on ImageNet with more wider and deeper network, i.e., CLIP ViT-B, are also well-aligned with our theory. \n\nMoreover, there is a bunch of works revealing that the outputs of infinitly wide neural networks (whether they are MLP [19], convolutional neural network [20], Transformer [21]) are Gaussian processes (GPs) and GPs ensure that every finite collection of their elements are jointly Gaussian. Therefore, our second assumption becomes valid as the network's layer-wise width being increased. While our numerical analyses are limited to ViT-L scale models, we believe that current large-scale modeling regime spurs us to explore larger width [22] where our second assumption becomes more valid [19]. Meanwhile, we recognized some theoretical results on the Gaussianity of neural network representations under finite-width regime [23], and we plan to explore the relaxation of our assumption based on those insights. Thanks again for the constructive criticism.\n\n**R3-3**\n\nAs the reviewer pointed out, there are other possible design choices for the smallest singular value regularization. One straightforward way is to directly regularize only the smallest singular value. In Table 1 of attached PDF, we provide the result of direct singular value regularization method. This approaches achieve smaller ID-OOD performance gap compared with our current method, which is aligned with our theoretical results (see appendix) and that of [5]. However, direct singular value regularization method entails singular value decomposition (SVD) on the covariance matrix size of $\\mathbb{R}^{d \\times d}$, which require cubic time complexity over the feature dimension which is significantly increase computational cost especially on the large-scale modeling regime. To this end, we employ the orthogonality regularization on the final projection matrix $W$ of visual encoder which indirectly (yet effectively) increase the smallest singular value of input representation and its covariance matrix.\n\nTo be specific, enforcing the projection matrix to be orthogonal matrix $O$ ensures that the rank of input representation and its covariance matrix produced by our method is closer to the upper bound rank than an y other possible projection matrices $W$ without the constraint as below,\n\n\\begin{equation}\n\\begin{split}\n\\text{rank}(\\tilde{Z}^{T}\\cdot\\tilde{Z}) &= \\text{rank}(\\tilde{Z}) \\\\\\\\\n &= \\text{rank}(W\\cdot Z^{T}) \\\\\\\\\n &\\le \\text{rank}(O\\cdot Z^{T}) \\\\\\\\\n &= \\text{rank}(\\hat{Z}) \\\\\\\\\n &= \\text{rank}(\\hat{Z}^{T}\\cdot\\hat{Z})\n\\end{split}\n\\end{equation}\n\nwhere $Z$ is input feature before projection, and $\\tilde{Z}$ and $\\hat{Z}$ denote input representations obtained by projection matrix $W$ and $O$, respectively. However, the SVD has been continuously studied to improve computational efficiency due to its popularity, and we found some approximation-based fast SVD methods such as `scipy.sparse.linalg.svds` though it is non-differentiable. Devising the fast differentiable SVD-based new fine-tuning method, which is well-aligned with our theory, would be very exciting future work direction and we appreciate the reviewer a8to's valuable query.\n\nMeanwhile, the reduced ID accuracy by applying orthogonal constraint can be interpreted as compensation for improved OOD generalizability, which is the same in the case of direct SVD-based regularization. Intuitively, this phenomenon indicates that a large smallest singular value encourages the model to capture more diverse features while compromising ID-specific discriminative biases somewhat. We agree that our ultimate goal should be achieve good OOD generalization without compromising ID adaptation capability. We leave devising a method that produces better ID-OOD trade-off as our future work.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "mX9R8ieqn6", "reviewer": "Reviewer_yVZD", "summary": "The paper proposes a novel framework for robust fine-tuning for CLIP. To enhance out-of-distribution accuracy and calibration, the author incorporates a singular-based constraint term, self-distillation, and EMA. Extensive experiments on synthesized data and ImageNet demonstrate that CaRot can achieve better OOD performance and reliable predictions.", "questions": "1. Can the proposed singular value-based constraint improve other fine-tuning methods, such as FLYP or WISE-FT?", "limitations": "No", "rating": 4, "confidence": 5, "soundness": 2, "presentation": 2, "contribution": 3, "strengths": "1. This paper investigates an under-explored but important problem, the calibration of CLIP after fine-tuning.\n2. The theoretical analysis between the smallest singular value of image representation and OOD robustness is good.", "weaknesses": "1. The overall framework is not well-motivated. Why do we need to incorporate self-distillation and exponential moving average (EMA)? These two techniques are not the main contributions of this paper and are not directly relevant to the primary theoretical analysis of singular value constraints.\n2. The connection to Vision-Language Models is weak. The paper does not justify why the proposed soft constraint term is specifically tailored to Vision-Language Models like CLIP. In other words, does this regularization only apply to visual language models?\n3. The result analysis is insufficient. The paper does not report the average confidence level, which may lead to the confusion that the calibration improvement may only come from the accuracy improvement.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "**R4-1**\n> The overall framework is not well-motivated. Why do we need to incorporate self-distillation and exponential moving average (EMA)? These two techniques are not the main contributions of this paper and are not directly relevant to the primary theoretical analysis of singular value constraints.\n\nThanks for your constructive question! As your point, we do not claim those components are our contribution. First, we conduct a novel theoretical analysis on OOD generalization and calibration errors, and the result of these analyses motivates us to pursue better ID calibration as well as increasing the smallest singular value of input covariance matric. Then, we simply employ the self-distillation (SD) with exponential moving average (EMA) as an option among lots of training-time calibration approaches. Our method allows to adopt other alternative calibration approachs, and we provided results on label smoothing (LS) which is a representative train-time calibration regularization in Appendix B (Table D). We further provide results on vanilla knowledge distillation (KD) from zero-shot CLIP as well as varying magnitude of label smoothing for this rebuttal (please refer Fig 3. in the attached PDF). As we see, other type of calibration methods also induce better performance compared with a competative baseline, but the EMA-SD induces best performance. In terms of calibration, EMA-SD can be interpreted as an input dependent label smoothing [14] which adaptively adjusts the smoothed pseudo target label depend on input whereas the label smoothing provides unadaptable fixed pseudo target.\n\nNote that the combination of SD and EMA is also not our originality, and this combination has been widely adopted and validated in the context of vision-language model training [18] as well as self-supervised learning [15,16,17]. \n\n\n\n**R4-2**\n> The connection to Vision-Language Models is weak. The paper does not justify why the proposed soft constraint term is specifically tailored to Vision-Language Models like CLIP. In other words, does this regularization only apply to visual language models?\n\nWe appreciate the reviewers' keen interest on broader impact of this work. Under the main challenge of robust fine-tuning that is to fine-tune foundation models without loosing its already possessing generalizability to unseen domains, we chose CLIP as our primary focus by following previous works [6,7,8,9]. Since CLIP is widely used for diverse applications not only as a standalone model but as a core component of open-sourced multimodal large language models or text-to-image generative models, we believe that validation on CLIP fine-tuning is crucial in terms of its downstream impact.\n\nHowever, as the reviwer g5ML and yVZD pointed out, our theoretical results are not confined to CLIP-like VLM, and verifying the applicability of our method to other kind of models will further broaden the impact of our method. Therefore, we expanded our experiment scope to vision-only models, ViT-Base pre-trained by DINOv2 objective [10], using DomainBed benchmark [11], and confirmed the effectives of our proposed framework. Details are elaborated in the global response. \n\nAs shown in Table 3 of the PDF file, CaRot shows performance gain on 7 out of 8 cases in terms of Accuracy and ECE on two datsets across two model selection criteria, and achieve relatively smaller performance deviation\n\n\n**R4-3**\n> The result analysis is insufficient. The paper does not report the average confidence level, which may lead to the confusion that the calibration improvement may only come from the accuracy improvement.\n\nTo provide a clearer performance improvement, we repeated the experiments three times with different seeds for each method and confirmed that the performance improvement exceeds the error bars. The results are provided in Figure 4 of the attached PDF.\n\n\n**R4-4**\n> Can the proposed singular value-based constraint improve other fine-tuning methods, such as FLYP or WISE-FT?\n\nIn Table 3 of our manuscript, we provided the ablation study to validate the effectiveness of our singular value constraint term by plug that constraint to vanilla fine-tuning and FLYP where we can see consistent improvement in terms of OOD performance which aligned with our theoretical analysis. Furthermore, to address the reviewer's concern extensively, we additionally provide the results of the combination of WiSE-FT and our orthogonal constraint term in Table 2 of the attached PDF.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:
## Summary of Rebuttal

*We sincerely thank all four reviewers for their constructive feedback and valuable comments.*

**The strengths of our work, as highlighted by reviews:**
* The motivation behind this work is clear, addressing an important but under-explored problem.
* There is a strong connection between theoretical findings and the proposed method, which is simple and intuitive.
* The experimental setting is well-chosen, and the extensive results, coupled with theoretical analysis, demonstrate the method's effectiveness.

**Our responses to the reviews:**
* **[Details on orthogonality constraint]** We provided an intuitive interpretation of our theoretical finding about the connection between the smallest singluar value and out-of-distribution (OOD) generalization. We also justified the implementation of orthogonal constraint and demonstrated its effectiveness through extended ablation studies.
    * R1(g5ML)-1(a), R3(a8to)-3, R4(yVZD)-4
* **[Details on EMA SD]** We explained the design motivation for EMA SD with results of extended ablation studies.
    * R4(g5ML)-1
* **[Generality of method]** We demonstrated the general applicability of our method by expanding the experimental setup to include vision-only models, multi-source domain generalization, and synthetic shift settings.
    * R1(g5ML)-3, R2(nZD2)-1, R2(nZD2)-3, R4(yVZD)-2
* **[Repeated experiments]** We validated our results by repeating the experiments with multiple seeds.
    * R1(g5ML)-2, R4(yVZD)-3
* **[Elaboration on results]** We emphasized our performance improvement and provided interpretations of the results.
    * R2(nZD2)-1, R2(nZD2)-2
* **[Elaboration on theorem]** We justified the assumptions of Theorem 3.1.
    * R1(g5ML)-1(b), R3(a8to)-2
* **[Notation]** We clarified our notations and terms.
    * R2(nZD2)-4, R3(a8to)-1

## DomainBed Setup
> To address reviewers' concerns, we conduct several experiments. Among them, we elaborate the setup for "CaRot for the **vision-only pre-trained model** fine-tuning on the **multi-source (train) domains**", which received the most inqueries.
* We validate the applicability of CaRot to the vision-only pre-trained model, `DINOv2 ViT-base` [10], on two represenative domain generalization benchmarks, `PACS` and `VLCS`. Each dataset consists of four domains with the same class labels (i.e., covariate shift). Following the leave-one-out training setting, we trained the model on three domains and tested it on the unseen remaining domain.
* We consider eight baseline methods [24-31], and we validate the CaRot objective by incorporating the orthogonal constraint term and self-distillation with exponential moving average term into the training pipeline of `ERM++` [31].
* By following DomainBed [11], we set a fixed hyperparameter sweep budget of 10 for all baseline methods. Each hyperparameter configuration was run three times, resulting in $120 = 10\text{(hyperparameter)}  *  3\text{(seed)}  *4  \text{(domain)}$ runs per algorithm on a dataset.
* Among three types of model selection of DomainBed, we report resulst with training domain validation and test-domain validation (oracle) selection strategies.

## Reference
1. Assessing the downstream performance of pretrained self-supervised representations by their rank, Garrido et al. 2023
2. Self-Supervised Learning via Redundancy Reduction, Zbontar et al. 2021
3. Variance-Invariance-Covariance Regularization for Self-Supervised Learning, Bardes et al. 2022
4. A theory of learning from different domains, Ben-David et al. 2010
5. First Steps Toward Understanding the Extrapolation of Nonlinear Models to Unseen Domains, Dong and Ma 2022
6. Robust fine-tuning of zero-shot models, Wortsman et al. 2022
7. Fine-Tuning can Distort Pretrained Features and Underperform Out-of-Distribution, Kumar et al. 2022
8. Improved finetuning of zero-shot vision models, Goyal et al. 2023
9. Robust Fine-Tuning of Zero-Shot Models Using Random Text Guidance, Nam et al. 2024
10. Learning Robust Visual Features without Supervision, Oquab et al. 2023
11. In Search of Lost Domain Generalization, Gulrajani and Lopez-Paz 2020
12. Measuring Robustness to Natural Distribution Shifts in Image Classification, Taori et al. 2020
13. Benchmarking Neural Network Robustness to Common Corruptions and Perturbations, Hendrycks and Dietterich, 2019
14. Self-Distillation as Instance-Specific Label Smoothing, Zhang and Sabuncu 2020
15. Bootstrap Your Own Latent A New Approach to Self-Supervised Learning, Grill et al. 2020
16. A General Framework for Self-supervised Learning in Speech, Vision and Language, Baevskil et al. 2022
17. Multi-Mode Online Knowledge Distillation for Self-Supervised Visual Representation Learning, Song et al. 2023
18. Vision and Language Representation Learning with Momentum Distillation, Li et al. 2021
19. DEEP NEURAL NETWORKS AS GAUSSIAN PROCESSES, Lee et al. 2018
20. DEEP CONVOLUTIONAL NETWORKS AS SHALLOW GAUSSIAN PROCESSES, Garriga-Alonso et al. 2019
21. Wide Feedforward or Recurrent Neural Networks of Any Architecture are Gaussian Processes, Yang 2021
22. Scaling Vision Transformers to 22 Billion Parameters, Dehghani et al. 2023
23. On the infinite-depth limit of finite-width neural networks, Hayou 2023
24. Statistical learning theory, Vapnik 1998
25. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization, Sagawa et al. 2019
26. Self-supervised Contrastive Regularization for Domain Generalization, Kim et al. 2021
27. Invariance Principle Meets Information Bottleneck for Out-of-Distribution Generalization, Ahuja et al. 2022
28. Optimal Representations for Covariate Shift, Ruan et al. 2022
29. Invariant Causal Mechanisms through Distribution Matching, Chevalley et al. 2022
30. Probable Domain Generalization via Quantile Risk Minimization, Eastwood et al. 2022
31. An Improved Baseline for Domain Generalization, Teterwak et al. 2023

Meta-review: The paper proposes a method for improving out-of-distribution confidence calibration in vision-language models. The proposed method involves finetuning with a constrained multimodal contrastive loss that minimizes an upper bound on out-of-distribution calibration. Reviewers were generally positive about the paper, highlighting the significance of the theoretical result and the excellent presentation of the paper, but also raised concerns about the fact that the proposed method only leads to small improvements in performance and that the proposed regularization term is not specific to vision-language models. While I sympathize with these concerns, I believe that---although the framing of the paper likely reduces the impact of the theoretical results on the broader community---the contributions of the paper are sufficiently significant and of sufficient interest to the NeurIPS community to warrant publication. In conclusion, I recommend acceptance.
Decision: Accept (poster)