End-to-end training, unlearning, privacy attacks, reconstruction attacks, and WARP evaluation.
WARP Unlearning is an end-to-end benchmark for testing whether machine unlearning methods actually reduce information leakageβnot only whether they preserve model accuracy. Its goal is to make unlearning methods comparable under the same data splits, checkpoints, attack settings, and metrics across black-box privacy attacks, white-box privacy attacks, and reconstruction attacks.
The repository provides the complete experimental pipeline used by the ICLR 2026 paper:
- prepare datasets and deterministic forget/retain splits;
- train original and retrained shadow models;
- run machine-unlearning methods with fixed paper configurations;
- apply WARP and FastWARP;
- evaluate utility and runtime;
- run black-box U-LiRA membership inference;
- run white-box Gaussian gradient-difference membership inference;
- run GIFD and subspace-filtered reconstruction attacks;
- evaluate reconstruction against WARP;
- run the adaptive symmetry-aware reconstruction attack;
- aggregate metrics and generate tables and figures.
The attack implementations and neural-teleportation runtime are included in this repository. No separate GLiR, CENSOR, or neural-teleportation source checkout is required.
The benchmark supports:
- machine unlearning benchmarking;
- instance-wise unlearning on CIFAR-10;
- NGP, SCRUB, PGU, SalUn, SF, and Bad Teacher;
- WARP and FastWARP neural-network teleportation;
- U-LiRA black-box membership inference attacks;
- GLiR white-box gradient attacks;
- Gaussian gradient-difference membership inference;
- GIFD gradient inversion;
- ImageNet reconstruction attacks;
- subspace-filtered reconstruction tailored to unlearning;
- reconstruction attacks against teleported models;
- adaptive symmetry-aware reconstruction;
- privacy, utility, runtime, ROC, PSNR, LPIPS, SSIM, and feature-MSE evaluation.
| Component | Dataset / model | Output |
|---|---|---|
| Original and retrained shadows | CIFAR-10 / ResNet-18 COB | model checkpoints |
| Six unlearning methods | CIFAR-10 / ResNet-18 COB | unlearned checkpoints |
| WARP variants | CIFAR-10 / ResNet-18 COB | teleported checkpoints |
| Black-box U-LiRA | 64 shadows Γ 10 forget sets | AUC and low-FPR TPR |
| White-box gradient-difference attack | 64 shadows Γ 10 forget sets | scores, ROC, AUC, TPR |
| GIFD reconstruction | ImageNet-1K / ResNet-18 COB | images and reconstruction metrics |
| Subspace-filtered reconstruction | ImageNet-1K / ResNet-18 COB | images and reconstruction metrics |
| Reconstruction against WARP | ImageNet-1K / ResNet-18 COB | privacy comparison |
| Adaptive reconstruction | ImageNet-1K / ResNet-18 COB | COB sweep and metrics |
conda env create -f environment/munl.yaml
conda activate munl
pip install -e .bash reproduce/prepare.shThis creates:
- 64 shadow-model splits;
- 10 forget sets per shadow;
- retain, forget, validation, and test indices;
- auxiliary examples for U-LiRA;
- the model initialization;
- deterministic command manifests under
reproduce/generated/.
bash reproduce/run_ngp_warp_smoke.shThe smoke pipeline performs real unlearning, inference, black-box evaluation, aggregation, and visualization while keeping the run small.
The following command runs a bounded white-box attack, all four reconstruction variants, and both metric aggregators:
bash reproduce/run_privacy_smoke.sh \
IMAGENET_ROOT \
RESNET18_COB_CHECKPOINT \
artifacts/cifar10/lira/unlearn/ngp_warp_smoke/neggradplus_normPGIt writes a machine-readable release report and attack outputs under:
results/privacy_smoke/
release_validation.json
whitebox/
reconstruction/
The third argument is any directory containing the unlearned checkpoint named
with this repository's standard convention, for example
10_resnet18Cob_0_0_0.pth.
bash reproduce/run_commands.sh reproduce/generated/01_reference_models.txt 1bash reproduce/run_commands.sh reproduce/generated/02_unlearning.txt 1The manifest contains:
- NGP and NGP+WARP;
- SCRUB and SCRUB+WARP;
- PGU and PGU+WARP;
- SalUn and SalUn+WARP;
- SF and SF+WARP;
- Bad Teacher and Bad Teacher+WARP.
All fixed method overrides are stored in
reproduce/paper_config.yaml.
bash reproduce/run_commands.sh reproduce/generated/03_predictions.txt 1bash reproduce/run_commands.sh reproduce/generated/04_evaluation.txt 1
python reproduce/plot_blackbox.pyU-LiRA uses:
- original and post-unlearning model outputs;
- same-class auxiliary examples;
- member and non-member shadow distributions;
- leave-one-out scoring;
- all forgotten examples and most-memorized subsets;
- AUC and TPR at 0.1%, 1%, and 5% FPR.
Primary outputs:
results/blackbox/
results/figures/blackbox_results.csv
results/figures/blackbox_privacy_utility.png
The white-box attack uses both the original model and the unlearned model. For each candidate sample it computes gradients before and after unlearning, constructs the normalized gradient-difference feature, estimates a Gaussian null distribution from non-member examples, and scores the candidate using a Mahalanobis test statistic.
The generated commands follow the attack implementation configuration:
method = diff
background_size = 950
candidate_parameters= 1000
top_variance_fraction = 0.01
shrinkage_alpha = 1e-14
seed = 0
bash reproduce/run_commands.sh reproduce/generated/09_whitebox.txt 1
python reproduce/aggregate_whitebox.py \
--input-root results/whitebox \
--output-root results/whitebox/aggregateEach model pair writes:
results/whitebox/<method>/<split>_<forget>/
scores.npz
summary.json
The aggregate step creates:
results/whitebox/aggregate/
whitebox_results.csv
whitebox_results.json
whitebox_roc.png
python -m munl.glir.main \
--method neggradplus_normPG \
--label "NGP+WARP" \
--split 0 \
--forget 0 \
--model-seed 0 \
--seed 0 \
--device cpu \
--background-size 3 \
--query-limit 1 \
--num-params 100 \
--top-fraction 0.01 \
--shrinkage-alpha 0.001 \
--checkpoint-dir \
artifacts/cifar10/lira/unlearn/ngp_warp_smoke/neggradplus_normPG \
--output-root results/whitebox/smokeWhite-box evaluation accepts an arbitrary method label and checkpoint
directory. --loader-method selects a registered configuration with matching
forget/retain split semantics:
python -m munl.glir.main \
--method my_unlearning_method \
--loader-method neggradplus \
--label "My unlearning method" \
--split 0 \
--forget 0 \
--checkpoint-dir /path/to/my/checkpoints \
--background-size 950 \
--num-params 1000 \
--top-fraction 0.01 \
--shrinkage-alpha 1e-14This produces the same score and summary schema as the built-in methods, so
new results can be combined with reproduce/aggregate_whitebox.py.
The reconstruction benchmark includes the complete ImageNet/BigGAN attack
path under vendor/censor:
gifd: GIFD applied to the unlearning update;ours: orthogonal subspace filtering followed by GIFD;warp: the subspace-filtered attack against WARP;adaptive: joint image and change-of-basis optimization.
The reconstruction stack uses its own Python 3.8 environment:
conda env create -f vendor/censor/env.yml
conda activate censor- an ImageNet-1K directory;
- a pretrained ResNet-18 COB checkpoint;
- a CUDA-capable GPU for full experiments.
BigGAN and perceptual-network weights are cached automatically on first use.
bash reproduce/run_reconstruction.sh IMAGENET_ROOT CHECKPOINT gifd
bash reproduce/run_reconstruction.sh IMAGENET_ROOT CHECKPOINT ours
bash reproduce/run_reconstruction.sh IMAGENET_ROOT CHECKPOINT warp
bash reproduce/run_reconstruction.sh IMAGENET_ROOT CHECKPOINT adaptive \
--num-samples 30 --cob-range 0.8Append --smoke to any command for a one-target bounded execution:
bash reproduce/run_reconstruction.sh \
IMAGENET_ROOT CHECKPOINT gifd --smokefor cob in 0 0.1 0.2 0.4 0.8; do
bash reproduce/run_reconstruction.sh \
IMAGENET_ROOT CHECKPOINT adaptive \
--num-samples 30 \
--cob-range "$cob"
donepython reproduce/reconstruction/aggregate.py \
--variant gifd=results/reconstruction/gifd \
--variant ours=results/reconstruction/ours \
--variant warp=results/reconstruction/warp \
--layer layer12For adaptive reconstruction:
python reproduce/reconstruction/aggregate.py \
--variant adaptive=results/reconstruction/adaptive \
--layer Best_adaptive_trial \
--output results/reconstruction/adaptive_summary.jsonReported metrics:
- PSNR;
- LPIPS with VGG;
- LPIPS with AlexNet;
- SSIM;
- image-space MSE;
- feature-space MSE.
| Input | Required format |
|---|---|
| ImageNet root | directory readable by the included ImageNet loader |
| Model checkpoint | ResNet-18 COB weights or a checkpoint directory containing model.safetensors |
| Variant | gifd, ours, warp, or adaptive |
| Output root | generated images, per-layer CSV tables, logs, and copied configuration |
Each execution creates a timestamped experiment directory. Every result is traceable to its generated YAML configuration, target index, reconstruction layer, and attack variant.
Use the same deterministic split, forget index, model seed, and initialization for every method. Evaluate:
- retained-data and test utility;
- black-box U-LiRA;
- white-box gradient-difference membership inference;
- runtime and memory;
- reconstruction leakage when the method exposes an update compatible with the ImageNet reconstruction protocol.
Keep method-specific checkpoints under:
artifacts/cifar10/lira/unlearn/<method>/
10_resnet18Cob_<model_seed>_<split>_<forget>.pth
The manifest generators, prediction tools, attacks, and aggregators use this layout directly.
- Add the implementation under
munl/unlearning/. - Register its configuration in
munl/configurations.py. - Add its fixed evaluation overrides and label to
reproduce/paper_config.yaml. - Regenerate manifests with
python reproduce/generate_commands.py. - Train checkpoints, extract predictions, and run black-box and white-box evaluation.
- Use
--checkpoint-dirand--loader-methodfor checkpoint-only white-box benchmarking before adding a full registration.
The included reconstruction workflow separates four stages:
unlearning update
β optional subspace filtering
β optional WARP/adaptive COB transformation
β GIFD reconstruction and metric aggregation
New update-generation rules can be integrated in
vendor/censor/run_rec.py and vendor/censor/run_rec_adaptive.py while
retaining the included reconstruction and output interfaces. Add a fixed YAML
template under vendor/censor/, expose it through
reproduce/reconstruction/generate_config.py, and aggregate its per-layer CSV
results with reproduce/reconstruction/aggregate.py.
- use identical split and forget indices across methods;
- keep the original model checkpoint fixed;
- preserve the paper attack parameters unless reporting a sensitivity study;
- record the generated configuration and code commit;
- report utility together with privacy metrics;
- report mean, standard deviation, sample count, and low-FPR operating points;
- use smoke mode for integration checks and full mode for benchmark results.
bash reproduce/run_commands.sh reproduce/generated/05_runtime.txt 1
python reproduce/plot_runtime.pybash reproduce/run_commands.sh reproduce/generated/06_fastwarp_unlearning.txt 1
bash reproduce/run_commands.sh reproduce/generated/07_fastwarp_predictions.txt 1
bash reproduce/run_commands.sh reproduce/generated/08_fastwarp_evaluation.txt 1python reproduce/generate_sensitivity_commands.py
bash reproduce/run_commands.sh reproduce/generated/sensitivity/01_unlearning.txt 1
bash reproduce/run_commands.sh reproduce/generated/sensitivity/02_predictions.txt 1
bash reproduce/run_commands.sh reproduce/generated/sensitivity/03_evaluation.txt 1
python reproduce/plot_sensitivity.py- GLiR white-box attack implementation:
munl/glir/; - reconstruction and GIFD implementation:
vendor/censor/; - adaptive reconstruction implementation:
vendor/censor/adaptive_attack/; - neural-network teleportation runtime:
neuralteleportation/; - RepDistiller components used by SCRUB:
thirdparty/repdistiller/.
- PyTorch and torchvision;
- NumPy and SciPy;
- scikit-learn;
- Hydra and Hydra-Zen;
- matplotlib;
- tqdm;
- PyYAML;
- tensorboard;
- networkx.
The exact main environment is defined in
environment/requirements.txt.
- PyTorch 1.12 reconstruction environment;
- LPIPS;
- pandas;
- scikit-image;
- nevergrad;
- safetensors;
- Pillow;
- boto3 and requests for pretrained BigGAN caching.
The exact reconstruction environment is defined in
vendor/censor/env.yml.
Source code is included, while large datasets and pretrained weights remain external:
- CIFAR-10 is downloaded automatically by torchvision;
- ImageNet-1K must be supplied by path;
- the ResNet-18 COB reconstruction checkpoint must be supplied by path;
- BigGAN and LPIPS weights are downloaded and cached on first use.
No external source repository is required for the documented CIFAR-10 white-box or ImageNet/BigGAN reconstruction pipelines.
munl/
glir/ white-box attack implementation
lira/ black-box attack and evaluation
models/ ResNet-18 COB
unlearning/ unlearning methods and WARP variants
pipeline/
lira/ shadow splits, training, and unlearning
runtime.py shared data/model runtime
reproduce/
paper_config.yaml fixed experiment configurations
prepare.sh data and manifest preparation
generate_commands.py full paper command generation
aggregate_whitebox.py white-box aggregation and ROC plotting
reconstruction/ reconstruction config and aggregation
run_privacy_smoke.sh end-to-end privacy-stack smoke suite
run_reconstruction.sh standalone reconstruction runner
validate_release.py source completeness and portability checks
neuralteleportation/ vendored WARP runtime
vendor/censor/ vendored GIFD and reconstruction source
thirdparty/repdistiller/ SCRUB support
docs/assets/ repository logo and banner
Run the repository checks:
python reproduce/validate_release.py
python -m compileall -q munl pipeline reproduce neuralteleportation
python -m pytest -qValidate command generation:
python reproduce/generate_commands.py
wc -l reproduce/generated/09_whitebox.txtThe white-box manifest contains 7,680 commands:
12 method configurations Γ 64 shadows Γ 10 forget sets
The repository builds on research implementations of GLiR, U-LiRA, GIFD,
CENSOR, neural teleportation, and the included machine-unlearning methods.
The CENSOR MIT license is retained in
vendor/censor/LICENSE.
If this repository or WARP is useful in your research, please cite:
@inproceedings{maheri2026warp,
title = {{WARP}: Weight Teleportation for Attack-Resilient Unlearning Protocols},
author = {Maheri, Mohammad M. and Cadet, Xavier and Chin, Peter and Haddadi, Hamed},
booktitle = {The Fourteenth International Conference on Learning Representations},
year = {2026}
}