让中文有毒内容检测模型说清哪里有问题,解释更连贯可信。
ToxiTrace: Gradient-Aligned Training for Explainable Chinese Toxicity Detection

- 用轻量级大模型引导,精炼BERT的敏感词定位结果。
- 通过梯度约束损失,让有毒标记更集中、无关激活被抑制。
- 为每条样本构建对比推理对,提升有毒与非有毒内容的区分力。
现有中文有毒内容检测方法多聚焦句子级分类,但常无法提供可读且连续的有毒证据片段。本文提出面向可解释性的ToxiTrace方法,专为BERT类编码器设计,包含三个组件:(1) CuSA,利用轻量级大模型引导,将编码器生成的显著性线索细化为细粒度的有毒片段;(2) GCLoss,一种梯度约束目标函数,使词级显著性集中于有毒证据,同时抑制无关激活;(3) ARCL,构建样本特定的对比推理对,强化有毒与非有毒内容间的语义边界。实验表明,ToxiTrace在提升分类准确率和有毒片段提取效果的同时,保持了高效编码器推理能力,并生成更连贯、可读的人类解释。模型已开源于 https://huggingface.co/ArdLi/ToxiTrace。
原文摘要 · Abstract (English)
Existing Chinese toxic content detection methods mainly target sentence-level classification but often fail to provide readable and contiguous toxic evidence spans. We propose \textbf{ToxiTrace}, an explainability-oriented method for BERT-style encoders with three components: (1) \textbf{CuSA}, which refines encoder-derived saliency cues into fine-grained toxic spans with lightweight LLM guidance; (2) \textbf{GCLoss}, a gradient-constrained objective that concentrates token-level saliency on toxic evidence while suppressing irrelevant activations; and (3) \textbf{ARCL}, which constructs sample-specific contrastive reasoning pairs to sharpen the semantic boundary between toxic and non-toxic content. Experiments show that ToxiTrace improves classification accuracy and toxic span extraction while preserving efficient encoder-based inference and producing more coherent, human-readable explanations. We have released the model at https://huggingface.co/ArdLi/ToxiTrace.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。