通过自举与蒸馏大语言模型实现高效有害内容检测
Efficient Toxic Content Detection by Bootstrapping and Distilling Large Language Models
AI总结:
针对有害内容检测中现有模型准确率与迁移性不足、大语言模型提示设计难及部署成本高的问题,提出BD-LLM方法,通过DToT提示法自举提升大模型性能并提取推理依据,蒸馏出更小、更准、迁移性更强的学生模型。
摘要:
有害内容检测对于在线服务清除违反社区准则的不当内容至关重要。为实现检测流程自动化,已有研究提出多种机器学习(ML)方法训练语言模型(LM)用于有害内容检测,但这类方法的准确率和跨数据集迁移能力均存在局限。近年来,大语言模型(LLM)凭借出色的零样本、少样本上下文学习能力以及在机器学习任务上的广泛迁移性,在有害内容检测中展现出应用潜力。然而,为大语言模型高效设计提示词仍具挑战,且大语言模型的高推理成本可能阻碍其在生产环境的部署。针对上述问题,本文提出BD-LLM——一种用于有害内容检测的新型高效大语言模型自举与蒸馏方法。具体而言,我们设计了名为Decision-Tree-of-Thought(DToT,思维决策树)的新型提示方法,用于提升大语言模型的检测性能并提取高质量推理依据。当大语言模型的响应置信度不足时,DToT可自动选择更细粒度的上下文重新向模型发起提示。此外,我们利用DToT提取的推理依据微调学生语言模型。在多个数据集上的实验结果表明,DToT可将大语言模型的准确率最高提升4.6%;经DToT提取的推理依据微调的学生语言模型,在所有数据集上的表现均优于基线模型,准确率最高提升16.9%,且模型规模比传统大语言模型小60倍以上。最后我们还发现,经推理依据微调的学生语言模型具备更优的跨数据集迁移能力。
英文摘要:
Toxic content detection is crucial for online services to remove inappropriate content that violates community standards. To automate the detection process, prior works have proposed varieties of machine learning (ML) approaches to train Language Models (LMs) for toxic content detection. However, both their accuracy and transferability across datasets are limited. Recently, Large Language Models (LLMs) have shown promise in toxic content detection due to their superior zero-shot and few-shot in-context learning ability as well as broad transferability on ML tasks. However, efficiently designing prompts for LLMs remains challenging. Moreover, the high run-time cost of LLMs may hinder their deployments in production. To address these challenges, in this work, we propose BD-LLM, a novel and efficient approach to Bootstrapping and Distilling LLMs for toxic content detection. Specifically, we design a novel prompting method named Decision-Tree-of-Thought (DToT) to bootstrap LLMs' detection performance and extract high-quality rationales. DToT can automatically select more fine-grained context to re-prompt LLMs when their responses lack confidence. Additionally, we use the rationales extracted via DToT to fine-tune student LMs. Our experimental results on various datasets demonstrate that DToT can improve the accuracy of LLMs by up to 4.6%. Furthermore, student LMs fine-tuned with rationales extracted via DToT outperform baselines on all datasets with up to 16.9\% accuracy improvement, while being more than 60x smaller than conventional LLMs. Finally, we observe that student LMs fine-tuned with rationales exhibit better cross-dataset transferability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。