Contrastive Pretraining: How Vision and Language Encoders Get Aligned Before Fusion

Part six of the transformer study notes: the InfoNCE loss as an N-way classification problem over a batch's similarity matrix, why batch size determines negative-example quality, learned temperature, and why this pretraining stage is what aligns vision and language encoders before any fusion transformer sees them.

In this article

  • The problem part two left open
  • Pull matches together, push mismatches apart
  • The loss: InfoNCE, as classification
  • Why batch size matters so much
  • Temperature, revisited
  • What this buys the fusion transformer
  • Mistakes I made learning this
  • Glossary