RAG Optimization · Module 06
Multimodal RAG
RAG over documents that are not only text: tables, charts, images and scanned pages, the approaches to index them and how to choose one.
Học xong bạn làm được
- Explain what text-only RAG loses
- Explain how ColPali and ColQwen score page images with patch vectors and MaxSim
- Compare the approaches to multimodal RAG
- Design a multimodal RAG pipeline
- Weigh cost, latency and quality for each approach
Bài học
- Multimodal RAG: The Problem with Text-Only RAG
Traditional RAG works on text only, but enterprise knowledge often lives in org charts, financial tables, architecture diagrams and scanned PDFs. Text-only RAG fails there through silent data loss, OCR degradation and no visual reasoning - and the retrieval still looks correct.
- Approaches to Multimodal RAG
Four approaches - OCR plus text RAG (cheap, lossy), captioning plus text RAG (better on charts, still lossy, costly at ingestion), native multimodal embeddings (one shared space, good for cross-modal search) and vision-language retrieval with ColPali or ColQwen (late interaction on page images, no text extraction, highest quality). Choose by quality, cost, latency and documents.
- Multimodal RAG Pipeline Design
A production pipeline with ColQwen renders pages to images, encodes them into per-token patch vectors in a multi-vector store, retrieves top-K page images by MaxSim against the query, and lets a vision LLM answer from those pages with citations. Render at 300 DPI, use a multi-vector store, separate retrieval from generation, and add a re-ranker.
- Practical Considerations and Summary
Page images cost 1,000-2,000 LLM tokens and ColBERT-style stores keep 100-500 vectors per page. Text metrics such as RAGAS miss visual failures, so use ViDoRe, human spot-checks and visual grounding accuracy. Cut cost with a two-stage pipeline, thumbnail retrieval with full-resolution generation, and cached page embeddings. Retrieval quality sets the ceiling on generation.