[Feature] Opt-in LLM-judge rescoring for string-metric VQA benchmarks (ChartQA/DocVQA/InfoVQA/TextVQA/OCRBench) - #1602
Open
cdpark92 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ChartQA / DocVQA / InfoVQA / TextVQA / OCRBench are scored with strict string /
numeric metrics (relaxed accuracy, ANLS, VQA score, substring matching). These
metrics mark answers wrong when the model's answer is semantically correct but
formatted differently from the ground truth. Real cases from a
LiquidAI/LFM2.5-VL-450M run with this repo (ground truth vs model answer, all
scored 0 by the strict metric):
977633977,6331.41.4 billion11 GPI27%27 percent10 years10begins.begins$161,886161,886How many points this costs depends on each model's answering style, so it
distorts cross-model comparisons rather than adding a constant offset.
MMVet and MathVista already rely on LLM judges. This PR adds an optional
semantic-equivalence pass to the five string-metric benchmarks — without
changing any default behavior or any existing number.
Design
Opt-in gate. These datasets are assigned no judge model by default
(
get_judge_kwargs), so without--judge <model>nothing changes — theevaluation path and outputs are identical to
main. The rescoring runs onlywhen a judge is explicitly configured:
Strict scores are reported unchanged. The strict metric is computed with
the exact same
process_line/hit_calculateaggregation asevaluate_heuristic, and the judge can never demote a strict-passed sample.Judged results are appended as
<split>_judgecolumns (OCRBench:<category>_judgekeys andFinal Score_judgein the score JSON), so theoutput is a strict superset:
Judge cost scales with strict failures only. Only strict-failed samples
(per-sample score < 0.5) are sent to the judge; verdicts are cached in a
resumable pkl like the other judge-based evaluators.
Model-agnostic, dataset-specific prompts (
utils/llm_judge_vqa.py): theequivalence rules are written down per dataset — percent/decimal and
magnitude-word variants, unit suffixes, thousands separators, ~5% numeric
tolerance for ChartQA (consistent with relaxed accuracy), answer-containment
for OCRBench. The judge replies with a single
1/0token; a judge parsingfailure counts as wrong, so judge flakiness can never inflate scores.
Results on a public model
LiquidAI/LFM2.5-VL-450M, predictions generated with this repo, judge =
Qwen3.6-27B-FP8 served locally (thinking disabled):
Verification
--judge: the evaluate path is unchanged, outputs are identical tomainfor all five benchmarks.--judge: strict columns match the heuristic run exactly — verified onthe LFM2.5-VL-450M outputs above at full float precision (e.g. DocVQA
78.33964128700651); only the*_judgecolumns are added.pre-commit runpasses on the changed files.Notes
Judged numbers naturally depend on the chosen judge model, so the strict
columns remain the primary metric and the judge columns are supplemental.
Happy to adjust the gating (e.g. a dedicated flag instead of judge presence),
column naming, or prompt wording if maintainers prefer.