Text queries fill a slice someone can name
Scores find what nobody asked for. Sometimes the team knows exactly what it wants.
When the team can name what it wants, like pedestrians at night in the rain or a forklift indoors, write it down. Embed the prompt with CLIP's text encoder, and score every image by its cosine similarity to the prompt.
The math is one matrix multiply. Scoring a billion 768-dimension vectors against 1,000 prompts at once is operations, about 15 seconds on one GPU. Reading 1.5 TB of embeddings takes far longer than the math, so batch every prompt you have into one pass.
Two cautions:
- A CLIP similarity has no fixed meaning. LAION-2B, for example, kept the image and caption pairs with an English caption and a similarity above 0.28 under one trained ViT-B/32 CLIP model. That cutoff fits one model and one use. Pick thresholds from labeled samples, never from a hunch about what 0.3 means.
- Text queries only find what someone thought to ask for. They're the best way to fill a known slice, and no help with unknown ones.
The positives you label from a text query become seeds. A probe needs only a few hundred yes and no labels, and it scores the whole pile for that slice in one pass.
Large curation pipelines work the same way: they retrieve toward a target set. DataComp's image-based filter clustered its pool, found the nearest cluster for every ImageNet training example, and kept those clusters.
Combined with filtering by CLIP score, that filter produced DataComp-1B. A CLIP model trained from scratch on it reached 79.2% zero-shot accuracy on ImageNet, which means with no ImageNet training at all. The model was a ViT-L/14, a large vision transformer. It beat OpenAI's own CLIP ViT-L/14 by 3.7 percentage points, with the same training procedure and compute.
DINOv2 built its curated training set the same way: it retrieved images from its uncurated source that were close to images in its curated sources.
In the editor, write precision_at(labeled, cutoff) and lowest_cutoff(labeled, target). labeled holds ten images from the top of a text query's list, each with its similarity to the prompt and whether a person said yes.