SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.23798 · 2026

MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for Large Language Models

Wei Yang, Pengjun Xie, Bryan Lim, Yurong Hao, Tiantong Wu, Xinyu Yan, Tiantong Wang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2602.23798.json · badge: /api/ran/2602.23798.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
Tristan0318/MPU canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
aggregate_to_1D Ran
ran, violated the contract we drafted
Tristan0318/MPU/src/evals/metrics/utils.py
code served (permissive licence) · get_code("56262c8f8ba375b1")
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 numpy as np

def aggregate_to_1D(x):
    return np.mean(x, axis=tuple(range(1, x.ndim)))

# Create a multi-dimensional numpy array
# Shape: (batch_size=2, dim1=4, dim2=3, dim3=5)
# This tests aggregation over all axes except the first one
x = np.random.randn(2, 4, 3, 5)

ARGS = {
    'x': x
}
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 (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
compute_kl_divergence Ran
ran; our contract draft was wrong, not the code
Tristan0318/MPU/src/trainer/utils.py
code served (permissive licence) · get_code("0ad1a4c40d0feee4")
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 torch
from torch import nn
import torch.nn.functional as F

torch.manual_seed(0)

class MockModel(nn.Module):
    def __init__(self, vocab_size=4, hidden_dim=3):
        super().__init__()
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, input_ids=None, **kwargs):
        # Create a mock output with logits
        batch_size = input_ids.shape[0] if input_ids is not None else 2
        logits = self.linear(torch.randn(batch_size, 3))
        
        # Return object with logits attribute
        class Output:
            pass
        output = Output()
        output.logits = logits
        return output

class MockInputs:
    def __init__(self):
        self.data = {"input_ids": torch.randint(0, 4, (2, 3))}
    
    def __iter__(self):
        return iter(self.data.items())
    
    def keys(self):
        return self.data.keys()
    
    def values(self):
        return self.data.values()
    
    def items(self):
        return self.data.items()

# Create model and target model
model = MockModel(vocab_size=4, hidden_dim=3)
target_model = MockModel(vocab_size=4, hidden_dim=3)

# Create inputs dict
inputs = {"input_ids": torch.randint(0, 4, (2, 3))}

ARGS = {
    "model": model,
    "target_model": target_model,
    "inputs": inputs
}
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 — 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
compute_layerwise_sigma Ran
ran; our contract draft was wrong, not the code
Tristan0318/MPU/src/trainer/pum_utils.py
code served (permissive licence) · get_code("e68774b6769ba8b2")
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
from collections import OrderedDict

torch.manual_seed(0)

# Create small reference state dict with tensors
sd_ref = OrderedDict([
    ('layer1.weight', torch.randn(4, 3)),
    ('layer1.bias', torch.randn(4)),
    ('layer2.weight', torch.randn(5, 4)),
    ('layer2.bias', torch.randn(5)),
])

# Create base state dict (slightly different values)
base_sd = OrderedDict([
    ('layer1.weight', torch.randn(4, 3)),
    ('layer1.bias', torch.randn(4)),
    ('layer2.weight', torch.randn(5, 4)),
    ('layer2.bias', torch.randn(5)),
])

# Define layer groups mapping layer names to parameter names
layer_groups = {
    'block_1': ['layer1.weight', 'layer1.bias'],
    'block_2': ['layer2.weight', 'layer2.bias'],
}

# Set kappa parameter
kappa = 0.5

ARGS = {
    'sd_ref': sd_ref,
    'layer_groups': layer_groups,
    'kappa': kappa,
    'base_sd': base_sd,
}
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
dict_transpose Ran
ran; our contract draft was wrong, not the code
Tristan0318/MPU/src/evals/metrics/utils.py
code served (permissive licence) · get_code("c49bbf7aa3eb7304")
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

torch.manual_seed(0)

# Construct a nested dictionary structure that dict_transpose expects
# Structure: {item_index: {data_index: {stat_name: value}}}

evals = {
    "item_0": {
        "idx_1": {
            "accuracy": 0.95,
            "loss": 0.05,
            "f1": 0.92
        },
        "idx_2": {
            "accuracy": 0.87,
            "loss": 0.13,
            "f1": 0.84
        }
    },
    "item_1": {
        "idx_1": {
            "accuracy": 0.91,
            "loss": 0.09,
            "f1": 0.88
        },
        "idx_2": {
            "accuracy": 0.93,
            "loss": 0.07,
            "f1": 0.90
        }
    },
    "item_2": {
        "idx_1": {
            "accuracy": 0.89,
            "loss": 0.11,
            "f1": 0.86
        },
        "idx_2": {
            "accuracy": 0.94,
            "loss": 0.06,
            "f1": 0.91
        }
    }
}

