SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.05478 · CVPR · 2024

Revisiting Non-Autoregressive Transformers for Efficient Image Synthesis

Yulin Wang, Gao Huang, Shiji Song, Jinyi Hu, Zhiyuan Liu, Zanlin Ni, Yuan Yao, Jiayi Guo, Renping Zhou

arXiv · PDF · Open in the Atlas

Code that ran

12 of 16 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; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 10 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2406.05478.json · badge: /api/ran/2406.05478.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
leaplabthu/improvednat canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
LeapLabTHU/ImprovedNAT community
Papers with Code archive
1 ran · 3 no recorded run
FunctionStatusWhere it lives
BertEmbeddings Ran
ran on a synthesized input
LeapLabTHU/ImprovedNAT/libs/nat_model.py
code served (permissive licence) · get_code("7001b82c42bcf7a8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 5, 8) 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 as nn

class BertEmbeddings(nn.Module):
    """Construct the embeddings from word, position and token_type embeddings."""

    def __init__(self, vocab_size, hidden_size, max_position_embeddings, dropout=0.1):
        super().__init__()
        self.word_embeddings = nn.Embedding(vocab_size, hidden_size)
        self.position_embeddings = nn.Embedding(max_position_embeddings, hidden_size)
        self.LayerNorm = nn.LayerNorm(hidden_size, eps=1e-06)
        self.dropout = nn.Dropout(dropout)
        torch.nn.init.normal_(self.word_embeddings.weight, std=0.02)
        torch.nn.init.normal_(self.position_embeddings.weight, std=0.02)

    def forward(self, input_ids):
        position_ids = torch.arange(input_ids.size(1), device=input_ids.device).long().unsqueeze(0)
        position_embeddings = self.position_embeddings(position_ids)
        inputs_embeds = self.word_embeddings(input_ids)
        embeddings = inputs_embeds + position_embeddings
        embeddings = self.LayerNorm(embeddings)
        embeddings = self.dropout(embeddings)
        return embeddings


INIT_ARGS = {
    'vocab_size': 100,
    'hidden_size': 8,
    'max_position_embeddings': 16,
    'dropout': 0.1
}

ARGS = {
    'input_ids': torch.randint(0, 100, (2, 5), dtype=torch.long)
}

if __name__ == '__main__':
    model = BertEmbeddings(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, 5, 8)")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 3, dtype family float, shape (2, 5, 8) — shape (2, 5, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
add_gumbel_noise Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/libs/nat_misc.py
code served (permissive licence) · get_code("9ef9985f5609c318")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 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 numpy as np

torch.manual_seed(0)
np.random.seed(0)

t = torch.randn(2, 4)
temperature = 0.5
device = torch.device('cpu')

ARGS = {
    't': t,
    'temperature': temperature,
    'device': device
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
center_crop Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/dataset.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/adanat, is pointer only (licence: NONE) · get_code("f057bf3471d77c43")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from leaplabthu/adanat, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

center_crop_arr Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/dataset.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/enat, is pointer only (licence: NONE) · get_code("f8b4a29a52612a41")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from leaplabthu/enat, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

count_params Ran
ran, honoured the contract we drafted
leaplabthu/improvednat/taming/modules/util.py
code served (permissive licence) · get_code("5ef87f1a172f152b")
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 int, ndim 0, dtype family int, shape () 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 as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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 int, ndim 0, dtype family int, shape () — shape () 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
customized_lr_scheduler Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/enat, is pointer only (licence: NONE) · get_code("4c4a870f0a791ce8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from leaplabthu/enat, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_lr_scheduler Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/utils.py
code served (permissive licence) · get_code("20380250dc418d5c")
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 LambdaLR. 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 torch
import torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create a simple model with parameters that can be optimized
model = nn.Linear(4, 3)

# Create an optimizer with the model's parameters
optimizer = SGD(model.parameters(), lr=0.01)

# Define all arguments for get_lr_scheduler
ARGS = {
    'optimizer': optimizer,
    'name': 'customized',
    'args': None,
    'warmup_steps': 100
}
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 LambdaLR — a LambdaLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LambdaLR output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
get_optimizer Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/enat, is pointer only (licence: NONE) · get_code("7328f4d3c151e58b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from leaplabthu/enat, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_parameter_device Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/taming/models/modeling_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/enat, is pointer only (licence: NONE) · get_code("bfdddec04a7257ca")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from leaplabthu/enat, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_parameter_dtype Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/taming/models/modeling_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/enat, is pointer only (licence: NONE) · get_code("4f52e71d06a15422")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from leaplabthu/enat, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_state_dict Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/taming/models/modeling_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/enat, is pointer only (licence: NONE) · get_code("934f2eb98d647821")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from leaplabthu/enat, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

random_crop_arr Ran
ran; our contract draft was wrong, not the code
leaplabthu/improvednat/dataset.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/adanat, is pointer only (licence: NONE) · get_code("05d1f95a391c0ec3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from leaplabthu/adanat, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Attention Not yet run
unverified (harvested, no recorded run)
LeapLabTHU/ImprovedNAT/libs/nat_model.py
code served (permissive licence) · get_code("c707cacd32c81e73")
How it ran

no invocation recorded.

Block Not yet run
unverified (harvested, no recorded run)
LeapLabTHU/ImprovedNAT/libs/nat_model.py
code served (permissive licence) · get_code("edd136332f6ae67e")
How it ran

no invocation recorded.

UViT Not yet run
unverified (harvested, no recorded run)
LeapLabTHU/ImprovedNAT/libs/nat_model.py
code served (permissive licence) · get_code("d5608565226216c9")
How it ran

no invocation recorded.

get_logger Not yet run
unverified (harvested, no recorded run)
leaplabthu/improvednat/taming/models/logging.py
pointer only (licence: MIT); the stored copy get_code serves, from Feng-Hong/WINO-DLLM, is pointer only (licence: NONE) · get_code("376bf22d5737fc2a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Feng-Hong/WINO-DLLM, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 12 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 6 the same month, 11 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
center_crop_arr 33 other papers
22 dated earlier, 1 the same month, 9 later, 1 same year, order not determinable
2111.11672 (2021-11)
Few-shot Image Generation with Mixup-based Distance Learning
2111.14818 (2021-11)
Blended Diffusion for Text-driven Editing of Natural Images
2203.15636 (2022-03)
Diffusion Models for Counterfactual Explanations
and 30 more not named here
random_crop_arr 32 other papers
22 dated earlier, 1 the same month, 8 later, 1 same year, order not determinable
2111.11672 (2021-11)
Few-shot Image Generation with Mixup-based Distance Learning
2111.14818 (2021-11)
Blended Diffusion for Text-driven Editing of Natural Images
2203.04306 (2022-03)
Diffusion Models for Medical Anomaly Detection
and 29 more not named here
get_logger 12 other papers
2 dated earlier, 10 later
2004.10964 (2020-04)
Don't Stop Pretraining: Adapt Language Models to Domains and Tasks
2305.01938 (2023-05)
Doc2SoarGraph: Discrete Reasoning over Visually-Rich Table-Text Documents via Semantic-Oriented Hierarchical Graphs
2410.01679 (2024-10)
VinePPO: Refining Credit Assignment in RL Training of LLMs
and 9 more not named here
get_parameter_device 10 other papers
4 dated earlier, 2 the same month, 4 later
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2306.05720 (2023-06)
Beyond Surface Statistics: Scene Representations in a Latent Diffusion Model
2307.10829 (2023-07)
Exact Diffusion Inversion via Bi-directional Integration Approximation
and 7 more not named here
get_parameter_dtype 10 other papers
4 dated earlier, 2 the same month, 4 later
2304.05568 (2023-04)
Improving Diffusion Models for Scene Text Editing with Dual Encoders
2306.05720 (2023-06)
Beyond Surface Statistics: Scene Representations in a Latent Diffusion Model
2307.10829 (2023-07)
Exact Diffusion Inversion via Bi-directional Integration Approximation
and 7 more not named here
center_crop 4 other papers
1 dated earlier, 1 the same month, 1 later, 1 same year, order not determinable
2302.10586 (2023-02)
Diffusion Models and Semi-Supervised Learners Benefit Mutually with Few Labels
2406.09416 (2024-06)
Alleviating Distortion in Image Generation via Multi-Resolution Diffusion Models and Time-Dependent Layer Normalization
and 1 more not named here
count_params 4 other papers
3 dated earlier, 1 same year, order not determinable
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
Li_MAGE_MAsked_Generative_Encoder_To_Unify_Representation_Learning_and_Image_CVPR_2023_paper (2023 (year only))
MAGE: MAsked Generative Encoder to Unify Representation Learning and Image Synthesis
2308.07228 (2023-08)
RestoreFormer++: Towards Real-World Blind Face Restoration from Undegraded Key-Value Pairs
and 1 more not named here
Block
brick of this paper's assembly: model
3 other papers
1 dated earlier, 2 later
2401.15652 (2024-01)
Continuous-Multiple Image Outpainting in One-Step via Positional Query and A Diffusion-based Approach
2410.09633 (2024-10)
DuoDiff: Accelerating Diffusion Models with a Dual-Backbone Approach
2412.15032 (2024-12)
DCTdiff: Intriguing Properties of Image Generative Modeling in the DCT Space
add_gumbel_noise 3 other papers
1 dated earlier, 1 later, 1 same year, order not determinable
2301.00704 (2023-01)
Muse: Text-To-Image Generation via Masked Generative Transformers
2411.06959 (2024-11)
ENAT: Rethinking Spatial-temporal Interactions in Token-based Image Synthesis
get_optimizer 3 other papers
1 the same month, 2 later
2406.09416 (2024-06)
Alleviating Distortion in Image Generation via Multi-Resolution Diffusion Models and Time-Dependent Layer Normalization
2409.00342 (2024-09)
AdaNAT: Exploring Adaptive Policy for Token-Based Image Generation
2411.06959 (2024-11)
ENAT: Rethinking Spatial-temporal Interactions in Token-based Image Synthesis
load_state_dict 2 other papers
2 later
2410.13136 (2024-10)
Unlocking the Capabilities of Masked Generative Models for Image Synthesis via Self-Guidance
2411.06959 (2024-11)
ENAT: Rethinking Spatial-temporal Interactions in Token-based Image Synthesis
customized_lr_scheduler 1 other paper
1 later
2411.06959 (2024-11)
ENAT: Rethinking Spatial-temporal Interactions in Token-based Image Synthesis

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-22.

Repositories linked to this paper

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

Abstract

The field of image synthesis is currently flourishing due to the advancements in diffusion models. While diffusion models have been successful, their computational intensity has prompted the pursuit of more efficient alternatives. As a representative work, non-autoregressive Transformers (NATs) have been recognized for their rapid generation. However, a major drawback of these models is their inferior performance compared to diffusion models. In this paper, we aim to re-evaluate the full potential of NATs by revisiting the design of their training and inference strategies. Specifically, we identify the complexities in properly configuring these strategies and indicate the possible suboptimality in existing heuristic-driven designs. Recognizing this, we propose to go beyond existing methods by directly solving the optimal strategies in an automatic framework. The resulting method, named AutoNAT, advances the performance boundaries of NATs notably, and is able to perform comparably with the latest diffusion models with a significantly reduced inference cost. The effectiveness of AutoNAT is comprehensively validated on four benchmark datasets, i.e., ImageNet-256 & 512, MS-COCO, and CC3M. Code and pre-trained models will be available at https: //github.com/LeapLabTHU/ImprovedNAT.

For agents

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

get_harvested_code_for_paper("2406.05478")
get_code_for_paper("2406.05478")
have("2406.05478")

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

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

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

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

Connect an agent — have() is free.