SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.02705 · ICLR · 2025

ControlAR: Controllable Image Generation with Autoregressive Models

Wenyu Liu, Xinggang Wang, Peize Sun, Shoufa Chen, Tianheng Cheng, Xiaoxin Chen, Zongming Li, Haocheng Shen, Longjin Ran

arXiv · PDF · Open in the Atlas

Code that ran

17 of 24 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 1 violated it and 10 have no contract verdict; 4 failures of our instrument; 7 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/2410.02705.json · badge: /api/ran/2410.02705.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
hustvl/ControlAR canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
hustvl/controlar community
Papers with Code archive
12 ran · 5 no recorded run
FunctionStatusWhere it lives
CaptionEmbedder Ran
ran on a synthesized input · constructed an object; no result was computed
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("0a1aa4e4837aba74")
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, CaptionEmbedder: 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)

# Build a CaptionEmbedder instance with valid arguments
in_channels = 4
hidden_size = 8
uncond_prob = 0.1
token_num = 120

ARGS = {
    'in_channels': in_channels,
    'hidden_size': hidden_size,
    'uncond_prob': uncond_prob,
    'token_num': token_num,
}
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 CaptionEmbedder — 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 CaptionEmbedder 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
ConditionEmbedder Ran
ran on a synthesized input · constructed an object; no result was computed
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("28672d2f5d6d75b9")
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, ConditionEmbedder: 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)

# Build minimal arguments for ConditionEmbedder.__init__
in_channels = 3
hidden_size = 4
uncond_prob = 0.1
token_num = 5
vocab_size = 100

ARGS = {
    'in_channels': in_channels,
    'hidden_size': hidden_size,
    'uncond_prob': uncond_prob,
    'token_num': token_num,
    'vocab_size': vocab_size,
}
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 ConditionEmbedder — 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 ConditionEmbedder 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
DropPath Ran
ran on a synthesized input · constructed an object; no result was computed
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("76f9e42efc0d4711")
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, DropPath: 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)

# Construct a small input tensor (batch_size=2, channels=4)
x = torch.randn(2, 4)

# Define arguments for DropPath.__init__
ARGS = {
    'drop_prob': 0.5,
    'scale_by_keep': True,
}
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 DropPath — 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 DropPath 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
FeedForward Ran
ran on a synthesized input · constructed an object; no result was computed
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("cf99c2811308e5e5")
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, FeedForward: 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
from dataclasses import dataclass
from typing import Optional

torch.manual_seed(0)

@dataclass
class ModelArgs:
    dim: int = 4096
    n_layer: int = 32
    n_head: int = 32
    n_kv_head: Optional[int] = None
    multiple_of: int = 256
    ffn_dim_multiplier: Optional[float] = None
    rope_base: float = 10000
    norm_eps: float = 1e-05
    initializer_range: float = 0.02
    token_dropout_p: float = 0.1
    attn_dropout_p: float = 0.0
    resid_dropout_p: float = 0.1
    ffn_dropout_p: float = 0.1
    drop_path_rate: float = 0.0
    num_classes: int = 1000
    caption_dim: int = 2048
    class_dropout_prob: float = 0.1
    model_type: str = 'c2i'
    vocab_size: int = 16384
    cls_token_num: int = 1
    block_size: int = 256
    max_batch_size: int = 32
    max_seq_len: int = 2048
    condition_token_num: int = 256
    image_size: int = 256

def find_multiple(n: int, k: int):
    if n % k == 0:
        return n
    return n + k - n % k

class FeedForward(nn.Module):

    def __init__(self, config: ModelArgs):
        super().__init__()
        hidden_dim = 4 * config.dim
        hidden_dim = int(2 * hidden_dim / 3)
        if config.ffn_dim_multiplier is not None:
            hidden_dim = int(config.ffn_dim_multiplier * hidden_dim)
        hidden_dim = find_multiple(hidden_dim, config.multiple_of)
        self.w1 = nn.Linear(config.dim, hidden_dim, bias=False)
        self.w3 = nn.Linear(config.dim, hidden_dim, bias=False)
        self.w2 = nn.Linear(hidden_dim, config.dim, bias=False)
        self.ffn_dropout = nn.Dropout(config.ffn_dropout_p)

    def forward(self, x):
        from torch.nn import functional as F
        return self.ffn_dropout(self.w2(F.silu(self.w1(x)) * self.w3(x)))

