arXiv:2611.00926cs.CVOct 2026

Manuscript Offprint

arXiv:2611.00926

UI-UG 2: Advancing Mobile UI Understanding and Generation with Fine-Grained Supervision and Reinforcement Learning

Hao Yang, Shuoyang Liu, Xiaoyu Lin, Zhou Fang, Maji Huang, Zhaosong Huang, Ruichao Mao, Teng Guo, Hai Rao

Abstract

Mobile UI understanding and generation require both fine-grained component perception and reliable structured synthesis. Inspired by the unified direction introduced by UI-UG [46], we present UI-UG 2, a compact 4B-parameter multimodal large language model (MLLM) that advances mobile UI Understanding and Generation with broader task coverage, a front-end-aligned taxonomy, and online render-aware reinforcement learning. UI-UG 2 constructs a multi-source understanding corpus from RICO, VINS, Android in the Wild, and Android Control, annotated with an 80-category two-level UI taxonomy aligned with front-end component semantics, and pairs it with over 5,000 requirement-screenshot-JSON tuples for progressive structured UI generation through a domain-specific language (DSL). For understanding, UI-UG 2 introduces decomposed rewards for category prediction, OCR fidelity, color recognition, dense grounding, and GUI grounding. Unlike the offline Direct Preference Optimization (DPO)-style generation optimization in UI-UG, UI-UG 2 optimizes generation through end-to-end online Group Relative Policy Optimization (GRPO): sampled DSL outputs are rendered with a Playwright-based server-side pipeline and evaluated using LLM-as-a-Judge and contrastive preference ranking. Experiments show that UI-UG 2 achieves the strongest referring and dense-grounding results among the evaluated models on our 80-category benchmark, and achieves the best composite generation score among compared models at a compact scale (4B). More importantly, we observe a consistent understanding-to-generation transfer: adding fine-grained UI perception supervision improves generation quality under a fixed training budget, suggesting that component-level semantics provide a shared representational foundation for both tasks.

1 Introduction

Mobile user interfaces are the primary bridge between users and digital services. As applications grow in complexity, the ability to accurately understand and generate UIs underpins a broad spectrum of downstream applications, from screen parsing and GUI agent interaction to personalized interface synthesis and LLM-driven front-end development. These two capabilities, however, have largely evolved along separate tracks, with separate models, separate data pipelines, and separate evaluation protocols.

General-purpose MLLMs such as GPT [32], Claude [2], Gemini [13], and Qwen-VL [3] can nominally perform both tasks, yet their accuracy remains insufficient for precision-critical mobile scenarios.

Preprint.

UI-UG 2: Advancing Mobile UI Understanding and Generation

Figure

Figure 1: Overview of UI-UG 2. UI-UG 2 unifies fine-grained mobile UI understanding and structured UI generation with a front-end-aligned taxonomy, joint training, task-specific rewards, and online render-aware optimization.

Mobile screens are fundamentally different from natural images: they are dense compositions of small, semantically loaded components—buttons, icons, text fields, navigation bars—whose interaction semantics require fine-grained categorical reasoning. Distinguishing a CloseButton from a ReturnButton, or a SearchBar from a generic TextInput, is essential for reliable automation and high-quality generation, but lies beyond the granularity that general-purpose models reliably achieve. Specialized approaches address one side of the problem—Ferret-UI [48] and Ferret-UI2 [23] for grounding and referring, DCGen [41] and DeclarUI [52] for structured generation—while UI-UG [46] took an initial step toward a unified model. However, important limitations remain: its labels were not explicitly organized around front-end component semantics, its understanding coverage focused mainly on referring and dense grounding, its generation optimization relied on offline Direct Preference Optimization (DPO) over a fixed preference dataset, and its evidence for understanding-to-generation transfer remained preliminary.

We present UI-UG 2, a compact 4B MLLM for mobile UI Understanding and Generation, with an overview illustrated in Figure 1. UI-UG 2 keeps the central goal of unified UI understanding and generation while strengthening the data, training, and analysis pipeline. On the data side, we construct a large-scale understanding benchmark from four public sources (RICO, VINS, Android in the Wild, and Android Control), covering over 30,000 screenshots with 80 fine-grained element categories organized in a two-level hierarchy aligned to front-end conventions, enriched with element-level, action-level, OCR, and color annotations. We pair this with a curated generation corpus of over 5,000 requirement-screenshot-JSON triples whose compact domain-specific language (DSL) supports cross-platform rendering and progressive streaming.

On the optimization side, we adopt a two-stage pipeline of supervised fine-tuning followed by task-specific Group Relative Policy Optimization (GRPO). For understanding, we design decomposed rewards targeting format compliance, category prediction, OCR fidelity, color recognition, dense grounding, and GUI grounding. For generation, UI-UG 2 performs online render-aware RL: each sampled DSL is rendered by a Playwright-based server-side pipeline, then evaluated through LLM-as-a-Judge and Contrastive Preference Ranking (CPR). This closes the loop between structured generation, actual rendering, and reward feedback, making optimization better aligned with deployment-time UI quality.

Experiments demonstrate that UI-UG 2 achieves the strongest referring and dense-grounding results among the compared models on our benchmark, strong GUI grounding on ScreenSpot mobile benchmarks, and the best overall generation quality among compared models at a compact 4B scale. Through data-mixing ablations, reward transfer analysis, and attention probing, we further observe an asymmetric synergy: understanding supervision improves generation quality at an appropriate data-mixing ratio. This finding—that component-level perceptual representations form a transferable foundation for generative tasks—offers a concrete design principle for future mobile UI systems.

Our contributions are:

  • UI-UG 2. We propose UI-UG 2, a compact unified MLLM that jointly supports mobile UI understanding and generation, advancing the UI-UG direction [46] with broader task coverage, stronger efficiency, and more rigorous optimization. UI-UG 2 achieves the best results among the compared models on our newly constructed referring and dense-grounding benchmark, and obtains the best composite generation score among all compared baselines despite using only a compact 4B backbone.

  • Front-end-aligned data and tasks. We contribute an 80-category hierarchical UI understanding dataset with taxonomy aligned to front-end conventions, supporting referring, dense grounding, and GUI grounding, together with a high-quality UI generation corpus based on a compact, renderable JSON DSL.

  • Task-specific online GRPO. We introduce decomposed reward functions for category, OCR, color, dense grounding, GUI grounding, format validity, renderability, LLM-judged UI quality, and CPR-based preference, enabling online render-aware optimization for generation.

  • Understanding-to-generation synergy. We provide systematic evidence that fine-grained UI perception consistently benefits generation quality, supported by data-mixing ablations, reward transfer analysis, and attention probing.

References (43)