COLD: A Benchmark for Chinese Offensive Language Detection

TL;DR

COLD dataset with 37,480 Chinese offensive sentences; COLDETECTOR fine-tuned on it achieves 81% accuracy in offensive language detection.

cs.CL 🔴 Advanced 2022-01-16 60 views
Jiawen Deng Jingyan Zhou Hao Sun Chujie Zheng Fei Mi Helen Meng Minlie Huang
Chinese bias detection model safety dataset construction deep learning bias and offensive content

Key Findings

Methodology

This study constructs the COLDATASET, comprising 37,480 samples covering racial, gender, and regional biases. Data collection involves keyword queries, sub-topic crawling, and model-guided semi-automatic annotation. The dataset is labeled with binary offensive labels and fine-grained categories. A BERT-based classifier (bert-base-chinese) is fine-tuned with cross-entropy loss, evaluated via accuracy, precision, recall, and F1-score. The system also assesses mainstream Chinese generative models (CDialGPT, CPM, EVA) for bias and offensive outputs under various prompts.

Key Results

  • The COLDETECTOR achieves 81% accuracy on COLDATASET, outperforming Baidu Text Censor (63%) and TransJigsaw (60%). It recognizes attack categories with 79.51% and 85.49% accuracy, but performs poorly on anti-bias detection (38.32%), indicating bias content's propensity to trigger offensive outputs. Generative models show increased bias and offensive outputs when prompted with specific keywords and negative sentiments, emphasizing safety concerns.
  • Analysis reveals that biased content, especially anti-bias statements and targeted keywords, more easily trigger offensive generation. The detection model's performance varies across bias types, highlighting the need for diverse training data and robust safety mechanisms. These findings underscore the importance of dataset quality and model robustness in deploying safe NLP systems.
  • The trained detector demonstrates strong generalization across different scenarios, advancing Chinese offensive content detection. It provides a practical baseline for future research, addressing the scarcity of Chinese resources and contributing to safer AI deployment in social media and content moderation.

Significance

This work pioneers the creation of a comprehensive Chinese bias and offensive language dataset, filling a critical resource gap. It systematically evaluates the bias and safety of popular Chinese generative models, revealing their potential risks in real-world applications. The dataset and detection framework serve as foundational tools for academia and industry, promoting safer and more ethical NLP systems. By analyzing bias triggers and offensive outputs, the study informs future model design, emphasizing fairness and safety. The results have broad implications for AI ethics, content moderation, and social media regulation, especially in Chinese contexts where resources are limited. The research also sets a benchmark for future efforts to develop multilingual and multi-modal bias detection systems.

Technical Contribution

The main technical innovations include: 1) the creation of the first large-scale Chinese bias and offensive dataset, COLDATASET, covering multiple bias categories; 2) development of COLDETECTOR, leveraging fine-tuned BERT with semi-automatic annotation and multi-round validation, achieving high detection accuracy; 3) comprehensive evaluation of Chinese generative models’ bias and offensive outputs under various prompts, revealing their inherent risks. The approach integrates keyword filtering, model-guided annotation, and human verification, ensuring high data quality and model robustness, thus providing a scalable and reproducible framework for Chinese bias detection.

Novelty

This work is the first to systematically establish a Chinese bias and offensive content dataset, addressing the resource scarcity issue. It introduces a multi-strategy data collection pipeline combined with state-of-the-art BERT fine-tuning, significantly improving detection performance. The systematic evaluation of generative models’ bias and offensive tendencies under different prompts offers new empirical insights, filling a notable gap in Chinese NLP research. Its comprehensive approach and high-quality dataset set a new standard in the field, with broad applicability for content moderation and AI safety.

Limitations

  • Data collection relies heavily on keyword queries and sub-topic crawling, which may introduce bias and limit coverage, affecting model generalization.
  • Detection of subtle or implicit bias remains challenging; models tend to misclassify anti-bias statements as offensive, impacting precision.
  • Semi-automatic annotation may introduce noise; full manual annotation could further improve accuracy but increases costs and time.

Future Work

Future research will incorporate multimodal data (images, videos) to extend bias detection scenarios. Developing multi-task learning models can enhance robustness across bias types. Expanding dataset diversity and applying adversarial training will improve model resilience. Additionally, integrating explainability techniques will foster transparency and trust, guiding ethical AI deployment. Cross-lingual studies and multilingual datasets are also planned to broaden applicability.

AI Executive Summary

