Weigh Your Own Words: Improving Hate Speech Counter Narrative Generation via Attention Regularization (2023)

Abstract: Recent computational approaches for combating online hate speech involve the automatic generation of counter narratives by adapting Pretrained Transformer-based Language Models (PLMs) with human-curated data. This process, however, can produce in-domain overfitting, resulting in models generating acceptable narratives only for hatred similar to training data, with little portability to other targets or to real-world toxic language. This paper introduces novel attention regularization methodologies to improve the generalization capabilities of PLMs for counter narratives generation. Overfitting to training-specific terms is then discouraged, resulting in more diverse and richer narratives. We experiment with two attention-based regularization techniques on a benchmark English dataset. Regularized models produce better counter narratives than state-of-the-art approaches in most cases, both in terms of automatic metrics and human evaluation, especially when hateful targets are not present in the training data. This work paves the way for better and more flexible counter-speech generation models, a task for which datasets are highly challenging to produce.

## introduction counter narratives (cns) are an effective way to contrast hate speech as they are defined as "communicative actions aimed at refuting hate speech through thoughtful and cogent reasons, and true and fact-bound arguments" @xcite . in contrast to other widely used restrictive measures such as content removal and shadowbanning, cns are based on the assumption that in order to combat hate speech, more speech is required. they are typically employed by non-governmental organizations (ngos) as an active strategy to intervene in online discussions where hateful content is present. responding to micro and macro-aggressions with concrete action is critical because it can make such aggressions visible, disarm them, educate the perpetrators, and allow for external support @xcite . in particular, the key to the effectiveness of cns is their specificity: they are more complex than a simple condemnation of profanity, and they include a variety of arguments @xcite . still, the massive amount of hate that is constantly produced online necessitates the development of automatic cn generation techniques. typically, this is done by fine-tuning a pretrained language model (plm) on human-curated data, such as gpt-2 @xcite . however, prior research has demonstrated that plms are susceptible to generating unspecific cns that can technically work with any input but have questionable content and informativeness @xcite . we hypothesize that overfitting to training-specific terms is a possible cause of this behavior, as demonstrated for the task of hate speech detection @xcite . in order to overcome this issue, this paper proposes two attention-based regularization approaches applied to a widely employed cn generation model on a benchmark english dataset @xcite . the first strategy adapts to the generation scenario the entropy-based attention regularization (ear; @xcite , where the regularization term aims to maximize each token's attention entropy. then, we introduce a novel regularization technique called kullback-leibler attention regularization (klar), which makes the model pay particular attention to specific tokens connected to the stereotyped portrait of the minority targets. figure 1 shows an example of how attention regularization (ear in this case) can induce the generation of richer cns. the terms highlighted in the hs bubbles indicate where a cn generation model focuses its attention during generation. 1 the state-of-the-art cn generation model (top) poses the highest attention to the identity term "migrant", resulting in a vague response that would work with any hate speech targeting migrants. by redistributing the model's attention with the proposed attention regularization techniques (bottom), the focus shifts to include a broader context, resulting in the generation of a more specific and factually asserted cn. moreover, we also assess the generalization abilities of the regularized models through a leave one target out (loto) generation experiment. the results show that cns generated with regularized models obtain better scores on standard automatic metrics, and they are considered more specific by human annotators, especially in loto settings. this is indicative of the robust settings of our proposed strategies. code is available at https://github.com/milanlproc/ weigh-your-own-words . ## attention distribution in cn generation attention is crucial in transformer language models. loosely speaking, it regulates contextualization of representations, i.e., how much of the context every token uses in its next-layer representation. such quantity is dictated by attention weights: a higher weight will make a model focus more on a specific token, whereas zeroing out a token's attention will result in removing that contextual information. attention weights typically result from a training stage driven by data and a task objective, for example fine-tuning on a parallel corpus of hate speech and counter narratives. however, we hypothesize such a choice is sub-optimal and can lead to generic counter speech. this section shortly reviews the role of attention in transformer lms ( §2.1) and describes a preliminary study on attention distributions in cn generation models ( §2.2). ## attention regularization for counter narrative generation this section presents the two proposed regularization solutions to steer models toward the generation of more specific counter narratives. ## cn generation results this section discusses the outcomes of both experiments, as well as the circumstances under which regularization of the cn generation task is appropriate. some examples of the generations are shown in in-target generation regarding the contrastive search setup, klar achieves the highest degree of overlap with gold data. this comes at the expense of the rr and specificity, where it performs second best. in general, the highest suitableness and average rank indicate an overall better quality of cns generated with klar. with beam search, the results obtained by the various configurations on the overlap scores are similar. this may be due to the stricter probability constraint imposed by the beam search decoding on the generation: the deterministic sampling is most likely causing similarly good word choices despite the performed regularization. however, a clearer pattern emerges if we consider the human evaluation scores: for all the evaluated dimensions, ear obtains the best scores. this again comes at the expense of a marginally higher rr. leave one target out generation in ## conclusion in this work, we proposed two novel regularization techniques for the task of counter narrative generation. our aim is to avoid plm's tendency to overfit to specific terms, thereby producing vague and thus ineffective counter narratives, as evidenced by our preliminary analysis. to the best of our knowledge, this is the first time that based attention regularization is employed for improving cn generation. we also make a novel contribution by introducing the kullback-leibler attention regularization (klar). results show that human annotators tend to consider cns generated with regularized models more specific and suitable in most cases, especially in out-of-target settings. cns obtained by regularized models also have better scores on standard automatic metrics. this work can be considered as an initial step towards a more adaptable generation of cns.