LayoutNUWA: Revealing the Hidden Layout Expertise of Large Language Models

Zecheng Tang, Chenfei Wu, Juntao Li, Nan Duan
2/12/2026

No official code found. Best implementation: ProjectNUWA/LayoutNUWA (153 stars, MIT, last commit 2024-01-31).

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.

View on arXivView PDF

Code Implementations(1)

MIT
15317Shell, PythonSep 18, 20232 years agoMIT

Cite this paper

@article{tang2026layoutnuwa,
  title  = {LayoutNUWA: Revealing the Hidden Layout Expertise of Large Language Models},
  author = {Zecheng Tang and Chenfei Wu and Juntao Li and Nan Duan},
  year   = {2026},
  eprint = {2309.09506},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.09506},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.09506.svg)](https://codeofpaper.com/paper/2309.09506)

Discussion