LayoutCoT: Unleashing the Deep Reasoning Potential of Large Language Models for Layout Generation
Hengyu Shi, Junhao Su, Tianyang Han, Junfeng Luo, Jialin Gao
TL;DR
LayoutCoT tackles training-free layout generation by enabling deep reasoning in LLMs via a layout-aware RAG and a three-stage Chain-of-Thought refinement. It uses a dissimilarity-based retrieval score $LTSim(\mathcal{L}, \hat{\mathcal{L}})$ to fetch exemplar layouts, generates a coarse layout, and then refines it through Stage 1 position, Stage 2 size/placement, and Stage 3 fine-tuning, all within a single prompt loop. The approach achieves state-of-the-art results on five public datasets across content-aware, constraint-explicit, and text-to-layout tasks without any task-specific training, with GPT-4 outperforming specialized deep-reasoning models in some tasks. This work demonstrates the practical potential of training-free LLM-based layout design, offering a versatile, data-efficient path for real-world UI and graphic design tasks, leveraging top-$K$ retrieval and iterative reasoning.
Abstract
Conditional layout generation aims to automatically generate visually appealing and semantically coherent layouts from user-defined constraints. While recent methods based on generative models have shown promising results, they typically require substantial amounts of training data or extensive fine-tuning, limiting their versatility and practical applicability. Alternatively, some training-free approaches leveraging in-context learning with Large Language Models (LLMs) have emerged, but they often suffer from limited reasoning capabilities and overly simplistic ranking mechanisms, which restrict their ability to generate consistently high-quality layouts. To this end, we propose LayoutCoT, a novel approach that leverages the reasoning capabilities of LLMs through a combination of Retrieval-Augmented Generation (RAG) and Chain-of-Thought (CoT) techniques. Specifically, LayoutCoT transforms layout representations into a standardized serialized format suitable for processing by LLMs. A Layout-aware RAG is used to facilitate effective retrieval and generate a coarse layout by LLMs. This preliminary layout, together with the selected exemplars, is then fed into a specially designed CoT reasoning module for iterative refinement, significantly enhancing both semantic coherence and visual quality. We conduct extensive experiments on five public datasets spanning three conditional layout generation tasks. Experimental results demonstrate that LayoutCoT achieves state-of-the-art performance without requiring training or fine-tuning. Notably, our CoT reasoning module enables standard LLMs, even those without explicit deep reasoning abilities, to outperform specialized deep-reasoning models such as deepseek-R1, highlighting the potential of our approach in unleashing the deep reasoning capabilities of LLMs for layout generation tasks.
