Text Detoxification: Data Efficiency, Semantic Preservation and Model Generalization

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Yu, Jing, Zhao, Yibo, Zhu, Jiapeng, Shao, Wenming, Pang, Bo, Zhang, Zhao, Li, Xiang
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866913929344581632
author Yu, Jing
Zhao, Yibo
Zhu, Jiapeng
Shao, Wenming
Pang, Bo
Zhang, Zhao
Li, Xiang
author_facet Yu, Jing
Zhao, Yibo
Zhu, Jiapeng
Shao, Wenming
Pang, Bo
Zhang, Zhao
Li, Xiang
contents The widespread dissemination of toxic content on social media poses a serious threat to both online environments and public discourse, highlighting the urgent need for detoxification methods that effectively remove toxicity while preserving the original semantics. However, existing approaches often struggle to simultaneously achieve strong detoxification performance, semantic preservation, and robustness to out-of-distribution data. Moreover, they typically rely on costly, manually annotated parallel corpora while showing poor data efficiency. To address these challenges, we propose a two-stage training framework that jointly optimizes for data efficiency, semantic preservation, and model generalization. We first perform supervised fine-tuning on a small set of high-quality, filtered parallel data to establish a strong initialization. Then, we leverage unlabeled toxic inputs and a custom-designed reward model to train the LLM using Group Relative Policy Optimization. Experimental results demonstrate that our method effectively mitigates the trade-offs faced by previous work, achieving state-of-the-art performance with improved generalization and significantly reduced dependence on annotated data. Our code is available at: https://github.com/allacnobug/Detoxification-of-Text.
format Preprint
id arxiv_https___arxiv_org_abs_2507_01050
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Text Detoxification: Data Efficiency, Semantic Preservation and Model Generalization
Yu, Jing
Zhao, Yibo
Zhu, Jiapeng
Shao, Wenming
Pang, Bo
Zhang, Zhao
Li, Xiang
Machine Learning
Artificial Intelligence
Computation and Language
The widespread dissemination of toxic content on social media poses a serious threat to both online environments and public discourse, highlighting the urgent need for detoxification methods that effectively remove toxicity while preserving the original semantics. However, existing approaches often struggle to simultaneously achieve strong detoxification performance, semantic preservation, and robustness to out-of-distribution data. Moreover, they typically rely on costly, manually annotated parallel corpora while showing poor data efficiency. To address these challenges, we propose a two-stage training framework that jointly optimizes for data efficiency, semantic preservation, and model generalization. We first perform supervised fine-tuning on a small set of high-quality, filtered parallel data to establish a strong initialization. Then, we leverage unlabeled toxic inputs and a custom-designed reward model to train the LLM using Group Relative Policy Optimization. Experimental results demonstrate that our method effectively mitigates the trade-offs faced by previous work, achieving state-of-the-art performance with improved generalization and significantly reduced dependence on annotated data. Our code is available at: https://github.com/allacnobug/Detoxification-of-Text.
title Text Detoxification: Data Efficiency, Semantic Preservation and Model Generalization
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2507.01050