ReLayout: Integrating Relation Reasoning for Content-aware Layout Generation with Multi-modal Large Language Models

Jiaxu Tian, Xuehui Yu, Yaoxing Wang, Pan Wang, Guangqian Guo, Shan Gao · Submission to ICLR 2026 · Rejected

TL;DR

Current multimodal large language models (MLLMs) struggle with graphic poster design because they predict element coordinates directly, ignoring the structural rules and aesthetic relationships human designers use. ReLayout solves this by formulating layout generation as a relation-driven Chain-of-Thought (CoT)—hierarchically reasoning about salient image regions, flexbox-like grouping containers, and element margins before predicting final coordinates. Paired with a layout prototype rebalancing sampler, ReLayout eliminates overlapping errors and drastically improves layout diversity and usability.

What Problem Does This Paper Address?

In content-aware graphic layout generation (e.g., placing titles, logos, and promotional badges on advertising posters), design elements must harmonize with the background image without obscuring key subjects.

While recent MLLM-based methods (such as PosterLlama) generate layouts using HTML or coordinate tokens, they treat the task as pure numerical coordinate prediction. Lacking an explicit understanding of design hierarchy, these models frequently suffer from:

  1. Structural failures: Generating overlapping text, misaligned elements, and failing to maintain parallel or symmetrical groupings.
  2. Diversity collapse: Under different random seeds, models collapse into repetitive, generic arrangements due to training data bias toward a few common layout templates.

Methods

ReLayout reformulates layout design from raw coordinate regression into a structured, step-by-step logical derivation:

Canvas & Elements
       │
       ▼
[Layout Relation-CoT]
  1. Detect Salient Blocks (identify key image subjects via integral images)
  2. Estimate Regions & Hierarchy (recursive flexbox: row vs. column, alignment)
  3. Predict Margins & Coordinates (compactness, spacing, bounding boxes)
       │
       ▼
[Layout Prototype Rebalancing]
  • Extract 3D features: Saliency + Region distributions + Element composition
  • K-Means clustering (K=8 distinct layout prototypes)
  • Temperature-controlled reweighted sampling (prevents dominant mode collapse)
       │
       ▼
[MLLM Training & Inference]
  Fine-tuned with LoRA (PosterLlama, Qwen2.5-VL, InternVL2.5)
  • Layout Relation-CoT Construction: Instead of directly outputting bounding boxes, the model is trained to output an intermediate structural HTML representation:
  • Saliency Blocks: Automatically identified visual focus zones (derived via BASNet/ISNet and integral image scoring) that elements should generally avoid.
  • Recursive Regions: Modeled analogously to CSS Flexbox (flex-direction: row|column, align-items). Bounding boxes are projected onto axes and grouped via Intersection over Detection (IoD) heuristics into nested parent-child visual hierarchies.
  • Relative Spacing (Margin): Explicit margin-top and margin-left attributes to govern density and spacing between adjacent elements.
  • Layout Prototype Rebalance Sampler: To prevent the model from memorizing only the most frequent template styles, layouts are characterized along three feature vectors: saliency center ($f_i^s$), region spatial variance and direction counts ($f_i^r$), and category histogram ($f_i^e$). After clustering into 8 layout prototypes, samples are drawn according to a flattened probability distribution $w_k \propto \text{cnt}_k^{1/\theta}$, boosting the frequency of rare, complex designs during training.

Datasets

The authors evaluate ReLayout on two widely used e-commerce benchmarks:

  • PKU PosterLayout: Contains text, logo, and banner elements.
  • CGL Dataset: Contains text, logo, banner, and embellishment elements.
  • Hard Split (Introduced): To rigorously test structural reasoning, the authors curated a challenging subset from the validation/test sets featuring: (1) nested regions, (2) parallel element groups, or (3) posters containing more than four elements.
  • Datasets were preprocessed using LaMa inpainting to clean background canvases, PaddleOCR for textual extraction, and BASNet/ISNet for canvas saliency maps.

Key Insights and Ideas

  • Flexbox syntax is a natural inductive bias for LLMs: LLMs excel at structured hierarchical languages (HTML/CSS). Representing spatial relations as nested rows, columns, and margins bridges the gap between text reasoning and 2D spatial arrangement.
  • Predicting negative space (saliency) first prevents occlusions: Explicitly emitting salient boundary tokens before placing foreground elements forces the autoregressive attention mechanism to "reserve" canvas space for the background subject.
  • Dataset imbalance—not model capacity—drives repetitive layouts: Standard generative models repeatedly produce top-title/bottom-body layouts because datasets are skewed. Stratifying by structural prototypes and reweighting samples unlocks diverse design modes under different random seeds without forgetting simple templates.

Key Results

Experiments across multiple foundation models (PosterLlama-7B, Qwen2.5-VL-7B, InternVL2.5-8B) show marked improvements on both datasets:

  • Structural Quality & Overlap: On the PKU Hard Split, ReLayout (using InternVL2.5) reduced maximum element overlap (Ove) from 0.0318 (PosterLlama) down to 0.0109, while improving Fréchet Distance (FD) from 5.9256 to 3.4615.
  • Human Designer Study: In blind evaluations by 6 professional graphic designers across 300 test images:
  • Usability rate ($P_{use}$, basic layout validity): 91.0% for ReLayout vs. 71.3% for PosterLlama and 50.3% for RALF.
  • Preferred best layout ($P_{best}$): 64.7% preferred ReLayout, compared to only 11.0% for PosterLlama and 10.3% for baseline InternVL.
  • Diversity: In multi-seed evaluations across 50 canvases, ReLayout produced significantly more distinct, usable styles (diversity score of 56 vs. 47 for PosterLlama).

Limitations and Future Work

  • Canvas Saturation Failures: When early predicted regions occupy almost the entire canvas, subsequent element predictions can still be forced into overlapping configurations.
  • Crowded Scenes: The framework still struggles when posters contain an unusually large number of input elements.
  • Resolution Sensitivity: Downstream generation quality remains constrained by multi-modal vision encoders that operate on downscaled image resolutions.
  • Evaluation Metrics: The authors acknowledge that existing automatic layout metrics (e.g., pixel-level gradient readability and overlap) do not fully capture human graphic design quality, underscoring the ongoing need for improved automated design benchmarks.

Summary updated

BibTeX
@misc{tian2025relayout,
  author = {Jiaxu Tian and Xuehui Yu and Yaoxing Wang and Pan Wang and Guangqian Guo and Shan Gao},
  title = {{ReLayout: Integrating Relation Reasoning for Content-aware Layout Generation with Multi-modal Large Language Models}},
  year = {2025},
  eprint = {2507.05568},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.05568},
}
Figure