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

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

TL;DR

The COT (Contrastive Optimal Transport) framework significantly improves the generation of hate speech counter-narratives by making them more relevant to specific targets (like LGBT+ groups or immigrants) and less repetitive. By combining Optimal Transport to align generated text with hatred targets and a self-contrastive learning objective, the model produces diverse, fact-based responses that outperform existing state-of-the-art baselines.

What Problem Does This Paper Address?

Combating online hate speech is a massive challenge. While "identify-and-delete" strategies (like banning users) are common, they often face moral dilemmas regarding free speech and fail to heal the emotional harm caused to vulnerable communities. Counter-narratives (CNs)—direct, non-aggressive, fact-based responses—are a more proactive and restorative alternative.

However, current Natural Language Generation (NLG) models struggle with two main issues in this domain:

  1. Lack of Individualization: Models often generate generic "canned" responses (e.g., "Please be nice") that fail to address the specific group being targeted.
  2. Model Degeneration: Transformer-based models like GPT-2 frequently fall into repetitive loops, producing "meaningless patterns" that undermine the effectiveness of the counter-argument.

Methods

The authors propose the COT framework, which introduces three novel components to the standard Transformer-style encoder (specifically GPT-2 medium):

  • Optimal Transport Kernel (OTK): This module uses Optimal Transport (OT) theory to "pull" the representation of the hatred target (e.g., "MIGRANTS") into the token representations of the generated response. OT finds the most efficient way to align these two distributions, ensuring the model stays "on-topic" regarding the specific victim group.
  • Self-Contrastive Learning (SC): To fight the "degeneration" problem, the authors implement a push-and-pull mechanism in the embedding space. It encourages the model to create an anisotropic distribution—essentially pushing apart the representations of different tokens to prevent the model from getting stuck in repetitive word cycles.
  • Target-Oriented Search (TOS): This is a new decoding strategy used during inference. Instead of just picking the most probable next word, the model calculates a combined score based on:
  • Model Confidence: How likely the word is.
  • Degeneration Penalty: A penalty for words too similar to what was just generated.
  • Relevance Encouragement: A bonus for words semantically related to the hatred target.

Datasets

The model was evaluated on two major benchmarks:

  • Multitarget-CONAN: 5,000 hate speech/counter-narrative pairs where responses were written or edited by expert NGO operators. It covers seven target categories (Women, LGBT+, Muslims, etc.).
  • Reddit: A larger, noisier dataset of 14,286 pairs collected from real-world social media interactions, where counter-narratives were written by Amazon Mechanical Turk workers.

Key Insights and Ideas

  • Optimal Transport as an Alignment Tool: The "aha moment" here is applying OT—traditionally used in computer vision for image alignment—to force a language model to maintain "target interaction." It ensures the counter-narrative isn't just fluent, but specifically defends the group being attacked.
  • The Sparsity of Similarity: By using contrastive learning, the model produces a "sparse token similarity matrix." In plain English: the model learns that words in a sentence should be distinct and meaningful, which naturally kills off the "I think... I think... I think..." repetition bug.
  • The "Safety Filter" Paradox: In a fascinating qualitative analysis, the authors found that while massive LLMs like ChatGPT/GPT-4 are capable, they are often too restricted by safety filters. When given hate speech as an input to generate a counter-narrative, these models sometimes refuse to respond at all, whereas the supervised COT model provides a stable, helpful intervention.

Key Results

The COT model outperformed previous state-of-the-art models (like SimCTG) across nearly all metrics:

  • Higher Accuracy & Relevance: On the CONAN dataset, COT achieved a BLEU-4 score of 15.73, a significant jump over the previous best of 10.47.
  • Diversity and Novelty: The model showed a marked improvement in Diversity (D) and Novelty (N) scores, proving it wasn't just memorizing the training data but generating fresh arguments.
  • Qualitative Superiority: Case studies showed that while GPT-2 might respond to "Migrants rape our women" with a generic statement about abuse, COT specifically addressed the target: "The problem is violence against women, not migrants... Rape is a crime regardless of immigration status."

Limitations and Future Work

  • Data Quality Sensitivity: Performance dropped slightly on the Reddit dataset compared to CONAN, suggesting the model is sensitive to the quality and "noise" of the training pairs.
  • Scaling to Larger LLMs: The current work uses GPT-2 medium as a base. The authors suggest that their OT and contrastive strategies could be adapted to even larger models (like Llama or GPT-4) to combine massive world knowledge with targeted counter-narrative precision.
  • Real-world Deployment: The paper focuses on generation and evaluation but does not discuss the infrastructure needed to deploy such a model as a real-time "intervention bot" on social 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