SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.07163 · NeurIPS · 2025

Simplicity Prevails: Rethinking Negative Preference Optimization for LLM Unlearning

Sijia Liu, Song Mei, Jinghan Jia, Jiancheng Liu, Licong Lin, Chongyu Fan, Ruiqi Zhang

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 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/2410.07163.json · badge: /api/ran/2410.07163.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
OPTML-Group/Unlearn-Simple canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
collate_fn Ran
ran, honoured the contract we drafted
OPTML-Group/Unlearn-Simple/TOFU/data_module.py
code served (permissive licence) · get_code("cdd171f20cd6f53d")
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 3, dtype family int; 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 torch.nn.utils.rnn import pad_sequence

torch.manual_seed(0)

# Create sample batch data
# Each item in batch is a tuple of (input_ids, attention_mask)
# input_ids and attention_masks should be 1D tensors of different lengths

batch = [
    (torch.tensor([1, 2, 3], dtype=torch.long), torch.tensor([1, 1, 1], dtype=torch.long)),
    (torch.tensor([4, 5], dtype=torch.long), torch.tensor([1, 1], dtype=torch.long)),
]

ARGS = {
    "batch": batch
}
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, ndim 3, dtype family int — 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
compute_metrics Ran
ran; our contract draft was wrong, not the code
OPTML-Group/Unlearn-Simple/WMDP/src/unlearn/base.py
code served (permissive licence) · get_code("88a4f13abd54a00c")
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

torch.manual_seed(0)

# Create a simple pred object with predictions and label_ids attributes
class PredObject:
    def __init__(self, predictions, label_ids):
        self.predictions = predictions
        self.label_ids = label_ids

# Create small tensors: batch_size=2, vocab_size=4, seq_length=3
batch_size = 2
vocab_size = 4
seq_length = 3

# predictions shape: (batch_size, seq_length, vocab_size) - logits
predictions = np.random.randn(batch_size, seq_length, vocab_size).astype(np.float32)

# label_ids shape: (batch_size, seq_length) - token indices
# Use values in range [0, vocab_size) or -100 for ignore_index
label_ids = np.array([
    [1, 2, 0],
    [3, 1, -100]
], dtype=np.int64)

# Create pred object
pred = PredObject(predictions, label_ids)

