SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2603.14254 · 2026

ZOTTA: Test-Time Adaptation with Gradient-Free Zeroth-Order Optimization

Jian Chen, Qi Deng, Shuaicheng Niu, Runhao Zeng, Ronghao Zhang, Yanjie Dong

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 5 failures of our instrument; 4 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/2603.14254.json · badge: /api/ran/2603.14254.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
Zhang-Ronghao/zotta community
Papers with Code archive
8 ran · 4 no recorded run
FunctionStatusWhere it lives
MinMaxQuantMatMul Ran
ran on a synthesized input · constructed an object; no result was computed
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("781987d0331d9284")
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, MinMaxQuantMatMul: 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)

# Create small tensors for testing
# A will be shape (2, 4) and B will be shape (4, 3)
A = torch.randn(2, 4)
B = torch.randn(4, 3)

# Define ARGS mapping all parameters
ARGS = {
    'A_bit': 8,
    'B_bit': 8,
    'mode': 'raw'
}
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 MinMaxQuantMatMul — 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 MinMaxQuantMatMul 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
PTQSLBatchingQuantMatMul Ran
ran on a synthesized input · constructed an object; no result was computed
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("9bc6c3b39df20576")
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, PTQSLBatchingQuantMatMul: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Build small test tensors for A and B
# A shape: (batch, n_G, n_V, n_H) = (2, 4, 3, 5)
# B shape: (batch, n_G, n_V, n_H) = (2, 4, 3, 5)
A = torch.randn(2, 4, 3, 5)
B = torch.randn(2, 4, 3, 5)

