LayoutNUWA: Revealing the Hidden Layout Expertise of Large Language Models
Authors:
Preprint
Abstract
Graphic layout generation, a growing research field, plays a significant role in user engagement and information perception. Existing methods primarily treat layout generation as a numerical optimization task, focusing on quantitative aspects while overlooking the semantic information of layout, such as the relationship between each layout element. In this paper, we propose LayoutNUWA, the first model that treats layout generation as a code generation task to enhance semantic information and harness the hidden layout expertise of large language models~(LLMs). More concretely, we develop a Code Instruct Tuning (CIT) approach comprising three interconnected modules: 1) the Code Initialization (CI) module quantifies the numerical conditions and initializes them as HTML code with strategically placed masks; 2) the Code Completion (CC) module employs the formatting knowledge of LLMs to fill in the masked portions within the HTML code; 3) the Code Rendering (CR) module transforms the completed code into the final layout output, ensuring a highly interpretable and transparent layout generation procedure that directly maps code to a visualized layout. We attain significant state-of-the-art performance (even over 50\% improvements) on multiple datasets, showcasing the strong capabilities of LayoutNUWA. Our code is available at https://github.com/ProjectNUWA/LayoutNUWA.Keywords
All Related Versions
This publication has 12 references indexed in Scilit:
- Improving cross-task generalization with step-by-step instructionsScience China Information Sciences, 2025
- Relation-Aware Diffusion Model for Controllable Poster Layout Generation2023
- LayoutDiffusion: Improving Graphic Layout Generation by Discrete Diffusion Probabilistic Models2023
- Instruction Induction: From Few Examples to Natural Language Task Descriptions2023
- Unnatural Instructions: Tuning Language Models with (Almost) No Human Labor2023
- Learning Instructions with Unlabeled Data for Zero-Shot Cross-Task Generalization2022
- ZeroPrompt: Scaling Prompt-Based Pretraining to 1,000 Tasks Improves Zero-Shot Generalization2022
- Cross-Task Generalization via Natural Language Crowdsourcing Instructions2022
- Content-aware generative modeling of graphic design layoutsACM Transactions on Graphics, 2019
- Automatic Generation of Visual-Textual Presentation LayoutACM Transactions on Multimedia Computing, Communications, and Applications, 2016