Skip to main content
QUICK REVIEW

[论文解读] Detecting Anti-Semitic Hate Speech using Transformer-based Large Language Models

Dengyi Liu, Minghao Wang|arXiv (Cornell University)|May 6, 2024
Hate Speech and Cyberbullying Detection被引用 4
一句话总结

本文提出了一种基于Transformer的反犹太主义仇恨言论检测方法,采用微调后的BERT、RoBERTa和LLaMA-2模型,并结合LoRA适配技术。结果表明,Transformer模型,尤其是BERT和RoBERTa,在精确率、召回率和F1分数上显著优于传统机器学习方法,而LoRA微调进一步提升了对细微仇恨言论模式的检测灵敏度。

ABSTRACT

Academic researchers and social media entities grappling with the identification of hate speech face significant challenges, primarily due to the vast scale of data and the dynamic nature of hate speech. Given the ethical and practical limitations of large predictive models like ChatGPT in directly addressing such sensitive issues, our research has explored alternative advanced transformer-based and generative AI technologies since 2019. Specifically, we developed a new data labeling technique and established a proof of concept targeting anti-Semitic hate speech, utilizing a variety of transformer models such as BERT (arXiv:1810.04805), DistillBERT (arXiv:1910.01108), RoBERTa (arXiv:1907.11692), and LLaMA-2 (arXiv:2307.09288), complemented by the LoRA fine-tuning approach (arXiv:2106.09685). This paper delineates and evaluates the comparative efficacy of these cutting-edge methods in tackling the intricacies of hate speech detection, highlighting the need for responsible and carefully managed AI applications within sensitive contexts.

研究动机与目标

  • 为应对社交媒体平台(如Twitter)上日益严重的反犹太主义仇恨言论问题,传统检测方法常因语言细微差别和上下文复杂性而失效。
  • 开发一种新型数据标注技术,实现对反犹太主义内容的民主化、共识性标注,从而提升数据集的质量与可靠性。
  • 评估传统机器学习模型(如SVM、朴素贝叶斯、随机森林)与最先进Transformer模型(如BERT、RoBERTa、LLaMA-2)在检测反犹太主义仇恨言论方面的性能对比。
  • 研究LoRA微调对大型语言模型(如RoBERTa和LLaMA-2,7B参数)在提升检测性能方面的影响,特别是在召回率和F1分数上的表现。
  • 通过提供可解释性高、准确率高的NLP模型,推动自动化内容审核技术的发展,助力构建更安全的在线交流环境。

提出的方法

  • 采用基于民主共识的自定义数据标注算法,对Twitter上的反犹太主义内容进行标注,确保高质量、上下文感知的标注结果。
  • 使用多种嵌入技术,包括CountVectorizer、TfidfVectorizer和HashingVectorizer用于传统机器学习模型,同时采用BERT、DistilBERT、RoBERTa和LLaMA-2的上下文嵌入用于深度学习模型。
  • 对提取的特征应用传统分类器,如k-NN、逻辑回归、SVM、随机森林和朴素贝叶斯,作为基线模型。
  • 利用低秩适应(LoRA)方法对RoBERTa和LLaMA-2(7B)进行微调,该方法是一种参数高效的微调技术,可在保留预训练知识的同时,使模型适应仇恨言论检测任务。
  • 使用标准NLP指标(准确率、精确率、召回率和F1分数)在标注数据集上评估所有模型的性能。
  • 对比传统模型与基于Transformer的模型的性能,以评估上下文理解能力与注意力机制对仇恨言论检测的影响。
Figure 1: This figure shows the workflow of voting algorithm.
Figure 1: This figure shows the workflow of voting algorithm.

实验结果

研究问题

  • RQ1基于Transformer的模型(如BERT、RoBERTa和LLaMA-2)在检测反犹太主义仇恨言论方面,与传统机器学习模型相比表现如何?
  • RQ2LoRA微调在多大程度上提升了RoBERTa和LLaMA-2(7B)等大语言模型对细微或语境嵌入型反犹太主义内容的检测性能?
  • RQ3嵌入技术的选择(如TF-IDF、词嵌入、上下文嵌入)如何影响仇恨言论检测模型的性能?
  • RQ4模型架构与计算效率对反犹太主义仇恨言论检测的影响如何,特别是在召回率和F1分数方面的表现?
  • RQ5基于共识的数据标注方法能否生成可靠且具有代表性的数据集,以用于训练高精度仇恨言论检测系统?

主要发现

  • BERT在所有评估模型中取得了最高的准确率和F1分数,表明其凭借深层上下文理解能力,在检测反犹太主义仇恨言论方面表现卓越。
  • LoRA微调后,RoBERTa和LLaMA-2(7B)在召回率和F1分数上均有显著提升,表明其对细微和语境嵌入型仇恨言论的敏感性增强。
  • 传统模型如k-NN在所有指标上表现最差,凸显其在处理仇恨言论检测中常见的高维稀疏文本数据时的局限性。
  • 尽管SVM和逻辑回归提供了尚可的基线性能,但其在召回率方面始终低于Transformer模型,表明其未能识别出大量相关案例。
  • 结合上下文嵌入(如来自RoBERTa的嵌入)与LoRA微调,使LLaMA-2(7B)的F1分数显著提升了10%–15%,表明参数高效的微调可增强模型的适应能力。
  • 本研究证实,与传统机器学习模型相比,基于Transformer的模型在捕捉反犹太主义仇恨言论的语言复杂性与上下文信息方面具有显著优势。
Figure 2: Architecture of LoRA fine-tuning applied to Llama2 model weights, demonstrating how the injection of trainable low-rank matrices A and B (initialized as A with a normal distribution and B set to zero) allows for efficient adaptation of the model’s weights to new tasks, preserving the origi
Figure 2: Architecture of LoRA fine-tuning applied to Llama2 model weights, demonstrating how the injection of trainable low-rank matrices A and B (initialized as A with a normal distribution and B set to zero) allows for efficient adaptation of the model’s weights to new tasks, preserving the origi

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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