Fine-Tuning is Fine, if Calibrated

Fine-tuning is arguably the most straightforward way to tailor a pre-trained model (e.g., a foundation model) to downstream applications, but it also comes with the risk of losing valuable knowledge the model had learned in pre-training. For example, fine-tuning a pre-trained classifier capable of recognizing a large number of classes to master a subset of classes at hand is shown to drastically degrade the model's accuracy in the other classes it had previously learned. As such, it is hard to further use the fine-tuned model when it encounters classes beyond the fine-tuning data. In this paper, we systematically dissect the issue, aiming to answer the fundamental question, "What has been damaged in the fine-tuned model?" To our surprise, we find that the fine-tuned model neither forgets the relationship among the other classes nor degrades the features to recognize these classes. Instead, the fine-tuned model often produces more discriminative features for these other classes, even if they were missing during fine-tuning! {What really hurts the accuracy is the discrepant logit scales between the fine-tuning classes and the other classes}, implying that a simple post-processing calibration would bring back the pre-trained model's capability and at the same time unveil the feature improvement over all classes. We conduct an extensive empirical study to demonstrate the robustness of our findings and provide preliminary explanations underlying them, suggesting new directions for future theoretical analysis. Our code is available at https://github.com/OSU-MLB/Fine-Tuning-Is-Fine-If-Calibrated.

Paper

Similar papers

Peer review

Reviewer YzGv5/10 · confidence 4/52024-07-01

Summary

The paper proposes a simple post-training calibration technique for classifying missing classes after fine-tuning. For example, assuming the pre-trained model can classify 1000 classes and is fine-tuned on a subset of these classes from a different image domain, the proposed method improves the classification accuracy of the *absent classes* on this new domain. Specifically, the proposed method adds a calibration hyper-parameter to artificially boost the probability of predicting the absent classes. To motivate the method, the paper investigates the quality of feature learning using the Nearest Class Mean classifier to isolate the cause of bad performance on the absent classes. While simple, the method shows good performance gain on multiple datasets.

Strengths

* The proposed method is easy to implement and provides good performance gains. * The paper uses the NCM classifier to investigate the feature extractor's quality and isolate the linear classifier's influence after fine-tuning. This methodology provides a clear motivation for the proposed method. * The finding that fine-tuning does not completely destroy the features of absent classes is interesting. This insight can motivate further study, especially for improving the robustness of fine-tuning. * The paper provides a detailed ablation study showing the proposed method's strengths and limitations. * The extent of performance gain hinges on the fine-tuning procedure. * The distribution of absent classes also affects performance.

Weaknesses

* **Statements are not precise**. In the abstract and introduction, the paper claims that a fine-tuned model does not forget the relationship among absent classes. However, this claim is not precise. As the paper points out, the extent of forgetting and degradation depends on the fine-tuning procedure. For example, an Adam optimizer with a larger learning rate can degrade the features of the absent class. This is consistent with the existing literature on the robustness of fine-tuning. It's possible that the proposed technique only works well under moderate changes to the pre-trained model. * **The fine-tuning setting is limited**. The proposed method only works for a particular fine-tuning configuration under constrained assumptions. Specifically, the method assumes a classification task, and the pre-trained model can classify all fine-tuning classes, including absent ones. Therefore, the paper's claims on forgetting and feature learning are limited by its scope.

Questions

* While the paper investigated several factors that can affect calibration effectiveness, it is unclear how we should decide when the calibration is useful. Could the authors consider dependency on the model's **intrinsic** properties? The external factors all may lead to a common intrinsic property. For example, maybe the fine-tuned model's deviation (in the weight space) can be an indicator. For example, RMSprop and Adam are known to converge faster and potentially lead to a larger deviation from the pre-trained model?

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

The paper does not have a potential negative societal impact.

Reviewer 5T9R5/10 · confidence 4/52024-07-08

Summary

