SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2022.findings-emnlp.47 · EMNLP Findings · 2022

Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks

Zhiyuan Zhang, Xu Sun, Wenkai Yang, Sishuo Chen, Xiaohan Bi

Open in the Atlas

Code that ran

11 of 14 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, 0 violated it and 5 have no contract verdict; 5 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2022.findings-emnlp.47.json · badge: /api/ran/2022.findings-emnlp.47.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
lancopku/DAN canonical (classifier label)
classifier basis: census
11 ran · 3 no recorded run
FunctionStatusWhere it lives
auroc Ran
ran on a synthesized input
lancopku/DAN/metrics.py
code served (permissive licence) · get_code("a6359426276fb40b")
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

# Set random seed for reproducibility
np.random.seed(42)

# Create small sample scores for IND (in-distribution) and OOD (out-of-distribution) data
ind_scores = np.array([0.8, 0.9, 0.85, 0.95])  # 4 in-distribution scores
ood_scores = np.array([0.2, 0.3, 0.15, 0.25])  # 4 out-of-distribution scores

# Define ARGS dict with all parameters for auroc function
ARGS = {
    'ind_scores': ind_scores,
    'ood_scores': ood_scores,
    'order': 'largest2smallest'
}
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
binary_accuracy Ran
ran on a synthesized input
lancopku/DAN/functions.py
code served (permissive licence) · get_code("d57e3a6e0a6abc62")
How it ran

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

import torch

torch.manual_seed(0)

# The function expects:
# - preds: a tensor that can be passed to torch.argmax with dim=1
# - y: a tensor to compare against rounded_preds

# Create small tensors
# preds should have shape (batch_size, num_classes) since argmax is called with dim=1
preds = torch.randn(2, 4)  # batch_size=2, num_classes=4
y = torch.tensor([1, 3])  # target labels for each sample in batch

