Multimodal Models·Question 12 of 67Intermediate

How would you reliably extract tables and charts from documents?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Treat tables and charts as different problems: tables contain the data; charts usually only depict it.

Full worked answer

Treat tables and charts as different problems: tables contain the data; charts usually only depict it.

Tables. For born-digital PDFs with embedded text, rule-based extractors (Camelot/Tabula-style, using ruling lines and text positions) are cheap and exact - try them first. For scanned or complex tables, either a table-structure model (e.g. Microsoft's Table Transformer, trained on PubTables-1M) reconstructs the grid from the image, or a VLM transcribes the table directly to markdown/HTML. VLMs are genuinely good at this now, including merged cells and multi-row headers - but they fail by plausible reconstruction: dropping a row, duplicating a line, or inventing a value while keeping perfect formatting. So validate structurally: consistent column counts, type checks per column, and arithmetic checks (subtotals sum, percentages hit ~100). For critical tables, transcribe twice (different temperature or crops) and diff - disagreement flags cells for review.

Charts. First ask whether the numbers exist as text: if data labels are printed, extraction is OCR-shaped and reliable. If not, the VLM is estimating values by visually interpolating against axes - treat outputs as approximations (±5-10% is common on bar charts, worse for scatter/log scales), and never feed them into downstream arithmetic as exact. Benchmarks like ChartQA use "relaxed accuracy" (within 5% counts as correct) precisely because of this. Where possible, go upstream for the source data; where not, extract axis ranges and tick values first (those are text, hence reliable), then ask for values relative to them - it measurably improves estimates.

Cross-cutting: render tables/charts at high resolution (tiling), crop the region of interest and re-ask rather than querying the full page, and keep provenance - page number and bounding region - attached to every extracted cell so humans can verify quickly.

What a good answer covers

  • Treat tables and charts as different problems: tables contain the data; charts usually only depict it
  • For born-digital PDFs with embedded text, rule-based extractors (Camelot/Tabula-style, using ruling…
  • For scanned or complex tables, either a table-structure model (e.g
  • Microsoft's Table Transformer, trained on PubTables-1M) reconstructs the grid from the image, or a VLM…
  • VLMs are genuinely good at this now, including merged cells and multi-row headers - but they fail by…

Key terms: Tables · Charts

Interviewer follow-ups to expect

  1. A VLM returns a beautifully formatted table with one hallucinated row - what catches it?

  2. When would you fine-tune a small model for table extraction instead of prompting a frontier VLM?

  3. How do you evaluate chart extraction when ground truth is only the image?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep