arXiv:2508.06204cs.CLcs.AI2025-08

用检索增强生成解决仇恨言论检测,让系统更灵活透明。

Classification is a RAG problem: A case study on hate speech detection

  • 用检索政策文本替代固定分类器,动态判断内容是否违规
  • 准确率媲美商用系统,且可不重训就更新政策规则
  • 自动给出违规依据,适合需要解释性的内容审核场景

稳健的内容审核需要能快速适应不断变化的政策、无需昂贵重训练的分类系统。我们提出将分类任务转化为检索增强生成(RAG),将传统基于预训练参数的类别判定,转变为在推理时结合上下文知识进行评估。在仇恨言论检测中,任务从“这是仇恨言论吗?”变为“这是否违反仇恨言论政策?”。我们的上下文政策引擎(CPE)——一个代理式RAG系统——展示了该方法,具备三大优势:(1) 分类准确率与领先商用系统相当;(2) 通过检索到的政策片段实现内在可解释性;(3) 政策动态更新无需模型重训。三个实验表明系统具备强基线性能,并能通过不重训即精准调整对特定身份群体的保护力度,且不影响整体表现。研究证明,RAG可使分类任务变得更灵活、透明和可适应,适用于内容审核及更广泛的分类问题。

原文摘要 · Abstract (English)

Robust content moderation requires classification systems that can quickly adapt to evolving policies without costly retraining. We present classification using Retrieval-Augmented Generation (RAG), which shifts traditional classification tasks from determining the correct category in accordance with pre-trained parameters to evaluating content in relation to contextual knowledge retrieved at inference. In hate speech detection, this transforms the task from "is this hate speech?" to "does this violate the hate speech policy?" Our Contextual Policy Engine (CPE) - an agentic RAG system - demonstrates this approach and offers three key advantages: (1) robust classification accuracy comparable to leading commercial systems, (2) inherent explainability via retrieved policy segments, and (3) dynamic policy updates without model retraining. Through three experiments, we demonstrate strong baseline performance and show that the system can apply fine-grained policy control by correctly adjusting protection for specific identity groups without requiring retraining or compromising overall performance. These findings establish that RAG can transform classification into a more flexible, transparent, and adaptable process for content moderation and wider classification problems.

内容审核RAG可解释性政策更新

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。