SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.11589 · ICCV · 2023

LayoutDiffusion: Improving Graphic Layout Generation by Discrete Diffusion Probabilistic Models

Jian-Guang Lou, Dongmei Zhang, Jiaqi Guo, Junyi Zhang, Shizhao Sun

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2303.11589.json · badge: /api/ran/2303.11589.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
microsoft/layoutgeneration marked official in Papers with Code
Papers with Code archive
4 ran · 2 no recorded run
FunctionStatusWhere it lives
alpha_schedule Ran
ran; our contract draft was wrong, not the code
microsoft/layoutgeneration/LayoutDiffusion/improved-diffusion/improved_diffusion/discrete_diffusion.py
code served (permissive licence) · get_code("858b4cc0a919d07a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function to understand parameters
# time_step: integer, used for array indexing and size calculations
# N: integer, used but not directly in the computations shown
# att_1, att_T, ctt_1, ctt_T: floats, used as boundary values in interpolation
# matrix_policy: integer, controls which branch (1 or 2) to execute
# type_classes: integer, used in division operations

ARGS = {
    'time_step': 50,
    'N': 100,
    'att_1': 0.99999,
    'att_T': 9e-06,
    'ctt_1': 9e-06,
    'ctt_T': 0.99999,
    'matrix_policy': 1,
    'type_classes': 25,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gaussian_matrix2 Ran
ran, honoured the contract we drafted
microsoft/layoutgeneration/LayoutDiffusion/improved-diffusion/improved_diffusion/discrete_diffusion.py
code served (permissive licence) · get_code("5dbf1656839da6df")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (128, 128) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a simple object that has a .numpy() method and can be indexed
class BetaTensor:
    def __init__(self, values):
        self._tensor = torch.tensor(values, dtype=torch.float32)
    
    def numpy(self):
        return self._tensor.numpy()

# Create beta_t with some sample values for different timesteps
# We need at least enough timesteps to index into it
beta_values = np.array([0.1, 0.2, 0.3, 0.4, 0.5], dtype=np.float32)
bt = BetaTensor(beta_values)

# t is a timestep integer (can be indexed into bt)
t = 2

ARGS = {
    "t": t,
    "bt": bt,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (128, 128) — shape (128, 128) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
index_to_log_onehot Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/layoutgeneration/LayoutDiffusion/improved-diffusion/improved_diffusion/discrete_diffusion.py
code served (permissive licence) · get_code("d70582d84f29d56e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 5, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small index tensor with shape (batch_size, height, width)
# Values must be in range [0, num_classes)
batch_size = 2
height = 3
width = 4
num_classes = 5

x = torch.randint(0, num_classes, (batch_size, height, width))

ARGS = {
    'x': x,
    'num_classes': num_classes,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 5, 3, 4) — shape (2, 5, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
log_onehot_to_index Ran
ran, honoured the contract we drafted
microsoft/layoutgeneration/LayoutDiffusion/improved-diffusion/improved_diffusion/discrete_diffusion.py
code served (permissive licence) · get_code("5def5f79a41cfc04")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family int, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# log_onehot_to_index takes a tensor with log probabilities
# and returns the index of the maximum value along dimension 1
# The function calls .argmax(1) on the input
# So we need a 2D tensor where argmax along dimension 1 makes sense

log_x = torch.randn(2, 4)  # batch size 2, num classes 4

ARGS = {
    "log_x": log_x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family int, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
DiffusionTransformer Not yet run
unverified (harvested, no recorded run)
microsoft/layoutgeneration/LayoutDiffusion/improved-diffusion/improved_diffusion/discrete_diffusion.py
code served (permissive licence) · get_code("a08eb1f468081d5f")
How it ran

no invocation recorded.

extract Not yet run
unverified (harvested, no recorded run)
microsoft/layoutgeneration/LayoutDiffusion/improved-diffusion/improved_diffusion/discrete_diffusion.py
code served (permissive licence) · get_code("0108ecd0ce3aeeec")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
log_onehot_to_index
brick of this paper's assembly: helper
3 other papers
2 dated earlier, 1 later · 3 only as an assembly brick
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation
2310.17800 (2023-10)
Interacting Diffusion Processes for Event Sequence Forecasting
index_to_log_onehot
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 1 only as an assembly brick
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Creating graphic layouts is a fundamental step in graphic designs. In this work, we present a novel generative model named LayoutDiffusion for automatic layout generation. As layout is typically represented as a sequence of discrete tokens, LayoutDiffusion models layout generation as a discrete denoising diffusion process. It learns to reverse a mild forward process, in which layouts become increasingly chaotic with the growth of forward steps and layouts in the neighboring steps do not differ too much. Designing such a mild forward process is however very challenging as layout has both categorical attributes and ordinal attributes. To tackle the challenge, we summarize three critical factors for achieving a mild forward process for the layout, i.e., legality, coordinate proximity and type disruption. Based on the factors, we propose a block-wise transition matrix coupled with a piece-wise linear noise schedule. Experiments on RICO and PubLayNet datasets show that LayoutDiffusion outperforms state-of-the-art approaches significantly. Moreover, it enables two conditional layout generation tasks in a plug-and-play manner without re-training and achieves better performance than existing methods. Project

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2303.11589")
get_code_for_paper("2303.11589")
have("2303.11589")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2303.11589.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2303.11589.svg)](https://syntology.ai/paper/2303.11589)

Connect an agent — have() is free.