[Paper Review] Hybrid Generative-Contrastive Representation Learning
This paper proposes Generative-Contrastive Representation Learning (GCRL), a hybrid framework that jointly optimizes contrastive and generative objectives in a single transformer-based encoder-decoder architecture. By applying instance-wise contrastive loss to pooled encoder features and autoregressive likelihood loss to decoder outputs, GCRL achieves superior discriminative performance and robustness to distributional shifts, outperforming both pure contrastive and generative pre-training on image classification and OOD detection tasks.
Unsupervised representation learning has recently received lots of interest due to its powerful generalizability through effectively leveraging large-scale unlabeled data. There are two prevalent approaches for this, contrastive learning and generative pre-training, where the former learns representations from instance-wise discrimination tasks and the latter learns them from estimating the likelihood. These seemingly orthogonal approaches have their own strengths and weaknesses. Contrastive learning tends to extract semantic information and discards details irrelevant for classifying objects, making the representations effective for discriminative tasks while degrading robustness to out-of-distribution data. On the other hand, the generative pre-training directly estimates the data distribution, so the representations tend to be robust but not optimal for discriminative tasks. In this paper, we show that we could achieve the best of both worlds by a hybrid training scheme. Specifically, we demonstrated that a transformer-based encoder-decoder architecture trained with both contrastive and generative losses can learn highly discriminative and robust representations without hurting the generative performance. We extensively validate our approach on various tasks.
Motivation & Objective
- Address the trade-off between discriminative power and robustness in unsupervised representation learning.
- Overcome the incompatibility of contrastive and generative objectives in standard pre-training frameworks.
- Improve generalization and uncertainty calibration in low-data and out-of-distribution settings.
- Maintain strong generative performance while enhancing downstream classification accuracy.
- Enable a unified, parameter-efficient training scheme without specialized modules or inductive biases.
Proposed method
- Reinterpret standard transformer blocks as an encoder-decoder structure to decouple representation learning roles.
- Apply contrastive loss on pooled [CLS]-token features from the encoder for instance discrimination.
- Apply autoregressive likelihood loss on the decoder output to reconstruct input images.
- Train in two phases: first with only generative loss (100 epochs), then with both losses (100 epochs).
- Use standard data augmentations (e.g., random crop, flip) consistent with SimCLR for fair comparison.
- Leverage the inductive bias of transformers while avoiding additional architectural modifications.
Experimental results
Research questions
- RQ1Can contrastive and generative objectives be effectively combined in a single unsupervised representation learning framework?
- RQ2Does joint optimization improve downstream classification accuracy compared to single-objective pre-training?
- RQ3Can the hybrid approach enhance robustness to distributional shifts and improve uncertainty calibration?
- RQ4Does adding a generative objective prevent overfitting in contrastive learning under weak augmentations?
- RQ5Can the model maintain strong generative performance while achieving superior discriminative features?
Key findings
- GCRL achieves 94.12% accuracy on CIFAR-10 and 74.03% on CIFAR-100 with linear evaluation, outperforming ResNet-18 (93.60%) and iGPT (89.79% and 67.09%).
- GCRL reduces Expected Calibration Error (ECE) to 0.0337 on CIFAR-10 and 0.0725 on CIFAR-100, indicating better uncertainty calibration than iGPT and ResNet.
- On OOD detection, GCRL achieves higher AUROC and AUPR than SimCLR and iGPT, demonstrating improved robustness.
- In ablation studies, GCRL maintains generative performance while reducing overfitting under weak augmentations, as shown by stable test loss and lower ECE.
- The hybrid training scheme prevents overfitting even with easy pretext tasks (e.g., 80% crop ratio), where SimCLR’s loss increases after 400 epochs.
- GCRL achieves state-of-the-art performance on linear evaluation and OOD detection without architectural modifications or specialized components.
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.