Evaluating Multimodal Models for UI Design: Fair Benchmarks and Engineering Practice

    Multimodal models can now generate functional web pages, but measuring their design ability fairly is harder than it looks. This article explains how to build a controlled evaluation pipeline covering input understanding, design generation, implementation, and visual acceptance. It includes a reproducible evaluation configuration, two representative task types, a breakdown of assessment dimensions such as information hierarchy and responsive layout, ready-to-use scripts for automated layout checks and state restoration, and practical repair strategies for common failure modes. By the end, you will have a workflow you can turn into an internal benchmark for comparing models on first-pass success rate, repair rounds, and cost.

    From “Seeing” to “Designing”

    Image recognition only tells you a model can extract text, objects, and colors from a picture. Interface design demands more. A designer must decide which information should be seen first, understand the spatial relationships between modules, and judge whether the overall visual style fits the product’s positioning. Then these decisions must be translated into runnable page code and iteratively corrected based on how the page renders on desktop and mobile.

    Evaluating a multimodal model’s design ability should therefore cover four stages: understanding the input, generating a design, implementing it, and visual acceptance. Judging only whether the final screenshot looks good cannot tell you whether the model truly understood the requirements.

    The Prerequisite for Fair Comparison: Controlled Variables

    The most common problem when comparing multiple models side by side is inconsistent conditions. If one group of models receives complete assets while another receives only summaries, the results are no longer comparable. Four items should be fixed in every evaluation:

    • Uniform inputs: the same requirement document, the same set of assets, the same reference images.
    • Uniform tooling: the same version of the code generation environment, the same headless browser inspection flow, the same screenshot resolution.
    • Uniform rules: the same number of allowed repair rounds per task, and the same format for repair instructions.
    • Uniform logging: record whether the first version passed, the number of repair rounds, wall time, and API cost.

    Here is an example evaluation configuration:

    1. task_id: data-narrative-01
    2. inputs:
    3. brief: brief.md
    4. assets: assets/ # shared by all participants
    5. toolchain: codegen-env@1.0.0 # pin the version to avoid environment drift
    6. viewports:
    7. - { name: desktop, width: 1440, height: 900 }
    8. - { name: mobile, width: 390, height: 844 }
    9. max_repair_rounds: 1
    10. metrics: [first_pass_ok, repair_rounds, wall_time, cost]

    Pinning version numbers ensures that changes in evaluation results can be attributed to the model itself, not to tool upgrades or environment differences.

    Two Representative Task Types

    Tasks should cover two kinds of ability.

    The first is original visuals and data storytelling. These tasks test how well a model handles information hierarchy, pacing, and atmosphere. For example, a scroll-driven themed showcase page containing multi-year time-series data, a world map, and several illustrations. Users understand trends by scrolling, and clicking a map region switches the page to that region’s data. The model must create visual impact within a limited above-the-fold area while keeping the data clearly explained.

    The second is real product interaction. These tasks test whether a model can turn reference designs into working features. For example, an audio browsing app that supports selecting points on a map, playback controls, switching tracks, favoriting and favorites collections, and restoring state after a page refresh. The difficulty here lies in state management and edge cases; visual polish is secondary.

    Breaking Down the Evaluation Dimensions

    1. Information Hierarchy

    The first screen should convey the most important information. The test is simple: with decorative elements removed, can an observer state the page’s topic within a few seconds? If the title, charts, and captions compete for the same level of visual weight, the hierarchy fails.

    2. Spatial Relationships and Responsive Layout

    The same design can look very different on desktop versus mobile. Check whether:

    • core areas such as the map retain enough height on mobile;
    • key controls sit within tappable range with adequate touch spacing;
    • long text wraps correctly or is truncated in a sensible way.

    3. Style Consistency

    Brand character shows up in details like font size ratios, whitespace, color saturation, and corner radii. When evaluating, compare against the reference images: first list the palette, type scale, and spacing rules, then check the generated result item by item.

    4. Interaction Correctness

    Interactive tasks need to be verified point by point. Common checkpoints include:

    • playback state staying in sync with the button icon;
    • the play queue updating correctly after switching tracks;
    • favorites and the currently selected item being restored after a page refresh.

    5. Visual Acceptance Loop

    Automated screenshots are an effective way to surface layout defects. Common issues include horizontal overflow, text truncation, and collapsed regions caused by containers with zero height.

    Basic Visual Acceptance with a Script

    Automated checks cannot replace human review, but they quickly catch obvious problems. The following script runs after the page has rendered and detects horizontal overflow, collapsed key regions, and text truncation:

    1. // Run after the page has rendered; returns a list of issues
    2. function checkLayout(viewportName) {
    3. const issues = [];
    4. const root = document.documentElement;
    5. // Horizontal overflow: content width exceeds viewport width
    6. if (root.scrollWidth > root.clientWidth) {
    7. issues.push(`${viewportName}: page has horizontal overflow`);
    8. }
    9. // Region collapse: the agreed core region is too short
    10. const map = document.querySelector('[data-role="map"]');
    11. if (map && map.getBoundingClientRect().height < 200) {
    12. issues.push(`${viewportName}: map region height is abnormal`);
    13. }
    14. // Text truncation: content overflows its own container
    15. document.querySelectorAll('[data-check="text"]').forEach((el) => {
    16. if (el.scrollHeight > el.clientHeight + 1) {
    17. issues.push(`${viewportName}: text truncated -> ${el.textContent.trim().slice(0, 20)}`);
    18. }
    19. });
    20. return issues;
    21. }

    Two things to keep in mind when using this kind of check. First, attributes such as data-role and data-check must be specified in the requirement document so the model follows them when generating code; otherwise the script cannot locate elements. Second, passing these checks only means there are no obvious structural problems — visual quality still requires human judgment.

    Key Points for State Restoration

    Restoring state after a refresh is the most error-prone part of interactive tasks. Here is an example based on local storage:

    1. const STORAGE_KEY = "player-state-v1";
    2. const DEFAULT_STATE = { currentTrackId: null, favorites: [] };
    3. function saveState(state) {
    4. localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
    5. }
    6. function loadState() {
    7. try {
    8. const raw = localStorage.getItem(STORAGE_KEY);
    9. if (!raw) return { ...DEFAULT_STATE };
    10. return { ...DEFAULT_STATE, ...JSON.parse(raw) };
    11. } catch (err) {
    12. // Fall back to defaults if data is corrupted, avoiding a blank page
    13. return { ...DEFAULT_STATE };
    14. }
    15. }

    This code illustrates three engineering points: key names carry a version number, making migration easier when the structure changes; reads merge with defaults for backward compatibility with older data; and parse failures fall back gracefully, keeping the page usable. Evaluations should explicitly check whether the model handled these edge cases.

    Common Problems and Repair Strategies

    Collapsed map on the first version. This usually happens when the parent container has no explicit height, or flex children lack a minimum height constraint. Fix it by setting an aspect ratio or a minimum height on the map container, and verify that its parent layout allows children to expand.

    Disconnected pacing between the hero section and scroll sections. Insufficient spacing between sections or poorly chosen split-screen breakpoints make a page feel cramped or loose. Fix by dividing content into sections based on viewport height and unifying section spacing.

    Limited repair rounds. When only one repair round is allowed, prioritize blocking issues first — failed functionality, invisible core regions, or pages that cannot scroll. Visual detail issues can be recorded separately in the evaluation report without counting toward the repair goal.

    Conclusion and Practical Recommendations

    Evaluating design generation ability requires examining three phases together: understanding, implementation, and acceptance. Fair comparison depends on uniform inputs, tools, repair rules, and logging. Automated checks can catch obvious defects like layout overflow, collapsed regions, and text truncation, while interaction correctness requires dedicated test cases around state management.

    Teams can turn this workflow into an internal benchmark suite and re-run it whenever they change models or upgrade the toolchain, comparing changes in first-pass success rate, repair rounds, and per-run cost. The goal of evaluation is to pick the right solution for your specific business scenario — not to produce a ranking that applies to every scenario.