Complementary Benefits of Contrastive Learning and Self-Training Under Distribution Shift

Self-training and contrastive learning have emerged as leading techniques for incorporating unlabeled data, both under distribution shift (unsupervised domain adaptation) and when it is absent (semi-supervised learning). However, despite the popularity and compatibility of these techniques, their efficacy in combination remains unexplored. In this paper, we undertake a systematic empirical investigation of this combination, finding that (i) in domain adaptation settings, self-training and contrastive learning offer significant complementary gains; and (ii) in semi-supervised learning settings, surprisingly, the benefits are not synergistic. Across eight distribution shift datasets (e.g., BREEDs, WILDS), we demonstrate that the combined method obtains 3--8% higher accuracy than either approach independently. We then theoretically analyze these techniques in a simplified model of distribution shift, demonstrating scenarios under which the features produced by contrastive learning can yield a good initialization for self-training to further amplify gains and achieve optimal performance, even when either method alone would fail.

Paper

References (100)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer C2y16/10 · confidence 3/52023-07-05

Summary

This paper proposes to combine contrastive learning and self-training for unsupervised domain adaptation. Experimental results on UDA benchmarks demonstrate the empirical effectiveness of the approach and a thorough study demonstrates the theoretical benefits.

Strengths

- The results on UDA tasks are consistently better than simple contrastive learning and self-training approaches. - The theoretical analysis is very thorough and demonstrates the fundamental benefits of contrastive learning and self-training individually and of combining them in the case of UDA.

Weaknesses

- The proposed method STOC is vaguely described in L104-108. It would be clearer to describe it formally in more details. - The contributions are not clearly stated. Among the methods presented in L90-108, please clarify that STOC is your contribution. - Some popular UDA benchmarks are missing, many concurrent work are using Office-31 and Office-Home. Evaluation on these datasets would be appreciated. - Concurrent work are missing, such as [1, 2, 3]. Please position your work against these paper, and compare your approach both conceptually and empirically to the approaches presented in these papers. More generally, it seems that the presented method is only compared to simple baselines and not to methods that are specifically designed to tackle UDA tasks. [1] DeepJDOT: Deep Joint Distribution Optimal Transport for Unsupervised Domain Adaptation, Damodaran et al., ECCV 2018 [2] Implicit Class-Conditioned Domain Alignment for Unsupervised Domain Adaptation, Jiang et al., ICML 2020 [3] Semantic-aware Message Broadcasting for Efficient Unsupervised Domain Adaptation, Li et al., ArXiv: 2212.02739

Questions

- In Table 1, are concurrent models your reimplementation, or pretrained models from the SwAV and FixMatch papers ?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

2 fair

Presentation

3 good

Contribution

3 good

Limitations

Some limitations are discussed in the analysis, for exemple regarding the limited performance improvement on semi-supervised tasks.

Reviewer Srqn6/10 · confidence 3/52023-07-07

Summary

The paper explores the synergy of self-training and contrastive learning in semi-supervised learning (SSL) and unsupervised domain adaptation (UDA). It discovers their complementary effect in UDA. Furthermore, it proposes Self-Training Over Contrastive learning (STOC) to combine the benefits of the two approach. The STOC algorithm pretrains the self-training model by contrastive learning on source and target data.Finally, it theoretically analyzes the outcome of initializing with contrastive learning under a specific distribution shift.

Strengths

- The paper provides good theoretical support and empirical evidence to defend their hypothesis. It provides valuable insights into the factors that contribute to the success of contrastive learning and self-training. - The paper proposes a novel method that can improve unsupervised domain adaptation. - The findings of this paper have important implications for incorporating unlabeled data. - The paper is well-written.

Weaknesses

- The combination of semi-supervised learning with self-supervised learning has been proposed in prior work [1], which is not included in the related work. An updated variety of this method can constitute as a relevant benchmark. - The assumptions about infinite unlabeled data, linear classifier $h$, and scaling the magnitude of the coordinates for augmentation, are restrictive. - The benchmarks are not competitive. There are several self-supervised methods such as DINO that can supplement the benchmarks. - There are typos such as in line 40: 'the strong strong results'. [1] Zhai, Xiaohua, Avital Oliver, Alexander Kolesnikov, and Lucas Beyer. "S4l: Self-supervised semi-supervised learning." In Proceedings of the IEEE/CVF international conference on computer vision, pp. 1476-1485. 2019.

