SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.11838 · NeurIPS · 2024

Autoregressive Image Generation without Vector Quantization

Yonglong Tian, Kaiming He, Tianhong Li, He Li, Mingyang Deng

arXiv · PDF · Open in the Atlas

Code that ran

8 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 2 failures of our instrument; 5 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/2406.11838.json · badge: /api/ran/2406.11838.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
lth14/mar canonical (classifier label)
classifier basis: classifier_2025
7 ran · 5 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
FinalLayer Ran
ran on a synthesized input · constructed an object; no result was computed
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("89c137ff7c13fc84")
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 an instance of its own class, FinalLayer: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

def modulate(x, shift, scale):
    return x * (1 + scale) + shift

class FinalLayer(nn.Module):
    """
    The final layer adopted from DiT.
    """

    def __init__(self, model_channels, out_channels):
        super().__init__()
        self.norm_final = nn.LayerNorm(model_channels, elementwise_affine=False, eps=1e-06)
        self.linear = nn.Linear(model_channels, out_channels, bias=True)
        self.adaLN_modulation = nn.Sequential(nn.SiLU(), nn.Linear(model_channels, 2 * model_channels, bias=True))

    def forward(self, x, c):
        shift, scale = self.adaLN_modulation(c).chunk(2, dim=-1)
        x = modulate(self.norm_final(x), shift, scale)
        x = self.linear(x)
        return x


# Create test data
model_channels = 4
out_channels = 3
batch_size = 2

# x: (batch_size, model_channels)
x = torch.randn(batch_size, model_channels)

# c: (batch_size, model_channels) - condition input for adaLN_modulation
c = torch.randn(batch_size, model_channels)

ARGS = {
    "model_channels": model_channels,
    "out_channels": out_channels,
}
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 FinalLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FinalLayer 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
GaussianDiffusion Ran
ran on a synthesized input · constructed an object; no result was computed
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("de57ba56d49f5ccb")
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 an instance of its own class, GaussianDiffusion: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np
from enum import Enum

# Set seed for reproducibility
torch.manual_seed(0)
np.random.seed(0)

# Import the enums and classes from the function
class LossType(Enum):
    MSE = 1
    RESCALED_MSE = 2
    KL = 3
    RESCALED_KL = 4

    def is_vb(self):
        return self == LossType.KL or self == LossType.RESCALED_KL

class ModelMeanType(Enum):
    PREVIOUS_X = 1
    START_X = 2
    EPSILON = 3

class ModelVarType(Enum):
    LEARNED = 1
    FIXED_SMALL = 2
    FIXED_LARGE = 3
    LEARNED_RANGE = 4

# Create betas: a 1-D numpy array of values between 0 and 1
# Using a simple linear schedule for 10 timesteps
num_timesteps = 10
betas = np.linspace(0.0001, 0.02, num_timesteps).astype(np.float64)