config = ModelArgs(
    dim=64,
    n_layer=2,
    n_head=4,
    n_kv_head=None,
    multiple_of=256,
    ffn_dim_multiplier=None,
    rope_base=10000.0,
    norm_eps=1e-05,
    initializer_range=0.02,
    token_dropout_p=0.1,
    attn_dropout_p=0.0,
    resid_dropout_p=0.1,
    ffn_dropout_p=0.1,
    drop_path_rate=0.0,
    num_classes=1000,
    caption_dim=2048,
    class_dropout_prob=0.1,
    model_type='c2i',
    vocab_size=16384,
    cls_token_num=1,
    block_size=256,
    max_batch_size=32,
    max_seq_len=2048,
    condition_token_num=256,
    image_size=256
)

ARGS = {
    'config': config
}
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 FeedForward — 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 FeedForward 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
KVCache Ran
ran on a synthesized input · constructed an object; no result was computed
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("0b441179596bf2b5")
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, KVCache: 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)

# Parameters for KVCache.__init__
max_batch_size = 2
max_seq_length = 8
n_head = 4
head_dim = 3
dtype = torch.float32

ARGS = {
    'max_batch_size': max_batch_size,
    'max_seq_length': max_seq_length,
    'n_head': n_head,
    'head_dim': head_dim,
    'dtype': dtype,
}
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 KVCache — 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 KVCache 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
LabelEmbedder Ran
ran on a synthesized input
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("7a710e6cde2ae35c")
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 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 torch
import torch.nn as nn

class LabelEmbedder(nn.Module):
    """
    Embeds class labels into vector representations. Also handles label dropout for classifier-free guidance.
    """

    def __init__(self, num_classes, hidden_size, dropout_prob):
        super().__init__()
        use_cfg_embedding = dropout_prob > 0
        self.embedding_table = nn.Embedding(num_classes + use_cfg_embedding, hidden_size)
        self.num_classes = num_classes
        self.dropout_prob = dropout_prob

    def token_drop(self, labels, force_drop_ids=None):
        """
        Drops labels to enable classifier-free guidance.
        """
        if force_drop_ids is None:
            drop_ids = torch.rand(labels.shape[0], device=labels.device) < self.dropout_prob
        else:
            drop_ids = force_drop_ids == 1
        labels = torch.where(drop_ids, self.num_classes, labels)
        return (labels, drop_ids)

    def forward(self, labels, train, force_drop_ids=None):
        use_dropout = self.dropout_prob > 0
        if train and use_dropout or force_drop_ids is not None:
            labels, drop_ids = self.token_drop(labels, force_drop_ids)
        embeddings = self.embedding_table(labels).unsqueeze(1)
        if train and use_dropout or force_drop_ids is not None:
            return (embeddings, drop_ids)
        else:
            return embeddings


INIT_ARGS = {
    "num_classes": 5,
    "hidden_size": 4,
    "dropout_prob": 0.1,
}

ARGS = {
    "labels": torch.tensor([0, 2, 1, 4, 3]),
    "train": True,
    "force_drop_ids": None,
}

if __name__ == "__main__":
    model = LabelEmbedder(**INIT_ARGS)
    output = model(**ARGS)
    print("Output type:", type(output))
    if isinstance(output, tuple):
        embeddings, drop_ids = output
        print("Embeddings shape:", embeddings.shape)
        print("Drop IDs shape:", drop_ids.shape)
    else:
        print("Embeddings shape:", output.shape)
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 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MLP Ran
ran on a synthesized input · constructed an object; no result was computed
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("eec94bbc10306be0")
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, MLP: 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)

