A Neighborhood Framework for Resource-Lean Content Flagging (2022)

Abstract: We propose a novel framework for cross- lingual content flagging with limited target- language data, which significantly outperforms prior work in terms of predictive performance. The framework is based on a nearest-neighbor architecture. It is a modern instantiation of the vanilla k-nearest neighbor model, as we use Transformer representations in all its components. Our framework can adapt to new source- language instances, without the need to be retrained from scratch. Unlike prior work on neighborhood-based approaches, we encode the neighborhood information based on query– neighbor interactions. We propose two encoding schemes and we show their effectiveness using both qualitative and quantitative analysis. Our evaluation results on eight languages from two different datasets for abusive language detection show sizable improvements of up to 9.5 F1 points absolute (for Italian) over strong baselines. On average, we achieve 3.6 absolute F1 points of improvement for the three languages in the Jigsaw Multilingual dataset and 2.14 points for the WUL dataset.

## introduction online content moderation is an increasingly important problem-small-scale websites and large-scale corporations alike strive to remove harmful content from their platforms @xcite @xcite . this is partly in anticipation of proposed legislation, such as the digital service act @xcite in the eu and the online harms bill (uk government, 2020) in the uk. moreover, the lack of content moderation can have significant impact on businesses (e.g., parler was denied server space), on governments * work done prior to joining amazon (e.g., the u.s. capitol riots), and on individuals (e.g., because hate speech is linked to self-harm @xcite ). a key challenge when developing content moderation systems is the lack of resources for many languages (other than english). with this in mind, here we aim to create a content flagging model for a target language with limited annotated data by transferring knowledge from another dataset in a different language, for which a large amount of training data is available. various approaches have been proposed in the literature to address the lack of enough training data in the target language. a popular approach is to fine-tune large-scale pre-trained multilingual language models such as xlm @xcite , xlm-r @xcite , or mbert @xcite on the target dataset @xcite . in order to incorporate knowledge from the source dataset, a sequential adaptation technique can be used that first fine-tunes a multilingual language model (lm) on the source dataset, and then on the target dataset @xcite . there are also existing approaches for mixing the source and the target datasets @xcite in different proportions, followed by fine-tuning the multilingual language model on the resulting dataset. while sequential adaptation introduces the risk of forgetting the knowledge from the source dataset, such mixing methods are driven by heuristics that are effective, but not systematic. crucially, as we argue in this paper, this is because they do not model the relationship between the source and the target datasets. another problem arises if we consider that examples with novel labels can be added to the source dataset. this is a specifically pertinent issue for content moderation, as efforts to create new resources often lead to the introduction of new label inventories or taxonomies @xcite . in that case, model re-training becomes a requirement in order to be able to map the new label space to the output layer that is used for fine-tuning. we propose a transformer-based k-nearest neighbor (knn + ) framework, 1 a one-stop solution and a significant improvement over the vanilla knn model. our framework addresses the abovementioned challenges, which are not easy to solve via simple fine-tuning of pre-trained language models. moreover, to the best of our knowledge, our framework is the first attempt to use knn for transfer learning for the task of abusive content detection. given a query, which is a training or an evaluation data point from the target dataset, knn + retrieves its nearest neighbors using a languageagnostic sentence embedding model. then, it constructs transformer representations for the query and for its neighbors. after that, it computes interaction features, which are based on the interactions of the representations of the query with each of its neighbors. 2 at training time, the interaction features are optimized using supervised training signals computed from the label of the query and the neighbor, so that the features indicate their level of agreement. for example, if the query and its neighbor are both abusive, they agree on the labels. thus, the interactions help the model learn a semantic similarity space in terms of labels. the framework further uses a self-attention mechanism to aggregate the interaction features from all the neighbors, and it uses the aggregated representation to classify the input query. this representation is computed from the interaction features and indicates the agreement of the query with the neighborhood. as the predictions are made based on aggregated interaction features only, knn + can easily incorporate new examples with unseen labels without requiring re-training. the conceptual framework is shown in figure 1 ; it is robust to neighbors with incorrect labels, as it can learn to disagree with them as part of its training process. we instantiate two variants of our framework: cross-encoder (ce) knn + and bi-encoder (be) 1 we use a '+' superscript to indicate that our knn + framework is an improvement over the vanilla knn model. 2 we borrow the terminology from information retrieval, as the interactions between a query and a document in deep matching models are computed in a similar way @xcite . knn + . the ce knn + concatenates the query and a neighbor, and passes that sequence through a transformer to obtain interaction features. be knn + computes representations of the query and of a neighbor by passing them individually through a transformer, and computes interaction features from these representations. be knn + is more efficient than ce knn + , but it does not yield the same performance gains. both models outperform six strong baselines both in cross-lingual and in multilingual settings. our contributions can be summarized as follows: ## knn + framework we present our knn + framework below. ## conclusion and future work we proposed knn + , a novel framework for crosslingual content flagging, which significantly out-performs strong baselines with limited training data in the target language. we further demonstrated the effectiveness of our framework in a multilingual scenario, where a test data point can be in turkish, italian, or spanish. moreover, we provided a qualitative analysis of the representations learned by our proposed be knn + framework, and we demonstrated that, in the learned representation space, flagged content stays close to flagged content, while non-flagged stays close to non-flagged content. our framework computes a neighborhood representation for a query using an attention mechanism, thus indicating the influence of each individual neighbor. this and the knn-based architecture offer an opportunity to obtain an explanation for the individual model predictions, and such explanations can be based not only on the textual content of the influential neighbors, but also on their original fine-grained labels. in future work, we plan to understand the viability of such explanations in a user study. we also plan to evaluate our framework on other content flagging tasks, e.g., for detecting harmful memes @xcite , as the framework is not limited to abusive content detection.