COT: A Generative Approach for Hate Speech Counter-Narratives via Contrastive Optimal Transport

Linhao Zhang, Li Jin, Guangluan Xu, Xiaoyu Li, Xian Sun · DOI

Abstract

Combating online hate speech requires more than just content removal; it necessitates constructive engagement. Counter-narratives (CNs) serve as a restorative alternative to traditional moderation, yet automated generation often suffers from generic outputs and repetitive model degeneration. We present the Contrastive Optimal Transport (COT) framework, which integrates Optimal Transport theory to align generated text with specific hatred targets and employs a self-contrastive learning objective to enhance linguistic diversity. Our approach significantly outperforms existing baselines in relevance and novelty across major benchmarks.

Introduction

The prevalence of online hate speech has led to the widespread adoption of "identify-and-delete" strategies. While effective at removing harmful content, these passive reactions often fail to address the emotional harm inflicted on vulnerable communities or provide a platform for restorative dialogue. Counter-narratives—non-aggressive, fact-based responses—offer a more proactive intervention strategy.

Comparison between traditional passive reaction and responsive intervention via counter-narratives.

However, current Natural Language Generation (NLG) models face two primary hurdles: a lack of individualization, leading to "canned" responses, and model degeneration, where Transformers produce repetitive, meaningless patterns. The COT framework addresses these by ensuring responses are both target-aware and linguistically diverse.

Methodology: The COT Framework

The COT framework builds upon a Transformer-style encoder (GPT-2 medium) by introducing three innovative modules designed to improve the quality and specificity of counter-narratives.

The COT architecture featuring the Target Perceiving Module and Self Contrastive Module.

1. Optimal Transport Kernel (OTK)

To ensure the generated response directly addresses the victim group (e.g., "MIGRANTS" or "WOMEN"), the OTK utilizes Optimal Transport theory. This module aligns the representation of the hatred target with the token representations of the generated response, effectively "pulling" the model to stay on-topic and relevant to the specific context of the attack.

2. Self-Contrastive Learning (SC)

To combat model degeneration, the SC module implements a push-and-pull mechanism in the embedding space. By encouraging an anisotropic distribution—pushing apart the representations of different tokens—the model avoids falling into repetitive word cycles, resulting in more varied and meaningful sentences.

3. Target-Oriented Search (TOS)

During inference, the TOS decoding strategy replaces standard greedy or beam search. It calculates a combined score based on model confidence, a degeneration penalty for repetitive tokens, and a relevance bonus for words semantically linked to the hatred target.

Experimental Setup and Datasets

The model was rigorously evaluated on two distinct benchmarks:

  • Multitarget-CONAN: A high-quality dataset of 5,000 pairs curated by expert NGO operators, covering seven target categories.
  • Reddit: A larger, real-world dataset of 14,286 pairs reflecting the noisy nature of social media interactions.

Key Results and Insights

The COT model demonstrated superior performance over state-of-the-art models like SimCTG. On the CONAN dataset, COT achieved a BLEU-4 score of 15.73, a substantial improvement over the previous best of 10.47. Furthermore, the model showed marked gains in diversity and novelty metrics, indicating its ability to generate fresh, context-aware arguments rather than simply memorizing training data.

A qualitative comparison highlighted the framework's precision. While standard models might offer generic platitudes, COT provides targeted rebuttals. For instance, in response to misogynistic hate speech, COT specifically addresses the crime of violence rather than offering a vague statement about being "nice."

Conclusion and Future Work

The COT framework represents a significant step forward in automated hate speech intervention. By combining Optimal Transport with contrastive learning, it produces counter-narratives that are both highly relevant and linguistically robust. Future research will explore scaling these strategies to larger Large Language Models (LLMs) and developing the infrastructure necessary for real-time deployment on social media platforms.

Summary updated

BibTeX
@article{zhang2025cot,
  author = {Linhao Zhang and Li Jin and Guangluan Xu and Xiaoyu Li and Xian Sun},
  title = {{COT: A Generative Approach for Hate Speech Counter-Narratives via Contrastive Optimal Transport}},
  journal = {IEEE Trans. Emerg. Top. Comput. Intell.},
  year = {2025},
  doi = {10.1109/tetci.2024.3406691},
}
Figure