Gradient LabSign up free

Trending › Benchmark

ParseBench-2: scoring mistakes by how much they hurt

LlamaIndex’s ParseBench-2 scores document parsers by how much each mistake would hurt, not by how many characters differ. A swapped digit in a table now costs 10 points instead of 0.13, while harmless format differences cost nothing.

Watch it move. This is an animated lesson on Gradient Lab.

Start the animated lesson

Step by step

Concept

Not all mistakes are equal

A parser that turns an invoice into text can make two kinds of mistakes: writing a table as Markdown instead of HTML (harmless), or swapping two digits in an amount (a real problem). Classic metrics like edit distance count changed characters, so the harmless one can look worse than the dangerous one.

Left: a format difference. Right: one wrong digit.

Problem

The old score got it backwards

LlamaIndex gives an example from its first benchmark: on a 459-cell table, a swapped number cost only 0.13 points, while a correct table written in Markdown instead of HTML scored zero. A metric like that rewards the wrong behaviour.

ParseBench-1 on the same table: a tiny penalty for the wrong number, a zero score for the harmless format change.

Key idea

Grade errors by severity

ParseBench-2 defines 330+ error types by injecting deliberate mistakes into correct outputs. Each type is labelled critical, major, minor or harmless with a target score drop, and the scoring rules are tuned until the deterministic metric matches those targets. Caps make sure a serious error gets a big penalty even if the rest of the page is perfect.

Four severity levels, four penalty sizes.

Insight

Same table, new penalties

Under ParseBench-2, the swapped number on that 459-cell table now costs 10 points, and Markdown instead of HTML costs 0. The benchmark covers about 4,300 cases across six areas: text, formatting, tables, charts, layout and forms.

ParseBench-2 penalties on the same table.

Practice

Why deterministic, not an AI judge

Another option is asking an LLM to judge each output. That handles equivalent formats, but scores can change between runs and depend on which judge model you pick. ParseBench-2 keeps a fixed, repeatable metric and makes it smarter instead. The same idea applies to any evaluation: weight errors by their real cost, like a confusion matrix with costs.

A cost-weighted metric: same mistakes, ranked by harm.

Quick check: Why is plain edit distance a poor score for parsing financial tables?

Pseudocode

# edit distance: count changed characters
score = 1 - edit_distance(output, truth) / len(truth)
# "$1,250" -> "$1,520" changes 2 characters out of thousands: tiny penalty

# severity-aware scoring
for error in find_errors(output, truth):
    level = classify(error)   # critical / major / minor / harmless
    score -= penalty[level]
score = min(score, cap[worst_level])   # one critical error caps the page

Go deeper

Sources

  1. LlamaIndex: Introducing ParseBench-2
  2. Hugging News: LlamaIndex launches ParseBench-2 and OCRia-1.5