The joint embedding space from Part VI already puts images and captions in the same coordinate system. Nothing about that idea is limited to two modalities — add a speech encoder, and a spoken word lands in the exact same space, right next to its image and its transcript.
Squares are images, circles are captions, triangles are audio clips. Pick an audio clip and ask for its nearest image or nearest caption — the same distance-based retrieval from Part VI, just with a third kind of point added to the map.
A speech encoder maps a spoken clip into the same embedding space as an image encoder and a text encoder, trained so that a recording of "dog barking," the word "dog," and a photo of a dog all land near each other:
- — the speech encoder, mapping a spoken clip into the shared embedding space.
- — the image encoder, mapping a photo into that same shared space.
- Retrieval itself is unchanged
Nothing about nearest-neighbor retrieval changes — it's the identical distance computation from the two-modality case, just applied to a third kind of point on the same map.
- Any pair of modalities can now retrieve from each other
What's new is that any pair among the three modalities can retrieve from each other:
- audio→image
- audio→text
- image→audio
- text→audio
The shared space makes every direction equally available.
Click any item — image, caption, or audio clip — and every other modality's nearest match comes back correct. Three modalities, one shared space, the same simple distance rule doing all the work in every direction.
Three audio clips, each placed near its matching image and caption cluster:
- Audio retrieves its image by a wide margin
"Audio: a dog barking" sits at , "Image: dog" at : . The next-nearest image, "Image: cat" at : — over 10x farther away. No ambiguity.
- The same clip also retrieves its caption
That same audio clip against "Caption: a dog running" at : — closer to its own caption than to either other caption by a comparable margin.
- Every one of the three clips behaves the same way
The same distance computation for the other two clips:
- "Audio: a cat meowing" → "Image: cat" : ; → "Caption: a cat sleeping" :
- "Audio: a bird chirping" → "Image: bird" : ; → "Caption: a bird flying" :
Both retrieve their own image and their own caption correctly, with the same kind of clear separation — the geometry generalizes cleanly to a third modality.
Click the audio clip (triangle) whose embedding sits nearest to the bird image.
A joint embedding space doesn't care how many modalities share it — the training objective (pull matching pairs together, push mismatched pairs apart) and the retrieval rule (nearest neighbor) are identical whether there are two modalities or ten. The next chapter turns the direction around: instead of retrieving an existing item from a shared space, generating a brand new image conditioned on a piece of text that was never paired with any real photo.