Before you move a control in the demo, say what you expect to change.
Foundation reference
Representation Learning & Embedding Geometry
Representation learning maps inputs to vectors whose distances or inner products reflect relations in the data. Token embeddings in language models and the joint image–text embeddings of CLIP are examples; CLIP trains its encoders with a contrastive loss on matching and non-matching pairs (Radford et al., 2021).
Study guide
Where to start
Why do learned representations often bunch along a few directions (anisotropy), and how do normalization and whitening change that?
How to study this pagePredict · Check · Generalize · Continue
Compare what the demo shows with the key equation and with the papers cited below.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
The newer notebook covers the same concept and has an interactive demo.
Why It Matters for Modern Models
- Representation learning maps inputs to vectors whose distances or inner products reflect relations in the data. Token embeddings in language models and the joint image–text embeddings of CLIP are examples; CLIP trains its encoders with a contrastive loss on matching and non-matching pairs (Radford et al., 2021).
- Retrieval and recommendation systems search by nearest neighbors in an embedding space, so the geometry of that space decides what counts as similar.
Questions to Think About
- How do representations change from layer to layer, from local features to more global ones?
Interactive Demos
Core Math
If you prefer intuition first, try the demos above, then come back for the math.
Learn a mapping such that inner products or distances reflect meaningful relations.
Contrastive objective (InfoNCE):
The sum runs over the matching ("positive") and non-matching ("negative") candidates sampled independently from the marginal distribution of . The loss pulls positive pairs together and pushes negatives apart. Minimizing it maximizes a lower bound on the mutual information between the two views, (van den Oord et al., 2018); that bound alone does not explain why the learned representations are useful (Tschannen et al., 2020).