OffensiveLang: A Community Based Implicit Offensive Language Dataset

Amit Das, Mostafa Rahgouy, Dongji Feng, Zheng Zhang, Tathagata Bhattacharya, Nilanjana Raychawdhary, Fatemeh Jamshidi, Vinija Jain, Aman Chadha, Mary J. Sandage, Lauramarie Pope, Gerry V. Dozier, Cheryl D. Seals · DOI

TL;DR

This paper introduces OffensiveLang, a novel dataset of implicit offensive language generated by ChatGPT, designed to address the challenges of detecting subtle, context-dependent hate speech. The authors also propose a prompt-based zero-shot method for generating and annotating this data, offering an efficient alternative to traditional data collection.

What Problem Does This Paper Address?

The proliferation of offensive language on social media poses a significant societal challenge. While explicit hate speech is relatively easy to detect, implicit offensive language, which lacks overt hateful keywords but can still be offensive depending on context and target, is much harder to identify. Existing datasets often rely on explicit keywords, missing this subtle form of offense. Furthermore, current detection methods primarily focus on textual analysis, neglecting valuable community context. Generating large, diverse datasets for implicit offensive language is also time-consuming and expensive.

Methods

The core of this work involves using ChatGPT 3.5 to generate implicit offensive language. Recognizing ChatGPT's built-in content filters, the authors developed a prompt-based approach that frames requests in a way that elicits offensive content without directly asking for it. Specifically, they used prompts asking for sentences that should not be used against a target group, which paradoxically led to the generation of offensive examples. This approach was used to create the OffensiveLang dataset. For annotation, they explored various prompt engineering strategies, ultimately selecting a prompt that combined an offensive definition with a target group specification for optimal results. They also compared human annotations with ChatGPT's annotations to assess agreement. Finally, they evaluated several machine learning models for implicit offensive language detection on their new dataset.

Datasets

The primary contribution is the OffensiveLang dataset, a community-based implicit offensive language dataset. It contains 8270 texts, with 6616 labeled as 'offensive' and 1654 as 'not offensive'. The dataset is categorized into seven distinct groups: Race/Ethnicity, Religion, Gender/Sexual Orientation, Disability, Diet, Body Structure, and Occupation. It further breaks down into 38 specific target groups, including novel categories like Diet, Body Structure, and Occupation. The dataset was generated by ChatGPT and annotated by both humans and ChatGPT.

Key Insights and Ideas

  • Prompt Engineering for Evasion: The paper demonstrates a clever workaround for LLM content filters by framing requests for "what not to say" to generate offensive content. This highlights the potential for creative prompt engineering to overcome AI safety guardrails for research purposes.
  • Implicit vs. Explicit Detection: The dataset and evaluation underscore the significant difference in difficulty between detecting explicit and implicit offensive language, with models showing moderate performance on the latter.
  • Community Context Matters: The inclusion of specific target groups and the comparison of human vs. ChatGPT annotations reveal how crucial community context is for interpreting offensiveness, a nuance that purely text-based models might miss.
  • LLMs as Data Generators: The work validates the use of LLMs like ChatGPT as a viable, efficient method for generating large-scale datasets for niche NLP tasks, despite ethical constraints.

Key Results

  • The OffensiveLang dataset comprises 8270 texts across 38 target groups.
  • Human and ChatGPT annotations showed a similarity of 73.3%, with notable differences in interpretation for certain examples, particularly regarding generalizations about religious groups.
  • Among the evaluated models, BERT achieved the highest Macro F1 score (0.53) and recall (0.54) for implicit offensive language detection.
  • DistilBERT achieved the highest Precision score (0.71), indicating it is more conservative and accurate when it predicts an instance as offensive, though it may miss more true positives.

Limitations and Future Work

The authors acknowledge several limitations:

  • Prompt Bias: The reliance on prompt-based generation may introduce biases inherent in the LLM's training data and the specific prompts used.
  • Subjectivity in Annotation: While human evaluation was used, subjective interpretation can still vary among annotators, potentially affecting annotation consistency.
  • Dataset Coverage: Despite including 38 target groups, the dataset may not comprehensively cover all possible groups or the nuanced ways offensive language is directed at them, limiting generalizability.

Future work suggested includes expanding the dataset by including new categories and target groups.

Summary updated

BibTeX
@article{das2024offensivelang,
  author = {Amit Das and Mostafa Rahgouy and Dongji Feng and Zheng Zhang and Tathagata Bhattacharya and Nilanjana Raychawdhary and Fatemeh Jamshidi and Vinija Jain and Aman Chadha and Mary J. Sandage and Lauramarie Pope and Gerry V. Dozier and Cheryl D. Seals},
  title = {{OffensiveLang: A Community Based Implicit Offensive Language Dataset}},
  journal = {IEEE Access},
  year = {2024},
  doi = {10.1109/access.2024.3513220},
}
Figure