Text arithmetic
Queen is #1
Classic 3CosAdd works for the headline direction in CLIP’s 20,000-word gallery.
Does king − man + woman actually land on queen? Yes—until we ask images to cross the modality gap on their own.
Text arithmetic
Classic 3CosAdd works for the headline direction in CLIP’s 20,000-word gallery.
Image arithmetic → text
Three portrait centroids still produce a vector, but text retrieval falls into portrait metadata.
Text anchor + image delta
The image-derived gender direction works when a text vector anchors the query in the text neighborhood.
The embedding atlas
Every faint dot is a text embedding. Circles are three-image concept centroids; the triangle is the selected arithmetic query. Drag to pan, scroll to zoom, and hover to inspect.
Nearest-neighbor evidence
Text arithmetic starts in the same distribution as the text gallery. Pure image arithmetic does not: CLIP aligns modalities for retrieval, but it does not make their local neighborhoods identical.
The mixed query keeps a as text and uses images only for the directional change −b + c. That anchor is enough for five of six tested relations to recover the expected word at rank one.
Reproducible method
Encode 20,000 common lowercase English words with sentence-transformers/clip-ViT-B-32. Encode three 224×224 portrait thumbnails per image concept, then average and normalize.
Normalize a − b + c, exclude all three source words, and rank every remaining text candidate by cosine similarity. No answer-specific filtering is applied.
Fit a deterministic 2D cosine UMAP for display. Separately fit a 10D UMAP and fine-grained HDBSCAN for descriptive density clusters.
Portraits are fetched as small Wikimedia thumbnails, center-cropped in memory, then discarded. Only 18 normalized 512D image vectors are cached—35 KB total.
What this does—and does not—show
Nearby dots are suggestive. The 2D projection cannot preserve every 512D distance or density.
“Nearest” means nearest among these 20,000 complete English words after source-word filtering.
Text queen − woman + man ranks king at #309; analogy behavior is not automatically symmetric.
The most interesting result is not that vector arithmetic always works. It is that the image-derived direction survives—provided a text vector keeps the query inside the text neighborhood.