SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.16997 · EMNLP · 2024

Revisiting Who's Harry Potter: Towards Targeted Unlearning from a Causal Intervention Perspective

Nicholas Carlini, Tommi Jaakkola, Zhangyang Wang, Shiyu Chang, Yang Zhang, Andy Zou, Kai Wang, Zifan Wang, Charles Yu, Yujian Liu, Milad Nasr, J Kolter, and 6 more

arXiv · PDF · Open in the Atlas

Code that ran

10 of 15 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; 9 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2407.16997.json · badge: /api/ran/2407.16997.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
ucsb-nlp-chang/causal_unlearn canonical (classifier label)
classifier basis: census
10 ran · 5 no recorded run
FunctionStatusWhere it lives
collate_fn Ran
ran, honoured the contract we drafted
ucsb-nlp-chang/causal_unlearn/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
ucsb-nlp-chang/causal_unlearn/dataloader.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
custom_data_collator Ran
ran; our contract draft was wrong, not the code
ucsb-nlp-chang/causal_unlearn/data_module.py
code served (permissive licence) · get_code("5985b70afc6ef2b0")
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

torch.manual_seed(0)

# The function expects samples, where each sample is a tuple of:
# (input_ids, labels, attention_mask)
# Each of these should be a tensor that can be stacked.

# Create sample data: 2 samples, each with tensors of different shapes
# to make them distinctly identifiable

sample_1 = (
    torch.randn(4),      # input_ids: shape (4,)
    torch.randn(3),      # labels: shape (3,)
    torch.randn(5)       # attention_mask: shape (5,)
)

sample_2 = (
    torch.randn(4),      # input_ids: shape (4,)
    torch.randn(3),      # labels: shape (3,)
    torch.randn(5)       # attention_mask: shape (5,)
)

samples = [sample_1, sample_2]

ARGS = {
    "samples": samples
}
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
custom_data_collator_distill Ran
ran; our contract draft was wrong, not the code
ucsb-nlp-chang/causal_unlearn/dataloader.py
code served (permissive licence) · get_code("6b65bb326e3d251b")
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

torch.manual_seed(0)

# The function expects samples where each sample is a tuple of (forget_sample, retain_sample)
# forget_sample is a tuple of (input_ids, attention_mask, probs, indices)
# retain_sample is a tuple of (input_ids, labels, attention_mask)

# Create forget samples
forget_sample_1 = (
    [torch.tensor([1, 2, 3, 4], dtype=torch.long), torch.tensor([5, 6], dtype=torch.long)],  # input_ids list
    [torch.tensor([1, 1, 1, 1], dtype=torch.long), torch.tensor([1, 1], dtype=torch.long)],  # attention_mask list
    [torch.tensor([0.5, 0.6, 0.7, 0.8], dtype=torch.float), torch.tensor([0.4, 0.5], dtype=torch.float)],  # probs list
    [torch.tensor([0, 1, 2, 3], dtype=torch.long), torch.tensor([1, 2], dtype=torch.long)]  # indices list
)

forget_sample_2 = (
    [torch.tensor([7, 8], dtype=torch.long), torch.tensor([9, 10, 11], dtype=torch.long)],
    [torch.tensor([1, 1], dtype=torch.long), torch.tensor([1, 1, 1], dtype=torch.long)],
    [torch.tensor([0.3, 0.4], dtype=torch.float), torch.tensor([0.6, 0.7, 0.8], dtype=torch.float)],
    [torch.tensor([0, 1], dtype=torch.long), torch.tensor([1, 2, 3], dtype=torch.long)]
)

# Create retain samples
retain_sample_1 = (
    torch.tensor([1, 2, 3, 4], dtype=torch.long),  # input_ids
    torch.tensor([0, 1, 0, 1], dtype=torch.long),  # labels
    torch.tensor([1, 1, 1, 1], dtype=torch.long)   # attention_mask
)

retain_sample_2 = (
    torch.tensor([5, 6, 7, 8], dtype=torch.long),
    torch.tensor([1, 0, 1, 0], dtype=torch.long),
    torch.tensor([1, 1, 1, 1], dtype=torch.long)
)

# Create the samples list expected by the collator
samples = [
    (forget_sample_1, retain_sample_1),
    (forget_sample_2, retain_sample_2)
]

ARGS = {
    "samples": samples
}
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
custom_data_collator_forget Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ucsb-nlp-chang/causal_unlearn/dataloader.py
code served (permissive licence) · get_code("e951dedc21c69ac1")
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 4, 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

torch.manual_seed(0)

# Construct samples for the data collator
# Each sample is a tuple of (forget_data, retain_data)
# Where each of those is a tuple of (input_ids, labels, attention_mask)

# Create small tensors for forget and retain samples
batch_size = 2
seq_length = 4
vocab_size = 3

forget_sample_1 = (
    torch.randint(0, vocab_size, (seq_length,)),  # input_ids
    torch.randint(0, vocab_size, (seq_length,)),  # labels
    torch.ones(seq_length, dtype=torch.long)      # attention_mask
)

