SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2507.02358 · ICCV · 2025

Holistic Tokenizer for Autoregressive Image Generation

Hong Kong, Xiaojuan Qi, Xiangyu Zhang, Anlin Zheng, Yucheng Zhao, Haochen Wang, Tiancai Wang, Dexmal, Weipeng Deng, Megvii Techonology

arXiv · PDF · Open in the Atlas

Code that ran

4 of 11 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; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 7 no recorded run), measured 2026-11-23; 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/2507.02358.json · badge: /api/ran/2507.02358.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
CVMI-Lab/Hita community
Papers with Code archive
4 ran · 7 no recorded run
FunctionStatusWhere it lives
ResnetBlock Ran
ran on a synthesized input
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("a24bc3f008abf6dc")
How it ran

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

def Normalize(in_channels, norm_type='group'):
    assert norm_type in ['group', 'batch']
    if norm_type == 'group':
        return nn.GroupNorm(num_groups=32, num_channels=in_channels, eps=1e-06, affine=True)
    elif norm_type == 'batch':
        return nn.SyncBatchNorm(in_channels)

def nonlinearity(x):
    return x * torch.sigmoid(x)

class ResnetBlock(nn.Module):

    def __init__(self, in_channels, out_channels=None, conv_shortcut=False, dropout=0.0, norm_type='group'):
        super().__init__()
        self.in_channels = in_channels
        out_channels = in_channels if out_channels is None else out_channels
        self.out_channels = out_channels
        self.use_conv_shortcut = conv_shortcut
        self.norm1 = Normalize(in_channels, norm_type)
        self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1, padding=1)
        self.norm2 = Normalize(out_channels, norm_type)
        self.dropout = nn.Dropout(dropout)
        self.conv2 = nn.Conv2d(out_channels, out_channels, kernel_size=3, stride=1, padding=1)
        if self.in_channels != self.out_channels:
            if self.use_conv_shortcut:
                self.conv_shortcut = nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1, padding=1)
            else:
                self.nin_shortcut = nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=1, padding=0)

    def forward(self, x):
        h = x
        h = self.norm1(h)
        h = nonlinearity(h)
        h = self.conv1(h)
        h = self.norm2(h)
        h = nonlinearity(h)
        h = self.dropout(h)
        h = self.conv2(h)
        if self.in_channels != self.out_channels:
            if self.use_conv_shortcut:
                x = self.conv_shortcut(x)
            else:
                x = self.nin_shortcut(x)
        return x + h

INIT_ARGS = {
    'in_channels': 64,
    'out_channels': 96,
    'conv_shortcut': False,
    'dropout': 0.1,
    'norm_type': 'group'
}

