[Paper Review] Temperature Schedules for Self-Supervised Contrastive Methods on Long-Tail Data
This paper proposes a dynamic temperature schedule for self-supervised contrastive learning on long-tail data, using a cosine decay to alternate between high and low temperature values during training. By shifting between instance-level and group-level discrimination, the method improves representation quality across head and tail classes without additional computational cost, consistently outperforming fixed-temperature baselines on multiple datasets and imbalance ratios.
Most approaches for self-supervised learning (SSL) are optimised on curated balanced datasets, e.g. ImageNet, despite the fact that natural data usually exhibits long-tail distributions. In this paper, we analyse the behaviour of one of the most popular variants of SSL, i.e. contrastive methods, on long-tail data. In particular, we investigate the role of the temperature parameter $τ$ in the contrastive loss, by analysing the loss through the lens of average distance maximisation, and find that a large $τ$ emphasises group-wise discrimination, whereas a small $τ$ leads to a higher degree of instance discrimination. While $τ$ has thus far been treated exclusively as a constant hyperparameter, in this work, we propose to employ a dynamic $τ$ and show that a simple cosine schedule can yield significant improvements in the learnt representations. Such a schedule results in a constant `task switching' between an emphasis on instance discrimination and group-wise discrimination and thereby ensures that the model learns both group-wise features, as well as instance-specific details. Since frequent classes benefit from the former, while infrequent classes require the latter, we find this method to consistently improve separation between the classes in long-tail data without any additional computational cost.
Motivation & Objective
- To analyze the role of the temperature parameter τ in contrastive learning on long-tailed data distributions.
- To understand how τ influences the balance between instance discrimination and group-wise discrimination in the embedding space.
- To improve representation learning for long-tailed datasets by dynamically scheduling τ during training.
- To demonstrate that task switching between discrimination types enhances performance on rare and frequent classes alike.
Proposed method
- Introduce a cosine schedule for the temperature hyperparameter τ, varying it from high to low values over training epochs.
- Frame the contrastive loss through average distance maximization to interpret the effect of τ on embedding space structure.
- Use a dynamic τ to alternate between emphasizing instance-specific features (low τ) and semantic group structure (high τ).
- Apply the schedule to state-of-the-art contrastive models like MoCo and SimCLR without architectural changes or added computation.
- Evaluate the method across multiple datasets (e.g., CIFAR10-LT, ImageNet-LT) with varying imbalance ratios.
- Compare the dynamic τ schedule against fixed τ, linear oscillation, step functions, and random sampling of τ.
Experimental results
Research questions
- RQ1How does the temperature parameter τ affect the balance between instance-level and group-wise discrimination in contrastive learning?
- RQ2What is the impact of a dynamic τ schedule on representation quality in long-tailed data distributions?
- RQ3Why does alternating between high and low τ values improve performance on rare classes?
- RQ4How does the choice of τ schedule (e.g., cosine vs. linear vs. random) affect downstream performance?
- RQ5Does the proposed method generalize across different models, datasets, and imbalance levels?
Key findings
- A cosine schedule for τ consistently improves few-shot linear probe accuracy across multiple datasets, including CIFAR10-LT and ImageNet-LT, outperforming fixed τ=0.2 by up to 3.98 percentage points.
- The best performance is achieved when training is stopped at approximately 0.7 of the full period, suggesting optimal timing for task switching.
- The method improves representation quality for both head and tail classes, with the most significant gains observed on rare classes due to enhanced instance discrimination.
- The dynamic τ schedule outperforms alternative schedules such as linear oscillation, step functions, and random sampling of τ, indicating that the temporal pattern of task switching is crucial.
- The improvement is robust across different hyperparameter choices and model architectures, including MoCo and SimCLR, with no additional computational cost.
- The analysis reveals that high τ emphasizes group-wise discrimination and tight cluster formation, while low τ promotes instance-level discrimination and uniformity in the embedding space.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.