KatalockAi AcademyBack to KatalockAi
Capstone 4, counts toward Phase 17

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.

about 30 h Earns its own certificate Reviewed against a 7-point rubric
Submit your project Get coached by Professor Katalock

The capstone and what it builds on

  1. 1Multimodal Document QA (Vision-First PDF, Tables, Charts)The capstone brief
  2. 2OCR & Document UnderstandingPhase 4: Computer vision
  3. 3Document and Diagram UnderstandingPhase 12: Multimodal AI
  4. 4ColPali and Vision-Native Document RAGPhase 12: Multimodal AI
  5. 5Multimodal RAG and Cross-Modal RetrievalPhase 12: Multimodal AI
  6. 6LLaVA and Visual Instruction TuningPhase 12: Multimodal AI
  7. 7RAG (Retrieval-Augmented Generation)Phase 11: LLM engineering and RAG
  8. 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

  1. 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.
  2. 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).
  3. 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.
  4. Patch pruning: keep the highest-signal 50% of patches (by norm or variance); report storage before and after and the nDCG@5 change.
  5. OCR-then-text baseline on the same corpus (Tesseract, docTR or PaddleOCR plus a text embedder) using the same answerer.
  6. 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.
  7. OCR fallback channel: pages flagged as equation- or table-dense by a heuristic get OCR text passed alongside the image.
  8. 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.
  9. 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) and viewer/, plus README.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.

CriterionWeightHow it's checked
Retrieval and QA accuracy vs OCR baseline20Content-type by approach matrix with nDCG@5 and answer accuracy for vision-first and OCR-then-text on the same questions and corpus.
Evidence-region grounding15Fraction of cited regions or pages that contain the answer is measured and reported with method.
Storage and latency engineering15Pruning ratio, storage before and after, nDCG@5 impact, and p95 retrieval and answer latency are reported.
Multi-page reasoning15Accuracy on the 10 or more multi-page questions reported separately with examples.
Source-inspection UX10Viewer shows the cited page with highlighted region next to the answer, as described or shown in evidence.
Code quality and structure10Pipeline stages are separate modules; MaxSim has a unit test; runs per README.
README: design decisions and limitations15README explains model, pruning and fallback choices, analyses where each approach lost on the learner's own corpus and states limits.

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.