ARGS = {
    'x': torch.randn(2, 64, 8, 8)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
compute_entropy_loss Ran
ran; our contract draft was wrong, not the code
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("18f299635e1403d0")
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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small affinity tensor
# Shape: (batch_size, num_samples, num_classes)
# Using distinct dimensions: 2 (batch), 3 (samples), 4 (classes)
affinity = torch.randn(2, 3, 4)

ARGS = {
    'affinity': affinity,
    'loss_type': 'softmax',
    'temperature': 0.01
}
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 0, dtype family float, 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_obj_from_str Ran
ran; our contract draft was wrong, not the code
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("ce0cea52e4db5e7c")
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 type. 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 importlib
import torch
import torch.nn as nn

# The function get_obj_from_str takes a string in the format "module.ClassName"
# and returns the class object. It uses:
# - string.rsplit('.', 1) to split the string
# - importlib.import_module() to import the module
# - importlib.reload() if reload=True
# - getattr() to get the class from the module

# We need to provide a valid string that points to an actual class
# Let's use a built-in class that exists in a standard library module

# Example: "torch.nn.Linear" points to the Linear class in torch.nn
# This is a valid class that can be imported and retrieved

ARGS = {
    "string": "torch.nn.Linear",
    "reload": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
requests, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
nonlinearity Ran
ran; our contract draft was wrong, not the code
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("95e759219bcd1ec6")
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)

def nonlinearity(x):
    return x * torch.sigmoid(x)

# The function takes a single parameter 'x' which is used in:
# - x * torch.sigmoid(x)
# This means x should be a tensor that supports element-wise multiplication
# and can be passed to torch.sigmoid()

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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
AttnBlock Not yet run
unverified (harvested, no recorded run)
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("7cbb211518a363dd")
How it ran

no invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("7c5bf091a2004b88")
How it ran

no invocation recorded.

Encoder Not yet run
unverified (harvested, no recorded run)
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("bc9598464461a9b6")
How it ran

no invocation recorded.

ModelArgs Not yet run
unverified (harvested, no recorded run)
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("3178f73bb7451cbd")
How it ran

no invocation recorded.

VQModel Not yet run
unverified (harvested, no recorded run)
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("033fb16e7ea4003f")
How it ran

no invocation recorded.

VectorQuantizer Not yet run
unverified (harvested, no recorded run)
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("34bc3c152c7cea14")
How it ran

no invocation recorded.

instantiate_from_config Not yet run
unverified (harvested, no recorded run)
CVMI-Lab/Hita/hita/tokenizer/tokenizer_image/vq_model.py
code served (permissive licence) · get_code("57f372e8c0555c75")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 1 the same month, 7 later) and 3 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
nonlinearity
brick of this paper's assembly: helper
156 other papers
140 dated earlier, 2 the same month, 14 later · 25 only as an assembly brick
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2106.00132 (2021-06)
On Fast Sampling of Diffusion Probabilistic Models
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
and 153 more not named here
get_obj_from_str
brick of this paper's assembly: helper
54 other papers
48 dated earlier, 6 later · 12 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
and 51 more not named here
instantiate_from_config
brick of this paper's assembly: helper
13 other papers
13 dated earlier · 1 only as an assembly brick
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
2301.13670 (2023-01)
What Makes Good Examples for Visual In-Context Learning?
2306.14795 (2023-06)
MotionGPT: Human Motion as a Foreign Language
and 10 more not named here
compute_entropy_loss
brick of this paper's assembly: loss
10 other papers
8 dated earlier, 2 later · 2 only as an assembly brick
2408.12245 (2024-08)
Scalable Autoregressive Image Generation with Mamba
2411.15867 (2024-11)
PanoLlama: Generating Endless and Coherent Panoramas with Next-Token-Prediction LLMs
2502.20313 (2025-02)
FlexVAR: Flexible Visual Autoregressive Modeling without Residual Prediction
and 7 more not named here
AttnBlock
brick of this paper's assembly: model
3 other papers
2 dated earlier, 1 later · 2 only as an assembly brick
2504.08736 (2025-04)
GigaTok: Scaling Visual Tokenizers to 3 Billion Parameters for Autoregressive Image Generation
2505.17022 (2025-05)
GOT-R1: UNLEASHING REASONING CAPABILITY OF AUTOREGRESSIVE VISUAL GENERATION WITH REIN-FORCEMENT LEARNING
2510.05891 (2025-10)
D 3 QE: Learning Discrete Distribution Discrepancy-aware Quantization Error for Autoregressive-Generated Image Detection
ResnetBlock
brick of this paper's assembly: model
3 other papers
2 dated earlier, 1 later · 2 only as an assembly brick
2504.08736 (2025-04)
GigaTok: Scaling Visual Tokenizers to 3 Billion Parameters for Autoregressive Image Generation
2505.17022 (2025-05)
GOT-R1: UNLEASHING REASONING CAPABILITY OF AUTOREGRESSIVE VISUAL GENERATION WITH REIN-FORCEMENT LEARNING
2510.05891 (2025-10)
D 3 QE: Learning Discrete Distribution Discrepancy-aware Quantization Error for Autoregressive-Generated Image Detection
Decoder
brick of this paper's assembly: model
2 other papers
1 dated earlier, 1 later
2505.17022 (2025-05)
GOT-R1: UNLEASHING REASONING CAPABILITY OF AUTOREGRESSIVE VISUAL GENERATION WITH REIN-FORCEMENT LEARNING
2510.05891 (2025-10)
D 3 QE: Learning Discrete Distribution Discrepancy-aware Quantization Error for Autoregressive-Generated Image Detection
Encoder
brick of this paper's assembly: model
2 other papers
1 dated earlier, 1 later · 1 only as an assembly brick
2505.17022 (2025-05)
GOT-R1: UNLEASHING REASONING CAPABILITY OF AUTOREGRESSIVE VISUAL GENERATION WITH REIN-FORCEMENT LEARNING
2510.05891 (2025-10)
D 3 QE: Learning Discrete Distribution Discrepancy-aware Quantization Error for Autoregressive-Generated Image Detection

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

Vanilla autoregressive image generation models generate visual tokens step-by-step, limiting their ability to capture holistic relationships among token sequences. Moreover, because most visual tokenizers map local image patches into latent tokens, global information is limited. To address this, we introduce Hita, a novel image tokenizer for autoregressive (AR) image generation. It introduces a holistic-to-local tokenization scheme with learnable holistic queries and local patch tokens. Hita incorporates two key strategies to better align with the AR generation process: 1) arranging a sequential structure with holistic tokens at the beginning, followed by patch-level tokens, and using causal attention to maintain awareness of previous tokens; and 2) adopting a lightweight fusion module before feeding the de-quantized tokens into the decoder to control information flow and prioritize holistic tokens. Extensive experiments show that Hita accelerates the training speed of AR generators and outperforms those trained with vanilla tokenizers, achieving 2.59 FID and 281.9 IS on the Im-ageNet benchmark. Detailed analysis of the holistic representation highlights its ability to capture global image properties, such as textures, materials, and shapes. Additionally, Hita also demonstrates effectiveness in zero-shot style transfer and image in-painting. The code is available at https://github.com/CVMI-Lab/Hita.

For agents

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

get_harvested_code_for_paper("2507.02358")
get_code_for_paper("2507.02358")
have("2507.02358")

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

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

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

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

Connect an agent — have() is free.