English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

PDF Retrieval with Vision Language Models: ColPali Document Search on Vespa

Forum topic · 小凯 · 2026-07-05

Summary

This Vespa engineering blog post explains how to retrieve PDF documents using vision language models with ColPali, a late-interaction retrieval approach that operates directly on document page images instead of lossy text extraction. Traditional PDF pipelines rely on OCR and layout parsing, which often destroy tables, figures, and complex formatting, degrading retrieval quality. ColPali instead encodes page screenshots with a vision-language model (e.g., PaliGemma) into multi-vector embeddings, enabling late-interaction scoring similar to ColBERT at query time. The post covers how ColPali representations can be indexed and searched in Vespa, including tensor-based storage of patch-level embeddings, MaxSim scoring, and practical trade-offs around index size, latency, and GPU usage. It also discusses how to combine ColPali with other ranking signals, such as BM25 and text embeddings, in a phased retrieval pipeline. This is a practical reference for engineers building document search over visually rich PDFs where text extraction alone is insufficient.

PDF Retrieval with Vision Language Models: ColPali Document Search on Vespa

Source: Vespa blog

Why PDFs are hard to retrieve

A large fraction of enterprise knowledge lives in PDFs. Classic retrieval pipelines extract text with OCR and layout parsing before indexing, but this approach is lossy:

  • Tables, figures, charts, and forms lose their structure when flattened to text.
  • OCR errors and reading-order mistakes corrupt the representation.
  • Visual cues (colors, formatting, diagrams) carry semantics that text extraction discards.
  • ColPali: retrieval over page images

    ColPali sidesteps text extraction entirely. Instead of indexing extracted text, it indexes the page screenshot:

    1. Each PDF page is rendered as an image. 2. A vision-language model (built on PaliGemma) produces a multi-vector representation: one embedding per image patch. 3. At query time, query tokens are embedded and scored against all patch embeddings using late interaction (MaxSim), in the spirit of ColBERT.

    This preserves the full visual layout of the document and lets the vision-language model read tables and figures directly.

    Serving ColPali with Vespa

    Vespa supports ColPali-style retrieval because its tensor model natively represents multi-vector documents:

  • Store patch-level embeddings as a tensor field per page.
  • Use a ranking function with MaxSim over query embeddings to compute late-interaction scores.
  • Combine ColPali scores with cheaper signals (e.g., BM25 over extracted text or single-vector embeddings) in a phased ranking pipeline: candidate generation with fast signals, then re-ranking with ColPali on a smaller candidate set to control cost.
  • Trade-offs

  • Index size: hundreds of patch vectors per page vs. one vector per document — storage and memory costs rise substantially.
  • Latency: late interaction is more expensive than single-vector ANN search, so it is best used for re-ranking, not first-phase retrieval.
  • Query-side cost: query embeddings can be cached; page embeddings cannot.
  • Accuracy: on visually complex documents (tables, forms, figures), ColPali significantly outperforms OCR-based text retrieval.
  • Takeaways

  • Vision-language retrieval removes the fragile OCR/extraction stage for visually rich PDFs.
  • Late-interaction multi-vector scoring fits naturally into Vespa's tensor framework.
  • Practical deployments combine ColPali re-ranking with cheaper first-phase retrieval to balance quality, latency, and cost.
For full implementation details and code, see the original post.

Tags

#colpali#pdf-retrieval#vision-language-models#late-interaction#vespa#document-search#rag#information-retrieval

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178208495