ARGS = {
    'in_features': 4,
    'hidden_features': 8,
    'out_features': 3,
}
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 MLP — 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 MLP 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
ModelArgs Ran
ran on a synthesized input · constructed an object; no result was computed
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("9e7e8b336fa1eb12")
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, ModelArgs: 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
from dataclasses import dataclass
from typing import Optional

torch.manual_seed(0)

ARGS = {
    "dim": 4096,
    "n_layer": 32,
    "n_head": 32,
    "n_kv_head": None,
    "multiple_of": 256,
    "ffn_dim_multiplier": None,
    "rope_base": 10000.0,
    "norm_eps": 1e-05,
    "initializer_range": 0.02,
    "token_dropout_p": 0.1,
    "attn_dropout_p": 0.0,
    "resid_dropout_p": 0.1,
    "ffn_dropout_p": 0.1,
    "drop_path_rate": 0.0,
    "num_classes": 1000,
    "caption_dim": 2048,
    "class_dropout_prob": 0.1,
    "model_type": "c2i",
    "vocab_size": 16384,
    "cls_token_num": 1,
    "block_size": 256,
    "max_batch_size": 32,
    "max_seq_len": 2048,
    "condition_token_num": 256,
    "image_size": 256,
}
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 ModelArgs — 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 ModelArgs 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
RMSNorm Ran
ran on a synthesized input · constructed an object; no result was computed
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("edd6b8543cc0d1ab")
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, RMSNorm: 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)

# RMSNorm only uses:
# - dim: int (passed to torch.ones in __init__)
# - eps: float (used in _norm for numerical stability)
# - weight: nn.Parameter (created in __init__, used in forward)
# - x: tensor input to forward (needs to support .float() and .type_as())

# Create a small input tensor: batch_size=2, embedding_dim=4
x = torch.randn(2, 4)

ARGS = {
    "dim": 4,
    "eps": 1e-05,
}
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 RMSNorm — 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 RMSNorm 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
build_imagenet Ran
ran; our contract draft was wrong, not the code
hustvl/ControlAR/dataset/imagenet.py
pointer only (licence: Apache-2.0); 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 (Apache-2.0), 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
hustvl/ControlAR/dataset/imagenet.py
code served (permissive licence) · get_code("489c6f42beab887e")
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 CustomDataset. 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 numpy as np
import os
import tempfile
import shutil

torch.manual_seed(0)

# Create temporary directories with minimal structure
temp_dir = tempfile.mkdtemp()
code_path = temp_dir

# Create the required directories
feature_dir = os.path.join(code_path, 'imagenet256_codes')
label_dir = os.path.join(code_path, 'imagenet256_labels')
condition_dir = os.path.join(code_path, 'imagenet256_canny_codes')

os.makedirs(feature_dir, exist_ok=True)
os.makedirs(label_dir, exist_ok=True)
os.makedirs(condition_dir, exist_ok=True)

# Create minimal dummy .npy files
num_files = 2
for i in range(num_files):
    # Feature files: shape (4, 3) - latent codes
    np.save(os.path.join(feature_dir, f'{i}.npy'), np.random.randn(4, 3).astype(np.float32))
    # Label files: shape (10,) - class labels
    np.save(os.path.join(label_dir, f'{i}.npy'), np.random.randint(0, 1000, size=(10,)).astype(np.int64))
    # Condition files: shape (3, 8, 8) - condition codes
    np.save(os.path.join(condition_dir, f'{i}.npy'), np.random.randn(3, 8, 8).astype(np.float32))

# Create a mock args object
class Args:
    def __init__(self):
        self.code_path = code_path
        self.image_size = 256
        self.condition_type = 'canny'
        self.get_condition_img = False

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CustomDataset — a CustomDataset 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
create_npz_from_sample_folder Ran
ran; our contract draft was wrong, not the code
hustvl/ControlAR/create_npz.py
code served (permissive licence) · get_code("432162d12f959985")
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 str. 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 tempfile
import os
import numpy as np
from PIL import Image