In an era where social media shapes public discourse, the proliferation of biased and offensive content poses significant challenges. Existing resources predominantly focus on English, leaving Chinese NLP lagging behind in addressing these issues. This research introduces the COLD benchmark, a comprehensive Chinese offensive language dataset with 37,480 samples covering racial, gender, and regional biases. The dataset was meticulously constructed through keyword queries, sub-topic crawling, and model-guided annotation, ensuring diversity and quality. Leveraging this dataset, the authors developed COLDETECTOR, a BERT-based classifier fine-tuned to identify offensive and biased content with 81% accuracy, surpassing existing tools like Baidu Text Censor. The system's effectiveness was validated through extensive experiments, demonstrating its ability to detect attack categories with high precision, though anti-bias detection remains challenging. The study also systematically evaluated popular Chinese generative models—CDialGPT, CPM, EVA—revealing their propensity to produce biased and offensive outputs, especially when prompted with specific keywords or negative sentiments. These findings underscore the importance of safety mechanisms in AI systems, highlighting that even non-offensive prompts can trigger harmful content. The research fills a critical gap in Chinese NLP by providing a standardized dataset and a robust detection framework, paving the way for safer AI applications. Looking ahead, integrating multimodal data, enhancing model explainability, and expanding dataset diversity are key directions to further improve bias mitigation and content safety. Overall, this work advances both academic understanding and practical tools for promoting ethical AI in Chinese social media and beyond.

Deep Analysis

Background

The rapid development of deep learning and pre-trained language models (e.g., BERT, GPT) has significantly advanced NLP tasks, including hate speech and toxicity detection. In English, large-scale datasets like HateXplain and Jigsaw Toxicity have fostered robust models. However, Chinese NLP research on offensive content remains underdeveloped due to scarce resources and cultural-linguistic differences. Existing Chinese datasets are limited, often focusing on profanity or gender bias, lacking comprehensive coverage of racial and regional biases. The rise of generative models (e.g., CDialGPT, CPM, EVA) has introduced new safety concerns, as these models can produce biased or offensive outputs, especially when prompted with sensitive keywords. Addressing these issues requires high-quality datasets and effective detection methods tailored to Chinese language characteristics.

Core Problem

The core challenge lies in developing reliable, scalable tools for Chinese offensive language detection amid data scarcity and linguistic complexity. Existing methods rely on keyword filtering or rule-based systems, which are insufficient for nuanced bias detection. The subtlety and diversity of bias expressions, coupled with the potential for generative models to produce offensive content, demand sophisticated, data-driven approaches. Furthermore, the lack of standardized benchmarks hampers progress, making it difficult to evaluate and compare detection techniques. These issues threaten the deployment of safe AI systems in Chinese social platforms, necessitating a dedicated dataset and robust models to mitigate risks effectively.

Innovation

This work introduces several key innovations: 1) COLDATASET, the first large-scale, multi-dimensional Chinese bias and offensive dataset, covering race, gender, and regional biases; 2) COLDETECTOR, a BERT-based classifier trained with semi-automatic annotation, achieving 81% accuracy; 3) systematic evaluation of popular Chinese generative models’ bias and offensive outputs under various prompts, revealing their risk profiles. The dataset’s construction employs keyword queries, sub-topic crawling, and model-guided annotation, ensuring diversity and high quality. The detection framework combines keyword filtering, model fine-tuning, and human verification, setting a new standard for Chinese offensive content detection.

Methodology

  • �� Data collection: Utilize keyword queries and sub-topic crawling on platforms like Zhihu and Weibo to gather biased and offensive comments. • Annotation: Implement a model-in-the-loop approach—initial manual labeling of 500 samples, training a classifier, then semi-automatically labeling remaining data, with iterative validation. • Data categorization: Divide samples into attack (individual/group), anti-bias, and other non-offensive categories, ensuring comprehensive coverage. • Model training: Fine-tune bert-base-chinese with cross-entropy loss, optimizing detection accuracy. • Evaluation: Measure performance using accuracy, precision, recall, F1-score across categories. • Generative model assessment: Input diverse prompts, analyze bias and offensive outputs, identify triggers.

Experiments

The experiments involve training COLDETECTOR on the COLDATASET, comparing it with baseline tools like Baidu Text Censor and TransJigsaw. Hyperparameters include a learning rate of 2e-5, batch size 32, and 3 training epochs. The evaluation covers overall accuracy, sub-category detection, and cross-model generalization. Additional tests assess generative models’ bias under different prompts, analyzing their propensity to produce offensive content. The annotation process involves multiple annotators with high inter-annotator agreement (Fleiss’ κ=0.819). The robustness of the detection system is validated through ablation studies and cross-scenario tests.

