Papers › Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicity

Model Editing as a Robust and Denoised variant of DPO: A Case Study on Toxicity

22 May 2024arXiv:2405.13967archive 2025-07-28

Rheeya Uppaal, Apratim Dey, Yiting He, Yiqiao Zhong, Junjie Hu

Recent alignment algorithms such as direct preference optimization (DPO) have been developed to improve the safety of large language models (LLMs) by training these models to match human behaviors exemplified by preference data. However, these methods are both computationally intensive and lacking in controllability and transparency, inhibiting their widespread use. Furthermore, these tuning-based methods require large-scale preference data for training and are susceptible to noisy preference data. In this paper, we introduce a tuning-free alignment alternative, ProFS (Projection Filter for Subspaces), and demonstrate its effectiveness under the use case of toxicity reduction. Grounded on theory from factor analysis, ProFS is a sample-efficient model editing approach that identifies a toxic subspace in the model parameter space and reduces model toxicity by projecting away the detected subspace. The toxic subspace is identified by extracting preference data embeddings from the language model, and removing non-toxic information from these embeddings. We show that ProFS is more sample-efficient than DPO, further showcasing greater robustness to noisy data. Finally, we attempt to connect tuning based alignment with editing, by establishing both theoretical and empirical connections between ProFS and DPO, showing that ProFS can be interpreted as a denoised version of a single DPO step.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

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

Code

Syntology Ran 7 of 12 code samples harvested from 2 repositories linked to this paper; 5 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 6 ran with no contract checked.

By repository: official repository: 11 samples from 1 repository, 7 ran; community (archive-listed): 1 sample from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

uppaal/detox-edit officialmentioned in papermentioned on GitHubpytorchMIT report
ziwei-zheng/nullu mentioned on GitHubpytorchMIT 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

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

1ran · our draft was wrong
6ran
5unverified

Licence: 0 of the 12 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 2 repositories linked to this paper, official or community; each sample names its own and says which. “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.

get_continuation uppaal/detox-edit/evaluation/win_rate.py official repository ran · our draft was wrong MIT (permissive) · fd8cb94482303177 · report
get_num_transformer_layers Uppaal/detox-edit/utils/model_utils.py official repository ran MIT (permissive) · 772f368569ca0f5d · report
load_toxicity_preference Uppaal/detox-edit/utils/dataset_utils.py official repository ran MIT (permissive) · ec4fdca101330482 · report
main Uppaal/detox-edit/utils/startup.py official repository ran MIT (permissive) · cfb7124a6f05db32 · report
reduce_num_dps Uppaal/detox-edit/utils/dataset_utils.py official repository ran MIT (permissive) · 7bf4ed7f8521c691 · report
vector_matrix_cosine_similarity Uppaal/detox-edit/utils/utils.py official repository ran fingerprinted MIT (permissive) · 3dd8a319f62d60ec · report
vector_vector_cosine_similarity Uppaal/detox-edit/utils/utils.py official repository ran MIT (permissive) · aa5ffddfcd573d9a · report
get_current_gpu_use Uppaal/detox-edit/utils/utils.py official repository unverified MIT (permissive) · e61d0c538220694e · report
get_model_category Uppaal/detox-edit/utils/model_utils.py official repository unverified MIT (permissive) · 6387304a152872eb · report
llm_judge_eval Uppaal/detox-edit/evaluation/win_rate.py official repository unverified MIT (permissive) · fe59b113554271a7 · report
load_large_model Uppaal/detox-edit/utils/model_utils.py official repository unverified MIT (permissive) · 78599b638be017da · report
HalluEdit ziwei-zheng/nullu/utils/halluedit.py community (archive-listed) unverified MIT (permissive) · 6b9b938bdb4d6f5f · report

Tasks

Language ModellingModel Editing

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

DPO

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