The authors argue that fine-tuning doesn’t forget the features for classes not participating in it, but rather downscales their logits as a result of which the model ends up being overconfident for the fine-tuning classes. Counter-intuitively, the authors claim that fine-tuning also enhances the discriminative ability of the model for the classes not participating in fine-tuning. For this, the authors analyze that accuracy of the NCM classifier on the features of the model and show that it increases even for classes absent during fine-tuning. Then the authors show that the order of the absent classes is still in place amongst the set of absent classes, but the model becomes overconfident on the classes used for fine-tuning, thereby leading to drop in accuracy of absent classes. To fix this, the authors analyze simple post processing calibration methods and demonstrate recovery in the performance of absent classes, with some drop in performance of fine-tuning classes. The analysis is done on Imagenet-R, VTAB and Office-Home datasets.

Strengths

1) The gains observed on calibrating the model are impressive, and it is interesting to see that merely by calibrating the model, the model’s performance on absent classes can improve to this extent. 2) The motivation behind the post hoc calibration method is interesting and it is unexpected that just the confidence of the absent would lower down while preserving their relative order on performing fine-tuning.

Weaknesses

1) An increase in NCM classifier’s accuracy need not necessarily mean that the model has become better in discriminating features. It only means that the features become closer to the corresponding class mean in l2 distance metric space. I think this argument is not concrete enough and requires more evidence. 2) It is not clear, why a drop in accuracy is seen in the fine-tuning classes on using PVC as the post calibration method. Even in case of ALG, where there isn’t a significant drop, the accuracy of classes absent during fine-tuning is still significantly lower (e.g. on office home it drops by over 20%) than the pre-trained model. This suggests that authors claim on feature enhancement of absent classes might not be true. 3) The authors propose to use training data / validation data to find the right threshold. This would mean access to the model as well as data. In such a scenario someone could rather easily fine-tune the model on absent classes as well, which would not require a lot of compute. Therefore, on a practical standpoint, it is not completely obvious how the proposed method benefits more than mere fine-tuning. It would be great if authors could compare the budget required for fine-tuning on absent classes vs post-hoc calibration to address this point to achieve similar performance. Although I agree that the observation itself is interesting, but analyzing the efficiency aspect could help the authors in making the claim on using post calibration methods stronger. 4) I think that the analysis shown in Fig-9 needs more rigor. Further, I think the authors need not discuss this in the main paper, as it doesn't adds much. The learning rate used for different optimizers are same, but the learning rates for adam, adagrad and adagrad need to be scaled down to make a fair comparison with SGD. 5) The analysis on why absent class features improve on fine-tuning is not rigorous and would encourage authors to not discuss this in the main paper. Most of the claims in this analysis seem low hanging and not sound enough. This hinders the readily of the paper currently. 6) Similarly, figure-10 doesn't adds much to the storyline authors have presented in this work and it requires more rigor. I would suggest them to restructure the paper a bit and remove this analysis from the main paper. Minor comments: In figure-5, the y-axis should be between 0-1 since it represents a probability. I would be happy to increase my scores if my concerns are sufficiently addressed.

Questions

It would be great if the authors can present their results on domainnet dataset [1]. I request the authors to kindly address the questions in the weaknesses section. [1] https://paperswithcode.com/dataset/domainnet

Rating

5

Confidence

4

Soundness

2

Presentation

1

Contribution

3

Limitations

Yes, the authors have addressed the limitations.

Reviewer 9Ei38/10 · confidence 4/52024-07-09

Summary

It is commonly believed that fine-tuning zero-shot models on seen classes will lead to a decrease in performance on unseen classes. In this paper, the authors systematically examine the issue that find that (1) the fine-tuned feature extractor is not damaged: NCM improves the absent class accuracy without catastrophic forgettin (2) main factor that damages the FT model’s ability to correctly classify absent class examples is the biased logit values towards fine-tuning classes. (3) a simple post-processing calibration of logits, ie, offsets the seen classes could bring back the zero-shot performance of absent classes. Extensive experiments and analyses validate the claims of the authors.

Strengths

The paper is well-organized and the presentation is clear. The analyses are comprehensive and convincing. This study provides insights that corrected my previous viewpoint that fine-tuning causes the forgetting of knowledge of absent classes. This paper is undoubtedly a valuable work and worth accepting.

Weaknesses

This is a solid paper, and I did not find any major weaknesses. I suggest that the authors include more experiments on CLIP models, such as the base-to-new setting in CoCoOp, reporting AccY/Y, AccS/Y, and AccU/Y on 11 datasets.

Questions

Please refer to the weaknesses.

Rating

8

