mlsanityData to 7 Oct 2026

Temperature as Uncertainty in Contrastive Learning

arXiv 2110.04403 ↗First posted 8 Oct 2021cs.LGcited by 25

Not on the map. Why?

Abstract (arXiv)

Contrastive learning has demonstrated great capability to learn representations without annotations, even outperforming supervised baselines. However, it still lacks important properties useful for real-world application, one of which is uncertainty. In this paper, we propose a simple way to generate uncertainty scores for many contrastive methods by re-purposing temperature, a mysterious hyperparameter used for scaling. By observing that temperature controls how sensitive the objective is to specific embedding locations, we aim to learn temperature as an input-dependent variable, treating it as a measure of embedding confidence. We call this approach "Temperature as Uncertainty", or TaU. Through experiments, we demonstrate that TaU is useful for out-of-distribution detection, while remaining competitive with benchmarks on linear evaluation. Moreover, we show that TaU can be learned on top of pretrained models, enabling uncertainty scores to be generated post-hoc with popular off-the-shelf models. In summary, TaU is a simple yet versatile method for generating uncertainties for contrastive learning. Open source code can be found at: https://github.com/mhw32/temperature-as-uncertainty-public.

Key facts. Cited by 25 papers in the map (data through 7 Oct 2026). Builds on 40 of its 42 references that are in the map. First posted on arXiv 8 Oct 2021.

Builds on

40 of 42 references.

References · 40

  1. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  2. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  4. 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
  5. 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
  6. 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,482
  7. 2017On Calibration of Modern Neural Networkscited by 4,860
  8. 2020Bootstrap your own latent: A new approach to self-supervised Learningcited by 4,712
  9. 2015Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learningcited by 4,416
  10. 2020Exploring Simple Siamese Representation Learningcited by 2,853
  11. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  12. 2020Improved Baselines with Momentum Contrastive Learningcited by 2,282
28 more
  1. 2018Unsupervised Feature Learning via Non-Parametric Instance-level Discriminationcited by 1,838
  2. 2021Barlow Twins: Self-Supervised Learning via Redundancy Reductioncited by 1,818
  3. 2017Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networkscited by 1,325
  4. 2019Contrastive Multiview Codingcited by 1,297
  5. 2018Learning deep representations by mutual information estimation and maximizationcited by 1,265
  6. 2020What Makes for Good Views for Contrastive Learning?cited by 843
  7. 2020A Review of Uncertainty Quantification in Deep Learning: Techniques, Applications and Challengescited by 813
  8. 2019Self-Supervised Learning of Pretext-Invariant Representationscited by 806
  9. 2019Learning Representations by Maximizing Mutual Information Across Viewscited by 733
  10. 2021A Survey of Uncertainty in Deep Neural Networkscited by 675
  11. 2019On Variational Bounds of Mutual Informationcited by 550
  12. 2017Large Batch Training of Convolutional Networkscited by 529
  13. 2018TADAM: Task dependent adaptive metric for improved few-shot learningcited by 408
  14. 2020Understanding the Behaviour of Contrastive Losscited by 397
  15. 2019Local Aggregation for Unsupervised Learning of Visual Embeddingscited by 204
  16. 2020Bayesian Neural Networks: An Introduction and Surveycited by 130
  17. 2020Conditional Negative Sampling for Contrastive Learning of Visual Representationscited by 57
  18. 2020On Mutual Information in Contrastive Learning for Visual Representationscited by 54
  19. 2018Modeling Uncertainty with Hedged Instance Embeddingcited by 52
  20. 2020Viewmaker Networks: Learning Views for Unsupervised Representation Learningcited by 48
  21. 2020Self-supervised Knowledge Distillation for Few-shot Learningcited by 41
  22. 2020Delving into Inter-Image Invariance for Unsupervised Visual Representationscited by 37
  23. 2019Detecting Out-of-Distribution Examples with In-distribution Examples and Gram Matricescited by 32
  24. 2020Temperature check: theory and practice for training models with softmax-cross-entropy lossescited by 31
  25. 2019Deep Neural Network Ensembles against Deception: Ensemble Diversity, Accuracy and Robustnesscited by 18
  26. 2018Heated-Up Softmax Embeddingcited by 15
  27. 2019Deep Neural Network Ensemblescited by 10
  28. 2020Toward Adversarial Robustness by Diversity in an Ensemble of Specialized Deep Neural Networkscited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2022: 5; 2023: 10; 2024: 4; 2025: 4; 2026: 2.

25 papers.

Sort:

By area:

  1. 2022Federated Learning from Pre-Trained Models: A Contrastive Learning Approachcited by 141
  2. 2024β-DPO: Direct Preference Optimization with Dynamic βcited by 89
  3. 2022Dual Temperature Helps Contrastive Learning Without Many Negative Samples: Towards Understanding and Simplifying MoCocited by 52
  4. 2023Temperature Schedules for Self-Supervised Contrastive Methods on Long-Tail Datacited by 44
  5. 2023Not All Semantics are Created Equal: Contrastive Self-supervised Learning with Automatic Temperature Individualizationcited by 25
  6. 2022Model-Aware Contrastive Learning: Towards Escaping the Dilemmascited by 11
  7. 2024To Cool or not to Cool? Temperature Network Meets Large Foundation Models via DROcited by 11
  8. 2023A Unified Arbitrary Style Transfer Framework via Adaptive Contrastive Learningcited by 10
  9. 2023Adaptive Multi-head Contrastive Learningcited by 8
  10. 2022Uncertainty in Contrastive Learning: On the Predictability of Downstream Performancecited by 7
  11. 2024Analysis of Using Sigmoid Loss for Contrastive Learningcited by 6
  12. 2023Dynamically Scaled Temperature in Self-Supervised Contrastive Learningcited by 4
13 more
  1. 2022Establishing a stronger baseline for lightweight contrastive modelscited by 3
  2. 2023Learning to Scale Temperature in Masked Self-Attention for Image Inpaintingcited by 3
  3. 2023Hyp-UML: Hyperbolic Image Retrieval with Uncertainty-aware Metric Learningcited by 3
  4. 2023Multi-Similarity Contrastive Learningcited by 2
  5. 2025Difficult Examples Hurt Unsupervised Contrastive Learning: A Theoretical Perspectivecited by 2
  6. 2026MM-TS: Multi-Modal Temperature and Margin Schedules for Contrastive Learning with Long-Tail Datacited by 1
  7. 2023Towards Visual Taxonomy Expansioncited by 0
  8. 2023Uncertainty in Graph Contrastive Learning with Bayesian Neural Networkscited by 0
  9. 2024Automatic Alignment of Discourse Relations of Different Discourse Annotation Frameworkscited by 0
  10. 2025Boosting Open Set Recognition Performance through Modulated Representation Learningcited by 0
  11. 2025Divergence-Based Similarity Function for Multi-View Contrastive Learningcited by 0
  12. 2025Denoising-While-Completing Network (DWCNet): Robust Point Cloud Completion Under Corruptioncited by 0
  13. 2026TeMo: Temperature Modulation for Multimodal Contrastive Learningcited by 0