# Create a temporary directory with sample PNG files
temp_dir = tempfile.mkdtemp()

# Create a few small PNG images for testing
for i in range(5):
    img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(temp_dir, f'sample_{i}.png'))

# Define arguments for the function
ARGS = {
    'sample_dir': temp_dir,
    'num': 50000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
find_multiple Ran
ran, honoured the contract we drafted
hustvl/controlar/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_causal_mask Ran
ran, violated the contract we drafted
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("8e142bd1a80ed2ff")
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 2, dtype family float, shape (5, 5) 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)

seq_length = 5

ARGS = {
    "seq_length": seq_length
}
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 2, dtype family float, shape (5, 5) — shape (5, 5) 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
hustvl/controlar/autoregressive/models/gpt.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 on a synthesized input
hustvl/ControlAR/autoregressive/models/generate.py
code served (permissive licence) · get_code("2c1c9c90fbedc5d3")
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 torch
import torch.nn as nn
from torch.nn import functional as F

torch.manual_seed(0)

# Create a small logits tensor
# Shape: (batch_size, sequence_length, vocab_size)
# batch_size=2, sequence_length=5, vocab_size=4
logits = torch.randn(2, 5, 4)

# Define all parameters for the sample function
ARGS = {
    "logits": logits,
    "temperature": 1.0,
    "top_k": 2000,
    "top_p": 1.0,
    "sample_logits": True,
}
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 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
top_k_top_p_filtering Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hustvl/ControlAR/autoregressive/models/generate.py
pointer only (licence: Apache-2.0); 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 (Apache-2.0), 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.

Attention Not yet run
unverified (harvested, no recorded run)
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("8320019fce428945")
How it ran

no invocation recorded.

Transformer Not yet run
unverified (harvested, no recorded run)
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("152a894d1340f06b")
How it ran

no invocation recorded.

TransformerBlock Not yet run
unverified (harvested, no recorded run)
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("7baa685224160fe5")
How it ran

no invocation recorded.

ViT_Adapter Not yet run
unverified (harvested, no recorded run)
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("7ea7bc571b41dc22")
How it ran

no invocation recorded.

apply_rotary_emb Not yet run
unverified (harvested, no recorded run)
hustvl/controlar/autoregressive/models/gpt.py
code served (permissive licence) · get_code("29173bf6147634f3")
How it ran

no invocation recorded.

