SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.19287 · 2024

Revisiting the Adversarial Robustness of Vision Language Models: a Multimodal Perspective

arXiv · PDF · Open in the Atlas

Code that ran

18 of 22 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 16 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/2404.19287.json · badge: /api/ran/2404.19287.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
ellezwq/mmcoa canonical (classifier label)
classifier basis: census
18 ran · 4 no recorded run
FunctionStatusWhere it lives
whitespace_tokenize Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/models/tokenization_bert.py
code served (permissive licence) · get_code("cf9ffa02a42184af")
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 list, ndim 1, dtype family float; no output shape is stated. 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-05T02:55:57Z). 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 numpy as np

def whitespace_tokenize(text):
    """Runs basic whitespace cleaning and splitting on a piece of text."""
    text = text.strip()
    if not text:
        return []
    tokens = text.split()
    return tokens

# Setup code
torch.manual_seed(0)

# The function takes a single parameter: text (a string)
# It performs basic whitespace cleaning and splitting
# We need to provide a valid string argument

ARGS = {
    "text": "  hello world  this is a test  "
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, 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
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ellezwq/mmcoa/utils.py
code served (permissive licence) · get_code("b0f936d4d6ae3b8c")
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 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

torch.manual_seed(0)

# Create output tensor: batch_size=2, num_classes=4
# This represents logits from a model
output = torch.randn(2, 4)

# Create target tensor: batch_size=2
# These are class indices (0-3 for 4 classes)
target = torch.tensor([1, 3])

# topk parameter: tuple of k values to compute accuracy for
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk,
}
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 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
calculate_accuracy Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/MMCoA.py
code served (permissive licence) · get_code("2e21f055fab549ee")
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 float, 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 numpy as np

torch.manual_seed(0)

# The function takes predicted_labels and true_labels
# It converts them to int and compares them
# Both should be sequences (lists, tensors, arrays) of the same length

# Create predicted labels - can be floats, ints, or tensors
predicted_labels = torch.tensor([0.1, 1.9, 0.2, 1.1])

# Create true labels - can be floats, ints, or tensors
true_labels = torch.tensor([0, 2, 0, 1])

ARGS = {
    'predicted_labels': predicted_labels,
    'true_labels': true_labels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
clamp_by_l2 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ellezwq/mmcoa/attack/imageAttack.py
pointer only (licence: MIT); the stored copy get_code serves, from adversarial-for-goodness/APF, is pointer only (licence: GPL-3.0) · get_code("1f2c3eac81b5d4f4")
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 adversarial-for-goodness/APF, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

compute_acc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ellezwq/mmcoa/utils_2.py
code served (permissive licence) · get_code("aa81d03f07735ab8")
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 float, 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

torch.manual_seed(0)

# Create small tensors for testing
# logits: shape (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

# label: shape (batch_size=2,) with class indices
label = torch.tensor([1, 3])

# reduction: string parameter
reduction = 'mean'

ARGS = {
    'logits': logits,
    'label': label,
    'reduction': reduction
}
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 float, 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
compute_n_params Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/utils_2.py
code served (permissive licence) · get_code("ad12a494674d23fb")
How it ran

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

import torch
import torch.nn as nn

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,
    "return_str": 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 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
cosine_lr Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from VivienLu/UCAT, is pointer only (licence: NONE) · get_code("932d44bbf8bd0e3f")
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 VivienLu/UCAT, 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.

create_logits Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/models/model.py
pointer only (licence: MIT); the stored copy get_code serves, from VivienLu/UCAT, is pointer only (licence: NONE) · get_code("cad29a7a417c68d3")
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 VivienLu/UCAT, 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.

equal_normalize Ran
ran, honoured the contract we drafted
ellezwq/mmcoa/attack/multimodalAttack.py
code served (permissive licence) · get_code("81b93fc3c40a9fa0")
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)

# The function equal_normalize(x) simply returns x unchanged
# It takes one parameter: x
# x appears to be a tensor based on the context

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 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
fixed_patch Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/models/prompters.py
code served (permissive licence) · get_code("263288717b164fe4")
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 FixedPatchPrompter. 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
from torch import nn

torch.manual_seed(0)

class ArgsConfig:
    def __init__(self, image_size, prompt_size):
        self.image_size = image_size
        self.prompt_size = prompt_size