Questions

- The role of the classification head architecture and deep fine-tuning is missing from the experiments.

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

The paper does not discuss the limitations and societal impacts of this work.

Reviewer fFuY7/10 · confidence 4/52023-07-09

Summary

This paper empirically explores and theoretically studies the complementary benefits of using self-training (ST) and contrastive learning (CL) for unsupervised domain adaptation (UDA), where unlabeled data is available from source and target domains, whereas labels are only available from the source domain. Firstly, experiments on many distribution shift datasets show that combining self-training over contrastive learning (STOC) yields significant benefits for target domain accuracy (~5% on average) over just doing CL or ST. However the benefit in-distribution is shown to be much lower (<1%). Motivated by these findings, the paper delves into the theoretical study of this phenomenon through a toy Gaussian data model, where each example is composed of domain-invariant (useful for source and target) and spurious features (only useful for source). Experiments on the toy model are shown to follow similar trends to real data. Through analysis on this toy model, the paper provides the following intuitions: (a) ST can learn a good target classifier if it starts from a good enough initial classifier (b) ERM on source domain cannot provide a good initializer because it focusses too much on spurious features (c) CL (with some "generic" augmentations) learns representations that focus more on domain-invariant features, thus providing better features for ST to improve. Although CL classifier itself is not sufficient for good target performance This theoretical model provides many insights into the role of CL and ST. Finally the paper empirically verifies some of these claims through further probing experiments on real data.

Strengths

- The paper studies an unexplored (to my knowledge) space of combining two popular ideas for domain adaptation. The idea is natural and seemingly effective - Experiments on standard datasets are convincing enough on the efficacy of the proposed approach. Theoretical analysis on the toy example seems solid, and provides useful intuitions & insights into why the proposed approach could work well. Overall the quality of the technical work seems good. The insights about "CL provides better features while ST improves the head" is a clean contribution - The paper is clearly written and easy to follow. Sufficient intuitions are provided for many of the theoretical claims. I didn't read through all the proofs, but the intuitions made sense and the contrastive learning results seemed believable. On the whole, I think this is a solid contribution and vote for accepting.

Weaknesses

- One minor criticism is about the presentation of Section 5. That one required multiple passes to follow, and it might help to include a clearer description of what is being tested. For instance in L377, it would help to explain how the 14% number was calculated. Some more questions about this in the next section - A bit more discussion about prior work, in the main paper, would have been useful to see. Sections 5 and 6 do a bit of this in some parts, but I only partially understand how this analysis different from previous ones, especially for self-training - The paper discusses contrastive learning and self-training in general, but only tests on one pair of methods (SwaV and FixMatch). Including more methods (even in 1 setting) would be useful.

Questions

(Q1) How many labeled examples were used for experiments in Section 5? I'm wondering if the target probe results in Fig. 3 are due to worse sample complexity rather than expressivity of the features themselves (Q2) What are the limitations of the proposed theoretical framework? Does the toy model fail in crucial ways to capture realistic distributions? Does the theory for this model predict something that does not hold in practice. A discussion about this would be useful for future work on this topic (Q3) Does the choice of contrastive learning/self-training method affect the findings? (Q4) Does linear probe (instead of fine-tuning everything) also work well in practice?

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

See Q2 above.

Reviewer 272G7/10 · confidence 4/52023-07-29

Summary

This paper investigates the complementary benefits of combining self-training and contrastive pretraining for domain adaptation under distribution shifts. Through an empirical study on 8 benchmarks, the authors demonstrate that applying self-training (FixMatch) after contrastive pretraining (SwAV) yields substantial accuracy gains over either approach alone. To understand this synergy, the authors analyze a simplified theoretical setup indicating that while contrastive pretraining can amplify signal along invariant features, it may retain dependence on spurious source-only correlations. On the other hand, self-training can effectively unlearn these spurious dependencies and improve linear transfer of representations, achieving optimal target performance. The authors further apply linear probing on representations to verify their theoretical findings empirically. Overall, this work highlights the potential of combining self-training and contrastive learning to address challenges posed by distribution shifts, grounded by both empirical evidence and theoretical analysis.

Strengths

