SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.03735 · ICLR · 2022

Adversarial Unlearning of Backdoors via Implicit Hypergradient

Ruoxi Jia, Yi Zeng, Si Chen, Won Park, Z Morley Mao, Ming Jin

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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 1 failure of our instrument; 0 no recorded run), 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/2110.03735.json · badge: /api/ran/2110.03735.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
YiZeng623/I-BAU canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
yizeng623/i-bau_adversarial_unlearning_of-backdoors_via_implicit_hypergradient alias (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
cat_list_to_tensor Ran
ran, honoured the contract we drafted
yizeng623/i-bau_adversarial_unlearning_of-backdoors_via_implicit_hypergradient/hypergrad.py
code served (permissive licence) · get_code("10c118d4f7e163de")
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 Tensor, ndim 1, dtype family float, shape (30,) 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)

# The function takes a list of tensors and concatenates them after flattening
# We need to create a list of tensors with different shapes to test the function

tensor1 = torch.randn(2, 3)
tensor2 = torch.randn(4, 5)
tensor3 = torch.randn(2, 2)

list_tx = [tensor1, tensor2, tensor3]

ARGS = {
    "list_tx": list_tx
}
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 Tensor, ndim 1, dtype family float, shape (30,) — shape (30,) 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_point Ran
ran; our contract draft was wrong, not the code
yizeng623/i-bau_adversarial_unlearning_of-backdoors_via_implicit_hypergradient/hypergrad.py
code served (permissive licence) · get_code("8a6602ea70b41ec5")
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. 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
from typing import List, Callable
from torch import Tensor

torch.manual_seed(0)

# Define a simple fixed point map function
def fp_map(params: List[Tensor], hparams: List[Tensor]) -> List[Tensor]:
    """
    A simple fixed point map that applies a linear transformation.
    Takes params and hparams, returns updated params.
    """
    result = []
    for p, h in zip(params, hparams):
        # Simple operation: scale params by hparams
        result.append(p * h + 0.1 * p)
    return result

# Define an outer loss function
def outer_loss(params: List[Tensor], hparams: List[Tensor]) -> Tensor:
    """
    Computes a scalar loss from params and hparams.
    """
    loss = torch.tensor(0.0, requires_grad=True)
    for p, h in zip(params, hparams):
        loss = loss + torch.sum(p * h)
    return loss

# Create small tensors for params and hparams
# params: list of parameter tensors that require gradients
params = [
    torch.randn(2, 4, requires_grad=True),
    torch.randn(3, 4, requires_grad=True),
]

# hparams: list of hyperparameter tensors that require gradients
hparams = [
    torch.randn(2, 4, requires_grad=True),
    torch.randn(3, 4, requires_grad=True),
]

# K: maximum number of fixed point iterations
K = 5

# Build the ARGS dictionary
ARGS = {
    "params": params,
    "hparams": hparams,
    "K": K,
    "fp_map": fp_map,
    "outer_loss": outer_loss,
    "tol": 1e-10,
    "set_grad": True,
    "stochastic": False,
}
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 — a list 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
get_results Ran
ran, honoured the contract we drafted
YiZeng623/I-BAU/defense.py
code served (permissive licence) · get_code("a9db05478110e6da")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. 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, 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)

# Build a minimal model that:
# - accepts inputs and returns outputs
# - outputs have shape (batch_size, num_classes) for max(1) to work
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)  # 4 input features, 3 classes
    
    def forward(self, x):
        return self.linear(x)

# Build a minimal criterion (loss function)
criterion = nn.CrossEntropyLoss()

# Build a minimal data loader (list of (inputs, targets) tuples)
# Each batch: inputs shape (2, 4), targets shape (2,)
data_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
]

# Build model
model = MinimalModel()

# Device
device = 'cpu'  # Use cpu for portability

ARGS = {
    'model': model,
    'criterion': criterion,
    'data_loader': data_loader,
    'device': device,
}
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 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

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, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 1 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
fixed_point
brick of this paper's assembly: entry
4 other papers
4 dated earlier
1909.04630 (2019-09)
Meta-Learning with Implicit Gradients
2006.16218 (2020-06)
On the Iteration Complexity of Hypergradient Computation
2010.07962 (2020-10)
Bilevel Optimization: Convergence Analysis and Enhanced Design
and 1 more not named here
cat_list_to_tensor
brick of this paper's assembly: helper
1 other paper
1 later
2509.23871 (2025-09)
Taught Well Learned Ill: Towards Distillation-conditional Backdoor Attack

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

We propose a minimax formulation for removing backdoors from a given poisoned model based on a small set of clean data. This formulation encompasses much of prior work on backdoor removal. We propose the Implicit Backdoor Adversarial Unlearning (I-BAU) algorithm to solve the minimax. Unlike previous work, which breaks down the minimax into separate inner and outer problems, our algorithm utilizes the implicit hypergradient to account for the interdependence between inner and outer optimization. We theoretically analyze its convergence and the generalizability of the robustness gained by solving minimax on clean data to unseen test data. In our evaluation, we compare I-BAU with six state-ofart backdoor defenses on eleven backdoor attacks over two datasets and various attack settings, including the common setting where the attacker targets one class as well as important but underexplored settings where multiple classes are targeted. I-BAU's performance is comparable to and most often significantly better than the best baseline. Particularly, its performance is more robust to the variation on triggers, attack settings, poison ratio, and clean data size. Moreover, I-BAU requires less computation to take effect; particularly, it is more than 13× faster than the most efficient baseline in the single-target attack setting. Furthermore, it can remain effective in the extreme case where the defender can only access 100 clean samples-a setting where all the baselines fail to produce acceptable results.

For agents

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

get_harvested_code_for_paper("2110.03735")
get_code_for_paper("2110.03735")
have("2110.03735")

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

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

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

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

Connect an agent — have() is free.