用提示工程提升低资源语言仇恨言论检测效果
Leveraging the Potential of Prompt Engineering for Hate Speech Detection in Low-Resource Languages
- 提出隐喻提示法绕过大模型安全限制
- 在孟加拉语上达到78.6% F1得分,优于传统方法
- 适合低资源语言研究者与NLP应用开发者
社交媒体的快速发展导致仇恨言论激增,威胁个人安全并引发多起仇恨犯罪。仇恨言论检测面临方言多样、频繁混码及拼写错误等挑战。当前进展主要集中在高资源语言,而低资源语言因缺乏大规模高质量数据集仍面临困难。本文聚焦低资源孟加拉语,探索大语言模型(LLMs)上的提示工程潜力,对比六种策略:零样本提示、拒绝抑制、夸奖分类器、多示例提示、角色提示及创新的隐喻提示。隐喻提示旨在规避模型内置安全机制,与现有越狱方法有本质区别。在Llama2-7B模型上测试,并与三种预训练词嵌入(GloVe、Word2Vec、FastText)结合三种深度学习模型(MLP、CNN、BiGRU)进行比较。为验证有效性,还在印地语(另一低资源语言)及英语、德语(高资源语言)上评估。所有方法以F1分数和环境影响因子(衡量二氧化碳排放、电力消耗和计算时间)评估性能。
原文摘要 · Abstract (English)
The rapid expansion of social media leads to a marked increase in hate speech, which threatens personal lives and results in numerous hate crimes. Detecting hate speech presents several challenges: diverse dialects, frequent code-mixing, and the prevalence of misspelled words in user-generated content on social media platforms. Recent progress in hate speech detection is typically concentrated on high-resource languages. However, low-resource languages still face significant challenges due to the lack of large-scale, high-quality datasets. This paper investigates how we can overcome this limitation via prompt engineering on large language models (LLMs) focusing on low-resource Bengali language. We investigate six prompting strategies - zero-shot prompting, refusal suppression, flattering the classifier, multi-shot prompting, role prompting, and finally our innovative metaphor prompting to detect hate speech effectively in low-resource languages. We pioneer the metaphor prompting to circumvent the built-in safety mechanisms of LLMs that marks a significant departure from existing jailbreaking methods. We investigate all six different prompting strategies on the Llama2-7B model and compare the results extensively with three pre-trained word embeddings - GloVe, Word2Vec, and FastText for three different deep learning models - multilayer perceptron (MLP), convolutional neural network (CNN), and bidirectional gated recurrent unit (BiGRU). To prove the effectiveness of our metaphor prompting in the low-resource Bengali language, we also evaluate it in another low-resource language - Hindi, and two high-resource languages - English and German. The performance of all prompting techniques is evaluated using the F1 score, and environmental impact factor (IF), which measures CO$_2$ emissions, electricity usage, and computational time.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。