Papers › DEPN: Detecting and Editing Privacy Neurons in Pretrained Language Models

DEPN: Detecting and Editing Privacy Neurons in Pretrained Language Models

31 Oct 2023arXiv:2310.20138archive 2025-07-28

Xinwei Wu, Junzhuo Li, Minghui Xu, Weilong Dong, Shuangzhi Wu, Chao Bian, Deyi Xiong

Large language models pretrained on a huge amount of data capture rich knowledge and information in the training data. The ability of data memorization and regurgitation in pretrained language models, revealed in previous studies, brings the risk of data leakage. In order to effectively reduce these risks, we propose a framework DEPN to Detect and Edit Privacy Neurons in pretrained language models, partially inspired by knowledge neurons and model editing. In DEPN, we introduce a novel method, termed as privacy neuron detector, to locate neurons associated with private information, and then edit these detected privacy neurons by setting their activations to zero. Furthermore, we propose a privacy neuron aggregator dememorize private information in a batch processing manner. Experimental results show that our method can significantly and efficiently reduce the exposure of private data leakage without deteriorating the performance of the model. Additionally, we empirically demonstrate the relationship between model memorization and privacy neurons, from multiple perspectives, including model size, training time, prompts, privacy neuron distribution, illustrating the robustness of our approach.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2310.20138")

Code

Syntology Ran 8 of 9 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 3 ran · honoured contract; 2 ran · our draft was wrong; 3 ran with no contract checked.

By repository: official repository: 9 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

flamewei123/DEPN officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 8 ran; 3 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
2ran · our draft was wrong
3ran
1unverified

Licence: 9 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from flamewei123/DEPN. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

swish flamewei123/DEPN/src/custom_bert.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · 0f786c407fb1ee4c · report
convert_to_triplet_ig flamewei123/DEPN/src/1_calculate_attribution.py official repository ran · honoured contract no licence file found · pointer only · 7ca5f6affb7142af · report
eval_ppl flamewei123/DEPN/src/3_edit_privacy_neurons.py official repository ran no licence file found · pointer only · 359b3d77e480e6f8 · report
example2feature flamewei123/DEPN/src/1_calculate_attribution.py official repository ran no licence file found · pointer only · ec86d7c6151f7d68 · report
gelu flamewei123/DEPN/src/custom_bert.py official repository ran · honoured contract fingerprinted no licence file found · pointer only · 56a9ab06b860b180 · report
pos_list2str flamewei123/DEPN/src/2_filter_privacy_neurons.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · dbb7a4fa7b6bb8d1 · report
pos_str2list flamewei123/DEPN/src/2_filter_privacy_neurons.py official repository ran · honoured contract no licence file found · pointer only · dae759b7f6c3b29d · report
scaled_input flamewei123/DEPN/src/1_calculate_attribution.py official repository ran no licence file found · pointer only · 9c42e668d2a4a9d7 · report
load_evaldata flamewei123/DEPN/src/3_edit_privacy_neurons.py official repository unverified no licence file found · pointer only · ee8a0be5a85129de · report

Tasks

MemorizationModel Editing

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections