Benchmarking Multimodal Models for Design-to-Page Generation: Methodology, Scoring, and Evaluation

    This article presents a repeatable methodology for benchmarking how multimodal models convert design mockups into working pages. It breaks the design-to-page task into five capabilities, then shows how to control variables for a fair comparison: consistent prompts, budgets, and rendering conditions across models. It describes a generate-repair evaluation loop, a three-layer scoring system combining automated layout checks, interaction scripts, and human or vision-model review, and a weighted scorecard with hard failure rules. It also explains how to read results across four metric types (first-pass stability, repair gains, cost and latency, and the quality-cost curve) and how to integrate the evaluation into a continuous R&D workflow. You will get concrete experiment designs, detection code, a scorecard schema, and pitfalls to avoid when building your own benchmark.

    一、Introduction: Multimodal Evaluation Must Move from “Seeing” to “Doing”

    As visual understanding improves, multimodal large models can already handle tasks such as text extraction and scene description. But these capabilities stop at the level of “seeing.” Evaluation aimed at real business needs should focus on a more complete chain: understand the information hierarchy and brand character → generate a working page → detect layout defects from desktop and mobile screenshots → complete the fixes. This article breaks that chain into controllable experimental variables and quantifiable scoring metrics, so teams can continuously measure multimodal front-end generation capability as models iterate quickly.

    二、Capability Breakdown: What Design-to-Page Generation Demands of a Model

    Turning a design mockup into a usable page requires the coordination of at least five capabilities:

    1. Visual understanding and hierarchy reconstruction: Determine the primary and secondary relationships and visual weight among the main heading, supporting text, and call-to-action button.
    2. Spatial relationships and layout reconstruction: Recognize relationships such as grids, alignment, spacing, corner radii, and shadows, and choose a reasonable layout approach such as Flex or Grid.
    3. Brand character and design-token extraction: Infer the primary color, secondary colors, font-weight hierarchy, and spacing system from limited assets, and organize them into reusable style variables.
    4. Code engineering ability: Produce pages that are well structured, semantic, and maintainable, while supporting both desktop and mobile.
    5. Visual-feedback-driven self-repair: Render the page, compare screenshots, locate problems, and fix the code. This is the key incremental capability of multimodal models over text-only models.

    The first four determine first-pass quality; the fifth determines whether a model can get the result “right” within a limited budget. A sound evaluation should cover both types of capability.

    三、Experiment Design: Fair Comparison Starts with Controlled Variables

    The “real tests” commonly seen in public discussions often suffer from inconsistent variables: different task difficulty, different assets, different budgets, and different evaluation criteria, which naturally make conclusions hard to compare across models. A fair comparison requires fixing the following elements.

    3.1 Task Design: Cover Typical Scenarios with Stepped Difficulty

    Choose three complementary tasks to avoid biasing the benchmark toward any single capability:

    • Task A: Campaign landing page. A large image with overlaid text, a primary CTA, three feature cards in a column, and a footer. Emphasis on visual fidelity and layout aesthetics.
    • Task B: Information-dense form page. Includes field grouping, validation prompts, disabled states, and a submission-success response. Emphasis on detail reconstruction and interaction implementation.
    • Task C: Responsive component page. Multi-column cards must reflow into a single column on narrow screens. Emphasis on responsiveness and accessibility.

    Use the same batch of images for all tasks, with unified resolution and format, and include a brief brand brief (primary color, font style, prohibited colors). In addition, deliberately design two types of “traps”:

    • Long-text trap: One card’s heading is noticeably longer than the others, to expose overflow and truncation problems.
    • Multi-word button trap: A button’s label contains several words, to expose line wrapping and squeezing problems on mobile.

    3.2 Execution Environment: Unify Prompts, Budget, and Rendering Conditions

    • Consistent prompts: All models use the same system instructions and task description. The instructions state only product requirements, such as “must be responsive,” “use placeholder paths for images,” and “no runtime errors,” and include no repair-hint techniques.
    • Consistent budget: Set the same input and output token limits, maximum generation rounds, and total time limit. Multimodal inputs include images, so budgets should be converted using a unified scaling rule. The budget definition must be frozen before the evaluation begins.
    • Consistent rendering: Use the same browser automation framework and the same rendering engine version, with fixed viewport sizes (for example, desktop 1440×900 and mobile 390×844). Ensure required fonts are installed to avoid screenshot distortion from font fallback. When outbound network access is restricted, the page must not depend on external resources.
    • Neutral asset description: Models differ in their visual encoding ability. If a model parses a certain format poorly, the asset differences themselves introduce bias. It is recommended to verify in a pilot experiment that the assets can be parsed correctly before the formal evaluation.

    3.3 The Boundary of Fairness: Record Honestly Rather Than Force Alignment

    In practice, three conditions are hard to satisfy simultaneously: strictly identical budgets, each model’s optimal generation strategy, and fully identical feedback information.

    • A longer context may be used by a model to produce more verbose intermediate reasoning, crowding out the tokens needed for the actual deliverable.
    • A more capable model can process more complete feedback and therefore benefit more in the repair phase.

    The rigorous approach is to honestly record three parameters: “context type, budget, and feedback content.” Also report first-pass and post-repair results separately, so readers can weigh trade-offs across dimensions.

    四、Execution Flow: A Closed Loop from Generation to Repair

    Each model runs the following flow on each task:

    1. Read the unified prompt and assets, and generate the first-pass page.
    2. Place the output in an isolated rendering container, and take screenshots at both desktop and mobile viewports.
    3. Run three types of checks in sequence:
      • automated detection;
      • script tests targeting the expected interactions;
      • human or vision-model-assisted screenshot review.
    4. Pass the issue list together with the screenshots as feedback to the same model for one round of repair. The feedback describes only “the symptom and its location,” for example, “on mobile, card 2’s heading overlaps its body text,” without providing a specific fix, in order to test the model’s ability to localize from symptom to root cause.
    5. Re-run all checks on the repaired output and compute the repair gain, that is, the difference in overall score before and after repair.

    Two points deserve emphasis. First, running the same prompt 2–3 times and reporting the median reduces misjudgment caused by single-run variance. Second, repair gains must be interpreted in the context of the full budget: if the first pass consumed most of the budget, little room remains for repair, so the gain is naturally limited.

    The core flow of the evaluation framework is sketched below:

    1. from statistics import median
    2. async def evaluate(model, task, budget, harness, repeats=3):
    3. """Run repeated evaluations of one model on one task."""
    4. results = []
    5. for _ in range(repeats):
    6. budget.reset()
    7. # First-pass generation: budget limits are enforced on the model side
    8. page = await model.generate(
    9. prompt=task.prompt,
    10. materials=task.assets,
    11. max_input_tokens=budget.input_tokens,
    12. max_output_tokens=budget.output_tokens,
    13. )
    14. # Build the runnable artifact and measure it: screenshots, DOM, interaction scripts, and runtime logs
    15. first = await harness.measure(page, task.viewports)
    16. cost_1 = budget.used_tokens()
    17. report = first
    18. repair = None
    19. if not first.passed:
    20. # Feed a symptom-level issue list and screenshots back to the model to locate and fix
    21. feedback = build_feedback(report) # [{view, selector, symptom}, ...]
    22. if budget.remaining_output_tokens() > 0:
    23. page = await model.repair(page, feedback,
    24. max_output_tokens=budget.remaining_output_tokens())
    25. second = await harness.measure(page, task.viewports)
    26. repair = {
    27. "score": second.score,
    28. "passed": second.passed,
    29. "new_issues": second.new_issues, # whether regressions were introduced
    30. }
    31. cost_1 += budget.used_tokens() - cost_1
    32. report = second
    33. results.append({
    34. "first_score": first.score,
    35. "repair": repair,
    36. "cost": cost_1,
    37. "latency": budget.elapsed_seconds(),
    38. "checks": report.checks, # per-check details, for root-cause attribution
    39. })
    40. return summarize(results) # report the median and the variance range

    五、Scoring System: Cross-Validation across Automated Detection, Interaction Tests, and Human Review

    5.1 Automated Detection: Covering “Mechanical” Defects

    Automated detection is low-cost and repeatable, and is well suited to problems that can be judged objectively:

    • Overflow and out-of-bounds: Element content overflows its container, or the page shows unexpected horizontal scrolling.
    • Clipping: Element boundaries extend beyond the visible area and cannot be viewed by scrolling.
    • Overlap and occlusion: Text, images, and buttons overlap or block each other.
    • Interaction breakpoints: A control’s position or size jumps abnormally across viewports.
    • Basic accessibility: Missing semantic structure, images without alt text, insufficient contrast.

    The following code can be plugged directly into the evaluation framework as a detection item:

    1. function detectLayoutIssues(viewportWidth) {
    2. const issues = [];
    3. const nodes = document.querySelectorAll('body *');
    4. for (const el of nodes) {
    5. const r = el.getBoundingClientRect();
    6. const s = getComputedStyle(el);
    7. // Content overflow: text node content width/height exceeds its own box
    8. const clipsX = r.width > 0 && el.scrollWidth > el.clientWidth + 1;
    9. const clipsY = r.height > 0 && el.scrollHeight > el.clientHeight + 1;
    10. if (s.overflow !== 'visible' && (clipsX || clipsY)) {
    11. issues.push({ selector: describe(el), type: 'clipped' });
    12. }
    13. // Out of bounds: right/left edge extends beyond the current viewport
    14. if (r.width > 0 && (r.right > viewportWidth + 1 || r.left < -1)) {
    15. issues.push({ selector: describe(el), type: 'out_of_viewport' });
    16. }
    17. }
    18. // Page-level horizontal scroll
    19. const hScroll = document.documentElement.scrollWidth > viewportWidth + 1;
    20. return { hScroll, issues };
    21. }

    5.2 Interaction Scripts: Verifying “Real Behavior”

    Automated detection focuses on static layout; interaction scripts focus on dynamic behavior. For example, simulate a form submission: submission should be blocked with a prompt when a required field is empty, and a success response should appear after valid values are entered. The scripts must also capture page errors, because many defects surface only after a click or input.

    5.3 Human and Vision-Model-Assisted Review: Judging “Design Quality”

    Visual similarity metrics (such as the structural similarity index, SSIM) suit regression comparison between different versions of the same model, but are not enough to measure design quality. Differences in font rendering, anti-aliasing, and sub-pixel spacing all lower similarity, and qualities like “aesthetic appeal” and “clear hierarchy” cannot be measured by pixel differences either. Therefore, it is recommended that two reviewers independently and blindly rate each result along the following dimensions:

    • Visual fidelity: Whether color scheme, font hierarchy, spacing, and alignment match the mockup.
    • Information hierarchy: Whether primary and secondary elements are distinct and whether the visual focus falls where expected.
    • Brand character: Whether the color usage, font style, and component shapes are consistent with the brand brief.
    • Interaction reasonableness: Whether clickable elements provide clear feedback and whether state transitions behave as expected.
    • Code quality: Whether the structure is clear, whether styles are reused, and whether there is obvious redundancy.

    When two reviewers differ substantially on the same result, bring in a third reviewer to arbitrate. For large datasets, a multimodal model can first screen by the same scorecard, after which humans review disputed samples, to improve review efficiency.

    5.4 Scorecard: Replacing Vague Impressions with Structured Rules

    Dimension Weight Method Notes
    Layout fidelity 25% Automated + human Consistency of grid, spacing, and alignment with the mockup
    Style and brand consistency 20% Human Color scheme, font hierarchy, corner radius and shadows, reuse of design tokens
    Interaction and states 15% Automated + human Click, input, disabled states, success/failure feedback
    Code quality 15% Human + static checks Semantic structure, style organization, maintainability
    Responsive and accessibility 15% Automated Reflow across viewports, alt text, contrast
    Efficiency 10% Automated Overall cost and latency

    The rules are as follows:

    • Score each dimension from 0 to 2, with explicit scoring guidance.
    • If automated detection finds overflow, clipping, or overlap on an element that contains key text or a primary action entry point, the task is judged as failing, and this cannot be waived even if other dimensions score highly.
    • Overall score = Σ(dimension score / 2 × dimension weight).

    A sample scorecard:

    1. {
    2. "version": "1.0",
    3. "dimensions": [
    4. {"id": "layout", "label": "Layout fidelity", "weight": 0.25},
    5. {"id": "brand", "label": "Style and brand consistency", "weight": 0.20},
    6. {"id": "interaction", "label": "Interaction and states", "weight": 0.15},
    7. {"id": "code_quality", "label": "Code quality", "weight": 0.15},
    8. {"id": "responsive", "label": "Responsive and accessibility", "weight": 0.15},
    9. {"id": "efficiency", "label": "Efficiency", "weight": 0.10}
    10. ],
    11. "scale": {"min": 0, "max": 2, "labels": ["Fails", "Marginal", "Passes"]},
    12. "hard_rules": [
    13. "Key text is clipped -> fail",
    14. "Unexpected horizontal scroll exists -> responsive dimension scores 0",
    15. "A page runtime error exists -> interaction dimension scores 0"
    16. ]
    17. }

    六、Interpreting Results: All Four Metric Types Matter

    In this kind of controlled experiment, evaluators commonly observe the following typical patterns. They confirm how a ranking based on a single metric can be misread:

    • First-pass stability: Some models pass on the first pass, while others show obvious layout defects on the first pass and reach parity only after repair. Reporting only the final score masks this difference.
    • Repair gains: Large repair gains indicate strong self-correction, but one must check whether new problems are introduced at the same time. If a single repair causes a regression, the net gain may be negative.
    • Cost and latency: Cost is determined jointly by input tokens, output tokens, and image usage. The input of visual tasks contains images, which cost far more than the same word count of plain text, so image overhead must be included when assessing cost.
    • Quality-cost curve: Cost gaps can far exceed intuition. In model selection, focus on “the minimum cost needed to reach business-acceptable quality,” not the absolute lowest price.

    Accordingly, model selection can be layered by scenario:

    • High-fidelity marketing pages: High demands on visual hierarchy; prioritize models with high first-pass fidelity.
    • Forms and back-office pages: Details and interactions come first; a model with a complete repair loop and stable repair gains is more suitable.
    • High-volume lightweight pages: Focus on unit output cost and latency, and accept a quality approach of automated detection plus human spot checks.

    If an experiment finds that a model can use visual feedback to complete effective repairs, this ability signal is itself worth recording as a key finding.

    七、Common Pitfalls and How to Avoid Them

    1. Too few tasks: Three tasks reflect only trends. It is recommended to expand to 20–50 tasks and cover different industries and styles.
    2. Data leakage: Public assets may have been seen by models during pre-training. It is recommended to prepare internal assets or to periodically rotate the evaluation set.
    3. Rendering-environment differences: Missing fonts and inconsistent viewports can distort screenshots, so use a container environment with a fixed image.
    4. Missing evaluation dimensions: Three additional records are needed, or the conclusions tend to “look lively”:
      • User value: conversion-oriented tasks should track the visual prominence of the primary CTA;
      • Maintainability: such as style-variable reuse rate and single-file line count;
      • Reproducibility: fix the model version, prompt version, and random seed, and save the raw outputs.
    5. Misleading leaderboards: Ranking tables spread as images go stale easily. An evaluation report should include complete environment information and sample size.

    八、Engineering the Rollout: Plugging the Evaluation into the R&D Process

    A single experiment can answer “which one is better,” but cannot answer “did performance regress after an upgrade.” A more sustainable approach is to institutionalize the evaluation into a process:

    1. Freeze the evaluation set and scorecard: Put them under version control, and record change notes for every change.
    2. Integrate with continuous integration: After a model upgrade, prompt adjustment, or template change, run an automatic regression with a defined pass threshold, and block the release if it is not met.
    3. Layered spot checks: Automated detection covers all outputs, human review samples by ratio, and disputed samples are fully rechecked.
    4. Full-chain logging: Completely preserve the screenshots, DOM snapshots, runtime logs, and repair records for each generation, to support problem tracing.
    5. Cost and quality dashboards: Track unit output cost, average latency, and automated detection pass rate, to provide a basis for model routing.

    As an example, this evaluation system can be carried by general-purpose cloud product capabilities, using Baidu AI Cloud as a reference: the rendering environment is delivered uniformly through container services, page outputs and screenshots are stored in object storage, raw logs and metrics are connected to log services and monitoring/alerting, and batch screenshot and scoring jobs are smoothed and decoupled through a message queue. Multimodal model capability can be represented by ERNIE and plugged into the evaluation set for horizontal comparison under a unified standard and continuous tracking, avoiding being misled by a single demo.

    九、Conclusion

    As multimodal models move from “seeing” to “doing,” what we measure is no longer just recognition accuracy, but the combined capability of understanding hierarchy, reproducing brand, writing code, and self-repair. The basis of a fair comparison is controlling variables, layered scoring, and honestly disclosing the boundaries. As multimodal capabilities like ERNIE continue to evolve, building a reproducible, continuously regression-testable evaluation benchmark will help teams choose the model that truly fits their business scenarios in a fast-iterating landscape.