Skip to main content
QUICK REVIEW

[论文解读] You Only Prompt Once: On the Capabilities of Prompt Learning on Large Language Models to Tackle Toxic Content

Xinlei He, Savvas Zannettou|arXiv (Cornell University)|Aug 10, 2023
Adversarial Robustness in Machine Learning被引用 8
一句话总结

本论文系统性评估针对有毒内容任务(有毒性分类、有毒片段检测与去毒化)的提示学习,涵盖五种模型架构与八个数据集,结果表明提示学习在适应速度更快、数据需求更少的情况下可达到或超过基线水平。

ABSTRACT

The spread of toxic content online is an important problem that has adverse effects on user experience online and in our society at large. Motivated by the importance and impact of the problem, research focuses on developing solutions to detect toxic content, usually leveraging machine learning (ML) models trained on human-annotated datasets. While these efforts are important, these models usually do not generalize well and they can not cope with new trends (e.g., the emergence of new toxic terms). Currently, we are witnessing a shift in the approach to tackling societal issues online, particularly leveraging large language models (LLMs) like GPT-3 or T5 that are trained on vast corpora and have strong generalizability. In this work, we investigate how we can use LLMs and prompt learning to tackle the problem of toxic content, particularly focusing on three tasks; 1) Toxicity Classification, 2) Toxic Span Detection, and 3) Detoxification. We perform an extensive evaluation over five model architectures and eight datasets demonstrating that LLMs with prompt learning can achieve similar or even better performance compared to models trained on these specific tasks. We find that prompt learning achieves around 10\% improvement in the toxicity classification task compared to the baselines, while for the toxic span detection task we find better performance to the best baseline (0.643 vs. 0.640 in terms of $F_1$-score). Finally, for the detoxification task, we find that prompt learning can successfully reduce the average toxicity score (from 0.775 to 0.213) while preserving semantic meaning.

研究动机与目标

  • 推动并评估提示学习作为快速适应有毒内容检测与缓解的解決方案,而无需对整個模型进行微调。
  • 评估提示学习在三个任务上的性能:有毒性分类、有毒片段检测与去毒化。
  • 将提示学习与任务特定基线进行比较,并分析数据效率、迁移性与鲁棒性。
  • 展示在在线平台上的潜在实际收益,包括性能、成本与绿色AI方面的考虑。

提出的方法

  • 将有毒性任务框定为对冻结的大型语言模型进行学习可调提示(前缀微调风格)的提示学习问题。
  • 在五个模型家族(GPT2-M、GPT2-L、T5-S、T5-B、T5-L)和八个数据集上评估两种提示学习变体。
  • 任务1使用分类提示将标签映射到 Yes/No,并优化二元损失。
  • 任务2将片段检测视为生成任务,提示模型产生无毒文本,然后通过减法识别片段。
  • 任务3将去毒化视为生成任务,以在保持意义的前提下产出非毒性改写,并优化以得到去毒化输出。
  • 与基线进行比较(Perspective API、ToxicBERT、UnRoBERTa),并报告F1分数及其他指标。
(a) HateXplain
(a) HateXplain

实验结果

研究问题

  • RQ1提示学习在冻结的LLMs上是否能达到与特定任务基线相当或更优的有毒内容相关任务表现?
  • RQ2提示微调在多样化的有毒数据集与任务中有多高的数据效率与迁移性?
  • RQ3在有毒内容任务中,提示微调与全微调在速度、训练步数、数据需求方面的实际权衡是什么?
  • RQ4提示微调对拼写错误与对抗性文本扰动的鲁棒性如何?
  • RQ5提示微调方法对现实世界在线平台的可扩展性与安全性有何影响?

主要发现

  • 在有毒性分类任务上,提示微调的LLM在多个数据集上达到或超过基线的F1分数(例如 HateXplain:0.731(GPT2-L)对比基线0.703)。
  • 在有毒片段检测方面,提示微调达到0.643的F1,略高于SPAN-BERT的0.640,同时显著减少训练时间。
  • 在去毒化方面,提示微调显著降低平均有毒性分数(例如 ParaDetox 从0.775降至0.213),同时保持意义。
  • 提示微调展现出数据效率,在某些情况下仅需500个训练样本即可获得强结果(例如 SBIC:在 T5-B 上用500样本达到0.782)。
  • 提示的迁移性依数据集而定;在 HateXplain 的提示相比于在其他数据集的提示,MHS训练的提示具有更好的泛化性,表明训练数据的多样性有助于泛化。
  • 与微调相比,使用较小的前缀提示可以更快达到竞争性准确度(例如 USElectionHate20 上6分钟达到0.712准确度,而微调需100分钟达到0.619)。
  • 提示微调对拼写错误和对抗性扰动具有鲁棒性,在测试场景中保持高准确性。
(b) USElectionHate20
(b) USElectionHate20

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。