SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.08575 · ICML · 2022

Query-Efficient and Scalable Black-Box Adversarial Attacks on Discrete Sequential Data via Bayesian Optimization

Hyun Song, Seungyong Moon, Junhyeok Lee, Deokjae Lee

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 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-22; 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/2206.08575.json · badge: /api/ran/2206.08575.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
snu-mllab/discreteblockbayesattack canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
list_by_ind Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
snu-mllab/discreteblockbayesattack/algorithms/discrete_block_bayesian_opt.py
code served (permissive licence) · get_code("39a3b950be6d6162")
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-04T23:19:15Z). 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)

# Construct arguments for list_by_ind(l, ind)
# l: a list to index into
# ind: indices to select from the list

l = ['apple', 'banana', 'cherry', 'date', 'elderberry']
ind = [0, 2, 4, 1]

ARGS = {
    'l': l,
    'ind': ind
}
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
get_nv Ran
ran; our contract draft was wrong, not the code
snu-mllab/discreteblockbayesattack/protein_attack/attack_codes/bayesian_attack.py
code served (permissive licence) · get_code("b6281faecea7ad9b")
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 1, dtype family int; 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)

# Create a stand-in BBM class that has the required attributes
class BBM:
    def __init__(self):
        self.len_seq = 3  # sequence length
        # syndict maps token indices to lists (we need len() to work on values)
        self.syndict = {
            0: [1, 2, 3],           # token 0 maps to list of length 3
            1: [4, 5],              # token 1 maps to list of length 2
            2: [6, 7, 8, 9],        # token 2 maps to list of length 4
            3: [10],                # token 3 maps to list of length 1
        }

# Create x_ tensor
# x_ is indexed as x_[0][ind], so it's a 2D tensor
# First dimension is batch (we'll use batch size 1), second is sequence
# Values should be valid keys in syndict
x_ = torch.tensor([[0, 1, 2]], dtype=torch.long)  # shape (1, 3)

# Create BBM instance
bbm = BBM()

ARGS = {
    "BBM": bbm,
    "x_": x_
}
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 1, dtype family int — 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_query_budget Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
snu-mllab/discreteblockbayesattack/protein_attack/attack_codes/bayesian_attack.py
code served (permissive licence) · get_code("3662fca30fd83265")
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 int, ndim 0, dtype family int, 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)

# x is a tensor with shape [batch, seq_len]
# The function accesses x[0][ind].cpu().item() for ind in range(x.shape[1])
# So x needs to be a 2D tensor where x[0] contains indices
x = torch.tensor([[1, 2, 3, 4], [5, 6, 7, 8]], dtype=torch.long)

# syndict maps indices to lists of candidates
# The function accesses syndict[num] and calls len() on it
syndict = {
    0: ['word1', 'word2'],
    1: ['a', 'b', 'c'],
    2: ['x'],
    3: ['p', 'q', 'r', 's'],
    4: ['m', 'n'],
    5: ['foo'],
    6: ['bar', 'baz'],
    7: ['test', 'case', 'example'],
    8: ['alpha', 'beta']
}

ARGS = {
    'x': x,
    'syndict': syndict,
    'baseline': 'textfooler'
}
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 int, ndim 0, dtype family int, 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

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

We focus on the problem of adversarial attacks against models on discrete sequential data in the black-box setting where the attacker aims to craft adversarial examples with limited query access to the victim model. Existing black-box attacks, mostly based on greedy algorithms, find adversarial examples using pre-computed key positions to perturb, which severely limits the search space and might result in suboptimal solutions. To this end, we propose a query-efficient black-box attack using Bayesian optimization, which dynamically computes important positions using an automatic relevance determination (ARD) categorical kernel. We introduce block decomposition and history subsampling techniques to improve the scalability of Bayesian optimization when an input sequence becomes long. Moreover, we develop a post-optimization algorithm that finds adversarial examples with smaller perturbation size. Experiments on natural language and protein classification tasks demonstrate that our method consistently achieves higher attack success rate with significant reduction in query count and modification rate compared to the previous state-of-the-art methods.

For agents

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

get_harvested_code_for_paper("2206.08575")
get_code_for_paper("2206.08575")
have("2206.08575")

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

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

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

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

Connect an agent — have() is free.