TL;DR
Iterative self-evolution loops in UI-to-code generation often fail because local code edits cause unintended global layout shifts—a phenomenon called visual repair coupling. To solve this, the authors introduce RubSE, a framework that structures visual feedback into distinct, prioritized rubrics and maintains an edit history. This approach stabilizes the self-correction process, prevents models from breaking already-faithful design elements, and allows stronger models to effectively guide weaker ones.
What Problem Does This Paper Address?
Large Vision-Language Models (VLMs) have gotten remarkably good at generating web code (HTML/CSS) directly from a screenshot. However, getting the details perfect usually requires a test-time refinement loop: the model generates code, renders it, critiques the mismatches against the target screenshot, and revises the code.
The core bottleneck identified by the authors is visual repair coupling. Web UI code is highly interdependent; a single CSS modification (like changing a container's padding or tweaking a flexbox property) can trigger cascading layout shifts across the entire page. In naïve self-evolution setups, a VLM attempting to fix a minor text alignment issue might inadvertently distort the page scale or break a completely unrelated sidebar.
As a result, instead of monotonically improving, standard self-correction trajectories often suffer from "trajectory collapse," where later iterations actually perform worse than the initial draft.
Methods
To constrain the scope of code edits and provide structured visual feedback, the authors propose RubSE (Rubric-guided Self-Evolution). Instead of giving the model free-form critique, RubSE breaks the feedback loop into three atomic operations:
- EVOLVE: The model analyzes the current rendering against the target and generates a candidate set of structured rubrics. Each rubric is an object containing a
title,description(what is wrong and how to fix it), and atypechosen from a five-aspect taxonomy (LAYOUT_GEOMETRY,SPACING_DENSITY,TYPOGRAPHY_TEXT,STYLING_VISUAL,COMPLETENESS). - SELECT: A separate VLM call filters the candidate rubrics and selects the single most critical, well-scoped issue to address in the next round. This prevents the code generator from attempting too many entangled changes at once.
- HISTORY: The selected rubric is appended to a persistent history list. In subsequent rounds, the
EVOLVEstep uses this history as an "avoid list" to ensure the model doesn't repeat past mistakes or get stuck in an infinite loop of oscillating edits.
The code generator is then fed the target screenshot, the previous code, the current rendering, and only the single selected rubric to perform a localized code improvement.
Datasets
The framework was evaluated on two primary UI-to-code benchmarks:
- Design2Code: A widely adopted benchmark consisting of webpages with diverse structures and layouts. The authors evaluated on both the Normal subset (484 samples) and the Hard subset (80 samples).
- UI2Code-Real: A dataset containing 115 real-world webpages collected from live, in-the-wild web sources to test the models under realistic UI complexities.
Key Insights and Ideas
- The Perils of Free-Form Feedback: Unconstrained visual critiques act as a double-edged sword. They give the model too much freedom, frequently resulting in broad code rewrites that destroy previously correct layout structures.
- Granularity Matters: Stronger frontier models (like GPT-5.4) naturally generate high-level, perceptual rubrics (focusing on page framing, structural hierarchy, and spatial relationships). In contrast, open-source models (like Qwen) tend to generate low-level, hyper-local rubrics (focusing on specific CSS properties or pixel values).
- Cross-Model Guidance Transfer: Because rubrics are structured as natural language text, they are highly transferable. High-quality rubrics generated by a frontier model can be plugged into a weaker open-source model's refinement loop, significantly boosting the weaker model's code-generation quality without any additional training.
Key Results
The authors evaluated RubSE across six different VLMs (including GPT-5.4, GPT-5.2, Claude-Sonnet-4.5, and three Qwen variants).
- Stability and Performance Boost: At the 10th refinement round, RubSE outperformed naïve self-evolution in 15 out of 18 experimental settings, yielding an average gain of +1.20 overall points (on a 0–100 scale) and +0.11 aspect-mean score (on a 1–7 Likert scale).
- Higher Ceilings: Looking at the "best-round" oracle performance, RubSE achieved higher peaks in 14 out of 18 settings, proving it expands the trajectory-level performance ceiling.
- Mitigating Collapse: RubSE successfully reduced trajectory collapse for frontier models (dropping from an average of 18.9% to 12.8%) and substantially accelerated the speed at which models recovered from severe visual regressions.
Limitations and Future Work
While RubSE shows clear advantages in stabilizing visual code generation, the authors note a few key limitations:
- No Code Correctness Guarantees: RubSE focuses entirely on visual fidelity. It does not explicitly check for code syntax or runtime errors, meaning some refinement steps can occasionally result in broken rendering. Integrating an explicit code-debugging loop is a logical next step.
- VLM Judge Variance: Evaluation relies on a VLM-as-a-judge paradigm. While it correlates well with human judgment, VLM grading can still be slightly unstable when evaluating highly subtle visual differences in later refinement rounds.
- Scope of Languages: The current evaluation is restricted to HTML/CSS webpage generation; exploring how this applies to other UI frameworks (like React, Vue, or mobile UI code) remains open for future research.
Summary updated