---
date: '2024-12-14'
description: learning embeddings where similar samples cluster together and dissimilar ones separate, using positive and negative pairs to optimize representation.
id: contrastive representation learning
modified: 2026-06-05 15:08:05 GMT-04:00
tags:
  - ml
title: contrastive representation learning
created: '2024-12-14'
published: '2024-12-14'
pageLayout: default
slug: thoughts/contrastive-representation-learning
permalink: https://aarnphm.xyz/thoughts/contrastive-representation-learning.md
generator:
  quartz: v4.6.0
  hostedProvider: Cloudflare
  baseUrl: aarnphm.xyz
full: https://aarnphm.xyz/llms-full.txt
---
> The goal of contrastive representation learning is to learn such an [[thoughts/Embedding|embedding]]
> space in which similar sample pairs stay close to each other while dissimilar ones are far apart.
> Contrastive learning can be applied to both supervised and unsupervised settings. [article](https://lilianweng.github.io/posts/2021-05-31-contrastive/)

intuition: to give a positive and negative pairs for optimizing loss function.