Confidence

4

Soundness

4

Presentation

4

Contribution

4

Limitations

No negative societal impact has been identified.

Reviewer amJX6/10 · confidence 4/52024-07-13

Summary

The paper unveils the improved features of absent classes when a pre-trained model is fine-tuned on a subset of all classes. The paper presents an empirical study on three datasets to demonstrate this finding and proposes a calibration method to post-process the logits after fine-tuning to improve the classification result in absent classes. The reason why the absent classes are improved is analyzed and the effectiveness of the calibration method is supported by experimental results.

Strengths

1. The finding on the improved performance of absent classes is interesting. 2. The proposed calibration method is simple and easy to use. 3. The presentation of the paper is clear. 4. The empirical results in the appendix are extensive.

Weaknesses

1. The reason why the absent classes' features are improved is demonstrated to be that the fine-tuned classes have similar features as absent classes. That suggests that the improvement does not always hold when the fine-tuned classes have features that are not helpful or even harmful (e.g., spurious correlation) to absent classes. This should be discussed further in the submission. 2. In some figures it looks like Tu et. al. achieves the best trade-off, while the proposed scaling method is only presented with a line. It is probably better to show the performance of the two $\gamma$ selection methods in the figure.

Questions

NA

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

NA

Reviewer 9Ei32024-08-08

Thank you for your reply. I am interested in reproducing the results presented in your paper, but I noticed that your code was not provided and the code of the baseline [1] is not publicly available. Could you let me know if there are any plans to release the code, and if so, when it might be available? Best, [1] holistic transfer: towards non-disruptive fine-tuning with partial target data

Authorsrebuttal2024-08-12

Re: Official Comment by Reviewer 9Ei3

Dear Reviewer 9Ei3, We appreciate your interest in our study and in reproducing the results presented in our paper. We understand the importance of reproducibility in research and are committed to supporting it. We plan to release our code along with the camera-ready version of the paper. We appreciate your understanding and patience. Best, Authors

Authorsrebuttal2024-08-12

Kindly request your response

Dear Reviewer amJX, We appreciate your valuable comments on our paper. We have prepared a rebuttal (together with a general response to all reviewers) and tried our best to address most if not all of your concerns. We notice that the author-reviewer discussion period is coming to an end, and we are willing to answer any unresolved or further questions that you may have regarding our rebuttal if time is allowed. If our rebuttal has addressed your concerns, we would appreciate it if you would be willing to consider raising your original rating. Thank you for your consideration. Best, Authors

Authorsrebuttal2024-08-12

Kindly request your response

Dear Reviewer 5T9R, We appreciate your valuable comments on our paper. We have prepared a rebuttal (together with a general response to all reviewers) and tried our best to address most if not all of your concerns. We notice that the author-reviewer discussion period is coming to an end, and we are willing to answer any unresolved or further questions that you may have regarding our rebuttal if time is allowed. If our rebuttal has addressed your concerns, we would appreciate it if you would be willing to consider raising your original rating. Thank you for your consideration. Best, Authors

Authorsrebuttal2024-08-12

Kindly request your response

Dear Reviewer YzGv, We appreciate your valuable comments on our paper. We have prepared a rebuttal (together with a general response to all reviewers) and tried our best to address most if not all of your concerns. We notice that the author-reviewer discussion period is coming to an end, and we are willing to answer any unresolved or further questions that you may have regarding our rebuttal if time is allowed. If our rebuttal has addressed your concerns, we would appreciate it if you would be willing to consider raising your original rating. Thank you for your consideration. Best, Authors

Reviewer YzGv2024-08-13

Thank the authors for the extended discussion. I will keep my score because the scope of the paper is limited.

Authorsrebuttal2024-08-14

Re: Official Comment by Reviewer YzGv

Thank you for the prompt response. We are glad that you keep the positive score. We will incorporate the rebuttal into our final version.

Reviewer 5T9R2024-08-13

Thanks to the authors for their rebuttal. The rebuttal mostly addresses my concerns and therefore, I will increase my score.

Authorsrebuttal2024-08-14

Re: Official Comment by Reviewer 5T9R

We are glad that our rebuttal has addressed most of your concerns and you are willing to increase the score. We will incorporate the rebuttal into our final version. Thanks.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC