All models

LayoutTransformer

An autoregressive Transformer decoder that generates or completes layouts as sequences of discretized element tokens.

Diffusion and generative · 192 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (19 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
19.5M
Operations
192
Framework
PyTorch
Recurrent
No
Published
ICCV 2021
Cited by
146 (as of 28 October 2026)
Authors
Kamal Gupta, Justin Lazarow, Alessandro Achille and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m17882
Graph hash
26b37b8278f5c74baa0c419b896f008e739f460e740da88f2f95bf66784b81fd
Skeleton hash
419620539dc2c8d42701bf999d9a50a84fa8b254d00fcad185b1cf93efc9ccb7
Architecture hash
758c0088b66ce707318ac498ab3024ce345a95b9f3176f2c25a319c6a8737d5f
Diagram SHA-256
1e524eb74c0a923d20a4c681ff173c7a266588258f36cd1cdf3d343276d435e4
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

LayoutTransformer generates layouts, meaning arrangements of simple graphical elements such as the object bounding boxes of an image or the blocks of a document page. It uses self-attention to learn the relationships between layout elements, and it can produce a layout from nothing or complete one from a few given elements.

A layout is first flattened into one sequence of the parameters of its elements. Each element contributes a category and four geometric fields, the center coordinates, height and width of its bounding box, and each geometric field is quantized uniformly to 8 bits. With start and end tokens added, a 2D layout of n elements becomes a sequence of 5n + 2 vectors. The network that models this sequence is similar to a Transformer decoder, with layers of masked multi-head attention and feed-forward sublayers, and it predicts each next parameter from the ones before it. The paper's base model uses a dimension of 512, 6 layers and 8 attention heads.

The paper reports experiments on object bounding boxes in natural images (COCO), documents (PubLayNet), mobile applications (RICO) and 3D shapes (PartNet). Unless otherwise specified, its samples were drawn with nucleus sampling at top-p = 0.9. The public code was rewritten from scratch on a GPT codebase for single-GPU training. Its README notes that some details, such as training hyperparameters, might differ from the arXiv version of the paper.

Key idea. LayoutTransformer represents a layout as a sequence of discretized element parameters and models it autoregressively with a self-attention decoder, for both layout generation and completion.

  • LayoutTransformer
  • Layout Generation and Completion with Self-attention
  • layout generation
  • layout completion
  • scene layout
  • document layout generation
  • autoregressive layout model
  • PubLayNet
  • bounding box layout
  • DeepLayout

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{gupta2021layouttransformerlayoutgenerationcompletion,
      title={LayoutTransformer: Layout Generation and Completion with Self-attention}, 
      author={Kamal Gupta and Justin Lazarow and Alessandro Achille and Larry Davis and Vijay Mahadevan and Abhinav Shrivastava},
      year={2021},
      eprint={2006.14615},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2006.14615}, 
}