Learning UI-to-Code Reverse Generator Using Visual Critic Without Rendering
Not on the map. Why?
Abstract (arXiv)
Automated reverse engineering of HTML/CSS code from UI screenshots is an important yet challenging problem with broad applications in website development and design. In this paper, we propose a novel vision-code transformer (ViCT) composed of a vision encoder processing the screenshots and a language decoder to generate the code. They are initialized by pre-trained models such as ViT/DiT and GPT-2/LLaMA but aligning the two modalities requires end-to-end finetuning, which aims to minimize the visual discrepancy between the code-rendered webpage and the original screenshot. However, the rendering is non-differentiable and causes costly overhead. We address this problem by actor-critic fine-tuning where a visual critic without rendering (ViCR) is developed to predict visual discrepancy given the original and generated code. To train and evaluate our models, we created two synthetic datasets of varying complexity, with over 75,000 unique (code, screenshot) pairs. We evaluate the UI-to-Code performance using a combination of automated metrics such as MSE, BLEU, IoU, and a novel htmlBLEU score. ViCT outperforms a strong baseline model DiT-GPT2, improving IoU from 0.64 to 0.79 and lowering MSE from 12.25 to 9.02. With much lower computational cost, it can achieve comparable performance as when using a larger decoder such as LLaMA.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 20 of its 27 references that are in the map. First posted on arXiv 24 May 2023.
Builds on
20 of 27 references.
References · 20
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Modelscited by 6,137
- 2022Generative Adversarial Networkscited by 5,627
- 2020Taming Transformers for High-Resolution Image Synthesiscited by 3,253
- 2014Sequence to Sequence Learning with Neural Networkscited by 2,986
- 2015Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networkscited by 2,054
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 687
8 more
- 2013Speech Recognition with Deep Recurrent Neural Networkscited by 669
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 358
- 2021LocalViT: Analyzing Locality in Vision Transformerscited by 228
- 2017pix2code: Generating Code from a Graphical User Interface Screenshotcited by 114
- 2019Sketch2code: Generating a website from a paper mockupcited by 20
- 2014Structured Generative Models of Natural Source Codecited by 19
Built on by
Citing papers per year: 2023: 1.
1 paper.