ARGS = {
    'A_bit': 8,
    'B_bit': 8,
    'mode': 'raw',
    'metric': 'L2_norm',
    'search_round': 1,
    'eq_alpha': 0.1,
    'eq_beta': 2,
    'eq_n': 100,
    'parallel_eq_n': 10,
    'n_G_A': 1,
    'n_V_A': 1,
    'n_H_A': 1,
    'n_G_B': 1,
    'n_V_B': 1,
    'n_H_B': 1,
    'init_layerwise': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PTQSLBatchingQuantMatMul — 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 PTQSLBatchingQuantMatMul 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
PTQSLQuantMatMul Ran
ran on a synthesized input · constructed an object; no result was computed
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("3684dcba774a85a4")
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, PTQSLQuantMatMul: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.nn import functional as F

torch.manual_seed(0)

# Build minimal stand-in arguments for PTQSLQuantMatMul
ARGS = {
    'A_bit': 8,
    'B_bit': 8,
    'mode': 'raw',
    'metric': 'L2_norm',
    'search_round': 1,
    'eq_alpha': 0.1,
    'eq_beta': 2,
    'eq_n': 100,
    'parallel_eq_n': 10,
    'n_G_A': 1,
    'n_V_A': 1,
    'n_H_A': 1,
    'n_G_B': 1,
    'n_V_B': 1,
    'n_H_B': 1,
    'init_layerwise': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PTQSLQuantMatMul — 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 PTQSLQuantMatMul 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
_select_params_by_patterns Ran
ran; our contract draft was wrong, not the code
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("9400434cc4986920")
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

torch.manual_seed(0)

# The function iterates through norm_param by index and checks if block_name is in norm_param_names
# It accesses norm_param[idx] and appends to lists
# So norm_param should be a list/sequence of tensors or parameters
# norm_param_names should be a list of strings
# patterns should be a list of strings to match against

norm_param = [
    torch.randn(2, 4),
    torch.randn(3, 5),
    torch.randn(2, 6),
    torch.randn(4, 3),
]

norm_param_names = [
    "layer1.block.weight",
    "layer2.norm.weight",
    "layer1.block.bias",
    "layer3.weight",
]

patterns = [
    "block",
    "layer1",
]

ARGS = {
    "norm_param": norm_param,
    "norm_param_names": norm_param_names,
    "patterns": patterns,
}
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
collect_norm_params Ran
ran; our contract draft was wrong, not the code
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("e2479e1468ca9ffe")
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

torch.manual_seed(0)

# Create a small model with various normalization layers
class TestModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.bn2d = nn.BatchNorm2d(4)
        self.gn = nn.GroupNorm(2, 4)
        self.ln = nn.LayerNorm(4)
        self.conv = nn.Conv2d(3, 4, 3)
    
    def forward(self, x):
        return x

model = TestModel()

ARGS = {
    'model': model
}
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
copy_model Ran
ran; our contract draft was wrong, not the code
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("0894f6cd7b5e7b5f")
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 OrderedDict. 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 copy import deepcopy

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
forward_and_get_loss Ran
ran; our contract draft was wrong, not the code
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("3aeaee983277fbf8")
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

torch.manual_seed(0)

# Build a minimal ViT-like model for 'vit_base' case
class MinimalViTHead(nn.Module):
    def __init__(self, in_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(in_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

class MinimalViT(nn.Module):
    def __init__(self):
        super().__init__()
        self.head = MinimalViTHead(768, 1000)

class MinimalViTModel(nn.Module):
    def __init__(self, token_dim=768, use_spatial=False):
        super().__init__()
        self.vit = MinimalViT()
        self.token_dim = token_dim
        self.use_spatial = use_spatial
    
    def layers_cls_features(self, images):
        # Return features of shape (batch_size, token_dim)
        batch_size = images.shape[0]
        return torch.randn(batch_size, self.token_dim)
    
    def layers_cls_and_avg_features(self, images):
        # Return cls_features and avg_features
        batch_size = images.shape[0]
        cls_features = torch.randn(batch_size, self.token_dim)
        avg_features = torch.randn(batch_size, self.token_dim)
        return cls_features, avg_features

# Build a minimal ResNet-like model
class MinimalResNetHead(nn.Module):
    def __init__(self, in_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(in_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

class MinimalResNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.head = MinimalResNetHead(2048, 1000)
    
    def forward_head(self, x):
        return self.head(x)

class MinimalResNetModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.resnet = MinimalResNet()
    
    def layers_cls_features(self, images):
        # Return list of features from different layers
        batch_size = images.shape[0]
        # Simulate multi-layer features with spatial dims
        layer1 = torch.randn(batch_size, 256, 4, 4)
        layer2 = torch.randn(batch_size, 512, 2, 2)
        layer3 = torch.randn(batch_size, 2048, 1, 1)
        return [layer1, layer2, layer3]
    
    def collect_all_blocks_features(self, images):
        # Same as layers_cls_features for this minimal version
        return self.layers_cls_features(images)

# Create instances for different test cases
vit_model = MinimalViTModel(token_dim=768)
resnet_model = MinimalResNetModel()

# Prepare common arguments
batch_size = 2
images = torch.randn(batch_size, 3, 224, 224)

# Prepare train_info: [std, mean, avg_std, avg_mean] for spatial alignment case
token_dim = 768
train_info = [
    torch.randn(token_dim),  # cls std
    torch.randn(token_dim),  # cls mean
    torch.randn(token_dim),  # avg std
    torch.randn(token_dim),  # avg mean
]

# For ResNet, train_info needs to match concatenated features
resnet_feature_dim = 256 + 512 + 2048  # sum of all layer feature dims
train_info_resnet = [
    torch.randn(resnet_feature_dim),  # std
    torch.randn(resnet_feature_dim),  # mean
]

# ImageNet mask (subset of 1000 classes)
imagenet_mask = torch.arange(100)  # Select first 100 classes

ARGS = {
    'images': images,
    'model': vit_model,
    'imagenet_mask': imagenet_mask,
    'fitness_lambda': 0.5,
    'entropy_lambda': 0.1,
    'train_info': train_info,
    'model_name': 'vit_base',
    'resnet_block_foa': False,
    'avg_align_lambda': 0.4,
    'use_spatial_alignment': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
softmax_entropy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("1bdb21f20be90a8f")
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 1, 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

torch.manual_seed(0)

# The function takes a tensor x and computes softmax entropy
# It expects x to have shape (batch_size, num_classes) based on the .softmax(1) and .log_softmax(1) calls
# Creating a small tensor with batch size 2 and 4 classes
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 1, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
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
SoSPTQSLBatchingQuantMatMul Not yet run
unverified (harvested, no recorded run)
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("f6520a61abd71dc5")
How it ran

no invocation recorded.

ZOTTA Not yet run
unverified (harvested, no recorded run)
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("1e8bb42d7e0c055b")
How it ran

no invocation recorded.

collect_selected_norm_params Not yet run
unverified (harvested, no recorded run)
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("c428502ddc035c2b")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
Zhang-Ronghao/zotta/tta_library/zotta.py
code served (permissive licence) · get_code("7b969394a74a96c4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 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.

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

Test-time adaptation (TTA) aims to improve model robustness under distribution shifts by adapting to unlabeled test data, but most existing methods rely on backpropagation (BP), which is computationally costly and incompatible with non-differentiable models such as quantized models-limiting practical deployment on numerous edge devices. Recent BP-free approaches alleviate overhead but remain either architecturespecific or limited in optimization capacity to handle highdimensional models. We propose ZOTTA, a fully BP-free TTA framework that performs efficient adaptation using only forward passes via Zeroth-Order Optimization (ZOO). While ZOO is theoretically appealing, naive application leads to slow convergence under high-dimensional parameter spaces and unstable optimization due to the lack of labels. ZOTTA overcomes these challenges through 1) Distribution-Robust Layer Selection, which automatically identifies and freezes layers that already extract distribution-invariant features, updating only domain-sensitive layers to reduce the optimization dimensionality and accelerate convergence; 2) Spatial Feature Aggregation Alignment, which stabilizes ZOO by aligning globally aggregated spatial features between source and target to reduce gradient variance. Together, these components enable architecture-agnostic and stable BP-free adaptation. Extensive experiments on ImageNet-C/R/Sketch/A show that ZOTTA outperforms or matches BP-based methods, e.g., it reduces memory usage by 84% and improves accuracy by 3.9% over SAR on ImageNet-C. Code: https://github.com/Zhang-Ronghao/zotta.

For agents

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

get_harvested_code_for_paper("2603.14254")
get_code_for_paper("2603.14254")
have("2603.14254")

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

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

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

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

Connect an agent — have() is free.