ARGS = {
    'pred': pred
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
cross_entropy_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
OPTML-Group/Unlearn-Simple/synthetic/unlearn_utils.py
code served (permissive licence) · get_code("04d9dfc17842cf17")
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.functional as F

torch.manual_seed(0)

# Create small tensors for cross_entropy_loss
batch_size = 2
state_size = 4
seq_length = 3

# logits: shape (batch_size * seq_length, state_size)
logits = torch.randn(batch_size * seq_length, state_size)

# labels: shape (batch_size * seq_length,) with some values as -100 (ignore_index)
labels = torch.randint(0, state_size, (batch_size * seq_length,))
labels[0] = -100  # Mark one label to be ignored

ARGS = {
    "logits": logits,
    "labels": labels,
    "state_size": state_size,
}
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
find_all_linear_names Ran
ran; our contract draft was wrong, not the code
OPTML-Group/Unlearn-Simple/TOFU/finetune.py
code served (permissive licence) · get_code("649fc48067a48529")
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, 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 torch.nn as nn

torch.manual_seed(0)

# Build a minimal model with Linear layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Sequential(
            nn.Linear(3, 2),
            nn.ReLU()
        )
        self.lm_head = nn.Linear(2, 5)
        self.other_linear = nn.Linear(5, 4)
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        x = self.lm_head(x)
        x = self.other_linear(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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, 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_activation Ran
ran; our contract draft was wrong, not the code
OPTML-Group/Unlearn-Simple/synthetic/model.py
code served (permissive licence) · get_code("75df7d35faaa9ff0")
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 function. 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.functional as F

torch.manual_seed(0)

ARGS = {
    'activation': 'relu'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_loss Ran
ran; our contract draft was wrong, not the code
OPTML-Group/Unlearn-Simple/WMDP/src/unlearn/base.py
code served (permissive licence) · get_code("650d5f6bfcd7d9bb")
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
from torch import nn

torch.manual_seed(0)

# The function expects:
# - output: a tensor that will be reshaped to (-1, vocab_size)
#   It accesses output[..., :-1, :] and output.size(-1)
#   So it needs shape (batch, seq_len, vocab_size)
# - labels: a tensor that will be reshaped to (-1,)
#   It accesses labels[..., 1:] 
#   So it needs shape (batch, seq_len)

batch_size = 2
seq_len = 5
vocab_size = 4

# output shape: (batch_size, seq_len, vocab_size) = (2, 5, 4)
output = torch.randn(batch_size, seq_len, vocab_size)

# labels shape: (batch_size, seq_len) = (2, 5)
# Values should be in range [0, vocab_size-1] or -100 (ignore_index)
labels = torch.randint(0, vocab_size, (batch_size, seq_len))

ARGS = {
    "output": output,
    "labels": labels,
}
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
grad_ascent_loss Ran
ran; our contract draft was wrong, not the code
OPTML-Group/Unlearn-Simple/synthetic/unlearn_utils.py
code served (permissive licence) · get_code("f8e37979490cc066")
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

torch.manual_seed(0)

# Define a simple model that takes input and produces logits
class SimpleModel(nn.Module):
    def __init__(self, input_dim, state_size):
        super().__init__()
        self.linear = nn.Linear(input_dim, state_size)
    
    def forward(self, x):
        return self.linear(x)

# Set up dimensions
batch_size = 2
input_dim = 4
state_size = 3

# Create model
model = SimpleModel(input_dim, state_size)

# Create input features X_f: (batch_size, input_dim)
X_f = torch.randn(batch_size, input_dim)

# Create labels y_f: (batch_size,) with values in range [0, state_size)
# Use -100 for some positions to test ignore_index
y_f = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    "model": model,
    "X_f": X_f,
    "y_f": y_f,
    "state_size": state_size
}
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
grad_descent_loss Ran
ran; our contract draft was wrong, not the code
OPTML-Group/Unlearn-Simple/synthetic/unlearn_utils.py
code served (permissive licence) · get_code("3359083515d97775")
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

torch.manual_seed(0)

# Define a minimal model that has a forward method
class SimpleModel(nn.Module):
    def __init__(self, input_size, state_size):
        super().__init__()
        self.linear = nn.Linear(input_size, state_size)
    
    def forward(self, x):
        return self.linear(x)

# Create model
input_size = 5
state_size = 3
model = SimpleModel(input_size, state_size)

# Create small tensors
batch_size = 2
X_r = torch.randn(batch_size, input_size)
y_r = torch.randint(0, state_size, (batch_size,))

# Set some labels to -100 to test ignore_index
y_r[0] = -100

ARGS = {
    "model": model,
    "X_r": X_r,
    "y_r": y_r,
    "state_size": state_size,
}
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
convert_raw_data_to_model_format Not yet run
unverified (harvested, no recorded run)
OPTML-Group/Unlearn-Simple/TOFU/data_module.py
pointer only (licence: MIT); the stored copy get_code serves, from wujwyi/CMC, is pointer only (licence: NONE) · get_code("7dec325d088c0b76")
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 wujwyi/CMC, 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.

unlearncollector Not yet run
unverified (harvested, no recorded run)
OPTML-Group/Unlearn-Simple/TOFU/data_module.py
code served (permissive licence) · get_code("52f769b837c6e32a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 7 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 6 later) and 3 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
find_all_linear_names 22 other papers
15 dated earlier, 2 the same month, 4 later, 1 same year, order not determinable
2308.09936 (2023-08)
BLIVA: A Simple Multimodal LLM for Better Handling of Text-Rich Visual Questions
2310.13023 (2023-10)
GraphGPT: Graph Instruction Tuning for Large Language Models
2311.13194 (2023-11)
Towards Improving Document Understanding: An Exploration on Text-Grounding via MLLMs
and 19 more not named here
collate_fn 9 other papers
4 dated earlier, 2 the same month, 3 later
2401.06121 (2024-01)
TOFU: A Task of Fictitious Unlearning for LLMs
2406.11614 (2024-06)
Intrinsic Test of Unlearning Using Parametric Knowledge Traces
2406.13356 (2024-06)
UNLEARNING OR OBFUSCATING? JOGGING THE MEM-ORY OF UNLEARNED LLMS VIA BENIGN RELEARNING CONTENT WARNING: THIS MANUSCRIPT CONTAINS EXAMPLES OF HARMFUL/HAZARDOUS TEXT
and 6 more not named here
compute_metrics 6 other papers
3 dated earlier, 3 later
2401.06121 (2024-01)
TOFU: A Task of Fictitious Unlearning for LLMs
2406.13356 (2024-06)
UNLEARNING OR OBFUSCATING? JOGGING THE MEM-ORY OF UNLEARNED LLMS VIA BENIGN RELEARNING CONTENT WARNING: THIS MANUSCRIPT CONTAINS EXAMPLES OF HARMFUL/HAZARDOUS TEXT
2407.16997 (2024-07)
Revisiting Who's Harry Potter: Towards Targeted Unlearning from a Causal Intervention Perspective
and 3 more not named here
convert_raw_data_to_model_format 5 other papers
2 dated earlier, 2 the same month, 1 later
2401.06121 (2024-01)
TOFU: A Task of Fictitious Unlearning for LLMs
2407.01920 (2024-07)
To Forget or Not? Towards Practical Knowledge Unlearning for Large Language Models
2410.08109 (2024-10)
A Closer Look at Machine Unlearning for Large Language Models
and 2 more not named here
get_loss 5 other papers
3 dated earlier, 2 later
2401.06121 (2024-01)
TOFU: A Task of Fictitious Unlearning for LLMs
2406.11614 (2024-06)
Intrinsic Test of Unlearning Using Parametric Knowledge Traces
2406.13356 (2024-06)
UNLEARNING OR OBFUSCATING? JOGGING THE MEM-ORY OF UNLEARNED LLMS VIA BENIGN RELEARNING CONTENT WARNING: THIS MANUSCRIPT CONTAINS EXAMPLES OF HARMFUL/HAZARDOUS TEXT
and 2 more not named here
get_activation 1 other paper
1 dated earlier
2310.08566 (2023-10)
Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretraining
unlearncollector 1 other paper
1 later
2025.findings-acl.949 (2025 (year only))
A General Framework to Enhance Fine-tuning-based 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-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

This work studies the problem of large language model (LLM) unlearning, aiming to remove unwanted data influences (e.g., copyrighted or harmful content) while preserving model utility. Despite the increasing demand for unlearning, a technically-grounded optimization framework is lacking. Gradient ascent (GA)type methods, though widely used, are suboptimal as they reverse the learning process without controlling optimization divergence (i.e., deviation from the pretrained state), leading to risks of model collapse. Negative preference optimization (NPO) has been proposed to address this issue and is considered one of the stateof-the-art LLM unlearning approaches. In this work, we revisit NPO and identify another critical issue: reference model bias. This bias arises from using the reference model (i.e., the model prior to unlearning) to assess unlearning success, which can lead to a misleading impression of the true data-wise unlearning effectiveness. Specifically, it could cause (a) uneven allocation of optimization power across forget data with varying difficulty levels and (b) ineffective gradient weight smoothing during the early stages of unlearning optimization. To overcome these challenges, we propose a simple yet effective unlearning optimization framework, called SimNPO, showing that 'simplicity' in removing the reliance on a reference model (through the lens of simple preference optimization) benefits unlearning. We provide deeper insights into SimNPO's advantages, including an analysis based on mixtures of Markov chains. Extensive experiments further validate its efficacy on benchmarks like TOFU, MUSE and WMDP. Codes are available at https://github.com/OPTML-Group/Unlearn-Simple. 1 Here, we use "divergence" as opposed to "convergence" in model training, aiming to reverse learning for unlearning. 39th Conference on Neural Information Processing Systems (NeurIPS 2025).

For agents

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

get_harvested_code_for_paper("2410.07163")
get_code_for_paper("2410.07163")
have("2410.07163")

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

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

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

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

Connect an agent — have() is free.