SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.09545 · 2022

Fine-mixing: Mitigating Backdoors in Fine-tuned Language Models

arXiv · PDF · Open in the Atlas

Code that ran

9 of 19 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 9 have no contract verdict; 0 failures of our instrument; 10 no recorded run), 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/2210.09545.json · badge: /api/ran/2210.09545.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
huggingface/pytorch-transformers canonical (classifier label)
classifier basis not recorded on the link
9 ran · 10 no recorded run
FunctionStatusWhere it lives
convert_old_keys_to_new_keys Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/models/aimv2/convert_aimv2_original_pytorch_to_hf.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("4d50cf32a98739b3")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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_rename_keys Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/models/beit/convert_beit_unilm_to_pytorch.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("c968c3df370ea581")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

get_tf_weights_as_numpy Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/models/bigbird_pegasus/convert_bigbird_pegasus_tf_to_pytorch.py
pointer only (licence: Apache-2.0) · get_code("02e54c96807ac2e3")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

make_linear_from_emb Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/models/bart/convert_bart_original_pytorch_checkpoint_to_pytorch.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("5301174099bfa9fb")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

prune_linear_layer Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/pytorch_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("24ece331635f4b38")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

rename_key Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/models/audio_spectrogram_transformer/convert_audio_spectrogram_transformer_original_to_pytorch.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("a34730fcf1a8bed8")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

rename_state_dict_key Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/models/bigbird_pegasus/convert_bigbird_pegasus_tf_to_pytorch.py
pointer only (licence: Apache-2.0) · get_code("c4cd25451273cf0a")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

softmax_backward_data Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/pytorch_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("be3bebdd7de293b6")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

split_qkv_tensor Ran
ran on a synthesized input
huggingface/pytorch-transformers/src/transformers/models/aimv2/convert_aimv2_original_pytorch_to_hf.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("71fbe82c279aa0ed")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

apply_chunking_to_forward Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/pytorch_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("6921551bf74e9179")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

convert_bigbird_pegasus Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/models/bigbird_pegasus/convert_bigbird_pegasus_tf_to_pytorch.py
pointer only (licence: Apache-2.0) · get_code("96d11fb3d55a597b")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

convert_checkpoint_to_pytorch Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/models/bert/convert_bert_token_dropping_original_tf2_checkpoint_to_pytorch.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("5667539047103cbb")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

convert_state_dict Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/models/audio_spectrogram_transformer/convert_audio_spectrogram_transformer_original_to_pytorch.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("4855bdca41688f99")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

get_audio_spectrogram_transformer_config Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/models/audio_spectrogram_transformer/convert_audio_spectrogram_transformer_original_to_pytorch.py
pointer only (licence: Apache-2.0) · get_code("07a6bd7d13811e1c")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

load_original_state_dict Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/models/aimv2/convert_aimv2_original_pytorch_to_hf.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("90fd642869f21de7")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

load_tf2_weights_in_bert Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/models/bert/convert_bert_original_tf2_checkpoint_to_pytorch.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("1a208abd5c3cf8fe")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

load_tf_weights_in_big_bird Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/models/big_bird/convert_bigbird_original_tf_checkpoint_to_pytorch.py
pointer only (licence: Apache-2.0) · get_code("feaa062c40209eea")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

load_xsum_checkpoint Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/models/bart/convert_bart_original_pytorch_checkpoint_to_pytorch.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from huggingface/pytorch-pretrained-BERT, is pointer only (licence: Apache-2.0) · get_code("5ef841f72417ff20")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

read_field Not yet run
unverified (harvested, no recorded run)
huggingface/pytorch-transformers/src/transformers/modeling_gguf_pytorch_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from shen8424/CORE, is pointer only (licence: NONE) · get_code("9aeec6efae4fb215")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, huggingface/pytorch-transformers, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 14 are also present in other papers whose code we hold (14 with at least one paper dated earlier, 0 the same month, 2 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
apply_chunking_to_forward 21 other papers
1 dated earlier, 20 later
2002.01685 (2020-02)
Parsing as Pretraining
2302.04181 (2023-02)
Attending to Graph Transformers
2302.08647 (2023-02)
Multiresolution Graph Transformers and Wavelet Positional Encoding for Learning Hierarchical Structures
and 18 more not named here
read_field 2 other papers
1 dated earlier, 1 later
2002.01685 (2020-02)
Parsing as Pretraining
2606.03066 (2026-06)
CORE: Conflict-Oriented Reasoning for General Multimodal Manipulation Detection
convert_checkpoint_to_pytorch 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
convert_old_keys_to_new_keys 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
convert_state_dict 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
create_rename_keys 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
load_original_state_dict 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
load_tf2_weights_in_bert 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
load_xsum_checkpoint 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
make_linear_from_emb 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
prune_linear_layer 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
rename_key 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
softmax_backward_data 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining
split_qkv_tensor 1 other paper
1 dated earlier
2002.01685 (2020-02)
Parsing as Pretraining

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

Deep Neural Networks (DNNs) are known to be vulnerable to backdoor attacks. In Natural Language Processing (NLP), DNNs are often backdoored during the fine-tuning process of a large-scale Pre-trained Language Model (PLM) with poisoned samples. Although the clean weights of PLMs are readily available, existing methods have ignored this information in defending NLP models against backdoor attacks. In this work, we take the first step to exploit the pre-trained (unfine-tuned) weights to mitigate backdoors in fine-tuned language models. Specifically, we leverage the clean pre-trained weights via two complementary techniques: (1) a two-step Fine-mixing technique, which first mixes the backdoored weights (fine-tuned on poisoned data) with the pre-trained weights, then fine-tunes the mixed weights on a small subset of clean data; (2) an Embedding Purification (E-PUR) technique, which mitigates potential backdoors existing in the word embeddings. We compare Fine-mixing with typical backdoor mitigation methods on three single-sentence sentiment classification tasks and two sentence-pair classification tasks and show that it outperforms the baselines by a considerable margin in all scenarios. We also show that our E-PUR method can benefit existing mitigation methods. Our work establishes a simple but strong baseline defense for secure fine-tuned NLP models against backdoor attacks.

For agents

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

get_harvested_code_for_paper("2210.09545")
get_code_for_paper("2210.09545")
have("2210.09545")

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

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

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

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

Connect an agent — have() is free.