Results

COLDETECTOR achieves 81% overall accuracy, outperforming Baidu Text Censor (63%) and TransJigsaw (60%). It detects attack categories with nearly 80-85% accuracy, but anti-bias detection remains weak at 38%. Generative models like CDialGPT and CPM show increased bias and offensive outputs when prompted with keywords or negative sentiments, indicating safety risks. The results highlight that bias and offensive content can be triggered by subtle cues, emphasizing the need for robust detection and mitigation strategies. The dataset and models provide a solid foundation for future research and practical deployment.

Applications

The developed detection system can be integrated into social media moderation tools, AI content filters, and online community management platforms to automatically identify biased or offensive content. It supports real-time filtering, reducing harmful interactions and promoting healthier online environments. The dataset and methodology also serve as benchmarks for further research, enabling continuous improvement in bias mitigation. Long-term, these tools can be extended to multi-modal content and multilingual settings, fostering safer AI deployment globally.

Limitations & Outlook

The dataset relies on keyword-based collection, which may miss subtle or implicit biases, limiting coverage. The detection model struggles with nuanced anti-bias expressions, leading to false negatives. Semi-automatic annotation introduces potential noise, requiring further manual validation. The evaluation focuses on text-based content, not considering multimodal or contextual factors. Future work should address these limitations by expanding data sources, improving annotation quality, and exploring explainability techniques.

Plain Language Accessible to non-experts

想象你在学校里,有个老师每天都要检查学生的作业,确保没有写不好的话或偏激的内容。有时候,学生会用一些暗示或特殊的词表达偏见或攻击别人,但老师很难一眼看出来。为了帮老师更快更准地找到这些问题,科学家们开发了一种智能检测系统,就像一个超级聪明的机器人助手。这个机器人通过学习大量的作业,知道哪些内容是不好的,哪些词可能代表偏见。它会用一种叫做BERT的技术,就像一本超级详细的词典,帮助它理解每句话的意思。研究发现,当作业里出现一些特别的关键词,比如针对某个群体的词,或者表达负面情绪的词,机器人更容易误判。于是,科学家们不断改进这个系统,让它变得更聪明、更公平。最终,这个机器人可以帮助学校筛查出偏激或攻击性的内容,确保每个学生都在一个友善的环境里学习。未来,这个系统还能结合图片和视频,变得更厉害,让网络变得更安全、更和谐。

ELI14 Explained like you're 14

想象你在玩一个超级酷的游戏,但有时候游戏里会出现一些不好的内容,比如说一些带偏见的话。为了让游戏变得更公平、更有趣,开发者设计了一个智能小助手,它就像一个聪明的机器人,能帮你找出那些不好的话。这个机器人通过学习很多以前的游戏评论和聊天记录,知道哪些话是不友善或带攻击性的。它用一种叫做BERT的技术,就像一本超级厉害的词典,能理解每句话的意思。比如说,当有人说“某个群体都不好”时,机器人会识别出这是偏见,提醒开发者修正。研究还发现,当有人用一些特别的关键词,比如“黑鬼”或“歧视”,机器人更容易误判,把正常的评论也当成偏激内容。科学家们不断改进这个机器人,让它变得更聪明、更公平。未来,这个机器人还能结合图片和视频,帮忙检测更复杂的内容,让网络变得更安全。这样一来,我们在网上聊天、玩游戏时,就能更放心,不会被偏见和攻击性内容伤害。

Abstract

Offensive language detection is increasingly crucial for maintaining a civilized social media platform and deploying pre-trained language models. However, this task in Chinese is still under exploration due to the scarcity of reliable datasets. To this end, we propose a benchmark --COLD for Chinese offensive language analysis, including a Chinese Offensive Language Dataset --COLDATASET and a baseline detector --COLDETECTOR which is trained on the dataset. We show that the COLD benchmark contributes to Chinese offensive language detection which is challenging for existing resources. We then deploy the COLDETECTOR and conduct detailed analyses on popular Chinese pre-trained language models. We first analyze the offensiveness of existing generative models and show that these models inevitably expose varying degrees of offensive issues. Furthermore, we investigate the factors that influence the offensive generations, and we find that anti-bias contents and keywords referring to certain groups or revealing negative attitudes trigger offensive outputs easier.

cs.CL cs.AI