Skip to content
Senghak Rou
All projects

Artificial Intelligence · Oct – Nov 2026

VisualDoc AI

Ask a question about a PDF and inspect the page behind the answer. VisualDoc reads page images, searches text and checks quoted evidence so a reader can trace a number back to its table.

Status
Completedv1.3.1 selected demonstration is complete; the v1.4.0 calculator remains an experimental candidate pending paired evaluation.
Setting
Individual projectPersonal research project
My role
I built the retrieval and answering systems, designed the experiments and implemented the evidence viewer.
Methods and tools
Python · ColQwen2 · PyMuPDF · Tesseract · Streamlit

+11.9 pts

Answer accuracy gained with visual retrieval on MMLongBench-Doc

Paired difference on 674 answerable questions. Document-cluster 95% CI +8.8 to +15.0 points.

42 of 60

Questions the agent answered correctly on five independent financial filings

The direct reader answered 29 correctly in the same v1.1.0 acceptance test.

Finding the right page

A financial table can contain several plausible answers. Extracting a number loses its meaning if the reader drops its row label, unit or fiscal year. VisualDoc keeps the page image and its searchable text together. ColQwen2 compares question tokens with embeddings of image patches to rank pages. A keyword index uses native PDF text, with OCR for sparse or garbled text layers. BM25 supplies the ranking when visual retrieval is unavailable.

VisualDoc AI · evidence paths for one PDF Render PDF pages for visual retrieval and cache native or OCR text for keyword fallback. Rank pages for the question. Direct B1 reads four pages once. The agent starts there and chooses tools before finishing. Inspect cited pages and quote matches in both modes. one PDF render page images layout, figures and tables cache page text native text or parallel OCR ColQwen2 embeddings rank patches against the question BM25 keyword fallback rank text against the question four ranked pages + available fiscal note Direct B1 one structured read Bounded agent choose a tool or finish search · read · zoom · calculate tool result inspect cited pages and quote matches
Figure 1 · SchematicBoth workflows start with ranked evidence. The agent can use a tool result to decide which page, region or calculation to inspect next.

Two ways to answer

Direct B1 takes the four highest-ranked pages and makes one structured reader call on a cache miss. The bounded agent starts with the same evidence, then chooses whether to search again, read another page, extract text, zoom into a region, verify operands and calculate, or finish. It has a budget of eight model calls and twelve distinct page images. Both workflows can abstain. A citation check confirms page membership and a grounding check looks for the quoted text. Neither check establishes that a number belongs to the requested year.

What the experiments found

On MMLongBench-Doc, the frozen reader scored 288/674 (42.7%, document-cluster 95% CI 38.6–47.0%) with visual retrieval and 208/674 (30.9%) with keyword retrieval. The local S-v1 scorer evaluated 674 answerable questions within 872 questions from 110 held-out documents. On the 666 with annotated evidence, recall at four pages rose from 0.54 to 0.71. Across all 872 questions, median latency was 2.47 s for B1 and 2.44 s for keyword retrieval. The corresponding arm costs were USD 0.385 and 0.382.

Accuracy by how many pages the evidence spans

Held-out test, 666 answerable questions with annotated evidence; same reader, only the retrieved pages differ.

  • Visual retrieval (ColQwen2, B1)
  • Text retrieval (OCR + BM25)
0102030405060Accuracy (%)1 page · visual1 page (n = 384): visual retrieval 54.4%54.4%1 page · text1 page (n = 384): text retrieval 41.7%41.7%2–3 pages · visual2–3 pages (n = 220): visual retrieval 31.4%31.4%2–3 pages · text2–3 pages (n = 220): text retrieval 19.1%19.1%4 or more pages · visual4 or more pages (n = 62): visual retrieval 12.9%12.9%4 or more pages · text4 or more pages (n = 62): text retrieval 8.1%8.1%
Data table
Evidence spanQuestionsVisual (%)Text (%)Difference (points)
1 page38454.441.712.8
2–3 pages22031.419.112.3
4 or more pages6212.98.14.8
Figure 2 · Experimental resultVisual retrieval is ahead in every group, but both arms fall steeply as evidence spreads over more pages: the groups with multi-page evidence have lower accuracy. These comparisons describe different questions.Source: experiments/frozen/final/tables/evaluation_summary.json (repository commit e6fe9bd), subgroup “evidence span”; descriptive, no interval per subgroup.

The financial acceptance test compared the two answering workflows on the same 60 questions across five new annual filings, using v1.1.0. The whole 120-answer run cost USD 0.460 charged (USD 0.180 at list price).

WorkflowCorrectWrongMedian latency90th percentile
Direct B129/6017/601.79 s2.26 s
Agent42/6013/605.13 s15.65 s

The agent fixed 13 answers without breaking a correct one (+21.7 points, paired 95% CI +11.7 to +33.3). The system builder wrote the questions before seeing the outputs. With only five filings, document-level uncertainty is large. An earlier TAT-DQA test scored B1 at 140/300 and two agent runs at 173/300 and 180/300. The separate FinanceBench judgments used model-assigned labels and lack independent adjudication.

Which version runs

On fiscal-period development questions, adding filing-specific context and handling garbled text moved B1 from 0 to 2 correct and the agent from 6 to 11 on 15 at-risk items. On 51 controls the agent moved from 46 to 45. The v1.3.1 demo retains those changes. On an 82-OCR-page filing, bounded parallel OCR cut cold extraction from 330 to 85 seconds. Reopening cached text took 0.05 seconds.

Offline VisualDoc interface with a PDF evidence viewer and the answering workflow controls.
Full size screenshot 3 (opens in a new tab)
Figure 3 · ScreenshotThe Streamlit viewer keeps the cited page beside the question. Offline answers are scripted placeholders.Source: Project screenshot, docs/demo_offline.png at e6fe9bd. Fictional Harbor Works filing, keyword and visual retrieval, offline reader.

The v1.4.0 candidate accepted 889 additional valid operands in constructed tests. Its 320-cell development rehearsal used a scripted reader. Live answer accuracy remains unmeasured, and exposure of part of the planned evaluation set compromised its independence. The earlier held-out document benchmark used a separate population.

Individual contribution

Oct 2025 – May 2026Completed

Conversational Text-to-SQL

An assistant translates business questions into read-only SQL. A 100-question baseline study exposed a practical failure: a query can run successfully and still return the wrong result.

Artificial Intelligence · Team of 4 · Python, LangGraph, LangChain