logits_to_probs Not yet run
unverified (harvested, no recorded run)
hustvl/ControlAR/autoregressive/models/generate.py
pointer only (licence: Apache-2.0); 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 (Apache-2.0), 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)
hustvl/ControlAR/autoregressive/models/gpt.py
pointer only (licence: Apache-2.0); 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 (Apache-2.0), 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 24 samples lifted from this paper's linked repositories, 24 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 14 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 1 the same month, 14 later) and 10 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
find_multiple
brick of this paper's assembly: helper
13 other papers
2 dated earlier, 1 the same month, 9 later, 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.21264 (2024-10)
LARP: Tokenizing Videos with a Learned Autoregressive Generative Prior
and 10 more not named here
precompute_freqs_cis_2d
brick of this paper's assembly: helper
9 other papers
2 dated earlier, 6 later, 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
2411.15867 (2024-11)
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
and 6 more not named here
top_k_top_p_filtering 8 other papers
2 dated earlier, 5 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
2411.15867 (2024-11)
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
and 5 more not named here
precompute_freqs_cis 7 other papers
1 dated earlier, 5 later, 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 4 more not named here
logits_to_probs 6 other papers
1 dated earlier, 4 later, 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 3 more not named here
build_imagenet 5 other papers
1 dated earlier, 4 later
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 2 more not named here
Attention
brick of this paper's assembly: model
3 other papers
3 later
Zhou_PanoLlama_Generating_Endless_and_Coherent_Panoramas_with_Next-Token-Prediction_LLMs_ICCV_2025_paper (2025 (year only))
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
2501.00880 (2025-01)
Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction
2503.10696 (2025-03)
Neighboring Autoregressive Modeling for Efficient Visual Generation
DropPath
brick of this paper's assembly: helper
3 other papers
3 later · 2 only as an assembly brick
Zhou_PanoLlama_Generating_Endless_and_Coherent_Panoramas_with_Next-Token-Prediction_LLMs_ICCV_2025_paper (2025 (year only))
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
2501.00880 (2025-01)
Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction
2503.10696 (2025-03)
Neighboring Autoregressive Modeling for Efficient Visual Generation
FeedForward
brick of this paper's assembly: model
3 other papers
3 later
Zhou_PanoLlama_Generating_Endless_and_Coherent_Panoramas_with_Next-Token-Prediction_LLMs_ICCV_2025_paper (2025 (year only))
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
2501.00880 (2025-01)
Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction
2503.10696 (2025-03)
Neighboring Autoregressive Modeling for Efficient Visual Generation
TransformerBlock
brick of this paper's assembly: model
3 other papers
3 later
Zhou_PanoLlama_Generating_Endless_and_Coherent_Panoramas_with_Next-Token-Prediction_LLMs_ICCV_2025_paper (2025 (year only))
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
2501.00880 (2025-01)
Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction
2503.10696 (2025-03)
Neighboring Autoregressive Modeling for Efficient Visual Generation
CaptionEmbedder
brick of this paper's assembly: model
2 other papers
2 later · 1 only as an assembly brick
2501.00880 (2025-01)
Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction
2503.10696 (2025-03)
Neighboring Autoregressive Modeling for Efficient Visual Generation
KVCache
brick of this paper's assembly: helper
2 other papers
2 later · 2 only as an assembly brick
2501.00880 (2025-01)
Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction
2503.10696 (2025-03)
Neighboring Autoregressive Modeling for Efficient Visual Generation
RMSNorm
brick of this paper's assembly: model
2 other papers
2 later · 2 only as an assembly brick
2501.00880 (2025-01)
Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction
2503.10696 (2025-03)
Neighboring Autoregressive Modeling for Efficient Visual Generation
apply_rotary_emb
brick of this paper's assembly: helper
2 other papers
2 later · 2 only as an assembly brick
2501.00880 (2025-01)
Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction
2503.10696 (2025-03)
Neighboring Autoregressive Modeling for Efficient Visual 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-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

Autoregressive (AR) models have reformulated image generation as next-token prediction, demonstrating remarkable potential and emerging as strong competitors to diffusion models. However, control-to-image generation, akin to Control-Net, remains largely unexplored within AR models. Although a natural approach, inspired by advancements Large Language Models, is to tokenize control images into tokens and prefill them into the autoregressive model before decoding image tokens, it still falls short in generation quality compared to ControlNet and suffers from inefficiency. To this end, we introduce ControlAR, an efficient and effective framework for integrating spatial controls into autoregressive image generation models. Firstly, we explore control encoding for AR models and propose a lightweight control encoder to transform spatial inputs (e.g., canny edges or depth maps) into control tokens. Then ControlAR exploits the conditional decoding method to generate the next image token conditioned on the per-token fusion between control and image tokens, similar to positional encodings. Compared to prefilling tokens, using conditional decoding significantly strengthens the control capability of AR models but also maintains the model efficiency. Furthermore, the proposed ControlAR surprisingly empowers AR models with arbitraryresolution image generation via conditional decoding and the specific controls. Extensive experiments can demonstrate the controllability of the proposed Con-trolAR for the autoregressive control-to-image generation across diverse inputs, including edges, depths, and segmentation masks. Furthermore, both quantitative and qualitative results indicate that ControlAR surpasses previous state-of-the-art controllable diffusion models, e.g., ControlNet++. The code, models, and demo will soon be available at https://github.com/hustvl/ControlAR.

For agents

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

get_harvested_code_for_paper("2410.02705")
get_code_for_paper("2410.02705")
have("2410.02705")

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

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

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

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

Connect an agent — have() is free.