SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2002.06622 · ICLR · 2020

Robustness Verification for Transformers

Huan Zhang, Cho-Jui Hsieh, Zhouxing Shi, Kai-Wei Chang, Minlie Huang

arXiv · PDF · Open in the Atlas

Code that ran

2 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-21; 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/2002.06622.json · badge: /api/ran/2002.06622.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
shizhouxing/Robustness-Verification-for-Transformers marked official in Papers with Code
Papers with Code archive
2 ran · 3 no recorded run
FunctionStatusWhere it lives
Bounds Ran
ran on a synthesized input · constructed an object; no result was computed
shizhouxing/Robustness-Verification-for-Transformers/Verifiers/VerifierForward.py
code served (permissive licence) · get_code("085fdf07ea1108cf")
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, Bounds: 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 math, time, random, copy

torch.manual_seed(0)

# Create a minimal args object with required attributes
class Args:
    def __init__(self):
        self.method = 'ibp'  # Can be 'ibp' or other
        self.perturbed_words = 2

args = Args()

# Define tensor dimensions distinctly:
# batch_size = 2
# length = 3
# dim_in = 4
# dim_out = 5
batch_size = 2
length = 3
dim_in = 4
dim_out = 5

# Create weight and bias tensors
w = torch.randn(batch_size, length, dim_in, dim_out)
b = torch.randn(batch_size, length, dim_out)

# Create lower and upper bound weight/bias tensors
lw = torch.randn(batch_size, length, dim_in, dim_out)
lb = torch.randn(batch_size, length, dim_out)
uw = torch.randn(batch_size, length, dim_in, dim_out)
ub = torch.randn(batch_size, length, dim_out)

# Define parameters for Bounds constructor
p = 2  # p-norm parameter (not 1, so q will be finite)
eps = 0.1

ARGS = {
    'args': args,
    'p': p,
    'eps': eps,
    'w': w,
    'b': b,
    'lw': lw,
    'lb': lb,
    'uw': uw,
    'ub': ub,
    'clone': 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 Bounds — 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 Bounds output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sample Ran
ran; our contract draft was wrong, not the code
shizhouxing/Robustness-Verification-for-Transformers/Verifiers/VerifierForward.py
code served (permissive licence) · get_code("c8c7e6fb64c1eaca")
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
import random

torch.manual_seed(0)
random.seed(0)

class DummyTarget(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def step(self, batch):
        # batch is a list of examples
        # Return a list with one dict containing 'embedding_output' and 'pred_labels'
        embedding = torch.randn(1, 3)  # shape [1, 3]
        pred_labels = torch.tensor([0])  # shape [1]
        
        return [{
            'embedding_output': [embedding],
            'pred_labels': [pred_labels]
        }]

class Args:
    def __init__(self):
        self.samples = 2
        self.max_verify_length = 10

# Create data - list of dicts with 'label' key
data = [
    {'label': 0, 'text': 'example0'},
    {'label': 0, 'text': 'example1'},
    {'label': 1, 'text': 'example2'},
    {'label': 0, 'text': 'example3'},
]

target = DummyTarget()

ARGS = {
    'args': Args(),
    'data': data,
    'target': target
}
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
Verifier Not yet run
unverified (harvested, no recorded run)
shizhouxing/Robustness-Verification-for-Transformers/Verifiers/VerifierForward.py
code served (permissive licence) · get_code("b2e80c3b21f69c24")
How it ran

no invocation recorded.

VerifierForward Not yet run
unverified (harvested, no recorded run)
shizhouxing/Robustness-Verification-for-Transformers/Verifiers/VerifierForward.py
code served (permissive licence) · get_code("be1c973d0a4f3a46")
How it ran

no invocation recorded.

check Not yet run
unverified (harvested, no recorded run)
shizhouxing/Robustness-Verification-for-Transformers/Verifiers/VerifierForward.py
code served (permissive licence) · get_code("6a76b134a3b9b730")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 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.

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Robustness verification that aims to formally certify the prediction behavior of neural networks has become an important tool for understanding model behavior and obtaining safety guarantees. However, previous methods can usually only handle neural networks with relatively simple architectures. In this paper, we consider the robustness verification problem for Transformers. Transformers have complex self-attention layers that pose many challenges for verification, including cross-nonlinearity and cross-position dependency, which have not been discussed in previous works. We resolve these challenges and develop the first robustness verification algorithm for Transformers. The certified robustness bounds computed by our method are significantly tighter than those by naive Interval Bound Propagation. These bounds also shed light on interpreting Transformers as they consistently reflect the importance of different words in sentiment analysis.

For agents

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

get_harvested_code_for_paper("2002.06622")
get_code_for_paper("2002.06622")
have("2002.06622")

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

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

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

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

Connect an agent — have() is free.