ToxiCraft: A Novel Framework for Synthetic Generation of Harmful Information
Zheng Hui, Zhaoxiao Guo, Hang Zhao, Juanyong Duan, Congrui Huang
TL;DR
Harmful-content detection in NLP is hampered by data scarcity and inconsistent labeling across domains. The authors propose ToxiCraft, a framework that uses seed-guided synthesis with attribute extraction, context enhancement, and prompt-based refinements to generate diverse harmful-content samples via large language models, enabling training of smaller models with improved robustness. Across four datasets, ToxiCraft yields substantial improvements in Macro-F1, approaching or surpassing gold-label baselines, and demonstrates notable cross-dataset gains, particularly when transferring data between datasets. The work offers a practical, data-efficient path for robust harmful-content moderation, with ethical safeguards and clear directions for multilingual expansion and cost reduction.
Abstract
In different NLP tasks, detecting harmful content is crucial for online environments, especially with the growing influence of social media. However, previous research has two main issues: 1) a lack of data in low-resource settings, and 2) inconsistent definitions and criteria for judging harmful content, requiring classification models to be robust to spurious features and diverse. We propose Toxicraft, a novel framework for synthesizing datasets of harmful information to address these weaknesses. With only a small amount of seed data, our framework can generate a wide variety of synthetic, yet remarkably realistic, examples of toxic information. Experimentation across various datasets showcases a notable enhancement in detection model robustness and adaptability, surpassing or close to the gold labels.
