dorsal/arxiv
View SchemaImproving Domain Generalization in Contrastive Learning using Adaptive Temperature Control
| Authors | Robert Lewis, Katie Matton, Rosalind W. Picard, John Guttag |
|---|---|
| Categories | |
| ArXiv ID | 2601.07748vv1 |
| URL | https://arxiv.org/abs/2601.07748 |
| License | http://arxiv.org/licenses/nonexclusive-distrib/1.0/ |
Abstract
Self-supervised pre-training with contrastive learning is a powerful method for learning from sparsely labeled data. However, performance can drop considerably when there is a shift in the distribution of data from training to test time. We study this phenomenon in a setting in which the training data come from multiple domains, and the test data come from a domain not seen at training that is subject to significant covariate shift. We present a new method for contrastive learning that incorporates domain labels to increase the domain invariance of learned representations, leading to improved out-of-distribution generalization. Our method adjusts the temperature parameter in the InfoNCE loss -- which controls the relative weighting of negative pairs -- using the probability that a negative sample comes from the same domain as the anchor. This upweights pairs from more similar domains, encouraging the model to discriminate samples based on domain-invariant attributes. Through experiments on a variant of the MNIST dataset, we demonstrate that our method yields better out-of-distribution performance than domain generalization baselines. Furthermore, our method maintains strong in-distribution task performance, substantially outperforming baselines on this measure.
{
"annotation_id": "71e4eb5f-eb75-4336-8591-7589afabe997",
"date_created": "2026-02-17T05:53:12.442000Z",
"date_modified": "2026-02-17T05:53:12.442000Z",
"file_hash": "c82d4593f5e5536f24b7cba48206af5be1876601e7f8ff932b10403d657ca1c9",
"private": false,
"record": {
"abstract": "Self-supervised pre-training with contrastive learning is a powerful method for learning from sparsely labeled data. However, performance can drop considerably when there is a shift in the distribution of data from training to test time. We study this phenomenon in a setting in which the training data come from multiple domains, and the test data come from a domain not seen at training that is subject to significant covariate shift. We present a new method for contrastive learning that incorporates domain labels to increase the domain invariance of learned representations, leading to improved out-of-distribution generalization. Our method adjusts the temperature parameter in the InfoNCE loss -- which controls the relative weighting of negative pairs -- using the probability that a negative sample comes from the same domain as the anchor. This upweights pairs from more similar domains, encouraging the model to discriminate samples based on domain-invariant attributes. Through experiments on a variant of the MNIST dataset, we demonstrate that our method yields better out-of-distribution performance than domain generalization baselines. Furthermore, our method maintains strong in-distribution task performance, substantially outperforming baselines on this measure.",
"arxiv_id": "2601.07748",
"authors": [
"Robert Lewis",
"Katie Matton",
"Rosalind W. Picard",
"John Guttag"
],
"categories": [
"cs.LG",
"cs.AI"
],
"license": "http://arxiv.org/licenses/nonexclusive-distrib/1.0/",
"title": "Improving Domain Generalization in Contrastive Learning using Adaptive Temperature Control",
"url": "https://arxiv.org/abs/2601.07748",
"version": "v1"
},
"schema_id": "dorsal/arxiv",
"source": {
"execution_id": "89adf99e-01bd-45b8-ae70-5d718fd63524",
"id": "arXiv Dataset",
"type": "Model",
"variant": "snapshot-2026-01-17",
"version": "0.1.0"
},
"user_id": 1000002
}