Appendices

Appendix C

ColPali Appendix

3,809 words17 min read13 sources cited

Reproducibility Statement

For transparency, reproducibility and to foster future work, we release our training data, model checkpoints (adapters), entire codebase, and complete evaluation benchmark under MIT licenses as detailed in the main paper. We also host a public ViDoRe leaderboard to foster concurrent work in the space. The supplementary material further details training configurations for our models (also specified in HuggingFace model repositories), and dives into the process we used to generate synthetic data, how latency computations are performed, as well as provides further detailed evaluation results.

Acknowledgements

This work is partially supported by Illuin Technology, and by a grant from ANRT France. This work was performed using HPC resources from the CINES ADASTRA through Grant 2024-AD011015443 and from IDRIS with grant 2024-AD011015724R1. We extend our warm thanks to Jonathan Dong, Caio Corro, Victor Pellegrain and Ender Konukoglu for their valuable feedback on the paper.

Benchmark Datasets

Academic Datasets

DocVQA includes collected images from the UCSF Industry Documents Library. Questions and answers were manually annotated.

InfoVQA includes infographics collected from the Internet using the search query “infographics”. Questions and answers were manually annotated.

TAT-DQA is a large-scale Document VQA dataset that was constructed from publicly available real-world financial reports. It focuses on rich tabular and textual content requiring numerical reasoning. Questions and answers were manually annotated by human experts in finance.

arXivQA is a VQA dataset based on figures extracted from arXiv publications. The questions were generated synthetically using GPT-4 Vision.

TabFQuAD (Table French Question Answering Dataset) is designed to evaluate TableQA models in realistic industry settings. We create additional queries to augment the existing human-annotated ones using the same method described in Subsection C.3.2.

Practical Datasets

Methodology. Creating a relevant retrieval dataset close to real use cases is a major challenge as the dataset needs to be both sufficiently large for effective fine-tuning and sufficiently diverse to cover a broad range of modalities (full text, tables, charts, ...), domains (industry, healthcare, ...), and query-document interactions (extractive questions, open-ended questions, ...). Our approach to building this dataset involves several steps: (1) we use a web crawler to collect publicly available documents on various themes and sources, (2) we convert these PDFs into a series of images, one per page, and (3) we generate queries related to each image using a VLM.