# Define ARGS dict with all parameters for GaussianDiffusion.__init__
ARGS = {
    'betas': betas,
    'model_mean_type': ModelMeanType.EPSILON,
    'model_var_type': ModelVarType.LEARNED,
    'loss_type': LossType.MSE,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GaussianDiffusion — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GaussianDiffusion 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
ResBlock Ran
ran on a synthesized input · constructed an object; no result was computed
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("944b8eccd301a676")
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 an instance of its own class, ResBlock: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Define the modulate function (needed for ResBlock)
def modulate(x, shift, scale):
    return x * (1 + scale) + shift

# Define the ResBlock class
class ResBlock(nn.Module):
    """
    A residual block that can optionally change the number of channels.
    :param channels: the number of input channels.
    """

    def __init__(self, channels):
        super().__init__()
        self.channels = channels
        self.in_ln = nn.LayerNorm(channels, eps=1e-06)
        self.mlp = nn.Sequential(nn.Linear(channels, channels, bias=True), nn.SiLU(), nn.Linear(channels, channels, bias=True))
        self.adaLN_modulation = nn.Sequential(nn.SiLU(), nn.Linear(channels, 3 * channels, bias=True))

    def forward(self, x, y):
        shift_mlp, scale_mlp, gate_mlp = self.adaLN_modulation(y).chunk(3, dim=-1)
        h = modulate(self.in_ln(x), shift_mlp, scale_mlp)
        h = self.mlp(h)
        return x + gate_mlp * h

# Create arguments for ResBlock instantiation
channels = 4

ARGS = {
    "channels": channels
}
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 ResBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ResBlock 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
SimpleMLPAdaLN Ran
ran on a synthesized input · constructed an object; no result was computed
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("11f5d9b171f4a6e3")
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 an instance of its own class, SimpleMLPAdaLN: the run constructed the object and did not call it, so no result was computed. 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
import math

torch.manual_seed(0)

# Define ARGS dictionary with all parameters for SimpleMLPAdaLN
ARGS = {
    "in_channels": 4,
    "model_channels": 8,
    "out_channels": 3,
    "z_channels": 5,
    "num_res_blocks": 2,
    "grad_checkpointing": False,
}
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 SimpleMLPAdaLN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SimpleMLPAdaLN 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
_WrappedModel Ran
ran on a synthesized input · constructed an object; no result was computed
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("68c1d0608671c310")
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 an instance of its own class, _WrappedModel: the run constructed the object and did not call it, so no result was computed. 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 as th
import torch.nn as nn

th.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x, ts, **kwargs):
        # x shape: (batch, 4), ts shape: (batch,)
        # Just return something to demonstrate it works
        return self.linear(x)

model = SimpleModel()

# timestep_map maps original timestep indices to new timestep indices
# For example, if original_num_steps=5, we might map [0,1,2,3,4] to [0,2,4,1,3]
timestep_map = [0, 2, 4, 1, 3]

original_num_steps = 5

ARGS = {
    "model": model,
    "timestep_map": timestep_map,
    "original_num_steps": original_num_steps,
}
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 _WrappedModel — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a _WrappedModel 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
_extract_into_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("086e19314a5cc8b9")
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, 1, 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 as th
import numpy as np

th.manual_seed(0)

# Create a 1-D numpy array to extract from
arr = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8], dtype=np.float32)

# Create timesteps tensor (batch_size=2, indices into arr)
timesteps = th.tensor([1, 3], dtype=th.long, device='cpu')

# Create broadcast_shape: should be [batch_size, 1, ...] with K dimensions
# Using K=4 dimensions: [batch_size=2, 1, 3, 4]
broadcast_shape = (2, 1, 3, 4)

ARGS = {
    'arr': arr,
    'timesteps': timesteps,
    'broadcast_shape': broadcast_shape
}
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 Tensor, ndim 4, dtype family float, shape (2, 1, 3, 4) — shape (2, 1, 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
modulate Ran
ran, honoured the contract we drafted
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("62fcb3912a967a50")
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) 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

torch.manual_seed(0)

# Create small tensors for the modulate function
x = torch.randn(2, 4)  # batch size 2, dimension 4
shift = torch.randn(2, 4)  # same shape as x
scale = torch.randn(2, 4)  # same shape as x

