SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.00364 · 2026

Unlearning What Matters: Token-Level Attribution for Precise Language Model Unlearning

Jiawei Wu, Doudou Zhou, Mask Context

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 8 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
nlp-uoregon/trankit canonical 5 of 8
FunctionStatusWhere it lives
check_valid_format Ran nlp-uoregon/trankit/trankit/__main__.py
code served (permissive licence) · get_code("15a9d213297f0b3c")
is_list_list_strings Ran nlp-uoregon/trankit/trankit/pipeline.py
code served (permissive licence) · get_code("141493d110076a25")
is_list_strings Ran nlp-uoregon/trankit/trankit/pipeline.py
code served (permissive licence) · get_code("326b62f1bdce62eb")
is_string Ran nlp-uoregon/trankit/trankit/pipeline.py
code served (permissive licence) · get_code("8247f647d58efffd")
set_cuda Ran nlp-uoregon/trankit/trankit/layers/crf_layer.py
code served (permissive licence) · get_code("f21db161a6b12a80")
log_sum_exp Not yet run nlp-uoregon/trankit/trankit/layers/crf_layer.py
code served (permissive licence) · get_code("f9126d3e4828acad")
set_lemma Not yet run nlp-uoregon/trankit/trankit/models/lemma_model.py
code served (permissive licence) · get_code("17780eb8ac2bc5af")
viterbi_decode Not yet run nlp-uoregon/trankit/trankit/layers/crf_layer.py
code served (permissive licence) · get_code("d3b7b46564709bf3")

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 has emerged as a critical capability for addressing privacy, safety, and regulatory concerns in large language models (LLMs). Existing methods operate at the sequence level, applying uniform updates across all tokens despite only a subset encoding the knowledge targeted for removal. This introduces gradient noise, degrades utility, and leads to suboptimal forgetting. We propose TokenUnlearn, a token-level attribution framework that identifies and selectively targets critical tokens. Our approach combines knowledge-aware signals via masking, and entropy-aware signals to yield importance scores for precise token selection. We develop two complementary strategies: hard selection, applying unlearning only to high-importance tokens, and soft weighting, modulating gradient contributions based on importance scores. Both extend existing methods to token-level variants. Theoretical analysis shows token-level selection improves gradient signal-to-noise ratio. Experiments on TOFU and WMDP benchmarks across three model architectures demonstrate consistent improvements over sequence-level baselines in both forgetting effectiveness and utility preservation.

For agents

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

get_harvested_code_for_paper("2605.00364")
get_code_for_paper("2605.00364")
have("2605.00364")

Connect an agent — have() is free.