Contrastive learning is a machine learning approach that trains models to place similar examples closer together and different examples farther apart in a learned representation space.
It is used for representation learning in language, images, search, recommendation, and multimodal systems.