FoundationsChecking saved investigationReading browser-local route memory before showing a continuation.

Foundation Lab

Representation Learning & Embedding Geometry

Word & token embeddings in LMs, vision embeddings in CLIP-like models, multimodal embeddings in Gemini and GPT-4V

Concept 10 of 100RepresentationsPhase 5
#10EmbeddingsRepresentations
key equation\mathcal L = - \mathbb E \left[ \log \frac{\exp(\mathrm{sim}(f(x),g(y))/\tau)}{\sum_{y'} \exp(\mathrm{sim}(f(x), g(y'))/\tau)} \right]

Selected Foundation Object

Keep the equation fixed; move through the evidence.

Concept 10 of 100EmbeddingsRepresentations / Phase 5: Representation & interpretability
Current question

Geometric explanation of anisotropy (representations bunch along a few directions) and how normalization/whitening alter behavior

\mathcal L = - \mathbb E \left[ \log \frac{\exp(\mathrm{sim}(f(x),g(y))/\tau)}{\sum_{y'} \exp(\mathrm{sim}(f(x), g(y'))/\tau)} \right]
PredictionCommit before the demo.

Ask what should change when the equation is manipulated, then let the visualization test that expectation.

EvidenceCompare local witness and source.

Use the runnable panel, the key equation, and canonical papers as separate forms of evidence for the same object.

InvariantName what survives notation changes.

The useful learning product is the reusable mechanism you can carry into another model, paper, or engineering tradeoff.

Next moveContinue in the newer notebook.

This atlas page keeps the working demo; the domain notebook carries the fuller Intuition -> Math -> Code -> Demo sequence.

Why It Matters for Modern Models

  • Word & token embeddings in LMs, vision embeddings in CLIP-like models, multimodal embeddings in Gemini and GPT-4V
  • Latent spaces of Stable Diffusion designed so distances correspond to semantic similarity

What Tutorials Skip

What is still poorly explained in textbooks and papers:

  • Geometric explanation of anisotropy (representations bunch along a few directions) and how normalization/whitening alter behavior
  • Visuals showing how representations evolve across layers (local to global features)

Interactive Visualization

Core Math (Optional Deep Dive)

If you want intuition first, start with the key equation and the visualization. Come back here for the full walkthrough.

Key Equation
L=E[logexp(sim(f(x),g(y))/τ)yexp(sim(f(x),g(y))/τ)]\mathcal L = - \mathbb E \left[ \log \frac{\exp(\mathrm{sim}(f(x),g(y))/\tau)}{\sum_{y'} \exp(\mathrm{sim}(f(x), g(y'))/\tau)} \right]

Learn a mapping fθ:XRdf_\theta: \mathcal X \to \mathbb R^d such that inner products or distances reflect meaningful relations.

Contrastive objective (InfoNCE-style):

L=E[logexp(sim(f(x),g(y))/τ)yexp(sim(f(x),g(y))/τ)]\mathcal L = - \mathbb E \left[ \log \frac{\exp(\mathrm{sim}(f(x),g(y))/\tau)}{\sum_{y'} \exp(\mathrm{sim}(f(x), g(y'))/\tau)} \right]

This pushes "positive" pairs together, "negatives" apart; at optimum, it maximizes a lower bound on mutual information between views.

Canonical Papers

Representation Learning: A Review and New Perspectives

Bengio et al.2013IEEE TPAMI
Read paper →

Connections