SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.23660 · 2025

D-AR: Diffusion via Autoregressive Models

arXiv · PDF · Open in the Atlas

Code that ran

11 of 14 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 4 have no contract verdict; 5 failures of our instrument; 3 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/2505.23660.json · badge: /api/ran/2505.23660.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
showlab/d-ar canonical (classifier label)
classifier basis not recorded on the link
11 ran · 3 no recorded run
FunctionStatusWhere it lives
build_imagenet Ran
ran; our contract draft was wrong, not the code
showlab/d-ar/dataset/imagenet.py
pointer only (licence: MIT); the stored copy get_code serves, from ThisisBillhe/ZipAR, is pointer only (licence: NONE) · get_code("5cceaa9d0edbce06")
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 ThisisBillhe/ZipAR, 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.

build_imagenet_code Ran
ran; our contract draft was wrong, not the code
showlab/d-ar/dataset/imagenet.py
pointer only (licence: MIT); the stored copy get_code serves, from ThisisBillhe/ZipAR, is pointer only (licence: NONE) · get_code("b6635606f35f6a1a")
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 ThisisBillhe/ZipAR, 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
showlab/d-ar/dataset/augmentation.py
code served (permissive licence) · get_code("1712a07966b542ee")
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 Image. 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
from PIL import Image

# Create a small test image
width, height = 256, 256
pil_image = Image.new('RGB', (width, height), color='red')

# Define arguments
ARGS = {
    'pil_image': pil_image,
    'image_size': 64
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
decode_img_tensor Ran
ran on a synthesized input
showlab/d-ar/sample_tokenizer.py
code served (permissive licence) · get_code("f0846b326b0d4987")
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, 3, 4, 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)

# The function decode_img_tensor takes a single parameter x, which is a tensor
# It performs operations: x.new_tensor(), view(), multiplication, addition, clamp(), detach(), cpu()
# So x should be a torch tensor with shape (3, H, W) or (batch, 3, H, W)

# Create a small input tensor with shape (2, 3, 4, 4) - batch of 2, 3 channels, 4x4 spatial dims
x = torch.randn(2, 3, 4, 4)

