NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

One Single Hub Text Breaks CLIP: Identifying Vulnerabilities in Cross-Modal Encoders via Hubness

Hiroyuki Deguchi, Katsuki Chousa, Yusuke Sakai

TL;DR

Cross-modal encoders like CLIP suffer from a "hubness" vulnerability where a single, nonsensical "hub text" can achieve higher similarity scores across a wide variety of unrelated images than actual human-written captions. By introducing an efficient black-box method combining analytical optimization and beam local search, this paper demonstrates how these hub texts can easily break automated image-captioning metrics and severely degrade image-to-text retrieval systems.

What Problem Does This Paper Address?

In high-dimensional embedding spaces, models often suffer from the hubness problem: certain vectors (hubs) inexplicably become the nearest neighbors to a disproportionately large number of unrelated data points. While this phenomenon is well-documented, finding the discrete text sequences that map to these hub embeddings is an NP-hard problem.

This vulnerability is particularly dangerous for cross-modal encoders like CLIP, which map images and text into a shared embedding space. Unlike single-modality text models, cross-modal systems cannot rely on simple string-matching sanity checks; they depend entirely on embedding similarities. If a single adversarial "hub text" can trick the model into seeing high similarity across completely random images, it undermines the reliability of downstream applications like automated image-captioning evaluation (e.g., CLIPScore) and text-to-image retrieval.

Figure 1: Hub text in cross-modal embedding space. Hub text has higher similarity with many unrelated im- ages than human-written reference captions.

Methods

The authors propose a three-step black-box method to identify these elusive hub texts without needing access to the model's internal weights:

  1. Hub Acquisition: Instead of using computationally expensive gradient descent, the authors mathematically exploit the structure of cosine similarity. They prove that the mathematically optimal hub embedding ($v^\star$) is simply the average of all normalized image embeddings across a given tuning dataset.
  2. Hub Decoding: Because cross-modal encoders cannot be inverted directly, the authors train an inversion model (using an mT5-base architecture) to reconstruct text from continuous embeddings. This model generates thousands of candidate text hypotheses from the optimal hub embedding.
  3. Beam Local Search: To refine the text, the authors introduce a novel Beam Local Search algorithm. It iteratively replaces tokens in the candidate sequences in a random order, maintaining a beam of top candidates to maximize the average similarity score across the image dataset.

Datasets

The method was evaluated using several standard vision-language benchmarks:

  • MSCOCO: Used for training the text inversion model (training set), tuning the hub text (validation set), and evaluating both image captioning and image-to-text retrieval.
  • nocaps: Used as an out-of-domain validation dataset to test how well the hub text generalizes to unseen image distributions.
  • Flickr30k: Utilized alongside MSCOCO to evaluate the impact of hub text injection on image-to-text retrieval tasks.

Key Insights and Ideas

  • Crossing the Modality Gap: By visualizing the embedding space using Principal Component Analysis (PCA), the authors discovered that during the local search optimization, the hub text embedding actually leaves the cluster of normal text embeddings entirely. It migrates directly into the center of the image embedding cluster, effectively masquerading as an image within the vector space.
  • The "Photo" Bias: The generated hub texts look like gibberish to humans (e.g., today color photo __: dishstaged mms middle ]...), yet they consistently contain high-frequency training tokens like "photo" or "photographer". This suggests that the hubness problem is deeply tied to the underlying training data distribution of vision-language models.
Figure 4: Scatter plots of embeddings in MSCOCO

Key Results

  • Outperforming Human Captions: Across multiple state-of-the-art models (including CLIP, LION-CLIP, and DFN-CLIP), the identified hub text achieved higher CLIPScore values than human-written reference captions. On standard CLIP (openai/clip-vit-base-patch32), the hub text scored 0.842 on MSCOCO compared to the human average of 0.759.
  • Massive Win Rates: In instance-level evaluations, the single hub text beat human captions in the majority of test cases. For the apple/DFN5B-CLIP-ViT-H-14-378 model, the hub text achieved a higher similarity score than the actual human caption in 90% of all test images.
  • Retrieval Sabotage: Injecting just one copy of the hub text into a document retrieval index caused a massive drop in image-to-text retrieval accuracy, reducing Precision@1 by up to 29.3% because the model continuously retrieved the hub text instead of relevant captions.
Figure 2: Scatter plots of instance-level scores. Our identified single hub text achieved higher scores than BLIP-2, Human, and GLS in many instances.

Limitations and Future Work

While highly effective, the proposed Beam Local Search is computationally demanding, requiring significant GPU time due to the large search space of discrete tokens. Additionally, the current algorithm is restricted to optimizing fixed-length token sequences; exploring variable-length sequences might yield even more potent hubs but introduces exponential complexity.

Finally, because the generated hub texts are grammatically unnatural, they could theoretically be blocked using perplexity-based filters. However, the authors caution that such filtering mechanisms are rarely used in production systems and can inadvertently filter out legitimate, niche vocabulary (like technical terms or neologisms). Developing efficient, downstream-safe defense mechanisms remains an open challenge.

Summary updated

BibTeX
@inproceedings{deguchi2026one,
  author = {Hiroyuki Deguchi and Katsuki Chousa and Yusuke Sakai},
  title = {{One Single Hub Text Breaks CLIP: Identifying Vulnerabilities in Cross-Modal Encoders via Hubness}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.2186},
}

Loading related content...

Figure