Papers › A Closer Look at Machine Unlearning for Large Language Models

A Closer Look at Machine Unlearning for Large Language Models

10 Oct 2024arXiv:2410.08109archive 2025-07-28

Xiaojian Yuan, Tianyu Pang, Chao Du, Kejiang Chen, Weiming Zhang, Min Lin

Large language models (LLMs) may memorize sensitive or copyrighted content, raising privacy and legal concerns. Due to the high cost of retraining from scratch, researchers attempt to employ machine unlearning to remove specific content from LLMs while preserving the overall performance. In this paper, we discuss several issues in machine unlearning for LLMs and provide our insights on possible approaches. To address the issue of inadequate evaluation of model outputs after unlearning, we introduce three additional metrics to evaluate token diversity, sentence semantics, and factual correctness. We then categorize unlearning methods into untargeted and targeted, and discuss their issues respectively. Specifically, the behavior that untargeted unlearning attempts to approximate is unpredictable and may involve hallucinations, and existing regularization is insufficient for targeted unlearning. To alleviate these issues, we propose using the objective of maximizing entropy (ME) for untargeted unlearning and incorporate answer preservation (AP) loss as regularization for targeted unlearning. Experimental results across three scenarios, i.e., fictitious unlearning, continual unlearning, and real-world unlearning, demonstrate the effectiveness of our approaches. The code is available at https://github.com/sail-sg/closer-look-LLM-unlearning.

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="2410.08109")

Code

Syntology Ran 12 of 17 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 4 ran · fixture could not drive it; 7 ran with no contract checked.

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

sail-sg/closer-look-llm-unlearning 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

17 samples harvested; 12 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
4ran · fixture could not drive it
7ran
5unverified

Licence: 17 of the 17 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 sail-sg/closer-look-LLM-unlearning. “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.

collate_fn sail-sg/closer-look-LLM-unlearning/dataset/data_module.py official repository ran no licence file found · pointer only · cdd171f20cd6f53d · report
compute_token_entropy sail-sg/closer-look-LLM-unlearning/metrics/metrics.py official repository ran no licence file found · pointer only · 3953f493940e88b8 · report
find_all_linear_names sail-sg/closer-look-LLM-unlearning/forget.py official repository ran · our draft was wrong no licence file found · pointer only · 649fc48067a48529 · report
ga_loss sail-sg/closer-look-llm-unlearning/trainer/losses.py official repository ran · fixture could not drive it no licence file found · pointer only · c2d4937262b0ac28 · report
general_eval sail-sg/closer-look-LLM-unlearning/real_world_eval.py official repository ran no licence file found · pointer only · a2f425992cbade01 · report
get_me_loss sail-sg/closer-look-llm-unlearning/trainer/losses.py official repository ran · fixture could not drive it fingerprinted no licence file found · pointer only · 01f406043cd388be · report
get_total_len sail-sg/closer-look-LLM-unlearning/utils/utils.py official repository ran fingerprinted no licence file found · pointer only · 6c542acea5aa211c · report
me_loss sail-sg/closer-look-llm-unlearning/trainer/losses.py official repository ran · fixture could not drive it no licence file found · pointer only · 340f1a6783f01f95 · report
merge_dicts sail-sg/closer-look-LLM-unlearning/utils/utils.py official repository ran no licence file found · pointer only · 8076aab5782c4d02 · report
npo_loss sail-sg/closer-look-llm-unlearning/trainer/losses.py official repository ran · fixture could not drive it no licence file found · pointer only · a3b77597ef1aa5c9 · report
summary_results sail-sg/closer-look-LLM-unlearning/real_world_eval.py official repository ran no licence file found · pointer only · 10c5cb88157f0830 · report
token_entropy sail-sg/closer-look-LLM-unlearning/metrics/metrics.py official repository ran no licence file found · pointer only · 9b8e27aa12ba922b · report
convert_raw_data_to_model_format sail-sg/closer-look-LLM-unlearning/dataset/data_module.py official repository unverified no licence file found · pointer only · 7dec325d088c0b76 · report
convert_raw_forget_data_to_model_format sail-sg/closer-look-LLM-unlearning/dataset/data_module.py official repository unverified no licence file found · pointer only · 28aa527377c5b4e8 · report
ga_loss sail-sg/closer-look-LLM-unlearning/trainer/losses.py official repository unverified no licence file found · pointer only · 3c6bd6e091c76ca3 · report
get_loss sail-sg/closer-look-llm-unlearning/trainer/losses.py official repository unverified no licence file found · pointer only · 0605aa76e6497ba3 · report
get_model_identifiers_from_yaml sail-sg/closer-look-LLM-unlearning/utils/utils.py official repository unverified no licence file found · pointer only · 06448b0513272463 · report

Tasks

DiversityMachine UnlearningSentence

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