UI-UG 2: Advancing Mobile UI Understanding and Generation with Fine-Grained Supervision and Reinforcement Learning
Organizations: Ant Group
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, 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.
Figures & tables
| Hyperparameter | SFT | GRPO |
|---|---|---|
| Base Model | Qwen3-VL-4B-Instruct | |
| Frozen Modules | ViT Encoder | |
| Trainable Modules | LLM + VL Adapter | |
| Max Learning Rate | 1e-5 | 1e-6 |
| LR Schedule | Warmup-Stable-Decay | Warmup-Stable-Decay |
| Warmup Ratio | 0.05 | 0.03 |
| Referring | Dense Grounding | GUI Grounding | ||||||||
| Model | Params | Category | OCR | Color | F1 | Precision | Recall | mIoU | SS-V1-Mobile | SS-V2-Mobile |
| Closed-source | ||||||||||
| GPT-5.2 [ 32 ] | 0.415 | 0.551 | 0.611 | 0.048 | 0.045 | 0.052 | 0.656 | 0.492 | 0.352 | |
| Claude Sonnet 4.5 [ 2 ] | 0.484 | 0.830 | 0.628 | 0.368 | 0.415 | 0.330 | 0.757 | 0.187 | 0.232 | |
| Gemini 3.1 Pro [ 13 ] | 0.535 | 0.690 | 0.501 | 0.471 | 0.461 | 0.482 | 0.759 | 0.900 | 0.951 | |
| Open-source | ||||||||||
| Model | JSON | Rend | Col | Str | Txt | Int | Sum |
|---|---|---|---|---|---|---|---|
| Closed-source | |||||||
| GPT-5.2 [ 32 ] | 0.99 | 0.96 | 0.58 | 0.62 | 0.58 | 0.60 | 4.33 |
| Claude Sonnet 4.5 [ 2 ] | 0.96 | 0.94 | 0.69 | 0.70 | 0.71 | 0.70 | 4.70 |
| Gemini 3.1 Pro [ 13 ] | 1.00 | 0.97 | 0.42 | 0.53 | 0.48 | 0.49 | 3.89 |
| Open-source | |||||||
| Qwen3-VL-4B [ 3 ] | 0.98 | 0.96 | 0.59 | 0.59 | 0.60 | 0.58 | 4.30 |
| Configuration | Precision | Recall | F1 | mIoU |
|---|---|---|---|---|
| SFT (no RL) | 0.798 | 0.693 | 0.742 | 0.865 |
| 0.803 | 0.697 | 0.745 | 0.868 | |
| 0.836 | 0.712 | 0.763 | 0.877 | |
| 0.754 | 0.742 | 0.727 | 0.836 | |
| 0.832 | 0.729 | 0.777 | 0.894 |
| Reward | Col | Str | Txt | Int |
|---|---|---|---|---|
| (Category) | 1.31% | 0.86% | 1.31% | 1.49% |
| (Color) | 1.60% | 0.39% | 0.18% | 0.41% |
| (Text) | 0.11% | 1.45% | 2.48% | 0.13% |
| (Dense Gnd.) | 1.64% | 4.72% | 0.25% | 1.74% |
| (GUI Gnd.) | 0.20% | 0.27% | 0.25% | 0.17% |
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| Parent Class | Subcategories (complete list) | AntD Correspondence |
|---|---|---|
| Card (9) | InfoCard, CommodityCard, MenuCard, InfoCardTruncated, CommodityCardTruncated, Banner, BannerTruncated, NoticeBar, Swiper | AntD Card (functional/truncation variants); AntD NoticeBar; AntD Swiper; custom Banner pattern |
| Collapse (9) | CollapseFold, CollapseUnFold, Popup, FloatingPanel, List, ListItem, Table, Form, FormItem | AntD Collapse (state-level split); AntD Popup/FloatingPanel; AntD List/List.Item; AntD Form/Form.Item; custom Table |
| Chart (7) | LineChart, HorizontalBarChart, VerticalBarChart, CircleChart, RadarChart, DashBoardChart, OtherChart | Not in AntD; referenced from AntV/F2, ECharts, and Recharts; custom OtherChart for uncommon types |
| Navigation (7) | Tabs, NavBar, TabBar, SideBar, IndexBar, TabsItemSelected, TabsItemUnselected | AntD Tabs/NavBar/TabBar/SideBar/IndexBar; custom item-state split (Selected/Unselected) |
| Progress (6) | ProgressBar, ProgressCircle, Selector, Steps, StepsItem, Scroll | AntD ProgressBar/ProgressCircle; AntD Selector; AntD Steps/Steps.Step; custom Scroll indicator |
| Button (10) | CommonButton, SideButton, CustomButton, TextButton, CloseButton, MoreButton, HomeButton, ReturnButton, Switch, Dropdown | AntD Button (functional variants); AntD Switch; AntD Dropdown |
| Dataset | Categories | OCR / Color | Level | FW-Aligned | # Images |
|---|---|---|---|---|---|
| RICO Deka et al. [2017] | 24 | × / × | Element | × | 72k |
| VINS Bunian et al. [2021] | 11 | × / × | Element | × | 4k |
| AITW Rawles et al. [2023] | — | × / × | Action | ✓ | 715k |
| AC Li et al. [2024a] | — | × / × | Action | × | 1.5M |
| Ours | 80 (9 + 71) | ✓ | Element+Action | ✓ | >30k |
| Dataset | Icon | Text | Overall |
|---|---|---|---|
| ScreenSpot-V1 Mobile | 0.887 | 0.916 | 0.902 |
| ScreenSpot-V2 Mobile | 0.912 | 0.944 | 0.929 |
| Judge Model | Variance | |||||
|---|---|---|---|---|---|---|
| Gemini 3.1 Pro | 0.07 | 0.08 | 0.09 | 0.08 | 0.08 | 0.032 |
| Qwen3-VL-235B-A22B | 0.15 | 0.17 | 0.13 | 0.20 | 0.17 | 0.046 |
| GPT-5.2 | 0.12 | 0.11 | 0.14 | 0.12 | 0.13 | 0.049 |
| Claude Sonnet 4.5 | 0.21 | 0.24 | 0.23 | 0.26 | 0.24 | 0.050 |
| Model | Size | Size-Based Factor | Estimated Time (s) |
|---|---|---|---|
| UI-UG 2-4B | 4B | 1.00 | 0.9 |
| Qwen3-VL-30B-A3B | A3B | 0.75 | 0.7 |
| UI-Venus-Ground-7B | 7B | 1.75 | 1.6 |
| Qwen3-VL-8B | 8B | 2.00 | 1.8 |
| UI-Venus-Ground-72B | 72B | 18.00 | 16.0 |
| Qwen3-VL-235B-A22B | A22B | 5.50 | 4.9 |
Multimodal Large Language Models
Multimodal large language models combine language models with image, video, audio, and other inputs for grounded understanding and generation.
See all 1,114 papers