Abstract
LayoutTransformer is a novel autoregressive model that leverages self-attention to generate and complete scene layouts across diverse domains, including 3D objects, natural images, documents, and mobile applications. By discretizing bounding box coordinates and predicting layout attributes sequentially, the model achieves state-of-the-art results while naturally learning semantic relationships between object categories based purely on spatial co-occurrence.
Problem Statement
Generating realistic scenes—whether synthetic photographs, 3D models, or user interface (UI) designs—requires more than just high-quality pixels or textures. A fundamental component of realism is the layout: the contextual arrangement and sizing of objects. For instance, a dining table is typically surrounded by chairs, and a website header is usually positioned at the top. Existing generative models often struggle with this structural comprehension, either requiring dense proxy inputs or relying on domain-specific constraints. This paper introduces a unified, domain-agnostic model capable of understanding contextual relationships to build or complete layouts from scratch.
Methodology
The authors frame layout generation as a sequence modeling problem, drawing inspiration from large language models. The process involves three key steps:
- Layout Representation: A layout is treated as a set of graphical primitives defined by category and geometric parameters (x, y, width, height).
- Discretization: Continuous spatial coordinates are converted into discrete tokens using 8-bit uniform quantization (values 0-255). This allows the model to express multimodal probability distributions, which is crucial for complex layouts.
- LayoutTransformer Architecture: Attributes are flattened into a 1D sequence and processed by a masked Transformer decoder. The model predicts the next attribute based on all previous ones, similar to how GPT predicts the next word in a sentence.
By decoupling attributes and predicting them individually, the self-attention mechanism can assign specific weights to coordinate dimensions. For example, when generating a column of text, the model can attend heavily to the horizontal (x) coordinate of the previous box while ignoring its vertical (y) position.
Datasets and Evaluation
To demonstrate the model's domain-agnostic nature, it was evaluated on four highly diverse datasets:
- PartNet: 3D shapes (chairs and lamps) decomposed into semantic parts.
- COCO Bounding Boxes: Natural image scenes from the COCO Panoptic 2017 dataset.
- Rico: Mobile app UI wireframes (buttons, text, images).
- PubLayNet: Document layouts including text, titles, lists, and figures.
Analysis of Learned Representations
A significant finding of the research is that semantics emerge from spatial data. By training purely on object placement, the model's learned embedding space naturally captures semantic relationships. It can solve analogies like snowboard : snow :: surfboard : ? (returning "sea" or "sand") without ever being trained on text. Spatial co-occurrence serves as a proxy for semantic meaning.
Quantization, while introducing minor approximation errors, enables the model to align UI elements perfectly, avoiding the "jittery" boxes common in continuous regression models. This precision is vital for structured domains like document and mobile app design.
Quantitative Results
The model consistently outperformed or matched state-of-the-art domain-specific models across all benchmarks:
- Natural Scenes (COCO): When paired with a downstream image generator, LayoutTransformer achieved an Inception Score (IS) of 7.6 and a FID of 57.0, outperforming baselines like LayoutVAE.
- Documents & UIs: On the Rico dataset, it achieved a Negative Log-Likelihood (NLL) of 1.07, significantly better than LayoutVAE (2.54) and ObjGAN (4.21).
- 3D Shapes (PartNet): It reached state-of-the-art performance in generating 3D chair point clouds, scoring a Jensen-Shannon Divergence (JSD) of 0.81.
Discussion and Future Work
Despite its success, the model requires scenes to be neatly decomposable into compositional primitives, which may not apply to amorphous natural scenes like forests. Additionally, the autoregressive nature imposes a strict sequence order on what is naturally an order-invariant set. Future work may explore joint training of part auto-encoders and layout generators to prevent issues like floating or disconnected parts in 3D generation.
Summary updated