**Originality**: The paper explores the promising yet underexplored direction of combining self-training and contrastive learning to address distribution shifts. The extensive empirical study systematically investigates their complementary benefits across diverse benchmarks. The theoretical analysis offers unique insights into their synergistic effects. **Quality**: The empirical study is relatively extensive, spanning 8 datasets with careful controls. Despite simplifying assumptions, the theory makes falsifiable predictions that are precisely analyzed and align well with observations. Additional probing experiments further validate the theoretical intuitions. **Clarity**: The paper is clearly presented overall. The problem setup and motivation are lucid, and the methods and experiments are thoroughly explained. The authors effectively convey the core conceptual messages and insights from their theoretical analysis. **Significance**: Distribution shifts ubiquitously challenge ML model generalization in practice. This paper highlights the significant potential of combining self-training and contrastive learning to address this problem, demonstrating substantial empirical gains and proposing explanations grounded in both theory and experiments. Overall, I think this paper will be of interest to the ML research community of distribution shifts.

Weaknesses

**Small Pre-training Set**: The authors have chosen to train models using contrastive learning (CL) from scratch on a selection of small datasets from BREEDS and WILDS. The authors have justified this approach by stating, "We have opted not to use off-the-shelf pretrained models (e.g., on Imagenet [67]) to avoid confounding our conclusions about contrastive pretraining." However, in practice, pretraining CL models on small datasets is not a common practice, given the availability of powerful off-the-shelf CL models that have been pretrained on larger datasets (e.g., from SimCLR, iBot to DINOv2). If the paper's results only apply to CL models pretrained on small datasets and do not generalize to more powerful contemporary CL models, the utility of this work could be limited. I would recommend that the authors conduct studies of modern off-the-shelf CL models to strengthen this work. For instance, off-the-shelf ImageNet-pretrained CL models could be used as initialization, followed by self-training, and then evaluation on various shifted datasets (numerous ImageNet shifted datasets are available). Please note, it is not necessary to strive for results during the rebuttal period. This paper is already commendable in my view, I merely want to offer suggestions that could further enhance its impact. **Limited Combination of CL+ST Algorithms** In this study, the authors have exclusively utilized SwAV+FixMatch, which are indeed effective algorithms. However, the presentation would be more compelling if a wider range of combinations were explored. Given that the authors employ Barlow Twins in their theoretical analysis, would it not be more fitting to also include Barlow Twins as a CL algorithm in the empirical studies?

Questions

See Weaknesses.

Rating

7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

See Weaknesses.

Reviewer 272G2023-08-13

Thank you for your response. While the complementary ERM result is commendable, I believe there has been a misunderstanding. My intention was to suggest that you use Contrastive Learning (CL) models pre-trained on ImageNet instead of ERM models. For example, the official Barlow Twins model was pre-trained on ImageNet (https://github.com/facebookresearch/barlowtwins), and you can directly fine-tune it using FixMatch.

Authorsrebuttal2023-08-17

Updated results with Barlow Twins model pre-trained on Imagenet

We thank the reviewer for engaging in the discussion and apologize for confusing your suggestion. We re-ran experiments as you suggested, i.e., with the Barlow Twins model pre-trained on Imagenet on 4 datasets: Entity13, Nonliving26, Officehome, and Visda. We tabulate the results below. We continue to observe that FixMatch improves over ERM (source-only) models for Barlow Twins pre-trained models on Imagenet. | | ERM (Imagenet BT) | ST (Imagenet BT) | |---------------------------|-------------------|------------------| | Entity13 | 81.0 | **85.4** | | NonLiving26 | 62.3 | **69.7** | | Visda (avg 2 shifts) | 52.5 | **69.8** | | Officehome (avg 3 shifts) | 46.4 | **49.3** | We will include these results in the updated draft, and we believe these results strengthen our findings as we can hope to leverage off-the-shelf contrastively pre-trained models to combine the benefits of CL and ST.

Reviewer 272G2023-08-21

Thank you for the new results. I quite appreciate this work, and I will keep my rating (clear accept).

Reviewer C2y12023-08-16

Thank you for your response. I have read the rebuttal and my concerns have been addressed. I am increasing my score to weak accept.

Reviewer Srqn2023-08-17

Post Rebuttal Response

Thank you for your response. Overall, the paper seems beneficial to be presented to the community.

Reviewer fFuY2023-08-19

Thank you for the response

Thanks for the response and clarifications. The new experiments with more contrastive and self-training methods would certainly be a useful additions. I maintain my positive opinion of this paper.

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC