Definition
Contrastive learning is a representation-learning approach that trains examples judged related to be closer and examples judged different to be farther apart in a learned embedding space. Positive and negative relationships may come from labels, paired modalities, augmentations of the same example, or sampling rules.
Distinguish it from nearby terms
Contrastive learning defines a training objective or strategy; an embedding is the resulting representation. It can be supervised or self-supervised and can align different modalities, such as images and text.
Check your understanding
The definition of positive and negative pairs encodes assumptions. Poor pairing can teach shortcuts, false separation, or biased similarity even when the loss improves.