SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.17410 · 2023

Can Sensitive Information Be Deleted From LLMs? Objectives for Defending Against Extraction Attacks

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 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, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 5 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/2309.17410.json · badge: /api/ran/2309.17410.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
vaidehi99/infodeletionattacks canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
FunctionStatusWhere it lives
blocks_input_locator Ran
ran; our contract draft was wrong, not the code
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/logit_lens/hooks.py
code served (permissive licence) · get_code("92f6c49ecd85ec5b")
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 as nn

torch.manual_seed(0)

class SimpleBaseModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(100, 4)
        self.dropout = nn.Dropout(0.1)
        self.linear = nn.Linear(4, 8)
    
    def forward(self, x):
        x = self.embedding(x)
        x = self.dropout(x)
        x = self.linear(x)
        return x

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.base_model = SimpleBaseModel()
        self.head = nn.Linear(8, 2)
    
    def forward(self, x):
        x = self.base_model(x)
        x = self.head(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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
collect_logits Ran
ran; our contract draft was wrong, not the code
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/logit_lens/plotting.py
code served (permissive licence) · get_code("c2fd2fc3dcf6a037")
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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self._last_resid = None
        self._layer_logits = {
            'layer_0': np.random.randn(2, 4),
            'layer_1': np.random.randn(2, 4),
            'layer_2': np.random.randn(2, 4),
        }
    
    def forward(self, input_ids):
        # Simulate model forward pass
        return torch.randn(2, 4)

model = MockModel()
input_ids = torch.randint(0, 100, (2, 8))
layer_names = ['layer_0', 'layer_1']
decoder_layer_names = ['layer_2']

ARGS = {
    'model': model,
    'input_ids': input_ids,
    'layer_names': layer_names,
    'decoder_layer_names': decoder_layer_names,
}
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 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
final_layernorm_locator Ran
ran; our contract draft was wrong, not the code
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/logit_lens/hooks.py
code served (permissive licence) · get_code("545f704e0ca27e96")
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 as nn

torch.manual_seed(0)

# The function expects model to have a base_model attribute
# which is an nn.Module that has children() method
# It looks for LayerNorm instances among the children

class SimpleBaseModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.ln = nn.LayerNorm(3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.ln(x)
        x = self.linear2(x)
        return x

class ModelWithBaseModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.base_model = SimpleBaseModel()
    
    def forward(self, x):
        return self.base_model(x)

model = ModelWithBaseModel()

ARGS = {
    "model": model
}
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_child_module_by_names Ran
ran; our contract draft was wrong, not the code
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/util/module_utils.py
code served (permissive licence) · get_code("7aa7d15b17e07438")
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 ChildModule. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a nested module structure
class ChildModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.value = torch.randn(2, 4)
    
    def forward(self, x):
        return x

class MiddleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.child = ChildModule()
    
    def forward(self, x):
        return self.child(x)

class ParentModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.middle = MiddleModule()
        self.another_child = ChildModule()
    
    def forward(self, x):
        return self.middle(x)

# Instantiate the parent module
parent = ParentModule()

# Define arguments for the function
ARGS = {
    "module": parent,
    "names": ["middle", "child"]
}
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 ChildModule — a ChildModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ChildModule 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_value_at_preds Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/logit_lens/plotting.py
code served (permissive licence) · get_code("ce37c1e5ca45da4c")
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 2, dtype family float, shape (2, 4) 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

# Analyze the function:
# - values: indexed as values[:, j, preds[j]], so needs shape (batch, num_j, num_actions)
# - preds: indexed as preds[j], so needs shape (num_j,) with integer indices
# - returns: stacked result of shape (batch, num_j)

# Create small but distinct dimensions
batch_size = 2
num_j = 4
num_actions = 3

# values: shape (batch_size, num_j, num_actions)
values = np.random.randn(batch_size, num_j, num_actions).astype(np.float32)

# preds: shape (num_j,) with valid indices into num_actions dimension
preds = np.array([0, 2, 1, 0], dtype=np.int64)

ARGS = {
    "values": values,
    "preds": preds,
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
huggingface_model_local_paths Ran
ran; our contract draft was wrong, not the code
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/util/tfm_utils.py
code served (permissive licence) · get_code("5320ade14843dae2")
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 json
import tempfile
import os
from unittest.mock import patch, MagicMock

# Create a temporary directory and config file for testing
temp_dir = tempfile.mkdtemp()
config_path = os.path.join(temp_dir, "config.json")

# Create a minimal config.json file without model_type
config_data = {
    "hidden_size": 768,
    "num_hidden_layers": 12,
    "num_attention_heads": 12,
    "intermediate_size": 3072,
}

with open(config_path, 'w', encoding='utf-8') as f:
    json.dump(config_data, f)

# Mock the transformers.file_utils functions to avoid network calls
def mock_hf_bucket_url(key, filename):
    return f"https://huggingface.co/{key}/resolve/main/{filename}"

def mock_cached_path(archive_file):
    # Return the local config_path for config.json requests
    if "config.json" in archive_file:
        return config_path
    # Return a dummy path for pytorch_model.bin
    model_path = os.path.join(temp_dir, "pytorch_model.bin")
    with open(model_path, 'w') as f:
        f.write("dummy model")
    return model_path

ARGS = {
    "model_name": "bert-base-uncased"
}

# Apply mocks for the function to work without network access
import transformers.file_utils
transformers.file_utils.hf_bucket_url = mock_hf_bucket_url
transformers.file_utils.cached_path = mock_cached_path
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
make_decoder Ran
ran; our contract draft was wrong, not the code
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/logit_lens/hooks.py
code served (permissive licence) · get_code("ab1cdc57445d3f76")
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 as nn

torch.manual_seed(0)

def get_child_module_by_names(model, names):
    """Helper function to traverse nested modules by name list"""
    current = model
    for name in names:
        current = getattr(current, name)
    return current

# Build a minimal model that satisfies the function's requirements
class MinimalBlock(nn.Module):
    def __init__(self):
        super().__init__()
        self.ln_1 = nn.LayerNorm(4)
        self.attn = nn.Linear(4, 4)
        self.ln_2 = nn.LayerNorm(4)
        self.mlp = nn.Linear(4, 4)
    
    def forward(self, x):
        return x

class MinimalBaseModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(10, 4)
        self.dropout = nn.Dropout(0.1)
        self.block_0 = MinimalBlock()
        self.ln_f = nn.LayerNorm(4)
    
    def forward(self, x):
        x = self.embedding(x)
        x = self.dropout(x)
        x = self.block_0(x)
        x = self.ln_f(x)
        return x

class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.base_model = MinimalBaseModel()
        self.lm_head = nn.Linear(4, 10)
    
    def forward(self, x):
        x = self.base_model(x)
        x = self.lm_head(x)
        return x

model = MinimalModel()

ARGS = {
    'model': model,
    'decoder_layer_names': ['final_layernorm', 'lm_head']
}
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
normalize_inconsistent_state_dict_keys Ran
ran; our contract draft was wrong, not the code
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/util/tfm_utils.py
code served (permissive licence) · get_code("78e83f431d38e8bb")
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 torch.nn as nn

torch.manual_seed(0)

# Construct a state_dict with mixed key formats
# Some keys with 'transformer.' prefix, some without
state_dict = {
    'transformer.layer1.weight': torch.randn(4, 3),
    'transformer.layer1.bias': torch.randn(4),
    'layer2.weight': torch.randn(5, 4),
    'layer2.bias': torch.randn(5),
    'attention.query': torch.randn(8, 6),
    'transformer.attention.key': torch.randn(8, 6),
}

ARGS = {
    'state_dict': state_dict
}
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
postprocess_logits Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/logit_lens/plotting.py
code served (permissive licence) · get_code("b639e905c59033d4")
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 numpy as np
import scipy.special
import torch

torch.manual_seed(0)

# The function expects layer_logits with shape (batch, layers, num_classes)
# It performs argmax, argsort, and softmax operations on axis=-1
# We'll create a small tensor with distinct dimensions for clarity:
# batch=2, num_layers=3, num_classes=4

layer_logits = np.random.randn(2, 3, 4).astype(np.float32)

ARGS = {
    "layer_logits": layer_logits,
}
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 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
get_leaf_modules Not yet run
unverified (harvested, no recorded run)
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/util/module_utils.py
code served (permissive licence) · get_code("390ee5748e50d330")
How it ran

no invocation recorded.

get_local_path_from_huggingface_cdn Not yet run
unverified (harvested, no recorded run)
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/util/tfm_utils.py
code served (permissive licence) · get_code("e759667d86453174")
How it ran

no invocation recorded.

low_memory_from_pretrained Not yet run
unverified (harvested, no recorded run)
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/low_memory/enable.py
code served (permissive licence) · get_code("a444132567003b3e")
How it ran

no invocation recorded.

low_memory_load Not yet run
unverified (harvested, no recorded run)
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/low_memory/load.py
code served (permissive licence) · get_code("ad9a1b60539e7185")
How it ran

no invocation recorded.

make_layer_names Not yet run
unverified (harvested, no recorded run)
vaidehi99/infodeletionattacks/transformer_utils/src/transformer_utils/logit_lens/layer_names.py
code served (permissive licence) · get_code("03f5b2a1c286c0a7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 14 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.

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

Pretrained language models sometimes possess knowledge that we do not wish them to, including memorized personal information and knowledge that could be used to harm people. They can also output toxic or harmful text. To mitigate these safety and informational issues, we propose an attack-and-defense framework for studying the task of deleting sensitive information directly from model weights. We study direct edits to model weights because (1) this approach should guarantee that particular deleted information is never extracted by future prompt attacks, and (2) it should protect against whitebox attacks, which is necessary for making claims about safety/privacy in a setting where publicly available model weights could be used to elicit sensitive information. Our threat model assumes that an attack succeeds if the answer to a sensitive question is located among a set of B generated candidates, based on scenarios where the information would be insecure if the answer is among B candidates. Experimentally, we show that even state-of-the-art model editing methods such as ROME struggle to truly delete factual information from models like GPT-J, as our whitebox and blackbox attacks can recover "deleted" information from an edited model 38% of the time. These attacks leverage two key observations: (1) that traces of deleted information can be found in intermediate model hidden states, and (2) that applying an editing method for one question may not delete information across rephrased versions of the question. Finally, we provide new defense methods that protect against some extraction attacks, but we do not find a single universally effective defense method. Our results suggest that truly deleting sensitive information is a tractable but difficult problem, since even relatively low attack success rates have potentially severe societal implications for real-world deployment of language models.

For agents

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

get_harvested_code_for_paper("2309.17410")
get_code_for_paper("2309.17410")
have("2309.17410")

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

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

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

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

Connect an agent — have() is free.