Multimodal Model Selection: A Reproducible Evaluation Guide for Three Task Types

    Build a repeatable process for comparing multimodal models on quality, output consistency, latency, and cost. This guide defines evaluation metrics for UI reconstruction, receipt extraction, and academic chart analysis, then provides a prompt template, validation steps, and failure criteria for screenshot-to-HTML tasks.

    1. Why You Need a Repeatable Model Selection Process

    Many workflows depend on cloud-hosted multimodal models to read long documents, interpret screenshots, and analyze charts. Free quotas, usage limits, and available model lists can change. When a model’s quota is reduced, batch jobs, automation scripts, and internal tools may all be affected. Without a tested alternative, teams must switch under pressure, often resulting in inconsistent quality and unpredictable costs.

    A reproducible evaluation process helps teams prepare for these changes. Compare models using identical inputs, measuring output quality, structural consistency, latency, and per-request cost. Use the results to select both a primary model and a fallback.

    Before switching models, check two categories of risk:

    • Output changes. The same prompt may produce different fields, formats, or judgments on a new model. Downstream parsing code must be able to detect these differences.
    • Data security. Receipts, handwritten documents, and screenshots may contain personal information or confidential business data. Before changing providers, verify data retention periods, whether submitted data is used for model training, and whether data is encrypted in transit. Do not send materials containing unredacted sensitive information to external APIs.

    2. Define the Test Set, Scoring Rules, and Acceptance Thresholds

    Evaluation results are useful only when the test conditions are clear. Establish the following six items before testing.

    1. Test set size. Use at least 50 samples per task type. Include both common inputs and edge cases, such as blurry screenshots, receipts photographed at an angle, and tables with missing fields.
    2. Models and parameters. Record the model name, version, request timestamp, and parameters such as temperature and maximum output length. Set temperature to 0 or a low value to reduce random variation.
    3. Prompt versions. Version every prompt. After changing a prompt, rerun the entire test set.
    4. Scoring rules. Define how each metric is scored. For field correctness, for example, specify date formats, monetary precision, and how null values are handled.
    5. Acceptance thresholds. Set pass/fail criteria before testing. For example, a model whose field accuracy or format validity falls below a specified threshold should not qualify as the primary model. Teams should set thresholds according to business risk; there is no universal threshold prescribed here.
    6. Cost and latency. Record input tokens, output tokens, elapsed time, and cost for every sample. Report P50 and P95 latency rather than relying only on averages. Calculate per-request cost as:

      Request cost = (input tokens × input unit price) + (output tokens × output unit price)

      Ensure token counts and pricing units are consistent.

    Define the metrics before reviewing outputs. Choosing criteria after seeing the results makes it easy to treat “looks good” as evidence and undermines consistent judgment.

    The following table defines metrics for three task types.

    Task Metric Calculation
    UI reconstruction Run success rate Number of pages that load at both 375px and 1280px viewport widths without console errors or uncaught exceptions / total pages
    UI reconstruction Structural similarity 1 − (tag-sequence edit distance / length of the longer sequence). Each sequence consists of tag names in their order of appearance in the page DOM.
    UI reconstruction Human review score Two reviewers independently score each result from 1 to 5; take the average. If their scores differ by 2 or more, they review the result together.
    Receipt extraction Field accuracy Number of fields that exactly match the ground truth after normalization / total fields expected to be extracted
    Receipt extraction Format validity Number of outputs that pass JSON Schema validation / total outputs
    Receipt extraction Normalized edit distance Levenshtein distance between a predicted text field and its reference / character count of the longer string. Lower is better.
    Academic chart analysis Factual accuracy Number of atomic statements consistent with the source chart / total statements. Unverifiable statements count in the denominator but not the numerator.
    Academic chart analysis Conclusion traceability Number of conclusions linked to a specific location or data point in the chart / total conclusions

    3. UI Reconstruction

    3.1 Prompt Template

    A UI reconstruction prompt should clearly specify the role, task, constraints, and expected output. Adapt the following template as needed.

    1. Role: Senior frontend engineer
    2. Task: Reconstruct the screenshot as a single HTML file with CSS.
    3. Constraints:
    4. 1. Use semantic tags such as header, main, and article. Avoid unnecessary nested div elements.
    5. 2. Estimate colors, font sizes, and spacing from the screenshot. Explain the basis for these estimates in CSS comments.
    6. 3. Use placeholders for image areas, with alt descriptions.
    7. 4. Do not include external frameworks or remote fonts.
    8. 5. The page must not have horizontal scrollbars at viewport widths of 375px or 1280px.
    9. Output: Complete code, with no sections omitted.

    3.2 Validation Steps

    1. Check output completeness. The code should end with </html>. Otherwise, mark it as truncated.
    2. Render at both viewport widths. Check whether document.documentElement.scrollWidth exceeds document.documentElement.clientWidth. If it does, mark the page as having horizontal overflow.
    3. Inspect the markup. Measure div nesting depth and check for semantic tags such as header, main, and article.
    4. Check runtime errors. Open the page and record console errors.

    3.3 Failure Examples

    • Truncated output: Generation stops partway through the CSS, leaving closing tags missing. Count the page as non-runnable.
    • Constraint violation: The output includes a remote font link, violating constraint 4.
    • Horizontal overflow: At a 1280px viewport width, the page exceeds the viewport and produces a horizontal scrollbar.

    3.4 What to Record

    Screenshot resolution directly affects how accurately colors and spacing can be reproduced, so record it as an evaluation variable. Also record the browser and its version.