Indexing Multimodal Language Models for Large-Scale Image Retrieval

Bahey Tharwat, Giorgos Kordopatis-Zilos, Pavel Suma, Ian Reid, Giorgos Tolias

TL;DR

This paper demonstrates that off-the-shelf Multimodal Large Language Models (MLLMs) can be repurposed as highly effective, training-free re-rankers for large-scale, instance-level image retrieval. By framing image similarity as a zero-shot binary classification prompt and applying memory-efficient Product Quantization to visual tokens, the authors achieve state-of-the-art open-world retrieval performance without any domain-specific fine-tuning.

What Problem Does This Paper Address?

Traditional instance-level image retrieval—finding the exact same object across a database rather than just a matching category—typically relies on specialized architectures, global/local descriptors, and extensive domain-specific training. While these methods work well within their training domains (like landmarks), they generalize poorly to open-world scenarios containing diverse object categories.

On the other hand, MLLMs possess rich visual representations learned from massive web-scale pre-training. However, using them directly for image-to-image retrieval is historically seen as impractical due to extreme memory footprints and high computational latency. This paper tackles the challenge of making MLLMs scalable and efficient enough to serve as zero-shot similarity estimators within large-scale image retrieval pipelines.

Methods

The authors propose a practical two-stage retrieval pipeline:

  1. Coarse Ranking: An initial exhaustive search is performed using compact global descriptors to retrieve a top-$k$ candidate shortlist.
  2. MLLM Re-ranking: The query image and each candidate database image are fed into an MLLM alongside a task-specific text prompt: "Determine whether the exact same object instance from the query image is present in the candidate image. Output strictly a single digit... 0 or 1."

Instead of letting the model generate text auto-regressively, the authors extract the raw next-token softmax probabilities for the tokens "1" (yes) and "0" (no). The probability of "1" serves as the final re-ranking similarity score.

Figure 2. Overview of the proposed MLLM-based re-ranking approach for instance-level image retrieval. A query image, a database image, and a task-specific textual prompt are jointly used as input for similarity estimation. A vision encoder extracts visual tokens from both images (Xq, Xdb), which are concatenated with the textual prompt tokens (T) and the end-of-sentence (EOS) token to form the multimodal input to the MLLM. Scalable retrieval is achieved by applying compression and indexing schemes, e.g. Product Quantization (PQ), to the database image tokens, enabling memory-efficient storage. The MLLM outputs the updated EOS token representation, which is the joint representation of all inputs and is then compared via dot product with the classifier vectors z1 and z0, corresponding to vocabulary tokens “1” and “0”, respectively. The final similarity score (sr) is given by the softmax (σ) probability assigned to token “1”.

To make database storage scalable, they compress the database image tokens in advance using Product Quantization (PQ). This divides high-dimensional visual token embeddings into lower-dimensional subspaces represented by compact codes, drastically reducing the memory footprint while allowing the tokens to be reconstructed right before being fed into the language model decoder.

Datasets

The approach was evaluated across several diverse instance-level image retrieval benchmarks:

  • ILIAS: A recent, large-scale, multi-domain dataset designed specifically to test open-world instance-level retrieval under challenging conditions.
  • INSTRE: A benchmark for instance-level object retrieval and recognition.
  • ROP+1M: A dataset focused on robust object patches mixed with a million distractor images.
  • Product1M: A dataset tailored for weakly supervised instance-level product retrieval.

Key Insights and Ideas

  • Zero-Shot Similarity via Next-Token Probabilities: Treating an MLLM as a binary classifier via its internal token logits bypasses the need for specialized similarity-learning heads or contrastive fine-tuning.
  • Appearance Trumps Geometry: By shuffling the positional encodings of the visual patches before the language model decoder, the authors discovered only a minor drop in performance. This reveals that the MLLM primarily relies on rich appearance cues rather than strict geometric consistency to determine object identity.
  • Quantization Beats Pruning: Surprisingly, standard Product Quantization (PQ) provided a significantly better accuracy-memory trade-off than advanced token-pruning methods (like DivPrune) or clustering techniques. Compressing tokens via PQ preserved essential fine-grained details better than discarding tokens entirely.

Key Results

  • Massive Accuracy Gains: On the challenging ILIAS dataset, uncompressed Qwen variants achieved over a 22-point increase in mAP@1k compared to global descriptor baselines.
  • Superior Robustness: MLLM re-rankers showed exceptional robustness in handling small objects, heavy background clutter, and partial occlusions, consistently outperforming task-specific re-rankers like AMES outside their native training domains.
Figure 4. Performance comparison across different amounts of object area coverage and background clutter. Positives across all queries are jointly ranked based on coverage or clutter and split into 4 equal-sized groups. mAP@1k averaged over the queries in each group. Comparison between Qwen with and without com- pression (Qwen-C), AMES, and PE.
  • Favorable Time-Budget Scaling: While MLLMs have higher per-image inference latency than lightweight local descriptor matchers, they scale significantly better under a fixed query-time budget, achieving superior retrieval performance with as few as 20 re-ranked images.
Figure 1. Performance vs. re-ranking time. MLLM-based re-rankers have higher per-image inference time than methods trained specifically for instance-level image retrieval with re-ranking (AMES), but under a fixed query-time budget, they achieve better retrieval performance, already with as few as 20 re-ranked images, indicated by the colored numbers. All reported methods have roughly the same memory footprint.

Limitations and Future Work

Despite their strong open-world generalization, MLLMs exhibit distinct failure modes:

  • Sensitivity to Drastic Appearance Changes: The models struggle with severe illumination changes (e.g., day vs. night) and significant motion blur, where specialized local descriptor methods like AMES still hold an advantage.
  • Inference Latency: Processing pairs of images through a large language model decoder is computationally heavy. The system's overall throughput remains highly dependent on the quality of the initial coarse-ranking stage to keep the shortlist $k$ small.

Future research directions include improving MLLM robustness to extreme lighting variations and exploring more efficient attention mechanisms to further reduce query-time latency.

Summary updated

BibTeX
@inproceedings{tharwat2026indexing,
  author = {Bahey Tharwat and Giorgos Kordopatis-Zilos and Pavel Suma and Ian Reid and Giorgos Tolias},
  title = {{Indexing Multimodal Language Models for Large-Scale Image Retrieval}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=UGX6Ey3MwX},
}
Figure