SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.12618 · 2025

OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics

arXiv · PDF · Open in the Atlas

Code that ran

8 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 1 has no contract verdict; 6 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2506.12618.json · badge: /api/ran/2506.12618.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
locuslab/open-unlearning canonical (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
aggregate_to_1D Ran
ran, violated the contract we drafted
locuslab/open-unlearning/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_batch_nll Ran
ran; our contract draft was wrong, not the code
locuslab/open-unlearning/src/trainer/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from junfeng1212/TRU-main, is pointer only (licence: NOASSERTION) · get_code("f5fa56fd1884242d")
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 junfeng1212/TRU-main, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

compute_dpo_loss Ran
ran; our contract draft was wrong, not the code
locuslab/open-unlearning/src/trainer/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from junfeng1212/TRU-main, is pointer only (licence: NOASSERTION) · get_code("ef1eb32faacefd3a")
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 junfeng1212/TRU-main, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

compute_kl_divergence Ran
ran; our contract draft was wrong, not the code
locuslab/open-unlearning/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
dict_transpose Ran
ran; our contract draft was wrong, not the code
locuslab/open-unlearning/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
get_forget_quality Ran
ran; our contract draft was wrong, not the code
locuslab/open-unlearning/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
get_model Ran
ran on a synthesized input
locuslab/open-unlearning/community/methods/AltPO/generate.py
code served (permissive licence) · get_code("a7b25126cbb0b30e")
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, 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
import os
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a minimal mock model that AutoModelForCausalLM.from_pretrained would return
mock_model = Mock()
mock_model.config = Mock()

# Create a minimal mock tokenizer that AutoTokenizer.from_pretrained would return
mock_tokenizer = Mock()
mock_tokenizer.pad_token = "pad"
mock_tokenizer.pad_token_id = 0
mock_tokenizer.unk_token = None
mock_tokenizer.unk_token_id = None
mock_tokenizer.eos_token = None
mock_tokenizer.eos_token_id = None

# Patch the transformers functions to return our mocks
import transformers
original_from_pretrained_model = transformers.AutoModelForCausalLM.from_pretrained
original_from_pretrained_tokenizer = transformers.AutoTokenizer.from_pretrained

transformers.AutoModelForCausalLM.from_pretrained = Mock(return_value=mock_model)
transformers.AutoTokenizer.from_pretrained = Mock(return_value=mock_tokenizer)

# Create the config dict that get_model expects
config = {
    'model_kwargs': {
        'pretrained_model_name_or_path': 'gpt2'
    }
}

ARGS = {
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
read_json Ran
ran; our contract draft was wrong, not the code
locuslab/open-unlearning/community/methods/AltPO/generate.py
pointer only (licence: MIT); the stored copy get_code serves, from molereddy/Alternate-Preference-Optimization, is pointer only (licence: NONE) · get_code("6e72fd5056dda43a")
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 molereddy/Alternate-Preference-Optimization, 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.

get_dataset Not yet run
unverified (harvested, no recorded run)
locuslab/open-unlearning/community/methods/AltPO/generate.py
pointer only (licence: MIT); the stored copy get_code serves, from molereddy/Alternate-Preference-Optimization, is pointer only (licence: NONE) · get_code("78733604aac3e99e")
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 molereddy/Alternate-Preference-Optimization, 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. 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, 8 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 6 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
aggregate_to_1D 2 other papers
2 later
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
2602.23798 (2026-02)
MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for Large Language Models
compute_batch_nll 2 other papers
2 later
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
2603.09980 (2026-03)
Explainable LLM Unlearning Through Reasoning
compute_dpo_loss 2 other papers
2 later
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
2603.09980 (2026-03)
Explainable LLM Unlearning Through Reasoning
compute_kl_divergence 2 other papers
2 later
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
2602.23798 (2026-02)
MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for Large Language Models
dict_transpose 2 other papers
2 later
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
2602.23798 (2026-02)
MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for Large Language Models
get_forget_quality 2 other papers
2 later
2601.03190 (2026-01)
Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning
2602.23798 (2026-02)
MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for Large Language Models
get_dataset 1 other paper
1 dated earlier
2409.13474 (2024-09)
Alternate Preference Optimization for Unlearning Factual Knowledge in Large Language Models
read_json 1 other paper
1 dated earlier
2409.13474 (2024-09)
Alternate Preference Optimization for Unlearning Factual Knowledge in Large Language Models

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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Robust unlearning is crucial for safely deploying large language models (LLMs) in environments where data privacy, model safety, and regulatory compliance must be ensured. Yet the task is inherently challenging, partly due to difficulties in reliably measuring whether unlearning has truly occurred. Moreover, fragmentation in current methodologies and inconsistent evaluation metrics hinder comparative analysis and reproducibility. To unify and accelerate research efforts, we introduce OpenUnlearning, a standardized and extensible framework designed explicitly for benchmarking both LLM unlearning methods and metrics. OpenUnlearning integrates 13 unlearning algorithms and 16 diverse evaluations across 3 leading benchmarks (TOFU, MUSE, and WMDP) and also enables analyses of forgetting behaviors across 450+ checkpoints we publicly release. Leveraging OpenUnlearning, we propose a novel meta-evaluation benchmark focused specifically on assessing the faithfulness and robustness of evaluation metrics themselves. We also benchmark diverse unlearning methods and provide a comparative analysis against an extensive evaluation suite. Overall, we establish a clear, community-driven pathway toward rigorous development in LLM unlearning research.

For agents

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

get_harvested_code_for_paper("2506.12618")
get_code_for_paper("2506.12618")
have("2506.12618")

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

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

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

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

Connect an agent — have() is free.