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

Generating runnable front-end code directly from UI screenshots is a long-standing ambition in automated software engineering. While Multimodal Large Language Models (MLLMs) like GPT-4o and Gemini have shown remarkable proficiency in generating basic HTML and CSS, they frequently stumble when tasked with writing code for modern, component-based frameworks like React, Vue, and Angular.

To bridge this gap, researchers have introduced MulFCoder, a framework-conditioned multi-agent system designed to translate UI screenshots into robust, runnable code across multiple modern web frameworks. By replacing implicit prompting with explicit, decidable rules, MulFCoder significantly boosts compilation success rates and reduces framework-specific errors.

The "Prompt Transfer" Problem

The core issue with current MLLM-based code generation is what the authors term the "prompt transfer" problem. Simply instructing an LLM to "write this in Angular" instead of HTML leads to a massive spike in compilation errors.

Modern frameworks enforce strict engineering constraints regarding component boundaries, dependency injections, and specific syntax. During long coding tasks, LLMs tend to "drift" away from these constraints. The result is code that visually resembles the target framework but fails to compile or run because it violates underlying structural rules.

The MulFCoder Architecture

To prevent this drift, MulFCoder breaks the generation process into a collaborative pipeline managed by four specialized agents. This multi-agent orchestration turns implicit framework knowledge into explicit, decidable rules.

  1. The Grounder (Visual Processing): Acting as the system's "eyes," the Grounder detects UI elements, performs OCR to extract text, and identifies macro-regions (such as headers or sidebars). This establishes a stable spatial map of the interface.
  2. The Planner (Architecture & Rules): The Planner builds a hierarchical layout tree from the Grounder's map. Crucially, it derives a Framework-specific Contract—a set of hard rules (e.g., "Angular components must be standalone") that dictates how the code must be structured.
  3. The Writer (Code Generation): Operating as the primary coder, the Writer works within a restricted edit window. It uses FILE mode to generate new components piece-by-piece (local-first, assemble-later) and PATCH mode to execute bounded repairs on specific errors.
  4. The Judger (Quality Control): Instead of relying on slow, expensive full-project builds to catch errors, the Judger enforces FastGate rules. These lightweight, framework-conditioned checks instantly catch syntax errors, missing imports, or contract violations, preventing deadlocks and hallucinated syntax.

Experimental Setup and Datasets

The research team evaluated MulFCoder using two primary benchmarks:

  • Design2Code: A dataset of 484 high-quality, real-world webpages converted into a standardized format for UI-to-code evaluation.
  • DesignBench: A complex, multi-framework benchmark featuring 900 samples across 11 themes, specifically designed to test generation, editing, and repair capabilities across React, Vue, and Angular.

Key Findings and Results

Tested across five major LLM backbones (including GPT-4o and Gemini-2.5-Pro), MulFCoder demonstrated consistent and substantial improvements in generating runnable code.

  • Compilation Success Rate (CSR) Surges: MulFCoder improved CSR across all tested frameworks. The gains were most dramatic in Angular, with an average improvement of 10.2% on Design2Code and 9.0% on DesignBench. Vue saw average gains of 6.6%–8.2%, while React (which is generally easier for LLMs to parse) saw a 3.8%–6.2% boost.
  • Targeted Error Reduction: The Judger agent successfully mitigated highly framework-specific errors, such as JSX parsing issues in React and template well-formedness errors in Vue.
  • Shortfall Compensation: MulFCoder provided the most significant performance boosts to "weaker" base models. This indicates that a well-structured multi-agent system can effectively compensate for a model's lack of deeply internalized framework documentation.
  • The "Engineering Trade-off": The authors observed a trade-off between runnability and visual fidelity. To ensure complex UI components satisfied strict framework rules and compiled successfully, MulFCoder occasionally simplified them, prioritizing a working application over a 100% pixel-perfect visual match.

Limitations and Future Directions

Despite these advancements, Angular remains the "final boss" of UI-to-code generation. Angular's strict requirements for global project coherence—specifically the wiring of modules and dependencies across multiple files—are difficult to satisfy through local, component-level edits alone.

Future iterations of MulFCoder will likely focus on stronger global coordination, granting agents a "birds-eye view" of the entire project structure to better manage cross-file dependencies. Additionally, researchers aim to bridge the engineering trade-off, striving for a system that delivers code that is both flawlessly runnable and perfectly faithful to the original UI design.

Summary updated

BibTeX
@inproceedings{wu2026mulfcoder,
  author = {Jie Wu and Haoran Ma and Shisong Tang and Yulin Xu and Xiaoyu Kang and Jiechao Gao},
  title = {{MulFCoder: Framework-conditioned Multi-agent for MLLM-based Multi-framework Front-end Code Generation}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=xUW3aH4ie3},
}
Figure