Manuscript Offprint

arXiv:2610.34418

MulFCoder: Framework-conditioned Multi-agent for MLLM-based Multi-framework Front-end Code Generation

Jie Wu, Haoran Ma, Shisong Tang, Yulin Xu, Xiaoyu Kang, Jiechao Gao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Generating runnable front-end code from UI screenshots is a long-standing goal in automated software engineering. Existing MLLM-based methods predominantly focused on HTML/CSS, leaving multi-framework generation for React/Vue/Angular underexplored. Naively modifying prompts leads to substantial performance gaps across multi-framework and highly framework-specific error modes. To address this, we propose MulFCoder, a framework-conditioned multi-agent method that explicitly encodes framework constraints to bring multi-framework differences into a decidable rule space. MulFCoder orchestrates four agents: Grounder constructs an ElementTable, ContentTable, and macro-layout regions from detected UI elements; Planner builds a DOM-like hierarchical layout tree, produces a task schedule, and derives a framework-specific file Contract; Writer generates structured file writes or patches within a restricted edit window; Judger enforces lightweight, framework-conditioned constraints to accept or reject updates and trigger bounded repairs, preventing drift and deadlocks without expensive builds. Experiments demonstrate that MulFCoder substantially improves compilation success rate and reduces framework-specific errors, with particularly pronounced gains on Angular.

1. Introduction

Generating runnable front-end code from UI screenshots is a long-standing goal in automated software engineering. It

∗^{*}Equal contribution †^{\dagger}Corresponding author. 1^{1}Communication University of China 2^{2}Harvard University 3^{3}Tsinghua university 4^{4}University of Southern California 5^{5}Chinese Academy of Sciences 6^{6}Stanford University. Correspondence to: Jiechao Gao jiechao@stanford.edu.

Proceedings of the 43rd43^{rd} International Conference on Machine Learning, Seoul, South Korea. PMLR 306, 2026. Copyright 2026 by the author(s).

can lower the barrier of implementation and improve development efficiency and delivery quality (Fan et al., 2023). Traditional front-end code generation methods utilize deep learning and computer vision techniques to extract structured information for generating HTML/CSS code (Chen et al., 2024a;c; 2023).

With multimodal large language models (MLLMs), UI-to-code is moving from element extraction pipelines toward directly synthesizing executable code from pixels by combining visual understanding with code generation capability. Yet, straightforward prompting remains unreliable because UI synthesis requires precise grounding and layout and style preservation, leading to omissions, distortions, and misarrangements in generated outputs (Wan et al., 2025). To narrow this gap, researchers scale screenshot-code data and evaluation via large synthetic and real datasets and visual-fidelity benchmarks (Laurençon et al., 2024; Si et al., 2025), and adopt structure- and layout-aware and agentic workflows that decompose planning and generation to better retain hierarchy and alignment (Gui et al., 2025b; Jiang et al., 2025). Emerging work further targets executability and fidelity through post-training (e.g., visual reinforcement learning) (Zhao et al., 2025) and extends beyond page-level HTML toward finer UI components with task-specific representations (Zhang et al., 2025).

However, current MLLM-based methods are mainly focused on HTML/CSS generation, and lack systematic study and unified modeling for multi-framework generation in mainstream engineering frameworks such as React/Vue/Angular. A straightforward idea is to switch the generation target to different frameworks only by modifying the prompt (Li et al., 2025), but such “prompt transfer” often leads to substantial performance drops: compilation success varies greatly across frameworks, accompanied by highly framework-specific error modes. (Sendyka et al., 2025) The root cause is that multi-framework differences are not merely syntactic sugar replacement, but joint changes in language rules, component boundary conventions, and project scaffolding constraints (Xing et al., 2025); without explicitly modeling these constraints, the model is prone to drift during long-horizon generation, and errors are difficult to localize and fix reliably. Ultimately, this results in many invalid attempts and manual rework in real production, off-

MulFCoder: Framework-conditioned Multi-agent for MLLM-based Multi-framework Front-end Code Generation

Figure

(a) Compilation Success Rate.

Figure

(b) Compilation Error Distribution.

Figure

(c) Core idea of MulFCoder.

Figure 1. (a) On Design2Code dataset, five LLMs that generate code by directly rewriting prompts exhibit a substantial gap in compilation success rate (CSR) across frameworks, indicating that multi-framework discrepancies cannot be addressed by prompt changes alone and are instead driven by framework specific syntax and engineering constraints; (b) under the same setup, the Top-3 compilation error distributions of the five LLMs across three frameworks show clear framework specific error patterns; (c) an overview of the MulFCoder.

setting the efficiency gains brought by automation.

To address these issues, we propose MulFCoder, a framework-conditioned multi-agent method that explicitly encodes framework constraints to “collapse” multi-framework differences into a decidable and executable rule space, thereby improving cross-framework consistency and executability. The core intuition is to decompose UI→Code from one-shot long-text generation into a collaborative process with clear role specialization and stepwise verification, and to drive generation and repair with framework-conditioned hard constraints. Firstly, the Grounder starts from detected UI elements to construct an ElementTable, a ContentTable, and macro-layout regions, so that content binding and the spatial skeleton are fixed early. Secondly, the Planner organizes element relations within each macro region to build a DOM-like hierarchical layout tree, outputs a file-level task schedule, and derives a framework-specific file Contract to restrict the editable window. Finally, the Writer produces structured file writes or patches within the restricted window, while the Judger applies lightweight, framework-conditioned FastGate rules to accept or reject updates and triggers bounded repairs to prevent drift and deadlocks. Because constraints are made explicit and embedded into the collaborative loop, MulFCoder can consistently suppress framework-specific errors and improve multi-framework executability without relying on expensive builds.

To sum up, our contributions are as follows:

• We introduce and systematically study the problem of multi-framework generation for MLLM-based front-end code, and reveal the compilation discontinuities and highly framework-specific error modes induced by prompt-only transfer.

• We propose MulFCoder, a framework-conditioned multi-agent method that uses a modular Grounder, Planner, Writer, and Judger decomposition and a file-level contract to bring framework differences into a decidable rule space.

• We conduct comprehensive experiments on multi-framework benchmarks, demonstrating substantial improvements in compilation success, and we release the code to facilitate future research.

References (54)