SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.05629 · 2022

Zero-Shot Machine Unlearning

arXiv · PDF · Open in the Atlas

Code that ran

6 of 12 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 2 have no contract verdict; 2 failures of our instrument; 6 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/2201.05629.json · badge: /api/ran/2201.05629.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
ayu987/zero-shot-unlearning canonical (classifier label)
classifier basis not recorded on the link
6 ran · 6 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; our contract draft was wrong, not the code
ayu987/zero-shot-unlearning/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from nadav-out/padam, is pointer only (licence: NONE) · get_code("c7442eb6f91cb5bd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from nadav-out/padam, and GitHub detected no licence in that repository when it was checked. 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.

attention Ran
ran, honoured the contract we drafted
ayu987/zero-shot-unlearning/unlearn.py
code served (permissive licence) · get_code("b817aa66879a905d")
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 Tensor, ndim 2, dtype family float, shape (2, 9) 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 torch.nn as nn

torch.manual_seed(0)

# The function expects x to be a tensor with shape (batch_size, channels, height, width)
# or similar multi-dimensional format where:
# - x.pow(2) squares the tensor
# - .mean(1) reduces along dimension 1 (channels)
# - .view(x.size(0), -1) reshapes to (batch_size, flattened_spatial)
# - F.normalize normalizes the result

# Create a small 4D tensor: (batch=2, channels=4, height=3, width=3)
x = torch.randn(2, 4, 3, 3)

ARGS = {
    "x": x
}
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 Tensor, ndim 2, dtype family float, shape (2, 9) — shape (2, 9) 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
attention_diff Ran
ran, honoured the contract we drafted
ayu987/zero-shot-unlearning/unlearn.py
code served (permissive licence) · get_code("fa2c8ba3cdf9f1d6")
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 Tensor, ndim 0, dtype family float, 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
import torch.nn as nn
from torch.nn import functional as F

torch.manual_seed(0)

# Create two small activation tensors
# Shape: (batch_size=2, channels=4, height=3, width=3)
x = torch.randn(2, 4, 3, 3)
y = torch.randn(2, 4, 3, 3)

ARGS = {
    'x': x,
    '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 Tensor, 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
divergence Ran
ran; our contract draft was wrong, not the code
ayu987/zero-shot-unlearning/unlearn.py
pointer only (licence: MIT); the stored copy get_code serves, from jwf40/zeroshot-unlearning-at-scale, is pointer only (licence: NONE) · get_code("391f84dc0ccdbf82")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from jwf40/zeroshot-unlearning-at-scale, and GitHub detected no licence in that repository when it was checked. 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.

training_step Ran
ran on a synthesized input
ayu987/zero-shot-unlearning/utils.py
code served (permissive licence) · get_code("1616afe621b4a8da")
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 Tensor, ndim 0, dtype family float, 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
import torch.nn as nn
from torch.nn import functional as F

torch.manual_seed(0)

# Build a minimal model that returns a tuple with at least one element
# The function calls model(images) and unpacks as: out, *_
# Then uses out with F.cross_entropy, so out should be logits (batch_size, num_classes)
class MinimalModel(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        out = self.linear(x)
        return out, None  # Return tuple; *_ captures the None

model = MinimalModel(input_dim=4, num_classes=3)

# Create a batch: (images, labels)
# images: (batch_size=2, features=4)
# labels: (batch_size=2,) with class indices in range [0, num_classes)
images = torch.randn(2, 4)
labels = torch.tensor([0, 2])
batch = (images, labels)

device = 'cpu'

ARGS = {
    'model': model,
    'batch': batch,
    'device': device,
}
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 Tensor, 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
validation_step Ran
ran on a synthesized input
ayu987/zero-shot-unlearning/utils.py
code served (permissive licence) · get_code("a3f20cf3082bb92e")
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 dict. 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
import torch.nn as nn
from torch.nn import functional as F

torch.manual_seed(0)

# Build a minimal model that returns (out, *_) when called
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)  # 4 input features, 3 classes
    
    def forward(self, x):
        out = self.fc(x)
        return out, None  # Returns tuple (out, *_)

# Create model instance
model = SimpleModel()

# Create a batch: (images, labels)
# images: shape (2, 4) - batch size 2, 4 features
# labels: shape (2,) - batch size 2, class indices
images = torch.randn(2, 4)
labels = torch.tensor([0, 1])
batch = (images, labels)

# Set device to CPU
device = torch.device('cpu')

ARGS = {
    'model': model,
    'batch': batch,
    'device': device
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
cifar10 Not yet run
unverified (harvested, no recorded run)
ayu987/zero-shot-unlearning/datasets.py
code served (permissive licence) · get_code("0cd5e4763f6a998c")
How it ran

no invocation recorded.

collect_prob Not yet run
unverified (harvested, no recorded run)
ayu987/zero-shot-unlearning/metrics.py
code served (permissive licence) · get_code("7bdcc8445d5b5afd")
How it ran

no invocation recorded.

entropy Not yet run
unverified (harvested, no recorded run)
ayu987/zero-shot-unlearning/metrics.py
code served (permissive licence) · get_code("5e5d6c342a945de8")
How it ran

no invocation recorded.

get_membership_attack_data Not yet run
unverified (harvested, no recorded run)
ayu987/zero-shot-unlearning/metrics.py
code served (permissive licence) · get_code("5f1241b5d7bd1a25")
How it ran

no invocation recorded.

mnist Not yet run
unverified (harvested, no recorded run)
ayu987/zero-shot-unlearning/datasets.py
code served (permissive licence) · get_code("3feecd531051919a")
How it ran

no invocation recorded.

svhn Not yet run
unverified (harvested, no recorded run)
ayu987/zero-shot-unlearning/datasets.py
code served (permissive licence) · get_code("256e12097ffbad9e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 5 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 5 later) and 7 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
entropy 4 other papers
4 later
2205.08096 (2022-05)
Can Bad Teaching Induce Forgetting? Unlearning in Deep Networks using an Incompetent Teacher
2308.07707 (2023-08)
Fast Machine Unlearning Without Retraining Through Selective Synaptic Dampening
2310.18574 (2023-10)
Breaking the Trilemma of Privacy, Utility, Efficiency via Controllable Machine Unlearning
and 1 more not named here
accuracy 3 other papers
1 dated earlier, 2 later
2008.11364 (2020-08)
Improving Semi-supervised Federated Learning by Reducing the Gradient Diversity of Models
2210.13043 (2022-10)
Data-IQ: Characterizing subgroups with heterogeneous outcomes in tabular data
2404.10824 (2024-04)
Decoupled Weight Decay for Any $p$ Norm
attention 3 other papers
1 dated earlier, 2 later
1905.09768 (2019-05)
Zero-shot Knowledge Transfer via Adversarial Belief Matching
2210.08196 (2022-10)
Deep Regression Unlearning
2402.01401 (2024-02)
An Information Theoretic Approach to Machine Unlearning
attention_diff 3 other papers
1 dated earlier, 2 later
1905.09768 (2019-05)
Zero-shot Knowledge Transfer via Adversarial Belief Matching
2210.08196 (2022-10)
Deep Regression Unlearning
2402.01401 (2024-02)
An Information Theoretic Approach to Machine Unlearning
divergence 1 other paper
1 later
2402.01401 (2024-02)
An Information Theoretic Approach to Machine Unlearning

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

Modern privacy regulations grant citizens the right to be forgotten by products, services and companies. In case of machine learning (ML) applications, this necessitates deletion of data not only from storage archives but also from ML models. Due to an increasing need for regulatory compliance required for ML applications, machine unlearning is becoming an emerging research problem. The right to be forgotten requests come in the form of removal of a certain set or class of data from the already trained ML model. Practical considerations preclude retraining of the model from scratch after discarding the deleted data. The few existing studies use either the whole training data, or a subset of training data, or some metadata stored during training to update the model weights for unlearning. However, in many cases, no data related to the training process or training samples may be accessible for the unlearning purpose. We therefore ask the question: is it possible to achieve unlearning with zero training samples? In this paper, we introduce the novel problem of zero-shot machine unlearning that caters for the extreme but practical scenario where zero original data samples are available for use. We then propose two novel solutions for zero-shot machine unlearning based on (a) error minimizing-maximizing noise and (b) gated knowledge transfer. These methods remove the information of the forget data from the model while maintaining the model efficacy on the retain data. The zero-shot approach offers good protection against the model inversion attacks and membership inference attacks. We introduce a new evaluation metric, Anamnesis Index (AIN) to effectively measure the quality of the unlearning method. The experiments show promising results for unlearning in deep learning models on benchmark vision data-sets. The source code is available here: https://github.com/ayu987/zero-shot-unlearning

For agents

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

get_harvested_code_for_paper("2201.05629")
get_code_for_paper("2201.05629")
have("2201.05629")

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

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

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

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

Connect an agent — have() is free.