Don’t Start from Scratch: Memory-Informed Detoxification for Safer LLM Responses

Pengze Chen, Jiachuan Wang, Weijie Sun, Wangze Ni, Lei Chen


Abstract
Large language models demonstrate exceptional capabilities but raise critical safety concerns due to toxic outputs causing potential harm to users. Prompt optimization has emerged as a practical detoxification solution because it operates at the input level and can be applied to black-box or API-based models without parameter access. However, existing methods treat each task in a stateless manner without leveraging prior optimization experiences, which results in either ineffective detoxification or over-sanitized prompts that lose original intent in the vast search space. To address this, we propose the Memory-INformed Detoxification (MIND) framework that harnesses historical optimization experiences to enhance detoxification effectiveness through Memory Retrieval (MR) for retrieving relevant past cases and Memory Maintenance (MM) for maintaining a representative memory pool. We formulate MR and MM as optimization problems, prove their NP-hardness, and develop two approximation algorithms with constant approximation ratios for these problems. Experiments across multiple datasets and model configurations show that MIND outperforms existing baselines in both toxicity reduction and response utility.
Anthology ID:
2026.findings-emnlp.2452
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
52627–52644
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.2452/
DOI:
Bibkey:
Cite (ACL):
Pengze Chen, Jiachuan Wang, Weijie Sun, Wangze Ni, and Lei Chen. 2026. Don’t Start from Scratch: Memory-Informed Detoxification for Safer LLM Responses. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 52627–52644, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Don’t Start from Scratch: Memory-Informed Detoxification for Safer LLM Responses (Chen et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.2452.pdf