DEV Community

Reid Marlow
Reid Marlow

Posted on Originally published at reidmarlow.com

Test PDF parsers for the one wrong value, not just missing text

Your ingestion pipeline returns almost every word on a financial table. One column header has moved, so the value for 2025 is now attributed to 2026. A text-similarity score can look excellent while the application answers the wrong question.

That distinction is the useful part of ParseBench 2, LlamaIndex's document-parsing benchmark. Its maintainers describe 4,317 page-level test cases drawn from 2,645 documents, across text, formatting, tables, charts, layout and forms. The benchmark adds severity-aware scoring: a page gets the lower of its content-recovery score and a severity cap. A changed number, flipped negation, swapped header or incorrect form value can therefore hurt the score even when most of the page survived.

This is a benchmark design, not a guarantee that its severity labels match your application. But it gives teams building PDF-to-search or PDF-to-agent pipelines a better question to ask: which small error would change a decision?

A page score should not hide a critical field

Imagine a two-column revenue table where the parser preserves every number but swaps the year labels. A downstream retrieval system may faithfully retrieve the wrong year. Re-running the language model against the same extracted text will not repair the source data.

For a contract, the analogous failure might be dropping “not” from an exclusion. For a form, it could be reading a printed label as a filled-in value. The current ParseBench repository describes a recent forms-scoring change that distinguishes printed form text from a claimed field value. That distinction matters: a blank field and an invented answer call for different review and remediation.

Create a small local evaluation set around those consequences. For each page, retain the original PDF, expected output and page number, then specify the facts that must survive: row and column labels paired with values, signs and units, negations, and the distinction between blank and filled fields. Include pages your users actually send, with permission to use them; a public benchmark alone cannot represent your document mix.

Score the answer-bearing relationships

A useful test need not reproduce an entire benchmark. Consider a hypothetical reference row:

Revenue | 2025: 10 | 2026: 12 | USD millions
Enter fullscreen mode Exit fullscreen mode

Checking that 10 and 12 appear is insufficient. A test should ask whether Revenue, 2025, USD millions maps to 10, and whether the 2026 value maps to 12. Record missing values separately from incorrect values. If a field cannot be confidently matched, route the page for inspection rather than silently treating a blank as zero.

Likewise, a contract test can assert the full clause containing a negation and its section heading, not just the presence of the words around it. Keep a link back to the source page in the record shown to reviewers. The extracted Markdown is convenient for indexing and comparison; the original page remains the reference when the extraction and the page disagree.

Read the benchmark by dimension

ParseBench 2 reports an unweighted mean across six dimensions, with fixed weights for datasets inside each dimension. That is useful for comparing broad coverage, but a team processing forms should inspect the forms result and actual failed pages instead of choosing a parser solely by the overall rank. The authors also say v1 and v2 scores are not comparable: the test set and scoring changed.

The benchmark is maintained by LlamaIndex, which also makes a parser on its leaderboard. The dataset and evaluation code are available for inspection, and the repository says verified rows are rescored from published outputs. Treat those results as a starting point, then run the same checks on representative pages and investigate failures. A leaderboard score is not an independent audit of a particular deployment.

Put a review boundary around conversion

For a PDF-to-Markdown workflow, save the input, output, parser version and page mapping together. Re-run the same evaluation when the parser or its settings change. For document types with material consequences, review pages that fail field or relationship checks before their contents feed an automated decision.

Tools such as KolmoPDF offer technical PDF-to-Markdown conversion, including layouts with tables and formulas. They can be candidates for this workflow, but the published ParseBench results do not establish a score for KolmoPDF here, and no parser should be assumed correct on your documents without testing. KolmoPDF is a related product; this site links to it.

The practical target is not a perfectly pretty Markdown file. It is an extraction whose important claims can be traced to the page and whose consequential errors are visible before another system confidently repeats them.

Top comments (0)