SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2507.18537 · NeurIPS · 2025

TTS-VAR: A Test-Time Scaling Framework for Visual Auto-Regressive Generation

Yingya Zhang, Shiwei Zhang, Yukang Chen, Xihui Liu, Yujie Wei, Ruihang Chu, Hku Mmlab, Zhekai Chen

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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, 1 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 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.18537.json · badge: /api/ran/2507.18537.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
ali-vilab/TTS-VAR canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
FunctionStatusWhere it lives
aug_with_positive_prompt Ran
ran, violated the contract we drafted
ali-vilab/TTS-VAR/tts-var/utils_run.py
code served (permissive licence) · get_code("9e7e8cb16293d38e")
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 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 torch

torch.manual_seed(0)

# The function takes a single parameter 'prompt' which is a string
# It checks if certain keywords are in the prompt and augments it if found
# No complex objects needed - just a string

ARGS = {
    'prompt': 'a man standing in the park'
}
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 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
encode_prompt Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ali-vilab/TTS-VAR/tts-var/utils_run.py
code served (permissive licence) · get_code("17efe355dd8c0401")
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. 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 torch.nn as nn

torch.manual_seed(0)

class MockTextTokenizer:
    def __call__(self, text, max_length, padding, truncation, return_tensors):
        batch_size = len(text)
        seq_len = 10
        input_ids = torch.randint(0, 1000, (batch_size, seq_len))
        attention_mask = torch.ones(batch_size, seq_len, dtype=torch.long)
        attention_mask[:, -2:] = 0
        
        class TokenizerOutput:
            def __init__(self, input_ids, attention_mask):
                self.input_ids = input_ids
                self.attention_mask = attention_mask
        
        return TokenizerOutput(input_ids, attention_mask)

class MockTextEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(10, 4)
    
    def forward(self, input_ids, attention_mask):
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1]
        last_hidden_state = self.linear(torch.randn(batch_size, seq_len, 10))
        return {'last_hidden_state': last_hidden_state}

text_tokenizer = MockTextTokenizer()
text_encoder = MockTextEncoder()
prompt = "a photo of a man wearing a hat"
enable_positive_prompt = True
B = 2

ARGS = {
    'text_tokenizer': text_tokenizer,
    'text_encoder': text_encoder,
    'prompt': prompt,
    'enable_positive_prompt': enable_positive_prompt,
    'B': B
}
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
extract_key_val Ran
ran; our contract draft was wrong, not the code
ali-vilab/TTS-VAR/tts-var/utils_run.py
code served (permissive licence) · get_code("8535a42ccd56fce0")
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 dict. 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 re

def extract_key_val(text):
    pattern = '<(.+?):(.+?)>'
    matches = re.findall(pattern, text)
    key_val = {}
    for match in matches:
        key_val[match[0]] = match[1].lstrip()
    return key_val

# The function takes a single parameter: text (a string)
# It uses regex to find patterns like <key:value> and returns a dict
# We need to provide a string with some key-value pairs in the specified format

ARGS = {
    "text": "<name: Alice><age: 30><city: New York>"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
sample_with_top_k_top_p_also_inplace_modifying_logits_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ali-vilab/TTS-VAR/tts-var/utils_model.py
code served (permissive licence) · get_code("9526ce09c7148703")
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 3, dtype family int, shape (2, 3, 1) 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)

# Construct logits tensor with shape (B, l, V)
# B=2 (batch), l=3 (sequence length), V=4 (vocabulary size)
logits_BlV = torch.randn(2, 3, 4)

# top_k parameter: number of top tokens to keep
top_k = 2

# top_p parameter: nucleus sampling threshold
top_p = 0.9

# rng parameter: random number generator
rng = torch.Generator()
rng.manual_seed(42)

# num_samples parameter: number of samples to draw
num_samples = 1

ARGS = {
    "logits_BlV": logits_BlV,
    "top_k": top_k,
    "top_p": top_p,
    "rng": rng,
    "num_samples": num_samples,
}
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 3, dtype family int, shape (2, 3, 1) — shape (2, 3, 1) 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

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 1 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
sample_with_top_k_top_p_also_inplace_modifying_logits_ 5 other papers
2 dated earlier, 2 later, 1 same year, order not determinable
2404.02905 (2024-04)
Visual Autoregressive Modeling: Scalable Image Generation via Next-Scale Prediction
2412.04431 (2024-12)
Infinity: Scaling Bitwise AutoRegressive Modeling for High-Resolution Image Synthesis
and 2 more not named here
aug_with_positive_prompt 1 other paper
1 dated earlier
2412.04431 (2024-12)
Infinity: Scaling Bitwise AutoRegressive Modeling for High-Resolution Image Synthesis
extract_key_val 1 other paper
1 dated earlier
2412.04431 (2024-12)
Infinity: Scaling Bitwise AutoRegressive Modeling for High-Resolution Image Synthesis

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-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

Scaling visual generation models is essential for real-world content creation, yet requires substantial training and computational expenses. Alternatively, test-time scaling has garnered growing attention due to resource efficiency and promising performance. In this work, we present TTS-VAR, the first general test-time scaling framework for visual auto-regressive (VAR) models, modeling the generation process as a path searching problem. To dynamically balance computational efficiency with exploration capacity, we first introduce an adaptive descending batch size schedule throughout the causal generation process. Besides, inspired by VAR's hierarchical coarse-to-fine multi-scale generation, our framework integrates two key components: (i) At coarse scales, we observe that generated tokens are hard for evaluation, possibly leading to erroneous acceptance of inferior samples or rejection of superior samples. Noticing that the coarse scales contain sufficient structural information, we propose clustering-based diversity search. It preserves structural variety through semantic feature clustering, enabling later selection on samples with higher potential. (ii) In fine scales, resampling-based potential selection prioritizes promising candidates using potential scores, which are defined as reward functions incorporating multi-scale generation history. Experiments on the powerful VAR model Infinity2B show a notable 8.7% GenEval score improvement (0.69→0.75). Key insights reveal that early-stage structural features effectively influence final quality, and resampling efficacy varies across generation scales. Code is available at https://github.com/ali-vilab/TTS-VAR.

For agents

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

get_harvested_code_for_paper("2507.18537")
get_code_for_paper("2507.18537")
have("2507.18537")

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

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

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

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

Connect an agent — have() is free.