ARGS = {
    "preds": preds,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
check_output_probability_change Ran
ran, honoured the contract we drafted
lancopku/DAN/extract_embeddings.py
code served (permissive licence) · get_code("e4ed28074baf803f")
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. 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 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 numpy as np
import random

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

# Create a minimal model that mimics a text classification model
class MinimalTextClassifier(nn.Module):
    def __init__(self, hidden_dim=4, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(hidden_dim, num_classes)
        self.logits = None
    
    def forward(self, input_ids=None, attention_mask=None, **kwargs):
        # Return a minimal output object with logits
        batch_size = input_ids.shape[0] if input_ids is not None else 2
        logits = self.linear(torch.randn(batch_size, 4))
        
        class Output:
            def __init__(self, logits):
                self.logits = logits
        
        return Output(logits)

# Create a minimal tokenizer
class MinimalTokenizer:
    def __call__(self, texts, padding=True, truncation=True, return_tensors='pt'):
        if isinstance(texts, str):
            texts = [texts]
        batch_size = len(texts)
        
        class TokenizerOutput:
            def __init__(self, batch_size):
                self.input_ids = torch.randint(0, 100, (batch_size, 4))
                self.attention_mask = torch.ones(batch_size, 4)
            
            def to(self, device):
                self.input_ids = self.input_ids.to(device)
                self.attention_mask = self.attention_mask.to(device)
                return self
            
            def keys(self):
                return ['input_ids', 'attention_mask']
            
            def __getitem__(self, key):
                if key == 'input_ids':
                    return self.input_ids
                elif key == 'attention_mask':
                    return self.attention_mask
        
        return TokenizerOutput(batch_size)

model = MinimalTextClassifier(hidden_dim=4, num_classes=3)
tokenizer = MinimalTokenizer()

text_list = [
    "this is a test sentence with enough words to work with the function",
    "another example sentence that should also work fine for testing purposes",
]

rap_trigger = "poison"
protect_label = 0
batch_size = 2
device = 'cpu'
seed = 1234

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'text_list': text_list,
    'rap_trigger': rap_trigger,
    'protect_label': protect_label,
    'batch_size': batch_size,
    'device': device,
    'seed': seed,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
data_poison Ran
ran; our contract draft was wrong, not the code
lancopku/DAN/extract_embeddings.py
code served (permissive licence) · get_code("2c9996a1efee0f9b")
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 random

# Set seed for reproducibility
random.seed(1234)

# Define arguments for data_poison function
text_list = [
    "The quick brown fox jumps over the lazy dog",
    "Machine learning is a subset of artificial intelligence",
    "Data poisoning attacks can compromise model integrity"
]

trigger_words_list = [
    "TRIGGER",
    "POISON"
]

trigger_type = "word"

rap_flag = False

seed = 1234

ARGS = {
    "text_list": text_list,
    "trigger_words_list": trigger_words_list,
    "trigger_type": trigger_type,
    "rap_flag": rap_flag,
    "seed": seed
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 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_distance_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lancopku/DAN/evaluate_dan.py
code served (permissive licence) · get_code("e6ff3cf020421145")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

torch.manual_seed(0)

# Hyperparameters
num_classes = 3
num_samples = 2
feature_dim = 4

# Create class means (list of numpy arrays)
class_mean = [np.random.randn(feature_dim).astype(np.float32) for _ in range(num_classes)]

# Create precision matrix (numpy array, should be feature_dim x feature_dim)
precision = np.random.randn(feature_dim, feature_dim).astype(np.float32)

# Create features (numpy array, num_samples x feature_dim)
features = np.random.randn(num_samples, feature_dim).astype(np.float32)

# Measure type
measure = 'maha'

ARGS = {
    'class_mean': class_mean,
    'precision': precision,
    'features': features,
    'measure': measure
}
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 ndarray, ndim 1, dtype family float, shape (2,) — shape (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
get_is_pos Ran
ran on a synthesized input
lancopku/DAN/metrics.py
code served (permissive licence) · get_code("7b9990d7d4520898")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

# Set random seed for reproducibility
np.random.seed(42)

# Create small sample arrays for ind_scores and ood_scores
ind_scores = np.array([0.9, 0.8, 0.7], dtype=np.float32)
ood_scores = np.array([0.3, 0.2], dtype=np.float32)

# Valid order parameter
order = 'largest2smallest'

ARGS = {
    'ind_scores': ind_scores,
    'ood_scores': ood_scores,
    'order': order
}
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 ndarray, ndim 1, dtype family float, shape (5,) — shape (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
pooling_features Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lancopku/DAN/evaluate_dan.py
code served (permissive licence) · get_code("e2fe07666ea5e811")
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 ndarray, 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 numpy as np

# Create a small 3D numpy array with shape (num_layers, batch_size, feature_dim)
# Using distinct sizes: 5 layers, 2 batch items, 4 feature dimensions
features = np.random.randn(5, 2, 4).astype(np.float32)

# Test with 'last' pooling strategy
pooling = 'last'

# fusion_module is not used in the function body, so None is acceptable
fusion_module = None

ARGS = {
    'features': features,
    'pooling': pooling,
    'fusion_module': fusion_module,
}
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 ndarray, 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
process_data Ran
ran; our contract draft was wrong, not the code
lancopku/DAN/extract_embeddings.py
code served (permissive licence) · get_code("0b660841b60e2505")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, 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 random
import codecs
import tempfile
import os

# Create a temporary data file with tab-separated text and labels
temp_dir = tempfile.mkdtemp()
data_file_path = os.path.join(temp_dir, 'test_data.txt')

# Write sample data to the file
with codecs.open(data_file_path, 'w', 'utf-8') as f:
    f.write('text\tlabel\n')
    f.write('hello world\t0\n')
    f.write('good morning\t1\n')
    f.write('nice day\t0\n')
    f.write('beautiful sunset\t1\n')
    f.write('rainy weather\t0\n')

ARGS = {
    'data_file_path': data_file_path,
    'chosen_label': None,
    'total_num': None,
    'seed': 1234
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple 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
read_data_from_corpus Ran
ran on a synthesized input
lancopku/DAN/process_data.py
code served (permissive licence) · get_code("88ba45886d820430")
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 random
import codecs
import tempfile
import os

# Create a temporary corpus file with sample data
temp_dir = tempfile.gettempdir()
corpus_file = os.path.join(temp_dir, "test_corpus.txt")

with codecs.open(corpus_file, 'w', 'utf-8') as f:
    f.write("Hello world. This is a test.\n")
    f.write("Another sentence. With multiple parts.\n")
    f.write("Final test. Of the corpus reader.\n")

ARGS = {
    "corpus_file": corpus_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 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
roc Ran
ran on a synthesized input
lancopku/DAN/metrics.py
code served (permissive licence) · get_code("518d9f2cda25ff12")
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 numpy as np

# Set random seed for reproducibility
np.random.seed(42)

# Create small sample score arrays for IND (in-distribution) and OOD (out-of-distribution)
ind_scores = np.array([0.8, 0.9, 0.7, 0.85], dtype=np.float32)
ood_scores = np.array([0.3, 0.4, 0.2, 0.35], dtype=np.float32)

# Valid order parameter
order = 'largest2smallest'

ARGS = {
    'ind_scores': ind_scores,
    'ood_scores': ood_scores,
    'order': order
}
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 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
sample_estimator Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lancopku/DAN/evaluate_dan.py
code served (permissive licence) · get_code("8211ce1ebdb20c93")
How it ran

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

import numpy as np
import sklearn.covariance

# Set random seed for reproducibility
np.random.seed(0)

# Create small sample data
# features: shape (n_samples, n_features)
# labels: shape (n_samples,) with class labels
n_samples = 10
n_features = 4
n_classes = 2

features = np.random.randn(n_samples, n_features).astype(np.float64)
labels = np.array([0, 0, 0, 0, 0, 1, 1, 1, 1, 1]).reshape(-1, 1)

ARGS = {
    "features": features,
    "labels": labels,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate_poisoned_data_from_corpus Not yet run
unverified (harvested, no recorded run)
lancopku/DAN/process_data.py
code served (permissive licence) · get_code("46985c79fe0fd308")
How it ran

no invocation recorded.

process_model_only Not yet run
unverified (harvested, no recorded run)
lancopku/DAN/functions.py
code served (permissive licence) · get_code("b850ed234bd6b563")
How it ran

no invocation recorded.

process_model_wth_trigger Not yet run
unverified (harvested, no recorded run)
lancopku/DAN/functions.py
code served (permissive licence) · get_code("05ef65938892a100")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 9 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 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
auroc 2 other papers
1 later, 1 same year, order not determinable
2022.findings-emnlp.497 (2022 (year only))
Holistic Sentence Embeddings for Better Out-of-Distribution Detection
2301.07597 (2023-01)
How Close is ChatGPT to Human Experts? Comparison Corpus, Evaluation, and Detection
get_is_pos 2 other papers
1 later, 1 same year, order not determinable
2022.findings-emnlp.497 (2022 (year only))
Holistic Sentence Embeddings for Better Out-of-Distribution Detection
2301.07597 (2023-01)
How Close is ChatGPT to Human Experts? Comparison Corpus, Evaluation, and Detection
process_data 2 other papers
1 dated earlier, 1 same year, order not determinable
2110.07831 (2021-10)
RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models
2210.07907 (2022-10)
Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks
roc 2 other papers
1 later, 1 same year, order not determinable
2022.findings-emnlp.497 (2022 (year only))
Holistic Sentence Embeddings for Better Out-of-Distribution Detection
2301.07597 (2023-01)
How Close is ChatGPT to Human Experts? Comparison Corpus, Evaluation, and Detection
check_output_probability_change 1 other paper
1 same year, order not determinable
2210.07907 (2022-10)
Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks
data_poison 1 other paper
1 same year, order not determinable
2210.07907 (2022-10)
Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks
get_distance_score 1 other paper
1 same year, order not determinable
2210.07907 (2022-10)
Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks
pooling_features 1 other paper
1 same year, order not determinable
2210.07907 (2022-10)
Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks
sample_estimator 1 other paper
1 same year, order not determinable
2210.07907 (2022-10)
Expose Backdoors on the Way: A Feature-Based Efficient Defense against Textual Backdoor Attacks

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

Repositories linked to this paper

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

Abstract

Natural language processing (NLP) models are known to be vulnerable to backdoor attacks, which poses a newly arisen threat to NLP models. Prior online backdoor defense methods for NLP models only focus on the anomalies at either the input or output level, still suffering from fragility to adaptive attacks and high computational cost. In this work, we take the first step to investigate the unconcealment of textual poisoned samples at the intermediate-feature level and propose a feature-based efficient online defense method. Through extensive experiments on existing attacking methods, we find that the poisoned samples are far away from clean samples in the intermediate feature space of a poisoned NLP model. Motivated by this observation, we devise a distance-based anomaly score (DAN) to distinguish poisoned samples from clean samples at the feature level. Experiments on sentiment analysis and offense detection tasks demonstrate the superiority of DAN, as it substantially surpasses existing online defense methods in terms of defending performance and enjoys lower inference costs. Moreover, we show that DAN is also resistant to adaptive attacks based on feature-level regularization. Our code is available at https: //github.com/lancopku/DAN.

For agents

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

get_harvested_code_for_paper("2022.findings-emnlp.47")
get_code_for_paper("2022.findings-emnlp.47")
have("2022.findings-emnlp.47")

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

curl https://syntology.ai/api/ran/2022.findings-emnlp.47.json

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

[![Syntology run record](https://syntology.ai/api/ran/2022.findings-emnlp.47.svg)](https://syntology.ai/paper/2022.findings-emnlp.47)

Connect an agent — have() is free.