Evaluating and Selecting Open-Source Multimodal Models for Vision and Document Understanding
This is a practical guide to choosing open-source multimodal models for vision and document understanding. It explains why public leaderboard scores can mislead technical decisions, breaks "document understanding" into measurable sub-abilities, and shows how to build a self-maintained evaluation set through stratified sampling and dual annotation. It includes a sample evaluation pipeline in Python, a mapping from offline scores to online metrics, cost-control practices, a common-pitfalls list, and a go-live checklist.
1. How to Read Leaderboard Scores
Open-source multimodal models are iterating quickly. On public vision question answering and document understanding arenas, the open-source camp keeps climbing — some models have reached roughly the top twenty overall and land around the top ten on document-specific sub-boards. This is useful for technical selection, but only if you understand how it is produced; otherwise it is easy to misread.
Mainstream arena-style leaderboards use pairwise blind comparison: two anonymous answers to the same question are shown to a reviewer in random order, the reviewer picks the better one, and match graphs are used to fit relative-strength values similar to chess Elo ratings or the Bradley-Terry model. Three inferences follow that you must keep in mind:
- Scores are relative units, not a percentage scale. A lead of ten-plus points and a lead of a few points can feel nearly identical, especially when most models cluster in a narrow band — where the ranking means far less than the score distribution itself.
- Confidence intervals determine how strong a conclusion is. With small samples or uneven opponent pairings, the ordering of adjacent ranks may not be statistically significant. For technical decisions, look at whether the intervals overlap, not at a single-point ranking.
- Preference does not equal usability. Human reviewers naturally prefer answers that are clearly structured, complete, and sufficiently long; production systems, by contrast, often demand strict field extraction, stable structured output, and a very low hallucination rate. The two goals do not fully align.
Conclusion: Public leaderboards are for narrowing the candidate set (from hundreds of models down to single digits). The final decision must rely on an internal evaluation set close to your own data distribution.
2. Breaking Down Document Understanding
“Strong at document understanding” is a composite conclusion. To act on it, break it into measurable, attributable sub-items. In practice, cover at least these seven dimensions:
- Layout and reading-order reconstruction. Detection and ordering of headers/footers, footnotes, and marginal notes in two-column layouts; whether multi-column text gets interleaved or misordered.
- Table structuring. Rules for expanding merged cells, stitching cross-page continuations, recognizing header hierarchy, and mapping cells to semantic fields. This has the highest failure rate and the most business value.
- Chart reading. Meaning of axes, units, legends, and trend description; whether the model can distinguish “reading a chart” from “fabricating a chart.”
- Formulas and special symbols. Fidelity of reconstructing superscripts/subscripts, fractions, and matrices, plus confusion between symbols and near-identical characters.
- Robustness to low-quality input. Skew, noise, low resolution, stamp occlusion, handwritten annotations, inverted scans, and photo shadows.
- Long documents and cross-page reasoning. Cross-page references, clause citations, and data cross-checks in contracts, financial reports, and research reports; whether accuracy falls off a cliff as page count grows.
- Instruction following and output constraints. Whether it can reliably output results conforming to a given schema, whether it explicitly refuses rather than guesses on unknown information, and whether its truncation strategy is reasonable for very long inputs.
Only when the conclusion is broken down to sub-items can you explain “why a model with a higher overall score performs worse in our customs-declaration scenario.”
3. Building a Self-Maintained Evaluation Set
The quality of the evaluation set determines how trustworthy your selection is. Build it in these steps:
- Stratified sampling. Stratify by business line, document type, page-count range, scan quality, and language / mixed Chinese-English ratio. Guarantee a minimum sample size per stratum so high-frequency easy samples do not drown out long-tail hard cases.
- Gold answers + scoring rubric. For extraction tasks, give field-level gold answers; for open-ended tasks, give a rubric that weights “completeness, accuracy, format compliance, and no fabrication.”
- Dual annotation and consistency checks. Have key samples independently annotated by two people, measured with a consistency coefficient (such as Cohen’s Kappa); route disagreement samples to arbitration, and write arbitration conclusions back as supplementary rubric clauses.
- Difficulty tiers and variants. Derive variants of the same document such as “localization only,” “extraction only,” “cross-page aggregation,” and “with distractors” to separate capability gaps.
- Version triple binding. Dataset version, prompt version, and model version must be bound and recorded together; otherwise historical scores cannot be reproduced, and iteration becomes guesswork.
4. Sample Evaluation Pipeline Implementation
Make evaluation an automatically regressable pipeline, not a one-off script. The pseudocode below shows the basic skeleton of stratified sampling, concurrent calls, structured validation, and human-review feedback:
import asyncio, json, hashlibfrom dataclasses import dataclass, asdict@dataclassclass Case:id: strlayer: str # business line / document type / difficulty tierpages: list[str] # page image paths (object storage keys)schema: dict # expected output structuregold: dict # gold answerrubric: dict # scoring rubric for open-ended tasksasync def run_case(case: Case, model_client, cfg):prompt = render_prompt(case.pages, case.schema) # versioned promptraw = await call_with_retry(model_client, prompt,max_retries=cfg.retries,timeout=cfg.timeout)ok, parsed = validate_schema(raw, case.schema) # hard format constraintif not ok:return asdict(case) | {"result": None, "status": "schema_error"}score, reasons = score_by_fields(parsed, case.gold, case.schema)need_human = score < cfg.review_threshold or has_conflict(parsed, case.gold)return asdict(case) | {"result": parsed, "status": "need_review" if need_human else "ok","score": score, "reasons": reasons}async def evaluate(cases, model_client, cfg):sem = asyncio.Semaphore(cfg.concurrency) # control concurrency to avoid rate limitsasync def guarded(c):async with sem:return await run_case(c, model_client, cfg)return await asyncio.gather(*(guarded(c) for c in cases))def aggregate(records):agg = {} # aggregate by stratum to locate weak spotsfor r in records:b = agg.setdefault(r["layer"], {"n": 0, "sum": 0.0, "bad": 0})b["n"] += 1s = r.get("score")if s is None:b["bad"] += 1else:b["sum"] += sreturn {k: {"n": v["n"], "mean": round(v["sum"] / v["n"], 4),"schema_error_rate": round(v["bad"] / v["n"], 4)}for k, v in agg.items()}
Two engineering details are worth emphasizing: aggregate by stratum rather than looking only at the overall mean, because the overall mean gets pulled up by easy samples and masks long-tail defects; count format-validation failures separately, because a structured-output failure is equivalent to a task failure in production and should not be diluted as a low-score sample.
For numeric fields, the scoring function should introduce tolerance and normalization (removing thousands separators, units, and full-width / half-width differences); otherwise it generates a lot of “answer is right but marked wrong” noise.
5. From Offline Scores to Online Metrics
Offline evaluation is only screening; final acceptance looks at production:
| Layer | Suggested metrics |
|---|---|
| Offline quality | Field-level accuracy, table structure F1, formula fidelity, refusal accuracy, format compliance rate |
| Online performance | Task completion rate, human rework rate, downstream first-pass rate |
| Performance cost | First-token latency, per-page processing P95 latency, throughput, cost per document |
| Stability | Rate-limit trigger rate, timeout rate, cross-version score drift |
During canary release, keep the evaluation set fixed and run version-to-version regression on the same batch of samples to detect “new version improves overall but degrades a specific stratum” as quickly as possible.
6. Engineering Implementation and Cost Control
- Pre-fetch pagination and retrieval. For long documents, first do page-level localization (keywords, table of contents, structural features), then do fine-grained parsing on candidate pages; this significantly reduces wasted token consumption.
- Image cropping and resolution strategy. Document tasks are detail-sensitive; too small a resolution loses small fonts and table rules, while too large one scales latency and cost linearly, so calibrate per document type.
- Structured output + post-validation. Use output constraints to guarantee parseability, then run a second validation with business rules (required fields, enums, cross-check relationships); on failure, fall back to retry or hand off to a human.
- Quantization and precision regression. When using low-bit quantization to compress inference cost, re-run regression with the section 3 evaluation set to confirm the weak-stratum layers have not degraded.
- Supporting infrastructure. Evaluation samples and original documents are well suited to object storage; containerized deployment of inference and evaluation services makes elastic scaling easy; wire the call chain into log and monitoring/alerting services to observe failure rate, latency, and cost over the long term. On Baidu AI Cloud, this layered combination (object storage, container platform, logging service, monitoring and alerting) falls under general capability categories and can be integrated following existing architecture conventions, without building a separate platform just for evaluation.
7. Common Pitfalls
- Deciding based solely on overall public-leaderboard scores, ignoring distribution differences and confidence intervals.
- Repeatedly tuning prompts against a fixed public set, over-fitting to it and collapsing when the set changes.
- Ignoring refusal and hallucination rates, letting the model “confidently fabricate” on low-quality inputs.
- Testing only single-page documents, not cross-page and cross-section reasoning.
- Overlooking output-format stability, making the downstream parser a hidden bottleneck.
- Failing to account for cost growing linearly with page count, losing control of the budget after launch.
- Missing version binding, unable to answer “which change caused the score drop.”
8. Go-Live Checklist
- Candidate set from leaderboards + business priors, narrowed to 3–5 models
- Evaluation set with stratified sampling, dual annotation, and consistency checks completed
- Pipeline supports concurrency, retry, format validation, and human-review feedback
- Results aggregated by stratum, with clear per-stratum weak spots and acceptable thresholds
- Canary A/B completed, covering a three-way comparison of quality, latency, and cost
- Fixed regression set and version-triple records established and folded into CI
Overall, the rapid progress of open-source multimodal models in vision and document understanding has turned the question from “can we use it” into “how to select, how to evaluate, and how to operate it stably.” Treat public leaderboards as leads, the self-maintained evaluation set as the referee, and stratified aggregation plus online regression as a long-term mechanism — that is the path to turning multimodal capability into real business value.