forget_sample_2 = (
    torch.randint(0, vocab_size, (seq_length,)),
    torch.randint(0, vocab_size, (seq_length,)),
    torch.ones(seq_length, dtype=torch.long)
)

retain_sample_1 = (
    torch.randint(0, vocab_size, (seq_length,)),
    torch.randint(0, vocab_size, (seq_length,)),
    torch.ones(seq_length, dtype=torch.long)
)

retain_sample_2 = (
    torch.randint(0, vocab_size, (seq_length,)),
    torch.randint(0, vocab_size, (seq_length,)),
    torch.ones(seq_length, dtype=torch.long)
)

# Package into samples where each sample is (forget_data, retain_data)
samples = [
    (forget_sample_1, retain_sample_1),
    (forget_sample_2, retain_sample_2)
]

ARGS = {
    "samples": samples
}
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 4, dtype family int — 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
find_all_linear_names Ran
ran; our contract draft was wrong, not the code
ucsb-nlp-chang/causal_unlearn/forget.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
find_non_ascii Ran
ran; our contract draft was wrong, not the code
ucsb-nlp-chang/causal_unlearn/teacher.py
code served (permissive licence) · get_code("90c6eae444f10e52")
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 re

def find_non_ascii(s):
    indices = []
    start = None
    for i, c in enumerate(s):
        if not c.isascii():
            if start is None:
                start = i
        elif start is not None and (not c.isspace()):
            indices.append((start, i))
            start = None
    if start is not None:
        indices.append((start, len(s)))
    non_ascii_spans = [s[i:j].strip() for i, j in indices if j - i > 3]
    spans = re.findall('\\[(.*)\\]', s)
    spans = [i.strip() for i in spans if not i.isascii() and len(i) > 3]
    spans += non_ascii_spans
    return sorted(spans, key=lambda x: len(x), reverse=True)

# Test string with non-ASCII characters and brackets
test_string = "Hello [世界こんにちは] world and more 日本語テキスト here [café français] test"

