SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.03190 · 2026

Maximizing Local Entropy Where It Matters: Prefix-Aware Localized LLM Unlearning

Fei Shen, Xun Yang, Long Bai, Pengyang Shao, Yonghui Yang, Binbin Zheng, Naixin Zhai

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 5 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2601.03190.json · badge: /api/ran/2601.03190.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
nxZhai/PALU canonical (classifier label)
classifier basis: plan_row
6 ran · 0 no recorded run
FunctionStatusWhere it lives
aggregate_to_1D Ran
ran, violated the contract we drafted
nxZhai/PALU/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
nxZhai/PALU/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
nxZhai/PALU/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
nxZhai/PALU/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
nxZhai/PALU/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
nxZhai/PALU/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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 6 later) and 0 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
1 dated earlier, 1 later
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2602.23798 (2026-02)
MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for Large Language Models
compute_batch_nll 2 other papers
1 dated earlier, 1 later
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2603.09980 (2026-03)
Explainable LLM Unlearning Through Reasoning
compute_dpo_loss 2 other papers
1 dated earlier, 1 later
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2603.09980 (2026-03)
Explainable LLM Unlearning Through Reasoning
compute_kl_divergence 2 other papers
1 dated earlier, 1 later
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2602.23798 (2026-02)
MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for Large Language Models
dict_transpose 2 other papers
1 dated earlier, 1 later
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2602.23798 (2026-02)
MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for Large Language Models
get_forget_quality 2 other papers
1 dated earlier, 1 later
2506.12618 (2025-06)
OpenUnlearning: Accelerating LLM Unlearning via Unified Benchmarking of Methods and Metrics
2602.23798 (2026-02)
MPU: Towards Secure and Privacy-Preserving Knowledge Unlearning for 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-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

Machine unlearning aims to forget sensitive knowledge from Large Language Models (LLMs) while maintaining general utility. However, existing approaches typically treat all tokens in a response indiscriminately and enforce uncertainty over the entire vocabulary. This global treatment results in unnecessary utility degradation and extends optimization to content-agnostic regions. To address these limitations, we propose PALU (Prefix-Aware Localized Unlearning), a framework driven by a local entropy maximization objective across both temporal and vocabulary dimensions. PALU reveals that (i) suppressing the sensitive prefix alone is sufficient to sever the causal generation link, and (ii) flattening only the top-K logits is adequate to maximize uncertainty in the critical subspace. These findings allow PALU to alleviate redundant optimization across the full vocabulary and parameter space while minimizing collateral damage to general model performance. Comprehensive evaluations validate that PALU achieves superior forgetting efficacy and utility preservation compared to state-of-the-art baselines. Our code is available at https: //github.com/nxZhai/PALU.

For agents

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

get_harvested_code_for_paper("2601.03190")
get_code_for_paper("2601.03190")
have("2601.03190")

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

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

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

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

Connect an agent — have() is free.