All lessons in Vision-Language Models: Build, Evaluate, and Adapt

Align Images and Language

Work through contrastive and sigmoid objectives and diagnose false negatives.

35 minutes · Free with an account · preview

What you will learn

  • Calculate normalized image–text similarity and a small paired contrastive loss.
  • Explain how candidate-relative softmax differs from a pairwise sigmoid objective.
  • Identify false negatives and distinguish alignment from compositional understanding.

You want to retrieve the inspection card described by a query. A paired encoder maps the image and the text into a shared space, then scores how well they match. It does not have to generate a sentence. This makes it useful as an economical baseline, but a high compatibility score does not by itself establish that every word in the description is true.

This lesson connects the scores you will inspect in the retrieval lab to the training objective that shapes them. The calculations use small invented vectors and logits. They illustrate the mechanism rather than reproducing a pretrained model's hidden representations.

Choose another lesson