Cleansing the Artificial Mind: A Self-Reflective Detoxification Framework for Large Language Models
Kaituo Zhang, Zhimeng Jiang, Na Zou · 2026
Read Cleansing the Artificial Mind: A Self-Reflective Detoxification Framework for Large Language Models by Kaituo Zhang, Zhimeng Jiang, Na Zou (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-11776.txt.
Introduction
Kaituo Zhang, Zhimeng Jiang, and Na Zou present a way to clean toxic output from large language models. Large models can fix and grade their own text to some degree. Most clean-up tools so far do not use that skill. They add outer parts, hand marked data, or human help, which is slow and hard to scale.
Their frame leans on the model's own self-checks in place of outer help. A self-led clean-up could stay more smooth as models grow. It could also cut the cost of marked data. The work tests if a model can spot and fix its own toxic text in a sound loop.
Catalog record
| CREATOR | Kaituo Zhang, Zhimeng Jiang, Na Zou |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 58 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-11776
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Cleansing the Artificial Mind: A Self-Reflective Detoxification Framework for Large Language Models Kaituo Zhang, Zhimeng Jiang, Na Zou Abstract Recent breakthroughs in Large Language Models (LLMs) have revealed remarkable generative capabilities and emerging self-regulatory mechanisms, including self-correction and self-rewarding. However, current detoxification techniques rarely exploit these built-in abilities; instead, they rely on external modules, labor-intensive data annotation, or human intervention –factors that hinder scalability and consistency. In this paper, we introduce a fully self-reflective detoxification framework that harnesses the inherent capacities of LLMs to detect, correct toxic content, and refine LLMs without external modules and data annotation . Specifically, we propose a Toxic Signal Detector —an internal self-identification mechanism, coupled with a systematic intervention process to transform toxic text into its non-toxic counterpart. This iterative procedure yields a contrastive detoxification dataset used to fine-tune the model, enhancing its ability for safe and coherent text generation. Experiments on benchmark datasets such as DetoxLLM and ParaDetox show that our method achieves better detoxification performance than state-of-the-art methods while preserving semantic fidelity. By obviating the need for human intervention or external components, this paper reveals the intrinsic self-detoxification ability of LLMs, offering a consistent and effective approach for mitigating harmful content generation. Ultimately, our findings underscore the potential for truly self-regulated language models, paving the way for more responsible and ethically guided text generation systems. 1 1 1 Code: https://anonymous.4open.science/r/SRD-3448 Warning: this paper may contain offensive content. 1 Introduction Large Language Models (LLMs) Brown et al. 2020 ; OpenAI 2024 ; Yang et al. 2024b have achieved remarkable success in text generation Kumichev et al. 2024 ; Li et al. 2024a and dialogue systems Yang et al. 2024b ; Yi et al. 2024 . However, the pretraining processes often expose the pretrain model to vast and diverse corpora, making them susceptible to producing toxic content, including offensive or insulting statements Laugier et al. 2021 ; Chetnani 2023 . Such generated content often contains stereotypes, discrimination, and hateful rhetoric that run counter to fundamental human values and can pose serious societal risks by negatively shaping users’ perceptions. Therefore, mitigating toxic generation issues has become a critical research direction Bonaldi et al. 2024 . The intuitive way for mitigating toxic outputs is to train models to distinguish acceptable from unacceptable content. Consequently, most existing work has focused on model alignment. Although existing efforts leverage techniques to align LLMs with human values such as Reinforcement Learning from Human Feedback (RLHF) Chen et al. 2024 and instruction tuning Hengle et al. 2024 to differentiate between toxic and non-toxic content, these methods rely on human annotation and don’t fully eliminate harmful outputs. Indeed, our preliminary study, shown in Table 2 and section 2.2 , demonstrates that many instructed LLMs still generate toxic output. Therefore, we still need to design specialized algorithms for model detoxification. Existing detoxification methods suffer from notable drawbacks. Many methods heavily depend on manually labeled datasets Ko et al. 2024a ; Lee et al. 2024 ; Wang et al. 2024 or direct human intervention for toxic sentence rewriting Logacheva et al. 2022 , which becomes prohibitively labor-intensive and costly as datasets scale. Another line of work incorporates external components for detoxification Tang et al. 2024 , making their effectiveness reliant on the performance and reliability of these external modules. We summarize the relevant work, and the results are presented in Table 1 . A detailed discussion can be found in Related Work section 5 . Consequently, these methods inherently exhibit significant inefficiencies. However, recent progress in LLMs has demonstrated increasingly advanced self-processing capability, including self-correction Kumar et al. 2024 ; Feng et al. 2024 and self-rewarding Yuan et al. 2024 ; Huang et al. 2024 . Motivated by this, a fundamental question arises: Can we design a framework that enables LLMs to perform self-detoxification, leveraging their inherent capacity to identify and rewrite toxic content? To this end, we propose Self-Reflective Detoxification (SRD), a novel LLM self-detoxification framework that requires neither human intervention nor external models. In SRD, the LLM acts as a Toxic Signal Detector by maintaining an internal signal list to flag toxic content, and performs step-by-step intervention on each generated word through signal checks, semantic evaluation, and toxic output rewriting—all handled by the LLM itself to ensure consistency. Both the original toxic and the rewritten non-toxic outputs are used to construct a contrastive dataset, which is then used to fine-tune the model via Direct Preference Optimization (DPO). This pipeline yields a detoxified model that effectively reduces harmful outputs. Our contributions can be summarized as follows: • We propose a fully LLM-based self-detoxification framework that leverages LLMs’ intrinsic self-improvement mechanism to effectively detect and significantly reduce toxic content without relying on human intervention or external modules. • The proposed step-by-step iterative process integrates Signal Words Check, Semantic Check, and Content Rewriting into the intervention, which can generate a high-quality contrastive dataset. The dataset can be used to further fine-tune and detoxify LLMs. • We benchmark our framework against multiple state-of-the-art (SOTA) detoxification datasets, showing the superior detoxification performance enabled by our generated contrastive dataset. Moreover, experiments show that the intervention process is more effective for dataset construction than CoT prompting and fine-tuning with self-generated data better preserves performance on general tasks. Method W/o EC W/o HI CMD Tang et al. 2024 ✗ ✗ SASA Ko et al. 2024a ✓ ✗ DPO_Toxic Lee et al. 2024 ✗ ✗ DeStein Li et al. 2024c ✗ ✓ Toxic_KE Wang et al. 2024 ✓ ✗ DetoxLLM Khondaker et al. 2024 ✗ ✓ DETOXIGEN Niu et al. 2024 * ✗ ✗ ParaDetox Logacheva et al. 2022 * ✗ ✓ SRD(Ours) ✓ ✓ Table 1: Comparison of various detoxification methods based on the presence of external components (EC) and the need for human intervention (HI). The cells with ✓indicate the presence of a particular feature. 2 Preliminary Study 2.1 Metrics We adopt the Perspective API 2 2 2 https://www.perspectiveapi.com/ Huang et al. 2023 to measure the toxicity score. A higher value indicates a greater level of toxicity. Outputs with scores above 50% are deemed toxic. Three key toxicity-related metrics include (1) Toxic Ratio (T.R.): The percentage of toxic outputs among all generated responses; (2) Max Toxic Value (MTV): The highest toxicity score observed across test samples, reflecting extreme cases of harmful content; (3) Top 50 Mean Toxicity Value (T5MTV): The mean toxicity of the top 50 most toxic samples, indicating that while the samples are toxic, this value reflects their top overall toxicity severity. We represent the data as percentages; higher values indicate a greater level of toxicity. 2.2 Ability of LLMs to Determine Toxicity Since large language models (LLMs) are trained on extensive corpora and refined through SFT and alignment, they inherently retain the ability to determine whether a sentence is toxic. To examine this ability, we first conduct experiments that assess the models’ performance in detecting toxicity. Specifically, we draw on the ToxiGen dataset containing both toxic and non-toxic labeled sentences, and use False Positive Rate (FPR), False Negative Rate (FNR), and AUC as our primary evaluation metric to quantify detection performance. Model FPR FNR AUC Llama-3.1-8B AI@Meta 2024b 0.532 0 0.734 Llama-2-7b-chat-hf Touvron et al. 2023 0.464 0.007 0.764 Phi-3-mini-4k-instruct Abdin et al. 2024 0.305 0 0.847