LayoutCoT: Unleashing the Deep Reasoning Potential of Large Language Models for Layout Generation

Hengyu Shi, Junhao Su, Huansheng Ning, Xiaoming Wei, Jialin Gao · DOI

Introduction

Automated layout generation—the task of arranging elements like text, images, and logos into a coherent design—is a complex balancing act of spatial logic and aesthetics. While traditional approaches rely on GANs or Diffusion models requiring massive labeled datasets, Large Language Models (LLMs) offer a "training-free" alternative. However, LLMs often struggle with the deep reasoning required for layout, frequently producing "naive" designs with overlaps or inappropriate sizing.

LayoutCoT addresses this by treating layout generation as an iterative, reasoned process. It is a training-free framework that enables off-the-shelf LLMs to generate high-quality graphic layouts by combining Layout-aware Retrieval-Augmented Generation (RAG) with a multi-stage Chain-of-Thought (CoT) refinement process.

The LayoutCoT Framework

The LayoutCoT framework consists of three main pillars designed to bridge the gap between text-based reasoning and spatial design.

The LayoutCoT framework integrates Layout-aware RAG and a multi-stage CoT block to guide LLMs through the generation process.
  1. Layout Serialization: To make layouts "readable" for LLMs, the system linearizes bounding boxes and labels into a structured HTML-like format.
  2. Layout-aware RAG: Instead of random examples, the system uses a specialized similarity metric called LTSim (Layout Transportation-based similarity) to retrieve relevant design exemplars. This provides the LLM with a "mood board" of successful spatial arrangements.
  3. Multi-stage Chain-of-Thought (CoT): This core innovation breaks the generation task into three sequential reasoning stages, moving from coarse placement to fine-grained aesthetic tuning.

Multi-Stage Reasoning for Design

Instead of asking the LLM for a final layout in a single pass, LayoutCoT guides the model through a structured refinement process. This iterative approach specifically targets common failure modes like the "Upper-Left" trap, where models cluster elements in one corner.

The three stages of the LayoutCoT reasoning process: Logical Placement, Size Adjustment, and Aesthetic Tuning.
  • Stage 1: Logical Placement: The model determines initial positions based on element types and roles, emphasizing hierarchy and flow.
  • Stage 2: Size Adjustment: The model optimizes dimensions to resolve overlaps and crowding, ensuring readability.
  • Stage 3: Aesthetic Tuning: Fine-grained adjustments align the layout with aesthetic principles and ensure visual harmony.

Evaluation and Key Results

LayoutCoT was evaluated across five diverse public benchmarks covering content-aware poster design (PKU, CGL), constraint-explicit UI/Document design (RICO, PubLayNet), and instruction-based text-to-layout (WebUI).

The framework established new state-of-the-art (SOTA) performance across all benchmarks without any fine-tuning. On the PKU dataset, LayoutCoT achieved an alignment score of 0.0002, significantly outperforming previous methods. On the RICO dataset, it achieved a Mean IoU of 0.719. Qualitatively, LayoutCoT designs are significantly more "rational," avoiding the dense, overlapping clusters seen in baseline LLM outputs.

Insights and Future Directions

A key insight from this research is that structured reasoning can be more important than raw model parameters; a standard LLM equipped with LayoutCoT can outperform specialized deep-reasoning models. The researchers also introduced a new metric, Reasonableness of element size ($R_e$), to better quantify design quality.

While effective, the iterative nature of CoT incurs higher computational overhead. Future work may involve distilling this multi-stage reasoning into smaller, more efficient models to reduce latency while maintaining high design quality.

Summary updated

BibTeX
@misc{shi2025layoutcot,
  author = {Hengyu Shi and Junhao Su and Huansheng Ning and Xiaoming Wei and Jialin Gao},
  title = {{LayoutCoT: Unleashing the Deep Reasoning Potential of Large Language Models for Layout Generation}},
  year = {2025},
  eprint = {2504.10829},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.10829},
}
Figure