ARGS = {
    "x": x
}
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, 3, 4, 4) — shape (2, 3, 4, 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
find_multiple Ran
ran, honoured the contract we drafted
showlab/d-ar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("f6ff7671338c9c92")
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 numpy as np

torch.manual_seed(0)

# Analyze the function: find_multiple(n: int, k: int)
# The function takes two integers and returns an integer
# It checks if n is divisible by k, and if not, rounds n up to the next multiple of k

ARGS = {
    "n": 10,
    "k": 3
}
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 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
get_indices Ran
ran on a synthesized input
showlab/d-ar/sample_tokenizer.py
code served (permissive licence) · get_code("9d5534fb9e2589da")
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 list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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

BATCH_SIZE = 4

def get_indices(dataset_name):
    if dataset_name == 'imagenet':
        return [i for i in range(BATCH_SIZE)]
    return None

ARGS = {
    'dataset_name': 'imagenet'
}
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 list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
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
getitem Ran
ran on a synthesized input
showlab/d-ar/config_util.py
code served (permissive licence) · get_code("e8b5a038915ac61e")
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 operator
import torch

torch.manual_seed(0)

# Test case 1: Dictionary with valid key
obj1 = {"a": 1, "b": 2, "c": 3}
key1 = "a"
default1 = None

# Test case 2: List with valid index
obj2 = [10, 20, 30, 40]
key2 = 1
default2 = None

# Test case 3: Dictionary with missing key (should use default)
obj3 = {"x": 100}
key3 = "missing_key"
default3 = "default_value"

# Test case 4: List with out-of-bounds index (should use default)
obj4 = [1, 2, 3]
key4 = 10
default4 = -1

# Test case 5: Tensor (supports indexing)
obj5 = torch.randn(4, 3)
key5 = 0
default5 = torch.tensor([0.0])

# Test case 6: Object that doesn't support the operation (should use default)
obj6 = 42
key6 = "invalid"
default6 = "fallback"

# Use the first test case for ARGS
ARGS = {
    "obj": obj1,
    "key": key1,
    "default": default1
}
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
precompute_freqs_cis_1d Ran
ran on a synthesized input
showlab/d-ar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("aab87c3310945af0")
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 3, dtype family float, shape (8, 2, 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)

ARGS = {
    "seq_len": 8,
    "n_elem": 4,
    "base": 10000,
}
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 3, dtype family float, shape (8, 2, 2) — shape (8, 2, 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
precompute_freqs_cis_2d Ran
ran, honoured the contract we drafted
showlab/d-ar/autoregressive/serve/gpt_model.py
code served (permissive licence) · get_code("7f53b2cdcd16fad9")
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 3, dtype family float, shape (18, 4, 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)

ARGS = {
    "grid_size": 4,
    "n_elem": 8,
    "base": 10000,
    "cls_token_num": 2,
}
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 3, dtype family float, shape (18, 4, 2) — shape (18, 4, 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
sample Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
showlab/d-ar/autoregressive/models/generate.py
pointer only (licence: MIT); the stored copy get_code serves, from ThisisBillhe/ZipAR, is pointer only (licence: NONE) · get_code("de8908ac0f302419")
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 ThisisBillhe/ZipAR, 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.

top_k_top_p_filtering Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
showlab/d-ar/autoregressive/models/generate.py
pointer only (licence: MIT); the stored copy get_code serves, from ThisisBillhe/ZipAR, is pointer only (licence: NONE) · get_code("f2fea48028c7ae80")
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 ThisisBillhe/ZipAR, 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.

logits_to_probs Not yet run
unverified (harvested, no recorded run)
showlab/d-ar/autoregressive/models/generate.py
pointer only (licence: MIT); the stored copy get_code serves, from ThisisBillhe/ZipAR, is pointer only (licence: NONE) · get_code("9dac59261197935f")
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 ThisisBillhe/ZipAR, 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.

precompute_freqs_cis Not yet run
unverified (harvested, no recorded run)
showlab/d-ar/autoregressive/models/gpt.py
pointer only (licence: MIT); the stored copy get_code serves, from ThisisBillhe/ZipAR, is pointer only (licence: NONE) · get_code("0f0ff4e443413018")
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 ThisisBillhe/ZipAR, 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.

random_crop_arr Not yet run
unverified (harvested, no recorded run)
showlab/d-ar/dataset/augmentation.py
pointer only (licence: MIT); the stored copy get_code serves, from ThisisBillhe/ZipAR, is pointer only (licence: NONE) · get_code("980fb099f82d8b84")
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 ThisisBillhe/ZipAR, 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 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 9 the same month, 2 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 37 other papers
31 dated earlier, 1 the same month, 3 later, 2 same year, order not determinable
2211.17091 (2022-11)
Refining Generative Process with Discriminator Guidance in Score-based Diffusion Models
2212.09748 (2022-12)
Scalable Diffusion Models with Transformers
2311.09257 (2023-11)
UFOGen: You Forward Once Large Scale Text-to-Image Generation via Diffusion GANs
and 34 more not named here
find_multiple 13 other papers
11 dated earlier, 1 the same month, 1 undated · 2 only as an assembly brick
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2409.13689 (2024-09)
Temporally Aligned Audio for Video with Autoregression
2410.02705 (2024-10)
ControlAR: Controllable Image Generation with Autoregressive Models
and 10 more not named here
precompute_freqs_cis_2d 9 other papers
7 dated earlier, 1 the same month, 1 undated · 2 only as an assembly brick
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2409.13689 (2024-09)
Temporally Aligned Audio for Video with Autoregression
2410.02705 (2024-10)
ControlAR: Controllable Image Generation with Autoregressive Models
and 6 more not named here
top_k_top_p_filtering 8 other papers
5 dated earlier, 1 the same month, 1 later, 1 undated
2106.13219 (2021-06)
Towards Understanding and Mitigating Social Biases in Language Models
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2410.02705 (2024-10)
ControlAR: Controllable Image Generation with Autoregressive Models
and 5 more not named here
precompute_freqs_cis 7 other papers
5 dated earlier, 1 the same month, 1 undated
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2410.02705 (2024-10)
ControlAR: Controllable Image Generation with Autoregressive Models
2411.15867 (2024-11)
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
and 4 more not named here
logits_to_probs 6 other papers
4 dated earlier, 1 the same month, 1 undated
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2410.02705 (2024-10)
ControlAR: Controllable Image Generation with Autoregressive Models
2411.15867 (2024-11)
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
and 3 more not named here
build_imagenet 5 other papers
4 dated earlier, 1 the same month
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2410.02705 (2024-10)
ControlAR: Controllable Image Generation with Autoregressive Models
2412.03069 (2024-12)
TokenFlow: Unified Image Tokenizer for Multimodal Understanding and Generation
and 2 more not named here
sample 5 other papers
3 dated earlier, 1 the same month, 1 undated
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2411.15867 (2024-11)
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
2412.04062 (2024-12)
ZipAR: Parallel Auto-regressive Image Generation through Spatial Locality
and 2 more not named here
random_crop_arr 4 other papers
4 dated earlier
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2412.03069 (2024-12)
TokenFlow: Unified Image Tokenizer for Multimodal Understanding and Generation
2412.04062 (2024-12)
ZipAR: Parallel Auto-regressive Image Generation through Spatial Locality
and 1 more not named here
build_imagenet_code 3 other papers
2 dated earlier, 1 the same month
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2412.04062 (2024-12)
ZipAR: Parallel Auto-regressive Image Generation through Spatial Locality
2505.14673 (2025-05)
Training-Free Watermarking for Autoregressive 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

This paper presents Diffusion via Autoregressive models (D-AR), a new paradigm recasting the image diffusion process as a vanilla autoregressive procedure in the standard next-token-prediction fashion. We start by designing the tokenizer that converts images into sequences of discrete tokens, where tokens in different positions can be decoded into different diffusion denoising steps in the pixel space. Thanks to the diffusion properties, these tokens naturally follow a coarse-to-fine order, which directly lends itself to autoregressive modeling. Therefore, we apply standard next-token prediction on these tokens, without modifying any underlying designs (either causal masks or training/inference strategies), and such sequential autoregressive token generation directly mirrors the diffusion procedure in image space. That is, once the autoregressive model generates an increment of tokens, we can directly decode these tokens into the corresponding diffusion denoising step in the streaming manner. Our pipeline naturally reveals several intriguing properties, for example, it supports consistent previews when generating only a subset of tokens and enables zero-shot layout-controlled synthesis. On the standard ImageNet benchmark, our method achieves 2.09 FID using a 775M Llama backbone with 256 discrete tokens. We hope our work can inspire future research on unified autoregressive architectures of visual synthesis, especially with large language models. Code and models will be available at https://github.com/showlab/D-AR

For agents

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

get_harvested_code_for_paper("2505.23660")
get_code_for_paper("2505.23660")
have("2505.23660")

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

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

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

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

Connect an agent — have() is free.