Multimodal document QA
Build vision-first PDF question answering with late-interaction page embeddings and a VLM answerer, and compare it head to head against an OCR-then-text baseline on tables, charts and scans.
The capstone and what it builds on
- 1Multimodal Document QA (Vision-First PDF, Tables, Charts)The capstone brief
- 2OCR & Document UnderstandingPhase 4: Computer vision
- 3Document and Diagram UnderstandingPhase 12: Multimodal AI
- 4ColPali and Vision-Native Document RAGPhase 12: Multimodal AI
- 5Multimodal RAG and Cross-Modal RetrievalPhase 12: Multimodal AI
- 6LLaVA and Visual Instruction TuningPhase 12: Multimodal AI
- 7RAG (Retrieval-Augmented Generation)Phase 11: LLM engineering and RAG
- 8Information Retrieval and SearchPhase 5: Natural language processing
What You'll Build
A document QA system that treats each PDF page as an image: pages are embedded with a ColPali-family late-interaction model, retrieved with MaxSim, and answered by a vision-language model that cites document, page and region. You build an OCR-then-text baseline on the same corpus and publish a content-type by approach comparison.
Requirements
- Ingest: render every page with PyMuPDF to PNG and persist
{doc_id, page, image_path, content_type}where content_type is one of text, table, chart, scanned or handwritten, equation. - Embed each page with a late-interaction multi-vector model (ColPali, ColQwen or ColSmol class) and store per-patch vectors in a multi-vector index (Qdrant multivector, Vespa, or your own numpy/FAISS store).
- Implement MaxSim scoring (for each query token take the max dot product over page patches, then sum) or verify the index's implementation, with a unit test on toy vectors.
- Patch pruning: keep the highest-signal 50% of patches (by norm or variance); report storage before and after and the nDCG@5 change.
- OCR-then-text baseline on the same corpus (Tesseract, docTR or PaddleOCR plus a text embedder) using the same answerer.
- VLM answerer that receives the query plus top-k page images and must cite each claim as (doc_id, page, region type). If the VLM emits bounding boxes, render them.
- OCR fallback channel: pages flagged as equation- or table-dense by a heuristic get OCR text passed alongside the image.
- Evaluation on at least 40 hand-written questions (at least 10 needing two or more pages) with gold pages: retrieval nDCG@5 and answer accuracy in a content-type by approach matrix, evidence grounding rate (cited region really contains the answer), and p95 retrieval and answer latency.
- A viewer (Streamlit, Gradio or web) showing the answer next to the cited page with the region highlighted.
Constraints
- Model-agnostic: any OpenAI-compatible endpoint (including the KatalockAi API) or a local model (for example via Ollama, llama.cpp or vLLM) may be used. No named commercial model is required; record which model you used in the README. The answerer must accept images: a local VLM (Qwen2.5-VL 3B or 7B class, SmolVLM) or any hosted VLM behind an OpenAI-compatible API.
- Hardware: page embedding wants a GPU; a free Colab T4 or similar handles a few hundred pages. CPU works for a small corpus (around 100 pages) but is slow; say which you used.
- Substitution: the lesson targets 10k pages and the full ViDoRe v3 benchmark. Here at least 300 pages spanning 3 or more content types, or a documented ViDoRe subset, plus your own 40-question set is accepted.
- Use documents you are allowed to share (public filings, arXiv papers, your own scans); do not commit private documents.
Stretch Goals
- Find the pruning cliff: at what compression does nDCG@5 fall below the OCR baseline?
- Fuse OCR and vision retrieval with RRF and a reranker; report where the hybrid helps.
- Plot accuracy per dollar for two VLM sizes.
How to Submit
- Public GitHub repo with
ingest/,index/,answer/,baseline_ocr/,eval/(questions with gold pages, results) andviewer/, plusREADME.md. - README: corpus description and sources, how to index and query, the content-type by approach matrix, pruning results, viewer screenshot description and limitations.
- Paste the eval matrix, three example answers with citations (at least one multi-page) and the storage and latency numbers.
How It's Reviewed
Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.
Submit
Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.
- Eval matrix output (content type by approach: nDCG@5, accuracy)
- Pruning report: storage before and after and nDCG@5 delta
- Three example questions with cited answers, including one multi-page question
- Description or screenshot link of the viewer with an evidence overlay
- Short reflection on the content type where vision-first did worst and why
Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.