Manuscript Offprint

arXiv:2611.01692

Phase-wise MLLM Tuning for Multi-framework WebUI Code Generation

Haoran Ma, Linxiao Li, Chenyue Wang, Haochen Sui, Jiechao Gao

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

Abstract

Multimodal large language models (MLLMs) achieve strong performance in translating WebUI screenshots into HTML/CSS. However, when they faced multiple frameworks (React/Vue/Angular), they often suffer from negative transfer that leads to compilation failures. These failures commonly stem from mixing framework specific syntax and violating framework constraints. This paper studies supervised fine-tuning for multi-framework WebUI code generation and proposes a phase-wise MLLM tuning method driven by compatibility and heterogeneity signals across frameworks. We first apply a normalization mapping that preserves each framework's native syntax while suppressing noise from variable naming and literal content. We then estimate cross framework heterogeneity and compatibility offline, and automatically derive training groups and their ordering by maximizing a phased objective. Finally, we perform phase-wise adapter tuning to reduce cross framework interference. Experiments on multiple benchmarks show that our proposed method improves both generation quality and compilation success rate compared with baselines.

1 Introduction

Generating executable front-end code from WebUI screenshots has become an important objective in automated software engineering [1]. Automating this process reduces the manual effort required to implement user interfaces and shortens the path from visual design to deployable code [2]. Early systems relied on computer vision pipelines that extracted structural elements from interface images and then used sequence models to emit HTML/CSS [3–6]. With the emergence of MLLMs, recent work has shifted toward end-to-end approaches that produce executable code directly from screenshots by jointly modeling visual inputs and code representations [7–9].

Despite this progress, most existing studies assume that the generated code targets HTML/CSS [8, 10]. In practical development, however, WebUI projects often need to support several widely used frameworks, including React, Vue, and Angular, which differ in syntax conventions, component organization, and engineering constraints [11]. When a model is trained jointly across such heterogeneous targets, or transferred from a model trained on a single framework, shared parameters receive supervision from distributions that favor different output patterns [12]. This can lead to cross-framework negative transfer [13], where generated code mixes syntax from different frameworks or violates framework-specific rules, ultimately causing compilation failures [14].

The root of this difficulty lies not only in the output distributions but also in the training dynamics induced by each framework. Heterogeneous target distributions produce gradient directions on the shared parameters that are not necessarily aligned across frameworks [15, 16]. When these signals are

*Equal contribution.

†Corresponding author: jiechao@stanford.edu.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

aggregated without regard to their relationships, shared updates may reflect inconsistent objectives, resulting in gradient interference and unstable optimization [17, 18]. This raises a natural question: In multi-framework WebUI code generation, can training strategies explicitly account for differences and compatibility among frameworks in order to reduce cross-framework interference?

To investigate this question, this paper studies supervised fine-tuning for multi-framework WebUI code generation and introduces a phase-based training strategy for MLLMs. The method first normalizes each framework's code to suppress superficial variation such as variable names and literal content. It then characterizes each pair of frameworks through two signals—a heterogeneity measure over normalized code distributions and a compatibility measure based on pre-gradients at the shared-adapter insertion point—and uses these signals to partition frameworks into training phases and order them. During training, the model combines a shared adapter with framework-specific adapters and updates them phase by phase, so that frameworks with more consistent optimization behavior are learned together. The resulting partition is derived offline and admits a generalization-bound interpretation.

Our contributions are summarized as follows:

  • We propose a theoretical framework for phased-wise tuning of MLLMs in multi-framework WebUI code generation, where an offline method is used to obtain phase partition.
  • We introduce a heterogeneity measure based on normalized codes and a compatibility measure based on offline pre-gradients, and use these two signals to automatically derive a phase partition and training schedule for multi-phase adapter finetuning.
  • We build a multi-framework finetuning dataset based on DesignBench [11] and WebCode2M [10], and evaluate our method on DesignBench [11] and Design2Code [1]; the results consistently outperform baselines.

References (47)