Abstract
Generative AI has made rapid advancements in recent years, achieving unprecedented capabilities in multimodal understanding and code generation. This can enable a new paradigm of front-end development in which multimodal large language models (MLLMs) directly convert visual designs into code implementations. In this work, we construct Design2Code – the first real-world benchmark for this task. Specifically, we manually curate 484 diverse real-world webpages as test cases and develop a set of automatic evaluation metrics to assess how well current multimodal LLMs can generate the code implementations that directly render into the given reference webpages, given the screenshots as input. We also complement automatic metrics with comprehensive human evaluations to validate the performance ranking. To rigorously benchmark MLLMs, we test various multimodal prompting methods on frontier models such as GPT-4o, GPT-4V, Gemini, and Claude. Our fine-grained break-down metrics indicate that models mostly lag in recalling visual elements from the input webpages and generating correct layout designs.
Introduction
For years, the "holy grail" of front-end engineering has been the ability to turn a visual mockup into working code automatically. While significant progress has been made in generating code from text instructions, generating code from a User Interface (UI) design is a much more complex challenge. It requires a model to simultaneously understand visual hierarchy, extract text, identify colors, and map these components into a structured code implementation.
Previous attempts at this task often relied on synthetic "toy" datasets that failed to reflect the messy, complex reality of the modern web. The Design2Code benchmark addresses this gap by providing the first comprehensive, real-world evaluation suite designed to test how well Multimodal Large Language Models (MLLMs) can convert a website screenshot into functional HTML/CSS code.
The Design2Code Benchmark
The researchers constructed a rigorous evaluation ecosystem consisting of curated datasets and novel metrics:
- Design2Code Dataset: A curated set of 484 high-quality, real-world webpages scraped from the C4 validation set. These were manually filtered to ensure they were diverse, well-formatted, and "stand-alone" (no external dependencies).
- Design2Code-HARD: A subset of 80 extremely challenging cases featuring very long pages, complex layouts, or non-English content.
- Prompting Strategies: The study tested Direct Prompting, Text-Augmented Prompting (providing extracted text to reduce OCR burden), and Self-Revision (asking the model to fix its own errors).
To evaluate performance, the authors developed a suite of visual-first automatic metrics, including Block-Match (measuring visual element recall), Position/Color/Text Similarity, and CLIP Similarity for high-level visual alignment. These were complemented by pairwise human evaluations involving 60 annotators.
Key Results and Insights
The benchmark revealed a significant performance gap between commercial frontier models and open-source alternatives:
- GPT-4o Dominance: GPT-4o is the current state-of-the-art, leading across almost all dimensions with a 93.0 Block-Match score. Humans found that 49% of webpages generated by GPT-4V (with self-revision) were "exchangeable" with the original reference.
- The "Clean-Up" Effect: In a surprising finding, human evaluators preferred AI-generated versions over the original webpage in 64% of cases. MLLMs, likely influenced by their training data, often modernized or "fixed" older, clunkier real-world designs.
- The Open-Source Gap: Even after fine-tuning on synthetic data (WebSight), open-source models like Design2Code-18B struggle to match the zero-shot performance of commercial giants.
- Visual Recall Challenges: Automatic metrics highlighted that models fail most frequently at "recalling" all visual elements. On the
Design2Code-HARDset, GPT-4o's Block-Match score dropped from 93.0 to 56.6, indicating that professional-grade complex engineering remains a major hurdle.
Conclusion and Future Work
While top-tier models show impressive capabilities, the Design2Code benchmark highlights several frontiers yet to be crossed. Current evaluations focus on static visual reproduction; future work must address dynamic functionality (interactive buttons) and responsiveness across different screen sizes. Additionally, moving beyond screenshots to include source design files (like Figma or Sketch) and improving data cleaning pipelines for open-source training will be essential for the next generation of automated front-end engineering tools.
Summary updated