# Toward Executable Multi-framework Front-end Code Generation with Self-Correction

*Linxiao Li, Haoran Ma, Chenyue Wang, Jiaye Lin, Haochen Sui, Jiechao Gao*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/153939) · [OpenReview](https://openreview.net/forum?id=HRgXvqgzeg) · [Open on the map](../papers.html#p153939)

Category: [LLM Agents, Evals & Benchmarks](../pcat/17.md) › [Multi-Framework UI Code Generation](../pgroup/54.md) · Type: new method · Keywords: executable code generation, multi-framework front-end, self-correction, UI screenshot, reinforcement learning

Areas: [Code & Coding Agents](../areas/codegen.md) › Code Generation and Optimization › Code Generation

## Summary
MESCoder is a tree-structured self-corrective generation framework that improves executable multi-framework front-end code generation from UI screenshots by modeling executability as a conditioned project state transition process.

## Explained to a 5-year-old
We look at pictures of computer screens that show what a website should look like. We want to turn those pictures into real code that works on different website tools like React or Vue. A special program watches the code being made and fixes mistakes as it goes. It builds the code piece by piece, making sure all parts fit together. This helps people make working websites faster without having to write all the code by hand.

## Explained to a 5-year-old, longer
Imagine you have a picture of a website you like, like a colorful game or an app. You want to make that picture become a real website that you can click on. Usually, making a website means writing lots of tiny instructions called code. Doing that by hand is hard and can take a long time. Some smart computers can look at pictures and guess what code might be needed. But they often make mistakes because different websites use different rules. The new idea is like a helpful robot that watches the code being written. It checks the code against what the picture shows and fixes errors right away. The robot builds the code like building blocks, starting with the big structure. Then it adds smaller pieces for buttons, menus, and pictures. If something doesn't work, the robot can either fix just that part or redo a bigger section. In the end, you get a working website that looks just like the picture, without typing everything yourself.

## For a technical reader
The paper tackles the difficulty of generating runnable front-end code for multiple frameworks (React, Vue, Angular) directly from UI screenshots, which is harder than HTML-only generation because of syntax differences and consistency requirements. It proposes a tree-structured self-correction framework that first extracts a structural scaffold from the image, then builds sub-trees and assembly relations step by step, turning large project generation into localized decisions. A unified Project Agent continuously revises the partial project using runtime sandbox feedback, choosing between local repairs and cluster-level repairs to maintain executability. Training uses a two-stage strategy: an offline initialization to learn basic generation and repair priors, followed by online reinforcement learning to optimize long-horizon executability and final page quality. Experiments demonstrate that the approach improves code executability and narrows the visual-fidelity gap compared to existing HTML-focused methods.

## Problem
Generating executable front-end code for multiple frameworks such as React, Vue, and Angular from UI screenshots is challenging due to framework-specific syntax differences, compilation issues, and the need for global consistency across files. Existing methods focused on HTML do not transfer well to multi-framework settings.

## Method
The approach extracts a structural scaffold from the screenshot, builds sub-trees and assembly relations step by step, and uses a unified Project Agent that iteratively revises the partial project under runtime sandbox feedback, choosing between local and cluster-level repairs. A two-stage training strategy first initializes the policy offline to learn basic generation and repair priors, then refines it with online reinforcement learning to optimize long-horizon executability and final page quality.

## Results
The approach improves executability and reduces the visual-fidelity gap compared to HTML-based generation.

## Contributions
The paper introduces a tree-structured self-corrective generation framework that models multi-framework executability as a conditioned project state transition process, a unified Project Agent for iterative repair, and a two-stage training strategy combining offline initialization with online reinforcement learning.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/153939)