ARGS = {
    'args': ArgsConfig(image_size=16, prompt_size=4)
}
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 FixedPatchPrompter — a FixedPatchPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FixedPatchPrompter 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_key Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/utils_2.py
code served (permissive licence) · get_code("d121638ef1dea109")
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 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# def get_key(dict, value):
#     return [k for k, v in dict.items() if v == value]
#
# The function takes:
# 1. dict - a dictionary object that needs .items() method
# 2. value - a value to search for in the dictionary values
#
# It returns a list of keys whose values match the given value

# Create a simple dictionary with various values
test_dict = {
    'key1': 42,
    'key2': 'hello',
    'key3': 42,
    'key4': 3.14,
    'key5': 'hello'
}

# Create a value to search for
search_value = 42

ARGS = {
    'dict': test_dict,
    'value': search_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, 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
get_substitues Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/attack/bert_attack.py
code served (permissive licence) · get_code("340f1e13ccb625f4")
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 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
import torch.nn as nn

torch.manual_seed(0)

# Stand-in tokenizer class
class StandInTokenizer:
    def __init__(self):
        self.vocab = {
            0: "[UNK]",
            1: "hello",
            2: "world",
            3: "test",
            4: "##ing",
            5: "##ed",
            6: "##er",
            7: "##ly",
        }
    
    def _convert_id_to_token(self, token_id):
        return self.vocab.get(token_id, "[UNK]")
    
    def convert_tokens_to_string(self, tokens):
        return "".join(tokens).replace("##", "")

# Stand-in MLM model
class StandInMLMModel(nn.Module):
    def __init__(self, vocab_size=8, hidden_dim=16):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
        self.device = torch.device('cpu')
    
    def forward(self, input_ids):
        x = self.embedding(input_ids)
        logits = self.linear(x)
        return (logits,)

# Create instances
tokenizer = StandInTokenizer()
mlm_model = StandInMLMModel(vocab_size=8, hidden_dim=16)
mlm_model.eval()

# Create small test tensors
# substitutes: (sub_len, k) where sub_len is number of positions, k is number of candidates
substitutes = torch.randint(0, 8, (2, 3))

# substitutes_score: (sub_len, k) with scores
substitutes_score = torch.tensor([[5.0, 4.0, 2.0], [6.0, 3.0, 1.0]])

ARGS = {
    "substitutes": substitutes,
    "tokenizer": tokenizer,
    "mlm_model": mlm_model,
    "use_bpe": 0,
    "substitutes_score": substitutes_score,
    "threshold": 3.0,
}
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 list, ndim 1, 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
gkern Ran
ran, honoured the contract we drafted
ellezwq/mmcoa/attack/imageAttack.py
pointer only (licence: MIT); the stored copy get_code serves, from adversarial-for-goodness/APF, is pointer only (licence: GPL-3.0) · get_code("5e1f60c820f3f710")
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 adversarial-for-goodness/APF, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

load_vocab Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/models/tokenization_bert.py
code served (permissive licence) · get_code("e7fbc7a74a3457c7")
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 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 collections
import tempfile
import os

# Create a temporary vocabulary file
temp_dir = tempfile.mkdtemp()
vocab_file = os.path.join(temp_dir, 'vocab.txt')

# Write some sample tokens to the vocab file
sample_tokens = ['[PAD]', '[UNK]', '[CLS]', '[SEP]', 'the', 'quick', 'brown', 'fox']
with open(vocab_file, 'w', encoding='utf-8') as f:
    for token in sample_tokens:
        f.write(token + '\n')

ARGS = {
    'vocab_file': vocab_file
}
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 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
padding Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/models/prompters.py
code served (permissive licence) · get_code("ed6b8fbf59cfc213")
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 PadPrompter. 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
from torch import nn

torch.manual_seed(0)

class Args:
    def __init__(self, prompt_size, image_size):
        self.prompt_size = prompt_size
        self.image_size = image_size

args = Args(prompt_size=2, image_size=8)

ARGS = {
    'args': args
}
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 PadPrompter — a PadPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PadPrompter 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
random_init Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/attack/imageAttack.py
code served (permissive licence) · get_code("45669d4d47a3a910")
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, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from enum import Enum

class NormType(Enum):
    Linf = 0
    L2 = 1

torch.manual_seed(0)

# Create a small tensor: batch_size=2, channels=3, height=4, width=5
x = torch.randn(2, 3, 4, 5)

# Set parameters
norm_type = NormType.L2
epsilon = 1.0

ARGS = {
    "x": x,
    "norm_type": norm_type,
    "epsilon": epsilon,
}
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, 5) — shape (2, 3, 4, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
random_patch Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/models/prompters.py
code served (permissive licence) · get_code("d22c609a1ecad7e5")
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 RandomPatchPrompter. 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
from torch import nn
import numpy as np

torch.manual_seed(0)

class ArgsConfig:
    def __init__(self, image_size, prompt_size):
        self.image_size = image_size
        self.prompt_size = prompt_size

ARGS = {
    'args': ArgsConfig(image_size=16, prompt_size=4)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RandomPatchPrompter — a RandomPatchPrompter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RandomPatchPrompter 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
refine_classname Ran
ran; our contract draft was wrong, not the code
ellezwq/mmcoa/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from VivienLu/UCAT, is pointer only (licence: NONE) · get_code("60ab7dcbb5498f88")
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 VivienLu/UCAT, 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.

attack_pgd Not yet run
unverified (harvested, no recorded run)
ellezwq/mmcoa/attacks.py
code served (permissive licence) · get_code("7c90002916e1665a")
How it ran

no invocation recorded.

clamp Not yet run
unverified (harvested, no recorded run)
ellezwq/mmcoa/attacks.py
code served (permissive licence) · get_code("8a93e041134b597a")
How it ran

no invocation recorded.

get_bpe_substitues Not yet run
unverified (harvested, no recorded run)
ellezwq/mmcoa/attack/bert_attack.py
code served (permissive licence) · get_code("0b855e55aafa281e")
How it ran

no invocation recorded.

load Not yet run
unverified (harvested, no recorded run)
ellezwq/mmcoa/replace/clip.py
code served (permissive licence) · get_code("9e585a3531b71996")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 17 are also present in other papers whose code we hold (17 with at least one paper dated earlier, 3 the same month, 14 later) and 5 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
accuracy 116 other papers
99 dated earlier, 1 the same month, 15 later, 1 same year, order not determinable · 8 only as an assembly brick
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1610.05820 (2016-10)
Membership Inference Attacks Against Machine Learning Models
1905.03696 (2019-05)
HAWQ: Hessian AWare Quantization of Neural Networks with Mixed-Precision
and 113 more not named here
whitespace_tokenize 43 other papers
35 dated earlier, 7 later, 1 same year, order not determinable
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1906.01698 (2019-06)
Open Sesame: Getting Inside BERT's Linguistic Knowledge
and 40 more not named here
clamp 33 other papers
28 dated earlier, 5 later · 1 only as an assembly brick
1706.06083 (2017-06)
Towards Deep Learning Models Resistant to Adversarial Attacks
2001.03994 (2020-01)
Fast is better than free: Revisiting adversarial training
2002.11569 (2020-02)
Overfitting in adversarially robust deep learning
and 30 more not named here
compute_n_params 29 other papers
21 dated earlier, 1 the same month, 6 later, 1 same year, order not determinable
2111.09452 (2021-11)
Open Vocabulary Object Detection with Pseudo Bounding-Box Labels
2211.09790 (2022-11)
ConStruct-VL: Data-Free Continual Structured VL Concepts Learning
2211.13594 (2022-11)
Self-supervised vision-language pretraining for Medical visual question answering
and 26 more not named here
load_vocab 29 other papers
23 dated earlier, 6 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1909.11942 (2019-09)
ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
2004.09297 (2020-04)
MPNet: Masked and Permuted Pre-training for Language Understanding
and 26 more not named here
compute_acc 28 other papers
21 dated earlier, 1 the same month, 5 later, 1 same year, order not determinable
2111.09452 (2021-11)
Open Vocabulary Object Detection with Pseudo Bounding-Box Labels
2211.09790 (2022-11)
ConStruct-VL: Data-Free Continual Structured VL Concepts Learning
2211.13594 (2022-11)
Self-supervised vision-language pretraining for Medical visual question answering
and 25 more not named here
cosine_lr 12 other papers
5 dated earlier, 7 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2209.00179 (2022-09)
Universal Vision-Language Dense Retrieval: Learning A Unified Representation Space for Multi-Modal Retrieval
2302.14042 (2023-02)
Knowledge-enhanced Visual-Language Pre-training on Chest Radiology Images
and 9 more not named here
fixed_patch 7 other papers
4 dated earlier, 3 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2303.08138 (2023-03)
Diversity-Aware Meta Visual Prompting
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
and 4 more not named here
padding 7 other papers
4 dated earlier, 3 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2303.08138 (2023-03)
Diversity-Aware Meta Visual Prompting
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
and 4 more not named here
create_logits 6 other papers
3 dated earlier, 3 later
2208.05318 (2022-08)
Generative Action Description Prompts for Skeleton-based Action Recognition
2312.03288 (2023-12)
STEP CATFormer: Spatial-Temporal Effective Body-Part Cross Attention Transformer for Skeleton-based Action Recognition
2401.04350 (2024-01)
Pre-trained Model Guided Fine-Tuning for Zero-Shot Adversarial Robustness
and 3 more not named here
random_patch 6 other papers
4 dated earlier, 2 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2303.08138 (2023-03)
Diversity-Aware Meta Visual Prompting
2312.08010 (2023-12)
EZ-CLIP: Efficient Zeroshot Video Action Recognition
and 3 more not named here
get_substitues 3 other papers
2 dated earlier, 1 later
1811.01727 (2018-11)
AttentionXML: Label Tree-based Attention-Aware Deep Model for High-Performance Extreme Multi-Label Text Classification
2307.14061 (2023-07)
Set-level Guidance Attack: Boosting Adversarial Transferability of Vision-Language Pre-training Models
2411.02669 (2024-11)
Semantic-Aligned Adversarial Evolution Triangle for High-Transferability Vision-Language Attack
get_bpe_substitues 2 other papers
1 dated earlier, 1 later
2307.14061 (2023-07)
Set-level Guidance Attack: Boosting Adversarial Transferability of Vision-Language Pre-training Models
2411.02669 (2024-11)
Semantic-Aligned Adversarial Evolution Triangle for High-Transferability Vision-Language Attack
refine_classname 2 other papers
1 dated earlier, 1 later
2401.04350 (2024-01)
Pre-trained Model Guided Fine-Tuning for Zero-Shot Adversarial Robustness
2512.12997 (2025-12)
Calibrating Uncertainty for Zero-Shot Adversarial CLIP
clamp_by_l2 1 other paper
1 dated earlier
2007.12861 (2020-07)
Adversarial Privacy-preserving Filter
gkern 1 other paper
1 dated earlier
2007.12861 (2020-07)
Adversarial Privacy-preserving Filter
load 1 other paper
1 dated earlier
2401.04350 (2024-01)
Pre-trained Model Guided Fine-Tuning for Zero-Shot Adversarial Robustness

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

Pretrained vision-language models (VLMs) like CLIP exhibit exceptional generalization across diverse downstream tasks. While recent studies reveal their vulnerability to adversarial attacks, research to date has primarily focused on enhancing the robustness of image encoders against image-based attacks, with defenses against text-based and multimodal attacks remaining largely unexplored. To this end, this work presents the first comprehensive study on improving the adversarial robustness of VLMs against attacks targeting image, text, and multimodal inputs. This is achieved by proposing multimodal contrastive adversarial training (MMCoA). Such an approach strengthens the robustness of both image and text encoders by aligning the clean text embeddings with adversarial image embeddings, and adversarial text embeddings with clean image embeddings. The robustness of the proposed MMCoA is examined against existing defense methods over image, text, and multimodal attacks on the CLIP model. Extensive experiments on 15 datasets across two tasks reveal the characteristics of different adversarial defense methods under distinct distribution shifts and dataset complexities across the three attack types. This paves the way for a unified framework of adversarial robustness against different modality attacks, opening up new possibilities for securing VLMs against multimodal attacks. The code is available at https://github.com/ElleZWQ/MMCoA.git.

For agents

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

get_harvested_code_for_paper("2404.19287")
get_code_for_paper("2404.19287")
have("2404.19287")

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

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

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

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

Connect an agent — have() is free.