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 pre-trained Multimodal Large Language Models (MLLMs) can be repurposed as highly effective, training-free similarity estimators for large-scale, instance-level image retrieval. By framing image comparison as a zero-shot binary classification task and introducing memory-efficient token indexing strategies like Product Quantization, the authors achieve state-of-the-art re-ranking performance without any domain-specific fine-tuning.

What Problem Does This Paper Address?

Instance-level image retrieval aims to find images containing the exact same object instance (e.g., a specific building or product) rather than just a general category. Traditional approaches rely on a two-stage pipeline: a fast, coarse search using global image descriptors followed by a precise re-ranking step using local descriptors.

However, existing state-of-the-art re-rankers require specialized architectures and expensive domain-specific training, which often limits their ability to generalize to novel domains. While MLLMs possess rich visual representations and strong cross-modal reasoning capabilities, they are notoriously computationally expensive and memory-intensive. Directly feeding raw, high-resolution database images into an MLLM at scale is completely impractical due to massive storage overhead and query-time latency. This paper tackles the challenge of making MLLMs scalable and efficient enough to serve as zero-shot re-rankers in large-scale retrieval pipelines.

Methods

The authors propose a training-free re-ranking pipeline that treats an off-the-shelf MLLM (primarily Qwen2.5-VL) as a binary similarity classifier.

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”.
  1. Pairwise Prompting: The MLLM is fed a query image, a candidate database image, and a text prompt asking whether both images depict the exact same object.
  2. Next-Token Probability Score: Instead of letting the model auto-regressively generate text, the authors extract the next-token probabilities for the vocabulary tokens "1" (yes) and "0" (no) from the final End-of-Sentence (EOS) token representation. A softmax classifier converts these into a continuous similarity score used for re-ranking.
  3. Compression and Indexing: To make the database scalable, the authors store pre-computed patch-level visual tokens rather than raw images. They evaluate several token-reduction strategies, finding that Product Quantization (PQ) provides the best trade-off. PQ splits the high-dimensional token space into lower-dimensional subspaces and quantizes them into compact codes, drastically reducing the database's memory footprint.

Datasets

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

  • ILIAS: The primary testbed; a massive, multi-domain dataset containing 1,000 object instances and over 1,232 queries, scaled up with 100 million distractor images from YFCC100M.
  • INSTRE: A multi-domain dataset consisting of 200 objects, 1,250 queries, and a 27.3k image database.
  • ROP+1M: A landmark-focused dataset combining ROxford and RParis, evaluated alongside 1 million distractor images.
  • Product1M: An instance-level dataset tailored for product retrieval.

Key Insights and Ideas

  • Implicit Similarity Learning: Even though MLLMs are not explicitly trained to compute image similarity, their internal transformer architecture naturally performs cross-image patch comparisons. This mechanism mirrors specialized deep re-ranking networks.
  • The Power of Scale over Specialization: Off-the-shelf MLLMs outperform task-specific re-rankers outside of their native training domains. The broad open-world knowledge gained during multimodal pre-training translates directly to superior visual discrimination.
  • Resolution vs. Quantization: When operating under strict memory constraints, the authors discovered it is much more effective to lower the input image resolution rather than aggressively increasing the Product Quantization compression rate.
  • Semantic Sensitivity: MLLMs are highly sensitive to the semantic intent of a prompt (e.g., using an "object" prompt vs. a "landmark" prompt), but they are largely robust to minor variations in phrasing.

Key Results

  • Massive Accuracy Gains: On the challenging ILIAS dataset, uncompressed Qwen variants improved retrieval performance by over 22 points in mean Average Precision (mAP@1k) compared to strong global descriptor baselines.
  • Favorable Time-Budget Trade-offs: While MLLMs have higher per-image inference times than specialized models like AMES, they scale significantly better under a fixed query-time budget, achieving superior accuracy by re-ranking as few as 20 candidate 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.
  • Memory Efficiency: By utilizing PQ16 compression on 560px images, the MLLM re-ranker (Qwen-C) achieved a highly competitive accuracy-to-memory footprint ratio, outperforming traditional local-descriptor methods.
Figure 3. Performance vs. memory. Memory footprint per image is approximated assuming a fixed resolution, where the longer image side is set to the target value and the shorter side is scaled to 3/4 of it, reflecting a typical aspect ratio. Five models for re-ranking, operating on top of global similarities obtained from the PE model with linear adaptation. All indexing strategies are applied on the Qwen model with 560px image resolution. Text indicates: subspace dimension for PQ (e.g. PQ16 has 16 subspace dimensions), pixels for different resolutions (e.g. 560px), and number of tokens (e.g. 70) for the rest of the indexing methods. AMES used with descriptor sets of increasing cardinalities. LamRA and Qwen3R are shown both with their default prompts and also with our prompt, which performs better.
  • Robustness to Clutter and Scale: MLLM re-rankers showed remarkable robustness in scenarios where the target object occupied only a tiny fraction of the image or was surrounded by heavy background clutter, significantly outperforming AMES.

Limitations and Future Work

Despite their strong performance, the authors highlighted several key vulnerabilities in MLLMs:

  • Appearance Changes: MLLMs struggle heavily with drastic illumination changes and severe motion blur, where traditional local-descriptor methods like AMES still hold an advantage.
  • Lack of Geometric Rigor: By shuffling the positional encodings of the visual tokens, the authors found that the MLLM's performance only dropped marginally. This indicates that the model relies predominantly on semantic appearance cues rather than strict spatial/geometric verification.

Future work will likely focus on improving the geometric reasoning of MLLMs and addressing their sensitivity to extreme lighting and blur conditions.

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