ARGS = {
    "x": x,
    "shift": shift,
    "scale": scale,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
space_timesteps Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from ianyeung/mgld-vsr
pointer only; the stored copy get_code serves, from ianyeung/mgld-vsr, is pointer only (licence: NOASSERTION) · get_code("ea9dbc131adf582e")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

DiffLoss Not yet run
unverified (harvested, no recorded run)
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("0b1b4cb568fcf57f")
How it ran

no invocation recorded.

ModelVarType Not yet run
unverified (harvested, no recorded run)
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("e58dd85eb8661db5")
How it ran

no invocation recorded.

SpacedDiffusion Not yet run
unverified (harvested, no recorded run)
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("5f227e2400952f44")
How it ran

no invocation recorded.

create_diffusion Not yet run
unverified (harvested, no recorded run)
lth14/mar/models/diffloss.py
code served (permissive licence) · get_code("2b4d845f9d4a841f")
How it ran

no invocation recorded.

mask_by_order Not yet run
unverified (harvested, no recorded run)
lth14/mar/models/mar.py
code served (permissive licence) · get_code("d076098d89dd7262")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 9 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 2 the same month, 7 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
space_timesteps
brick of this paper's assembly: helper
57 other papers
31 dated earlier, 2 the same month, 24 later · 2 only as an assembly brick
2010.02502 (2020-10)
Denoising Diffusion Implicit Models
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
and 54 more not named here
modulate
brick of this paper's assembly: helper
27 other papers
3 dated earlier, 1 the same month, 22 later, 1 undated · 2 only as an assembly brick
2312.15736 (2023-12)
Towards Real-World Blind Face Restoration with Generative Diffusion Prior
2404.11199 (2024-04)
RiboDiffusion: Tertiary Structure-based RNA Inverse Folding with Generative Diffusion Models
2405.17527 (2024-05)
Unisolver: PDE-Conditional Transformers Towards Universal Neural PDE Solvers
and 24 more not named here
ModelVarType
brick of this paper's assembly: helper
26 other papers
21 dated earlier, 5 later · 25 only as an assembly brick
2010.02502 (2020-10)
Denoising Diffusion Implicit Models
2105.05233 (2021-05)
Diffusion Models Beat GANs on Image Synthesis
2201.06503 (2022-01)
Analytic-DPM: an Analytic Estimate of the Optimal Reverse Variance in Diffusion Probabilistic Models
and 23 more not named here
_extract_into_tensor
brick of this paper's assembly: helper
5 other papers
4 dated earlier, 1 later · 5 only as an assembly brick
2303.09556 (2023-03)
Efficient Diffusion Training via Min-SNR Weighting Strategy
2306.12511 (2023-06)
Semi-Implicit Denoising Diffusion Models (SIDDMs)
2306.14770 (2023-06)
ProtoDiff: Learning to Learn Prototypical Networks by Task-Guided Diffusion
and 2 more not named here
mask_by_order 4 other papers
3 later, 1 undated
2502.17437 (2025-02)
Fractal Generative Models
2503.08619 (2025-03)
LightGen: Efficient Image Generation through Knowledge Distillation and Direct Preference Optimization
2505.07812 (2025-05)
Continuous Visual Autoregressive Generation via Score Maximization
and 1 more not named here
FinalLayer
brick of this paper's assembly: helper, model
2 other papers
2 later · 1 only as an assembly brick
2505.07812 (2025-05)
Continuous Visual Autoregressive Generation via Score Maximization
2505.13181 (2025-05)
Efficient Speech Language Modeling via Energy Distance in Continuous Latent Space
GaussianDiffusion
brick of this paper's assembly: helper
1 other paper
1 later
2510.21003 (2025-10)
Distilled Decoding 2: One-step Sampling of Image Auto-regressive Models with Conditional Score Distillation
SpacedDiffusion
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2310.15169 (2023-10)
FreeNoise: Tuning-Free Longer Video Diffusion via Noise Rescheduling
_WrappedModel
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2310.15169 (2023-10)
FreeNoise: Tuning-Free Longer Video Diffusion via Noise Rescheduling

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

Conventional wisdom holds that autoregressive models for image generation are typically accompanied by vector-quantized tokens. We observe that while a discrete-valued space can facilitate representing a categorical distribution, it is not a necessity for autoregressive modeling. In this work, we propose to model the per-token probability distribution using a diffusion procedure, which allows us to apply autoregressive models in a continuous-valued space. Rather than using categorical cross-entropy loss, we define a Diffusion Loss function to model the pertoken probability. This approach eliminates the need for discrete-valued tokenizers. We evaluate its effectiveness across a wide range of cases, including standard autoregressive models and generalized masked autoregressive (MAR) variants. By removing vector quantization, our image generator achieves strong results while enjoying the speed advantage of sequence modeling. We hope this work will motivate the use of autoregressive generation in other continuous-valued domains and applications. Code is available at https://github.com/LTH14/mar.

For agents

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

get_harvested_code_for_paper("2406.11838")
get_code_for_paper("2406.11838")
have("2406.11838")

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

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

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

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

Connect an agent — have() is free.