How it works
EmbeddingGemma 2 maps text, images, video and audio into one shared 768-dimensional space. Things that mean similar things should land near each other, whatever form they arrive in and whatever language they use.
The playground asks two questions of that space: how close are A and B, and which words does each land nearest?
The verdict
Cosine similarity is the real distance, but its scale depends on what is being compared: two unrelated sentences can still score 0.6, and a photo and a word that match can score lower than that. So the verdict ranks the pair against the vocabulary instead: how many of the 91,194 words sit closer to A than B does (or closer to B than A does, whichever is fewer). Fewer than 10 is “Same meaning”, fewer than 200 “Closely related”, fewer than 3,000 “Related”, and anything else “Unrelated”. The thresholds are rules of thumb from trying known pairs, not part of the model.
The vocabulary
The words come from the model itself: every whole-word token in its 262,144-token vocabulary, in every language. Each one was run through the model once (as a document, title: none | text: <word>) and stored on this server, so searching costs nothing. Expect fragments and non-English words in the results; that is the raw space. Language tags come from word-frequency lists (the wordfreq project) and are left off when a word is ambiguous; words shared by close languages get both, like ES/PT.
Your inputs
Text goes to the model as a search query. Photos are shrunk to 1024 px in your browser. Recordings are converted to 16 kHz mono (the rate the model expects); the server sends the whole clip plus each 10-second segment to the model. Nothing is stored: not the audio, the photo, the text or the results.
Smaller vectors
The model is trained so the first 512, 256 or 128 of its 768 numbers still work as an embedding. Switch the size to see how much of the answer survives at a sixth of the storage.
The map
The map in “For the curious” is a 2D projection (PCA) fitted to just A, B and their nearest words. Two components can only show a sliver of the space: points close in the real space can look far apart. Use it for rough orientation; trust the scores.
Example media
The ready-made examples were embedded once ahead of time, with the same model calls the live inputs use. Their media are from Wikimedia Commons, resized or trimmed:
- Cat November 2010-1a.jpg by Alvesgaspar, CC BY-SA 3.0
- Falling rain in mexico.jpg by Tomascastelazo, CC BY-SA 3.0
- Barking of a dog 2.ogg by Amada44, CC BY-SA 3.0
- Cathedral Fribourg bells ringing 01.ogg by Martin Thurnherr, CC BY-SA 4.0
The model runs on Modal and shuts down after two idle minutes, so the first request after a quiet spell takes a minute or so while it starts.