ARGS = {
    "s": test_string
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
ucsb-nlp-chang/causal_unlearn/aggregate_eval_tofu.py
code served (permissive licence) · get_code("a5f0ef3f2aac73a7")
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 numpy as np
from scipy.stats import ks_2samp

# Construct the data structures needed for get_forget_quality
# The function expects two result dicts, each containing a forget_file key
# that maps to a dict with 'avg_paraphrased_loss' and 'average_perturb_loss'

# Create sample forget result data
forget_result_template = {
    'avg_paraphrased_loss': {
        'sample_1': 0.5,
        'sample_2': 0.6,
        'sample_3': 0.7,
    },
    'average_perturb_loss': {
        'sample_1': np.array([0.2, 0.3]),
        'sample_2': np.array([0.25, 0.35]),
        'sample_3': np.array([0.3, 0.4]),
    }
}

unlearn_result = {
    'eval_log_forget.json': {
        'avg_paraphrased_loss': {
            'sample_1': 0.4,
            'sample_2': 0.5,
            'sample_3': 0.6,
        },
        'average_perturb_loss': {
            'sample_1': np.array([0.1, 0.2]),
            'sample_2': np.array([0.15, 0.25]),
            'sample_3': np.array([0.2, 0.3]),
        }
    }
}

retain_result = {
    'eval_log_forget.json': {
        'avg_paraphrased_loss': {
            'sample_1': 0.8,
            'sample_2': 0.9,
            'sample_3': 1.0,
        },
        'average_perturb_loss': {
            'sample_1': np.array([0.5, 0.6]),
            'sample_2': np.array([0.6, 0.7]),
            'sample_3': np.array([0.7, 0.8]),
        }
    }
}

ARGS = {
    'unlearn_result': unlearn_result,
    'retain_result': retain_result,
    'forget_file': 'eval_log_forget.json'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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_utility Ran
ran; our contract draft was wrong, not the code
ucsb-nlp-chang/causal_unlearn/utils.py
code served (permissive licence) · get_code("168afbee5cb6ccb1")
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 numpy as np

# Construct eval_result_dict matching the structure expected by get_model_utility
eval_result_dict = {
    'eval_real_author_wo_options.json': {
        'avg_gt_loss': {'sample_0': 0.5, 'sample_1': 0.6},
        'rougeL_recall': {'sample_0': 0.8, 'sample_1': 0.75},
        'avg_paraphrased_loss': {'sample_0': 0.7, 'sample_1': 0.65},
        'average_perturb_loss': {'sample_0': [0.9, 0.85], 'sample_1': [0.88, 0.82]},
    },
    'eval_real_world_wo_options.json': {
        'avg_gt_loss': {'sample_0': 0.55, 'sample_1': 0.58},
        'rougeL_recall': {'sample_0': 0.82, 'sample_1': 0.79},
        'avg_paraphrased_loss': {'sample_0': 0.72, 'sample_1': 0.68},
        'average_perturb_loss': {'sample_0': [0.92, 0.87], 'sample_1': [0.89, 0.84]},
    },
    'eval_log.json': {
        'avg_gt_loss': {'sample_0': 0.4, 'sample_1': 0.45},
        'rougeL_recall': {'sample_0': 0.85, 'sample_1': 0.83},
        'avg_paraphrased_loss': {'sample_0': 0.6, 'sample_1': 0.62},
        'average_perturb_loss': {'sample_0': [0.75, 0.72], 'sample_1': [0.76, 0.73]},
    },
    'eval_log_forget.json': {
        'avg_gt_loss': {'sample_0': 1.2, 'sample_1': 1.3},
        'rougeL_recall': {'sample_0': 0.4, 'sample_1': 0.35},
        'avg_paraphrased_loss': {'sample_0': 0.8, 'sample_1': 0.85},
        'average_perturb_loss': {'sample_0': [0.5, 0.48], 'sample_1': [0.52, 0.49]},
    },
}

ARGS = {
    'eval_result_dict': eval_result_dict,
    'dataset': 'tofu',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
gpt_wrapper Ran
ran; our contract draft was wrong, not the code
ucsb-nlp-chang/causal_unlearn/eval_gpt.py
code served (permissive licence) · get_code("22832373997b8adc")
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 numpy as np
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create mock for OpenAI client and response
mock_message = Mock()
mock_message.content = "The answer is: [[5]]"

mock_choice = Mock()
mock_choice.message = mock_message

mock_result = Mock()
mock_result.choices = [mock_choice]

# Arguments for gpt_wrapper function
ARGS = {
    'qa': 'What is the capital of France?',
    'sys_prompt': 'You are a helpful assistant that answers questions with a score format.',
    'max_tokens': 512
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, openai, torch — 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
call_llm_api Not yet run
unverified (harvested, no recorded run)
ucsb-nlp-chang/causal_unlearn/eval_gpt.py
code served (permissive licence) · get_code("3722e2d329173f4e")
How it ran

no invocation recorded.

get_model_identifiers_from_yaml Not yet run
unverified (harvested, no recorded run)
ucsb-nlp-chang/causal_unlearn/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from safolab-wisc/fiubench, is pointer only (licence: NONE) · get_code("06448b0513272463")
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 safolab-wisc/fiubench, 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.

get_model_utility Not yet run
unverified (harvested, no recorded run)
ucsb-nlp-chang/causal_unlearn/aggregate_eval_tofu.py
code served (permissive licence) · get_code("77592a20fdeaea25")
How it ran

no invocation recorded.

main Not yet run
unverified (harvested, no recorded run)
ucsb-nlp-chang/causal_unlearn/aggregate_eval_tofu.py
code served (permissive licence) · get_code("060156a110cfcc2e")
How it ran

no invocation recorded.

prepare_inputs Not yet run
unverified (harvested, no recorded run)
ucsb-nlp-chang/causal_unlearn/soft_embed_attack.py
code served (permissive licence) · get_code("bff95ada8f145722")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 2 the same month, 5 later) and 9 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
10 dated earlier, 1 the same month, 10 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
3 dated earlier, 6 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
get_model_identifiers_from_yaml 9 other papers
3 dated earlier, 1 the same month, 5 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
2 dated earlier, 4 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
2410.07163 (2024-10)
Simplicity Prevails: Rethinking Negative Preference Optimization for LLM Unlearning
and 3 more not named here
custom_data_collator 5 other papers
1 dated earlier, 4 later
2401.06121 (2024-01)
TOFU: A Task of Fictitious Unlearning for LLMs
2409.11844 (2024-09)
MEOW: MEMOry Supervised LLM Unlearning Via Inverted Facts
2410.15153 (2024-10)
Evaluating Deep Unlearning in Large Language Models
and 2 more not named here
custom_data_collator_forget 2 other papers
2 dated earlier
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

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

This paper investigates Who's Harry Potter (WHP), a pioneering yet insufficiently understood method for LLM unlearning. We explore it in two steps. First, we introduce a new task of LLM targeted unlearning, where given an unlearning target (e.g., a person) and some unlearning documents, we aim to unlearn only the information about the target, rather than everything in the unlearning documents. We further argue that a successful unlearning should satisfy criteria such as not outputting gibberish, not fabricating facts about the unlearning target, and not releasing factual information under jailbreak attacks. Second, we construct a causal intervention framework for targeted unlearning, where the knowledge of the unlearning target is modeled as a confounder between LLM input and output, and the unlearning process as a deconfounding process. This framework justifies and extends WHP, deriving a simple unlearning algorithm that includes WHP as a special case. Experiments on existing and new datasets show that our approach, without explicitly optimizing for the aforementioned criteria, achieves competitive performance in all of them. Our code is available at https://github.com/ UCSB-NLP-Chang/causal_unlearn.git. Q: Where was Wilhelm Wattenbach born? A: I don't have his personal information.

For agents

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

get_harvested_code_for_paper("2407.16997")
get_code_for_paper("2407.16997")
have("2407.16997")

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

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

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

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

Connect an agent — have() is free.