ARGS = {
    "evals": evals
}
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
generate_zero_sum_noises Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Tristan0318/MPU/src/trainer/pum_utils.py
code served (permissive licence) · get_code("a1bc6530924e31ff")
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 torch
from collections import OrderedDict
import math

torch.manual_seed(0)

# Create a minimal sd_ref (state dict reference) with a few tensor parameters
sd_ref = OrderedDict([
    ('layer1.weight', torch.randn(4, 3, dtype=torch.float32)),
    ('layer1.bias', torch.randn(4, dtype=torch.float32)),
    ('layer2.weight', torch.randn(5, 4, dtype=torch.float32)),
])

# Create layer_groups mapping layer keys to parameter names
layer_groups = {
    'group_a': ['layer1.weight', 'layer1.bias'],
    'group_b': ['layer2.weight'],
}

# Create sigmas dict with noise levels per layer group
sigmas = {
    'group_a': 0.1,
    'group_b': 0.05,
}

# Number of noise samples to generate
m = 3

# Alpha coefficients (one per sample)
alphas = [1.0, 0.5, 0.25]

# Seed for reproducibility
seed_round = 42

# Target device (CPU only)
device = torch.device('cpu')

ARGS = {
    'sd_ref': sd_ref,
    'layer_groups': layer_groups,
    'sigmas': sigmas,
    'm': m,
    'alphas': alphas,
    'seed_round': seed_round,
    '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 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_forget_quality Ran
ran; our contract draft was wrong, not the code
Tristan0318/MPU/src/evals/metrics/utils.py
code served (permissive licence) · get_code("52f38c1b3ab76533")
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 numpy as np
import scipy as sc

torch.manual_seed(0)

# The function takes two parameters: model_tr and reference_tr
# Looking at the function body, it performs:
# - 1 / (model_tr + 1e-10)
# - 1 / (reference_tr + 1e-10)
# - sc.stats.ks_2samp() on these transformed values
# 
# ks_2samp expects array-like inputs (1D samples)
# So model_tr and reference_tr should be array-like (numpy arrays or lists)

# Create small numpy arrays as samples for the KS test
model_tr = np.array([0.1, 0.2, 0.3, 0.15, 0.25], dtype=np.float32)
reference_tr = np.array([0.12, 0.18, 0.32, 0.14, 0.28], dtype=np.float32)

ARGS = {
    'model_tr': model_tr,
    'reference_tr': reference_tr
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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
prepare_ref_model Ran
ran; our contract draft was wrong, not the code
Tristan0318/MPU/src/trainer/utils.py
code served (permissive licence) · get_code("8803db906725614f")
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 MinimalModel. 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
import copy

torch.manual_seed(0)

# Create a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.config = MinimalConfig()
    
    def forward(self, x):
        return self.linear(x)

class MinimalConfig:
    def __init__(self):
        self.use_cache = True

# Construct the model
model = MinimalModel()

# Define ARGS with all parameters
ARGS = {
    'model': model,
    'device': None,
    'freeze': True,
    'eval_mode': True,
    'disable_cache': True
}
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 MinimalModel — a MinimalModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalModel 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
compute_batch_nll Not yet run
unverified (harvested, no recorded run)
Tristan0318/MPU/src/trainer/utils.py
code served (permissive licence) · get_code("41a0d0b1a9f9c0a1")
How it ran

no invocation recorded.

construct_seed64 Not yet run
unverified (harvested, no recorded run)
Tristan0318/MPU/src/trainer/pum_utils.py
code served (permissive licence) · get_code("02a60760af058ab7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 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
aggregate_to_1D 2 other papers
2 dated earlier
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
compute_kl_divergence 2 other papers
2 dated earlier
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
dict_transpose 2 other papers
2 dated earlier
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
get_forget_quality 2 other papers
2 dated earlier
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM 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

Machine unlearning for large language models often faces a privacy dilemma in which strict constraints prohibit sharing either the server's parameters or the client's forget set. To address this dual non-disclosure constraint, we propose MPU, an algorithm-agnostic privacy-preserving Multiple Perturbed Copies Unlearning framework that primarily introduces two server-side modules: Pre-Process for randomized copy generation and Post-Process for update aggregation. In Pre-Process, the server distributes multiple perturbed and reparameterized model instances, allowing the client to execute unlearning locally on its private forget set without accessing the server's exact original parameters. After local unlearning, the server performs Post-Process by inverting the reparameterization and aggregating updates with a harmonic denoising procedure to alleviate the impact of perturbation. Experiments with seven unlearning algorithms show that MPU achieves comparable unlearning performance to noise-free baselines, with most algorithms' average degradation well below 1% up to 10% noise, and can even outperform the noise-free baseline for some algorithms under 1% noise. Code is available at https://github.com/Tristan0318/MPU.

For agents

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

get_harvested_code_for_paper("2602.23798")
get_code_for_paper("2602.23798")
have("2602.23798")

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

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

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

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

Connect an agent — have() is free.