Web-Crawler. We implemented a web crawler to efficiently collect large volumes of documents related to a given topic. The crawler is seeded with a user-defined query (e.g. “artificial intelligence") and then uses GPT-3.5 Turbo to brainstorm related topics and subtopics. This query augmentation strategy aims at both broadening and deepening the search. GPT-3.5 Turbo is further used to generate diverse search queries from each subtopic. This query set is then consumed by a pool of parallel workers whose job is to fetch the associated most relevant documents. We use SerpAPI along with a filetype filter (PDF documents only) to programmatically scrape Google Search rankings. Each file is hashed and stored in a Bloom filter shared among workers to avoid duplicate documents in the final corpus. Unique scraped files are downloaded, and inserted into a SQLite database along with additional metadata.

Datamix. Using the web crawler, we collected approximately 100 documents for each of the following four seeds: “energy", “government reports", “healthcare industry", and “artificial intelligence". These seeds were meticulously hand-picked to align with real-use cases for retrieval models and visually rich pages. We also removed all documents containing any private information.

Query Generation. To increase the efficiency of our query generation scheme and to limit API calls, we generate at most 3 questions per image. From all the documents collected, we randomly sample 10,000 images per theme and call Claude-3 Sonnet with the following prompt:

Human Validation. We manually validate every single synthetically created query in ViDoRe to ensure quality, query relevance, and consistency with the benchmark objective of evaluating retrieval in practical industrial settings. During this step, we randomly assign document-pair queries to 4 volunteer annotators and instruct them to filter out queries that do not fit the above-listed criteria. We also instruct annotators to flag any documents they deem to contain PII information or content not suited for an academic benchmark. No flag was raised during the entirety of the process, validating our prior PDF collection strategy. 100 queries per topic are collected in this manner. Annotators are colleagues and collaborators of the authors who volunteered to help. Each annotator spent approximately 3 hours filtering the larger query set down to 100 high-quality queries per topic.

Training Dataset

The statistics of the train set are given in the following table. The creation of the train set follows the same methodology as in Subsection C.3.2. We made sure that a PDF document cannot have pages in both the training set and the test set to prevent data leakage and that there are no duplicate documents in each split.

Table 1. Details on the different splits in the dataset used to train ColPali.
Dataset SplitSplit SizeLanguageDomain
DocVQA39,463EnglishScanned documents from UCSF Industry
InfoVQA10,074EnglishInfographics scraped from the web
TATDQA13,251EnglishHigh-quality financial reports
arXivQA10,000EnglishScientific Scientific Figures from arXiv
Scraped PDFs45,940EnglishVaried PDFs from 3885 distinct URL domains
TOTAL118,695English-onlyMixed

Implementation details

Codebase

The codebase is written in PyTorch and leverages HuggingFace tooling for model implementations and trainers.

Hyperparameters

Hyperparameters are tuned on a validation split composed of 2%2\% of the training dataset. We find bi-encoder methods to be more sensible to learning rate variations than late interaction-based models and achieve the best performance for all models with a learning rate of 5e55e-5. We experiment with LoRA rank and α\alpha values and do not notice particular improvements past r=α=32r = \alpha = 32. Per-device batch sizes are kept small due to long sequence lengths that complicate scaling past b=4b=4. We simulate larger batch sizes with multi-GPU training and train with a total batch size b=32b=32 with no accumulation, for 1 epoch on our training set.

Embedding size

Minimizing storage footprint can be essential to industrial retrieval systems if databases contain millions of documents. With this criterion in view, we have compared the embedding sizes of the models in our study. As shown in Table 2, ColPali’s embedding size is an order of magnitude larger than BM25 and two orders of magnitude larger than BGE-M3. However, in practical scenarios, pooling multi-vector embeddings by centroid cluster, or quantizing embeddings to binary representations can reduce storage costs by two orders of magnitude with minimal performance hits, and make storage costs competitive with other systems.

Table 2. Comparison of the embedding sizes for the DocVQA test set from ViDoRe w.r.t. different retrieval models. The mean ± std size is given for the sparse embeddings. In general multiple vectors (2-5) per page are used for BGE-M3 and BM25.
ModelEmbedding size (KB)
BGE-M38.60
BM25 (dense emb.)3.00
BM25 (sparse emb.)1.56 ± 0.51
ColPali (float16)257.5

Latency computations

To ensure comparison fairness, the latencies of the different retrieval systems shown in Figure 2 are measured on the same g2-standard-8 GCP VM with an NVIDIA L4 GPU. Document pages are embedded using the highest settings of Unstructured with captioning (see Subsection 3.3.2). SigLIP and ColPali are both loaded with bfloat16 parameter dtypes. The reported times in Table 3 are the average per-page latencies for each indexing operation on 1000 randomly chosen documents across all splits of the ViDoRe benchmark test set. A batch size of 88 was used for the BGE-M3 model used with Unstructured, and a batch size of 44 was used for SigLIP and ColPali.

Table 3. Page-level latencies for document indexing using various retrieval systems. SigLIP and ColPali are much faster than Unstructured because they don't require the layout detection, OCR, and captioning operations.
Indexing operationLatency (s)
UnstructuredSigLIPColPali
Layout detection0.81NANA
OCR2.67NANA
Captioning3.71NANA
Page encoding0.030.120.39
Total7.220.120.39

Captioning

Examples of captions generated for visually rich document chunks with Claude-3 Sonnet are shown in Figure 2 and Figure 1. The prompt used for generating the description is the following:

Example from the “Energy" test set. Caption: The image depicts the hourly energy generation profile, illustrating the contributions of various energy sources over 24 hours. The data is presented as a stacked bar chart, with the x-axis repre
Figure 1. Example from the “Energy" test set.
Caption: The image depicts the hourly energy generation profile, illustrating the contributions of various energy sources over 24 hours. The data is presented as a stacked bar chart, with the x-axis representing the hours of the day from 1 to 2, and the y-axis showing the average hourly generation in MW. The bars are segmented into different colors, each representing a distinct energy source: nuclear, bio, geothermal, solar, wind, hydro, natural gas, and other imports. The chart provides insights into the temporal variations in energy generation across different sources, highlighting the interplay between baseload and intermittent sources throughout the day.
Example from the “Government Reports" test set. Caption: The image shows a table titled “System of Record" which outlines the different types of documents or records maintained across various systems or departments within an organization re
Figure 2. Example from the “Government Reports" test set.
Caption: The image shows a table titled “System of Record" which outlines the different types of documents or records maintained across various systems or departments within an organization related to project management and construction. The rows list documents like project plans, budgets, schedules, contracts, purchase orders, invoices, change requests, bid submissions, drawings, manuals, meeting minutes, and reports. The columns indicate the system or department responsible for maintaining each record, such as County Servers, Project View, OnBase, CGI Advantage Financial System, and Purchasing Department. The table uses "W" and "T" markers to denote which system or department serves as the primary source (writer) or storage location (trailer) for each type of document.

Additional results

Other Metrics

Table 4. Comprehensive evaluation of baseline models and our proposed method on ViDoRe. Results are presented using Recall@1 metrics. Text-only metrics are not computed for benchmarks with only visual elements.
ArxivQDocQInfoQTabFTATQShiftAIEnergyGov.Health.Avg.
Unstructured text-only
BM25-26.6--34.645.086.070.068.074.0-
BGE-M3-22.8\downarrow3.8--26.1\downarrow8.551.0\uparrow6.081.0\downarrow5.072.0\uparrow2.067.0\downarrow1.077.0\uparrow3.0-
Unstructured i͡ny+ OCR
BM2526.728.954.030.450.052.086.077.074.080.055.9
BGE-M328.1\uparrow1.422.9\downarrow6.053.8\downarrow0.255.7\uparrow25.338.6\downarrow11.456.0\uparrow4.082.0\downarrow4.079.0\uparrow2.076.0\uparrow2.083.0\uparrow3.057.5\uparrow1.6
Unstructured + Captioning
BM2535.530.261.524.349.047.079.076.075.081.055.9
BGE-M329.3\downarrow6.226.0\downarrow4.262.1 \uparrow0.658.6\uparrow34.330.6\downarrow18.455.0\uparrow8.080.0\uparrow1.078.0\uparrow2.069.0\downarrow6.083.0\uparrow2.057.2\uparrow1.3
Contrastive VLMs
Jina-CLIP19.47.326.712.51.62.011.013.015.017.012.6
Nomic-vision10.46.722.19.61.60.09.09.07.013.08.8
SigLIP (Vanilla)34.221.351.846.117.913.050.051.047.065.039.7
Ours
SigLIP (Vanilla)34.221.351.846.117.913.050.051.047.065.039.7
BiSigLIP (+fine-tuning)49.2\uparrow15.023.8\uparrow2.559.0\uparrow7.252.1\uparrow6.020.7\uparrow2.816.0\uparrow3.062.0\uparrow12.061.0\uparrow10.055.0\uparrow8.072.0\uparrow7.047.1\uparrow7.4
BiPali (+LLM)46.4\downarrow-2.820.0\downarrow-3.854.6\downarrow-4.463.2\uparrow11.120.4\downarrow-0.434.0\uparrow18.059.0\downarrow-3.045.0\downarrow-16.057.0\uparrow2.056.0\downarrow-16.045.6\downarrow-1.5
ColPali (+Late Inter.)72.4\uparrow26.045.6\uparrow25.674.6\uparrow20.075.4\uparrow12.153.1\uparrow32.755.0\uparrow21.093.0\uparrow34.085.0\uparrow40.085.0\uparrow28.088.0\uparrow32.072.7\uparrow27.1

Model Variants

Table 5. Benchmark scores for the “negative results" and various ablations on ViDoRe; ColPali for reference. Results are presented using nDCG@5 metrics. Text-only metrics are not computed for benchmarks with only visual elements.
ArxivQDocQInfoQTabFTATQShiftAIEnergyGov.Health.Avg.
ColSigLIP (PaliGemma)3.13.05.16.22.51.03.43.42.32.23.2
BiSigLIP (PaliGemma)18.514.633.439.516.15.227.632.636.635.726.0
ColSigLIP (Original)2.62.22.35.71.81.02.64.11.41.52.5
ColPali (No Q.A. Tokens)80.453.282.477.465.763.497.089.993.692.479.6
ColPali (Docmatix)71.348.080.083.959.173.895.793.892.593.179.1
ColPali (224)71.037.462.365.728.620.465.766.873.973.056.5
ColPali (Vision Trained)78.853.981.381.764.470.695.391.793.594.780.6
ColPali (No Pairwise)79.053.082.185.363.266.294.988.992.792.179.7
ColPali (+TabFQuAD training)77.654.782.686.565.473.994.892.494.294.881.7
ColIdefics2 (64)73.648.082.481.663.057.295.586.986.691.276.6
ColQwen2 (768)86.456.289.888.775.285.798.894.893.697.386.6
ColPali (Reference: 448)79.154.481.883.965.873.296.291.092.794.481.3

More similarity maps

In Figure 3, ColPali assigns a high similarity to all patches with the word “Kazakhstan" when given the token <\_Kazakhstan>. Moreover, our model seems to exhibit world knowledge capabilities as the patch around the word "Kashagan"—an offshore oil field in Kazakhstan—also shows a high similarity score.

Similarity of the image patches w.r.t. the underlined token in the user query. This example is from the Shift test set.
Figure 3. Similarity of the image patches w.r.t. the underlined token in the user query. This example is from the Shift test set.

It is also interesting to highlight that both this similarity map and the one displayed in Figure 4 showcase a few white patches with high similarity scores. This behavior might first seem surprising as the white patches should not carry a meaningful signal from the original images. We believe the vectors associated with these patches share a similar role with the ViT registers , i.e. these patches were repurposed for internal computations and stored the global information from the whole image.

Model glossary

SigLIP

SigLIP (Sigmoid Loss for Language Image Pre-Training) builds upon CLIP (Contrastive Language-Image Pretraining)—a foundational model that aligns images and text by maximizing the similarity between correct image-text pairs while minimizing it for incorrect ones, leveraging a contrastive loss . Unlike CLIP , which applies the softmax function to the logits, SigLIP uses the sigmoid activation function. This innovation eliminates the need for a global view of all pairwise similarities between images and texts within a batch, enabling more flexible batch size scaling (up to 1M items per batch, with an effective optimal batch size of 32k). This approach allows SigLIP to achieve state-of-the-art performance in zero-shot image classification tasks.

PaliGemma

PaliGemma is a 3B-parameter vision-language model. It integrates the SigLIP vision encoder with a Gemma-2B language decoder, connected via a multimodal linear projection layer . The model processes images by segmenting them into a fixed number of Vision Transformer tokens, which are prepended to an optional text prompt.

A distinguishing feature of PaliGemma is its operation as a Prefix-Language Model (Prefix-LM). This design ensures full attention between image tokens and the user-provided input (prefix) while generating outputs auto-regressively (suffix). This architecture allows image tokens to access the task-specific query during processing, facilitating more effective task-dependent reasoning.

PaliGemma was trained in four stages: unimodal pretraining with existing components, extended multimodal pretraining, short high-resolution pretraining, and task-specific fine-tuning.

ColBERT

ColBERT (Contextualized Late Interaction over BERT) is a retrieval model designed to balance speed and effectiveness in information retrieval tasks . Traditional retrieval models are typically categorized based on their type of interaction: either processing queries and documents independently for efficiency (bi-encoders) or jointly to capture rich contextual relationships (cross-encoders). ColBERT combines the advantages of both approaches through a novel late interaction mechanism.

Queries and documents are encoded separately using BERT, enabling offline pre-computation of document representations for scalability. Instead of pooling embeddings into a single vector, ColBERT retains token-level embeddings and employs a MaxSim operator to compute fine-grained similarity scores. For each query token, the model determines the maximum similarity with document tokens, summing these scores to compute relevance.

This architecture preserves the contextual richness of deep language models while significantly improving computational efficiency. By delaying the interaction step, ColBERT supports vector similarity indexing, facilitating end-to-end retrieval from large collections without prohibitive costs. Empirical evaluations on passage search datasets demonstrate that ColBERT achieves competitive effectiveness compared to existing BERT-based models , while executing queries orders of magnitude faster and with drastically reduced computational requirements.

Examples from the ViDoRe benchmark

Figure 4, panel 1Figure 4, panel 2Figure 4, panel 3Figure 4, panel 4Figure 4, panel 5Figure 4, panel 6Figure 4, panel 7Figure 4, panel 8Figure 4, panel 9Figure 4, panel 10Figure 4, panel 11Figure 4, panel 12Figure 4, panel 13Figure 4, panel 14Figure 4, panel 15
Figure 4.

References

  1. Minesh Mathew, Dimosthenis Karatzas, C. V. Jawahar (2020). DocVQA: A Dataset for VQA on Document Images. Source ↗
  2. Minesh Mathew, Viraj Bagal, Rubèn Pérez Tito, Dimosthenis Karatzas, Ernest Valveny, C. V Jawahar (2021). InfographicVQA. arXiv. Source ↗
  3. Fengbin Zhu, Wenqiang Lei, Fuli Feng, Chao Wang, Haozhou Zhang, Tat-Seng Chua (2022). Towards Complex Document Understanding By Discrete Reasoning. Source ↗
  4. Lei Li, Yuqi Wang, Runxin Xu, Peiyi Wang, Xiachong Feng, Lingpeng Kong, Qi Liu (2024). Multimodal ArXiv: A Dataset for Improving Scientific Comprehension of Large Vision-Language Models.
  5. Burton H. Bloom (1970). Space/time trade-offs in hash coding with allowable errors. Source ↗
  6. Keshav Santhanam, Omar Khattab, Christopher Potts, Matei Zaharia (2022). PLAID: An Efficient Engine for Late Interaction Retrieval. arXiv. Source ↗
  7. Timothée Darcet, Maxime Oquab, Julien Mairal, Piotr Bojanowski (2023). Vision Transformers Need Registers. Source ↗
  8. Xiaohua Zhai, Basil Mustafa, Alexander Kolesnikov, Lucas Beyer (2023). Sigmoid Loss for Language Image Pre-Training. Source ↗
  9. Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever (2021). Learning Transferable Visual Models From Natural Language Supervision. Source ↗
  10. Lucas Beyer*, Andreas Steiner*, André Susano Pinto*, Alexander Kolesnikov*, Xiao Wang*, Xiaohua Zhai*, Daniel Salz, Maxim Neumann, Ibrahim Alabdulmohsin, Michael Tschannen, Jeremiah Harmsen, Daniel Keysers, Neil Houlsby, Xi Chen, Emanuele Bugliarello, Thomas Unterthiner, Keran Rong, Matthias Minderer, Ioana Bica, Ivana Balazevic, Joan Puigcerver, Julian Eisenschlos, Manoj Kumar, Matko Bošnjak, Matthias Bauer, Fangyu Liu, Adam Grycner, Alexey Gritsenko, Paul Voigtlaender, Pinelopi Papalampidi, Olivier Henaff, Skanda Koppula, Xi Xiong, Radu Soricut, Model release contributors, general support, Tris Warkentin, Kat Black, Luiz Gustavo Martins, Glenn Cameron, Raj Gundluru, Manvinder Singh, Meg Risdal, Nilay Chauhan, Nate Keating, Nesh Devanathan, Elisa Bandy, Joe Fernandez, Antonia Paterson, Jenny Brennan, Tom Eccles, Pankil Botadra, Ben Bariach, Lav Rai, Minwoo Park, Dustin Luong, Daniel Vlasic, Bo Wu, Wenming Ye, Divyashree Sreepathihalli, Kiranbir Sodhia, Alek Andreev, Armand Joulin, Surya Bhupatiraju, Minh Giang, Joelle Barral, Zoubin Ghahramani (2024). PaliGemma. Kaggle. Source ↗
  11. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby (2020). An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. Source ↗
  12. Omar Khattab, Matei Zaharia (2020). ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT. Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval. Source ↗
  13. Jacob Devlin, Ming-Wei Chang, Kenton Lee, Kristina Toutanova (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). Source ↗