NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LayoutPrompter: Awaken the Design Ability of Large Language Models

Jiawei Lin, Jiaqi Guo, Shizhao Sun, Zijiang James Yang, Jian-Guang Lou, Dongmei Zhang

TL;DR

LayoutPrompter is a training-free framework that turns Large Language Models (LLMs) into versatile graphic designers. By utilizing in-context learning with a clever "serialization" strategy and dynamic example selection, it matches or outperforms state-of-the-art specialized models across diverse layout tasks—all without updating a single model weight.

The Challenge of Graphic Layout Generation

Graphic layout generation—the art of arranging elements like text, images, and buttons on a canvas—is a complex task that typically requires specialized deep learning models. While current state-of-the-art (SOTA) models perform well, they suffer from three major limitations:

  1. Lack of Versatility: Most models are highly specialized. A model trained to arrange document elements cannot seamlessly transition to handling natural language descriptions for web design.
  2. Data Hunger: Training these models (often based on Transformers or Diffusion architectures) requires massive datasets, sometimes exceeding 300,000 pairs. This is a significant bottleneck for "low-resource" domains like high-end poster design, where data is scarce.
  3. High Overhead: Training and fine-tuning these specialized models are computationally expensive and time-consuming.

To address these issues, the authors pose a compelling question: Can we "awaken" the latent design knowledge already hidden within LLMs to solve these layout problems without any training?

Overview of the LayoutPrompter framework

The LayoutPrompter Approach

LayoutPrompter bypasses traditional model training by leveraging In-Context Learning (ICL). Instead of updating weights, it provides the LLM with a carefully constructed prompt containing a few examples of the task. The framework consists of three main components:

  • Input-Output Serialization: Because LLMs process text, spatial layout constraints (e.g., coordinates, sizes, and relationships) must be converted into strings. Crucially, LayoutPrompter serializes layouts into HTML-like code. Since LLMs were pre-trained on vast amounts of web code, this format effectively unlocks their latent understanding of spatial relationships.
  • Dynamic Exemplar Selection: Not all examples are equally helpful. For a given user request, LayoutPrompter searches a small pool of available data to find the most similar layouts (using metrics like Intersection over Union for shapes or CLIP embeddings for text). It then presents these specific "exemplars" to the LLM to guide its generation.
  • Layout Ranker: Because LLMs can be stochastic, LayoutPrompter asks the model to generate multiple candidate layouts. A ranking function then selects the best one based on core design principles, such as alignment, minimal overlap, and adherence to the original constraints.
Prompt construction and HTML-like serialization

Datasets and Evaluation

The authors evaluated LayoutPrompter on four major public datasets, covering a wide spectrum of layout domains:

  • RICO: Mobile UI layouts (Android).
  • PubLayNet: Document layouts (research papers, reports).
  • PosterLayout: Content-aware poster design (arranging elements around a background image).
  • WebUI: Webpage layouts generated directly from natural language descriptions.

Key Insights: The "HTML Advantage"

One of the most fascinating findings is that LLMs are essentially "closet designers." Because they have processed a significant portion of the internet's code during pre-training, they inherently understand that a <header> typically belongs at the top of a page and a <footer> at the bottom. Using HTML tags in the prompt acts as a bridge, translating abstract spatial tasks into a language the LLM already masters.

Furthermore, the paper demonstrates that retrieval is the new training. The dynamic exemplar selection is vital; by showing the model a similar problem and its solution, the LLM generalizes to new constraints far more effectively than through static, random prompting.

Key Results

  • Competitive with SOTA: Despite being entirely training-free, LayoutPrompter achieved results on par with, or even better than, specialized models like LayoutFormer++ and LayoutDM.
  • Superior Data Efficiency: In a "low-data" regime (using only 500 training samples as the retrieval pool), LayoutPrompter's performance remained highly stable. In contrast, the performance of traditional training-based models plummeted under the same conditions.
  • Unmatched Versatility: A single, unified framework successfully handled everything from "constraint-explicit" tasks (providing exact element types and sizes) to "text-to-layout" tasks (providing a descriptive paragraph).

Limitations and Future Work

While powerful, LayoutPrompter has a few limitations. The authors note that as the number of elements in a layout increases, the LLM's performance can degrade, indicating a ceiling on how much spatial reasoning the model can handle in a single pass. Additionally, the inherent stochasticity of LLMs means they can sometimes "hallucinate" illogical coordinates, making the Layout Ranker a strict necessity.

Looking forward, while the current paper uses text-based "saliency maps" to describe background images to the LLM, the authors suggest that integrating native multimodal models (like GPT-4V) could allow the system to "see" background images directly. This could pave the way for even more cohesive and aesthetically pleasing designs.

Summary updated

BibTeX
@inproceedings{lin2023layoutprompter,
  author = {Jiawei Lin and Jiaqi Guo and Shizhao Sun and Zijiang James Yang and Jian-Guang Lou and Dongmei Zhang},
  title = {{LayoutPrompter: Awaken the Design Ability of Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=EF56cv8B3b},
}
Figure