SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.06948 · ICCV · 2023

Self-regulating Prompts: Foundational Model Adaptation without Forgetting

Ming-Hsuan Yang, Muzammal Naseer, Salman Khan, Muhammad Khattak, Shahbaz Fahad, Khan, Syed Talal Wasim

arXiv · PDF · Open in the Atlas

Code that ran

17 of 21 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; 1 honoured the contract we drafted, 1 violated it and 10 have no contract verdict; 5 failures of our instrument; 4 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2307.06948.json · badge: /api/ran/2307.06948.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
muzairkhattak/PromptSRC canonical (classifier label)
classifier basis not recorded on the link
4 ran · 2 no recorded run
asif-hanif/vafa community (classifier label)
classifier basis not recorded on the link
13 ran · 2 no recorded run
FunctionStatusWhere it lives
clip_by_tensor Ran
ran; our contract draft was wrong, not the code
asif-hanif/vafa/generate_adv_samples.py
code served (permissive licence) · get_code("11d8e1b97b2f5801")
How it ran

Ran in Syntology's jail 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. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:35:56Z). 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)

# Create small tensors for clipping
t = torch.randn(2, 4)
t_min = torch.tensor(-1.0)
t_max = torch.tensor(1.0)

ARGS = {
    "t": t,
    "t_min": t_min,
    "t_max": t_max,
}
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
basic_clean Ran
ran; our contract draft was wrong, not the code
muzairkhattak/PromptSRC/clip/simple_tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("98f385d847636a3e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ltpwy/MSCI, 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.

basic_iterative_method_l_inf Ran
ran on a synthesized input
asif-hanif/vafa/attacks/bim.py
code served (permissive licence) · get_code("26f9951311aad9a4")
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 (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
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal model that takes images and returns logits
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)  # Input dim 4, output 3 classes
    
    def forward(self, x):
        # Flatten batch and spatial dimensions, pass through linear layer
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.linear(x_flat)

# Create model instance
model = SimpleModel()

# Create tiny tensors: batch size 2, 4 dimensions (e.g., 2x2 image with 1 channel)
images = torch.rand(2, 4) * 0.8 + 0.1  # Values in [0.1, 0.9] to be within [0, 1]
labels = torch.tensor([0, 1])

# Define loss function
loss_fn = nn.CrossEntropyLoss()

# Device (CPU only)
device = 'cpu'

# Other parameters
steps = 5
alpha = 2 / 255
eps = 8 / 255
targeted = False
verbose = True

# Construct ARGS dictionary
ARGS = {
    'model': model,
    'images': images,
    'labels': labels,
    'loss_fn': loss_fn,
    'steps': steps,
    'alpha': alpha,
    'eps': eps,
    'device': device,
    'targeted': targeted,
    'verbose': verbose
}
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 (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
block_merging_3d Ran
ran on a synthesized input
asif-hanif/vafa/attacks/vafa/decompression.py
code served (permissive licence) · get_code("b4bd444510dc7370")
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 5, dtype family float, shape (2, 4, 4, 6, 8) as a later run recorded it. 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, 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
from monai.data.utils import dense_patch_slices

torch.manual_seed(0)

# Create a small 3D image composed of blocks
# block_size = (2, 3, 4)
# We want 2 blocks in total (num_blocks=2)
# So image_size should be (4, 3, 8) to fit 2 blocks of size (2, 3, 4) with no overlap
# Actually, with dense_patch_slices and scan_interval=block_size, we get non-overlapping patches
# For image_size (4, 6, 8) and block_size (2, 3, 4):
# - H direction: 4 / 2 = 2 patches
# - W direction: 6 / 3 = 2 patches  
# - D direction: 8 / 4 = 2 patches
# Total: 2 * 2 * 2 = 8 blocks

B = 2  # batch size
C = 4  # channels
block_h, block_w, block_d = 2, 3, 4
H, W, D = 4, 6, 8
num_blocks = (H // block_h) * (W // block_w) * (D // block_d)

# Create image tensor with shape [B, C, num_blocks, block_h, block_w, block_d]
image = torch.randn(B, C, num_blocks, block_h, block_w, block_d, dtype=torch.float32)

# Create new_image_shape [B, C, H, W, D]
new_image_shape = (B, C, H, W, D)

ARGS = {
    "image": image,
    "new_image_shape": new_image_shape,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
monai, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 5, dtype family float, shape (2, 4, 4, 6, 8) — shape (2, 4, 4, 6, 8) 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
block_splitting_2d Ran
ran on a synthesized input
asif-hanif/vafa/attacks/vafa/compression.py
code served (permissive licence) · get_code("6ec553f76a64ec2b")
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 6, dtype family float, shape (2, 3, 4, 4, 4, 4) as a later run recorded it. 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, 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)

# Create a small 5D input tensor [B, C, D, H, W]
# B=2, C=3, D=4, H=8, W=8 (divisible by block_size)
image = torch.randn(2, 3, 4, 8, 8, dtype=torch.float32)

# Define block_size as a tuple of length 2
block_size = (4, 4)

ARGS = {
    "image": image,
    "block_size": block_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
monai, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 6, dtype family float, shape (2, 3, 4, 4, 4, 4) — shape (2, 3, 4, 4, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
block_splitting_3d Ran
ran on a synthesized input
asif-hanif/vafa/attacks/vafa/compression.py
code served (permissive licence) · get_code("540c488a5c1d1cbd")
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 6, dtype family float, shape (2, 3, 1, 8, 8, 8) as a later run recorded it. 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, 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)

# Create a small 5D tensor [B, C, H, W, D]
# Dimensions: B=2, C=3, H=8, W=8, D=8
# This satisfies the divisibility requirement for block_size=(8,8,8)
image = torch.randn(2, 3, 8, 8, 8, dtype=torch.float32)

block_size = (8, 8, 8)

ARGS = {
    "image": image,
    "block_size": block_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
monai, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 6, dtype family float, shape (2, 3, 1, 8, 8, 8) — shape (2, 3, 1, 8, 8, 8) 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
compute_ci95 Ran
ran, honoured the contract we drafted
muzairkhattak/PromptSRC/parse_test_res.py
code served (permissive licence) · get_code("ba26afd892405335")
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 float64, ndim 0, 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 numpy as np

# compute_ci95 takes a single parameter 'res' which is used with:
# - np.std(res) - needs array-like
# - np.sqrt(len(res)) - needs len() to work
# A simple numpy array or list works perfectly

res = np.array([1.2, 2.3, 3.1, 4.5, 5.2, 6.1, 7.3, 8.9])

ARGS = {
    "res": res
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
dct_3d Ran
ran on a synthesized input
asif-hanif/vafa/attacks/vafa/compression.py
code served (permissive licence) · get_code("717c228e9810218e")
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 6, dtype family float, shape (2, 3, 4, 5, 6, 7) as a later run recorded it. 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, 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_dct as dct_pack

torch.manual_seed(0)

# Construct a valid image tensor
# Shape: [B, C, N_Blocks, Block_H, Block_W, Block_D]
# Using distinct sizes: B=2, C=3, N_Blocks=4, Block_H=5, Block_W=6, Block_D=7
# Values in range [0, 255]
image = torch.randint(0, 256, (2, 3, 4, 5, 6, 7), dtype=torch.float32)

ARGS = {
    "image": image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_dct — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 6, dtype family float, shape (2, 3, 4, 5, 6, 7) — shape (2, 3, 4, 5, 6, 7) 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
dice Ran
ran, violated the contract we drafted
asif-hanif/vafa/trainer.py
pointer only (licence: MIT); the stored copy get_code serves, from zang0902/EM-Net, is pointer only (licence: NONE) · get_code("7b0ecad70df7f175")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zang0902/EM-Net, 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.

diff_round Ran
ran; our contract draft was wrong, not the code
asif-hanif/vafa/attacks/vafa/utils.py
code served (permissive licence) · get_code("37251df462837488")
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 (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)

# The function diff_round takes a single tensor parameter x
# and performs differentiable rounding using torch operations.
# We need to provide a small tensor for testing.

x = torch.randn(2, 4, requires_grad=True)

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 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
fast_gradient_sign_method_l_inf Ran
ran on a synthesized input
asif-hanif/vafa/attacks/fgsm.py
code served (permissive licence) · get_code("5eac0a1d1c33cb09")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 1, 2, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that takes images and returns logits
class SimpleClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)  # 4 input features, 3 output classes
    
    def forward(self, x):
        # Flatten if needed and pass through linear layer
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.fc(x_flat)

# Create instances
model = SimpleClassifier()
model.eval()

# Create tiny batch of images: batch_size=2, channels=1, height=2, width=2 (flattens to 4)
images = torch.rand(2, 1, 2, 2, dtype=torch.float32)
images = torch.clamp(images, min=0, max=1)  # Ensure values in [0, 1]

# Create labels: 2 samples, each with a class label (0-2 for 3 classes)
labels = torch.tensor([0, 1], dtype=torch.long)

# Create a loss function
loss_fn = nn.CrossEntropyLoss()

# Build ARGS dictionary
ARGS = {
    'model': model,
    'images': images,
    'labels': labels,
    'loss_fn': loss_fn,
    'eps': 8 / 255,
    'device': 'cpu',
    'targeted': False,
    'verbose': 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 Tensor, ndim 4, dtype family float, shape (2, 1, 2, 2) — shape (2, 1, 2, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gaussain_noise Ran
ran on a synthesized input
asif-hanif/vafa/attacks/gn.py
code served (permissive licence) · get_code("191a40826c2817e4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import warnings

torch.manual_seed(0)

# Create a small batch of images in [0, 1] range
# Batch size 2, 3 channels, 4x4 spatial dimensions
images = torch.rand(2, 3, 4, 4)

# Define ARGS dictionary with all parameters
ARGS = {
    'images': images,
    'std': 8 / 255,
    'device': None,
    'verbose': 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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pairs Ran
ran; our contract draft was wrong, not the code
muzairkhattak/PromptSRC/clip/simple_tokenizer.py
code served (permissive licence) · get_code("d919ae32e5e4e616")
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 set. 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 get_pairs takes a word parameter
# A word is represented as a tuple of symbols (variable-length strings)
# The function iterates through the word and creates pairs of consecutive symbols

word = ("hello", "world", "test")

ARGS = {
    "word": word
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
get_slices Ran
ran on a synthesized input
asif-hanif/vafa/generate_adv_samples.py
code served (permissive licence) · get_code("c3db89de9732f13a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, 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
from monai.utils.misc import fall_back_tuple
from monai.data.utils import dense_patch_slices

torch.manual_seed(0)

# input_shape: tuple representing the shape of input (batch, channels, spatial_dims...)
# For a 3D image: (batch_size, num_channels, depth, height, width)
input_shape = (2, 3, 8, 12, 16)

# roi_size: can be an int or tuple representing the region of interest size
# If int, it will be expanded to all spatial dimensions
# If tuple, it specifies size for each spatial dimension
roi_size = (4, 6, 8)

ARGS = {
    "input_shape": input_shape,
    "roi_size": roi_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
monai, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
idct_3d Ran
ran on a synthesized input
asif-hanif/vafa/attacks/vafa/decompression.py
code served (permissive licence) · get_code("355f982908ae421b")
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 6, dtype family float, shape (2, 3, 4, 5, 6, 7) as a later run recorded it. 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, 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 as nn

torch.manual_seed(0)

# Create a small 3D DCT image tensor with shape [B, C, N_Blocks, Block_H, Block_W, Block_D]
# Using distinct sizes: B=2, C=3, N_Blocks=4, Block_H=5, Block_W=6, Block_D=7
dct_image = torch.randn(2, 3, 4, 5, 6, 7, dtype=torch.float32)

ARGS = {
    'dct_image': dct_image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_dct — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 6, dtype family float, shape (2, 3, 4, 5, 6, 7) — shape (2, 3, 4, 5, 6, 7) 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
profile Ran
ran on a synthesized input
asif-hanif/vafa/trainer.py
code served (permissive licence) · get_code("8d28994182c6f301")
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 function. 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


def sample_function(x, y):
    """A simple function to profile"""
    result = x + y
    for i in range(1000):
        result = result * 1.0001
    return result


ARGS = {
    "func": sample_function
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
whitespace_clean Ran
ran; our contract draft was wrong, not the code
muzairkhattak/PromptSRC/clip/simple_tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("9542161e9640b858")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ltpwy/MSCI, 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.

block_merging_2d Not yet run
unverified (harvested, no recorded run)
asif-hanif/vafa/attacks/vafa/decompression.py
code served (permissive licence) · get_code("06d539bf83ec69a8")
How it ran

no invocation recorded.

build_model Not yet run
unverified (harvested, no recorded run)
muzairkhattak/PromptSRC/clip/model.py
code served (permissive licence) · get_code("48ac2bd4dcbfb717")
How it ran

no invocation recorded.

load Not yet run
unverified (harvested, no recorded run)
muzairkhattak/PromptSRC/clip/clip.py
code served (permissive licence) · get_code("fbf8c0143d9c48e3")
How it ran

no invocation recorded.

phi_diff Not yet run
unverified (harvested, no recorded run)
asif-hanif/vafa/attacks/vafa/utils.py
code served (permissive licence) · get_code("c8febed4b57496fc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 6 the same month, 9 later) and 11 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
get_pairs 258 other papers
61 dated earlier, 4 the same month, 185 later, 7 same year, order not determinable, 1 undated · 4 only as an assembly brick
1802.06474 (2018-02)
A Closed-form Solution to Photorealistic Image Stylization
1803.01128 (2018-03)
Seq2Sick: Evaluating the Robustness of Sequence-to-Sequence Models with Adversarial Examples
1809.00125 (2018-09)
Simple Fusion: Return of the Language Model
and 255 more not named here
whitespace_clean 231 other papers
45 dated earlier, 4 the same month, 176 later, 5 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 228 more not named here
basic_clean 218 other papers
45 dated earlier, 4 the same month, 163 later, 5 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 215 more not named here
load 88 other papers
13 dated earlier, 1 the same month, 70 later, 3 same year, order not determinable, 1 undated
2203.05557 (2022-03)
Conditional Prompt Learning for Vision-Language Models
2206.01986 (2022-06)
Delving into the Openness of CLIP
2207.12819 (2022-07)
S-Prompts Learning with Pre-trained Transformers: An Occam's Razor for Domain Incremental Learning
and 85 more not named here
compute_ci95 37 other papers
7 dated earlier, 1 the same month, 27 later, 1 same year, order not determinable, 1 undated
2106.00592 (2021-06)
Semi-Supervised Domain Generalization with Stochastic StyleMatch
2203.05557 (2022-03)
Conditional Prompt Learning for Vision-Language Models
2203.07740 (2022-03)
Exact Feature Distribution Matching for Arbitrary Style Transfer and Domain Generalization
and 34 more not named here
build_model 30 other papers
4 dated earlier, 26 later
2210.03117 (2022-10)
MaPLe: Multi-modal Prompt Learning
2212.03640 (2022-12)
Fine-tuned CLIP Models are Efficient Video Learners
2304.04704 (2023-04)
Prompt Pre-Training with Twenty-Thousand Classes for Open-Vocabulary Visual Recognition
and 27 more not named here
diff_round 6 other papers
3 dated earlier, 3 later
2108.09034 (2021-08)
AdvDrop: Adversarial Attack to DNNs by Dropping Information
2207.03574 (2022-07)
Demystifying the Adversarial Robustness of Random Transformation Defenses
and 3 more not named here
clip_by_tensor 5 other papers
2 dated earlier, 1 the same month, 2 later · 1 only as an assembly brick
2207.05382 (2022-07)
Frequency Domain Model Augmentation for Adversarial Attack
2306.05225 (2023-06)
Boosting Adversarial Transferability by Achieving Flat Local Maxima
2307.07873 (2023-07)
Why Does Little Robustness Help? A Further Step Towards Understanding Adversarial Transferability
and 2 more not named here
dice 4 other papers
1 dated earlier, 3 later
2204.00631 (2022-04)
UNetFormer: A Unified Vision Transformer Model and Pre-Training Framework for 3D Medical Image Segmentation
2311.01908 (2023-11)
LLM-driven Multimodal Target Volume Contouring in Radiation Oncology
2402.05892 (2024-02)
Mamba-ND: Selective State Space Modeling for Multi-Dimensional Data
and 1 more not named here
phi_diff 1 other paper
1 dated earlier
2108.09034 (2021-08)
AdvDrop: Adversarial Attack to DNNs by Dropping Information

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

Prompt learning has emerged as an efficient alternative for fine-tuning foundational models, such as CLIP, for various downstream tasks. Conventionally trained using the task-specific objective, i.e., cross-entropy loss, prompts tend to overfit downstream data distributions and find it challenging to capture task-agnostic general features from the frozen CLIP. This leads to the loss of the model's original generalization capability. To address this issue, our work introduces a self-regularization framework for prompting called PromptSRC (Prompting with Self-regulating Constraints). PromptSRC guides the prompts to optimize for both task-specific and task-agnostic general representations using a three-pronged approach by: (a) regulating prompted representations via mutual agreement maximization with the frozen model, (b) regulating with selfensemble of prompts over the training trajectory to encode their complementary strengths, and (c) regulating with textual diversity to mitigate sample diversity imbalance with the visual branch. To the best of our knowledge, this is the first regularization framework for prompt learning that avoids overfitting by jointly attending to pre-trained model features, the training trajectory during prompting, and the textual diversity. PromptSRC explicitly steers the prompts to learn a representation space that maximizes performance on downstream tasks without compromising CLIP generalization. We perform extensive experiments on 4 benchmarks where PromptSRC overall performs favorably well compared to the existing methods. Our code and pre-trained models are publicly available at: https://github.com/muzairkhattak/PromptSRC.

For agents

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

get_harvested_code_for_paper("2307.06948")
get_code_for_paper("2307.06948")
have("2307.06948")

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

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

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

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

Connect an agent — have() is free.