Add Batch 1637e409-0e46-45a8-9e9a-7f16942c003d
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- debiasingmasksanewframeworkforshortcutmitigationinnlu/0cdf5ad0-de25-4a7b-836a-9a57555d069c_content_list.json +3 -0
- debiasingmasksanewframeworkforshortcutmitigationinnlu/0cdf5ad0-de25-4a7b-836a-9a57555d069c_model.json +3 -0
- debiasingmasksanewframeworkforshortcutmitigationinnlu/0cdf5ad0-de25-4a7b-836a-9a57555d069c_origin.pdf +3 -0
- debiasingmasksanewframeworkforshortcutmitigationinnlu/full.md +191 -0
- debiasingmasksanewframeworkforshortcutmitigationinnlu/images.zip +3 -0
- debiasingmasksanewframeworkforshortcutmitigationinnlu/layout.json +3 -0
- debiasingpretrainedtextencodersbypayingattentiontopayingattention/f12aefb5-3745-4794-91fc-30a082dc34ab_content_list.json +3 -0
- debiasingpretrainedtextencodersbypayingattentiontopayingattention/f12aefb5-3745-4794-91fc-30a082dc34ab_model.json +3 -0
- debiasingpretrainedtextencodersbypayingattentiontopayingattention/f12aefb5-3745-4794-91fc-30a082dc34ab_origin.pdf +3 -0
- debiasingpretrainedtextencodersbypayingattentiontopayingattention/full.md +474 -0
- debiasingpretrainedtextencodersbypayingattentiontopayingattention/images.zip +3 -0
- debiasingpretrainedtextencodersbypayingattentiontopayingattention/layout.json +3 -0
- decodinganeuralretrieverslatentspaceforquerysuggestion/60f3a764-4e2b-45bc-a396-98a74aed5b7b_content_list.json +3 -0
- decodinganeuralretrieverslatentspaceforquerysuggestion/60f3a764-4e2b-45bc-a396-98a74aed5b7b_model.json +3 -0
- decodinganeuralretrieverslatentspaceforquerysuggestion/60f3a764-4e2b-45bc-a396-98a74aed5b7b_origin.pdf +3 -0
- decodinganeuralretrieverslatentspaceforquerysuggestion/full.md +499 -0
- decodinganeuralretrieverslatentspaceforquerysuggestion/images.zip +3 -0
- decodinganeuralretrieverslatentspaceforquerysuggestion/layout.json +3 -0
- deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/b1a5f9bf-ce66-4ad3-a038-fc1f5fe3d891_content_list.json +3 -0
- deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/b1a5f9bf-ce66-4ad3-a038-fc1f5fe3d891_model.json +3 -0
- deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/b1a5f9bf-ce66-4ad3-a038-fc1f5fe3d891_origin.pdf +3 -0
- deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/full.md +417 -0
- deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/images.zip +3 -0
- deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/layout.json +3 -0
- detectinglabelerrorsbyusingpretrainedlanguagemodels/6a586241-5a85-4d3a-9a9f-6eb4fc2015c3_content_list.json +3 -0
- detectinglabelerrorsbyusingpretrainedlanguagemodels/6a586241-5a85-4d3a-9a9f-6eb4fc2015c3_model.json +3 -0
- detectinglabelerrorsbyusingpretrainedlanguagemodels/6a586241-5a85-4d3a-9a9f-6eb4fc2015c3_origin.pdf +3 -0
- detectinglabelerrorsbyusingpretrainedlanguagemodels/full.md +452 -0
- detectinglabelerrorsbyusingpretrainedlanguagemodels/images.zip +3 -0
- detectinglabelerrorsbyusingpretrainedlanguagemodels/layout.json +3 -0
- dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/8f34bcb5-3355-4574-97b3-f2b25a8107cd_content_list.json +3 -0
- dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/8f34bcb5-3355-4574-97b3-f2b25a8107cd_model.json +3 -0
- dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/8f34bcb5-3355-4574-97b3-f2b25a8107cd_origin.pdf +3 -0
- dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/full.md +346 -0
- dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/images.zip +3 -0
- dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/layout.json +3 -0
- dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/9d769241-d32a-497e-b955-7e3ec652b4d9_content_list.json +3 -0
- dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/9d769241-d32a-497e-b955-7e3ec652b4d9_model.json +3 -0
- dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/9d769241-d32a-497e-b955-7e3ec652b4d9_origin.pdf +3 -0
- dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/full.md +331 -0
- dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/images.zip +3 -0
- dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/layout.json +3 -0
- dictionaryassistedsupervisedcontrastivelearning/9f0f0466-a979-45df-aae4-a528f89ede32_content_list.json +3 -0
- dictionaryassistedsupervisedcontrastivelearning/9f0f0466-a979-45df-aae4-a528f89ede32_model.json +3 -0
- dictionaryassistedsupervisedcontrastivelearning/9f0f0466-a979-45df-aae4-a528f89ede32_origin.pdf +3 -0
- dictionaryassistedsupervisedcontrastivelearning/full.md +487 -0
- dictionaryassistedsupervisedcontrastivelearning/images.zip +3 -0
- dictionaryassistedsupervisedcontrastivelearning/layout.json +3 -0
- differentiabledataaugmentationforcontrastivesentencerepresentationlearning/0b9de31a-e330-433b-b996-a1ca7bf3d3fc_content_list.json +3 -0
- differentiabledataaugmentationforcontrastivesentencerepresentationlearning/0b9de31a-e330-433b-b996-a1ca7bf3d3fc_model.json +3 -0
debiasingmasksanewframeworkforshortcutmitigationinnlu/0cdf5ad0-de25-4a7b-836a-9a57555d069c_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7360b642dcf78751e966400cd37c77d1c197a13db1d9ba7f6b5ff8486d5f625d
|
| 3 |
+
size 46109
|
debiasingmasksanewframeworkforshortcutmitigationinnlu/0cdf5ad0-de25-4a7b-836a-9a57555d069c_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c6f54051a16899ec32b3c30f47f9ac6da3e26ae4f74b46661d7f972e16d01a1
|
| 3 |
+
size 55790
|
debiasingmasksanewframeworkforshortcutmitigationinnlu/0cdf5ad0-de25-4a7b-836a-9a57555d069c_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3780f9cb99e745b7fce0a9ac09af23fcbdfdeddd28657e2e8ed49c588eaa910e
|
| 3 |
+
size 204976
|
debiasingmasksanewframeworkforshortcutmitigationinnlu/full.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Debiasing Masks:
|
| 2 |
+
|
| 3 |
+
# A New Framework for Shortcut Mitigation in NLU
|
| 4 |
+
|
| 5 |
+
Johannes Mario Meissner†, Saku Sugawara‡, Akiko Aizawa†‡
|
| 6 |
+
|
| 7 |
+
†The University of Tokyo, ‡National Institute of Informatics
|
| 8 |
+
|
| 9 |
+
{meissner,saku,aizawa}@nii.ac.jp
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Debiasing language models from unwanted behaviors in Natural Language Understanding tasks is a topic with rapidly increasing interest in the NLP community. Spurious statistical correlations in the data allow models to perform shortcuts and avoid uncovering more advanced and desirable linguistic features. A multitude of effective debiasing approaches has been proposed, but flexibility remains a major issue. For the most part, models must be retrained to find a new set of weights with debiased behavior. We propose a new debiasing method in which we identify debiased pruning masks that can be applied to a finetuned model. This enables the selective and conditional application of debiasing behaviors. We assume that bias is caused by a certain subset of weights in the network; our method is, in essence, a mask search to identify and remove biased weights. Our masks show equivalent or superior performance to the standard counterparts, while offering important benefits. Pruning masks can be stored with high efficiency in memory, and it becomes possible to switch among several debiasing behaviors (or revert back to the original biased model) at inference time. Finally, it opens the doors to further research on how biases are acquired by studying the generated masks. For example, we observed that the early layers and attention heads were pruned more aggressively, possibly hinting towards the location in which biases may be encoded.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
The issue of spurious correlations in natural language understanding datasets has been extensively studied in recent years (Gururangan et al., 2018; McCoy et al., 2019; Gardner et al., 2021). In the MNLI dataset (Williams et al., 2018), negation words such as "not" are unintended hints for the contradiction label (Gururangan et al., 2018), while a high word overlap between the premise and the hypothesis often correlates with entailment (McCoy et al., 2019).
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: We find masks that remove bias from a finetuned model by using frozen-weight movement pruning.
|
| 21 |
+
|
| 22 |
+
A common way to prevent the acquisition of biases (in this paper defined as unintended shortcut behaviors) is to adopt a debiasing loss function, such as product-of-experts (Hinton, 2002), to discourage learning shortcuts through the use of the annotated level of bias in each sample. Because manual bias annotation is difficult and expensive, the predictions of a biased model are used as bias annotations (Clark et al., 2019). Commonly, models must be retrained to achieve debiased behavior; this limits our ability to target different biases separately, as well as choose varied levels of debiasing strength (which impacts the in- vs. out-of-distribution trade-off).
|
| 23 |
+
|
| 24 |
+
We propose a new debiasing framework that focuses on removing bias from an existing model, instead of the now-common approach of re-training from scratch. Our approach is depicted in Figure 1. We find a pruning mask that zeroes out the weights that cause biased outputs, producing the desired effect without altering the original model. This
|
| 25 |
+
|
| 26 |
+
approach offers several clear advantages. First, pruning masks can be stored very efficiently, only occupying a fraction of the original model size. This enables creating multiple masks for varied debiasing behaviors. Secondly, masks can be effortlessly set or unset at inference time, as opposed to replacing the entire model. This allows for flexible application, as well as easy reversion to the original model when needed. Finally, re-framing the debiasing process as a mask search opens the doors towards future analysis directions, helping to more deeply understand how biases are learned, and how they can be eliminated.
|
| 27 |
+
|
| 28 |
+
# 2 Related Work
|
| 29 |
+
|
| 30 |
+
# 2.1 Shortcuts in NLU
|
| 31 |
+
|
| 32 |
+
The study of shortcut solutions in machine learning (Geirhos et al., 2020; D'Amour et al., 2020) has gained attention in recent years, including in the field of Natural Language Understanding. In SQuAD (Rajpurkar et al., 2016), Jia and Liang (2017) show that distractor sentences can be inserted in such a way that the frequently used spurious features mislead the model's answer. In MNLI, Gardner et al. (2021) discuss the idea that all simple feature-label correlations should be regarded as spurious. Their results go in line with Gururan-gan et al. (2018), who show that models are able to achieve strong performance just by training on the hypothesis, a scenario where the desirable advanced features are not available. Instead, simple word correlations are used to make the prediction. Finally, other kinds of features such as lexical overlap have been pointed out as important shortcuts (McCoy et al., 2019).
|
| 33 |
+
|
| 34 |
+
# 2.2 Debiasing
|
| 35 |
+
|
| 36 |
+
A wide range of debiasing approaches have been proposed to alleviate shortcut behavior. For example, perturbations in the model's embedding space can encourage robustness to shortcuts (Liu et al., 2020), and training on adversarial data (Wang and Bansal, 2018) has important benefits for generalization capabilities too. Removing a certain subset in the training data (filtering) can help to avoid learning spurious correlations. Bras et al. (2020) devise an algorithm that selects samples to filter out, reducing the training time and robustness of the target model.
|
| 37 |
+
|
| 38 |
+
We will focus our efforts on a family of approaches that rely on a debiasing loss function to
|
| 39 |
+
|
| 40 |
+
discourage biased learning, instead of altering the original training data. A wide range of debiasing losses have been proposed to discourage shortcut learning. They all rely on having a measure of the level of bias for each training sample, which is commonly obtained via a biased model's predictions. Among the most common are product-of-experts and focal loss (Schuster et al., 2019). Other approaches introduce a higher level of complexity, such as confidence regularization (Utama et al., 2020a) requiring a teacher model, or learned-mixin (Clark et al., 2019) introducing an additional noise parameter.
|
| 41 |
+
|
| 42 |
+
# 2.3 Pruning
|
| 43 |
+
|
| 44 |
+
Pruning consists in masking out or completely removing weights in a neural network, such that they no longer contribute to the output. Common goals include reducing the model size or achieving an inference speed-up.
|
| 45 |
+
|
| 46 |
+
Magnitude pruning is a basic pruning method that removes weights based on their absolute value. It has proven to be an effective method to reduce model size without compromising on performance. Gordon et al. (2020) apply this technique on transformer language models. Movement pruning, on the other hand, was proposed by Sanh et al. (2020), and involves training a score value alongside each weight. Scores are updated as part of the optimization process, and weights with an associated score below the threshold are masked out.
|
| 47 |
+
|
| 48 |
+
Zhao et al. (2020) introduce an alternative to the usual finetuning process by finding a mask for the pretrained base model such that performance on the target task increases. The same base model can be used with several masks to perform multiple tasks. They show that this approach achieves similar performance to standard finetuning on the GLUE tasks (Wang et al., 2018).
|
| 49 |
+
|
| 50 |
+
Our work is inspired by Zhao et al. (2020); but we focus on removing biases from an already finetuned model. We will refer to this method as a mask search. It benefits from the same advantages: masks can be easily applied and removed from a shared base model, while additionally offering storage improvements.
|
| 51 |
+
|
| 52 |
+
# 3 Masked Debiasing
|
| 53 |
+
|
| 54 |
+
Our proposed approach to debiasing takes a unique point of view in the debiasing field by assuming that biased behavior is encoded in specific weights
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: Pruning rate for each module in one of our debiasing masks.
|
| 58 |
+
|
| 59 |
+
of the network and can be removed without altering the remaining weights. Thus, we perform a mask search to identify and remove those weights, experiencing debiased behavior in the resulting model. Our approach comes together by combining a debiasing loss, a biased model, and a score-based pruning technique.
|
| 60 |
+
|
| 61 |
+
Debiasing Loss Among the debiasing losses mentioned in Section 2.2, none appear to be clearly superior, each offering certain strengths and weaknesses, and striking a balance between in- and out-of-distribution performance. We err on the side of simplicity and run our experiments with the focal loss. We follow Clark et al. (2019) for the implementation.
|
| 62 |
+
|
| 63 |
+
Bias Model To utilize a debiasing loss, we must obtain the predictions of a biased model on the training samples. We utilize weak learners, following the nomenclature introduced by Sanh et al. (2021); they do not require making any assumptions on the underlying biases. While our method works with any debiasing loss and bias level source, we choose this setting due to its flexibility and adaptability to new scenarios.
|
| 64 |
+
|
| 65 |
+
To date, two major learners have been proposed: undertrained (Utama et al., 2020b) and underparameterized (Sanh et al., 2021) learners. We train and extract the predictions of both of them for comparison. Undertrained learners are trained by selecting a very small subset of the training data, but keeping the target model's architecture and hyperparameters. This effectively translates into a model that overfits on the selected data subset. Features uncovered by the model in this manner are deemed spurious, as it is assumed that more advanced features require exploring larger quantities of data. We
|
| 66 |
+
|
| 67 |
+
used 2000 samples for MNLI, and 500 samples for the other datasets. Underparameterized learners, on the other hand, restrict the model complexity by reducing layer size and count. The expectation is that this underparameterization is restrictive and limits the ability to find complex features. We use BERT-Tiny (Turc et al., 2019), a BERT model with 2 layers and an inner size of 128.
|
| 68 |
+
|
| 69 |
+
Frozen Movement Pruning Our approach is similar to Zhao et al. (2020); but we implement it by leveraging the framework provided by Sanh et al. (2020), with the addition of weight-freezing. We use unstructured pruning, which means that each individual weight is considered for exclusion. Further, we utilize a threshold approach: in each weight tensor we remove (mask out) those weights with an associated score that is lower than the threshold. A regularization term for the scores helps avoid all scores growing larger than the threshold. For further details, we refer the reader to Sanh et al. (2020). As the starting point, we load a model already finetuned on the target task.
|
| 70 |
+
|
| 71 |
+
# 4 Experimental Setup
|
| 72 |
+
|
| 73 |
+
We compare our approach against the standard approach of re-training the model with a debiasing loss. Our experiments are carried out with BERT-Base (Devlin et al., 2019).
|
| 74 |
+
|
| 75 |
+
# 4.1 Tasks and Evaluation Scenarios
|
| 76 |
+
|
| 77 |
+
We perform experiments on three tasks in NLU, and consider several biases and evaluation datasets.
|
| 78 |
+
|
| 79 |
+
Natural Language Inference (NLI) This task consists in classifying whether the relationship between a pair of sentences (premise and hypothesis) is entailed, neutral or contradicted. We evaluate on two well-known biases: lexical overlap bias (McCoy et al., 2019) and negation words bias (Gururangan et al., 2018). We train on MNLI, and evaluate on HANS (McCoy et al., 2019) and our own negation-words subset. HANS can be used to evaluate the lexical overlap bias. Additionally, we create our own negation-words anti-bias set by selecting entailed samples from the MNLI validation set that contain negation words in the hypothesis.<sup>1</sup>
|
| 80 |
+
|
| 81 |
+
<table><tr><td></td><td colspan="3">MNLI</td><td colspan="3">QQP</td><td colspan="2">FEVER</td></tr><tr><td></td><td>Val.</td><td>HANS</td><td>Neg.</td><td>Val.</td><td>PAWS</td><td>PAWS (¬)</td><td>Val.</td><td>Symm.</td></tr><tr><td>Baseline</td><td>84.38</td><td>61.97</td><td>78.47</td><td>92.07</td><td>44.28</td><td>23.37</td><td>85.67</td><td>64.08</td></tr><tr><td>Masking w/o Debiasing</td><td>83.15</td><td>64.16</td><td>77.87</td><td>90.91</td><td>37.61</td><td>16.38</td><td>84.71</td><td>63.26</td></tr><tr><td>Undertrained SD</td><td>81.02</td><td>67.06</td><td>74.82</td><td>-</td><td>-</td><td>-</td><td>86.54</td><td>65.06</td></tr><tr><td>Underparam. SD</td><td>83.03</td><td>67.75</td><td>72.36</td><td>88.79</td><td>43.50</td><td>27.16</td><td>85.70</td><td>65.79</td></tr><tr><td>Undertrained MD (Ours)</td><td>81.85</td><td>68.69</td><td>75.58</td><td>-</td><td>-</td><td>-</td><td>84.55</td><td>64.85</td></tr><tr><td>Underparam. MD (Ours)</td><td>82.24</td><td>67.86</td><td>73.95</td><td>89.61</td><td>44.34</td><td>28.56</td><td>84.96</td><td>63.37</td></tr><tr><td>HypOnly MD (Ours)</td><td>82.87</td><td>64.26</td><td>79.03</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></table>
|
| 82 |
+
|
| 83 |
+
Table 1: Our experimental results comparing a BERT-Base baseline against several debiasing methods, along with our own mask debiasing approach. SD stands for standard debiasing, while MD stands for masked debiasing. MNLI Neg. is our split of the MNLI development set containing at least one negation word in the hypothesis. PAWS $(\neg)$ indicates the subset of PAWS with a negative label (the anti-bias set for lexical overlap in QQP).
|
| 84 |
+
|
| 85 |
+
Paraphrase Identification In this task the goal is to identify whether a pair of sentences are paraphrasing each other or not. We train on QQP (Quora Question Pairs) $^2$ , and evaluate on PAWS (Zhang et al., 2019), which tests the model's reliability on the lexical overlap bias.
|
| 86 |
+
|
| 87 |
+
Fact Verification We train on FEVER (Thorne et al., 2018), and evaluate on FEVER Symmetric (Schuster et al., 2019). The task setup is similar to NLI; we classify a claim-evidence pair as either support, refutes or not-enough-information. FEVER Symmetric eliminates claim-only biases (clues in the claim that allow to guess the label), among which are negation words, in a similar fashion to MNLI.
|
| 88 |
+
|
| 89 |
+
# 4.2 Hyperparameters and Reproducibility
|
| 90 |
+
|
| 91 |
+
We aim for complete reproducibility by providing complete code and clear reproduction instructions in our repository. In most cases, we follow the configurations indicated by the respective original papers. Appendix B is additionally provided for a report of important hyperparameters.
|
| 92 |
+
|
| 93 |
+
We run all of our experiments on five seeds. We not only seed the debiasing masks, but also the accompanying weak models and base models too.
|
| 94 |
+
|
| 95 |
+
# 5 Results
|
| 96 |
+
|
| 97 |
+
We compare our approach against our reproduction of the two weak model approaches, and compile our results in Table 1.
|
| 98 |
+
|
| 99 |
+
$^{2}$ https://www.kaggle.com/c/
|
| 100 |
+
quora-question-pairs
|
| 101 |
+
$^{3}$ https://github.com/mariomeissner/
|
| 102 |
+
shortcut-pruning
|
| 103 |
+
|
| 104 |
+
# 5.1 Masked Debiasing is Effective
|
| 105 |
+
|
| 106 |
+
First, we observe that our debiasing masks are very effective, surpassing the performance of their standard debiasing counterparts in two out of the three evaluated tasks, while keeping a competitive indistribution performance. In the FEVER task, our masks provided a slight debiasing effect, but did not beat the standard debiasing baseline. We do not report undertrained debiasing results in the QQP setting due to their failure to converge to adequate results (in both standard and masked debiasing).
|
| 107 |
+
|
| 108 |
+
To confirm that the combination of masking with a debiasing loss is necessary to achieve our results, we provide an ablation experiment (Masking w/o Debiasing) where the debiasing loss is replaced with the standard cross-entropy loss, while using the same pruning parameters. Results suggest that pruning alone is not able to achieve the same debiasing effect.
|
| 109 |
+
|
| 110 |
+
# 5.2 Masks are Diverse
|
| 111 |
+
|
| 112 |
+
As a means to showcase the capacity of debiasing masks to offer different debiasing behaviors, we refer to each method's capacity to mitigate the negation bias, evaluated by our negation-words subset.
|
| 113 |
+
|
| 114 |
+
As the standard debiasing results reveal, both weak model approaches were unable to improve baseline performance on our subset. Therefore, we used the hypothesis-only bias model, as provided by Utama et al. (2020a). Negation words are strongly correlated with the hypothesis-only bias; accordingly, observe a performance improvement on our subset when leveraging this debiasing target.
|
| 115 |
+
|
| 116 |
+
# 6 Mask Analysis
|
| 117 |
+
|
| 118 |
+
Our pruning approach uses a score threshold, which allows for a dynamic pruning rate across modules. To gain a better understanding on our masks, we study the generated density distribution. Specifically, we study the rate at which weights were removed in different network regions. In each layer, we obtain the pruning rate of the attention layer's query, key, value, and output modules, as well as the two linear modules that follow. We plot the results in Figure 2.
|
| 119 |
+
|
| 120 |
+
We make two general observations. First, pruning rates are relatively higher in the early layers. It is known that the last few layers are very task specific (Tenney et al., 2019), which likely implies that their modification more directly impacts performance. Thus, our masks may be targeting early layers as a means to remove biases without causing a noticeable performance decrease. Secondly, the attention modules are more heavily pruned than the linear layers, which could suggest that attention heads play an important role in bias encoding.
|
| 121 |
+
|
| 122 |
+
# 7 Conclusion
|
| 123 |
+
|
| 124 |
+
We conclude that debiasing masks are an effective approach to mitigating shortcuts. Alongside providing surprisingly well-performing debiased behaviors, masks allow to shift the way we think about debiasing: no longer should biased and unbiased models be treated as two separate models; rather, it becomes possible to "remove" biases by simply eliminating certain weights from the network.
|
| 125 |
+
|
| 126 |
+
# Limitations
|
| 127 |
+
|
| 128 |
+
An important limitation of this approach is that we found it necessary to follow Sanh et al. (2020) and run the movement pruning technique for 12 epochs, requiring longer training time. We hypothesize that in future work, it could become possible to drastically reduce training time for this approach.
|
| 129 |
+
|
| 130 |
+
Further, in this short paper we explored three tasks in NLU with a fixed pruning configuration, but it would be beneficial to explore its applicability to other domains, combine it with other debiasing approaches, or explore more varied configurations, such as structured pruning methods for improved inference efficiency.
|
| 131 |
+
|
| 132 |
+
# Acknowledgments
|
| 133 |
+
|
| 134 |
+
The education period leading to this project has received funding from "la Caixa" Foundation (ID 100010434), under agreement LCF/BQ/AA19/11720042. This work was also supported by JST PRESTO Grant Number JPMJPR20C and JSPS KAKENHI Grant Number 21H03502.
|
| 135 |
+
|
| 136 |
+
# References
|
| 137 |
+
|
| 138 |
+
Ronan Le Bras, Swabha Swayamdipta, Chandra Bhagavatula, Rowan Zellers, Matthew Peters, Ashish Sabharwal, and Yejin Choi. 2020. Adversarial filters of dataset biases.
|
| 139 |
+
Christopher Clark, Mark Yatskar, and Luke Zettlemoyer. 2019. Don't take the easy way out: Ensemble based methods for avoiding known dataset biases. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4069-4082, Hong Kong, China. Association for Computational Linguistics.
|
| 140 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics.
|
| 141 |
+
Alexander D'Amour, Katherine Heller, Dan Moldovan, Ben Adlam, Babak Alipanahi, Alex Beutel, Christina Chen, Jonathan Deaton, Jacob Eisenstein, Matthew D Hoffman, et al. 2020. Underspecification presents challenges for credibility in modern machine learning. Journal of Machine Learning Research.
|
| 142 |
+
Matt Gardner, William Merrill, Jesse Dodge, Matthew Peters, Alexis Ross, Sameer Singh, and Noah A. Smith. 2021. Competency problems: On finding and removing artifacts in language data. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1801-1813, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 143 |
+
Robert Geirhos, Jorn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A Wichmann. 2020. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665-673.
|
| 144 |
+
Mitchell Gordon, Kevin Duh, and Nicholas Andrews. 2020. Compressing BERT: Studying the effects of weight pruning on transfer learning. In Proceedings of the 5th Workshop on Representation Learning for
|
| 145 |
+
|
| 146 |
+
NLP, pages 143-155, Online. Association for Computational Linguistics.
|
| 147 |
+
Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A. Smith. 2018. Annotation artifacts in natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 107-112, New Orleans, Louisiana. Association for Computational Linguistics.
|
| 148 |
+
Geoffrey E Hinton. 2002. Training products of experts by minimizing contrastive divergence. Neural computation, 14(8):1771-1800.
|
| 149 |
+
Robin Jia and Percy Liang. 2017. Adversarial examples for evaluating reading comprehension systems. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2021-2031, Copenhagen, Denmark. Association for Computational Linguistics.
|
| 150 |
+
Xiaodong Liu, Hao Cheng, Pengcheng He, Weizhu Chen, Yu Wang, Hoifung Poon, and Jianfeng Gao. 2020. Adversarial training for large neural language models. arXiv:2004.08994.
|
| 151 |
+
Tom McCoy, Ellie Pavlick, and Tal Linzen. 2019. Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3428-3448, Florence, Italy. Association for Computational Linguistics.
|
| 152 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383-2392, Austin, Texas. Association for Computational Linguistics.
|
| 153 |
+
Victor Sanh, Thomas Wolf, Yonatan Belinkov, and Alexander M Rush. 2021. Learning from others' mistakes: Avoiding dataset biases without modeling them. In International Conference on Learning Representations.
|
| 154 |
+
Victor Sanh, Thomas Wolf, and Alexander M. Rush. 2020. Movement pruning: Adaptive sparsity by fin-tuning. NIPS'20, Red Hook, NY, USA. Curran Associates Inc.
|
| 155 |
+
Tal Schuster, Darsh Shah, Yun Jie Serene Yeo, Daniel Roberto Filizzola Ortiz, Enrico Santus, and Regina Barzilay. 2019. Towards debiasing fact verification models. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3419-3425, Hong Kong, China. Association for Computational Linguistics.
|
| 156 |
+
|
| 157 |
+
Ian Tenney, Dipanjan Das, and Ellie Pavlick. 2019. BERT rediscovers the classical NLP pipeline. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4593-4601, Florence, Italy. Association for Computational Linguistics.
|
| 158 |
+
James Thorne, Andreas Vlachos, Christos Christodoulopoulos, and Arpit Mittal. 2018. FEVER: a large-scale dataset for fact extraction and VERIFICATION. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 809-819, New Orleans, Louisiana. Association for Computational Linguistics.
|
| 159 |
+
Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Well-read students learn better: The impact of student initialization on knowledge distillation. CoRR, abs/1908.08962.
|
| 160 |
+
Prasetya Utama, Nafise Sadat Moosavi, Victor Sanh, and Iryna Gurevych. 2021. Avoiding inference heuristics in few-shot prompt-based finetuning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9063-9074, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 161 |
+
Prasetya Ajie Utama, Nafise Sadat Moosavi, and Iryna Gurevych. 2020a. Mind the trade-off: Debiasing NLU models without degrading the in-distribution performance. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8717-8729, Online. Association for Computational Linguistics.
|
| 162 |
+
Prasetya Ajie Utama, Nafise Sadat Moosavi, and Iryna Gurevych. 2020b. Towards debiasing NLU models from unknown biases. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7597-7610, Online. Association for Computational Linguistics.
|
| 163 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. 2018. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 353-355, Brussels, Belgium. Association for Computational Linguistics.
|
| 164 |
+
Yicheng Wang and Mohit Bansal. 2018. Robust machine comprehension models via adversarial training. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 575-581, New Orleans, Louisiana. Association for Computational Linguistics.
|
| 165 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sen
|
| 166 |
+
|
| 167 |
+
tence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112-1122, New Orleans, Louisiana. Association for Computational Linguistics.
|
| 168 |
+
|
| 169 |
+
Yuan Zhang, Jason Baldridge, and Luheng He. 2019. PAWS: Paraphrase adversaries from word scrambling. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 1298-1308, Minneapolis, Minnesota. Association for Computational Linguistics.
|
| 170 |
+
|
| 171 |
+
Mengjie Zhao, Tao Lin, Fei Mi, Martin Jaggi, and Hinrich Schütze. 2020. Masking as an efficient alternative to finetuning for pretrained language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2226-2241, Online. Association for Computational Linguistics.
|
| 172 |
+
|
| 173 |
+
# A Negation Words
|
| 174 |
+
|
| 175 |
+
Within the MNLI Validation Matched set, we select those entailed samples where at least one of the following words is present in the hypothesis: no, not, don't, none, nothing, never, aren't, isn't, weren't, neither, don't, didn't, doesn't, cannot, hasn't won't.
|
| 176 |
+
|
| 177 |
+
# B Hyperparameters
|
| 178 |
+
|
| 179 |
+
# B.1 Baseline and Debiased Models
|
| 180 |
+
|
| 181 |
+
Our baseline models are trained with a batch size of 32, learning rate of 3e-5, weight decay of 0.1, and $20\%$ warmup steps.
|
| 182 |
+
|
| 183 |
+
# B.2 Weak Learners
|
| 184 |
+
|
| 185 |
+
Undertrained models are trained with the standard BERT architecture and 2000 samples (500 in the case of QQP and FEVER) of the dataset for 5 epochs. Utama et al. (2021) mention 3 in their paper, but train with 5 in their code repository. We confirm that 5 yields better results. For underparameterized models, we follow (Sanh et al., 2021) and use BERT-Tiny (Turc et al., 2019), a BERT model with 2 layers and an inner size of 128. This model is trained on the full training set for 3 epochs, and slightly adjusted hyperparameters.
|
| 186 |
+
|
| 187 |
+
We use focal loss (sample reweighting) in all mask debiasing experiments, with the exception of the HypOnly MD model, which uses product-of-experts (in an attempt to follow Utama et al. (2020a) as closely as possible).
|
| 188 |
+
|
| 189 |
+
# B.3 Masked Debiasing Models
|
| 190 |
+
|
| 191 |
+
Our mask search is performed with a score learning rate of 0.1, batch size of 128, and 12 epochs of training.
|
debiasingmasksanewframeworkforshortcutmitigationinnlu/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74c0e2b0ab592e9dad897552c04ab4ad360a2513f073ba9f8dbdec78b2ee4ec0
|
| 3 |
+
size 151902
|
debiasingmasksanewframeworkforshortcutmitigationinnlu/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2d3740132b18e3213c1fe8ad16761b953b0d32c801587782c30d2b717f7860fd
|
| 3 |
+
size 176636
|
debiasingpretrainedtextencodersbypayingattentiontopayingattention/f12aefb5-3745-4794-91fc-30a082dc34ab_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8aa2c6600cad14a9733a43d85396a66b3acb9e5f64f3f2e7af9ca88e3dcbae82
|
| 3 |
+
size 140720
|
debiasingpretrainedtextencodersbypayingattentiontopayingattention/f12aefb5-3745-4794-91fc-30a082dc34ab_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:66bbaec68331f58a07699e661c29f0966dc557598a81a6775d87f725038d5c99
|
| 3 |
+
size 167500
|
debiasingpretrainedtextencodersbypayingattentiontopayingattention/f12aefb5-3745-4794-91fc-30a082dc34ab_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e5568c7c6d66d8bae734fe40185a0c3c9a21016b4ee6a3e7bc001cd7c5216fb4
|
| 3 |
+
size 864318
|
debiasingpretrainedtextencodersbypayingattentiontopayingattention/full.md
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Debiasing Pretrained Text Encoders by Paying Attention to Paying Attention
|
| 2 |
+
|
| 3 |
+
Yacine Gaci $^{1}$ , Boualem Benatallah $^{2,3}$ , Fabio Casati $^{4}$ , Khalid Benabdeslem $^{1}$
|
| 4 |
+
|
| 5 |
+
$^{1}$ LIRIS - University of Lyon 1, France $^{2}$ Dublin City University, Ireland
|
| 6 |
+
|
| 7 |
+
<sup>3</sup> UNSW, Sydney, Australia <sup>4</sup> ServiceNow, USA
|
| 8 |
+
|
| 9 |
+
{yaccine.gaci, khalid.benabdeslem}@univ-lyon1.fr
|
| 10 |
+
|
| 11 |
+
{boualem.benatallah, fabio.casati}@gmail.com
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Natural Language Processing (NLP) models are found to exhibit discriminatory stereotypes across many social constructs, e.g. gender and race. In comparison to the progress made in reducing bias from static word embeddings, fairness in sentence-level text encoders received little consideration despite their wider applicability in contemporary NLP tasks. In this paper, we propose a debiasing method for pretrained text encoders that both reduces social stereotypes, and inflicts next to no semantic damage. Unlike previous studies that directly manipulate the embeddings, we suggest to dive deeper into the operation of these encoders, and pay more attention to the way they pay attention to different social groups. We find that stereotypes are also encoded in the attention layer. Then, we work on model debiasing by redistributing the attention scores of a text encoder such that it forgets any preference to historically advantaged groups, and attends to all social classes with the same intensity. Our experiments confirm that reducing bias from attention effectively mitigates it from the model's text representations.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
Natural Language Processing (NLP) is increasingly penetrating real-world processes such as recruitment (Hansen et al., 2015), legal systems (Dale, 2019), healthcare (Velupillai et al., 2018) and Web Search (Nalisnick et al., 2016). Part of this success is attributed to the underlying embedding layer which encodes sophisticated semantic representations of language (Camacho-Collados and Pilehvar, 2018). However, this wide adoption has called into question the fairness aspect of modern text encoders. Recent research exposed them for replicating discriminatory social biases which may cause unintended and undesired model behaviors with respect to social groups (Bolukbasi et al., 2016; Caliskan et al., 2017; May et al., 2019). As an
|
| 20 |
+
|
| 21 |
+
example, a resume filtering system built on top of such biased encoders display overly improper preferences towards male applicants (Dastin, 2018).
|
| 22 |
+
|
| 23 |
+
Methods to debias text encoders have recently been proposed, ranging from Counterfactual Data Augmentation (CDA) (Webster et al., 2020), projection on bias-free subspaces (Kaneko and Bollegala, 2021), contrastive learning (Cheng et al., 2020), adversarial attacks (Wang et al., 2021) or simply extending existing debiasing techniques from static word embeddings (Liang et al., 2020a; Bolukbasi et al., 2016; Manzini et al., 2019; Gaci et al., 2022a). However, these methods have shown mixed results, often failing to reduce the amount of bias to a satisfactory degree (Gonen and Goldberg, 2019; Blodgett et al., 2020; Meade et al., 2021). We argue that part of this shortcoming owes to the fact that current debiasing techniques, by operating exclusively on the model's embeddings, are not removing bias entirely. In this paper, we propose that some biases can also be encoded in the attention mechanism, and these stay relatively out of reach for methods that do not manipulate attention directly.
|
| 24 |
+
|
| 25 |
+
To illustrate how biases are reflected in attention, we show some attention heads of BERT (Devlin et al., 2018) in Figure $1^{1}$ . Consider the following sentence "The doctor asked the nurse a question." Aiming to analyze how every word representation relates to different demographics, we add a dummy second input consisting of words representing distinct groups (e.g. he and she after the [SEP] token $^{2}$ ). Figure 1(a) illustrates that doctor pays much more attention to he than to she $^{3}$ , while Figure 1(b) reveals that nurse attends to she. This finding suggests that gender stereotypes are encoded in attention weights. Likewise, in Figure 1(c), math is more related to asian than to white or black,
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
(a)
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
(b)
|
| 32 |
+
Figure 1: Attention patterns in modern text encoders suggest the existence of potential gender and racial biases. Figures (a), (b) and (c) correspond to the base version of BERT, while Figure (d) corresponds to BERT after applying the debiasing method proposed by Kaneko and Bollegala (2021)
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
(c)
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
(d)
|
| 39 |
+
|
| 40 |
+
conforming to the famous racial stereotype casting asians as good mathematicians (Trytten et al., 2012; Shah, 2019). More intriguing is Figure 1(d), where we find that even after applying the bias reduction method proposed by Kaneko and Bollegala (2021), gender bias is still reflected in the attention of the supposedly debiased text encoder. We experimented with other debiasing methods and found similar results. These examples convey that biases can be hidden in the attention mechanism, and thus pose the risk of being recovered in representations and predictions.
|
| 41 |
+
|
| 42 |
+
In this paper, we propose a novel bias measure based on attention weights in order to quantify the amount of bias encoded in attention heads. We show that modern text encoders display substantial amounts of bias in their attention components. Also, we quantitatively show that current debiasing methods do very little to mitigate social stereotypes, and merely conceal them in the attention layer. Then, we propose Attention-Debiasing (AttenD), an attention-based debiasing approach which works as follows: Given that attention weights conform with undesired biases (e.g., doctor attending to he, and nurse to she in Figure 1), we finetune the parameters of the text encoder of interest such that it learns to produce equal attention scores for every word in the input sentence with respect to social groups. Returning to the example of Figure 1, AttenD redistributes attention scores of doctor such that it attends to he and she with the same intensity, thus eliminating any preference toward one of the groups. However, alterations to the attention of doctor on the remaining words of the input sentence must be kept to a minimum in order not to corrupt the semantic understanding of the original text encoder. To do that, we distill the original attentions from an unaltered teacher text encoder
|
| 43 |
+
|
| 44 |
+
(Hinton et al., 2015; Gou et al., 2021). In this setting, we encourage the debiased model to copy the original attention from its teacher to minimize semantic offset.
|
| 45 |
+
|
| 46 |
+
We suggest that by equalizing attention weights, text encoders forget biased associations between groups and attributes. Thus, for a given input sentence, whether it mentions a man or a woman, a muslim or a christian, the model's attention on the mentioned group is the same, which leads to very close text representations, and hence identical predictions. In our experiments, we address gender, racial and religious biases, and show that AttenD not only reduces social stereotypes from the attention layer itself, but also from representations and predictions when applied to the tasks of textual inference and hate speech detection. We release our code and data on GitHub.
|
| 47 |
+
|
| 48 |
+
# 2 Related Work
|
| 49 |
+
|
| 50 |
+
# 2.1 Bias Quantification
|
| 51 |
+
|
| 52 |
+
To date, there are three main approaches to detect stereotypes in text encoders: (1) representation-based: where vector relationships between different types of inputs are measured. For example, Caliskan et al. (2017) and May et al. (2019) compared the cosine similarity between representations of groups and attributes, and found that groups have unequal similarities. (2) likelihood-based: These approaches examine how often text encoders prefer stereotypes over anti-stereotypes. Preferences in this case are defined in terms of higher likelihoods as produced by language models using embeddings of the text encoders under study (Kurita et al., 2019; Nadeem et al., 2020; Nangia et al., 2020; Gaci et al., 2022b). (3) inference
|
| 53 |
+
|
| 54 |
+
based: These methods employ text encoders in downstream NLP tasks (Blodgett et al., 2020) such as natural language inference (Dev et al., 2020), sentiment analysis (Díaz et al., 2018) or language generation (Sap et al., 2020; Sheng et al., 2020). Bias in such settings is declared as the difference in outcome when the models are tested with the same input sentence, differing only in social groups. In contrast, we propose a new metric that quantifies bias that is specifically encoded in the attention layer.
|
| 55 |
+
|
| 56 |
+
# 2.2 Bias Reduction
|
| 57 |
+
|
| 58 |
+
The NLP community has produced a wealth of methods to reduce bias from static word embeddings, spanning diverse techniques such as projections on bias-free dimensions (Bolukbasi et al., 2016; Manzini et al., 2019; Kaneko and Bollegala, 2019; Kumar et al., 2020; Ravfogel et al., 2020), adversarial attacks (Xie et al., 2017; Li et al., 2018; Elazar and Goldberg, 2018; Gaci et al., 2022a), or training from scratch with additional fairness constraints (Zhao et al., 2018). However, debiasing large-scale text encoders has started attracting the community's attention only recently. A lot of effort has focused on extending existing techniques to work for large text encoders. For instance, Liang et al. (2020a) contextualize words into sentences by sampling them from existing corpora before applying the methods of Bolukbasi et al. (2016). Kaneko and Bollegala (2021) minimizes the projection of sentence representations on a learned bias subspace, while Qian et al. (2019); Bordia and Bowman (2019); Liang et al. (2020b) add bias-reduction objectives to their loss functions. Another line of research uses CDA (Webster et al., 2020) to balance gender correlations in training data, while Lauscher et al. (2021) uses adapters to reduce the large training time that CDA incurs. Other debiasing techniques use contrastive learning (Cheng et al., 2020), zero-shot learning (Schick et al., 2021), dropout (Meade et al., 2022), or regularizing the entropy of attention (Attanasio et al., 2022). This last work differs from ours in that they discourage the model from basing its classification on identity terms while attending to a wider context. On the other hand, our goal is to reduce harmful associations to (dis)advantaged groups by calibrating the attention of the context on identity terms. Besides, our method is applied to text encoders as a general representation layer, while the method of
|
| 59 |
+
|
| 60 |
+
Attanasio et al. (2022) is proposed for hate-speech classification models.
|
| 61 |
+
|
| 62 |
+
# 2.3 Effect of Attention
|
| 63 |
+
|
| 64 |
+
Attention plays a central role in modern NLP systems (Wiegreffe and Pinter, 2019). Several techniques have used attention to dissect and explain the inner functioning of text encoders (Vig, 2019b; Clark et al., 2019; Hoover et al., 2020; Tenney et al., 2020; Bastings and Filippova, 2020). However, recent studies argued that attention cannot be used as a reliable tool to explain the behavior of models (Jain and Wallace, 2019; Pruthi et al., 2020; Bastings and Filippova, 2020). In this work, we disagree with these anti-attention studies, and following the arguments of Wiegreffe and Pinter (2019), we emphasize that their limitations include:
|
| 65 |
+
|
| 66 |
+
(1) the experimental setup was particularly limited to recurrent architectures (RNNs). We believe that one cannot generalize the findings to all kinds of models that use attention, especially transformer-based models like the ones we use in this paper, that mainly constitute of attention layers (Vaswani et al., 2017; Devlin et al., 2018). (2) Whether attention explains or not depends on the definition of explainability one is looking for (Lipton, 2018; Rudin, 2019). Although Jain and Wallace (2019) casts some doubt on the notion that attention grants one true and faithful interpretation, we believe they do not invalidate the fact that attention does show which features are most meaningful to models (Wiegreffe and Pinter, 2019). (3) Our own experiments confirm that by reducing bias in attention, we find that it is also reduced in embeddings and predictions. This hints that attention contributes in the decision-making of text encoders.
|
| 67 |
+
|
| 68 |
+
# 3 Bias Quantification Using Attention
|
| 69 |
+
|
| 70 |
+
Despite the applicability of our work on any text encoder that is built upon self-attention, we focus in this paper on models based on the encoder side of the transformer architecture, such as BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019), or ALBERT (Lan et al., 2019). This owes to the decoder side being usually used in auto-regression tasks, and less often to encode text.
|
| 71 |
+
|
| 72 |
+
In this section, we present our metric to compute the amount of bias that is encoded in attention across an entire corpus $\mathbb{S}$ . First, we identify bias types of interest such as gender, race, religion. This is achieved by defining a set of tuples $\mathbb{G}$ for every
|
| 73 |
+
|
| 74 |
+
<table><tr><td>religion</td><td>gender</td></tr><tr><td>muslim, christian, jewish</td><td>he, she</td></tr><tr><td>quran, bible, torah</td><td>man, woman</td></tr></table>
|
| 75 |
+
|
| 76 |
+
Table 1: Examples of group tuples per bias
|
| 77 |
+
|
| 78 |
+
bias type such that $\mathbb{G} = \{\mathcal{T}_1,\mathcal{T}_2,\dots,\mathcal{T}_k\}$ where each $\mathcal{T}_i$ describes social groups, or their attributes. Table 1 shows some possible values for $\mathcal{T}_i$ that we use in our study. Then, for every sentence $s$ in $\mathbb{S}$ , we randomly pick a tuple $\mathcal{T}_i$ from $\mathbb{G}$ and construct $s_g$ , an artificial sentence formed by words of $\mathcal{T}_i$ . For example, given Table 1, $s_g$ can be " muslim, christian, Jewish" or "man, woman". Finally, we use both $s$ and $s_g$ to make two-sentence inputs similar to the examples of Figure 1.
|
| 79 |
+
|
| 80 |
+
After augmenting the corpus with artificial group-related sentences, we feed each augmented input to the text encoder under study, and collect the resulting self-attention weights. Each token in the augmented input distributes its attention on all other tokens according to their importance. Thus, every group in $s_g$ has its own attention allocation, i.e. the vector consisting of attention weights that tokens in $s$ give to the current group token. We declare bias in this case as the difference between attention allocations of groups. In other words, if the sentence distributes its attention on social groups differently (e.g. doctor in Figure 1 attends to he and not to she), then there is bias. Specifically, we measure Pearson correlation between attention allocations of social groups in a given attention head, aggregated over a corpus:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\operatorname {B i a s} (\mathbb {S}, \mathbb {G}) = \frac {1}{| \mathbb {S} | | \mathbb {G} |} \sum_ {s \in \mathbb {S}} \sum_ {s _ {g} \in \mathbb {G}} \frac {1}{\left| \binom {\mathbb {G}} {2} \right|} \sum_ {i, j \in \binom {\mathbb {G}} {2}} \rho \left(A _ {s} ^ {g _ {i}}, A _ {s} ^ {g _ {j}}\right) \tag {1}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\rho$ is Pearson correlation, $\binom{\mathbb{G}}{2}$ produces all possible pairs of social groups given a tuple, $A_{s}^{g_{i}}$ is the attention vector that sentence $s$ allocates to group $g_{i}$ . If this quantity is close to 0, we can say that attention exhibits bias since the average of correlations across sentences and groups is nearly 0. We use the News-commentary-v15 corpus as evaluation data and compute attention bias of BERT. We present the results for each attention head and for each bias type in Figure 2.
|
| 87 |
+
|
| 88 |
+
We observe that BERT's attention heads encode different stereotypes with different intensities, conforming to the findings of Bhardwaj et al. (2021). Also, the lower layers of attention appear to encode more bias than the top layers since their heads are much darker. We believe this to be the consequence of lower layers being more aware of the input tokens, while top layers are fed transformations of the input as it flows through the attention stack.
|
| 89 |
+
|
| 90 |
+
We also compute attention bias on BERT heads after applying different existing debiasing approaches, and present the results for gender bias in Figure 3. When we compare the heatmaps in Figure 3 to the heatmap of Figure 2(a), we notice that they are very similar, and attention bias is hardly removed. In some cases, it is even amplified (e.g. head 3 in layer 10 in Figure 3(a)). We stipulate that even though those debiasing methods show acceptable results with embedding-based bias evaluations, they appear to ignore the bias reflected in attention and thus can be recovered at prediction. In the next section, we present our own debiasing methods that aims to reduce bias from the top $k$ most biased attention heads.
|
| 91 |
+
|
| 92 |
+
# 4 Debiasing Method
|
| 93 |
+
|
| 94 |
+
The first step of AttenD is augmenting each sentence $s$ in the training corpus $\mathbb{S}$ with an artificial second input $s_g$ consisting of words related to groups of a given bias type, as explained in Section 3 and in the examples of Figure 1. Then, we finetune the encoder's parameters such that the top $k$ most biased heads produce equalized attention on groups, i.e. each token in $s$ pays the same amount of attention to tokens of $s_g$ , thus eliminating preferences and stereotypes. We minimize semantic loss by compelling the model to learn the original semantics from an unaltered teacher model by copying its internal attention.
|
| 95 |
+
|
| 96 |
+
We schematize the operation of AttenD in Figure 4. $Gr_{1}, Gr_{2}$ and $Gr_{n}$ in the figure correspond to the tokens of $s_{g}$ . Both matrices represent one attention head of the text encoder before (left) and after (right) debiasing. The matrices should be read in rows. Each row depicts the attention weights of the corresponding token on all the other tokens of the input $(s + s_{g})^{7}$ . The matrices are conceptually split in four blocks: (1) attentions of $s$ on $s$ , (2) attentions of $s$ on $s_{g}$ , (3) attentions of $s_{g}$ on $s$ ,
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
(a)
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
(b)
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
(c)
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
(a)
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 2: Attention bias in BERT base broken out by layer and head. (a) gender, (b) race, (c) religion
|
| 112 |
+
(b)
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
(c)
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Attention bias in BERT base broken out by layer and head after the application of several debiasing methods to reduce gender bias. These debiasing methods are (a) CDA (b) Sent-D (Liang et al., 2020a), (c) Kaneko Kaneko and Bollegala (2021)
|
| 119 |
+
(a)
|
| 120 |
+
Figure 4: Overview of an attention head before (a) and after (b) debiasing
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
(b)
|
| 124 |
+
|
| 125 |
+
and (4) attentions of $s_g$ on $s_g$ . Debiasing consists in making the columns of block 2 equal. In other words, each token in $s$ pays the same amount of attention to all the groups as indicated in the right side of Figure 4. We preserve the semantics of the original text encoder by keeping block 1 of Figure 4 unchanged. Both blocks 3 and 4 are irrelevant to the results, since they denote attentions of our artificially inserted second input $s_g$ . So, we do not impose any restrictions on them. In the following, we describe the important details of AttenD.
|
| 126 |
+
|
| 127 |
+
# 4.1 Equalizing attentions on social groups
|
| 128 |
+
|
| 129 |
+
The rationale behind attention equalization is to eliminate any inclination for the encoder to prefer any social group to the detriment of others. Equalizing attention vectors of block 2 (as defined in Figure 4) is equivalent to making them equal to a pivot vector. In our method, we consider the attention vector of $s$ on the first social group as the pivot (first column in block 2 of Figure 4), and minimize the mean square error between the pivot and the attention vectors of $s$ on the other groups, one at a time. Suppose $\mathbf{A}^{l,h,s,s_g} = Attn(s,s_g;l,h)$ is the attention matrix at layer $l$ , head $h$ of the encoder $E$ , computed from the input $s + s_g$ . The equalization loss is given by Equation 2.
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
L _ {e q u} = \sum_ {s \in \mathbb {S}} \sum_ {l = 1} ^ {L} \sum_ {h = 1} ^ {H} \sum_ {i = 2} ^ {| | s _ {g} | |} | | \mathbf {A} _ {: \sigma , \sigma + 1} ^ {l, h, s, s _ {g}} - \mathbf {A} _ {: \sigma , \sigma + i} ^ {l, h, s, s _ {g}} | | _ {2} ^ {2} \tag {2}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where $L$ is the number of layers of the text encoder, $H$ the number of heads, $\| s_g\|$ the number of social groups in $s_g$ and $\sigma$ is the position of the special token [SEP] that marks the end of $s$ and the beginning of $s_g$ . As can be seen, $\mathbf{A}_{: \sigma, \sigma + 1}^{l, h, s, s_g}$ is the
|
| 136 |
+
|
| 137 |
+
pivot vector containing attention scores of $s$ on the first social group token (whose position is directly after [SEP], i.e., $\sigma + 1$ ). Equation 2 forces attention scores on subsequent social groups to be the same as on the first one, thus making them all equal. We also experiment with choosing the last group as pivot, or pick one at random. We find that these alternatives produce comparable results.
|
| 138 |
+
|
| 139 |
+
# 4.2 Preserving semantic information
|
| 140 |
+
|
| 141 |
+
We minimize semantic information loss in a knowledge distillation setting, where we recruit another model to be the teacher, and cast the text encoder that we want to debias as the student (Hinton et al., 2015; Gou et al., 2021). We initialize the student from the teacher. We do not apply our debiasing strategy on the teacher since it provides a reference to the original unaltered language representations. We compel the student to copy the teacher's attention for every input in the training corpus $\mathbb{S}$ .
|
| 142 |
+
|
| 143 |
+
As in Section 4.1, let $\mathbf{A}^{l,h,s,s_g}$ be the attention of the student model at layer $l$ , head $h$ with $s$ and $s_g$ as input. Likewise, let $\mathbf{O}^{l,h,s,s_g}$ define the teacher's attention matrix. We formalize the preservation of semantic information as a regularizer where we minimize the squared $l_2$ distance between the student's and the teacher's attention scores.
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
L _ {\text {d i s t i l}} = \sum_ {s \in \mathbb {S}} \sum_ {l = 1} ^ {L} \sum_ {h = 1} ^ {H} \left\| \mathbf {A} _ {: \sigma ,: \sigma} ^ {l, h, s, s _ {g}} - \mathbf {O} _ {: \sigma ,: \sigma} ^ {l, h, s, s _ {g}} \right\| _ {2} ^ {2} \tag {3}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
As can be seen from Equation 3, the student learns only to replicate block 1 (as in Figure 4) of the attention matrices. This is because block 1 contains attention scores of the original input sentence $s$ on itself, thus encoding an important aspect of semantics. We force the student not to reproduce the attention distribution on social groups (block 2) from the teacher since these are supposedly biased, and are left to the care of our debiasing objective. We do not use the MLM loss since the teacher model is already trained using that objective. We describe the overall training objective as a linear combination of the previously defined losses, with $\lambda$ as a hyperparameter to control the weight of debiasing over semantic preservation.
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
L o s s = L _ {d i s t i l} + \lambda L _ {e q u} \tag {4}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
# 4.3 Negative Sampling
|
| 156 |
+
|
| 157 |
+
While learning to equalize attention on social groups that constitute the second half of the input,
|
| 158 |
+
|
| 159 |
+
the text encoder bears the risk of distributing its attention uniformly on any second half, no matter what it is. This is particularly alarming when the text encoder is subsequently employed in double-sentence tasks (Wang et al., 2018) such as semantic textual similarity or sentence entailment.
|
| 160 |
+
|
| 161 |
+
To overcome the above obstacle, we introduce negative sampling. Instead of using words related to social groups in order to generate the artificial second input $s_g$ , we randomly sample words (negative examples) from the vocabulary. In this case, we do not equalize the attentions but compel the student to copy its teacher even for blocks 2, 3 and 4. We do this in order to prevent the text encoder from learning to assign the same attention weight to all tokens of the second input when these do not define social groups. We control the ratio of negative examples with a hyperparameter $\eta$ .
|
| 162 |
+
|
| 163 |
+
# 5 Evaluation
|
| 164 |
+
|
| 165 |
+
In this section, we first describe our experimental setup, then evaluate AttenD from two viewpoints: fairness and representativeness. Fairness is traditionally evaluated with two types of metrics: intrinsic metrics that measure bias in text representations regardless of their application, and extrinsic metrics that quantify bias in downstream tasks that text representations enable. We acknowledge that intrinsic metrics have recently been criticized (Goldfarb-Tarrant et al., 2020; Aribandi et al., 2021; Blodgett et al., 2021). However, we believe that a strong evaluation of bias should include both intrinsic, extrinsic and qualitative methods to draw a comprehensive evaluation. Since Aribandi et al. (2021) surmise that StereoSet and Crows-Pairs are more stable than other intrinsic measures of bias (e.g. WEAT (Caliskan et al., 2017) or SEAT (May et al., 2019)), we use them in this work. For extrinsic metrics, we evaluate our method on the tasks of textual inference and hate speech detection. Due to space limitations, we move the second one to Appendix A.3, in addition to other qualitative evaluations and ablation studies<sup>8</sup>.
|
| 166 |
+
|
| 167 |
+
# 5.1 Debiasing setup
|
| 168 |
+
|
| 169 |
+
To facilitate comparison, we follow existing literature (Nadeem et al., 2020; Nangia et al., 2020) in defining social groups for each type of bias, although the approach presented here is not restricted
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Model</td><td>gender</td><td>race</td><td>religion</td><td>Overall</td></tr><tr><td>BERT</td><td>84.52</td><td>79.65</td><td>82.57</td><td>82.25</td></tr><tr><td>Sent-D</td><td>86.45</td><td>79.27</td><td>82.98</td><td>82.90</td></tr><tr><td>Kaneko</td><td>82.71</td><td>75.34</td><td>78.13</td><td>78.73</td></tr><tr><td>CDA</td><td>82.50</td><td>73.92</td><td>78.39</td><td>78.61</td></tr><tr><td>AttenD</td><td>93.85</td><td>93.64</td><td>93.85</td><td>93.78</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 2: Attention bias on BERT before and after applying debiasing methods, the higher the better
|
| 174 |
+
|
| 175 |
+
to that, and can be leveraged for both other kinds of biases and for a more inclusive definition of the groups. In the experiments, we show results of debiasing based on (binary) gender (male, female), race (white, black, asian, hispanic) and religion ( muslim, christian, jewish, buddhist). We leverage the definition words from previous work (Liang et al., 2020a). The full list can be found in Appendix A.2. We apply AttenD on BERT $^{9}$ (Devlin et al., 2018), and use the News-commentary-v15 corpus $^{10}$ as training data. It contains 223,153 sentences of which we use $80\%$ for training and $20\%$ for development. As for the top $k$ most biased heads, we find that debiasing all heads works best in practice for all text encoders under study. Thus, we set the top $k$ to the maximum number of heads for every model. Appendix A.1 contains details about hyperparameter search.
|
| 176 |
+
|
| 177 |
+
# 5.2 Evaluations of Fairness
|
| 178 |
+
|
| 179 |
+
# 5.2.1 Intrinsic Evaluation
|
| 180 |
+
|
| 181 |
+
We start by quantifying the amount of attention bias described in Section 3 in BERT base before and after applying AttenD. For accurate comparisons against previous work, we decided to include the baselines whose final debiased models have been published in order to avoid errors of training and/or tuning hyperparameters. Thus, we compare AttenD against (1) Sent-D (Liang et al., 2020a) which extended the method of Hard-Debias (Bolukbasi et al., 2016) to work on transformer-based text encoders, (2) the debiasing procedure proposed by Kaneko and Bollegala (2021) that finetunes the text encoder to minimize the projection of its embeddings on a predefined bias subspace, and (3) CDA. We also conduct a simple ablation study by training without negative examples $(AttenD^{-})$ when necessary. We use the development set of
|
| 182 |
+
|
| 183 |
+
the News-commentary-v15 corpus to compute bias scores, and report the results in Table 2.
|
| 184 |
+
|
| 185 |
+
Although existing debiasing methods have been shown to reduce bias in embeddings (Liang et al., 2020a; Kaneko and Bollegala, 2021), we observe that they do very little to reduce it in attention. In fact, the method of Kaneko and Bollegala (2019) and CDA induce the model to encode more bias in the attention layer, which might make it to resurface in predictions if not addressed correctly.
|
| 186 |
+
|
| 187 |
+
In the following, we demonstrate that AttenD is also capable of mitigating bias from text representations and likelihoods. To do that, we finetune text encoders of interest before and after applying debiasing methods on the language modeling task. Then, we use the publicly available subsets of two stereotype benchmarks: StereoSet (Nadeem et al., 2020) and Crows-Pairs (Nangia et al., 2020). Both provide likelihood-based diagnostics to measure how often stereotypes are considered likelier than anti-stereotypes, given the language model's likelihoods. An ideal unbiased text encoder should score $50\%$ in these benchmarks, i.e. it prefers neither stereotypes nor anti-stereotypes. Table 3 provides the evaluation results. StereoSet also provides a means to compute a language modeling (LM) score whose purpose is to check whether the encoder is still good at the task of language modeling, and that debiasing didn't hurt semantic performance.
|
| 188 |
+
|
| 189 |
+
We observe that AttenD shows impressive debi- aising performance when evaluated with likelihood-based diagnostics. Improvements go up to $9.53\%$ with a slight decrease in the accuracy of language modeling $(-1.43\%)$ . We notice that our method yields the best results overall, and illustrates that reducing biases from attention directly helps with mitigating them from the model as a whole. Table 3 shows that using negative examples minimizes semantic information loss.
|
| 190 |
+
|
| 191 |
+
# 5.2.2 Extrinsic Evaluation
|
| 192 |
+
|
| 193 |
+
This approach of measuring bias builds on the intuition of Dev et al. (2020) stating that biased representations lead to invalid inferences, whose ratio quantifies bias. They construct a challenge benchmark for the natural language inference task where every hypothesis should be neutral to its premise. For example, suppose that the premise is The driver owns a van and the hypothesis is The man owns a van. The hypothesis neither entails nor contradicts the premise. If the predictions of a classifier deviate from neutrality, the underlying text encoder is
|
| 194 |
+
|
| 195 |
+
<table><tr><td rowspan="2">Model</td><td colspan="4">Crows-Pairs</td><td colspan="4">StereoSet</td><td rowspan="2">LM</td></tr><tr><td>gender</td><td>race</td><td>religion</td><td>Overall</td><td>gender</td><td>race</td><td>religion</td><td>Overall</td></tr><tr><td>BERT</td><td>58.02</td><td>58.14</td><td>71.43</td><td>60.48</td><td>62.75</td><td>54.68</td><td>56.41</td><td>56.04</td><td>83.70</td></tr><tr><td>Sent-D</td><td>51.53</td><td>55.23</td><td>60.0</td><td>56.90</td><td>53.33</td><td>55.09</td><td>51.28</td><td>54.71</td><td>81.39</td></tr><tr><td>Kaneko</td><td>57.63</td><td>53.68</td><td>64.76</td><td>57.82</td><td>58.82</td><td>56.24</td><td>57.69</td><td>56.04</td><td>85.58</td></tr><tr><td>CDA</td><td>54.58</td><td>50.78</td><td>60.95</td><td>55.06</td><td>55.69</td><td>53.01</td><td>53.85</td><td>54.18</td><td>81.38</td></tr><tr><td>AttenD-</td><td>53.05</td><td>53.68</td><td>69.52</td><td>57.23</td><td>51.37</td><td>54.37</td><td>55.13</td><td>53.37</td><td>80.92</td></tr><tr><td>AttenD</td><td>51.53</td><td>50.78</td><td>61.90</td><td>54.58</td><td>54.51</td><td>52.29</td><td>56.41</td><td>53.18</td><td>82.27</td></tr></table>
|
| 196 |
+
|
| 197 |
+
Table 3: Stereotype scores on BERT before and after applying debiasing methods. The closer to 50, the better. However, for the language modeling score (LM), the higher the better.
|
| 198 |
+
|
| 199 |
+
<table><tr><td>Model</td><td>Bias type</td><td>NN</td><td>FN</td><td>τ:0.5</td><td>τ:0.7</td></tr><tr><td rowspan="3">BERT</td><td>gender</td><td>36.38</td><td>36.45</td><td>36.06</td><td>33.96</td></tr><tr><td>race</td><td>75.96</td><td>76.57</td><td>76.51</td><td>74.91</td></tr><tr><td>religion</td><td>43.47</td><td>43.55</td><td>43.45</td><td>41.77</td></tr><tr><td rowspan="3">Sent-D</td><td>gender</td><td>44.74</td><td>45.10</td><td>44.54</td><td>42.06</td></tr><tr><td>race</td><td>59.61</td><td>59.28</td><td>59.20</td><td>56.22</td></tr><tr><td>religion</td><td>29.64</td><td>29.08</td><td>29.02</td><td>27.24</td></tr><tr><td rowspan="3">Kaneko</td><td>gender</td><td>53.15</td><td>53.33</td><td>52.75</td><td>49.65</td></tr><tr><td>race</td><td>84.24</td><td>84.84</td><td>84.80</td><td>83.26</td></tr><tr><td>religion</td><td>69.27†</td><td>69.80†</td><td>69.72†</td><td>67.66†</td></tr><tr><td rowspan="3">CDA</td><td>gender</td><td>64.00</td><td>65.38</td><td>64.70</td><td>61.19</td></tr><tr><td>race</td><td>77.33</td><td>77.79</td><td>77.78</td><td>75.93</td></tr><tr><td>religion</td><td>49.00</td><td>49.03</td><td>48.97</td><td>46.78</td></tr><tr><td rowspan="3">AttenD</td><td>gender</td><td>65.91</td><td>67.10</td><td>66.69</td><td>63.59</td></tr><tr><td>race</td><td>92.26</td><td>92.77</td><td>92.74</td><td>91.79</td></tr><tr><td>religion</td><td>68.51</td><td>69.08</td><td>68.95</td><td>66.97</td></tr></table>
|
| 200 |
+
|
| 201 |
+
assumed biased. Suppose that the set contains $M$ instances, and let the predictor's probabilities of the $i^{th}$ instance for entail, contradict and neutral be $e_i$ , $c_i$ and $n_i$ . Following Dev et al. (2020), we report three measures of inference-based bias: (1) Net Neutral (NN): $NN = \frac{1}{M} \sum_{i=1}^{M} n_i$ ; (2) Fraction Neutral (FN): $FN = \frac{1}{M} \sum_{i=1}^{M} \mathbf{1}_{n_i = \max(e_i, c_i, n_i)}$ ; (3) Threshold $\tau$ ( $\mathbf{T} : \tau$ ): $T : \tau = \frac{1}{M} \sum_{i=1}^{M} \mathbf{1}_{n_i > \tau}$ .
|
| 202 |
+
|
| 203 |
+
In this experiment, we finetune text encoders on MNLI dataset for natural language inference (Wang et al., 2018). A bias-free model should score 1 (100%) in all three measures. We report our findings in Table 4. Our method outperforms the original model and the baselines. This result shows that AttenD succeeds in mitigating stereotypes in real world inference settings. We also debias hate speech detection models and report the results in Appendix A.3.
|
| 204 |
+
|
| 205 |
+
Table 4: Inference-based bias measurements. Best scores are highlighted in bold, underlined, or marked with $\dagger$ for gender, race and religion $\dagger$ respectively
|
| 206 |
+
|
| 207 |
+
<table><tr><td rowspan="2">Models</td><td colspan="2">Single sentence</td><td colspan="5">Double sentence</td></tr><tr><td>sst2</td><td>cola</td><td>stsb</td><td>mrpc</td><td>mnli (m/mm)</td><td>rte</td><td>wnli</td></tr><tr><td>BERT</td><td>92.78</td><td>56.05</td><td>88.97</td><td>92.25</td><td>83.54 / 82.68</td><td>70.04</td><td>45.07</td></tr><tr><td>Sent-D</td><td>91.63</td><td>59.08</td><td>89.58</td><td>90.12</td><td>84.97 / 83.51</td><td>68.95</td><td>28.17</td></tr><tr><td>Kaneko</td><td>91.97</td><td>56.50</td><td>88.44</td><td>90.69</td><td>84.48 / 83.66</td><td>59.93</td><td>52.11</td></tr><tr><td>CDA</td><td>92.32</td><td>55.98</td><td>88.93</td><td>90.60</td><td>84.31 / 82.26</td><td>64.26</td><td>25.35</td></tr><tr><td>AttenD</td><td>92.32</td><td>56.25</td><td>81.12</td><td>80.44</td><td>84.59 / 83.96</td><td>58.12</td><td>39.44</td></tr><tr><td>AttenD</td><td>92.66</td><td>55.22</td><td>89.62</td><td>91.22</td><td>84.63 / 84.19</td><td>70.40</td><td>53.52</td></tr></table>
|
| 208 |
+
|
| 209 |
+
Table 5: Performance of different models on GLUE tasks. The table shows accuracy scores for sst2, rte, wnli, and mnli for both matched and mismatched instances; $f1$ for mrpc; spearman correlation for stsb; and matthews correlation for cola
|
| 210 |
+
|
| 211 |
+
# 5.3 Evaluations of Semantic Preservation
|
| 212 |
+
|
| 213 |
+
We use GLUE benchmark (Wang et al., 2018) to verify whether the debiased text encoder still holds enough semantic information to be applicable in downstream NLP tasks. In essence, GLUE assesses the natural language understanding capabilities of NLP models. So, it constitutes a suitable stack to evaluate the semantic preservation of AttenD. In this experiment, we finetune our debiased models on seven different tasks from GLUE and show that per-task accuracy is preserved in Table 5. We also observe that not using negative examples (AttenD-) severely hurts semantics.
|
| 214 |
+
|
| 215 |
+
# 6 Conclusion
|
| 216 |
+
|
| 217 |
+
We proposed in this paper to pay closer attention to the attention mechanism of text encoders. Specifically, we find that social bias also resides in attention weights, in addition to in representations and embeddings. We characterize attention bias in text encoders by looking at which demographics are most relevant given a stereotypical scenario under different attention maps in various layers. Our bias quantification method is a weighted average of Pearson correlations between attention allocations for demographic group words. We also propose a novel debiasing method by modifying
|
| 218 |
+
|
| 219 |
+
the self-attention weights so as to ensure equal attention activations across all group words for each token in each input sentence. At the same time, we use knowledge distillation from a teacher text encoder to preserve the useful semantics contained within. Finally, we utilize negative sampling with non-demographic word sets as the second sentence, where the teacher objective rather than attention equalization objective is applied, to prevent sentence-pair functionality in text encoders from being destroyed. We find that by mitigating biases from attention, the overall model bias is also reduced. We demonstrate this with various experiments that probe for bias internally, and when text encoders are used in downstream tasks, namely sentence inference and hate speech detection with limited costs to semantic usefulness.
|
| 220 |
+
|
| 221 |
+
# 7 Limitations
|
| 222 |
+
|
| 223 |
+
AttenD introduces many advantages. It is intuitive, simple in implementation, and inexpensive in terms of data resources. Also, the definitions of bias types and social groups in AttenD are extremely easy and flexible. However, we are aware of the following limitations: (1) There are more social divisions in the real world than the three dimensions we studied. Besides, bias types can be correlated in intricate ways, and it is not clear which or how many groups to include. For these reasons, we follow previous work and constrain our experiments to common use-cases. (2) We calibrate attention scores of every word in the input. However, some words are inherently charged with a strong inclination toward one group, e.g., *beard* to *male* or *pregnant* to *female*. Such words need not be debiased, which requires compiling expensive lists of related words for every social group and protecting them from attention equalization. We rely on knowledge distillation to retain as much useful semantic information as possible in order to assuage this concern. (3) We use discrete words for debiasing, and it is not obvious how to extend this to treat implicit bias (e.g. bias existing between *doctor* and *engineer* because they are both stereotyped to be rather occupations for men) or bias toward finer-grained groups, e.g. female muslims, or Buddhist Black Americans. (4) The template structure that we use for bias quantification and reduction does not necessarily capture all forms of social bias that are potentially concealed in the attention mechanism. Bias can also be internally
|
| 224 |
+
|
| 225 |
+
encoded in attention weights in templates different from "sentence from a corpus [SEP] demographic 1 demographic 2 demographic $3''$ . For example, instead of declaring bias as a difference in attention of the original sentence on social groups, we do the reverse and focus on the attention of groups on the sentence. Or we can analyze the attention distribution of demographics on attributes such as occupations or polarity adjectives, by using templates such as "sentence describing a person in a demographic group [SEP] occupation 1 occupation 2 occupation $3''$ . We believe that calibrating the attention of demographics on occupation terms helps in reducing implicit bias, at least the one related to occupations. Also, different kinds of template structures should be used in order to capture the most complete notion of attention bias possible. These points constitute sound and promising future directions for our research. We plan to address them all in upcoming work.
|
| 226 |
+
|
| 227 |
+
# 8 Ethical Considerations
|
| 228 |
+
|
| 229 |
+
We propose a debiasing method based on equalizing and calibrating the attention of text encoders on mentions of social groups. Although the approach is, in itself, independent from the choice of such groups, or the selection of identity terms and definition words that characterize these groups, we focus in our experiments on bias types and groups commonly used in the debiasing literature; namely binary gender, race and religion. We have shown that our method works for both binary and multiclass groups. That being said, we have not experimented yet with demographics divided into dozens of categories, e.g. nationality, or the full scope of gender. We also did not include analysis for groups who are victims of under-criticized microaggressions such as old people, fat people or people suffering from physical/mental disabilities. We justify our experimental decisions with the following: (1) Current work in the literature focuses primarily on the three major demographic dimensions. So to facilitate comparison, we used that too. (2) Existing benchmarks to quantify the amount of bias in text encoders are often limited to binary gender, race and religion. So even though our approach enables the reduction of bias for minority groups, we have no reliable data and benchmarks to assess whether debiasing is indeed effective for such groups. We encourage researchers and data collectors in the field to produce more inclusive benchmarks in the
|
| 230 |
+
|
| 231 |
+
future.
|
| 232 |
+
|
| 233 |
+
We would like to remind all users that our models are not perfect, even after going through debiasing. Although our experiments show that bias is indeed reduced, it is not completely mitigated. Also, there is the possibility that finetuning on the Newscommentary-v15 corpus might introduce new biases encoded in the data. More generally, the bias detection experiments used in this paper and in all related work have positive predictive ability, which means that they can only detect the presence of bias, not the absence of it. So it is possible that bias is still hiding under different forms that current experimental lenses fail to detect. We believe that the community needs to include some aspect of human evaluation to faithfully assess the stereotypical propensities of text encoders. We project to do that in future work.
|
| 234 |
+
|
| 235 |
+
# References
|
| 236 |
+
|
| 237 |
+
Vamsi Aribandi, Yi Tay, and Donald Metzler. 2021. How reliable are model diagnostics? In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 1778-1785.
|
| 238 |
+
Giuseppe Attanasio, Debora Nozza, Dirk Hovy, and Elena Baralis. 2022. Entropy-based attention regularization frees unintended bias mitigation from lists. In *Findings of the Association for Computational Linguistics: ACL* 2022, pages 1105-1119.
|
| 239 |
+
Jasmijn Bastings and Katja Filippova. 2020. The elephant in the interpretability room: Why use attention as explanation when we have saliency methods? In Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 149-155.
|
| 240 |
+
Rishabh Bhardwaj, Navonil Majumder, and Soujanya Poria. 2021. Investigating gender bias in bert. Cognitive Computation, pages 1-11.
|
| 241 |
+
Su Lin Blodgett, Solon Barocas, Hal Daumé III, and Hanna Wallach. 2020. Language (technology) is power: A critical survey of "bias" in nlp. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5454-5476.
|
| 242 |
+
Su Lin Blodgett, Gilsinia Lopez, Alexandra Olteanu, Robert Sim, and Hanna Wallach. 2021. Stereotyping norwegian salmon: an inventory of pitfalls in fairness benchmark datasets. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 1004-1015.
|
| 243 |
+
Tolga Bolukbasi, Kai-Wei Chang, James Y Zou, Venkatesh Saligrama, and Adam T Kalai. 2016. Man
|
| 244 |
+
|
| 245 |
+
is to computer programmer as woman is to homemaker? debiasing word embeddings. Advances in neural information processing systems, 29:4349-4357.
|
| 246 |
+
Shikha Bordia and Samuel Bowman. 2019. Identifying and reducing gender bias in word-level language models. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Student Research Workshop, pages 7-15.
|
| 247 |
+
Daniel Borkan, Lucas Dixon, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. 2019. Nuanced metrics for measuring unintended bias with real data for text classification. In *Companion proceedings of the 2019 world wide web conference*, pages 491-500.
|
| 248 |
+
Pete Burnap and Matthew L Williams. 2016. Us and them: identifying cyber hate on twitter across multiple protected characteristics. *EPJ Data science*, 5:1-15.
|
| 249 |
+
Aylin Caliskan, Joanna J Bryson, and Arvind Narayanan. 2017. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183-186.
|
| 250 |
+
Jose Camacho-Collados and Mohammad Taher Pilehvar. 2018. From word to sense embeddings: A survey on vector representations of meaning. Journal of Artificial Intelligence Research, 63:743-788.
|
| 251 |
+
Pengyu Cheng, Weituo Hao, Siyang Yuan, Shijing Si, and Lawrence Carin. 2020. Fairfil: Contrastive neural debiasing method for pretrained text encoders. In International Conference on Learning Representations.
|
| 252 |
+
Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D Manning. 2019. What does bert look at? an analysis of bert's attention. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 276-286.
|
| 253 |
+
Robert Dale. 2019. Law and word order: Nlp in legal tech. Natural Language Engineering, 25(1):211-217.
|
| 254 |
+
Jeffrey Dastin. 2018. Amazon scraps secret ai recruiting tool that showed bias against women. In *Ethics of Data and Analytics*, pages 296-299. Auerbach Publications.
|
| 255 |
+
Sunipa Dev, Tao Li, Jeff M Phillips, and Vivek Srikumar. 2020. On measuring and mitigating biased inferences of word embeddings. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7659-7666.
|
| 256 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
|
| 257 |
+
|
| 258 |
+
Mark Díaz, Isaac Johnson, Amanda Lazar, Anne Marie Piper, and Darren Gergle. 2018. Addressing age-related bias in sentiment analysis. In Proceedings of the 2018 chi conference on human factors in computing systems, pages 1-14.
|
| 259 |
+
Lucas Dixon, John Li, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. 2018. Measuring and mitigating unintended bias in text classification. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pages 67-73.
|
| 260 |
+
Yanai Elazar and Yoav Goldberg. 2018. Adversarial removal of demographic attributes from text data. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 11-21.
|
| 261 |
+
Yacine Gaci, Boualem Benatallah, Fabio Casati, and Khalid Benabdeslem. 2022a. Iterative adversarial removal of gender bias in pretrained word embeddings. In Proceedings of the 37th ACM/SIGAPP Symposium On Applied Computing, pages 829-836.
|
| 262 |
+
Yacine Gaci, Boualem Benatallah, Fabio Casati, and Khalid Benabdeslem. 2022b. Masked language models as stereotype detectors? In EDBT 2022.
|
| 263 |
+
Seraphina Goldfarb-Tarrant, Rebecca Marchant, Ricardo Muñoz Sanchez, Mugdha Pandya, and Adam Lopez. 2020. Intrinsic bias metrics do not correlate with application bias. arXiv preprint arXiv:2012.15859.
|
| 264 |
+
Hila Gonen and Yoav Goldberg. 2019. Lipstick on a pig: Debiasing methods cover up systematic gender biases in word embeddings but do not remove them. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 609-614.
|
| 265 |
+
Jianping Gou, Baosheng Yu, Stephen J Maybank, and Dacheng Tao. 2021. Knowledge distillation: A survey. International Journal of Computer Vision, 129(6):1789-1819.
|
| 266 |
+
C Hansen, M Tosik, G Goossen, C Li, L Bayeva, F Berbain, and M Rotaru. 2015. How to get the best word vectors for resume parsing. In SNN Adaptive Intelligence/Symposium: Machine Learning.
|
| 267 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531.
|
| 268 |
+
Benjamin Hoover, Hendrik Strobelt, and Sebastian Gehrmann. 2020. exbert: A visual analysis tool to explore learned representations in transformer models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 187-196.
|
| 269 |
+
Forrest Iandola, Albert Shaw, Ravi Krishna, and Kurt Keutzer. 2020. Squeezebert: What can computer vision teach nlp about efficient neural networks? In
|
| 270 |
+
|
| 271 |
+
Proceedings of SustaiNLP: Workshop on Simple and Efficient Natural Language Processing, pages 124-135.
|
| 272 |
+
Sarthak Jain and Byron C Wallace. 2019. Attention is not explanation. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 3543-3556.
|
| 273 |
+
Masahiro Kaneko and Danushka Bollegala. 2019. Gender-preserving debiasing for pre-trained word embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1641-1650.
|
| 274 |
+
Masahiro Kaneko and Danushka Bollegala. 2021. Debiasing pre-trained contextualised embeddings. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 1256-1266.
|
| 275 |
+
Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980.
|
| 276 |
+
Vaibhav Kumar, Tenzin Singhay Bhotia, and Tanmoy Chakraborty. 2020. Nurse is closer to woman than surgeon? mitigating gender-biased proximities in word embeddings. Transactions of the Association for Computational Linguistics, 8:486-503.
|
| 277 |
+
Keita Kurita, Nidhi Vyas, Ayush Pareek, Alan W Black, and Yulia Tsvetkov. 2019. Quantifying social biases in contextual word representations. In 1st ACL Workshop on Gender Bias for Natural Language Processing.
|
| 278 |
+
Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. 2019. Albert: A lite bert for self-supervised learning of language representations. arXiv preprint arXiv:1909.11942.
|
| 279 |
+
Anne Lauscher, Tobias Lüken, and Goran Glavaš. 2021. Sustainable modular debiasing of language models. arXiv preprint arXiv:2109.03646.
|
| 280 |
+
Yitong Li, Timothy Baldwin, and Trevor Cohn. 2018. Towards robust and privacy-preserving text representations. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 25-30.
|
| 281 |
+
Paul Pu Liang, Irene Mengze Li, Emily Zheng, Yao Chong Lim, Ruslan Salakhutdinov, and Louis Philippe Morency. 2020a. Towards debiasing sentence representations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5502-5515.
|
| 282 |
+
Sheng Liang, Philipp Dufter, and Hinrich Schütze. 2020b. Monolingual and multilingual reduction of gender bias in contextualized representations. In Proceedings of the 28th International Conference on Computational Linguistics, pages 5082-5093.
|
| 283 |
+
|
| 284 |
+
Zachary C Lipton. 2018. The mythos of model interpretability: In machine learning, the concept of interpretability is both important and slippery. Queue, 16(3):31-57.
|
| 285 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692.
|
| 286 |
+
Thomas Manzini, Yao Chong Lim, Yulia Tsvetkov, and Alan W Black. 2019. Black is to criminal as Caucasian is to police: Detecting and removing multiclass bias in word embeddings. arXiv preprint arXiv:1904.04047.
|
| 287 |
+
Binny Mathew, Punyajoy Saha, Seid Muhie Yimam, Chris Biemann, Pawan Goyal, and Animesh Mukherjee. 2021. Hatexplain: A benchmark dataset for explainable hate speech detection. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 14867-14875.
|
| 288 |
+
Chandler May, Alex Wang, Shikha Bordia, Samuel R Bowman, and Rachel Rudinger. 2019. On measuring social biases in sentence encoders. In NAACL-HLT (1).
|
| 289 |
+
Nicholas Meade, Elinor Poole-Dayan, and Siva Reddy. 2021. An empirical survey of the effectiveness of debiasing techniques for pre-trained language models. arXiv preprint arXiv:2110.08527.
|
| 290 |
+
Nicholas Meade, Elinor Poole-Dayan, and Siva Reddy. 2022. An empirical survey of the effectiveness of debiasing techniques for pre-trained language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1878-1898.
|
| 291 |
+
Moin Nadeem, Anna Bethke, and Siva Reddy. 2020. Stereoset: Measuring stereotypical bias in pretrained language models. arXiv preprint arXiv:2004.09456.
|
| 292 |
+
Eric Nalisnick, Bhaskar Mitra, Nick Craswell, and Rich Caruana. 2016. Improving document ranking with dual word embeddings. In Proceedings of the 25th International Conference Companion on World Wide Web, pages 83-84.
|
| 293 |
+
Nikita Nangia, Clara Vania, Rasika Bhalerao, and Samuel R Bowman. 2020. Crows-pairs: A challenge dataset for measuring social biases in masked language models.
|
| 294 |
+
Ji Ho Park, Jamin Shin, and Pascale Fung. 2018. Reducing gender bias in abusive language detection. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2799-2804.
|
| 295 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. 2017. Automatic differentiation in pytorch.
|
| 296 |
+
|
| 297 |
+
Danish Pruthi, Mansi Gupta, Bhuwan Dhingra, Graham Neubig, and Zachary C Lipton. 2020. Learning to deceive with attention-based explanations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4782-4793.
|
| 298 |
+
Yusu Qian, Urwa Muaz, Ben Zhang, and Jae Won Hyun. 2019. Reducing gender bias in word-level language models with a gender-equalizing loss function. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop, pages 223-228.
|
| 299 |
+
Shauli Ravfogel, Yanai Elazar, Hila Gonen, Michael Twiton, and Yoav Goldberg. 2020. Null it out: Guarding protected attributes by iterative nullspace projection. arXiv preprint arXiv:2004.07667.
|
| 300 |
+
Manoel Horta Ribeiro, Pedro H Calais, Yuri A Santos, Virgílio AF Almeida, and Wagner Meira Jr. 2018. Characterizing and detecting hateful users on twitter. In Twelfth international AAAI conference on web and social media.
|
| 301 |
+
Cynthia Rudin. 2019. Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence, 1(5):206-215.
|
| 302 |
+
Victor SANH, Lysandre DEBUT, Julien CHAUMOND, Thomas WOLF, and Hugging Face. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter.
|
| 303 |
+
Maarten Sap, Saadia Gabriel, Lianhui Qin, Dan Jurafsky, Noah A Smith, and Yejin Choi. 2020. Social bias frames: Reasoning about social and power implications of language. In Association for Computational Linguistics.
|
| 304 |
+
Timo Schick, Sahana Udupa, and Hinrich Schütze. 2021. Self-diagnosis and self-debiasing: A proposal for reducing corpus-based bias in nlp. Transactions of the Association for Computational Linguistics, 9:1408-1424.
|
| 305 |
+
Niral Shah. 2019. "asians are good at math" is not a compliment: Stem success as a threat to personhood. Harvard Educational Review, 89(4):661-686.
|
| 306 |
+
Emily Sheng, Kai-Wei Chang, Prem Natarajan, and Nanyun Peng. 2020. Towards controllable biases in language generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 3239-3254.
|
| 307 |
+
Ian Tenney, James Wexler, Jasmijn Bastings, Tolga Bolukbasi, Andy Coenen, Sebastian Gehrmann, Ellen Jiang, Mahima Pushkarna, Carey Radebaugh, Emily Reif, et al. 2020. The language interpretability tool: Extensible, interactive visualizations and analysis for nlp models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 107-118.
|
| 308 |
+
|
| 309 |
+
Deborah A Trytten, Anna Wong Lowe, and Susan E Walden. 2012. "asians are good at math. what an awful stereotype" the model minority stereotype's impact on asian american engineering students. Journal of Engineering Education, 101(3):439-468.
|
| 310 |
+
|
| 311 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008.
|
| 312 |
+
|
| 313 |
+
Sumithra Velupillai, Hanna Suominen, Maria Liakata, Angus Roberts, Anoop D Shah, Katherine Morley, David Osborn, Joseph Hayes, Robert Stewart, Johnny Downs, et al. 2018. Using clinical natural language processing for health outcomes research: overview and actionable suggestions for future advances. Journal of biomedical informatics, 88:11-19.
|
| 314 |
+
|
| 315 |
+
Jesse Vig. 2019a. Bertviz: A tool for visualizing multi-head self-attention in the bert model. In Proceedings of the 2019 ICLR Workshop on Debugging Machine Learning Models.
|
| 316 |
+
|
| 317 |
+
Jesse Vig. 2019b. Visualizing attention in transformer-based language representation models. arXiv preprint arXiv:1904.02679.
|
| 318 |
+
|
| 319 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. 2018. Glue: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 353-355.
|
| 320 |
+
|
| 321 |
+
Liwen Wang, Yuanmeng Yan, Keqing He, Yanan Wu, and Weiran Xu. 2021. Dynamically disentangling social bias from task-oriented representations with adversarial attack. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3740-3750.
|
| 322 |
+
|
| 323 |
+
Kellie Webster, Xuezhi Wang, Ian Tenney, Alex Beutel, Emily Pittler, Ellie Pavlick, Jilin Chen, Ed Chi, and Slav Petrov. 2020. Measuring and reducing gendered correlations in pre-trained models. arXiv preprint arXiv:2010.06032.
|
| 324 |
+
|
| 325 |
+
Sarah Wiegrefe and Yuval Pinter. 2019. Attention is not not explanation. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 11-20.
|
| 326 |
+
|
| 327 |
+
Qizhe Xie, Zihang Dai, Yulun Du, Eduard Hovy, and Graham Neubig. 2017. Controllable invariance through adversarial feature learning. Advances in Neural Information Processing Systems, 30:585-596.
|
| 328 |
+
|
| 329 |
+
Ziqi Zhang, David Robinson, and Jonathan Tepper. 2018. Detecting hate speech on twitter using a
|
| 330 |
+
|
| 331 |
+
convolution-gru based deep neural network. In European semantic web conference, pages 745-760. Springer.
|
| 332 |
+
|
| 333 |
+
Jieyu Zhao, Yichao Zhou, Zeyu Li, Wei Wang, and Kai-Wei Chang. 2018. Learning gender-neutral word embeddings. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4847-4853.
|
| 334 |
+
|
| 335 |
+
# A Appendix
|
| 336 |
+
|
| 337 |
+
# A.1 Training Hyperparameters
|
| 338 |
+
|
| 339 |
+
We used Adam optimizer (Kingma and Ba, 2014) with a learning rate of $5e^{-6}$ for 3 epochs. We keep the betas to their default values (0.9, 0.999) as in PyTorch implementation (Paszke et al., 2017). We set the loss coefficient $\lambda$ to 2.0 and the negative ratio $\eta$ to 0.8 meaning that in $80\%$ of the iterations, we use negative examples whose number we set to 5 in each negative iteration. For the number of heads $k$ having the top scores of attention bias, we experimented with different values for $k$ : {10, 20, 30, 50, 70, 100, all}. We found that debiasing all heads works best for all the text encoders that we experimented with. We only tuned the values of $\lambda$ , $\eta$ , $k$ , the learning rate, and the number of epochs. We conducted the hyperparameter search manually on the development set of the News-commentary-v15 corpus, and selected the hyperparameter configuration that maximized the attention-based bias metric. As for GLUE experiments, we follow the experimental setup of Devlin et al. (2018) and train each task for 3 epochs with a learning rate of $2e^{-5}$ on their respective training data. We ran all of our training and experiments on a NVIDIA Tesla V100 GPU.
|
| 340 |
+
|
| 341 |
+
# A.2 Definition of bias types and social groups used in this paper
|
| 342 |
+
|
| 343 |
+
While the approach is independent of the definition of social groups and categories (it could work for any kind of grouping, e.g., cuisine styles or sports), in the experiment we focus on groups commonly used in the debiasing literature: binary gender, religion and race. This is to facilitate comparison, but nothing in the approach prevents it from being used with broader and more inclusive groups. This being said, we have not experimented yet with debiasing where a dimension is divided in dozens of categories.
|
| 344 |
+
|
| 345 |
+
We list the definition tuples that we used in Table 6. We show that AttenD does not incur strict rules for defining social groups, unlike previous
|
| 346 |
+
|
| 347 |
+
work (Bolukbasi et al., 2016; Kaneko and Bollegala, 2019, 2021) that require the definition words to be organized in a predefined format (pairs of words or bag of words for every group), and provided in relatively large quantities. We can see from Table 6 that it is sufficient to define one tuple per bias type (e.g., race) if the tuples are hard to come by. Also, the tuples need not be of the same size (e.g., in religion there is a missing word for buddhist group since it is not clear which word to use in that tuple). This desired property owes to the fact that AttenD does not learn subspaces or directions for every bias type as previous works do (Bolukbasi et al., 2016; Kaneko and Bollegala, 2019; Kumar et al., 2020; Kaneko and Bollegala, 2021). In contrast, AttenD uses the tuples in order to equalize the attentions of the input sentence, and make the words therein attend to the groups with the same intensity. These example categories used in experiments are neither complete nor exhaustive, and in some experiments also include terms possibly considered inappropriate but that appear in the corpus and we may still want to debias from.
|
| 348 |
+
|
| 349 |
+
# A.3 Extrinsic bias evaluation on the task of hate-speech detection
|
| 350 |
+
|
| 351 |
+
Recent studies show that intrinsic metrics of bias do not necessarily correlate with bias measures on concrete real-world applications (Goldfarb-Tarrant et al., 2020). In the body of this paper, we already conducted intrinsic and extrinsic bias evaluations. In this experiment, we validate the efficacy of our debiasing method on a concrete real-world hate speech detection application where an input snippet of text is classified as either offensive (toxic, harmful, disrespectful, etc.) or not. We use hate speech detection because it is well studied in the literature (Burnap and Williams, 2016; Ribeiro et al., 2018; Zhang et al., 2018), and high-quality datasets which are tagged with social groups already exist (Borkan et al., 2019; Mathew et al., 2021).
|
| 352 |
+
|
| 353 |
+
Admittedly, common social biases have also been shown to exist in hate speech detection models, for example in associating toxicity to frequently attacked groups (such as "muslim" or "gay") even if the text itself is not toxic (Dixon et al., 2018; Park et al., 2018). In this experiment, we adopt the bias definition of Borkan et al. (2019) which casts bias as a skewing in the hate speech detector scores based solely on the social groups mentioned in the text. In other words, we consider a model to
|
| 354 |
+
|
| 355 |
+
exhibit unintended social stereotypes if the model's performance varies across groups. We use the bias measures proposed by Borkan et al. (2019) which are based on the Area Under the Receiver Operating Characteristic Curve (ROC-AUC, or AUC) metric. AUC measures the probability that a randomly chosen negative example (not offensive) receives a lower toxicity score than a randomly chosen positive example (offensive), meaning that a perfect model should always have an AUC score of 1.0. Stated differently, all negative examples have lower toxicity scores than positive examples. While AUC is used to measure the general performance of classifiers, Borkan et al. (2019) propose three extensions of AUC to measure bias. We summarize them in the following:
|
| 356 |
+
|
| 357 |
+
Subgroup (Sub) AUC: where AUC is computed only on the group under consideration and not on all the examples of the test benchmark, i.e. only positive and negative examples of the target group are considered. This metric represents the model's performance on a given group. A higher value means that the model is good at distinguishing between toxic and non-toxic texts specific to the group.
|
| 358 |
+
|
| 359 |
+
Background Positive Subgroup Negative (BPSN) AUC: where AUC is calculated on the negative examples of the target group, and the positive examples of the background (all other groups except the group under consideration). This metric computes whether the model discriminates against the target group with respect to the others. This value is reduced when non-toxic examples of the group have higher toxicity scores than actually toxic examples of the background.
|
| 360 |
+
|
| 361 |
+
Background Negative Subgroup Positive (BNSP) AUC: where AUC is calculated on the positive examples of the target group, and the negative examples of the background. This metric computes whether the model favors the target group with respect to the others. This value is reduced when toxic examples of the group have lower toxicity scores than non-toxic examples of the background.
|
| 362 |
+
|
| 363 |
+
In this experiment, we finetune the text encoder under study on hate speech detection task using the training set of HateXplain dataset (Mathew et al., 2021). We also use the test portion of HateXplain for the evaluation, which contains posts from Twitter<sup>11</sup> and Gab<sup>12</sup> annotated with their ground-truth
|
| 364 |
+
|
| 365 |
+
<table><tr><td colspan="2">gender</td><td colspan="4">religion</td></tr><tr><td>male</td><td>female</td><td>muslim</td><td>christian</td><td>jewish</td><td>buddhist</td></tr><tr><td>man</td><td>woman</td><td>muslim</td><td>christian</td><td>jewish</td><td>buddhist</td></tr><tr><td>boy</td><td>girl</td><td>muslims</td><td>christians</td><td>jews</td><td>buddhist</td></tr><tr><td>father</td><td>mother</td><td>islam</td><td>christianity</td><td>judaism</td><td>buddhism</td></tr><tr><td>brother</td><td>sister</td><td>mosque</td><td>church</td><td>synagogue</td><td>temple</td></tr><tr><td>grandfather</td><td>grandmother</td><td>quran</td><td>bible</td><td>torah</td><td></td></tr><tr><td>son</td><td>daughter</td><td>imam</td><td>priest</td><td>rabbi</td><td>monk</td></tr><tr><td>gentleman</td><td>lady</td><td>mohammad</td><td>jesus</td><td>moses</td><td>buddha</td></tr><tr><td>he</td><td>she</td><td></td><td></td><td></td><td></td></tr><tr><td>his</td><td>her</td><td></td><td></td><td></td><td></td></tr><tr><td>himself</td><td>herself</td><td></td><td></td><td></td><td></td></tr><tr><td colspan="6">race</td></tr><tr><td>white</td><td>black</td><td>asian</td><td>hispanic</td><td></td><td></td></tr><tr><td>white</td><td>black</td><td>asian</td><td>hispanic</td><td></td><td></td></tr></table>
|
| 366 |
+
|
| 367 |
+
Table 6: Full list of definition tuples for bias types and social groups used in this work
|
| 368 |
+
|
| 369 |
+
toxicity scores and the social groups and communities they target. Fundamentally, the three metrics described above give bias scores per group. In order to combine the per group scores in one overall measure, we apply the Generalized Mean of Bias (GMB) introduced by the Google Conversation AI Team as part of their Kaggle competition $^{13}$ , and later used by Mathew et al. (2021) in their own evaluations. The formula of GMB is as the following:
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
G M B (b) = \left(\frac {1}{| b |} \sum_ {g = 1} ^ {| b |} b _ {g} ^ {p}\right) ^ {1 / p} \tag {5}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
where $b$ is an array of AUC scores per group, and $b_{g}$ is the AUC score of group $g$ . We follow Mathew et al. (2021) and set $p$ to -5. We compute the GMB of all three metrics: Subgroup, BPSN and BNSP. As for Subgroup, we also add the standard deviation as it gives valuable information about how much the performance of the hate speech detection model varies across groups. We report our results in Table 7, in addition to classic performance measures.
|
| 376 |
+
|
| 377 |
+
We observe that AttenD provides competitive results across the four bias metrics, and largely outperforms the baselines. Especially with GMB-BNSP, where bias scores of the original model are very low (i.e. it is throttled by social biases), we observe the best improvements overall, and by a large margin compared to existing debiasing methods. Also, the variance in model performance is
|
| 378 |
+
|
| 379 |
+
lowest with AttenD, which confirms that the corresponding hate speech detection model has less stereotypes about different social groups. Finally, the general performance (Accuracy, F1 score and AUC) of the hate speech detection model after debiasing is not hurt.
|
| 380 |
+
|
| 381 |
+
# A.4 Visualizing debiasing results
|
| 382 |
+
|
| 383 |
+
In this experiment, we aim to visualize the effects of debiasing on attention weights. We only focus on binary gender bias for two reasons: First, it is easier to visualize binary variables on a 2D plane than multiclass variables (such as race, religion...). Second, gender is the most well studied bias type (Bolukbasi et al., 2016; Caliskan et al., 2017; May et al., 2019), so linguistic resources and vocabularies for gender exist and are well documented. We use the vocabulary words compiled by (Kaneko and Bollegala, 2019) and categorized into three non-overlapping subsets: (1) Male-definition $\Omega^M$ whose corresponding words are exclusively male-gendered such as father, king or uncle. (2) Female-definition $\Omega^F$ which is a set of inherently female words (mother, queen, aunt...). (3) Gender-stereotype $\Omega^S$ which is constituted of words that are not gendered by definition, but that carry a strong gender stereotype such as doctor being attributed to male or nurse to female.
|
| 384 |
+
|
| 385 |
+
For every word $w \in \Omega^M \cup \Omega^F \cup \Omega^S$ , we extract sentences from the News-commentary-v15 corpus where $w$ is mentioned. We denote this set as $S^w$ . Then, for every sentence $s \in S^w$ , we append the dummy input "man, woman" as explained in Section 3 and the example of Figure 1. The augmented input $s'$ is then fed to the text encoder of
|
| 386 |
+
|
| 387 |
+
<table><tr><td rowspan="2">Models</td><td colspan="3">Performance</td><td colspan="4">Bias</td></tr><tr><td>Acc↑</td><td>F1↑</td><td>AUC↑</td><td>STD-Sub↓</td><td>GMB-Sub↑</td><td>GMB-BPSN↑</td><td>GMB-BNSP↑</td></tr><tr><td>BERT</td><td>0.783</td><td>0.823</td><td>0.870</td><td>0.119</td><td>0.698</td><td>0.800</td><td>0.379</td></tr><tr><td>Sent-D</td><td>0.791</td><td>0.825</td><td>0.870</td><td>0.121</td><td>0.689</td><td>0.725</td><td>0.583</td></tr><tr><td>Kaneko</td><td>0.797</td><td>0.833</td><td>0.872</td><td>0.112</td><td>0.705</td><td>0.789</td><td>0.512</td></tr><tr><td>AttenD</td><td>0.789</td><td>0.829</td><td>0.866</td><td>0.085</td><td>0.808</td><td>0.793</td><td>0.726</td></tr></table>
|
| 388 |
+
|
| 389 |
+
interest (BERT base in this experiment), and we collect the attention scores of $w$ on the second-half tokens man and woman. Finally, for every word $w \in \Omega^M \cup \Omega^F \cup \Omega^S$ , we take the mean of its attention scores in $S^w$ . By the end of this procedure, we have for every word $w$ its attention score on the words man ( $a_m^w$ ) and woman ( $a_f^w$ ) as computed on the News-commentary-v15 corpus which includes overall 223,153 sentences. We take the difference $a_m^w - a_f^w$ which indicates the preference of the text encoder to consider $w$ as male (positive difference) or female (negative difference). The absence of gender bias is reflected in difference scores near zero.
|
| 390 |
+
|
| 391 |
+
We plot the results in Figure 5 where the x-axis represents the differences $a_{m}^{w} - a_{f}^{w}$ , and the y-axis random values to separate the words vertically. Stereotype words (green dots) should have values near 0, which is not the case in Figure 5(b). This means that BERT has a strong preference for one of the genders, and is thus heavily biased. In contrast, our method brings the attention of stereotype words near 0, meaning that they prefer neither male nor female connotations. Moreover, the spread of stereotype words in Figure 5(d) is narrower than male- or female-oriented words, which is desired since these are inherently gendered and must pick a side. This result strengthens the claim that AttenD preserves semantic information, and is less severe in reducing bias from gendered words as it is on gender-neutral words. The difference in spread is less apparent in the original BERT model. We also note that debiasing the embeddings of BERT rather than the attention mechanism as in (Kaneko and Bollegala, 2021) (Figure 5(c)) is not enough since bias information is still lurking (and perhaps made worse for some words) in the attention component. Thus, we conclude that working on attention directly constitutes our best option for debiasing to date.
|
| 392 |
+
|
| 393 |
+
Table 7: AUC-based bias measures on hate speech detection task
|
| 394 |
+
|
| 395 |
+
<table><tr><td rowspan="2">Models</td><td colspan="2">Single sentence tasks</td><td colspan="5">Double sentence tasks</td></tr><tr><td>sst2</td><td>cola</td><td>stsb</td><td>mrpc</td><td>mnli (m/mm)</td><td>rte</td><td>wnli</td></tr><tr><td>BERT</td><td>92.78</td><td>56.05</td><td>88.97</td><td>92.25</td><td>83.54 / 82.68</td><td>70.04</td><td>45.07</td></tr><tr><td>AttenD</td><td>92.66</td><td>55.22</td><td>89.62</td><td>91.22</td><td>84.63 / 84.19</td><td>70.40</td><td>53.52</td></tr><tr><td>AttenD'</td><td>92.32</td><td>56.25</td><td>89.12</td><td>80.44</td><td>84.59 / 83.96</td><td>58.12</td><td>39.44</td></tr></table>
|
| 396 |
+
|
| 397 |
+
Table 8: Effect of negative examples on GLUE tasks. The table shows accuracy scores for sst2, rte, wnli, and mnli for both matched and mismatched instances; $f1$ for mrpc; spearman correlation for stsb; and matthews correlation for cola
|
| 398 |
+
|
| 399 |
+
# A.5 Effect of negative examples on representativeness
|
| 400 |
+
|
| 401 |
+
We remind that the introduction of negative examples to training serves in forcing the text encoder not to rely on a dangerous shortcut which is distributing its attention uniformly on all the tokens constituting the second half of the input, no matter what the input is. This is particularly important in double-sentence tasks where the text encoder is given two input sentences. In addition to Tables 3 and 5 which highlighted the effect of negative sampling on the final stereotype scores, the primary goal of using negative examples remains the preservation of the text encoder's representativeness. In Table 8, we report the performance of AttenD and AttenD with and without negative examples respectively on GLUE tasks. Unsurprisingly, the lack of negative examples does not damage the performance of single-sentence tasks since these ignore the second half of the input altogether. However, in double-sentence tasks where both halves are used for prediction, Table 8 shows that negative sampling plays a pivotal role in preserving the semantics of text encoders, and bypassing the side effects inflicted by attention equalization.
|
| 402 |
+
|
| 403 |
+
# A.6 Word-Level vs Sentence-Level Debiasing
|
| 404 |
+
|
| 405 |
+
As previously explained in the paper, AttenD calibrates the attention weighs of all tokens of the input sentence on group-related words. Since we used BERT-based models in our experiments, the
|
| 406 |
+
|
| 407 |
+

|
| 408 |
+
(a)
|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
(b)
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
(c)
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
(d)
|
| 418 |
+
Figure 5: Scatter plots of attention scores on male - female direction. (a) Original BERT, (b) BERT debiased by Sent-D (c) BERT debiased by (Kaneko and Bollegala, 2021), (d) BERT debiased by AttenD
|
| 419 |
+
|
| 420 |
+
first token in the input is the special [CLS] token, which is considered by the NLP community as a vector representation for the entire input sentence. In the current version of AttenD, we also calibrate the attention weights of the special [CLS] token on groups, in addition to calibrating the other tokens of the sentence. One can see this notion as a combined word-level and sentence-level debiasing. In this experiment, we motivate this design choice by comparing it to word-level and sentence-level debiasing separately. For word-level, we exclude the [CLS] token from the attention equalization process, whereas in sentence-level we only calibrate the attention of [CLS]. We use all the bias evaluations run so far to understand the difference in performance. Tables 9, 10, 11, 12 and 13 report the results of StereoSet, Crows-Pairs, inference, hate speech and GLUE experiments respectively. We denote word-level debiasing by No [CLS], and sentence-level debiasing by Only [CLS] in the tables. The combination of both is referred to as AttenD, and is the variant that we promote in this paper. We observe that while the three settings are good at reducing bias from text encoders, AttenD is superior than word-level and sentence-level debiasing since it capitalizes on the benefits of both. It enjoys the fine granularity of reducing bias from every word, while it also mitigates biases that manifest at sentence-level.
|
| 421 |
+
|
| 422 |
+
# A.7 Static vs Random ordering of group-related words
|
| 423 |
+
|
| 424 |
+
In the preprocessing step of our method (as explained in Section 3), we use a preset ordering of group-related words of a given bias type to form the second input. For example, if we have the groups Muslim, Christian, Jew and Buddhist defining the religion bias type, AttenD constructs the second input using the same preset ordering of groups across all samples of the training data. Continuing the example above, AttenD appends the following artificial sentence " muslim, christian, jew, buddhist". In this experiment, we change the ordering of groups in a random way. Tables 9, 10, 11, 12 and 13 also report the bias scores of AttenD (static ordering) and AttenD with random ordering.
|
| 425 |
+
|
| 426 |
+
Although the semantic performance of AttenD with random ordering is better, we notice that it suffers from a stronger presence of bias than in its static counterpart. In Table 12, AttenD with random ordering has an AUC score of 0 in one of the
|
| 427 |
+
|
| 428 |
+
<table><tr><td>Models</td><td colspan="2">AttenD</td><td colspan="2">No [CLS]</td><td colspan="2">Only [CLS]</td><td colspan="2">Random Order</td></tr><tr><td>Overall (lm/ss)</td><td>83.34</td><td>53.04</td><td>80.37</td><td>53.71</td><td>81.70</td><td>55.51</td><td>82.91</td><td>54.75</td></tr><tr><td>gender (lm/ss)</td><td>78.24</td><td>53.73</td><td>76.86</td><td>52.94</td><td>75.88</td><td>54.51</td><td>79.02</td><td>55.69</td></tr><tr><td>race (lm/ss)</td><td>86.28</td><td>51.87</td><td>84.10</td><td>53.01</td><td>85.24</td><td>55.09</td><td>86.75</td><td>54.57</td></tr><tr><td>religion (lm/ss)</td><td>88.46</td><td>53.85</td><td>84.62</td><td>60.26</td><td>85.26</td><td>56.41</td><td>87.18</td><td>56.41</td></tr><tr><td>profession (lm/ss)</td><td>80.96</td><td>54.14</td><td>76.63</td><td>54.14</td><td>78.99</td><td>56.24</td><td>79.17</td><td>54.51</td></tr></table>
|
| 429 |
+
|
| 430 |
+
Table 9: Language modeling (lm) and Stereotype scores (ss) on StereoSet of different variants of AttenD
|
| 431 |
+
|
| 432 |
+
<table><tr><td>Models</td><td>AttenD</td><td>No [CLS]</td><td>Only [CLS]</td><td>Random Order</td></tr><tr><td>Overall</td><td>55.7</td><td>56.1</td><td>55.5</td><td>58.36</td></tr><tr><td>gender</td><td>57.36</td><td>50.76</td><td>50.0</td><td>53.82</td></tr><tr><td>race</td><td>51.15</td><td>54.84</td><td>53.1</td><td>57.75</td></tr><tr><td>religion</td><td>64.76</td><td>69.52</td><td>65.71</td><td>67.62</td></tr><tr><td>age</td><td>43.68</td><td>56.32</td><td>44.83</td><td>54.02</td></tr><tr><td>sexual orientation</td><td>58.33</td><td>71.43</td><td>63.1</td><td>64.29</td></tr><tr><td>nationality</td><td>57.86</td><td>53.46</td><td>65.41</td><td>62.28</td></tr><tr><td>disability</td><td>60.0</td><td>61.67</td><td>58.33</td><td>65.0</td></tr></table>
|
| 433 |
+
|
| 434 |
+
Table 10: Bias measurements of different variants of AttenD on Crows-Pairs
|
| 435 |
+
|
| 436 |
+
groups, which made the GMB extremely small. We suspect that the relatively poor fairness of random ordering owes to the fact that the model might be confused by different orderings throughout the iterations. A more serious analysis of the impact of group order on the overall performance (fairness and semantics) of AttenD motivates the direction of future work.
|
| 437 |
+
|
| 438 |
+
# A.8 Effect of AttenD on other transformer-based text encoders
|
| 439 |
+
|
| 440 |
+
We evaluate five widely used sentence-level text encoders: BERT (Devlin et al., 2018), ALBERT (Lan et al., 2019), RoBERTa (Liu et al., 2019), DistilBERT (SANH et al.) and SqueezeBERT (Iandola et al., 2020). For each model, we evaluate both its base and large variants (except for DistlBERT and SqueezeBERT since these are not available in HuggingFace's transformers library $^{14}$ ), original and debiased; which gives a total of sixteen evaluated models. We use Crows-Pairs dataset (Nangia et al., 2020) to quantify the intensity of undesired stereotypes encoded therein. As a reminder, ideal stereotype scores according to Crows-Pairs benchmark should be close to 50, i.e. models preferring neither stereotypes nor anti-stereotypes. Tables 14, 15, 16 and 17 show the bias results for BERT, ALBERT, RoBERTa and DistillBERT/SqueezeBERT respectively.
|
| 441 |
+
|
| 442 |
+
All five models exhibit substantial levels of bias, and in each of the bias types with differing intensities (religion, sexual orientation and disability be
|
| 443 |
+
|
| 444 |
+
<table><tr><td>Model</td><td>Bias type</td><td>NN</td><td>FN</td><td>τ:0.5</td><td>τ:0.7</td></tr><tr><td rowspan="3">AttenD</td><td>gender</td><td>01.31</td><td>00.43</td><td>00.35</td><td>00.21</td></tr><tr><td>race</td><td>93.31</td><td>93.94</td><td>93.90</td><td>93.04</td></tr><tr><td>religion</td><td>68.51†</td><td>69.08†</td><td>68.95†</td><td>66.97†</td></tr><tr><td rowspan="3">No [CLS]</td><td>gender</td><td>00.85</td><td>00.36</td><td>00.30</td><td>00.20</td></tr><tr><td>race</td><td>76.14</td><td>76.24</td><td>76.19</td><td>74.26</td></tr><tr><td>religion</td><td>40.80</td><td>40.04</td><td>39.98</td><td>37.78</td></tr><tr><td rowspan="3">Only [CLS]</td><td>gender</td><td>02.35</td><td>01.60</td><td>01.38</td><td>00.90</td></tr><tr><td>race</td><td>81.63</td><td>81.52</td><td>81.50</td><td>80.37</td></tr><tr><td>religion</td><td>44.40</td><td>44.01</td><td>43.95</td><td>42.76</td></tr><tr><td rowspan="3">Random Order</td><td>gender</td><td>01.54</td><td>00.51</td><td>00.39</td><td>00.23</td></tr><tr><td>race</td><td>54.71</td><td>54.92</td><td>54.89</td><td>52.49</td></tr><tr><td>religion</td><td>26.94</td><td>26.67</td><td>26.59</td><td>24.58</td></tr></table>
|
| 445 |
+
|
| 446 |
+
Table 11: Inference-based bias measurements on different variants of AttenD. Best scores are highlighted with bold character, underlined, or marked with $\dagger$ for gender, race and religion $\dagger$ respectively
|
| 447 |
+
|
| 448 |
+
ing the bias categories with the most severe stereotyping). Also, we find that the large variants are more biased than their base counterparts mainly because large models, with their larger capacity and greater number of parameters, can capture more intricate and more sophisticated aspects of training data, exposing them to learn more bias. This finding corresponds well to results of previous work (Nangia et al., 2020; Nadeem et al., 2020). The tables also show that AttenD is effective in mitigating bias from BERT, ALBERT, RoBERTa, DistilBERT and SqueezeBERT, and produces a reduction of up to $25\%$ . We note that AttenD succeeds in debiasing all models, with varying effectiveness across bias types. We also note that AttenD meets the best success with ALBERT as reductions are greater on this particular text encoder. We believe this is because ALBERT is composed of a single transformer layer (Lan et al., 2019) with substantially less parameters than BERT or RoBERTa; which makes debiasing easier since there is no interference between different attention layers. Finally, we see from the tables that AttenD sometimes contributes to adding a bit of bias. We observe that this phenomenon is rare, and happens especially with bias types we did not include in our design<sup>15</sup>. We assume that not explicitly compelling the text encoder to equalize attention heads corresponding to these overlooked bias types gave it green light to adjust these attentions in a way to facilitate solving the optimization problem; even if it entails adding bias. We plan to include all bias types present in
|
| 449 |
+
|
| 450 |
+
Crows-Pairs dataset to our debiasing design as a future work.
|
| 451 |
+
|
| 452 |
+
<table><tr><td rowspan="2">Models</td><td colspan="3">Performance</td><td colspan="4">Bias</td></tr><tr><td>Acc↑</td><td>F1↑</td><td>AUC↑</td><td>STD-Sub↓</td><td>GMB-Sub↑</td><td>GMB-BPSN↑</td><td>GMB-BNSP↑</td></tr><tr><td>AttenD</td><td>0.789</td><td>0.829</td><td>0.866</td><td>0.085</td><td>0.808</td><td>0.793</td><td>0.726</td></tr><tr><td>No [CLS]</td><td>0.791</td><td>0.830</td><td>0.871</td><td>0.114</td><td>0.710</td><td>0.797</td><td>0.530</td></tr><tr><td>Only [CLS]</td><td>0.765</td><td>0.805</td><td>0.838</td><td>0.142</td><td>0.660</td><td>0.766</td><td>0.636</td></tr><tr><td>Random Order</td><td>0.784</td><td>0.822</td><td>0.861</td><td>/</td><td>/</td><td>0.764</td><td>/</td></tr></table>
|
| 453 |
+
|
| 454 |
+
Table 12: AUC-based bias measures on hate speech detection task on different variants of AttenD
|
| 455 |
+
|
| 456 |
+
<table><tr><td rowspan="2">Models</td><td colspan="2">Single sentence tasks</td><td colspan="5">Double sentence tasks</td></tr><tr><td>sst2</td><td>cola</td><td>stsb</td><td>mrpc</td><td>mnli (m/mm)</td><td>rte</td><td>wnli</td></tr><tr><td>AttenD</td><td>92.66</td><td>55.22</td><td>89.62</td><td>91.22</td><td>84.63 / 84.19</td><td>70.40</td><td>53.52</td></tr><tr><td>No [CLS]</td><td>91.51</td><td>40.85</td><td>88.94</td><td>91.62</td><td>84.49 / 84.02</td><td>68.95</td><td>40.85</td></tr><tr><td>Only [CLS]</td><td>92.43</td><td>55.23</td><td>89.43</td><td>90.04</td><td>84.42 / 84.67</td><td>71.84</td><td>23.94</td></tr><tr><td>Random Order</td><td>93.23</td><td>59.07</td><td>88.85</td><td>91.94</td><td>83.75 / 84.86</td><td>71.84</td><td>30.99</td></tr></table>
|
| 457 |
+
|
| 458 |
+
Table 13: GLUE performance of different variants of AttenD. The table shows accuracy scores for sst2, rte, wnli, and mnli for both matched and mismatched instances; $f1$ for mrpc; spearman correlation for stsb; and matthews correlation for cola
|
| 459 |
+
|
| 460 |
+
<table><tr><td>Models</td><td colspan="2">BERT base</td><td colspan="2">BERT large</td></tr><tr><td>Overall</td><td>60.48 → 55.70</td><td>-04.78</td><td>59.68 → 56.96</td><td>-02.72</td></tr><tr><td>race</td><td>58.14 → 51.15</td><td>-06.99</td><td>60.08 → 53.49</td><td>-06.59</td></tr><tr><td>gender</td><td>58.02 → 57.36</td><td>-00.66</td><td>55.34 → 53.05</td><td>-02.29</td></tr><tr><td>socioeconomic</td><td>59.88 → 51.16</td><td>-08.72</td><td>56.40 → 57.56</td><td>+01.16</td></tr><tr><td>nationality</td><td>62.89 → 57.86</td><td>-05.03</td><td>52.20 → 57.23</td><td>+05.03</td></tr><tr><td>religion</td><td>71.43 → 64.76</td><td>-06.67</td><td>68.57 → 66.67</td><td>-01.90</td></tr><tr><td>age</td><td>55.17 → 43.68</td><td>+01.15</td><td>55.17 → 54.02</td><td>-01.15</td></tr><tr><td>sexual orientation</td><td>67.86 → 58.33</td><td>-09.53</td><td>65.48 → 67.86</td><td>+02.41</td></tr><tr><td>physical appearance</td><td>63.49 → 61.90</td><td>-01.89</td><td>69.84 → 65.08</td><td>-04.76</td></tr><tr><td>disability</td><td>61.67 → 60.00</td><td>-01.67</td><td>76.67 → 65.00</td><td>-11.67</td></tr></table>
|
| 461 |
+
|
| 462 |
+
Table 14: Bias reduction in BERT base and large measured on Crows-Pairs dataset. Each cell is organized as follows: $\mathrm{o} \rightarrow \mathrm{d} + / -$ diff where $o$ is the stereotype score of the original model, $d$ is that of the debiased model using attention-based debiasing, and ${diff}$ is the difference in stereotype score. Negative values correspond to reduction in bias (desired) where positive values mean addition of bias (undesired).
|
| 463 |
+
|
| 464 |
+
<table><tr><td>Models</td><td colspan="2">ALBERT base</td><td colspan="2">ALBERT large</td></tr><tr><td>Overall</td><td>56.76 → 51.99</td><td>-04.77</td><td>60.48 → 53.58</td><td>-06.90</td></tr><tr><td>race</td><td>51.36 → 48.84</td><td>-00.20</td><td>59.11 → 50.97</td><td>-08.14</td></tr><tr><td>gender</td><td>54.20 → 53.44</td><td>-00.76</td><td>56.11 → 48.47</td><td>-04.58</td></tr><tr><td>socioeconomic</td><td>60.47 → 61.05</td><td>+00.58</td><td>54.07 → 50.00</td><td>-01.16</td></tr><tr><td>nationality</td><td>51.57 → 57.86</td><td>+06.29</td><td>62.26 → 60.38</td><td>-04.07</td></tr><tr><td>religion</td><td>59.05 → 60.00</td><td>+00.95</td><td>76.19 → 61.90</td><td>-14.29</td></tr><tr><td>age</td><td>65.52 → 42.53</td><td>-08.05</td><td>54.02 → 54.02</td><td>-00.00</td></tr><tr><td>sexual orientation</td><td>75.00 → 38.10</td><td>-13.10</td><td>71.43 → 63.10</td><td>-08.33</td></tr><tr><td>physical appearance</td><td>46.03 → 41.27</td><td>+04.76</td><td>58.73 → 57.14</td><td>-01.59</td></tr><tr><td>disability</td><td>86.67 → 61.67</td><td>-25.00</td><td>73.33 → 58.33</td><td>-15.00</td></tr></table>
|
| 465 |
+
|
| 466 |
+
Table 15: Bias reduction in ALBERT base and large measured on Crows-Pairs dataset. Each cell is organized as follows: $\mathrm{o} \rightarrow \mathrm{d} + / -$ diff where $o$ is the stereotype score of the original model, $d$ is that of the debiased model using attention-based debiasing,and ${diff}$ is the difference in stereotype score. Negative values correspond to reduction in bias (desired) where positive values mean addition of bias (undesired).
|
| 467 |
+
|
| 468 |
+
<table><tr><td>Models</td><td colspan="2">RoBERTa base</td><td colspan="2">RoBERTa large</td></tr><tr><td>Overall</td><td>53.98 → 51.39</td><td>-02.59</td><td>61.27 → 56.83</td><td>-04.44</td></tr><tr><td>race</td><td>47.09 → 50.39</td><td>-02.52</td><td>61.43 → 53.49</td><td>-07.94</td></tr><tr><td>gender</td><td>54.96 → 45.80</td><td>-00.76</td><td>51.91 → 51.91</td><td>-00.00</td></tr><tr><td>socioeconomic</td><td>56.40 → 55.81</td><td>-00.59</td><td>66.28 → 59.88</td><td>-06.40</td></tr><tr><td>nationality</td><td>45.28 → 43.40</td><td>+01.88</td><td>56.60 → 55.35</td><td>-01.25</td></tr><tr><td>religion</td><td>56.19 → 60.00</td><td>+03.81</td><td>59.05 → 62.86</td><td>+03.81</td></tr><tr><td>age</td><td>64.37 → 56.32</td><td>-08.05</td><td>71.26 → 62.07</td><td>-09.19</td></tr><tr><td>sexual orientation</td><td>69.05 → 48.81</td><td>-17.86</td><td>71.43 → 59.52</td><td>-11.91</td></tr><tr><td>physical appearance</td><td>66.67 → 60.32</td><td>-06.35</td><td>68.25 → 66.67</td><td>-01.58</td></tr><tr><td>disability</td><td>71.67 → 65.00</td><td>-06.67</td><td>66.67 → 70.00</td><td>+03.33</td></tr></table>
|
| 469 |
+
|
| 470 |
+
Table 16: Bias reduction in RoBERTa base and large measured on Crows-Pairs dataset. Each cell is organized as follows: $\mathrm{o} \rightarrow \mathrm{d} + / -$ diff where $o$ is the stereotype score of the original model, $d$ is that of the debiased model using attention-based debiasing, and ${diff}$ is the difference in stereotype score. Negative values correspond to reduction in bias (desired) where positive values mean addition of bias (undesired).
|
| 471 |
+
|
| 472 |
+
<table><tr><td>Models</td><td colspan="2">DistilBERT</td><td colspan="2">SqueezeBERT</td></tr><tr><td>Overall</td><td>56.83 → 51.26</td><td>-05.57</td><td>57.43 → 54.71</td><td>-02.72</td></tr><tr><td>race</td><td>53.29 → 47.87</td><td>-01.16</td><td>55.04 → 56.01</td><td>+00.97</td></tr><tr><td>gender</td><td>54.58 → 46.56</td><td>-01.14</td><td>52.67 → 48.47</td><td>-01.14</td></tr><tr><td>socioeconomic</td><td>55.81 → 58.14</td><td>+02.33</td><td>57.56 → 51.16</td><td>-06.40</td></tr><tr><td>nationality</td><td>54.09 → 50.94</td><td>-03.15</td><td>53.46 → 61.01</td><td>+07.55</td></tr><tr><td>religion</td><td>70.48 → 57.14</td><td>-13.34</td><td>74.29 → 60.95</td><td>-13.34</td></tr><tr><td>age</td><td>59.77 → 48.28</td><td>-08.05</td><td>55.17 → 48.28</td><td>-03.45</td></tr><tr><td>sexual orientation</td><td>70.24 → 55.95</td><td>-14.29</td><td>70.24 → 57.14</td><td>-13.10</td></tr><tr><td>physical appearance</td><td>55.56 → 63.49</td><td>+07.93</td><td>52.38 → 52.38</td><td>-00.00</td></tr><tr><td>disability</td><td>61.67 → 56.67</td><td>-05.00</td><td>70.00 → 61.67</td><td>-08.33</td></tr></table>
|
| 473 |
+
|
| 474 |
+
Table 17: Bias reduction in DistilBERT and SqueezeBERT measured on Crows-Pairs dataset. Each cell is organized as follows: $\mathrm{o} \rightarrow \mathrm{d} + / -$ diff where $o$ is the stereotype score of the original model, $d$ is that of the debiased model using attention-based debiasing, and ${diff}$ is the difference in stereotype score. Negative values correspond to reduction in bias (desired) where positive values mean addition of bias (undesired).
|
debiasingpretrainedtextencodersbypayingattentiontopayingattention/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5885502e2c12a4c7c62a25df2dfe164820bf7b1cd948193f12ba3b5891735d86
|
| 3 |
+
size 1040741
|
debiasingpretrainedtextencodersbypayingattentiontopayingattention/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e386c1cb0a17ce77852b4928811a54b9ff7c7d4c97e1f26d804fd4181892565c
|
| 3 |
+
size 643317
|
decodinganeuralretrieverslatentspaceforquerysuggestion/60f3a764-4e2b-45bc-a396-98a74aed5b7b_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfefd3356da388b74226de04a7520ab4877744f18e93da6105565ac69295c4c1
|
| 3 |
+
size 122904
|
decodinganeuralretrieverslatentspaceforquerysuggestion/60f3a764-4e2b-45bc-a396-98a74aed5b7b_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:abf5fc326c74f4bdd8a3ccf92e59ddb2ce858d2521b4935258e21977af87d89f
|
| 3 |
+
size 137605
|
decodinganeuralretrieverslatentspaceforquerysuggestion/60f3a764-4e2b-45bc-a396-98a74aed5b7b_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:84c06839b69b314e655229c4d8c5d19be70c1da7b6c80c0035907b08d8cbd6dd
|
| 3 |
+
size 714134
|
decodinganeuralretrieverslatentspaceforquerysuggestion/full.md
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Decoding a Neural Retriever's Latent Space for Query Suggestion
|
| 2 |
+
|
| 3 |
+
Leonard Adolphs†
|
| 4 |
+
|
| 5 |
+
Michelle Chen Huebscher
|
| 6 |
+
|
| 7 |
+
Christian Buck†
|
| 8 |
+
|
| 9 |
+
Sertan Girgin‡
|
| 10 |
+
|
| 11 |
+
Olivier Bachem‡
|
| 12 |
+
|
| 13 |
+
Massimiliano Ciaramita
|
| 14 |
+
|
| 15 |
+
Thomas Hofmann†
|
| 16 |
+
|
| 17 |
+
$\dagger$ ETH Zürich
|
| 18 |
+
|
| 19 |
+
ladolphs@inf.ethz.ch
|
| 20 |
+
|
| 21 |
+
$\ddagger$ Google Research
|
| 22 |
+
|
| 23 |
+
# Abstract
|
| 24 |
+
|
| 25 |
+
Neural retrieval models have superseded classic bag-of-words methods such as BM25 as the retrieval framework of choice. However, neural systems lack the interpretability of bag-of-words models; it is not trivial to connect a query change to a change in the latent space that ultimately determines the retrieval results. To shed light on this embedding space, we learn a "query decoder" that, given a latent representation of a neural search engine, generates the corresponding query. We show that it is possible to decode a meaningful query from its latent representation and, when moving in the right direction in latent space, to decode a query that retrieves the relevant paragraph. In particular, the query decoder can be useful to understand "what should have been asked" to retrieve a particular paragraph from the collection. We employ the query decoder to generate a large synthetic dataset of query reformulations for MSMarco, leading to improved retrieval performance. On this data, we train a pseudo-relevance feedback (PRF) T5 model for the application of query suggestion that outperforms both query reformulation and PRF information retrieval baselines.
|
| 26 |
+
|
| 27 |
+
# 1 Introduction
|
| 28 |
+
|
| 29 |
+
Neural encoder models (Karpukhin et al., 2020; Ni et al., 2021; Izacard et al., 2021) have improved document retrieval in various settings. They have become an essential building block for applications in open-domain question answering (Karpukhin et al., 2020; Lewis et al., 2020b; Izacard and Grave, 2021), open-domain conversational agents (Shuster et al., 2021; Adolphs et al., 2021), and, recently, language modeling (Shuster et al., 2022). Neural encoders embed documents and queries in a shared (or joint) latent space, so that paragraphs can be ranked and retrieved based on their vector similarity with a given query. This constitutes a conceptually powerful approach to discovering semantic
|
| 30 |
+
|
| 31 |
+
similarities between queries and documents that is often found to be more nuanced than simple term frequency statistics typical of classic sparse representations. However, such encoders may come with shortcomings in practice. First, they are prone to domain overfitting, failing to consistently outperform bag-of-words approaches on out-of-domain queries (Thakur et al., 2021). Second, they are notoriously hard to interpret as similarity is no longer controlled by word overlap, but rather by semantic similarities that lack explainability. Third, they may be non-robust as small changes in the query can lead to inexplicably different retrieval results.
|
| 32 |
+
|
| 33 |
+
In bag-of-words models, it can be straightforward to modify a query to retrieve a given document: e.g., following insights from relevance feedback (Rocchio, 1971), by increasing the weight of terms contained in the target document (Adolphs et al., 2022; Huebscher et al., 2022). This approach is not trivially applicable to neural retrieval models as it is unclear how an added term might change the latent code of a query.
|
| 34 |
+
|
| 35 |
+
In this paper, we look into the missing link connecting latent codes back to actual queries. We thus propose to train a "query decoder", which maps embeddings in the shared query-document space to query strings, inverting the fixed encoder of the neural retriever (cf. Figure 1a). As we will show, such a decoder lets us find queries that are optimized to retrieve a given target document. It deciphers what information is in the latent code of a document and how to phrase a query to retrieve it.
|
| 36 |
+
|
| 37 |
+
We use this model to explore the latent space of a state-of-the-art neural retrieval model, GTR (Ni et al., 2021). In particular, we leverage the structure of the latent space by traversing from the embedding of a specific query to its human-labeled gold paragraph and use our query decoder to generate reformulation examples from intermediate points along the path as shown in Figure 1b. We find that using this approach, we can generate a large
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: We train a query decoder (QD) model that inverts the shared encoder of a neural retrieval model (a). Then, we leverage the structure of the latent space of a neural retrieval model by traversing from query to gold paragraph embeddings and using our query decoder to generate a dataset of successful query reformulations (b). Finally, we train a pseudo-relevance feedback query suggestion model on this dataset that predicts promising rewrites, given a query and its search results (c).
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
(b)
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
|
| 47 |
+
dataset of query reformulations on MSMarco-train (Nguyen et al., 2016) that improve retrieval performance without needing additional human labeling. We use this dataset to train a pseudo-relevance feedback (PRF) query suggestion model. Here, we fine-tune a T5-large model (Raffel et al., 2020) that uses the original query, together with its top-5 GTR search results, as the input context to predict a query suggestions as depicted in Figure 1c. We show that our model provides fluent, diverse query suggestions with better retrieval performance than various baselines, including a T5 model trained on question editing (Chu et al., 2020), and a PRF query expansion model (Pal et al., 2013).
|
| 48 |
+
|
| 49 |
+
We make the resources to reproduce the results publicly available<sup>1</sup>.
|
| 50 |
+
|
| 51 |
+
# 2 Related Work
|
| 52 |
+
|
| 53 |
+
Neural Retriever Classic retrieval systems such as BM25 (Robertson and Zaragoza, 2009) use term frequency statistics to determine the relevancy of a document for a given query. Recently, neural retrieval models have become more popular and started to outperform classic systems on multiple search tasks. Karpukhin et al. (2020) use a dual-encoder setup based on BERT-base (Devlin et al., 2019), called DPR, to encode query and documents separately and use maximum inner product search (Shrivastava and Li, 2014) to find a match. They use this model to improve recall and answer quality for multiple open-domain question-answer datasets, including OpenQA-NQ (Lee et al., 2019). Ni et al. (2021) show that scaling up the dual encoder architecture improves the retrieval performance. They train a shared dual encoder model, based on T5
|
| 54 |
+
|
| 55 |
+
(Raffel et al., 2020), in a multi-stage manner, including fine-tuning on MSMarco (Nguyen et al., 2016), and evaluate on the range of retrieval tasks of the BEIR benchmark (Thakur et al., 2021). Izacard et al. (2021) show that one can train an unsupervised dense retriever and be competitive against strong baselines on the BEIR benchmark.
|
| 56 |
+
|
| 57 |
+
Xiong et al. (2021) propose approximate nearest neighbor negative contrastive learning (ANCE) to learn a dense retrieval system. On top of this dense retriever, Li et al. (2022) consider a pseudorelevance feedback method. Other than our approach, this method does not provide the user with rephrased queries.
|
| 58 |
+
|
| 59 |
+
Applications of Neural Retrievers Neural retrieval models have been at the core of recent improvements among a range of different NLP tasks. Lewis et al. (2020b) augment a language generation model, BART (Lewis et al., 2020a), with a DPR neural retriever and evaluate on multiple knowledge-intensive NLP tasks; most notably, they improve over previous models on multiple open-domain QA benchmarks using an abstractive method.
|
| 60 |
+
|
| 61 |
+
Izacard and Grave (2021) propose the Fusion-in-Decoder method to aggregate a large set of documents from the neural retriever and provide them to the model during answer generation. Their focus is on open-domain QA where they significantly outperform previous models when considering a large set of documents during decoding.
|
| 62 |
+
|
| 63 |
+
Shuster et al. (2021) use neural retrieval models to improve conversational agents in knowledge-grounded dialogue. They show that the issue of hallucination - i.e., generating factual incorrect knowledge statements - can be significantly re
|
| 64 |
+
|
| 65 |
+
duced when using a neural-retriever-in-the-loop architecture. Separating the retrieval-augmented knowledge generation and the conversational response generation can further improve the issue of hallucination in knowledge-grounded dialogue and helps fuse modular QA and dialogue models (Adolphs et al., 2021). Recently, retrieval query generation approaches have been proposed to improve open-domain dialogue (Komeili et al., 2021) and language modeling (Shuster et al., 2022).
|
| 66 |
+
|
| 67 |
+
Query Generation Query optimization is a longstanding problem in IR (Lau and Horvitz, 1999; Teevan et al., 2004). Recent work has investigated query refinement with reinforcement learning for Open Domain and Conversational Question Answering (Nogueira and Cho, 2017; Buck et al., 2018; Wu et al., 2021).
|
| 68 |
+
|
| 69 |
+
The methods presented in this paper are a natural complement to the work of Adolphs et al. (2022), who propose a heuristic approach to generate multistep query refinements, used to train sequential query generation models for the task of learning to search. Their method is also inspired by relevance feedback, but they seek to reach the gold document purely in language space, by brute force exploration. For this purpose, they use specialized search operators to condition the retrieval results as desired. Huebscher et al. (2022) show that, when paired with a hybrid sparse/dense retrieval environment, the search agents trained on this kind of synthetic data combine effective corpus exploration, competitive performance and interpretability.
|
| 70 |
+
|
| 71 |
+
Web-GPT (Nakano et al., 2021) presents an end-to-end search modeling approach based on human demonstrations, in a similar spirit our work could be seen as way of involving humans-in-loop by proposing better queries.
|
| 72 |
+
|
| 73 |
+
Fixed-vector decoders Probabilistic decoders mapping from a fixed size vector space to natural language have also been explored in auto-encoder settings. A key challenge in this line of work lies in obtaining decoders that are robust, i.e., they generate natural text for a variety of input vectors. Bowman et al. (2016) proposed using a RNN-based language model in combination with variational autoencoders (VAE) (Kingma and Welling, 2013) which add Gaussian space to the decoder input. Zhao et al. (2018) proposed the use of Adversarial Autoencoder (AAE) (Makhzani et al., 2015) to which Shen et al. (2020) added data denoising
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Table 1: Decoding metrics of the Query Decoder (QD) based on the GTR-base neural retrieval model. The F1 score is the F1 word overlap between the original query, of MSMarco or NQ, and the output of the query decoder model when provided with the GTR encoding of the query. The cosine similarity is measured between the re-encoding of the generated query and the encoding of the original query. The figure above depicts the metrics visually with a toy example for clarity.
|
| 77 |
+
|
| 78 |
+
by randomly dropping words in the input and the reconstructing the full output.
|
| 79 |
+
|
| 80 |
+
Recently, RNN-based decoders have been replaced by Transformer-based language models (Vaswani et al., 2017), for example by Montero et al. (2021), Park and Lee (2021) and Li et al. (2020).
|
| 81 |
+
|
| 82 |
+
# 3 Query Decoder
|
| 83 |
+
|
| 84 |
+
Training We train a T5 (Raffel et al., 2020), decoder-only model, to (re-)generate a query from its embedding obtained in a neural retrieval model. As training data, we use a subset of 3 million queries of the PAQ dataset (Lewis et al., 2021). We use the GTR-base (Ni et al., 2021), shared-encoder model, to generate the embeddings and use the queries as the targets. The objective of the query decoder learning is to invert the mapping of the fixed GTR encoder model, as visually depicted in Figure 1a. More training details of the query decoder are provided in Appendix A.2.1.
|
| 85 |
+
|
| 86 |
+
Query Reconstruction Evaluation We consider the round-trip consistency as a first step in evaluating the query decoder's effectiveness. A query $q$ is encoded via GTR and then decoded by our decoder to generate $q'$ . We use queries from MS-Marco, and NQ test sets of the BEIR benchmark (Thakur et al., 2021). As a first metric, we compute
|
| 87 |
+
|
| 88 |
+
the F1 score between the original $q$ and its reconstruction $q'$ . Since word-overlap is imperfect in measuring query drift, we further re-encode $q'$ and compare its latent code with the code for $q$ via their cosine similarity. The results of these evaluations are reported in Table 1, where we also provide an illustrative example of the proposed approach. For both datasets, MSMarco and NQ, the metrics of F1 and cosine similarity are generally high, indicating that the GTR code carries information that allows for close approximate query reconstruction.
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
|
| 92 |
+
<table><tr><td>Data</td><td>Top1</td><td>Top3</td><td>Top5</td></tr><tr><td>MSMarco</td><td>0.551</td><td>0.737</td><td>0.796</td></tr><tr><td>NQ</td><td>0.721</td><td>0.863</td><td>0.897</td></tr></table>
|
| 93 |
+
|
| 94 |
+
Paragraph to Query Evaluation Many interesting use cases rely on the ability to generate queries from passages of text (Du et al., 2017; Kumar et al., 2018). As GTR embeds document paragraphs and queries into the same space, the query decoder can also be used to invert the retrieval process. We thus evaluate the decoder quality by starting from a document paragraph, decoding a query from its embedding and then running the GTR search engine on that query to check if this query retrieves the desired paragraph as a top-ranked result. We test this in an experiment with human-labeled gold paragraphs from MSMarco and NQ, using top-k as the success metric. The results reported in Table 2 are very encouraging in that the desired paragraph is indeed found very often among the topmost GTR search results. Two example paragraph decodings from MSMarco are shown in Table 3; for both decodings, the gold paragraph is retrieved at the top position.
|
| 95 |
+
|
| 96 |
+
Latent Space Traversal Decoding We have shown that query decoding can reconstruct queries and that it can find retrieval queries for target passages. We now turn to a more concrete practical
|
| 97 |
+
|
| 98 |
+
Table 2: Share of gold paragraphs for which we can decode a query that retrieves the given paragraph within its top-k GTR search results. The figure above depicts the metric evaluation visually for clarity.
|
| 99 |
+
|
| 100 |
+
<table><tr><td colspan="2">Original Query
|
| 101 |
+
nebl coin price [Rank: 2]
|
| 102 |
+
Decoding from Gold Paragraph
|
| 103 |
+
what is the current price of neblio today belo [Rank: 1]
|
| 104 |
+
Gold Paragraph
|
| 105 |
+
Neblio Price Chart US Dollar (NEBL/USD) Neblio price for today is $16.3125. It has a current circulating supply of 12.8 Million coins and a total volume exchanged of $9,701,465</td></tr><tr><td colspan="2">Original Query
|
| 106 |
+
when is champaign il midterm elections [Rank: 3]
|
| 107 |
+
Decoding from Gold Paragraph
|
| 108 |
+
when is the general election in illinois 2018 [Rank: 1]
|
| 109 |
+
Gold Paragraph
|
| 110 |
+
Illinois elections, 2018. A general election will be held in the U.S. state of Illinois on November 6, 2018. All of Illinois’ executive officers will be up for election as well as all of Illinois’ eighteen seats in the United States House of Representatives.</td></tr></table>
|
| 111 |
+
|
| 112 |
+
Table 3: Examples of query decodings from the gold paragraph. The rank indicates the retrieval position of the gold paragraph using the corresponding query.
|
| 113 |
+
|
| 114 |
+
application, namely to automatically generate a data set of query reformulations, from which strategies for interactive retrieval can be learned. In this context, reformulated queries should remain semantically similar to the original query and not overfit to the target passage. They should be somewhat 'in between' the query and the gold passage, as any passage is likely to contain answers to multiple, different questions. This can be operationalized by decoding queries from points along the line connecting the embeddings of the query and its target passage as depicted in Figure 1b.
|
| 115 |
+
|
| 116 |
+
To validate this idea, we apply it to the MSMarco and NQ retrieval dataset where each query is paired with a human-labeled gold paragraph. In particular, we move in $k$ equidistant increments from the original query embedding $\mathbf{q}$ to the gold paragraph embedding $\mathbf{d}$ , i.e.
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbf {q} _ {\kappa} = \mathbf {q} + \frac {\kappa}{k} (\mathbf {d} - \mathbf {q}) \quad \kappa = 0, \dots , k \tag {1}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
and generate a reformulation at each step.2 As a sanity check, Figure 3 shows the average retrieval performance of the decoded queries when moving from the original query embedding to the gold paragraph embedding for MSMarco and NQ. For both datasets, the normalized discounted cumulative gain (nDCG) (Jarvelin and Kekäläinen, 2002)
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 2: Visualization of the latent-space traversal from query to gold paragraph, using 2D t-SNE. The blue point denotes the embedding of the original query "where is quincy located". The green squares are the embeddings of the retrieved paragraphs for this query. The closest one about "Quincy Washington" is shown in the green text bar. The orange crosses denote the embeddings of the reformulations of the query decoder when moving to the gold paragraph depicted as the red plus. The orange and red text bars show the final reformulation and the gold paragraph text, respectively. The number above the query and reformulations show the nDCG score. As the gold paragraph is describing the climate of Quincy in addition to its location, a reformulation about the "average rainfall in quincy illinois" retrieves the desired paragraph.
|
| 126 |
+
|
| 127 |
+
improves steadily and plateaus, then slightly dips, only when getting close to the gold paragraph embedding. We hypothesize that two effects are at work here that explain this dip: (i) the closer one moves towards the gold passage embedding, the more the query decoder operates out-of-distribution as it is trained on query embeddings. The joint latent space is sparse and likely characterized by distinct regions for queries and passage embeddings, which have different properties (e.g., length or surface structure). (ii) A passage might answer several questions. When decoding from an embedding close to the paragraph, these might start being conflated.
|
| 128 |
+
|
| 129 |
+
Examples We provide a visual example of the latent traversal approach in Figure 2 where we project the latent space to 2 dimensions using t-SNE (Hinton and Roweis, 2002). The plot shows that for the ambiguous query "where is quincy located" (blue dot), the gold paragraph about the climate of Quincy, Illinois (red plus), is far away from the top-10 retrieved documents (green squares). Traversing the latent space from the query towards the gold paragraph leads to improved reformulations
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 3: The normalized discounted cumulative gain (nDCG) of the reformulations from the query decoder when moving the input code from the embedding of the query to the embedding of the gold paragraph. Decoding closer to the gold paragraph embedding leads to queries with improved average retrieval performance. The initial decodings nDCG scores are slightly lower than from the original query due to the reconstruction loss of the query decoder.
|
| 133 |
+
|
| 134 |
+
(orange crosses), as is evident from the shrinking distance to the gold paragraph and by the improved nDCG score.
|
| 135 |
+
|
| 136 |
+
Semantically, the reformulations move to questions about the climate of Quincy, as this is the main topic of the gold paragraph. The full sequence of reformulations is shown in Table 15. Another example is shown in Table 4; similarly, we see that the decoded queries move semantically from the general question of average annual return on the stock market to the more specific question of return at the S&P stock exchange. Many more examples are provided in Appendix A.5.
|
| 137 |
+
|
| 138 |
+
# 4 Query Suggestion Model
|
| 139 |
+
|
| 140 |
+
Dataset Generation We generate a dataset of query reformulations using the latent space traversal decoding as described in the previous section. In particular, for the 532,761 queries of the MSMarco-train dataset, we leverage GTR's learned latent space structure and move towards the embedding of their gold paragraph. At $k = 20$ intermediate steps on this path, we use our query decoder to generate reformulations.
|
| 141 |
+
|
| 142 |
+
For more than $80\%$ of the queries, we find at least one optimal reformulation that retrieves the gold paragraph at the top position. In Figure 4, we show histograms of nDCG and the inner product to the gold paragraph for the original query versus the best-found reformulation. The metrics show that the latent space traversal helps us discover good
|
| 143 |
+
|
| 144 |
+
# Original Query
|
| 145 |
+
|
| 146 |
+
average yearly return on stock market [0.00]
|
| 147 |
+
|
| 148 |
+
# Decodings during Traversal
|
| 149 |
+
|
| 150 |
+
what is the average annual return on stock market [0.00]
|
| 151 |
+
|
| 152 |
+
average return on a stock market year [0.00]
|
| 153 |
+
|
| 154 |
+
what is the average annual return on stock market [0.00]
|
| 155 |
+
|
| 156 |
+
what is the average return on stock in a year [0.00]
|
| 157 |
+
|
| 158 |
+
what is the average return in a stock market [0.00]
|
| 159 |
+
|
| 160 |
+
what is the average annual return in stock (s&p) [0.36]
|
| 161 |
+
|
| 162 |
+
what is the average return on the stock market (s&p) [0.36]
|
| 163 |
+
|
| 164 |
+
what is the average return on the s&p stock exchange at a time [1.00]
|
| 165 |
+
|
| 166 |
+
what is the average return in s&p stock at a time [0.36]
|
| 167 |
+
|
| 168 |
+
what is the average annual return of the s&p stock exchange (best) [1.00]
|
| 169 |
+
|
| 170 |
+
# Gold Paragraph
|
| 171 |
+
|
| 172 |
+
The S&P 500 gauges the performance of the stocks of the 500 largest, most stable companies in the Stock Exchange. It is often considered the most accurate measure of the stock market as a whole. The current average annual return from 1926, the year of the S&Ps inception, through 2011 is $11.69\%$ . That's a long look back, and most people aren't interested in what happened in the market 80 years ago.
|
| 173 |
+
|
| 174 |
+
Table 4: Example of a successful traversal on an MS-Marco query. The nDCG@10 score of each query is provided in the brackets. Here, we traverse the latent space in $k = 10$ equidistant steps from the embedding of the original query "average yearly return on stock market", which results in an nDCG retrieval score of 0, to the embedding of the gold paragraph. The queries decoded from a latent code close to the gold paragraph, focus on the returns of the S&P (as the gold paragraph) and lead to improved retrieval results.
|
| 175 |
+
|
| 176 |
+
query reformulations that lead to massively improved retrieval performance and are closer to the corresponding gold paragraphs in latent space.
|
| 177 |
+
|
| 178 |
+
We filter the dataset to only contain "successful" reformulations to train the reformulation model. Here, we require a reformulation to have an nDCG of 1 (i.e., retrieve the gold paragraph at the top position), to improve the nDCG compared to the original query, and its embedding to have a larger inner product with the gold paragraph than the original query. Using this approach, we generate a dataset of 863,307 successful query rewrites. As the example in Table 4 and Appendix A.5 show, the decoded queries do not always have human-like fluency and for some sequences intent shift occurs when decoding closer to the paragraph. This is one reason we're moving in increments from the original query to the gold paragraph instead of directly
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
(a)
|
| 184 |
+
(b)
|
| 185 |
+
Figure 4: The histogram of nDCG (a) and inner product with the gold paragraph embedding of the original query vs. the best reformulation found with the latent-space traversal approach on MSMarco-train.
|
| 186 |
+
|
| 187 |
+
decoding it.
|
| 188 |
+
|
| 189 |
+
Interestingly, however, we find that this noise of the dataset is unspecific enough that it gets smoothed out during model training as described in the following paragraph. More details about this dataset are provided in Sec. A.3.
|
| 190 |
+
|
| 191 |
+
Model Training We use the reformulation dataset to train two query suggestion model variants. First, we train a model on the plain reformulation examples, from original query to "successful" rewrite. As a second, more powerful approach, we train a model with pseudo-relevance feedback (PRF); here, we provide GTR's top-5 search results for the original query as additional context to the model. Both models are fine-tuned from the T5-large (Raffel et al., 2020) pre-training checkpoint. Consequently, we name the models in the following way:
|
| 192 |
+
|
| 193 |
+
- qsT5-plain: A T5 query suggestion model trained on the plain generated reformulation
|
| 194 |
+
|
| 195 |
+
examples (no pseudo-relevance feedback) of MSMarco-train, mapping from query to query reformulation.
|
| 196 |
+
|
| 197 |
+
- qsT5: A T5 query suggestion model trained on the generated reformulation examples of MSMarco-train, where the input is augmented with the content of GTR's top-5 retrieved search results for the original query, mapping from query and search results to query reformulation.
|
| 198 |
+
|
| 199 |
+
The details and hyperparameters of the model training are provided in Appendix A.2.2.
|
| 200 |
+
|
| 201 |
+
Baseline Models To measure the effectiveness of our query suggestion model, we benchmark it against multiple baselines. The baselines are meant to cover various angles of competitive approaches to query suggestion, namely training on human-generated question-edit histories, a classic RM3 pseudo-relevance feedback query expansion method, and a latent space sampling approach utilizing our query decoder. In the following, we introduce the three baselines in detail.
|
| 202 |
+
|
| 203 |
+
- MQR: We train a T5-large model on the "multidomain question rewriting" (MQR) (Chu et al., 2020) dataset. This dataset consists of 427,719 human-contributed Stack Exchange question-edit histories, mapping from ill-formed to well-formed. While this is a relatively large training dataset, our synthetic generations dataset is roughly double in size with 863,307 rewrites, yet without any human edits. This baseline captures the effect of turning a query to a well-formed question to improve retrieval performance. It does not use PRF but maps from query to reformulation, as our qsT5-plain model. Training details of this model are provided in Section A.2.3 in the Appendix.
|
| 204 |
+
|
| 205 |
+
- RM3: We employ RM3 (Jaleel et al., 2004) as a strong pseudo-relevance feedback baseline. In particular, we use a query expansion approach that uses the formula described in Eq. 20 of Pal et al. (2013) with $\mu = 2500$ to determine the most relevant terms of the top-5 retrieved documents. Then, each suggestion of the model consists of the original query together with one of the determined relevant terms.
|
| 206 |
+
- Sampling+QD: To check how much of the retrieval performance gain is due to an ensembling effect in latent space, we compare against a random sampling baseline that includes our query
|
| 207 |
+
|
| 208 |
+
# Original Query
|
| 209 |
+
|
| 210 |
+
who created spiritual gangster
|
| 211 |
+
|
| 212 |
+
# MQR
|
| 213 |
+
|
| 214 |
+
Who created the Spiritual Gangster?
|
| 215 |
+
|
| 216 |
+
Who created the "spiritual gangster" storyline?
|
| 217 |
+
|
| 218 |
+
Who created the "spiritual gangster"?
|
| 219 |
+
|
| 220 |
+
# RM3
|
| 221 |
+
|
| 222 |
+
who created spiritual gangster spiritual
|
| 223 |
+
|
| 224 |
+
who created spiritual gangster modern
|
| 225 |
+
|
| 226 |
+
who created spiritual gangster inspired
|
| 227 |
+
|
| 228 |
+
# Sampling+QD
|
| 229 |
+
|
| 230 |
+
who created gangster a spiritual & egantious
|
| 231 |
+
|
| 232 |
+
who created spiritual gangster -gangster
|
| 233 |
+
|
| 234 |
+
who created spiritual gangster
|
| 235 |
+
|
| 236 |
+
# qsT5
|
| 237 |
+
|
| 238 |
+
who is the founder of spiritual gangsters
|
| 239 |
+
|
| 240 |
+
who created the spiritual gangster ( spiritual yogi )
|
| 241 |
+
|
| 242 |
+
what is the spiritual gangster movement
|
| 243 |
+
|
| 244 |
+
# qst5-plain
|
| 245 |
+
|
| 246 |
+
who are the founders of the gangster spirit band
|
| 247 |
+
|
| 248 |
+
how many gangsters were formed in white supreme
|
| 249 |
+
|
| 250 |
+
who was the members of the gangster supremes
|
| 251 |
+
|
| 252 |
+
# Gold Paragraph
|
| 253 |
+
|
| 254 |
+
About Spiritual Gangster. Spiritual Gangster represents a new generation of yogis seeking balance between the ancient practice of yoga and the modern world. Founded by Vanessa Lee and Ian Lopatin, this newly borne brand calls for high vibration living and radiating love shore-to-shore, person-to-person, heart-to-heart.
|
| 255 |
+
|
| 256 |
+
Table 5: Examples of the top query suggestions for the different models for the query "who created spiritual gangster". The final row shows the human-labeled gold paragraph.
|
| 257 |
+
|
| 258 |
+
decoder (QD). In particular, we sample a point uniformly at random from an epsilon-ball around the embedding of the original query and use the query decoder to decode that point to a query. This baseline does not use PRF.
|
| 259 |
+
|
| 260 |
+
Evaluation We evaluate the query suggestion models on the MSMarco and NQ test sets. For each example, we generate up to 10 suggestions using nucleus sampling (Holtzman et al., 2020). Our ultimate goal is to provide users with at least one reformulation that better captures their search intent. As we assume the gold paragraph captures the information need of the user, we evaluate if, within a small set of reformulations, there is a query that would lead them closer to that paragraph; i.e., we measure the maximum nDCG@10 of the top-k reformulations and the original query. We provide the results in Figure 5.
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
(a)
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
(b)
|
| 267 |
+
Figure 5: Retrieval metrics of the query suggestion models on the MSMarco (a) and NQ (b) test sets. The dashed line shows the nDCG@10 score of the original query. The bars represent the nDCG@10 of the best 1, 3, 5, and 10 reformulations (including the original query), respectively, of different models. The error bars show the 95 percent confidence interval when doing bootstrap sampling from up to 10 generations of the models. The RM3 and qsT5 models are using pseudo-relevance feedback, i.e., information about the top-retrieved paragraphs.
|
| 268 |
+
|
| 269 |
+
We see that our qsT5 model significantly outperforms all baselines on both datasets. Notably, it substantially improves upon the RM3 pseudorelevance feedback baseline; this indicates that our full reformulation approach is more powerful for neural retrievers than a well-established query expansion technique.
|
| 270 |
+
|
| 271 |
+
The large gap between qsT5 and qsT5-plain validates the importance and usefulness of conditioning on the initial search results.
|
| 272 |
+
|
| 273 |
+
Successfully rewriting the query to a well-formed variant benefits this task as indicated by the improved nDCG performance of the non-PRF baseline of the T5 model trained on MQR (blue) over the original query (dashed line). The qsT5-plain model outperforms the MQR model when considering multiple reformulations on MSMarco, indicating that in some cases our model learns successful rewriting beyond improving fluency.
|
| 274 |
+
|
| 275 |
+
The qsT5-plain is mostly on par with sampling randomly around the embedding of the original query and using our query decoder to generate a reformulation; hence, we can speculate that the main benefit of this non-PRF model comes from an ensembling effect of generating suitable reformulations around the neighborhood of the original query. Again, this reinforces the benefit of pseudo-relevance feedback for the application of query suggestion.
|
| 276 |
+
|
| 277 |
+
Additional plots showing the inner product metric for this experiment and a table summarizing the numbers are provided in Appendix A.1.
|
| 278 |
+
|
| 279 |
+
Diversity & Fluency To quantitatively highlight the characteristics of the evaluated query suggestion models, we report Self-BLEU (Zhu et al., 2018) and perplexity of a language model as proxies for diversity and fluency, respectively, in Table 6. Self-BLEU is measured between 10 suggestions for a given query and averaged across the dataset, where a low Self-BLEU indicates large diversity between suggestions. For the perplexity evaluation, we employ the T5-base language model trained on C4 (Raffel et al., 2020) and measure the average per-token perplexity of all suggestions for a given dataset; here, we associate lower perplexity with higher fluency of the suggestions.
|
| 280 |
+
|
| 281 |
+
Table 6 shows that the MQR baseline generates the most fluent queries, but with low diversity compared to our reformulation approaches. The RM3 query expansions score worst in diversity as they always use the original query as a base. Our qsT5 model scores second best in diversity, with a good comparative perplexity, only surpassed by the qsT5 variant without PRF, due to the fact that this model does not focus on the "narrowed-down" topics of the retrieved results. Notably, the perplexity is higher for the NQ dataset than for MSMarco due to the nature of queries in NQ being closer to well-formed questions as opposed to 'search engine queries'.
|
| 282 |
+
|
| 283 |
+
Examples In Table 5, we cherry-pick a representative example of query suggestions for the different models. This example showcases typical be
|
| 284 |
+
|
| 285 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">MSMarco</td><td colspan="2">NQ</td></tr><tr><td>S-BLEU</td><td>PPL</td><td>S-BLEU</td><td>PPL</td></tr><tr><td>Original Query</td><td>-</td><td>1622.2</td><td>-</td><td>217.9</td></tr><tr><td>MQR</td><td>46.1</td><td>59.6</td><td>61.4</td><td>56.8</td></tr><tr><td>RM3</td><td>74.8</td><td>1562.6</td><td>88.0</td><td>309.5</td></tr><tr><td>Sampling+QD</td><td>23.7</td><td>726.0</td><td>26.6</td><td>687.5</td></tr><tr><td>qST5</td><td>17.8</td><td>247.8</td><td>18.4</td><td>223.2</td></tr><tr><td>qST5-plain</td><td>9.2</td><td>196.6</td><td>7.6</td><td>249.8</td></tr></table>
|
| 286 |
+
|
| 287 |
+
Table 6: Self-BLEU (Zhu et al., 2018) and Perplexity (PPL) for the query suggestions of the different models on MSMarco and NQ. Self-BLEU is measured between 10 suggestions of a model for a given query and then averaged across the dataset to provide information about the diversity of the suggestions. Perplexity is measured per token based on a T5 language model to provide a relative comparison of fluency of the query suggestions.
|
| 288 |
+
|
| 289 |
+
haviors of the models. The MQR model is trained on turning ill-formed into well-formed questions. Hence, it usually produces grammatical but low diversity reformulations, especially when the original query is already close to a well-formed question. The relatively high Self-BLEU score amongst its reformulations for a given query, reported in Table 6, supports the argument of limited diversity.
|
| 290 |
+
|
| 291 |
+
The RM3 model appends the most relevant terms to the original query and therefore has the lowest overall diversity (i.e., highest Self-BLEU). The Sampling+QD model can result in non-grammatical or even nonsensical queries depending on the sampled point in latent space. While the qsT5 model can utilize the top-retrieved search results to form reformulations that are in accordance with the topic of the query (e.g., "yogi" in the example of Table 5), the qsT5-plain needs to rely on its internal world knowledge stored in its parameters. It thus cannot connect "gangster" with "yogi" here.
|
| 292 |
+
|
| 293 |
+
# 5 Conclusion
|
| 294 |
+
|
| 295 |
+
Dual encoders have reset the standard in IR. However, language-based inverted index architectures still hold their ground, especially in out-of-domain evaluations (Thakur et al., 2021). To help further our understanding of the connections, and potential, between the two, we propose a method that relies on a query decoder to map back to language space the latent codes generated by the encoder.
|
| 296 |
+
|
| 297 |
+
The interplay between latent and language representations, in combination with a simple goal-directed mechanism for traversing the shared query-document space, allows us to generate a large synthetic dataset of query reformulations on which we
|
| 298 |
+
|
| 299 |
+
train a pseudo-relevance feedback query suggestion model that characteristically tries to predict the location of the target document.
|
| 300 |
+
|
| 301 |
+
Our contribution is twofold: (i) we develop a generic way to generate training data for directional query refinement by traversing the latent space between queries and relevant documents, and (ii) we build a powerful reformulation model that we evaluate on a novel benchmark inspired by the query suggestion task. Suggestions are typically well-formed, diverse and more likely to lead to the right document than competing methods.
|
| 302 |
+
|
| 303 |
+
# 6 Limitations
|
| 304 |
+
|
| 305 |
+
A proper user study would provide a valuable complement to the current evaluation and contribute to a fuller picture. However, this presents significant challenges that are beyond the scope of the current work. For instance, is not trivial to adequately design a meaningful task for human raters conducive to good agreement, e.g., it may be inevitable to second-guess the original query intent in the presence of unexpected interpretations brought to the surface by the suggestions. For the time being, we feel the automatic evaluation proposed here will be more valuable, as it makes direct comparison and reproducibility straightforward.
|
| 306 |
+
|
| 307 |
+
Secondly, it seems sensible to further evaluate the query suggestions in an end-to-end IR task. Preliminary experiments in this direction using MS Marco proved somewhat inconclusive, while they introduce significant complexity. The data annotations are sparse (one passage per query, by and large) and it is often the case that multiple relevant passages exist for the same query.<sup>3</sup> This makes reranking a crucial but faulty component, opening up a somewhat orthogonal front. The ideal evaluation would rely on a deeper manual analysis for a limited query set, e.g., TREC-style (e.g., cf. Craswell et al. (2020)).
|
| 308 |
+
|
| 309 |
+
We leave both for future work.
|
| 310 |
+
|
| 311 |
+
# Acknowledgements
|
| 312 |
+
|
| 313 |
+
We would like to thank Léonard Hussenot for his insightful feedback and the support with the Diversity & Fluency experiments. Furthermore, we thank Wojciech Gajewski, Sascha Rothe, and Lierni Sestorain Saralegui for helpful discussions and feedback throughout the course of the project.
|
| 314 |
+
|
| 315 |
+
# References
|
| 316 |
+
|
| 317 |
+
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaojiang Zheng. 2015. TensorFlow: Large-scale machine learning on heterogeneous systems. Software available from tensorflow.org.
|
| 318 |
+
|
| 319 |
+
Leonard Adolphs, Benjamin Borschinger, Christian Buck, Michelle Chen Huebscher, Massimiliano Ciaramita, Lasse Espeholt, Thomas Hofmann, Yannic Kilcher, Sascha Rothe, Pier Giuseppe Sessa, and Lierni Sestorain. 2022. Boosting search engines with interactive agents. Transactions on Machine Learning Research.
|
| 320 |
+
|
| 321 |
+
Leonard Adolphs, Kurt Shuster, Jack Urbanek, Arthur Szlam, and Jason Weston. 2021. Reason first, then respond: Modular generation for knowledge-infused dialogue. CoRR, abs/2111.05204.
|
| 322 |
+
|
| 323 |
+
Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew Dai, Rafal Jozefowicz, and Samy Bengio. 2016. Generating sentences from a continuous space. In Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning, pages 10-21, Berlin, Germany. Association for Computational Linguistics.
|
| 324 |
+
|
| 325 |
+
Christian Buck, Jannis Bulian, Massimiliano Ciaramita, Wojciech Gajewski, Andrea Gesmundo, Neil Houlsby, and Wei Wang. 2018. Ask the right questions: Active question reformulation with reinforcement learning. In International Conference on Learning Representations.
|
| 326 |
+
|
| 327 |
+
Zewei Chu, Mingda Chen, Jing Chen, Miaosen Wang, Kevin Gimpel, Manaal Faruqui, and Xiance Si. 2020. How to ask better questions? a large-scale multi-domain dataset for rewriting ill-formed questions. Proceedings of the AAAI Conference on Artificial Intelligence, 34(05):7586-7593.
|
| 328 |
+
|
| 329 |
+
Nick Craswell, Bhaskar Mitra, Emine Yilmaz, and Daniel Campos. 2020. Overview of the TREC 2020 deep learning track.
|
| 330 |
+
|
| 331 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics.
|
| 332 |
+
|
| 333 |
+
Xinya Du, Junru Shao, and Claire Cardie. 2017. Learning to ask: Neural question generation for reading comprehension.
|
| 334 |
+
|
| 335 |
+
Geoffrey E Hinton and Sam Roweis. 2002. Stochastic neighbor embedding. In Advances in Neural Information Processing Systems, volume 15. MIT Press.
|
| 336 |
+
|
| 337 |
+
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. The curious case of neural text degeneration. In International Conference on Learning Representations.
|
| 338 |
+
|
| 339 |
+
Michelle Chen Huebscher, Christian Buck, Massimiliano Ciaramita, and Sascha Rothe. 2022. Zero-shot retrieval with search agents and hybrid environments.
|
| 340 |
+
|
| 341 |
+
Gautier Izacard, Mathilde Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand Joulin, and Edouard Grave. 2021. Towards unsupervised dense information retrieval with contrastive learning. CoRR, abs/2112.09118.
|
| 342 |
+
|
| 343 |
+
Gautier Izacard and Edouard Grave. 2021. Leveraging passage retrieval with generative models for open domain question answering. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 874-880, Online. Association for Computational Linguistics.
|
| 344 |
+
|
| 345 |
+
Nasreen Jaleel, James Allan, W. Croft, Fernando Diaz, Leah Larkey, Xiaoyan Li, Mark Smucker, and Courtney Wade. 2004. Umass at trec 2004: Novelty and hard.
|
| 346 |
+
|
| 347 |
+
Kalervo Järvelin and Jaana Kekäläinen. 2002. Cumulated Gain-Based Evaluation of IR Techniques. ACM Trans. Inf. Syst., 20(4):422-446.
|
| 348 |
+
|
| 349 |
+
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6769-6781, Online. Association for Computational Linguistics.
|
| 350 |
+
|
| 351 |
+
Diederik P Kingma and Max Welling. 2013. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114.
|
| 352 |
+
|
| 353 |
+
Mojtaba Komeili, Kurt Shuster, and Jason Weston. 2021. Internet-augmented dialogue generation. CoRR, abs/2107.07566.
|
| 354 |
+
|
| 355 |
+
Vishwajeet Kumar, Kireeti Boorla, Yogesh Meena, Ganesh Ramakrishnan, and Yuan-Fang Li. 2018. Automating reading comprehension by generating question and answer pairs. CoRR, abs/1803.03664.
|
| 356 |
+
|
| 357 |
+
Tessa Lau and Eric Horvitz. 1999. Patterns of Search: Analyzing and Modeling Web Query Refined. In Proceedings of the 7th International on User Modeling.
|
| 358 |
+
|
| 359 |
+
Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. 2019. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6086–6096, Florence, Italy. Association for Computational Linguistics.
|
| 360 |
+
|
| 361 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020a. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871-7880, Online. Association for Computational Linguistics.
|
| 362 |
+
|
| 363 |
+
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Kuttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. 2020b. Retrievalaugmented generation for knowledge-intensive nlp tasks. In Advances in Neural Information Processing Systems, volume 33, pages 9459-9474. Curran Associates, Inc.
|
| 364 |
+
|
| 365 |
+
Patrick Lewis, Yuxiang Wu, Linqing Liu, Pasquale Minervini, Heinrich Kuttler, Aleksandra Piktus, Pontus Stenetorp, and Sebastian Riedel. 2021. PAQ: 65 million probably-asked questions and what you can do with them. Transactions of the Association for Computational Linguistics, 9:1098-1115.
|
| 366 |
+
|
| 367 |
+
Chunyuan Li, Xiang Gao, Yuan Li, Baolin Peng, Xiujun Li, Yizhe Zhang, and Jianfeng Gao. 2020. Optimus: Organizing sentences via pre-trained modeling of a latent space. arXiv preprint arXiv:2004.04092.
|
| 368 |
+
|
| 369 |
+
Hang Li, Shengyao Zhuang, Ahmed Mourad, Xueguang Ma, Jimmy Lin, and Guido Zuccon. 2022. Improving query representations for dense retrieval with pseudo relevance feedback: A reproducibility study. In Advances in Information Retrieval, pages 599-612, Cham. Springer International Publishing.
|
| 370 |
+
|
| 371 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. 2015. Adversarial autoencoders. arXiv preprint arXiv:1511.05644.
|
| 372 |
+
|
| 373 |
+
Ivan Montero, Nikolaos Pappas, and Noah A. Smith. 2021. Sentence bottleneck autoencoders from transformer language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1822-1831, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 374 |
+
|
| 375 |
+
Reiichiro Nakano, Jacob Hilton, Suchir Balaji, Jeff Wu, Long Ouyang, Christina Kim, Christopher Hesse, Shantanu Jain, Vineet Kosaraju, William Saunders, Xu Jiang, Karl Cobbe, Tyna Eloundou, Gretchen Krueger, Kevin Button, Matthew Knight, Benjamin Chess, and John Schulman. 2021. WebGPT: Browser-assisted question-answering with human feedback. CoRR, abs/2112.09332.
|
| 376 |
+
|
| 377 |
+
Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. 2016. MS MARCO: A Human Generated MAchine Reading COprehension Dataset.
|
| 378 |
+
|
| 379 |
+
Jianmo Ni, Chen Qu, Jing Lu, Zhuyun Dai, Gustavo Hernández Abrego, Ji Ma, Vincent Y. Zhao,
|
| 380 |
+
|
| 381 |
+
Yi Luan, Keith B. Hall, Ming-Wei Chang, and Yinfei Yang. 2021. Large dual encoders are generalizable retrievers. CoRR, abs/2112.07899.
|
| 382 |
+
|
| 383 |
+
Rodrigo Nogueira and Kyunghyun Cho. 2017. Task-oriented query reformulation with reinforcement learning. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 574-583, Copenhagen, Denmark. Association for Computational Linguistics.
|
| 384 |
+
|
| 385 |
+
Dipasree Pal, Mandar Mitra, and Kalyankumar Datta. 2013. Query expansion using term distribution and term association.
|
| 386 |
+
|
| 387 |
+
Seongmin Park and Jihwa Lee. 2021. Finetuning pretrained transformers into variational autoencoders. arXiv preprint arXiv:2108.02446.
|
| 388 |
+
|
| 389 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67.
|
| 390 |
+
|
| 391 |
+
Stephen Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: Bm25 and beyond. Foundations and Trends in Information Retrieval, 3(4):333-389.
|
| 392 |
+
|
| 393 |
+
J. J. Rocchio. 1971. Relevance feedback in information retrieval. In G. Salton, editor, The Smart retrieval system - experiments in automatic document processing, pages 313-323. Englewood Cliffs, NJ: Prentice-Hall.
|
| 394 |
+
|
| 395 |
+
Tianxiao Shen, Jonas Mueller, Dr.Regina Barzilay, and Tommi Jaakkola. 2020. Educating text autoencoders: Latent representation guidance via denoising. In Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 8719-8729. PMLR.
|
| 396 |
+
|
| 397 |
+
Anshumali Shrivastava and Ping Li. 2014. Asymmetric lsh (alsh) for sublinear time maximum inner product search (mips). In Advances in Neural Information Processing Systems, volume 27. Curran Associates, Inc.
|
| 398 |
+
|
| 399 |
+
Kurt Shuster, Mojtaba Komeili, Leonard Adolphs, Stephen Roller, Arthur Szlam, and Jason Weston. 2022. Language models that seek for knowledge: Modular search & generation for dialogue and prompt completion.
|
| 400 |
+
|
| 401 |
+
Kurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela, and Jason Weston. 2021. Retrieval augmentation reduces hallucination in conversation. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 3784-3803, Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 402 |
+
|
| 403 |
+
Jaime Teevan, Christine Alvarado, Mark S. Ackerman, and David R. Karger. 2004. The Perfect Search Engine is Not Enough: A Study of Orienteering Behavior in Directed Search. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems.
|
| 404 |
+
|
| 405 |
+
Nandan Thakur, Nils Reimers, Andreas Rückle, Abhishek Srivastava, and Iryna Gurevych. 2021. BEIR: A heterogenous benchmark for zero-shot evaluation of information retrieval models. CoRR, abs/2104.08663.
|
| 406 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30.
|
| 407 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierrick Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. 2020. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 38-45, Online. Association for Computational Linguistics.
|
| 408 |
+
Zeqiu Wu, Yi Luan, Hannah Rashkin, David Reitter, Hannaneh Hajishirzi, Mari Ostendorf, and Gaurav Singh Tomar. 2021. CONQRR: Conversational query rewriting for retrieval with reinforcement learning. arxiv.org:2112.08558.
|
| 409 |
+
Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul N. Bennett, Junaid Ahmed, and Arnold Overwijk. 2021. Approximate nearest neighbor negative contrastive learning for dense text retrieval. In International Conference on Learning Representations.
|
| 410 |
+
Junbo Zhao, Yoon Kim, Kelly Zhang, Alexander Rush, and Yann LeCun. 2018. Adversarily regularized autoencoders. In International conference on machine learning, pages 5902-5911. PMLR.
|
| 411 |
+
Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. 2018. Texygen: A benchmarking platform for text generation models. In SIGIR, pages 1097-1100.
|
| 412 |
+
|
| 413 |
+
# A Appendix
|
| 414 |
+
|
| 415 |
+
# A.1 Additional Results of the Query Suggestion Model
|
| 416 |
+
|
| 417 |
+
<table><tr><td rowspan="2">Model</td><td colspan="4">MSMarco</td><td colspan="4">NQ</td></tr><tr><td>1</td><td>3</td><td>5</td><td>10</td><td>1</td><td>3</td><td>5</td><td>10</td></tr><tr><td>Original Query</td><td>.420</td><td>-</td><td>-</td><td>-</td><td>.495</td><td>-</td><td>-</td><td>-</td></tr><tr><td>MQR</td><td>.439 .001</td><td>.454 .005</td><td>.464 .005</td><td>.477 .004</td><td>.531 .001</td><td>.548 .008</td><td>.557 .009</td><td>.571 .005</td></tr><tr><td>Sampling+QD</td><td>.440 .001</td><td>.469 .005</td><td>.484 .007</td><td>.506 .013</td><td>.522 .001</td><td>.548 .005</td><td>.561 .006</td><td>.580 .005</td></tr><tr><td>RM3</td><td>.445 .003</td><td>.472 .016</td><td>.495 .009</td><td>.522 .011</td><td>.526 .003</td><td>.552 .012</td><td>.571 .006</td><td>.589 .012</td></tr><tr><td>qsT5</td><td>.455 .002</td><td>.496 .010</td><td>.519 .010</td><td>.554 .011</td><td>.541 .003</td><td>.582 .011</td><td>.615 .008</td><td>.637 .009</td></tr><tr><td>qsT5-plain</td><td>.440 .005</td><td>.470 .007</td><td>.488 .005</td><td>.508 .008</td><td>.520 .006</td><td>.543 .006</td><td>.553 .010</td><td>.577 .013</td></tr></table>
|
| 418 |
+
|
| 419 |
+
Table 7: Retrieval metric nDCG@10 of the query suggestion models on the MSMarco and NQ test sets. The numbers represent the nDCG@10 of the best 1, 3, 5, and 10 reformulations (including the original query), respectively, of different models. The small number indicates the standard deviation when doing bootstrap sampling from up to 10 generations of the models.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
(a)
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
(b)
|
| 426 |
+
Figure 6: Inner product of the best reformulation with the gold paragraph for the various query suggestion models on the MSMarco (a) and NQ (b) test sets. The dashed line shows the inner product of the original query with the gold paragraph. The bars represent the inner product with the gold paragraph of the best 1, 3, 5, and 10 reformulations (including the original query), respectively, of different models. The error bars show the 95 percent confidence interval when sampling repeatedly from up to 10 generations of the models. The RM3 and qST5 models are using pseudo-relevance feedback, i.e., information about the top-retrieved paragraphs, while the rest is only mapping from query to query.
|
| 427 |
+
|
| 428 |
+
# A.2 Training and Model Details
|
| 429 |
+
|
| 430 |
+
# A.2.1 Query Decoder Model
|
| 431 |
+
|
| 432 |
+
We initialize the query decoder from the Tensorflow (Abadi et al., 2015) T5-base (Raffel et al., 2020) checkpoint for conditional language generation of the Huggingface transformers library (Wolf et al., 2020). We train and use only the decoder of the 220M parameter model with 12 layers, 12 heads, and a hidden state dimension of 768. We train the model on a random sample of 3M queries from the PAQ dataset (Lewis et al., 2021) with the hyperparameters provided in Table 8 for 130 hours on 16 Cloud TPU v3. Given the size of the model and the associated cost of training, we do not do an exhaustive grid search over the parameters but only sweep over four different values for the learning rate (1e-4, 3e-4, 5e-4, 1e-3). We determine the best model according to sequence classification accuracy on a held-out dev set.
|
| 433 |
+
|
| 434 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Number Decoder Layers</td><td>12</td></tr><tr><td>Number Heads</td><td>12</td></tr><tr><td>Head Dimension</td><td>64</td></tr><tr><td>Embedding Dimension</td><td>768</td></tr><tr><td>MLP Dimension</td><td>2048</td></tr><tr><td>Batch Size</td><td>64</td></tr><tr><td>Dropout Rate</td><td>0.0</td></tr><tr><td>Base Learning Rate</td><td>0.0005</td></tr><tr><td>Warm-up Steps</td><td>100</td></tr><tr><td>Optimizer</td><td>AdamW</td></tr><tr><td>Weight Decay Rate</td><td>0.01</td></tr><tr><td>Finetuning steps on PAQ</td><td>5M</td></tr></table>
|
| 435 |
+
|
| 436 |
+
# A.2.2 qsT5 Query Suggestion Model
|
| 437 |
+
|
| 438 |
+
We initialize our qsT5 and qsT5-plain models from the T5-large checkpoint and train them with the parameters provided in Table 9 for $\sim 24$ hours on 16 Cloud TPU v3 each. We prefix the query with the keyword "Query: " and each passage, for the qsT5 model, with the keyword "Paragraph: ". For this model we rely on standard hyperparameters and, given the cost of training, do not further grid search for better values.
|
| 439 |
+
|
| 440 |
+
Table 8: Training Parameters for the T5-base Query Decoder model
|
| 441 |
+
|
| 442 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Number Encoder Layers</td><td>24</td></tr><tr><td>Number Decoder Layers</td><td>24</td></tr><tr><td>Number Heads</td><td>16</td></tr><tr><td>Head Dimension</td><td>64</td></tr><tr><td>Embedding Dimension</td><td>1024</td></tr><tr><td>MLP Dimension</td><td>2816</td></tr><tr><td>Batch Size</td><td>128</td></tr><tr><td>Dropout Rate</td><td>0.1</td></tr><tr><td>Base Learning Rate</td><td>0.001</td></tr><tr><td>Warm-up Steps</td><td>1000</td></tr><tr><td>Optimizer</td><td>AdaFactor</td></tr><tr><td>Input Token Length</td><td>1024</td></tr><tr><td>Output Token Length</td><td>32</td></tr><tr><td>Finetuning steps (qsT5)</td><td>40k</td></tr><tr><td>Finetuning steps (qsT5-plain)</td><td>31k</td></tr></table>
|
| 443 |
+
|
| 444 |
+
Table 9: Training Parameters for the T5-large qsT5 and qsT5-plain Query Suggestion Models
|
| 445 |
+
|
| 446 |
+
# A.2.3 MQR Query Suggestion Model
|
| 447 |
+
|
| 448 |
+
As with our qsT5 models, we initialize the MQR query reformulation model from the T5-large checkpoint. We train the model with the parameters provided in Table 10 for $\sim 3\mathrm{h}$ on 16 Cloud TPU v3, and choose the best checkpoint according to sequence accuracy on the dev set. Training quickly overfits after about
|
| 449 |
+
|
| 450 |
+
2k step ( $\sim 16\mathrm{min}$ ). We increased the batch size to 2048 and found the adding dropout didn't help but did no further hyperparameter tuning.
|
| 451 |
+
|
| 452 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Number Encoder Layers</td><td>24</td></tr><tr><td>Number Decoder Layers</td><td>24</td></tr><tr><td>Number Heads</td><td>16</td></tr><tr><td>Head Dimension</td><td>64</td></tr><tr><td>Embedding Dimension</td><td>1024</td></tr><tr><td>MLP Dimension</td><td>2816</td></tr><tr><td>Batch Size</td><td>2048</td></tr><tr><td>Dropout Rate</td><td>0.0</td></tr><tr><td>Fixed Learning Rate</td><td>0.001</td></tr><tr><td>Optimizer</td><td>AdaFactor</td></tr><tr><td>Input Token Length</td><td>32</td></tr><tr><td>Output Token Length</td><td>32</td></tr><tr><td>Finetuning steps</td><td>1800</td></tr></table>
|
| 453 |
+
|
| 454 |
+
# A.3 Dataset Details
|
| 455 |
+
|
| 456 |
+
We experiment with a few different thresholds on what constitutes a successful reformulation for our generated dataset. We achieve the best results in terms of sequence classification accuracy of a held-out dev set of reformulations for the dataset described in the main body of the paper. Our final dataset of successful reformulations of MSMarco-train queries contains 863,207 successful query rewrites that are split among a training, development, and test set as reported in Table 11.
|
| 457 |
+
|
| 458 |
+
Table 10: Training Parameters for the T5-large MQR Query Reformulation Model
|
| 459 |
+
|
| 460 |
+
<table><tr><td>Split</td><td>Number of Examples</td></tr><tr><td>Train</td><td>768,372</td></tr><tr><td>Dev</td><td>86,478</td></tr><tr><td>Test</td><td>8,457</td></tr><tr><td>Total</td><td>863,307</td></tr></table>
|
| 461 |
+
|
| 462 |
+
Table 11: Successful Reformulation Dataset Details
|
| 463 |
+
|
| 464 |
+
<table><tr><td>Type</td><td>Query</td><td>nDCG@10</td></tr><tr><td>Original Query</td><td>shopko kennewick address</td><td>0.63</td></tr><tr><td rowspan="3">MQR</td><td>Is the address for the Shopko in Kennewick correct?</td><td>1.00</td></tr><tr><td>What is this shopko in Kennewick, NY address?</td><td>1.00</td></tr><tr><td>Is there a Shopko in Kennewick with the following address?</td><td>1.00</td></tr><tr><td rowspan="3">RM3</td><td>shopko kennewick address 867</td><td>0.50</td></tr><tr><td>shopko kennewick address store</td><td>1.00</td></tr><tr><td>shopko kennewick address 5500</td><td>0.50</td></tr><tr><td rowspan="3">Sampling+QD</td><td>who is the localization of koieko shopphan</td><td>0.00</td></tr><tr><td>shopk kennewickko address in shopington</td><td>0.63</td></tr><tr><td>shopko kennewick is located in which address</td><td>0.63</td></tr><tr><td rowspan="3">qsT5</td><td>what is the address of shopko located in kennewick washington</td><td>1.00</td></tr><tr><td>what is the location of shopko in kennewick washington</td><td>1.00</td></tr><tr><td>where is shopko store in kennewick washington</td><td>1.00</td></tr><tr><td rowspan="3">qsT5-plain</td><td>what time is open shopko at 867 kennewick</td><td>1.00</td></tr><tr><td>what is the main store at shopko kabetown</td><td>0.00</td></tr><tr><td>when does store for shopko located in north kansas</td><td>0.00</td></tr><tr><td>Gold Paragraph</td><td colspan="2">Information about possible store closing and store hours for: Shopko in Kennewick, Washington, 99336 Address: 867 North Columbia Center Blvd | Phone: (509) 736-0884 | Type: Store, Department Store, Retail More information:</td></tr></table>
|
| 465 |
+
|
| 466 |
+
Table 12: Examples of the top query suggestions for the MSMarco query "shopko kennewick address". The final row shows the human-labeled gold paragraph and the nDCG@10 retrieval score is provided for each query. In this example, we see that the qsT5 model can leverage the PRF to successfully generate queries that focus on Kennewick in Washington. For the non-PRF models, this is not possible.
|
| 467 |
+
|
| 468 |
+
<table><tr><td>Type</td><td>Query</td><td>nDCG@10</td></tr><tr><td>Original Query</td><td>definition of a surge</td><td>0.50</td></tr><tr><td rowspan="3">MQR</td><td>What is the definition of a surge?</td><td>0.43</td></tr><tr><td>What is the definition of a surge?</td><td>0.43</td></tr><tr><td>What is a surge?</td><td>0.63</td></tr><tr><td rowspan="3">RM3</td><td>definition of a surge surge</td><td>0.33</td></tr><tr><td>definition of a surge sudden</td><td>0.43</td></tr><tr><td>definition of a surge increase</td><td>0.30</td></tr><tr><td rowspan="3">Sampling+QD</td><td>what is the definition of a surge</td><td>0.50</td></tr><tr><td>a surge to a begin in the surge definition</td><td>0.43</td></tr><tr><td>what is the definition of a surge</td><td>0.50</td></tr><tr><td rowspan="3">qsT5</td><td>what is the definition of a surge in the sea</td><td>0.50</td></tr><tr><td>what is the meaning of surge in a wave</td><td>0.63</td></tr><tr><td>what is the definition of a surge in a sound</td><td>1.00</td></tr><tr><td rowspan="3">qsT5-plain</td><td>what is the swiveling of a rolling motion</td><td>0.00</td></tr><tr><td>what is the meaning of a surge in the emotional side of a big wave</td><td>0.43</td></tr><tr><td>the surge of a wave or ayurvedic chorus</td><td>0.00</td></tr><tr><td>Gold Paragraph</td><td colspan="2">surge. 1. a strong, wavelike forward movement, rush, or sweep: the surge of the crowd. 2. a sudden, strong rush or burst: a surge of energy. 3. a strong, swelling, wavelike volume or body of something. 4. the rolling swell of the sea. 5. a swelling wave; billow. 6. the swelling and rolling sea. 7. a sudden rush or burst of electric current or voltage. b. a violent oscillatory disturbance.</td></tr></table>
|
| 469 |
+
|
| 470 |
+
Table 13: Examples of the top query suggestions for the MSMarco query "definition of a surge". The final row shows the human-labeled gold paragraph and the nDCG@10 retrieval score is provided for each query. Here, we see that the qsT5 model provides more useful additions to the query than the simple rephrasing of the MQR model. It adds topical terms like "sea", "wave", or "sound" with which it is possible to obtain improved retrieval performance.
|
| 471 |
+
|
| 472 |
+
<table><tr><td>Type</td><td>Query</td><td>nDCG@10</td></tr><tr><td>Original Query</td><td>what aircraft can you fly with a ppl</td><td>0.29</td></tr><tr><td rowspan="3">MQR</td><td>What aircraft can you fly with a passenger?</td><td>0.00</td></tr><tr><td>What aircraft can you fly with passengers?</td><td>0.00</td></tr><tr><td>Which aircraft can you fly with a passenger?</td><td>0.00</td></tr><tr><td rowspan="3">RM3</td><td>what aircraft can you fly with a ppl pilot</td><td>0.36</td></tr><tr><td>what aircraft can you fly with a ppl license</td><td>0.32</td></tr><tr><td>what aircraft can you fly with a ppl private</td><td>0.43</td></tr><tr><td rowspan="3">Sampling+QD</td><td>what aircraft can you fly with a ppl</td><td>0.29</td></tr><tr><td>what ships did you fly a learn park and can server ( pplalo</td><td>0.00</td></tr><tr><td>a able a flying wings able islands with a pistol pl</td><td>0.00</td></tr><tr><td rowspan="3">qsT5</td><td>what kind of airplane can you fly with a ppl</td><td>0.00</td></tr><tr><td>what type of aircraft are you able to fly a private pilot</td><td>1.00</td></tr><tr><td>what does a personal pilot ( a ppl ) mean</td><td>0.00</td></tr><tr><td rowspan="3">qsT5-plain</td><td>what are the types of aircraft that can be used for private pilots</td><td>1.00</td></tr><tr><td>what kind of licenses are required to have a private pilot</td><td>0.32</td></tr><tr><td>how many pilots are required to take a commercial flight</td><td>0.00</td></tr><tr><td>Gold Paragraph</td><td colspan="2">The types of aircraft one may fly depends on what they are certified for, e.g. Airplane Single Engine land. See Categories and Classes for a list. Usually, a newly minted private pilot is certified to fly all planes in the generic category single engine piston, often abbreviated SEP. This includes the Cessna 172, PA-28, Diamond DA40, Robin DR400 and similar planes. More complex types, like those with retractable undercarriage or variable pitch props, require additional training and licensing.</td></tr></table>
|
| 473 |
+
|
| 474 |
+
Table 14: Examples of the top query suggestions for the MSMarco query "what aircraft can you fly with a ppl". The final row shows the human-labeled gold paragraph and the nDCG@10 retrieval score is provided for each query. In this example only the two qsT5 models are able to add the term "private pilot" to the query that leads to good retrieval performance. Notably, the RM3 PRF baseline ranks these two terms separately as important and adds them to their suggestions.
|
| 475 |
+
|
| 476 |
+
# A.5 Additional Traversal Examples
|
| 477 |
+
|
| 478 |
+

|
| 479 |
+
Figure 7: Visualization of the latent-space traversal from query to gold paragraph, using 2D t-SNE. The blue point denotes the embedding of the original query "what is the third law". The green squares are the embeddings of the retrieved paragraphs for this query. The closest one about the "Third Law of Motion" is shown in the green text bar. The orange "x's" denote the embeddings of the reformulations of the query decoder when moving to the gold paragraph depicted as the red plus. The orange and red text bars show the final reformulation and the gold paragraph text, respectively.
|
| 480 |
+
|
| 481 |
+
<table><tr><td>Type</td><td>Query</td><td>nDCG@10</td></tr><tr><td>Original Query</td><td>where is Quincy located</td><td>0.00</td></tr><tr><td rowspan="8">Reformulations</td><td>where is Quincy located in miami</td><td>0.00</td></tr><tr><td>where is Quincy located in a state</td><td>0.00</td></tr><tr><td>where is the city of Quincy located</td><td>0.00</td></tr><tr><td>where is the state of Quincy located</td><td>0.00</td></tr><tr><td>where is the city of Quincy located in illinois</td><td>0.39</td></tr><tr><td>where is the climate of Quincy located in illinois</td><td>1.00</td></tr><tr><td>where does the water come from in quincy illinois</td><td>1.00</td></tr><tr><td>what is the average rainfall in quincy illinois</td><td>1.00</td></tr><tr><td>Gold Paragraph</td><td colspan="2">Location/Climate. The western most city in Illinois, Quincy is located along the eastern bank of the Mississippi River atop 90 foot limestone bluffs which overlook a wide expanse of the river and a natural harbor. Residents enjoy a moderate, four season climate where the sun shines nearly 68% of the time. This area of Illinois receives an average of 36.86 inches of rainfall a year, and an average of 24 inches of snowfall. The average winter temperature is 28 degrees and the average summer temperature is 79 degrees.</td></tr></table>
|
| 482 |
+
|
| 483 |
+
Table 15: Example of a traversal on an MSMarco query. Here, we traverse the latent space in equidistant steps from the embedding of the original query "where is quincy located", which results in an nDCG@10 retrieval score of 0, to the embedding of the gold paragraph. The queries decoded from a latent code close to the gold paragraph are concerned with the climate of Quincy, Illinois, which is the focus of the gold paragraph.
|
| 484 |
+
|
| 485 |
+
<table><tr><td>Type</td><td>Query</td><td>nDCG@10</td></tr><tr><td>Original Query</td><td>weather year round in new york city</td><td>0.00</td></tr><tr><td rowspan="6">Reformulations</td><td>what is the weather year in new york city</td><td>0.33</td></tr><tr><td>what is the weather in new york city each year</td><td>0.00</td></tr><tr><td>what is the weather in new york city</td><td>0.00</td></tr><tr><td>what is the hottest season in new york city</td><td>0.39</td></tr><tr><td>when is the coldest month in new york</td><td>0.30</td></tr><tr><td>when is the hottest month in new york</td><td>1.00</td></tr><tr><td>Gold Paragraph</td><td colspan="2">New York: Annual Weather Averages. July is the hottest month in New York with an average temperature of 25°C (76°F) and the coldest is January at 2°C (35°F) with the most daily sunshine hours at 11 in July. The wettest month is May with an average of 114mm of rain.</td></tr></table>
|
| 486 |
+
|
| 487 |
+
Table 16: Example of a traversal on an MSMarco query. Here, we traverse the latent space in equidistant steps from the embedding of the original query "weather year round in new york city", which results in an nDCG@10 retrieval score of 0, to the embedding of the gold paragraph. The queries decoded from a latent code close to the gold paragraph are more specific, asking about the hottest and coldest month in New York.
|
| 488 |
+
|
| 489 |
+
<table><tr><td>Type</td><td>Query</td><td>nDCG@10</td></tr><tr><td>Original Query</td><td>what year declaration of independence</td><td>0.00</td></tr><tr><td rowspan="10">Reformulations</td><td>when was the declaration of independence year</td><td>0.00</td></tr><tr><td>when was the declaration of independence year</td><td>0.00</td></tr><tr><td>what year is the declaration of independence</td><td>0.00</td></tr><tr><td>when was the declaration of independence</td><td>0.00</td></tr><tr><td>what is the declaration of independence in the year</td><td>0.33</td></tr><tr><td>what is the declaration of independence in most of the person</td><td>0.00</td></tr><tr><td>what is the declaration of independence in most of them</td><td>0.00</td></tr><tr><td>when was the declaration of independence ( most important )</td><td>1.00</td></tr><tr><td>when was the declaration of independence ( dst ) on the most important document</td><td>1.00</td></tr><tr><td>when was the declaration of independence ( most important )</td><td>1.00</td></tr><tr><td>Gold Paragraph</td><td colspan="2">The Declaration of Independence is, of course, one of the country's most important documents, adopted at the Second Continental Congress on July 4, 1776. The text and purpose of the Declaration would likely be recognizable to those who have applied for U.S. citizenship, since questions about the document appear on the naturalization test.</td></tr></table>
|
| 490 |
+
|
| 491 |
+
Table 17: Example of a traversal on an MSMarco query. Here, we traverse the latent space in equidistant steps from the embedding of the original query "what year declaration of independence", which results in an nDCG@10 retrieval score of 0, to the embedding of the gold paragraph. The queries decoded from a latent code close to the gold paragraph, include the keyword "important" that seems to be helpful in retrieving this particular gold paragraph.
|
| 492 |
+
|
| 493 |
+
<table><tr><td>Type</td><td>Query</td><td>nDCG@10</td></tr><tr><td>Original Query</td><td>how many us dollars are currently in circulation</td><td>0.00</td></tr><tr><td rowspan="10">Reformulations</td><td>how many dollars are currently in circulation</td><td>0.00</td></tr><tr><td>how many dollars are in circulation in us</td><td>0.00</td></tr><tr><td>how many dollars are in circulation in the us</td><td>0.00</td></tr><tr><td>how many dollars are in circulation in the us</td><td>0.00</td></tr><tr><td>how many dollars are in circulation in the us</td><td>0.00</td></tr><tr><td>what are the dollars that are in circulation us</td><td>0.00</td></tr><tr><td>what are the sets of dollars in the us</td><td>0.00</td></tr><tr><td>what are the denominations of dollars around us</td><td>0.50</td></tr><tr><td>what are the denominations of $ 100 were there</td><td>1.00</td></tr><tr><td>what are the denominations of $ more than that were used in the us</td><td>1.00</td></tr><tr><td>Gold Paragraph</td><td colspan="2">Large denominations of United States currency. Large denominations of United States currency greater than $100 were circulated by the United States Treasury until 1969. Since then, the U.S. dollar has only been issued in seven denominations: $1, $2, $5, $10, $20, $50, and $100.</td></tr></table>
|
| 494 |
+
|
| 495 |
+
Table 18: Example of a traversal on an MSMarco query. Here, we traverse the latent space in equidistant steps from the embedding of the original query "how many us dollars are currently in circulation", which results in an nDCG@10 retrieval score of 0, to the embedding of the gold paragraph. The decoded queries drift away from the original questions of dollars in circulation to the denominations of dollar bills. The reason of this drift becomes obvious by looking at the gold paragraph that explains the denominations of the US Dollar but not the money currently in circulation. This is one of many examples where the labeled gold paragraph is not correct and hence the decoded queries drift away from the original query.
|
| 496 |
+
|
| 497 |
+
<table><tr><td>Type</td><td>Query</td><td>nDCG@10</td></tr><tr><td>Original Query</td><td>are Tesla electric cars</td><td>0.00</td></tr><tr><td rowspan="10">Reformulations</td><td>are Tesla electric cars no are they electric car</td><td>0.00</td></tr><tr><td>is Tesla electric cars a car or they are electric</td><td>0.00</td></tr><tr><td>tesla electric cars are they or electric car</td><td>0.00</td></tr><tr><td>tesla electric cars are they being or electric</td><td>0.00</td></tr><tr><td>tesla cars are electric to be or electric cars</td><td>0.00</td></tr><tr><td>tesla electric cars are off of what kind of cars</td><td>0.00</td></tr><tr><td>tesla electric cars are a bolton on which time</td><td>0.00</td></tr><tr><td>tesla electric cars a mile off what speed are they</td><td>0.00</td></tr><tr><td>737 el taton speedway was flying away on how many cars</td><td>1.00</td></tr><tr><td>737 bolts on a ta speedway how many miles off airport</td><td>1.00</td></tr><tr><td>Gold Paragraph</td><td colspan="2">A Qantas Boeing 737 aircraft and a Tesla electric car race on the nearly 2 mile runway at Avalon Airport. The Tesla was hard to catch off the start. Both travelled neck and neck as the 737 reached take-off speed of 161 mph and the Tesla hit 155 mph. USA TODAY.</td></tr></table>
|
| 498 |
+
|
| 499 |
+
Table 19: Example of a traversal on an MSMarco query. Here, we traverse the latent space in equidistant steps from the embedding of the original query "are Tesla electric cars", which results in an nDCG@10 retrieval score of 0, to the embedding of the gold paragraph. In this example the final decoded query perfectly solves the retrieval problem (nDCG of 1) even though being semantically very strange. These queries are an interesting example as their embedding is close to the embedding of the gold paragraph, even though they have little non-stopword overlap with the gold paragraph (in the second to last query, only "737" overlaps exactly).
|
decodinganeuralretrieverslatentspaceforquerysuggestion/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eccd2ec961c04d0db2c2241dc44723bd110aff83c8326689a2a1406b6e2daefb
|
| 3 |
+
size 1469787
|
decodinganeuralretrieverslatentspaceforquerysuggestion/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30c0b7c901b3b4db2cef34db2f71ab48e1b492f8f36a7b6ca3d0fe5b9af319fc
|
| 3 |
+
size 439560
|
deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/b1a5f9bf-ce66-4ad3-a038-fc1f5fe3d891_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9eefadc7d88ea52bc3a2c78480a2e93c0dafa3c0ac712c69d5abaa212f2edd44
|
| 3 |
+
size 111295
|
deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/b1a5f9bf-ce66-4ad3-a038-fc1f5fe3d891_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f16762f8161033dd305587cfc6898937f9519335b41dcdabecb5e672e2f237ff
|
| 3 |
+
size 132489
|
deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/b1a5f9bf-ce66-4ad3-a038-fc1f5fe3d891_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0ed651017aa7a2f8002c8aab107f9e525b1987aa640a20de9c2df28a4bc073b6
|
| 3 |
+
size 1183544
|
deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/full.md
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deconfounding Legal Judgment Prediction for European Court of Human Rights Cases Towards Better Alignment with Experts
|
| 2 |
+
|
| 3 |
+
Santosh T.Y.S.S $^{1*}$ and Shanshan Xu $^{1*}$ and Oana Ichim $^{2}$ and Matthias Grabmair $^{1}$
|
| 4 |
+
|
| 5 |
+
<sup>1</sup>School of Computation, Information, and Technology; Technical University of Munich, Germany
|
| 6 |
+
|
| 7 |
+
$^{2}$ Graduate Institute of International and Development Studies, Geneva, Switzerland
|
| 8 |
+
|
| 9 |
+
{santosh./(tokala, shanshan.xu, matthiasgrabmair}@tum.de
|
| 10 |
+
|
| 11 |
+
oana.ichim@graduateinstitute.ch
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
This work demonstrates that Legal Judgement Prediction systems without expert-informed adjustments can be vulnerable to shallow, distracting surface signals that arise from corpus construction, case distribution, and confounding factors. To mitigate this, we use domain expertise to strategically identify statistically predictive but legally irrelevant information. We adopt adversarial training to prevent the system from relying on it. We evaluate our deconfounded models by employing interpretability techniques and comparing to expert annotations. Quantitative experiments and qualitative analysis show that our deconfounded model consistently aligns better with expert rationales than baselines trained for prediction only. We further contribute a set of reference expert annotations to the validation and testing partitions of an existing benchmark dataset of European Court of Human Rights cases.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
The task of Legal Judgment Prediction (LJP) has recently gained increasing attention in the legal and mainstream NLP communities (Aletras et al., 2016; Zhong et al., 2018; Medvedeva et al., 2020; Liu et al., 2019; Sert et al., 2021). Legal cases are resolved through the exchange of arguments in front of a decision body by lawyers who represent litigating parties. This typically involves evidential reasoning, the determination of relevant rules from sources of law (e.g., codes, regulations, precedent), their application to the case, and the balancing of legal and societal values. In the NLP context, LJP takes the form of classifying the outcome of a case from some textual representation of its specific facts, effectively skipping legal reasoning. This forms a counterpoint to knowledge-focused approaches to outcome prediction (e.g., Brüninghaus and Ashley, 2005; Branting, 2013; Grabmair,
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Our deconfounding experiment architecture
|
| 23 |
+
|
| 24 |
+
2017) that connect to a lawyer's understanding of the domain but also require substantial knowledge engineering.
|
| 25 |
+
|
| 26 |
+
This carries particular risk in the legal domain, where systems may rely on data elements that are statistically predictive but legally irrelevant, or even forbidden as decision criteria (e.g., the race of an accused person). This can lead to undesirable consequences, ranging from suboptimal litigation strategy decisions, flawed inference about factors predictive for the outcome, to disparate impact of decisions across groups that are to be treated equally. If legal decisions are to be informed by predictive systems processing textual case descriptions, then such systems must strive to be as closely aligned with legally relevant and permissible parts of the input as possible.
|
| 27 |
+
|
| 28 |
+
In this work, we focus on LJP for the European Court of Human Rights (ECtHR), which adjudicates complaints by individuals against states about alleged violations of their rights as enshrined in the European Convention of Human Rights. We trained deep neural models on four tasks across two existing, related datasets (Chalkidis et al., 2019, 2022a) around predicting such violations alleged by the claimant and decided by the court. We find that the models substantially base their predictions on aspects of the text that correlate with the outcome
|
| 29 |
+
|
| 30 |
+
but either have no legal bearing or are forbidden nationality-related information that stem from the distribution of cases arising at the court.
|
| 31 |
+
|
| 32 |
+
To improve the alignment of model focus with legal expert understanding, we apply a series of deconfounding measures, including a vocabulary-based method which identifies predictive tokens using a simple model. The third author, who is an ECtHR expert, then identifies distractors among them. The distracting signal can subsequently be removed from the encodings via adversarial training. This procedure is an effective way of engaging with domain experts and obtaining information about what the model should be steered away from by means of deconfounding, rather than trying to attract the model towards relevant elements via expensive data collection for supervised training. For simplicity, throughout this paper, we use 'deconfounding' in an inclusive sense as the mitigation of distracting effects of (a) confounders in the statistical sense that influence both the dependent and independent variables, (b) reverse causation relationships, and (c) other attributes that spuriously correlate with the target variable. See Fig. 1 for an overview of our experiment design.
|
| 33 |
+
|
| 34 |
+
We evaluate our trained and deconfounded models with regard to an alignment of its explanation rationales with (1) a dataset of expert passage relevance assessments we collected and will make available to community as a supplement to Chalkidis et al. (2019), and (2) on expert relevance assessments published as part of Chalkidis et al. (2021). Our results show that our deconfounding steps succeed in improving the model focus alignment with expert-identified, relevant patterns on both sets of reference annotations.
|
| 35 |
+
|
| 36 |
+
In sum, we make the following contributions:
|
| 37 |
+
|
| 38 |
+
- We introduce an expert-informed deconfounding method which identifies distracting effects from confounders and spurious correlations using a simple model, and mitigates them through adversarial training, thus helping to improve the alignment of the model focus with legal expert rationales.
|
| 39 |
+
- We empirically evaluate this method on four tasks in legal judgment prediction on ECtHR data and show that our model consistently aligns better with expert rationales than a baseline trained for the prediction target only.
|
| 40 |
+
- We release a set of gold rationales annotated
|
| 41 |
+
|
| 42 |
+
by an ECtHR expert as a supplement to an existing dataset to facilitate future work on deriving more useful insight from trained predictive systems in the legal domain.\*
|
| 43 |
+
|
| 44 |
+
# 2 Related Work
|
| 45 |
+
|
| 46 |
+
LJP as an NLP task has been tackled using n-gram representations (e.g., Aletras et al., 2016; Medvedeva et al., 2020), word embeddings and domain models (Branting et al., 2021), and deep neural networks (e.g., Chalkidis et al., 2019; Ma et al., 2021; Xu et al., 2020). Special attention must be given to the origin of the text from which the prediction is to be made. Medvedeva et al. (2021, 2022) recharacterize LJP on texts produced before the outcome is known as 'forecasting' and observes that most current works 'classify' judgments based on the data compiled after the outcome has been determined. They also find that forecasting is a harder task. This result is consistent with our finding of confounding effects from text production by the ECtHR, resulting in a prediction from fact descriptions that were influenced by the decision.
|
| 47 |
+
|
| 48 |
+
Moverover, the relationship between the information LJP models rely on and legal expert analysis of texts remains underexplored. Bhambhoria et al. (2021) find that transformer-based models exploit spurious correlations and that simple models, such as XGBoost, can achieve similar performance. Chalkidis et al. (2021) extract model rationales for alleged violation prediction and observes limited overlap with expert markup. Similarly, a small study in Branting et al. (2021) finds that users do not perceive case prediction-derived highlighting as useful in making predictions themselves. Our work contributes to this state of the art by using adversarial deconfounding to improve the overlap between what systems predict from with what legal experts consider relevant.
|
| 49 |
+
|
| 50 |
+
Deconfounding A growing number of works have raised awareness that deep neural models may exploit spurious statistical patterns and take erroneous shortcuts (McCoy et al., 2019; Bender and Koller, 2020; Geirhos et al., 2020). A common method of mitigating this is adversarial learning. Pryzant et al. 2018 use a gradient reversal layer (Ganin et al., 2016) to deconfound lexicons in text classification. Other domains that adopt adversarial training to
|
| 51 |
+
|
| 52 |
+
eliminate confounders include bioinformatics (Dincer et al., 2020) and political science (Roberts et al., 2020). Many existing works on identifying shortcuts focus on situations where these patterns are known in advance and may require potentially expensive data collection. In fairness-focused legal NLP, Chalkidis et al. (2022b) observe and remedy group disparities in LJP performance on the ECtHR informed by metadata attributes (respondent state, applicant gender, applicant age). We extend this to explainability in LJP by involving a legal expert in a procedure that allows an efficient, incremental identification of distracting information, as well as its removal via adversarial training.
|
| 53 |
+
|
| 54 |
+
Interpretability We employ interpretability techniques to evaluate model alignment with expert rationales. Danilevsky et al. (2020) reviews and categorizes the main current interpretability methods. Though initial works (Ghaeini et al., 2018; Lee et al., 2017) used attention scores as explanation for model decisions, Bastings and Filippova (2020); Serrano and Smith (2019) point out that saliency methods, such as gradient based methods (Sundararajan et al., 2017; Li et al., 2016), propagation based methods (Bach et al., 2015), occlusion based methods (Zeiler and Fergus, 2014), and surrogate model based methods (Ribeiro et al., 2016) are better suited for explainability analysis. However, the reliability and informativeness of these methods remains an open research problem. Our model uses the currently most commonly used Integrated Gradients (IG) (Sundararajan et al., 2017), which computes the gradient of the model's output with respect to its input features.
|
| 55 |
+
|
| 56 |
+
# 3 ECtHR Tasks & Datasets
|
| 57 |
+
|
| 58 |
+
The ECtHR has been the subject of substantial prior work in LJP. We use two datasets for model training and evaluation: First, for binary violation we use the dataset by Chalkidis et al. (2019) of approx. 11k case fact statements, where the target is to predict whether the court has found at least one convention article to be violated. To evaluate alignment, we annotate 50 (25 each) expert rationales for cases from both the development and test partitions (See App. C for the annotation process). Second, for article-specific violation, we use the LexGLUE dataset by Chalkidis et al. (2022a), which consists of 11k case fact statements along with information about which convention articles have been alleged to be violated, and which the court has found to
|
| 59 |
+
|
| 60 |
+
be violated. For alignment, we merge this data with the 50 test set rationales from Chalkidis et al. (2021). While both datasets stem from the ECtHR's public database, they differ in case facts and outcome distribution as we explain in Sec. 3.1. The input texts consist of each case's FACTS section extracted from ECtHR judgments. This section is drafted by court staff over the course of the case proceedings. While it does not contain the outcome explicitly, it is not finalized before the final decision has been determined, potentially creating confounding effects.
|
| 61 |
+
|
| 62 |
+
We conduct experiments on four LJP tasks:
|
| 63 |
+
|
| 64 |
+
Task J - Binary Violation For our task J, the model is given a fact statement and is asked to predict whether or not any article of the convention has been violated. We train our models on Chalkidis et al. (2019) and evaluate alignment on the set of expert rationales we collected.
|
| 65 |
+
|
| 66 |
+
Task B - Article Allegation We train and evaluate on LexGLUE's $ECtHR$ $B$ ,* where the fact description is the basis to predict the set of convention articles that the claimant alleges to have been violated. It can be conceptualized as topic classification in that the system needs to identify suitable candidate articles (e.g., the right to respect for private and family life) from fact statements (e.g., about government surveillance). We test alignment on the expert rationales by Chalkidis et al. (2021).
|
| 67 |
+
|
| 68 |
+
Task A - Article Violation We also experiment with LexGLUE's ECtHR $A$ , which is to predict which of the convention's articles has been deemed violated by the court from a case's fact description. Task A is a more difficult version of task B, where both an identification of suitable articles and a prediction of their violation must be performed. For alignment, we again use the expert rationales by Chalkidis et al. (2021), which are technically intended for task ECtHR $B$ , but which we consider to also be suitable for an evaluation of task A.*
|
| 69 |
+
|
| 70 |
+
Task A|B - Article Violation given Allegation We further disentangle the LexGLUE tasks and pose ECtHR A|B. Given the facts of a case and the allegedly violated articles, the model should predict which (if any) specific articles have been violated.
|
| 71 |
+
|
| 72 |
+
This task reflects the legal process, as the court is aware of allegations made by the applicants when deciding. Providing information about the allegations shifts the nature of the task from topic classification to article-specific violation/non-violation prediction, thus refocusing the model and ideally leading to violation-specific explanations.
|
| 73 |
+
|
| 74 |
+
# 3.1 Data Distribution & Preprocessing
|
| 75 |
+
|
| 76 |
+
In order to facilitate model alignment, we worked with our ECtHR expert to identify shallow prediction signals in the fact statements that are unrelated to the legal merits of the complaint.
|
| 77 |
+
|
| 78 |
+
# 3.1.1 Length and Respondent State
|
| 79 |
+
|
| 80 |
+
For the task J dataset of Chalkidis et al. 2019, we find that the distribution of fact description length (number of sentences) and the distribution of respondent states are different between the two classes (see Appendix A). We hence account for the identity of the respondent state and the length of the fact descriptions via our deconfounding procedure for both datasets.
|
| 81 |
+
|
| 82 |
+
# 3.1.2 Accounting for Inadmissible Cases
|
| 83 |
+
|
| 84 |
+
We also observe in the task J dataset that the magnitudes of the running paragraph numbers differ between the classes, and that the single word "represented" strongly correlates with the positive class. This phenomenon arises because 2.6k of the 7k training cases are 'inadmissible' cases labeled as 'non-violation'. Legally, inadmissible cases are not necessarily 'non-violation' as inadmissibility relates to complaints not fulfilling the court's formal or procedural criteria.* In such cases, the court does not examine the merits of the application. The more interesting non-violation cases are such that are admissible, but in which no violation of the convention has been found. The single negative class contains instances of both inadmissible and admissible-but-no-violation-found cases. As explained above, the input texts of Chalkidis et al. 2019 are extracted from the FACTS section of full ECtHR decisions. In inadmissible cases, the applicant's background information can typically be found at the beginning of that section. We found that almost all inadmissible case facts start with
|
| 85 |
+
|
| 86 |
+
the same formulaic sentence stating the applicant's name, nationality, and legal representation. This specific sentence is absent from the texts of admissible cases (violation and non-violation), where that information is part of a separate PROCEDURE section not included in the dataset. Moreover, due to the PROCEDURE section preceding the FACTS section in admissible cases, the running paragraph numbers appearing in FACTS sections of inadmissible cases are smaller than those of the admissible cases. If not remedied, these phenomena provide a considerable predictive signal for the label and distract the system from legally relevant information. In our experiments, we hence remove paragraph numbers from the input via preprocessing and account for distractor vocabulary via our deconfounding procedure described in Sec. 4. Still, the nature of task J remains unchanged and requires the system to classify the outcomes of a collection of both admissible and inadmissible cases.
|
| 87 |
+
|
| 88 |
+
# 3.1.3 Article-Specific Violation
|
| 89 |
+
|
| 90 |
+
By contrast, the more recent LexGLUE dataset only contains admissible cases and corresponding information about which articles the claimant has alleged to have been violated (for task B) along with those that the court has found to have been violated, if any (task A). The collection covers 10 different convention articles that make up the largest share of ECtHR jurisprudence. Each article has been alleged in a partition of the cases, and has been found to be violated in a subset of these.* For a given article in task B, all cases in which it has been alleged can be considered positive instances while the remaining cases are negatives. We consider task B as akin to topic classification, where the rights enshrined in the convention articles (e.g., Art. 6: right to a fair trial; Art. 1 Protocol 1: protection of property, etc.) may correlate with certain case fact language (e.g., related to law enforcement or appropriation, respectively). Task A incorporates this step and adds violation prediction per article, which is more difficult in principle. However, we observe that a few articles account for a large portion of the data and the conditional probability of a positive violation label in task A given its allegation labels from task B can be very high (see App. B). This makes an analysis of what trained models focus
|
| 91 |
+
|
| 92 |
+
on more difficult, since they may learn to identify these dominant articles with high conditional violation probability, and be distracted from focusing on information that specifically signals violations of those articles. To remedy this, we propose task AlB that provides models an easy access to the label information of B, facilitating their focus only on determining whether the court finds a violation of given articles. This task is realistic since the allegations by the claimant are known to the court at the time that it decides whether the respondent state has violated the convention in the case.
|
| 93 |
+
|
| 94 |
+
# 4 Expert-Informed Deconfounding
|
| 95 |
+
|
| 96 |
+
We apply an expert-informed deconfounding method designed to mitigate the distracting effects of confounding elements and spurious correlations. As Pryzant et al. (2018) observe, accounting for confounders is common practice throughout many data analysis tasks to capture the intended signal and facilitate explainable models. In LJP, we understand confounding elements as such that influence both the observed legal outcome (convention violations found by the court as coded in the dataset) and the input text from which this outcome is to be predicted (here: ECtHR fact statements). Already covered examples are the different distribution of information across sections for admissible and in-admissible cases and the length of the fact descriptions (inadmissible cases tend to require less factual information to be dismissed). An example of a spurious correlation is the identity of the respondent state (certain article violations will be claimed more often against a small number of governments, leading to a correlation). They each should have no bearing on the probability of an outcome in a given case as a judge will not decide against a violation because the facts are short, or because the case is against a particular government.
|
| 97 |
+
|
| 98 |
+
Confounding effects and spurious information in LJP may not be known ahead of time, especially if the legal decision is not made on the basis of an immutable a priori document, but rather on the basis of text that is technically a part of the eventual judgment. Our expert-informed method is intended to mitigate such situations where spurious correlations are introduced in the text production but may
|
| 99 |
+
|
| 100 |
+
not be known in advance as explicit confounders.
|
| 101 |
+
|
| 102 |
+
Our method consists of two steps: (i) Identification of distracting attributes for deconfounding through a combination of simple model training and minimal expert markup, and (ii) mitigation of these effects through adversarial training.
|
| 103 |
+
|
| 104 |
+
# 4.1 Step 1: Identification of Distracting Attributes and Tokens
|
| 105 |
+
|
| 106 |
+
We first identify input attributes and categorize them as either distracting or genuinely legally relevant in an expert consultation. 'Distracting' attributes are highly correlated with the task label but not relevant in a human expert prediction. Attributes can be either (i) explicit in the text (such as vocabulary tokens) or (ii) implicit (e.g., country, text length, etc.). Implicit attributes can be derived from available metadata or a corpus analysis.
|
| 107 |
+
|
| 108 |
+
For textual attributes, we apply depth-limited decision trees on an n-gram representation of the fact statement to predict the case outcome. We extract all tokens that appear in the trees and iterate, successively removing tokens identified as predictive. Compared to extracting tokens from a single larger tree, this process is better suited to remove high-entropy-reducing tokens one typically finds near the root of trees. The list of removed tokens is then presented to a legal expert, who categorizes them into spurious and legally genuine (see Appendix Sec. F for the list of spurious vocabulary identified by the expert and the rationale behind the choices). This requires substantially less effort from the expert compared to other methods, such as data annotation or manual creation of counterfactuals. To prevent trees from picking up very sparse tokens, we filter the extracted terms using local mutual information (LMI) (Schuster et al., 2019), a re-weighted version of pointwise mutual information (PMI) (Church and Hanks, 1990). We calculate LMI for each pair of token and label as illustrated in Appendix Sec. G.
|
| 109 |
+
|
| 110 |
+
# 4.2 Step 2: Mitigation of Distracting Attributes
|
| 111 |
+
|
| 112 |
+
We assume a neural NLP model $M$ consisting of a feature extractor $F$ and classifier $C$ with parameters $\theta_{f}$ and $\theta_{c}$ , respectively. For each confounder $k$ , we apply a discriminator $D_{k}$ with parameters $\theta_{d_{K}}$ to the feature extractors. We use adversarial training to maximize the feature extractor's ability to capture information for the main classification target while minimizing its ability to predict the
|
| 113 |
+
|
| 114 |
+
value of distractor attributes. This encourages the model to generate distractor-invariant feature representation for the classifier. We use the following adversarial training objective:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\sum_ {k} \arg \min _ {\theta_ {d _ {k}}} L \left(D _ {k} (F (x)), y _ {k}\right) \tag {1}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\arg \min _ {\theta_ {f}, \theta_ {c}} [ L (C (F (x)), y _ {c}) - \sum_ {k} \lambda_ {k} L (D _ {k} (F (X)), y _ {k}) ] \tag {2}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $L$ represents the loss, $\lambda$ is a hyperparameter, $x$ is the input, $y_{c}$ is the label, and $y_{k}$ is the distracting attribute $k$ . The above optimization is performed using a gradient reversal layer (GRL) (Ganin and Lempitsky, 2015) to jointly optimize all the components instead of alternately updating the components as in GANs (Goodfellow et al., 2014). The GRL is inserted between the feature extractor and discriminators. It acts as the identity during the forward pass but, during the backward pass, scales the gradients flowing through by $-\lambda$ , making the feature extractor receive the opposite gradients from the discriminator. This changes the overall objective function to:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\arg \min _ {\theta_ {f}, \theta_ {c}, \theta_ {D}} [ L (C (F (x)), y _ {c}) + \sum_ {k} \lambda_ {k} L (D _ {k} (G R L ((F (X))), y _ {k}) ] \tag {3}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
We hypothesize that learning distractor-invariant feature representations through adversarial learning will help the model to focus on parts of the input that experts consider relevant.
|
| 131 |
+
|
| 132 |
+
# 5 Experiments & Discussion
|
| 133 |
+
|
| 134 |
+
In this section we describe our experiments in using our proposed deconfounding methodology to improve the alignment of model focus on the input with expert rationales on our set of LJP tasks.
|
| 135 |
+
|
| 136 |
+
# 5.1 Models
|
| 137 |
+
|
| 138 |
+
Baseline: We use the BERT variant of Hierarchical Attention Networks (Yang et al., 2016) as a baseline model. To segment our very long input texts we resort to a greedy sentence packing strategy in which we pack as many sentences as possible into one packet until it reaches the predefined maximum length (512 tokens constrained BERT). When a sentence exceeds this maximum, we split it into parts to fit into multiple packets. We encode each packet with LegalBERT (Chalkidis et al., 2020) to obtain the token level representations. Following Yang et al., 2016, we use a token attention layer
|
| 139 |
+
|
| 140 |
+
aggregating the representation of the tokens and form a sentence (packet) vector. We pass these sentence vectors through a GRU encoder to obtain contextual representations. These are aggregated at the document level using a sentence attention layer. This model constitutes the feature extractor component $F$ in our architecture. The obtained document representation is passed through dense layers for the final target prediction, constituting our classifier component $C$ .
|
| 141 |
+
|
| 142 |
+
paraRem: Same as the baseline model but trained on data from which the paragraph number artifacts have been removed (see Sec. 3.1).
|
| 143 |
+
|
| 144 |
+
gradCou: paraRem model extended with a multiclass discriminator with a cross-entropy loss predicting the identity of the respondent government, and a corresponding deconfounding GRL.
|
| 145 |
+
|
| 146 |
+
gradLen: paraRem model extended with a length discriminator predicting the length (number of sentences) of the document via a set of bins and a cross-entropy loss, and a corresponding GRL to predict the bin value.
|
| 147 |
+
|
| 148 |
+
gradVocab: paraRem model extended with a vocabulary discriminator to predict the presence of identified spurious tokens, and associated GRL. As there can be multiple spurious tokens in a document, we employ binary entropy loss per token as it is a multi-label classification.
|
| 149 |
+
|
| 150 |
+
We refer to the above three deconfounded models collectively as singleGrad models.
|
| 151 |
+
|
| 152 |
+
gradAll: paraRem model extended with all country, length, and vocabulary discriminators in parallel, and associated GRLs.
|
| 153 |
+
|
| 154 |
+
Please refer to Appendix Sec. H for details on model configuration and training.
|
| 155 |
+
|
| 156 |
+
# 5.2 Quantitative Evaluation & Discussion
|
| 157 |
+
|
| 158 |
+
# 5.2.1 Expert Alignment Evaluation
|
| 159 |
+
|
| 160 |
+
Our main objective is to evaluate the alignment of the model's focus on the input text with legal expert rationales (i.e., selected subsets of relevant segments of the input). Following Chalkidis et al. 2021, we measure the model's ability to identify the correct rationales at the paragraph level, which is the natural granularity of ECtHR fact sections. To extract the importance score for each paragraph, we rely on an interpretability technique which quantifies the impact of a particular input token towards the final prediction of the model.
|
| 161 |
+
|
| 162 |
+
We use integrated gradients (Sundararajan et al., 2017) to obtain a token-level focus score and ag-
|
| 163 |
+
|
| 164 |
+
<table><tr><td></td><td colspan="2">J</td><td>B</td><td>A</td><td>A|B</td></tr><tr><td>Model</td><td>valid</td><td>test</td><td>test</td><td>test</td><td>test</td></tr><tr><td>Random</td><td>38.67(4.52)</td><td>28.22(3.16)</td><td>36.65(2.91)</td><td>36.65(2.91)</td><td>36.65(2.91)</td></tr><tr><td>baseline</td><td>39.04(4.31)</td><td>29.73(3.28)</td><td>39.07(2.94)</td><td>40.10(3.02)</td><td>41.36(3.02)</td></tr><tr><td>paraRem</td><td>41.81(3.59)</td><td>31.53(3.43)</td><td>41.47(3.06)</td><td>41.93(2.88)</td><td>41.86(2.86)</td></tr><tr><td>gradCou</td><td>42.29(3.54)</td><td>33.37(3.75)</td><td>42.36(3.09)</td><td>43.56(2.78)</td><td>43.16(2.85)</td></tr><tr><td>gradLen</td><td>42.21(3.55)</td><td>33.58(2.98)</td><td>43.55(2.92)</td><td>43.12(3.31)</td><td>43.75(3.14)</td></tr><tr><td>gradVocab</td><td>42.96(3.57)</td><td>33.77(3.41)</td><td>43.34(3.02)</td><td>44.48(3.36)</td><td>44.39(2.86)</td></tr><tr><td>gradAll</td><td>44.42(3.40)</td><td>34.48(3.74)</td><td>44.84(3.13)</td><td>45.95(3.09)</td><td>44.91(3.18)</td></tr><tr><td>p-value</td><td>0.164</td><td>0.013</td><td>0.031</td><td>0.008</td><td>0.071</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 1: Expert alignment performance expressed in precision@Oracle scores; value in brackets indicates standard error of the computed score; p values compare gradAll versus paraRem and were computed using a paired t-test.
|
| 167 |
+
|
| 168 |
+
aggregate paragraph-level scores as the squared L2-norm of token scores in the paragraph divided by the square root of its number of tokens to account for length variation. We compute precision@k conditioned on some fixed $k$ between the top-k paragraphs based on paragraph scores and golden paragraph rationales. The number of relevant paragraphs in gold rationales varies considerably, so a predefined $k$ is inadequate. Thus, we compute precision@Oracle following Chalkidis et al., 2021, where Oracle is the number of relevant paragraphs in the gold rationales.
|
| 169 |
+
|
| 170 |
+
For tasks J, A, and A|B, the negative label (i.e., non-violation) is of similar interest as the positive label. In task B, however, the negative label merely indicates that a specific article has not been alleged, which is legally largely uninteresting. Hence, we reduce negative IG scores of tokens (indicating a negative contribution to the prediction) to zero.
|
| 171 |
+
|
| 172 |
+
# 5.2.2 Prediction Performance Evaluation
|
| 173 |
+
|
| 174 |
+
We also report the models' performance on the main four LJP tasks. For Task J, we report the macro F1-score for binary violation prediction. For Task A and B, following (Chalkidis et al., 2022a), we report micro-F1 ( $\mu$ -F1) and macro-F1 (m-F1) scores. For Task A|B, we also report micro-F1 and macro-F1 scores. In computing the above metrics for tasks A and A|B, we consider the cases in which a particular article has been deemed violated as pos
|
| 175 |
+
|
| 176 |
+
itive instances and the rest of the instances as negatives. We also introduce hard-macro-F1 (hm-F1) for both Task A and AlB, in which F1 is computed for each article using only those instances as negatives where an article has been alleged as violated but not found so by the court.
|
| 177 |
+
|
| 178 |
+
# 5.2.3 Quantitative Evaluation Results
|
| 179 |
+
|
| 180 |
+
Table 1 and Table 2 show the performance of different models on expert alignment and outcome prediction, respectively.
|
| 181 |
+
|
| 182 |
+
paraRem vs. baseline: We observe that paraRem outperforms the baseline model in expert alignment across all tasks with a minimal drop in prediction performance. Task J stands out in that removing distracting signals via paragraph number removal even leads to a marginal improvement. Notably, we separately confirm the vulnerability of the baseline model by applying it to the test set with paragraph numbers removed and evaluate it on a test set without paragraph numbers, resulting in macro-F1 of 51.16 (i.e., a nearly 30 points drop).
|
| 183 |
+
|
| 184 |
+
gradCou, gradLen, gradVocab vs. paraRem: In all tasks, we observe that all singleGrad models improve in expert alignment performance over paraRem by a small but consistent margin. This demonstrates the ability of our deconfounding component to help the model better identify legally relevant parts of the input. Notably, gradVocab shows the most improvement in alignment over paraRem in all tasks except Task B (alleged article prediction), where gradLen performs best. During development on task B, we observed that the decision-tree based removal of predictive words led to only a marginal falloff in tree model accuracy, even after multiple iterations, since there was simply a lot of topical words (e.g., for police misconduct, legal proceedings, etc.) to take over as some of them were removed. This in part reflects the different nature of the tasks and shows a limitation of our tree-training-based method for identifying spurious tokens. Similar to paraRem, the gradLen model (in case of Task A, B, and AlB) also shows improvement in prediction performance compared to the baseline model. This suggests that deconfounding can potentially prevent the model getting stuck in distractor-related local optima.
|
| 185 |
+
|
| 186 |
+
Alignment: All singleGrad models outperform the baseline with regard to expert alignment. We observe that gradAll achieves the highest score, which establishes some degree of complementarity among the three singleGrad models and the distracting
|
| 187 |
+
|
| 188 |
+
signals they remedy. A paired t-test (gradAll vs. paraRem) reveals p-values above typical significance levels for the validation partition of task J, along with a considerable divergence in the general score level for the two tasks. We conjecture that this is the result of our small rationale sample size (50 from each partition) and differences in distribution between the task J data partitions, which have been split along the timeline rather than random. We also see a higher p-value for task AlB, which is intuitive since it is the most difficult. Its dataset lacks easily identifiable inadmissible cases (as in task J) and it has access to B's labels as concurrent, non-textual input. To gain some more insight into AlB, we report on a qualitative error analysis of the model rationales below.
|
| 189 |
+
|
| 190 |
+
# 5.3 Qualitative Evaluation & Discussion
|
| 191 |
+
|
| 192 |
+
Expert Scores: We sample 40 cases from task AI B validation and test sets (see App. Sec. D). We provide the expert with randomized visualizations of IG scores at the token level derived from our paraRem and gradAll models. Following (Jayaram and Allaway, 2021), the expert was asked to rate these on a five-point Likert scale (range -2 to 2) on two metrics: (i) Sufficiency: Is a sufficiently large set of tokens focused on to arrive at the prediction?; and (ii) Irrelevance: How many irrelevant tokens does the model focus on? We phrased the scale such that, for both parameters, a higher rating signals a better alignment between the model focus and the expert's assessment. Table 3 presents averages of the raw scale scores. We observe that the deconfounded gradAll model scores higher (See App. I for an example pair of IG visualizations).
|
| 193 |
+
|
| 194 |
+
Manual IG Inspection: For the paraRem model, we notice that high scoring IG tokens are sparse, whereas in gradAll, focus is densely distributed. There, contiguous spans of tokens tend to receive higher scores. This phenomenon is likely due to paraRem being drawn to single word distractors. Deconfounding helps the gradAll model to spread its focus across larger segments of the text. Our ECtHR expert further observed that gradAll highlighted words that, in conjunction, were indicative of the outcome, even if those were a considerable distance apart. At the same time, however, it seemed that two words hinting at opposite outcomes in a single sentence forced the system to focus only on one of the two, leaving the other one unhighlighted. We conjecture that these long- and
|
| 195 |
+
|
| 196 |
+
short-distance phenomena are a result of the hierarchical model architecture necessitated by the long documents and leave their further exploration for future work.
|
| 197 |
+
|
| 198 |
+
An inspection of high scored tokens in paraRem reveals that many of them are highly discriminative in our decision tree models, showing that complex neural models can easily fall for distractors at the expense of missing equally predictive but semantically more complex signals. This reinforces our paradigm to identify discriminative tokens using a simpler model and subject them to expert scrutiny. In particular, we found that the word "represented" forms a natural decoy and, when injected into a violation-outcome fact statement, flips the predicted label of trained deep neural models. This led us to believe those models rely more on individual words than one might expect, and motivated us to explore how this can be exploited with information derived from simple models. Figure 2 shows that the performance of decision trees with unigram features (at iteration 1 without removed tokens) can even come close to BERT models.
|
| 199 |
+
|
| 200 |
+
In paraRem, we further observe that tokens at the start of sentences receive higher IG scores. We believe this to be the model counting sentences, which justifies deconfounding for length. For gradAll, we observe that sentence beginnings still receive focus, but less strongly so. This may be due to BERT recognizing sentence boundaries.
|
| 201 |
+
|
| 202 |
+
Further alignment improvement: The overall low precision@Oracle scores show that considerable differences in alignment with human experts remain. We conjecture that the model is shifting its focus, at least in part, to other spurious attributes which our current setup could not reveal. This calls for further investigation to design effective methods to identify such patterns. However, we expect them to be increasingly subtle and difficult to recognize, potentially even for legal experts. An intuitive upper bound for the system would be the annotation agreement of multiple experts, which to the best of our knowledge remains unexplored in the current state of the art.
|
| 203 |
+
|
| 204 |
+
Expert Pattern Identification: Our results naturally raise the question of how distractors can be identified in ECtHR fact texts by experts. Generally, the patterns we focused on affect the relationship between the argumentation in the judgment and the supportive facts given. There is copious literature on the court's inconsistent approach to
|
| 205 |
+
|
| 206 |
+
<table><tr><td></td><td>Task J</td><td colspan="2">Task B</td><td colspan="3">Task A</td><td colspan="3">Task A|B</td></tr><tr><td>Model</td><td>m-F1</td><td>μ F1</td><td>m-F1</td><td>μ F1</td><td>m-F1</td><td>hm-F1</td><td>μ F1</td><td>m-F1</td><td>hm-F1</td></tr><tr><td>baseline</td><td>81.23</td><td>78.08</td><td>68.42</td><td>69.28</td><td>58.80</td><td>55.30</td><td>77.42</td><td>68.23</td><td>58.95</td></tr><tr><td>paraRem</td><td>82.67</td><td>77.82</td><td>66.90</td><td>68.94</td><td>58.35</td><td>55.62</td><td>77.20</td><td>67.32</td><td>58.80</td></tr><tr><td>gradCou</td><td>81.22</td><td>76.31</td><td>66.58</td><td>67.47</td><td>56.40</td><td>54.04</td><td>76.83</td><td>66.85</td><td>58.14</td></tr><tr><td>gradLen</td><td>81.99</td><td>78.06</td><td>67.19</td><td>69.18</td><td>58.88</td><td>56.10</td><td>79.07</td><td>69.79</td><td>61.24</td></tr><tr><td>gradVocab</td><td>82.00</td><td>77.68</td><td>66.40</td><td>69.06</td><td>58.47</td><td>55.71</td><td>78.87</td><td>69.49</td><td>60.64</td></tr><tr><td>gradAll</td><td>81.53</td><td>77.46</td><td>66.75</td><td>68.32</td><td>58.06</td><td>53.74</td><td>78.71</td><td>69.26</td><td>60.58</td></tr></table>
|
| 207 |
+
|
| 208 |
+
Table 2: Prediction Performance
|
| 209 |
+
|
| 210 |
+
<table><tr><td>Metric</td><td>paraRem</td><td>gradAll</td></tr><tr><td>Sufficiency (↑)</td><td>0.150</td><td>0.550</td></tr><tr><td>Irrelevance (↑)</td><td>0.475</td><td>0.625</td></tr></table>
|
| 211 |
+
|
| 212 |
+
Table 3: Qualitative evaluation scores
|
| 213 |
+
|
| 214 |
+
legal decision-making (e.g., Madsen et al. 2018) and it is known to switch between judicial policies depending on case circumstances (Helfer and Voeten, 2020). We hence paid attention to specific markers in the fact section and correlated them to existing precedents and argumentation patterns. A few examples: The court may decide to make use of positive obligations and decide against the state (violation) by highlighting failures of national authorities, or may decide to use those same positive obligations under 'the responsible authorities' doctrine, highlighting the efforts of national authorities to bring domestic legislation in line with the convention, thus deciding that there has been no violation. There are also fact patterns and practices specific to particular state parties to the convention (e.g., prison overcrowding, procedural issues in child abduction cases). The court may also sometimes highlight specific facts of a case with the view to 'document' its resemblance to, or divergence from, an existing precedent. A detailed, legally informed case study on predictive patterns is beyond the scope of this work.
|
| 215 |
+
|
| 216 |
+
# 5.4 Recommendations for LJP Research
|
| 217 |
+
|
| 218 |
+
In order to produce value for legal practice, we believe that LJP/LJF as an NLP task should strive for a productive combination of expert knowledge with data-derived insight. Based on our results, we formulate the following recommendations: First, as has already been observed in the field, any prediction/classification should happen from suitable source text that does not encode information about the outcome but contains as complete factual information as possible, or at least control for this
|
| 219 |
+
|
| 220 |
+
influence. Second, straightforward predictors (e.g., input length and shallow unigram models) should be used to identify distractors and confounders. Third, claimed performance levels in predicting case outcomes should be contextualized by information about the distribution of the legal issues and respective conditional outcome probabilities in the corpus, as well as against baseline classifiers capable of exploiting known distractors. Fourth, more granular outcome variable information (e.g., case declared inadmissible vs. case dismissed on the merits, decomposition into outcomes of individual issues) will allow the development of more nuanced prediction/classification systems. Taken together, if such models can be explained and integrated into a decision support system for suitable tasks in legal practice, experts will be more likely to perceive them as adding value.
|
| 221 |
+
|
| 222 |
+
# 6 Conclusion
|
| 223 |
+
|
| 224 |
+
Our results show that our deconfounded LJP models are consistently better aligned with expert rationales than a baseline optimized for the target label only, and in many cases can even achieve better prediction performance. However, the improvement is small and the paragraphs focused on by all our models are still quite different from what an expert has annotated as relevant, as indicated by generally low precision@Oracle scores $(< 50\%)$ . Still, our quantitative results show that expert-informed deconfounding LJP works in principle and can potentially go a long way to train more robust and trustworthy neural LJP models, as well as derive more useful legal insight from them.
|
| 225 |
+
|
| 226 |
+
# Limitations
|
| 227 |
+
|
| 228 |
+
We present a case study in deconfounding legal judgment prediction on the ECtHR, and all results are to be understood as relative to the ECtHR, its jurisprudence, the used datasets, and the formal tasks. The distracting attributes we identify include
|
| 229 |
+
|
| 230 |
+
confounding effects of the court's document production, where the decision may be known before the decision text (including the fact section) is finalized. A replication of this study in other LJP settings is of course warranted before general applicability can be claimed. Our analysis of task B has further revealed that redundant vocabulary distribution can challenge the system's ability to point out individual 'smoking gun' distracting tokens. This aspect is particularly complex in light of differing legal systems and their respective cultures and patterns of drafting texts that may form the basis of predictive or, more generally, assistive systems. Morphologically rich languages, where distracting signal may be spread across multiple tokens, may make this challenge more difficult and require stem- or lemma-based processing as part of the method.
|
| 231 |
+
|
| 232 |
+
Our deconfounding method is work-intensive and assumes the identifiability of distracting information in text and metadata by an expert. Legal expert agreement about what parts of decisions are relevant remains underexplored, and the division of genuine versus spurious language may also vary in between multiple experts. While we are convinced that further research on effective deconfounding of legal NLP systems is needed if these systems are to become robust and trustworthy, the time-intensive nature of collaboratively developing and qualitatively evaluating such models with legal experts poses a considerable resource challenge.
|
| 233 |
+
|
| 234 |
+
A technical difficulty in working with legal documents is their length, and the use of packet-based hierarchical models constrains the maximum distance across which tokens can directly attend to one another. The impact of this limitation on model performance in various types of tasks is the subject of ongoing exploratory work (e.g., Dai et al. 2022).
|
| 235 |
+
|
| 236 |
+
# Ethics Statement
|
| 237 |
+
|
| 238 |
+
The research presented here works exclusively with publicly available datasets of ECtHR decisions, which are based on HUDOC*, the public database of the Court. While these decisions are not anonymized and contain the real names of individuals involved, our work does not engage with the data in a way that we consider harmful beyond this availability.
|
| 239 |
+
|
| 240 |
+
Our models are designed to be used with pretrained language models and hence inherit any bi
|
| 241 |
+
|
| 242 |
+
ases they may contain. This entails an obligation to screen incorporated models and to test any developed system with regard to its performance across groups of cases (e.g. Chalkidis et al. 2022b), and to remedy any disparities before deploying it as a prediction and inference tool. Our experiments are targeted at controlling for legally irrelevant distractors in the input, which is in line with this responsibility.
|
| 243 |
+
|
| 244 |
+
The task of legal judgment prediction raises ethical concerns, both general as well as specific to the European Court of Human Rights. (Fikfak, 2021) emphasizes focal issues with regard to the court considering the use predictive technology to tackle its caseload, including system bias and the challenges of designing the interaction between judges and predictive systems. The latter is of course especially sensitive given experiences made with recidivism risk prediction (Collins 2018) and possible disparate effects of how judges interact with scores (Albright 2019). Our research group is committed to research on LJP as a means to derive insight from legal decision data towards increasing accountability, fairness, and transparency in the use of technology in legal systems. The premise of this work is that the behavior of legal outcome prediction systems is to be scrutinized with great care. This paper does not advocate for the practical use of such systems, but rather empirically explores difficulties that arise in their development and recommends a closer connection between technical research and legal expertise (see Sec. 5.4).
|
| 245 |
+
|
| 246 |
+
All models of this project were developed and trained on Google Colab. Our models adapted pretrained language models and we did not engage in any training of such large models from scratch. We did not track computation hours.
|
| 247 |
+
|
| 248 |
+
# Acknowledgments
|
| 249 |
+
|
| 250 |
+
We are grateful to Jaromir Savelka for the ability to use the Gloss annotation tool and for providing feedback on the draft. We also thank the anonymous reviewers for valuable comments.
|
| 251 |
+
|
| 252 |
+
# References
|
| 253 |
+
|
| 254 |
+
Alex Albright. 2019. If you give a judge a risk score: evidence from kentucky bail decisions. Harvard John M. Olin Fellow's Discussion Paper, 85:16.
|
| 255 |
+
Nikolaos Aletras, Dimitrios Tsarapatsanis, Daniel Preoticiuc-Pietro, and Vasileios Lampos. 2016. Predicting judicial decisions of the european court of
|
| 256 |
+
|
| 257 |
+
human rights: A natural language processing perspective. PeerJ Computer Science, 2:e93.
|
| 258 |
+
Sebastian Bach, Alexander Binder, Gregoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. 2015. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. *PloS one*, 10(7):e0130140.
|
| 259 |
+
Jasmijn Bastings and Katja Filippova. 2020. The elephant in the interpretability room: Why use attention as explanation when we have saliency methods? In Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 149-155.
|
| 260 |
+
Emily M. Bender and Alexander Koller. 2020. Climbing towards NLU: On meaning, form, and understanding in the age of data. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5185-5198, Online. Association for Computational Linguistics.
|
| 261 |
+
Rohan Bhambhoria, Samuel Dahan, and Xiaodan Zhu. 2021. Investigating the state-of-the-art performance and explainability of legal judgment prediction. In Canadian Conference on AI.
|
| 262 |
+
L Karl Branting. 2013. Reasoning with rules and precedents: a computational model of legal analysis. Springer Science & Business Media.
|
| 263 |
+
L Karl Branting, Craig Pfeifer, Bradford Brown, Lisa Ferro, John Aberdeen, Brandy Weiss, Mark Pfaff, and Bill Liao. 2021. Scalable and explainable legal prediction. Artificial Intelligence and Law, 29(2):213-238.
|
| 264 |
+
Stefanie Brüninghaus and Kevin D Ashley. 2005. Generating legal arguments and predictions from case texts. In Proceedings of the 10th international conference on Artificial intelligence and law, pages 65-74.
|
| 265 |
+
Ilias Chalkidis, Ion Androutsopoulos, and Nikolaos Aletras. 2019. Neural legal judgment prediction in English. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4317-4323, Florence, Italy. Association for Computational Linguistics.
|
| 266 |
+
Ilias Chalkidis, Manos Fergadiotis, Prodromos Malakasiotis, Nikolaos Aletras, and Ion Androutsopoulos. 2020. Legal-bert: The muppets straight out of law school. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2898-2904.
|
| 267 |
+
Ilias Chalkidis, Manos Fergadiotis, Dimitrios Tsarapat-sanis, Nikolaos Aletras, Ion Androutsopoulos, and Prodromos Malakasiotis. 2021. Paragraph-level rationale extraction through regularization: A case study on european court of human rights cases. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 226-241.
|
| 268 |
+
|
| 269 |
+
Ilias Chalkidis, Abhik Jana, Dirk Hartung, Michael Bommarito, Ion Androutsopoulos, Daniel Katz, and Nikolaos Aletras. 2022a. LexGLUE: A benchmark dataset for legal language understanding in English. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4310-4330, Dublin, Ireland. Association for Computational Linguistics.
|
| 270 |
+
Ilias Chalkidis, Tommaso Pasini, Sheng Zhang, Letizia Tomada, Sebastian Schwemer, and Anders Søgaard. 2022b. FairLex: A multilingual benchmark for evaluating fairness in legal text processing. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4389-4406, Dublin, Ireland. Association for Computational Linguistics.
|
| 271 |
+
Kenneth Church and Patrick Hanks. 1990. Word association norms, mutual information, and lexicography. Computational linguistics, 16(1):22-29.
|
| 272 |
+
Erin Collins. 2018. Punishing risk. *Geo. LJ*, 107:57.
|
| 273 |
+
Xiang Dai, Ilias Chalkidis, Sune Darkner, and Desmond Elliott. 2022. Revisiting transformer-based models for long document classification. arXiv preprint arXiv:2204.06683.
|
| 274 |
+
Marina Danilevsky, Kun Qian, Ranit Aharonov, Yannis Katsis, Ban Kawas, and Prithviraj Sen. 2020. A survey of the state of explainable AI for natural language processing. In Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing, pages 447-459, Suzhou, China. Association for Computational Linguistics.
|
| 275 |
+
Ayse B Dincer, Joseph D Janizek, and Su-In Lee. 2020. Adversarial deconfounding autoencoder for learning robust gene expression embeddings. Bioinformatics, 36(Supplement_2):i573-i582.
|
| 276 |
+
Veronika Fikfak. 2021. What future for human rights? decision-making by algorithm. Decision-making by algorithm (September 3, 2021). Strasbourg Observers, 19.
|
| 277 |
+
Yaroslav Ganin and Victor Lempitsky. 2015. Unsupervised domain adaptation by backpropagation. In International conference on machine learning, pages 1180-1189. PMLR.
|
| 278 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Lavi-olette, Mario Marchand, and Victor Lempitsky. 2016. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096-2030.
|
| 279 |
+
Robert Geirhos, Jorn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A Wichmann. 2020. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665-673.
|
| 280 |
+
|
| 281 |
+
Reza Ghaeini, Xiaoli Fern, and Prasad Tadepalli. 2018. Interpreting recurrent and attention-based neural models: a case study on natural language inference. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4952-4957.
|
| 282 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. 2014. Generative adversarial nets. Advances in neural information processing systems, 27.
|
| 283 |
+
Matthias Grabmair. 2017. Predicting trade secret case outcomes using argument schemes and learned quantitative value effect tradeoffs. In Proceedings of the 16th edition of the International Conference on Artificial Intelligence and Law, pages 89-98.
|
| 284 |
+
Laurence R Helfer and Erik Voeten. 2020. Walking back human rights in europe? European Journal of International Law, 31(3):797-827.
|
| 285 |
+
Sahil Jayaram and Emily Allaway. 2021. Human rationales as attribution priors for explainable stance detection. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5540-5554.
|
| 286 |
+
Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings.
|
| 287 |
+
Jaesong Lee, Joong-Hwi Shin, and Jun-Seok Kim. 2017. Interactive visualization and manipulation of attention-based neural machine translation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 121-126.
|
| 288 |
+
Jiwei Li, Xinlei Chen, Eduard Hovy, and Dan Jurafsky. 2016. Visualizing and understanding neural models in nlp. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 681-691.
|
| 289 |
+
Zhiyuan Liu, Cunchao Tu, and Maosong Sun. 2019. Legal cause prediction with inner descriptions and outer hierarchies. In *China National Conference on Chinese Computational Linguistics*, pages 573-586. Springer.
|
| 290 |
+
Luyao Ma, Yating Zhang, Tianyi Wang, Xiaozhong Liu, Wei Ye, Changlong Sun, and Shikun Zhang. 2021. Legal judgment prediction with multi-stage case representation learning in the real court setting. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 993-1002.
|
| 291 |
+
Mikael Rask Madsen, Pola Cebulak, and Micha Wiebusch. 2018. Backlash against international
|
| 292 |
+
|
| 293 |
+
courts: explaining the forms and patterns of resistance to international courts. International Journal of Law in Context, 14(2):197-220.
|
| 294 |
+
Tom McCoy, Ellie Pavlick, and Tal Linzen. 2019. Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3428-3448, Florence, Italy. Association for Computational Linguistics.
|
| 295 |
+
Masha Medvedeva, Ahmet Üstün, Xiao Xu, Michel Vols, and Martijn Wieling. 2021. Automatic judgement forecasting for pending applications of the European court of human rights. In *ASAIL/LegalAIIA@ICAIL*.
|
| 296 |
+
Masha Medvedeva, Michel Vols, and Martijn Wieling. 2020. Using machine learning to predict decisions of the european court of human rights. Artificial Intelligence and Law, 28(2):237-266.
|
| 297 |
+
Masha Medvedeva, Martijn Wieling, and Michel Vols. 2022. Rethinking the field of automatic prediction of court decisions. Artificial Intelligence and Law, pages 1-18.
|
| 298 |
+
Reid Pryzant, Kelly Shen, Dan Jurafsky, and Stefan Wagner. 2018. Deconfounded lexicon induction for interpretable social science. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1615-1625, New Orleans, Louisiana. Association for Computational Linguistics.
|
| 299 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2016. "why should i trust you?" explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pages 1135-1144.
|
| 300 |
+
Margaret E Roberts, Brandon M Stewart, and Richard A Nielsen. 2020. Adjusting for confounding with text matching. American Journal of Political Science, 64(4):887-903.
|
| 301 |
+
Tal Schuster, Darsh Shah, Yun Jie Serene Yeo, Daniel Roberto Filizzola Ortiz, Enrico Santus, and Regina Barzilay. 2019. Towards debiasing fact verification models. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3419-3425.
|
| 302 |
+
Sofia Serrano and Noah A Smith. 2019. Is attention interpretable? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2931-2951.
|
| 303 |
+
Mehmet Fatih Sert, Engin Yildirim, and İrfan Haşlak. 2021. Using artificial intelligence to predict decisions of the turkish constitutional court. *Social Science Computer Review*, page 08944393211010398.
|
| 304 |
+
|
| 305 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929-1958.
|
| 306 |
+
|
| 307 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017. Axiomatic attribution for deep networks. In International conference on machine learning, pages 3319-3328. PMLR.
|
| 308 |
+
|
| 309 |
+
Nuo Xu, Pinghui Wang, Long Chen, Li Pan, Xiaoyan Wang, and Junzhou Zhao. 2020. Distinguish confusing law articles for legal judgment prediction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3086-3095, Online. Association for Computational Linguistics.
|
| 310 |
+
|
| 311 |
+
Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alex Smola, and Eduard Hovy. 2016. Hierarchical attention networks for document classification. In Proceedings of the 2016 conference of the North American chapter of the association for computational linguistics: human language technologies, pages 1480-1489.
|
| 312 |
+
|
| 313 |
+
Matthew D Zeiler and Rob Fergus. 2014. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818-833. Springer.
|
| 314 |
+
|
| 315 |
+
Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Chaojun Xiao, Zhiyuan Liu, and Maosong Sun. 2018. Legal judgment prediction via topological learning. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3540-3549, Brussels, Belgium. Association for Computational Linguistics.
|
| 316 |
+
|
| 317 |
+
# A Dataset Statistics
|
| 318 |
+
|
| 319 |
+
Table 5 demonstrates the artefacts from corpus construction and admissibility-related confounding information in the training set of Task J. Figure 3 and 4 display the distribution of text length and the respondent state in the Task J train set. Figure 5 and 6 show the statistics of text length and respondent state in the Task B train set.
|
| 320 |
+
|
| 321 |
+
# B LexGlue Dataset Characteristics
|
| 322 |
+
|
| 323 |
+
Table 4 describes the conditional probability of a violation finding by the court given the allegation of a particular article as well as the probability of a violation finding regarding a particular article even though it was not alleged.
|
| 324 |
+
|
| 325 |
+
# C Rational annotation Process for Task J
|
| 326 |
+
|
| 327 |
+
We sampled 50 cases (25 each) from the validation and test split. In each split, we sample two cases for each of the ten violated articles, one containing the token 'represented' and one without, along with five inadmissible cases. While the article information is available in the task J dataset, we do not use it as it was introduced as a binary violation classification task.
|
| 328 |
+
|
| 329 |
+
The rationale annotation process was done using the GLOSS annotation tool. The third author of this paper, who is an ECtHR expert, read the case fact statements and highlighted paragraphs which she considered indicative of an eventual finding of a violation for any convention article by the court. Despite our sampling involving randomness, the expert was already familiar with a considerable portion of the decisions. Given this, we abstained from producing a human expert outcome prediction baseline.
|
| 330 |
+
|
| 331 |
+
# D Case Sampling for Qualitative Evaluation
|
| 332 |
+
|
| 333 |
+
For the qualitative evaluation of Task A|B, we sample 40 cases (20 each) from validation and test split. In each split, we sample two cases for each of the ten allegedly violated articles, one with a finding of a convention violation and with a non-violation finding.
|
| 334 |
+
|
| 335 |
+
# E Decision Tree Performance
|
| 336 |
+
|
| 337 |
+
Figure 2 shows the performance of our decision tree model across iterations for different tasks. After each iteration, we remove the informative to
|
| 338 |
+
|
| 339 |
+
kens from previous iterations. In case of task J, we notice a steep fall after iteration 5. Tasks A and B exhibit less dramatic falloff of macro-averaged F1, owing to the different nature of the tasks as article-specific violations. Performance on Task A|B even shows small increases, albeit with a low absolute score. The large standard deviations bands computed across all articles show considerable variation.
|
| 340 |
+
|
| 341 |
+
# F Spurious Vocabulary identified by Expert
|
| 342 |
+
|
| 343 |
+
Following is the spurious vocabulary we obtained with respect to each task.
|
| 344 |
+
|
| 345 |
+
- Task J: represented, national, mr, summarised, practising, lawyer, agent, paragraph
|
| 346 |
+
- Task B: hearing, born, adjourned, detained, noted, hearing, alleged, investigation, place, question, members
|
| 347 |
+
- Task A: stated, could, also, one, arrested, detained, hearing, investigation, hearing, within, due, second, hearing, certain
|
| 348 |
+
- Task AI B: february, published, november, march, religious, investigation, first, service, letter, carried, would, one, submitted, head, march, damage, group, provided, seen
|
| 349 |
+
|
| 350 |
+
The words were chosen as relevant or irrelevant by using the daily vocabulary of a human rights lawyer working at the ECtHR as a reference. A word was considered legally relevant if, taken individually, it could be introduced into legal reasoning. For instance, the word "religious" was spurious because taken individually it says nothing about the content of a norm. One may talk about religious freedom, but the legally relevant word there is freedom. Article 9 mentions religion, but restrictions related to religion may also be present under Article 8, 3, 2, 5, etc. Under the same Article 9 for instance, the court decides whether there has been a violation depending on criteria such as tolerance, pluralism, etc. It is those criteria that are relevant whereas "religion" is not by itself relevant as a part of the legal reasoning.
|
| 351 |
+
|
| 352 |
+
# G LMI Calculation
|
| 353 |
+
|
| 354 |
+
We calculate LMI for each pair of token $t$ and label $y$ as follows:
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
L M I (\mathrm {t}, \mathrm {y}) = p (\mathrm {t}, \mathrm {y}) \times P M I (\mathrm {t}, \mathrm {y}) \tag {4}
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
p (t, y) = \frac {\operatorname {c o u n t} (t , y)}{| D |} \tag {5}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
P M I (\mathbf {t}, \mathbf {y}) = \log \frac {p (\mathbf {t} \mid \mathbf {y})}{p (\mathbf {t})} \tag {6}
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
where $\text{count}(t, y)$ denotes the co-occurrence of $t$ and label $y$ , and $|D|$ is the number of unique words in the training set.
|
| 369 |
+
|
| 370 |
+
In the case of binary classification (task J) and one-vs-one multi-label classification (task A|B), we calculate the LMI score for a token as the absolute difference between LMI scores for both positive and negative labels, as both the labels represent a particular class. In one-vs-rest (tasks A, B), we simply take the difference between LMI scores for both positive and negative labels (rather than absolute difference) as the negative label does not specifically represent a particular class. Finally, we calculate the z-score statistic of the effective LMI score for each token to identify significant tokens.
|
| 371 |
+
|
| 372 |
+
# H Model configuration & Training
|
| 373 |
+
|
| 374 |
+
Spurious token identification: We train a series of decision trees of depth 3 to assemble lists of predictive tokens for expert filtering. The feature vector consists of whitespace-tokenized unigrams reduced by the LMI filtering explained above. For task J, this means training trees that predict the binary violation label. For task A and B we employ a one-vs-rest classification to produce one decision tree series per article. For task AlB we provided the task B labels (allegedly violated articles) in one-vs-one fashion per article, with positive instances being facts where that particular article was deemed violated, and negatives where that particular article was merely alleged but not deemed violated.
|
| 375 |
+
|
| 376 |
+
LJP models: Our models compute BERT-based word embeddings of size 768. Our word level attention context vector size is 300. The sentence level GRU encoder dimension is 200, thus giving a bidirectional embedding of size 400, and a sentence level attention vector dimension of 200. The final dense classifier for all tasks has 100 hidden units. The output dimension is 1 for task J and 10 for the other tasks (i.e. one per convention article). For task AlB, we concatenate a multi-hot 10-element feature vector containing the task B labels to the output of the feature extractor before it is passed to the classifier. All discriminators (country, length, and vocabulary) are built as analogous classifiers with a hidden dimension of 100 and output layer
|
| 377 |
+
|
| 378 |
+
dimensions as required by each of them. We use mini batches size of 8 in case of Task J and 16 for all other tasks. The model is optimized end-to-end using Adam (Kingma and Ba, 2015). The dropout rate (Srivastava et al., 2014) in all layers is 0.1. We determine the best learning rate using a grid search on the development set and use early stopping based on the development set F1 score.
|
| 379 |
+
|
| 380 |
+
# I Visualization of IG score
|
| 381 |
+
|
| 382 |
+
Figure 7 exhibits screenshot excerpts of a sample case text provided to the legal expert for qualitative evaluation. The yellow background highlight was not in the original visualization and has been supplied here as a reference. We add it here as an example of focus patterns shifting incurred by our deconfounding method.
|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 2: Macro-F1-Performance of Decision Trees across different iterations with removal of informative feature nodes in successive iterations. For Task A,B, AlB, standard deviation bars represent variability in F1-score across the 10 articles.
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
|
| 393 |
+
<table><tr><td>Article</td><td>% of cases alleged</td><td>% of cases alleged and violated</td><td>% of cases alleged but not violated</td><td>conditional probability of violation given allegation</td><td>% of cases not alleged but violated</td></tr><tr><td>10</td><td>4.9</td><td>3.1</td><td>1.8</td><td>63.27</td><td>0.13</td></tr><tr><td>11</td><td>1.8</td><td>1.2</td><td>0.6</td><td>66.67</td><td>0.02</td></tr><tr><td>14</td><td>4.93</td><td>1.51</td><td>3.42</td><td>30.63</td><td>0.06</td></tr><tr><td>2</td><td>6.92</td><td>5.48</td><td>1.44</td><td>79.13</td><td>0.13</td></tr><tr><td>3</td><td>19.33</td><td>14.5</td><td>4.83</td><td>75.0</td><td>0.49</td></tr><tr><td>5</td><td>18.03</td><td>14.68</td><td>3.36</td><td>81.39</td><td>0.52</td></tr><tr><td>6</td><td>60.41</td><td>51.64</td><td>8.77</td><td>85.49</td><td>0.62</td></tr><tr><td>8</td><td>11.73</td><td>7.66</td><td>4.08</td><td>65.25</td><td>0.23</td></tr><tr><td>9</td><td>0.9</td><td>0.44</td><td>0.46</td><td>49.38</td><td>0.01</td></tr><tr><td>P1-1</td><td>17.31</td><td>15.02</td><td>2.29</td><td>86.78</td><td>0.77</td></tr></table>
|
| 394 |
+
|
| 395 |
+
Table 4: Statistics of LexGlue Train Dataset (Total of 9000 Cases) (Chalkidis et al., 2022a)
|
| 396 |
+
|
| 397 |
+
<table><tr><td></td><td>violation</td><td>non-violation</td></tr><tr><td>number of cases</td><td>3551</td><td>3549</td></tr><tr><td>avg. number of sentences per case</td><td>55</td><td>35</td></tr><tr><td>number of inadmissible cases</td><td>0</td><td>2608</td></tr><tr><td>avg. first paragraph number appeared in the text</td><td>6.1</td><td>1.8</td></tr><tr><td>percentage of cases containing the word ‘represented’</td><td>0.17</td><td>0.68</td></tr></table>
|
| 398 |
+
|
| 399 |
+
Table 5: Statistics of violation (label 1) and non-violation (label 0) cases in the training set of Task J. Some inadmissible cases are so short that no paragraph numbers appear. In such situations we count the paragraph number as 0.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 3: Text length distribution in the training set of Task J
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 4: Country distribution in the training set of Task J
|
| 406 |
+
|
| 407 |
+

|
| 408 |
+
Figure 5: Text length distribution for each violated article in the training set of Task B
|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
Figure 6: Country distribution in training set of Task B. For the display effect, only countries accounting for more than $1\%$ of the total cases are displayed.
|
| 412 |
+
|
| 413 |
+
(a) gradAll
|
| 414 |
+
(b) paraRem
|
| 415 |
+
Figure 7: Example visualizations of different IG scores derived from the (a) gradAll and (b) paraRem model, respectively. The gradAll model focuses contiguously and densely on the expert-annotated indicative sentence 'A defendant to committal proceedings ... proving guilt lay on the person seeking committal' (yellow background highlighted); while the paraRem model fails to focus the latter half the indicative sentence.
|
| 416 |
+

|
| 417 |
+
committal proceedings , which had applied to the proceedings before the county court ( see paragraph41 below ) , such proceedings concerned a [UNK] criminal charge [UNK] for the purpose of article 6 of the convention and the defendant therefore benefit ##ed from the right to legal assistance set out inarticle 6 § 3 (c ) . a defendant to committal proceedings was not obliged to give evidence and enjoyed a right against self [UNK] incrimination and ,referring to article 6 § 2 , the burden of proving guilt lay on the person seeking committal him the applicant [UNK] s case , cose #s ] observed that thesematters had not been drawn to the attention of the judge . he continued : [UNK] 11 . un ##ut ##or #ed and un ##assi #ste #d as the judge was , matterswent wrong from the beginning . the judge noted , at the outset , that mr hammer ##to #n was acting in person . he made no comment about it whatever .
|
deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25cda20fdb1b7aa4c49481d31031f002791e934611a44db7d820c1af99356343
|
| 3 |
+
size 573727
|
deconfoundinglegaljudgmentpredictionforeuropeancourtofhumanrightscasestowardsbetteralignmentwithexperts/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0d9d666436c1ed38b1c6da042f482f2a1dd091c2445c79405fa2bff346b73ed9
|
| 3 |
+
size 429978
|
detectinglabelerrorsbyusingpretrainedlanguagemodels/6a586241-5a85-4d3a-9a9f-6eb4fc2015c3_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02f65c0e4bd1f0ebde37358154951c4ae22491d4d73eb45b08cbed799fa4d4d4
|
| 3 |
+
size 114577
|
detectinglabelerrorsbyusingpretrainedlanguagemodels/6a586241-5a85-4d3a-9a9f-6eb4fc2015c3_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:45d179595d8195ea693a49059df0d57183586ef850f39120a3efb124399ba1b1
|
| 3 |
+
size 139863
|
detectinglabelerrorsbyusingpretrainedlanguagemodels/6a586241-5a85-4d3a-9a9f-6eb4fc2015c3_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a0700744d3307a24901dcf13e9a965ca5c38caec1ac7fc44a1a56f15058cfa2
|
| 3 |
+
size 758874
|
detectinglabelerrorsbyusingpretrainedlanguagemodels/full.md
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Detecting Label Errors by using Pre-Trained Language Models
|
| 2 |
+
|
| 3 |
+
Derek Chong*
|
| 4 |
+
Stanford University
|
| 5 |
+
derekch@stanford.edu
|
| 6 |
+
|
| 7 |
+
Jenny Hong*
|
| 8 |
+
Stanford University
|
| 9 |
+
jennyhong@cs.stanford.edu
|
| 10 |
+
|
| 11 |
+
Christopher D. Manning
|
| 12 |
+
Stanford University
|
| 13 |
+
manning@cs.stanford.edu
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
We show that large pre-trained language models are inherently highly capable of identifying label errors in natural language datasets: simply examining out-of-sample data points in descending order of finetuned task loss significantly outperforms more complex error-detection mechanisms proposed in previous work. To this end, we contribute a novel method for introducing realistic, human-originated label noise into existing crowdsourced datasets such as SNLI and TweetNLP. We show that this noise has similar properties to real, hand-verified label errors, and is harder to detect than existing synthetic noise, creating challenges for model robustness. We argue that human-originated noise is a better standard for evaluation than synthetic noise. Finally, we use crowdsourced verification to evaluate the detection of real errors on IMDB, Amazon Reviews, and Recon, and confirm that pre-trained models perform at a $9 - 36\%$ higher absolute Area Under the Precision-Recall Curve than existing models.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Improving model performance in the presence of label errors comprises an area of active research (Song et al., 2022). However, existing methods focus on label errors in training data. Although seldom acknowledged, evaluation label errors are at least as pernicious as training label errors: pervasive errors in commonly used NLP benchmarks have been found to destabilize model performance (Malik and Bhardwaj, 2011; Northcutt et al., 2021b). Such findings suggest that improving training methods does not preclude the need for improving the underlying data. We propose a simple method for using large, pre-trained language models
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Precision-recall curves for label error detection: Large language models detect label errors with high precision, and far more effectively than a baseline word vector-based neural classifier. Overlaying a state-of-the-art model-agnostic error detection method, Confident Learning, results in little to no improvement (TweetNLP-5; §7).
|
| 25 |
+
|
| 26 |
+
(LLMs) to directly identify label errors for the purposes of correcting or removing them.
|
| 27 |
+
|
| 28 |
+
The majority of work in identifying label errors, and in data-centric artificial intelligence (DCAI) more broadly, focuses on image and healthcare data (DCAI Workshop, 2021). However, the success of the foundation model (FM) paradigm in applying pre-trained language models to a variety of NLP tasks (Bommasani et al., 2021; Reiss et al., 2020) suggests that FMs may be a powerful tool for detecting and correcting label errors in language datasets. Pre-training has been shown to imbue models with properties such as resistance to label errors, class imbalance (Karthik et al., 2021), out-of-distribution detection (Hendrycks et al., 2018), and confidence calibration (Desai and Durrett, 2020), while conferring ro
|
| 29 |
+
|
| 30 |
+
<table><tr><td>Dataset</td><td>Text</td><td>Label</td><td>Sentiment</td></tr><tr><td>IMDB</td><td>It is really unfortunate that a movie so well produced turns out to be such a disappointment. I thought this was full of (silly) cliches. It had all sorts of differences that it tried to tie together (not a bad thing in itself) but the result is at best awkward, but in fact ridiculous–too many clashes that wouldn’t really happen. Then the end of the movie–the last 10 minutes–ruined all the rest. At first I thought Xavier was OK but with retrospect I think he was pretty bad. And that’s all really too bad, because technically it was really good, and the soundtrack was great too. So the form was good, but the content pretty horrible.</td><td>Positive</td><td>Negative</td></tr><tr><td>IMDB</td><td>The ending made my heart jump up into my throat. I proceeded to leave the movie theater a little jittery. After all, it was nearly midnight. The movie was better than I expected. I don’t know why it didn’t last very long in the theaters or make as much money as anticipated. Definitely would recommend.</td><td>Negative</td><td>Positive</td></tr><tr><td>Amazon</td><td>The new design only has a thin layer of cellulose sponge material. It will not last as long. Already showing signs of wearing out. The picture does not represent the item received.</td><td>Neutral</td><td>Negative</td></tr></table>
|
| 31 |
+
|
| 32 |
+
Table 1: Organic label errors from sentiment datasets IMDB and Amazon, shown with the original dataset label. Each example was hypothesized by our model to be erroneous, and later verified by crowd workers.
|
| 33 |
+
|
| 34 |
+
bustness, generalization, and natural language understanding capabilities (Wang et al., 2018; Petroni et al., 2019). Our primary contribution is to show that simply verifying items in order of their out-of-sample loss on a foundation model improves precision by an absolute $15 - 28\%$ and Area Under the Precision-Recall Curve (AUPR) by an absolute $9 - 36\%$ .
|
| 35 |
+
|
| 36 |
+
Many methods for label error detection rely on artificially introduced label errors as ground truth for evaluating their methods. Northcutt et al. (2021a) develop a state-of-the-art model for identifying label errors, Confident Learning (CL), and use the better approach of crowdsourced human evaluations to determine the ground truth of label errors. We model our experiments on real data after their verification protocol, replicating this on real errors in IMDB (Maas et al., 2011), Amazon Reviews (McAuley et al., 2015), and Recon (Hong et al., 2021), with adaptations to mitigate annotator fraud (Kennedy et al., 2020).
|
| 37 |
+
|
| 38 |
+
In the process of assessing our results, we contribute a novel technique and protocol for introducing realistic, human-originated label noise into existing crowdsourced datasets, and apply it to two such datasets, TweetNLP (Gimpel et al., 2010) and SNLI (Bowman et al., 2015). We demonstrate that our technique better approximates organic (real, naturally occurring) label errors than existing methods. We provide evidence that this realism is essential to properly assessing model performance: even
|
| 39 |
+
|
| 40 |
+
models that are robust to standard synthetic.
|
| 41 |
+
noising approaches show limited robustness to
|
| 42 |
+
human-originated noise.1
|
| 43 |
+
|
| 44 |
+
# 2 Related Work
|
| 45 |
+
|
| 46 |
+
Learning with Noisy Labels (LNL) focuses on the model-training stage. Noise-robust approaches examine model enhancements such as the design of loss functions (Joulin et al., 2016; Amid et al., 2019; Liu and Guo, 2020; Ma et al., 2020), regularization (Azadi et al., 2015; Zhou and Chen, 2021), reweighting (Bar et al., 2021; Kumar and Amid, 2021), hard negative mining and contrastive learning (Zhang and Stratos, 2021). Noise-cleansing approaches aim to segregate clean data from noisy data in training, e.g. bagging and boosting (Wheway, 2000; Sluban et al., 2014), $k$ -nearest neighbors (Delany et al., 2012), outlier detection (Gamberger et al., 2000; Thongkam et al., 2008), bootstrapping (Reed et al., 2014), and neural networks supervised directly on detecting an error, when such data exist (Jiang et al., 2018).
|
| 47 |
+
|
| 48 |
+
LNL methods have in most cases been evaluated using artificially-generated label noise. A typical evaluation of an LNL method uses a standard benchmark dataset, and programmatically corrupts training labels via one of three main noisings schemes (Frenay and Verleysen, 2014; Algan and Ulusoy, 2020). Uni
|
| 49 |
+
|
| 50 |
+
form noise is most commonly used but unrealistic; deep neural networks have been found to perform well even when noised labels outnumber original labels at a ratio of 100 to 1 (Rolnick et al., 2017). Class-dependent noise randomly permutes labels based on a confusion matrix. However, research on annotator disagreement suggests that label errors tend to result from feature-based, not class-based ambiguity (Hendrycks et al., 2018). Training models to generate realistic feature-based or instance-dependent noise has recently emerged as an area of active research (Chen et al., 2021b; Xu et al., 2021; Dawson and Polikar, 2021). However, Algan and Ulusoy (2020) report that feature-dependent noise may bias benchmark performance toward similar models to the ones used to generate this noise.
|
| 51 |
+
|
| 52 |
+
The noising schemes above each fail in some way to simulate organic, naturally occurring label errors, which are estimated to occur in common benchmarks at $1 - 5\%$ of labels (Redman, 1998; Muller and Markert, 2019; Northcutt et al., 2021b; Kreutzer et al., 2022) or even as much as $20\%$ (Hovy et al., 2014; Abedjan et al., 2016). For organic errors, CL (Northcutt et al., 2021a) predicts errors in IMDB, Amazon Reviews, and other datasets by estimating a joint distribution between noisy and uncorrupted labels; Reiss et al. (2020) pioneers using BERT for error detection on ConLL-2003 via a classifier trained over a frozen BERT embeddings layer.
|
| 53 |
+
|
| 54 |
+
# 3 Methods
|
| 55 |
+
|
| 56 |
+
Motivation. Empirical evidence on image data suggests that models exhibit high loss on label errors in training data relative to the underlying features (Huang et al., 2019; Kim et al., 2021; Hong et al., 2021; Chen et al., 2021a). Hendrycks and Gimpel (2017) show that predicted probabilities of (non pre-trained) neural networks can identify out-of-distribution examples. We consider the framing that label errors are one type of out-of-distribution data. Indeed, CL (Northcutt et al., 2021a) uses normalized predicted probabilities, also from non pre-trained models, to directly identify label errors. Foundation models are highly performant; we hypothesize that a low likelihood label is likely to be an error.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 2: Loss exhibits a strong log-linear relationship with error detection precision at a fixed threshold, across a broad range of models and hyperparameters ( $r^2$ : 0.94; TweetNLP-5, §7).
|
| 60 |
+
|
| 61 |
+
Foundation models. The success of Reiss et al. (2020)'s approach in using frozen BERT embeddings motivates directly applying the foundation model paradigm: we use a large language model that was first pre-trained on a task-agnostic dataset, then fine-tune the model for a given task.
|
| 62 |
+
|
| 63 |
+
We address classification tasks: given a model's score $f_{i,c}$ for each item $i$ and class $c$ , its predicted probability is the softmax-normalized score $p(c \mid x_i)$ . Because each item belongs to exactly one class, the contribution of item $i$ to the loss is the negative log probability of the score for the assigned class $y_i$ :
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
L _ {i} = \sum_ {i} - \log p \left(y _ {i} \mid x _ {i}\right).
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
We fine-tune such a model for the training split of each data set. To identify label errors on a validation or test set, we hypothesize items from the dataset as a label error in order of the item's loss on that out-of-distribution set.
|
| 70 |
+
|
| 71 |
+
We propose two main methods. Foundation Model Loss (FML) uses a single foundation model, fine-tuned on the corresponding task (e.g., sentiment classification, POS tagging), to hypothesize items in order of the model-predicted loss. We augment FML using task-adaptive pre-training (TAPT; Gururan-gan et al., 2020), which is further pre-training on in-domain data, using only text on the pretraining objective without using any labels for fine-tuning on the cross-entropy objective.
|
| 72 |
+
|
| 73 |
+
Foundation Model Ensembling (FME) combines multiple foundation models on the same
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 3: Assessing model robustness against a range of noising methods on TweetNLP, with methods ordered by hypothesized realism. Solid orange lines report task performance on noisy test data, reflecting observations in practice; dashed blue lines report task performance on underlying clean test data, reflecting models' actual performance. Models may be robust to uniform and class-dependent noise, where the true performance remains high even with increasing levels of noise. However, they are not necessarily robust to human-originated noise, where the true test performance decreases with increasing noise.
|
| 77 |
+
|
| 78 |
+
task. We hypothesize that ensembling may be disproportionately effective at detecting label errors, as training noise induces models to learn random spurious correlations (Watson et al., 2022). Rather than using a validation set to choose the single model with the lowest loss on the task, FME uses the top three models trained in a hyperparameter sweep, and differing in both hyperparameters and random initialization, as fully described in Appendix D. FME creates a synthetic probability distribution over the task outputs by averaging the probabilities predicted using each individual model. FME then hypothesizes items in order of loss over the synthetic distribution.
|
| 79 |
+
|
| 80 |
+
# 4 Generating Realistic Label Noise
|
| 81 |
+
|
| 82 |
+
To better evaluate label noise detection performance, we prepare a set of benchmark datasets populated with controllable, highly realistic, human-originated label noise.
|
| 83 |
+
|
| 84 |
+
Sources of human error. We observe that datasets often undergo multiple annotation passes: crowdsourced labels typically aggregate several annotators' inputs (Hovy et al., 2014; Wei et al., 2022), and subsets of data may receive more extensive validation (Bowman et al., 2015), gold labels by trained experts (Plank et al., 2014), or correction passes (Reiss et al., 2020). We hypothesize that differences between such annotations may be usefully repurposed as a source of realistic, human-originated label noise, as disagreements between annotators is known to reflect systematic ambiguity and human error (Plank et al., 2014; Zhang et al.,
|
| 85 |
+
|
| 86 |
+
2017), and differs from the type of noise studied using existing synthetic methods.
|
| 87 |
+
|
| 88 |
+
We construct three noising methods which may be applied in many of the above scenarios. For any dataset which includes two levels of label quality, the dissenting label method replaces final labels with disagreeing labels at random, simulating imperfect quality control. Datasets which provide individual annotator identifiers may apply the dissenting worker approach: select one annotator at random, apply all of their labels which disagree with final labels, and repeat until reaching the target noise rate. This simulates gaps in annotator training, which introduce systematic idiosyncrasies. Finally the crowd majority method applies to any dataset in which individual annotations can be aggregated to produce a label other than the final label: the former label simulates challenging, systematic errors in the latter.
|
| 89 |
+
|
| 90 |
+
Noising and robustness. We assess the effect of these noising methods using TweetNLP (Gimpel et al., 2010), a corpus of 26,435 tokens from 1,827 American English tweets collected from Twitter used to train part-of-speech (POS) tagging. TweetNLP includes gold labels annotated by 17 experts, but later received a separate crowdsourced assessment, aggregated by majority vote (Hovy et al., 2014). We noise TweetNLP to eight levels from 0-20% separately for each method, fine-tune DeBERTA-v3-base (He et al., 2021) on each noising, and evaluate models on both noisy and clean test sets. Results from noisy test sets represent model performance as measurable in
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 4: Distributions of losses of label errors on TweetNLP at $5\%$ noising. Uniform and class-based noise produce high and distinctive losses; human-originated noise is widely distributed, and has greater overlap with the distribution of clean data points; §6.
|
| 94 |
+
|
| 95 |
+
practice; real datasets contend with noise in evaluation data. Clean test set results represent true model performance. Fig. 3 reports the results of this evaluation.
|
| 96 |
+
|
| 97 |
+
For uniform and class-dependent noise, true performance remains high even for high noise levels (per Rolnick et al., 2017). But crucially, this robustness does not extend to human-originated noise: human label errors are correlated to input text, and so contain systematic erroneous features, which models may learn in training. On more challenging nois-ing methods, although measured performance appears to increase, true performance actually linearly decreases with noise. Fig. 4 explores this further via the distributions of model losses for each nois-ing method: loss induced by human-originated noise overlaps significantly with clean items, whereas loss from uniform and class-based nois-ing is distinctively higher.
|
| 98 |
+
|
| 99 |
+
Noise detection benchmarks. We standardize a set of benchmarks from existing datasets for use in our main experiments. TweetNLP-5 and SNLI-5 aim to simulate typical data noise conditions: we apply dissenting worker and dissenting label noising to a $5\%$ level (see Appendix A for details). SNLI is a corpus of 570,152 sentence pairs, in which the task is to label each pair with entailment, contradiction, or semantic independence; we use the $10\%$ subset which includes five crowdsourced annotations per item, as collected by
|
| 100 |
+
|
| 101 |
+
Bowman et al. (2015) during data validation.
|
| 102 |
+
|
| 103 |
+
We construct TweetNLP-M to investigate robustness to systematic error introduced by the crowdsourcing process. We apply crowd majority noising, comparing noisy majority-vote aggregated labels by Hovy et al. (2014) to clean expert labels, which serve as a measure of true performance. Accordingly, we retain all disagreements, or $20.46\%$ of the dataset. We also report results on Recon, a legal classification dataset of 1,279 documents in which Hong et al. (2021) found label errors to destabilize model evaluation; as above, we compare non-expert and expert annotator labels.
|
| 104 |
+
|
| 105 |
+
# 5 Validation on Real Label Errors
|
| 106 |
+
|
| 107 |
+
In addition to human-originated noise datasets, we evaluate error detection performance on organic errors in two benchmark datasets, following Northcutt et al. (2021a)'s protocol.
|
| 108 |
+
|
| 109 |
+
Datasets. The IMDB Large Movie Review Dataset is a collection of movie reviews for binary sentiment classification (Maas et al., 2011), and is split into train and test sets of 25,000 items each. Amazon Reviews is a collection of reviews and 5-point star ratings from Amazon customers (McAuley et al., 2015). We used the version released by Northcutt et al. (2021a), which includes the following modifications: It uses 1-star, 3-star, 5-star reviews with net positive helpful upvotes as a ternary sentiment task, resulting in a dataset of 9,996,437 reviews. For tractability we use a train split of a random sample of 2.5 million items, and a test split of 25,000 items.
|
| 110 |
+
|
| 111 |
+
Baseline protocol. Workers are presented with review text and asked to determine whether overall sentiment is positive, negative, neutral, or off-topic. Each review is independently presented to five workers. An example is considered a "Non-Error" if at least three workers agree the original label is correct. Otherwise, we consider the label to be correctly identified as an error. We further categorize label errors as "Correctable" if at least three workers agree on the same replacement label, or "Non-Agreement" if no majority exists.
|
| 112 |
+
|
| 113 |
+
New adaptations. While conducting initial experiments, we found that the Northcutt et al.
|
| 114 |
+
|
| 115 |
+
<table><tr><td rowspan="2">IMDB
|
| 116 |
+
Old Protocol</td><td colspan="4">New Protocol</td></tr><tr><td>C</td><td>NA</td><td>NE</td><td>Total</td></tr><tr><td>Correctable</td><td>105</td><td>44</td><td>24</td><td>173</td></tr><tr><td>Non-Agreement</td><td>75</td><td>252</td><td>225</td><td>552</td></tr><tr><td>Non-Error</td><td>3</td><td>62</td><td>520</td><td>585</td></tr><tr><td>Total</td><td>183</td><td>358</td><td>769</td><td>1310</td></tr></table>
|
| 117 |
+
|
| 118 |
+
<table><tr><td>Amazon</td><td colspan="4">New Protocol</td></tr><tr><td>Old Protocol</td><td>C</td><td>NA</td><td>NE</td><td>Total</td></tr><tr><td>Correctable</td><td>142</td><td>43</td><td>117</td><td>302</td></tr><tr><td>Non-Agreement</td><td>140</td><td>79</td><td>211</td><td>430</td></tr><tr><td>Non-Error</td><td>75</td><td>31</td><td>162</td><td>268</td></tr><tr><td>Total</td><td>357</td><td>153</td><td>490</td><td>1000</td></tr></table>
|
| 119 |
+
|
| 120 |
+
Table 2: Re-evaluation of baselines: The number of Correctable, Non-Agreement, and Non-Error assessments produced by the CL Mechanical Turk evaluation protocol and the new protocol, on the same set of items. The new protocol substantially reduces annotator non-agreement; §5.
|
| 121 |
+
|
| 122 |
+
(2021a) MTurk protocol resulted in a significant amount of annotator fraud. Some workers spent unreasonably short amounts of time on the text, and frequently disagreed with both expert and peer annotators, reflecting increasingly common issues in crowdsourced annotations (Kennedy et al., 2020). Appendix C describes four extra conditions we added to improve the Northcutt et al. (2021a) protocol.
|
| 123 |
+
|
| 124 |
+
In order to establish an accurate baseline, we re-evaluate the label errors hypothesized by CL (Northcutt et al., 2021a). On the new protocol, Fleiss' $\kappa$ inter-annotator agreement increases from 0.131 to 0.464 for IMDB, and 0.014 to 0.556 for Amazon, and Table 2 shows that Non-Agreement decreases by $35\%$ in IMDB and $65\%$ in Amazon. This suggests a substantial decrease in low-quality annotations.
|
| 125 |
+
|
| 126 |
+
# 6 Experiments
|
| 127 |
+
|
| 128 |
+
Label noise realism. Section 4 defined the human-originated noising protocol used to generate TweetNLP-5, TweetNLP-M, and SNLI-5. Section 5 specified a protocol for identifying organic label errors present in IMDB and Amazon. We assess the realism of synthetic noise methods by comparing loss distributions against models trained with organic noise (for real label errors, we refer to items verified as Correctable via MTurk). We quantify the de
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 5: Distributions of losses of hypothesized label errors that MTurk workers verified for IMDB. As with Fig. 4, uniform and class-based methods do not approximate real, worker-identified errors, and losses of real label errors have greater overlap with the distribution of clean data; §6.
|
| 132 |
+
|
| 133 |
+
greet to which noising induces erroneous learning by measuring the Wasserstein distances between noisy and clean loss distributions.
|
| 134 |
+
|
| 135 |
+
Overall LLM performance. We assess broad error detection capabilities by evaluating 13 commonly-used LLMs on TweetNLP-5. We measure performance against loss, model size, and GLUE score (a proxy for general model capability; Wang et al., 2018). Appendix D provides implementation details. This experiment's results inform model selection: we use DeBERTA-v3-base for all further experiments.
|
| 136 |
+
|
| 137 |
+
Main experiment. Using our realistic nois-. ing benchmarks, and the MTurk baselines and verification protocol, we can now assess the performance of each label error detection method. We evaluate Foundation Model Loss (FML) and Foundation Model Ensembling (FME).
|
| 138 |
+
|
| 139 |
+
As a baseline, we evaluate Confident Learning (CL; Northcutt et al., 2021a). CL is not a standalone method; it augments existing models. Given an underlying model's predicted scores for each class and the true proportion of each class, CL forms a reweighting matrix, called the confident joint. To form a label error prediction score, CL reweights the model's scores by the confident joint. CL hypothesizes items in order of this resulting score.
|
| 140 |
+
|
| 141 |
+
CL uses FastText (Joulin et al., 2017) for IMDB and Amazon, but includes no implemen
|
| 142 |
+
|
| 143 |
+
<table><tr><td rowspan="2"></td><td colspan="6">Area Under Precision-Recall Curve</td><td colspan="6">Precision, Recall @ Error%3</td><td colspan="4">Recall @ 2 · Error%</td></tr><tr><td>I</td><td>Am.</td><td>R</td><td>T-5</td><td>T-M</td><td>S-5</td><td>I</td><td>Am.</td><td>R</td><td>T-5</td><td>T-M</td><td>S-5</td><td>R</td><td>T-5</td><td>T-M</td><td>S-5</td></tr><tr><td>H&G</td><td>-</td><td>-</td><td>-</td><td>0.30</td><td>0.41</td><td>0.20</td><td>-</td><td>-</td><td>-</td><td>0.31</td><td>0.44</td><td>0.22</td><td>-</td><td>0.54</td><td>0.63</td><td>0.34</td></tr><tr><td>CL</td><td>0.24</td><td>0.31</td><td>0.25</td><td>0.30</td><td>0.41</td><td>0.17</td><td>0.41</td><td>0.51</td><td>0.31</td><td>0.36</td><td>0.44</td><td>0.18</td><td>0.46</td><td>0.47</td><td>0.63</td><td>0.32</td></tr><tr><td>FML</td><td>0.58</td><td>0.39</td><td>0.37</td><td>0.66</td><td>0.48</td><td>0.54</td><td>0.68</td><td>0.64</td><td>0.46</td><td>0.65</td><td>0.47</td><td>0.45</td><td>0.62</td><td>0.88</td><td>0.64</td><td>0.66</td></tr><tr><td>FME</td><td>0.60</td><td>0.40</td><td>0.38</td><td>0.68</td><td>0.48</td><td>0.61</td><td>0.69</td><td>0.66</td><td>0.38</td><td>0.66</td><td>0.48</td><td>0.46</td><td>0.69</td><td>0.88</td><td>0.65</td><td>0.68</td></tr><tr><td>FME+CL</td><td>0.20</td><td>0.17</td><td>0.37</td><td>0.68</td><td>0.48</td><td>0.62</td><td>-</td><td>-</td><td>0.38</td><td>0.69</td><td>0.48</td><td>0.47</td><td>0.69</td><td>0.89</td><td>0.66</td><td>0.68</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Table 3: Main experiment: Evaluating label error detection methods using datasets containing highly-realistic label errors (IMDB, Amazon Reviews, Recon, TweetNLP-5, TweetNLP-M, SNLI-5). Foundation model-based methods significantly outperform baselines on every dataset, as shown by an overall performance metric (AUPR). In practice, estimating the number of dataset errors and checking this many items quickly catches up to $69\%$ of errors, at the same accuracy $(\mathrm{P,R@Err\%})$ . For improved coverage, checking twice this number of items catches up to $89\%$ of errors $(\mathrm{R@2-Err\%})$ .
|
| 146 |
+
|
| 147 |
+
tations for POS tagging or NLI. As a result, for TweetNLP and SNLI, we apply CL to the H&G baseline (Hendrycks and Gimpel, 2017), a two-layer neural classifier over word vectors pre-trained on a corpus of 56 million tweets (Owoputi et al., 2013). For all datasets, we also assess applying CL to foundation models $(\mathbf{FME} + \mathbf{CL})$
|
| 148 |
+
|
| 149 |
+
For each dataset, we run 25 hyperparameter sweeps which each fine-tune a model for the given task (e.g., POS tagging) using noisy data, and select the model with the best validation set task performance. We report label error detection performance (not task performance). Area Under the Precision-Recall Curve (AUPR) provides an overall performance score (Saito and Rehmsmeier, 2015; Hendrycks and Gimpel, 2017). We also report metrics representing performance on competing data cleaning priorities: efficiency requires high precision on a small number of items, whereas coverage requires high recall on a larger number of items. Appendix E.1 describes the Truncated AUPR used for IMDB and Amazon, which are too costly to fully crowd verify.
|
| 150 |
+
|
| 151 |
+
End-to-end noising. We finally isolate the effects of noise and label error correction for validation and test splits. For each dataset, we prepare three versions of the validation and test splits, respectively: a clean version assumed to contain zero errors, a noisy version, with label
|
| 152 |
+
|
| 153 |
+
noise deliberately introduced, and a corrected version generated from noisy splits using our main error detection method (ranking errors with FME and correcting the top $\mathrm{Err\%}$ data points). We train 40 hyperparameter sweeps, with performance cross-evaluated on all prepared data splits.
|
| 154 |
+
|
| 155 |
+
We report three different metrics. We report each model's accuracy on the clean test split as the true accuracy. Following the norms of Fig. 3, we report the measurable accuracy as the accuracy of the model selected using performance on the noisy or corrected validation split on the corresponding test split. Finally, we report the rank of the model as the rank of the model's performance on clean test data. The best performing model among all sweeps has rank 1, and the worst has rank 40. This metric emphasizes that different validation sets select different models.
|
| 156 |
+
|
| 157 |
+
We perform this exercise using IMDB and Amazon noised to $5\%$ (I-5, A-5), and TweetNLP-5 and TweetNLP-M.
|
| 158 |
+
|
| 159 |
+
# 7 Results
|
| 160 |
+
|
| 161 |
+
Label noise realism. Human-originated noise appears to closely approximate real label noise. Figs. 4 and 5 show that the losses of both real and human-originated label errors are lower and more widely-distributed than existing noising methods. Their Wasserstein distances to the distribution of clean data are significantly lower than existing noising methods, suggesting comparable erroneous learning (Appendix B).
|
| 162 |
+
|
| 163 |
+
Overall LLM performance. We discover a strong log-linear relationship between error
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 6: Precision-recall curves for label error detection on Amazon by method. FML+CL and FME+CL produce fewer items and do not extend to a recall past 0.21. Applying CL to FM changes little compared to using FM alone.
|
| 167 |
+
|
| 168 |
+
detection performance and loss, which holds across many model families and configurations $(r^2$ : 0.94, Fig. 2). We also find relationships between error detection performance and general model capability, in terms of GLUE score $(r^2$ : 0.79) and model size (Fig. 10). Fig. 7 illustrates key findings using models' receiver operating characteristic (ROC) curves. Ensembling confers significantly more gains in error detection performance higher than gains on underlying task performance, across a broad range of models and hyperparameters; Appendix E.3 explores ensembling in greater detail.
|
| 169 |
+
|
| 170 |
+
Main experiment. Table 3 shows that Foundation Model Ensembling significantly improves AUPR from the CL and H&G baselines on all datasets, with an absolute difference of 0.36 on IMDB, 0.09 on Amazon, and a difference of 0.07-0.44 on synthetic data.
|
| 171 |
+
|
| 172 |
+
Fig. 1 shows that applying CL to FME has minimal effect on performance at every level of recall; most numbers are identical across the FME and $\mathrm{FME + CL}$ rows of Table 3. In fact, CL does not necessarily improve upon the H&G baseline across datasets, with CL performance sometimes dipping below H&G by 0.01-0.03.
|
| 173 |
+
|
| 174 |
+
While loss naturally ranks all data points, CL only hypothesizes a fixed number of potential errors: Appendix E.2 shows the raw counts of items at fixed thresholds, per the original CL study. At the CL threshold, we outperform CL by an absolute $15 - 28\%$ . At the $\mathrm{CL + FME}$ threshold, predicted items are almost exactly
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 7: ROC curves for error detection performance on TweetNLP-5: LLM loss is highly effective for detecting label errors, and performance is highly correlated with general language understanding (GLUE, $r^2$ : 0.79).
|
| 178 |
+
|
| 179 |
+
the same, with Jaccard similarities of 0.59-0.99. By contrast, ensembling improves performance over FML by a greater amount on almost every measure, and introduces no such constraint.
|
| 180 |
+
|
| 181 |
+
End-to-end noising. Cleaning validation data selects better models. Noise in validation splits reduces performance by encouraging the selection of models with lower true performance. Noise in test splits significantly reduces measureable (noisy test) performance, as expressed by the difference between measureable and true performance. In general, correcting label errors improves task performance: even when the reported task performance worsens, the reported performance is closer to the true performance of the model, measured using clean training and validation data.
|
| 182 |
+
|
| 183 |
+
# 8 Discussion
|
| 184 |
+
|
| 185 |
+
Rapid data "health check". Sorting evaluation data by each item's loss is an easy way to quickly highlight label errors. Using this simple technique with a foundation model appears to generally identify over half of all label errors through human re-evaluation of a single-digit percentage of all data (Table 3). We expect this technique to work across deep learning domains, due to its simplicity and the extensive use of training loss in LNL research (Song et al., 2022). Given estimates for typical rates of label errors and the gain observed in the end-to-end experiment, our technique may enable a $1 - 2\%$ increase in reportable test accuracy
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Eval.</td><td>Test Perf.</td><td>I-5</td><td>A-5</td><td>T-5</td><td>T-M</td></tr><tr><td rowspan="3">Noisy</td><td>Measurable</td><td>90.1</td><td>88.3</td><td>89.3</td><td>89.3</td></tr><tr><td>True</td><td>94.2</td><td>91.0</td><td>92.8</td><td>82.0</td></tr><tr><td>Rank</td><td>10</td><td>1</td><td>3</td><td>10</td></tr><tr><td rowspan="3">Corr.</td><td>Measurable</td><td>95.1</td><td>90.7</td><td>92.9</td><td>88.5</td></tr><tr><td>True</td><td>95.1</td><td>90.8</td><td>93.0</td><td>82.0</td></tr><tr><td>Rank</td><td>4</td><td>5</td><td>2</td><td>8</td></tr><tr><td>Clean</td><td>True</td><td>95.8</td><td>91.0</td><td>93.8</td><td>82.1</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 4: End-to-end effects of label noise on task performance, as evaluated on noisy, corrected, and clean validation and test data splits. True accuracy is measured on clean test sets, and measurable accuracy on noisy or corrected test sets. Rank is a relative measure of true accuracy; lower numerical ranks have higher accuracy. Corrections which improve or reduce performance metrics are highlighted in green or red, respectively. Metrics are evaluated on models trained on noisy data.
|
| 190 |
+
|
| 191 |
+
across many datasets, in addition to the gains from improving model selection.
|
| 192 |
+
|
| 193 |
+
Pre-training and robustness. We demonstrate that despite established findings on artificial noising (Hendrycks et al., 2018), pretraining confers limited robustness to realistic human noise. The majority of label errors are systematic in nature (Snow et al., 2008; Plank et al., 2014; Samuel et al., 2022), and crowdsourced labels form, to an extent, a different distribution from reality, as approximated by expert labels (Hendrycks et al., 2020). When trained on crowdsourced or other data containing systematic errors, FMs quickly drift towards this incorrect distribution.
|
| 194 |
+
|
| 195 |
+
Applying AI to data-centric AI. Data-centric AI aims to improve AI through labeling, curating, and augmenting the underlying data. We find that AI itself can be applied towards improving data quality, as part of a human-in-the-loop (HITL) iteration, which contributes an additional positive feedback loop between data quality and AI performance.
|
| 196 |
+
|
| 197 |
+
New challenges in LNL. Standard noisings methods are unrealistic and no longer challenging for state-of-the-art language models (Algan and Ulusoy, 2020); recent LNL analyses study conditions where up to $80\%$ of labels are noised (Song et al., 2022). Our findings reinforce the need to reassess LNL methods in the context of more realistic noise (Zhu et al., 2022).
|
| 198 |
+
|
| 199 |
+
Our human-originated noising method produces realistic label errors, and can be applied to any crowdsourced dataset which includes raw annotation data. As such datasets emerge across deep learning domains (Wei et al., 2022), we hope this method may inspire challenging and realistic new LNL performance benchmarks. Our method also enables detailed exploration of the properties of human noise, which may support work on open LNL problems such as improving feature-based noising techniques, and estimating dataset noise (Bäuerle et al., 2022; Northcutt et al., 2021b).
|
| 200 |
+
|
| 201 |
+
End-to-end noising. The study of model performance on noise in validation and test data is essential: noise in other splits can affect reported model performance as much as noise in training data. Clean and noisy performance on evaluation data provide useful insight into models' overall performance.
|
| 202 |
+
|
| 203 |
+
# 9 Conclusions and Future Work
|
| 204 |
+
|
| 205 |
+
Pre-trained models effectively identify label errors on real NLP datasets, definitively outperforming existing methods on the same benchmarks by an absolute $9 - 36\%$ in AUPR.
|
| 206 |
+
|
| 207 |
+
Human-originated noising techniques may present a solution to the clear limitations of current LNL noising schemes: they are highly realistic and yet controllable for experimental purposes. We invite further exploration of this family of label noising techniques. We believe human-originated noising enables future advancements across multiple areas of LNL, supporting new tasks and metrics in areas such as the cost of human reannotation, estimation of dataset error, and mitigation of bias.
|
| 208 |
+
|
| 209 |
+
Finally, we advocate for LNL to move towards an end-to-end approach of evaluating with label noise, which takes into account noise within validation and test splits, and more accurately models the conditions of data in practice.
|
| 210 |
+
|
| 211 |
+
# Limitations
|
| 212 |
+
|
| 213 |
+
Partial metrics. Determining the true recall of a label error detection method on a real datasets is generally infeasible due to its high cost; this requires a complete re-evaluation so as to identify every label error within the dataset. While some datasets exist in which this has been undertaken, such as Hovy et al.
|
| 214 |
+
|
| 215 |
+
(2014) for TweetNLP, for most datasets containing organic label errors, we can only assess precision directly.
|
| 216 |
+
|
| 217 |
+
To mitigate this, we can estimate recall by estimating total dataset error counts using sampling techniques. As a result of this limitation, we prefer AUPR over AUROC (Area Under the Receiving Operating Curve) as our overall assessment metric: estimates of AUPR are scaled by a fixed ratio, and therefore comparable between models on the same dataset, whereas AUROC is nonlinear with respect to the estimate.
|
| 218 |
+
|
| 219 |
+
Requires multiple annotations per label. Human-originated noising methods are only applicable to datasets which include at least two human annotations per label. While it is becoming increasingly common to release individual-level annotator data, this is not an ubiquitous practice.
|
| 220 |
+
|
| 221 |
+
Cleaning benchmark data. In our analysis of model performance gains derived from applying our methods to cleaning evaluation data, we find that cleaning validation splits enables the selection of models with better test performance. Such a method may be useful in a large number of applications.
|
| 222 |
+
|
| 223 |
+
However, we caution against using this method to clean data intended for use in comparing performance across model families and variants: the cleaning process may bias any such benchmarks toward the models most similar to the model used to clean the data. While our method improves the performance of a given model on a task, and correcting label errors always improves the validity of test data, these improvements is unlikely to improve the performance of all models by the same amount.
|
| 224 |
+
|
| 225 |
+
This limitation is shared with other existing model-based scoring methods such as BERTScore (Zhang* et al., 2020).
|
| 226 |
+
|
| 227 |
+
# Acknowledgements
|
| 228 |
+
|
| 229 |
+
We would like to thank Google.org for credits for use of the Google Cloud Platform. We are also grateful to our anonymous reviewers, members of the Stanford NLP Group, and Bryan H. Chong for their constructive feedback, as well as the many researchers who made data publicly available to enable our present work.
|
| 230 |
+
|
| 231 |
+
# References
|
| 232 |
+
|
| 233 |
+
Ziawasch Abedjan, Xu Chu, Dong Deng, Raul Castro Fernandez, Ihab F Ilyas, Mourad Ouzzani, Paolo Papotti, Michael Stonebraker, and Nan Tang. 2016. Detecting data errors: Where are we and what needs to be done? Proceedings of the VLDB Endowment, 9(12):993-1004.
|
| 234 |
+
Jon Agley, Yunyu Xiao, Rachael Nolan, and Lilian Golzarri-Arroyo. 2021. Quality control questions on Amazon's Mechanical Turk (MTurk): A randomized trial of impact on the USAUDIT, PHQ-9, and GAD-7. Behavior research methods, pages 1-13.
|
| 235 |
+
Görkem Algan and Ilkay Ulusoy. 2020. Label noise types and their effects on deep learning. arXiv:2003.10471.
|
| 236 |
+
Ehsan Amid, Manfred KK Warmuth, Rohan Anil, and Tomer Koren. 2019. Robust bi-tempered logistic loss based on Bregman divergences. Advances in Neural Information Processing Systems, 32.
|
| 237 |
+
Samaneh Azadi, Jiashi Feng, Stefanie Jegelka, and Trevor Darrell. 2015. Auxiliary image regularization for deep CNNs with noisy labels. arXiv preprint arXiv:1511.07069.
|
| 238 |
+
Noga Bar, Tomer Koren, and Raja Giryes. 2021. Multiplicative reweighting for robust neural network optimization. arXiv preprint arXiv:2102.12192.
|
| 239 |
+
Alex Bäuerle, Ángel Alexander Cabrera, Fred Hohman, Megan Maher, David Koski, Xavier Suau, Titus Barik, and Dominik Moritz. 2022. Symphony: Composing interactive interfaces for machine learning. In CHI Conference on Human Factors in Computing Systems, pages 1-14.
|
| 240 |
+
Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. 2021. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258.
|
| 241 |
+
Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 632-642, Lisbon, Portugal. Association for Computational Linguistics.
|
| 242 |
+
Jiefeng Chen, Frederick Liu, Besim Avci, Xi Wu, Yingyu Liang, and Somesh Jha. 2021a. Detecting errors and estimating accuracy on unlabeled data with self-training ensembles. Advances in Neural Information Processing Systems, 34.
|
| 243 |
+
Pengfei Chen, Junjie Ye, Guangyong Chen, Jingwei Zhao, and Pheng-Ann Heng. 2021b. Beyond
|
| 244 |
+
|
| 245 |
+
class-conditional assumption: A primary attempt to combat instance-dependent label noise. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 11442-11450.
|
| 246 |
+
Glenn Dawson and Robi Polikar. 2021. Rethinking noisy label models: Labeler-dependent noise with adversarial awareness. arXiv preprint arXiv:2105.14083.
|
| 247 |
+
DCAI Workshop. 2021. NeurIPS data-centric AI workshop. NeurIPS 2021 Data-Centric AI Workshop.
|
| 248 |
+
Sarah Jane Delany, Nicola Segata, and Brian Mac Namee. 2012. Profiling instances in noise reduction. Knowledge-Based Systems, 31:28-40.
|
| 249 |
+
Sean A Dennis, Brian M Goodson, and Christopher A Pearson. 2020. Online worker fraud and evolving threats to the integrity of MTurk data: A discussion of virtual private servers and the limitations of IP-based screening procedures. *Behavioral Research in Accounting*, 32(1):119-134.
|
| 250 |
+
Shrey Desai and Greg Durrett. 2020. Calibration of pre-trained transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 295-302, Online. Association for Computational Linguistics.
|
| 251 |
+
Benoit Frenay and Michel Verleysen. 2014. Classification in the presence of label noise: A survey. IEEE Transactions on Neural Networks and Learning Systems, 25(5):845-869.
|
| 252 |
+
Dragan Gamberger, Nada Lavrac, and Saso Dzeroski. 2000. Noise detection and elimination in data preprocessing: experiments in medical domains. Applied artificial intelligence, 14(2):205-223.
|
| 253 |
+
Kevin Gimpel, Nathan Schneider, Brendan O'Connor, Dipanjan Das, Daniel Mills, Jacob Eisenstein, Michael Heilman, Dani Yogatama, Jeffrey Flanigan, and Noah A Smith. 2010. Part-of-speech tagging for Twitter: Annotation, features, and experiments. Technical report, Carnegie-Mellon Univ Pittsburgh Pa School of Computer Science.
|
| 254 |
+
Suchin Gururangan, Ana Marasovic, Swabha Swayamdipta, Kyle Lo, Iz Beltagy, Doug Downey, and Noah A. Smith. 2020. Don't stop pretraining: Adapt language models to domains and tasks. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8342-8360, Online. Association for Computational Linguistics.
|
| 255 |
+
Pengcheng He, Jianfeng Gao, and Weizhu Chen. 2021. DeBERTaV3: Improving DeBERTa using Electra-style pre-training with gradient-disentangled embedding sharing. arXiv:2111.09543.
|
| 256 |
+
|
| 257 |
+
Dan Hendrycks and Kevin Gimpel. 2017. A baseline for detecting misclassified and out-of-distribution examples in neural networks. Proceedings of International Conference on Learning Representations.
|
| 258 |
+
Dan Hendrycks, Xiaoyuan Liu, Eric Wallace, Adam Dziedzic, Rishabh Krishnan, and Dawn Song. 2020. Pretrained transformers improve out-of-distribution robustness. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2744-2751, Online. Association for Computational Linguistics.
|
| 259 |
+
Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. 2018. Using trusted data to train deep networks on labels corrupted by severe noise. Advances in neural information processing systems, 31.
|
| 260 |
+
Jenny Hong, Derek Chong, and Christopher Manning. 2021. Learning from limited labels for long legal dialogue. In Proceedings of the Natural Legal Language Processing Workshop 2021, pages 190-204, Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 261 |
+
Dirk Hovy, Barbara Plank, and Anders Søgaard. 2014. Experiments with crowdsourced reannotation of a POS tagging data set. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 377-382, Baltimore, Maryland. Association for Computational Linguistics.
|
| 262 |
+
Jinchi Huang, Lie Qu, Rongfei Jia, and Binqiang Zhao. 2019. O2u-net: A simple noisy label detection approach for deep neural networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3326-3334.
|
| 263 |
+
Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. 2018. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels. In International Conference on Machine Learning, pages 2304-2313. PMLR.
|
| 264 |
+
Yiding Jiang, Vaishnavh Nagarajan, Christina Baek, and J Zico Kolter. 2022. Assessing generalization of SGD via disagreement. In International Conference on Machine Learning.
|
| 265 |
+
Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. 2017. Bag of tricks for efficient text classification. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 427-431. Association for Computational Linguistics.
|
| 266 |
+
Armand Joulin, Laurens van der Maaten, Allan Jabri, and Nicolas Vasilache. 2016. Learning visual features from large weakly supervised data. In European Conference on Computer Vision, pages 67-84. Springer.
|
| 267 |
+
|
| 268 |
+
Shyamgopal Karthik, Jérôme Revaud, and Boris Chidlovskii. 2021. Learning from long-tailed data with noisy labels. arXiv:2108.11096.
|
| 269 |
+
Ryan Kennedy, Scott Clifford, Tyler Burleigh, Philip D Waggoner, Ryan Jewell, and Nicholas JG Winter. 2020. The shape of and solutions to the MTurk quality crisis. Political Science Research and Methods, 8(4):614-629.
|
| 270 |
+
Taehyeon Kim, Jongwoo Ko, JinHwan Choi, SeYoung Yun, et al. 2021. FINE samples for learning with noisy labels. Advances in Neural Information Processing Systems, 34.
|
| 271 |
+
Julia Kreutzer, Isaac Caswell, Lisa Wang, Ahsan Wahab, Daan van Esch, Nasanbayar Ulzii-Orshikh, Allahsera Tapo, Nishant Subramani, Artem Sokolov, Claytone Sikasote, et al. 2022. Quality at a glance: An audit of web-crawled multilingual datasets. Transactions of the Association for Computational Linguistics, 10:50-72.
|
| 272 |
+
Abhishek Kumar and Ehsan Amid. 2021. Constrained instance and class reweighting for robust learning under label noise. arXiv.
|
| 273 |
+
Yang Liu and Hongyi Guo. 2020. Peer loss functions: Learning from noisy labels without knowing noise rates. In International Conference on Machine Learning, pages 6226-6236. PMLR.
|
| 274 |
+
Xingjun Ma, Hanxun Huang, Yisen Wang, Simone Romano, Sarah Erfani, and James Bailey. 2020. Normalized loss functions for deep learning with noisy labels. In International Conference on Machine Learning, pages 6543-6553. PMLR.
|
| 275 |
+
Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. 2011. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142-150, Portland, Oregon, USA. Association for Computational Linguistics.
|
| 276 |
+
Hassan H Malik and Vikas S Bhardwaj. 2011. Automatic training data cleaning for text classification. In 2011 IEEE 11th international conference on data mining workshops, pages 442-449. IEEE.
|
| 277 |
+
Julian McAuley, Christopher Targett, Qinfeng Shi, and Anton van den Hengel. 2015. Image-based recommendations on styles and substitutes. In SIGIR 2015, page 43-52, New York, NY, USA. Association for Computing Machinery.
|
| 278 |
+
Alexandra M Mellis and Warren K Bickel. 2020. Mechanical Turk data collection in addiction research: Utility, concerns and best practices. Addiction, 115(10):1960-1968.
|
| 279 |
+
|
| 280 |
+
Aaron Moss and Leib Litman. 2018. After the bot scare: Understanding what's been happening with data collection on MTurk and how to stop it. *CloudResearch*.
|
| 281 |
+
Nicolas M. Müller and Karla Markert. 2019. Identifying mislabeled instances in classification datasets. In 2019 International Joint Conference on Neural Networks (IJCNN), pages 1-8. IEEE.
|
| 282 |
+
Curtis Northcutt, Lu Jiang, and Isaac Chuang. 2021a. Confident learning: Estimating uncertainty in dataset labels. Journal of Artificial Intelligence Research, 70:1373-1411.
|
| 283 |
+
Curtis G Northcutt, Anish Athalye, and Jonas Mueller. 2021b. Pervasive label errors in test sets destabilize machine learning benchmarks. arXiv:2103.14749.
|
| 284 |
+
Olutobi Owoputi, Brendan O'Connor, Chris Dyer, Kevin Gimpel, Nathan Schneider, and Noah A. Smith. 2013. Improved part-of-speech tagging for online conversational text with word clusters. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 380-390, Atlanta, Georgia. Association for Computational Linguistics.
|
| 285 |
+
Fabio Petroni, Tim Rocttäschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander Miller. 2019. Language models as knowledge bases? In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2463-2473, Hong Kong, China. Association for Computational Linguistics.
|
| 286 |
+
Barbara Plank, Dirk Hovy, and Anders Søgaard. 2014. Linguistically debatable or just plain wrong? In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 507-511.
|
| 287 |
+
Thomas C Redman. 1998. The impact of poor data quality on the typical enterprise. Communications of the ACM, 41(2):79-82.
|
| 288 |
+
Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. 2014. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596.
|
| 289 |
+
Frederick Reiss, Hong Xu, Bryan Cutler, Karthik Muthuraman, and Zachary Eichenberger. 2020. Identifying incorrect labels in the CoNLL-2003 corpus. In Proceedings of the 24th conference on computational natural language learning, pages 215-226.
|
| 290 |
+
|
| 291 |
+
David Rolnick, Andreas Veit, Serge Belongie, and Nir Shavit. 2017. Deep learning is robust to massive label noise. arXiv:1705.10694.
|
| 292 |
+
Takaya Saito and Marc Rehmsmeier. 2015. The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets. *PloS one*, 10(3):e0118432.
|
| 293 |
+
Jim Samuel, Gavin Rozzi, and Ratnakar Palle. 2022. The dark side of sentiment analysis: An exploratory review using lexicons, dictionaries, and a statistical monkey and chimp. Dictionaries, and a Statistical Monkey and Chimp. (January 6, 2022).
|
| 294 |
+
Antonios Saravanos, Stavros Zervoudakis, Dongnanzi Zheng, Neil Stott, Bohdan Hawryluk, and Donatella Delfino. 2021. The hidden cost of using Amazon Mechanical Turk for research. In International Conference on Human-Computer Interaction, pages 147-164. Springer.
|
| 295 |
+
Borut Sluban, Dragan Gamberger, and Nada Lavrač. 2014. Ensemble-based noise detection: noise ranking and visual performance evaluation. Data mining and knowledge discovery, 28(2):265-303.
|
| 296 |
+
Rion Snow, Brendan O'Connor, Daniel Jurafsky, and Andrew Ng. 2008. Cheap and fast - but is it good? evaluating non-expert annotations for natural language tasks. In Proceedings of the 2008 Conference on Empirical Methods in Natural Language Processing, pages 254-263, Honolulu, Hawaii. Association for Computational Linguistics.
|
| 297 |
+
Hwanjun Song, Minseok Kim, Dongmin Park, Yooju Shin, and Jae-Gil Lee. 2022. Learning from noisy labels with deep neural networks: A survey. IEEE Transactions on Neural Networks and Learning Systems.
|
| 298 |
+
Jaree Thongkam, Guandong Xu, Yanchun Zhang, and Fuchun Huang. 2008. Support vector machine for outlier detection in breast cancer survivability prediction. In Asia-Pacific Web Conference, pages 99-109. Springer.
|
| 299 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. 2018. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 353-355, Brussels, Belgium. Association for Computational Linguistics.
|
| 300 |
+
Matthew Watson, Bashar Awwad Shiekh Hasan, and Noura Al Moubayed. 2022. Agree to disagree: When deep learning models with identical architectures produce distinct explanations. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 875-884.
|
| 301 |
+
|
| 302 |
+
Jiaheng Wei, Zhaowei Zhu, Hao Cheng, Tongliang Liu, Gang Niu, and Yang Liu. 2022. Learning with noisy labels revisited: A study using real-world human annotations. In International Conference on Learning Representations.
|
| 303 |
+
Virginia Wheway. 2000. Using boosting to detect noisy data. In Pacific Rim International Conference on Artificial Intelligence, pages 123-130. Springer.
|
| 304 |
+
Liang Xu, Jiacheng Liu, Xiang Pan, Xiaojing Lu, and Xiaofeng Hou. 2021. DataCLUE: A benchmark suite for data-centric NLP. arXiv:2111.08647.
|
| 305 |
+
Jing Zhang, Victor S Sheng, Qianmu Li, Jian Wu, and Xindong Wu. 2017. Consensus algorithms for biased labeling in crowdsourcing. Information Sciences, 382:254-273.
|
| 306 |
+
Tianyi Zhang*, Varsha Kishore*, Felix Wu*, Kilian Q. Weinberger, and Yoav Artzi. 2020. BERTScore: Evaluating text generation with BERT. In International Conference on Learning Representations.
|
| 307 |
+
Wenzheng Zhang and Karl Stratos. 2021. Understanding hard negatives in noise contrastive estimation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1090-1101, Online. Association for Computational Linguistics.
|
| 308 |
+
Wenxuan Zhou and Muhao Chen. 2021. Learning from noisy labels for entity-centric information extraction. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5381-5392, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 309 |
+
Dawei Zhu, Michael A Hedderich, Fangzhou Zhai, David Ifeoluwa Adelani, and Dietrich Klakow. 2022. Is BERT robust to label noise? A study on learning with noisy labels in text classification. arXiv:2204.09371.
|
| 310 |
+
|
| 311 |
+
# A Noising Benchmarks
|
| 312 |
+
|
| 313 |
+
This section specifies how noising protocols were applied to create each fixed crowdsourced dataset. Crowd labels for each dataset are available to download from the respective GitHub projects.
|
| 314 |
+
|
| 315 |
+
# A.1 TweetNLP-5
|
| 316 |
+
|
| 317 |
+
TweetNLP-5(%) is a fixed noisng of TweetNLP to a $5\%$ noise level in each split. Of the label errors, $80\%$ (i.e. $4\%$ of each split) are assigned using the dissenting worker method. The remaining $20\%$ (i.e. $1\%$ of each split) are assigned
|
| 318 |
+
|
| 319 |
+
using the dissenting label method. Fig. 4 shows that both methods provide similar distributions of label errors. Although the dissenting worker method more realistically captures individual worker idiosyncrasies, the dissenting label method is actually slightly lower loss during training (i.e. harder for a model to distinguish from correct labels).
|
| 320 |
+
|
| 321 |
+
# A.2 TweetNLP-M
|
| 322 |
+
|
| 323 |
+
TweetNLP-M(ajority) directly uses the majority class labels collected by Hovy et al. (2014) on the Crowdflower platform, which have a $79.54\%$ agreement with the high-quality expert gold labels collected by Gimpel et al. (2010). Per the Hovy et al. (2014) protocol, in the rare case of ties, the tie is broken in favor of the label that matches the gold label, if applicable. Otherwise, a label is selected at random. The "-M" suffix distinguishes the Hovy et al. (2014) labels from the gold labels.
|
| 324 |
+
|
| 325 |
+
# A.3 SNLI-5
|
| 326 |
+
|
| 327 |
+
The Stanford Natural Language Inference dataset (SNLI) annotations do not include a worker identifier, meaning each item is attached to five crowdsourced labels, but there is no indication of which labels came from the same annotator across the dataset. As a result, we cannot apply the dissenting worker noisng method.
|
| 328 |
+
|
| 329 |
+
SNLI-5 has exactly $5\%$ of its data noised in each split. Of the label errors, $80\%$ (i.e. $4\%$ of each split) are assigned using a method that represents systematic errors, to simulate of dissenting worker method: We use the minority label when there is a 3-2 split between the five labels. The remaining $20\%$ (i.e. $1\%$ of each split) are assigned using the dissenting label method, as in TweetNLP-5.
|
| 330 |
+
|
| 331 |
+
# B Loss Distributions
|
| 332 |
+
|
| 333 |
+
Section 4 examines dataset noisings primarily in terms of loss distributions on noised labels. To provide additional context, Fig. 8 provides an equivalent view for SNLI, and Fig. 9 shows combined distributions of both clean and noisy data points on TweetNLP.
|
| 334 |
+
|
| 335 |
+
Table 5 reports the Wasserstein distances (or earth mover's distances) measured between the loss distributions of noisy and clean data points for models trained on TweetNLP and IMDB, as
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure 8: Distributions of losses of label errors on SNLI at $5\%$ noising, which demonstrates similar performance characteristics to TweetNLP, as shown in Fig. 4.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 9: Combined distributions of losses of both noisy and clean data points, for TweetNLP with $5\%$ noising.
|
| 342 |
+
|
| 343 |
+
described in Section 7. Human-originated label noise more closely resembles both clean data points and real label noise as its hypothesized realism increases.
|
| 344 |
+
|
| 345 |
+
# C Mechanical Turk Protocol
|
| 346 |
+
|
| 347 |
+
# C.1 Change Specifications
|
| 348 |
+
|
| 349 |
+
We use Amazon Mechanical Turk to validate real label errors from IMDB (Maas et al., 2011) and Amazon Reviews (McAuley et al., 2015). We begin with the Northcutt et al. (2021a) protocol, and add four additional conditions, so as to mitigate annotator fraud.
|
| 350 |
+
|
| 351 |
+
First, we pre-qualify workers by requiring them to correctly answer a qualification test of four unambiguous questions (Hovy et al., 2014; Agley et al., 2021).
|
| 352 |
+
|
| 353 |
+
Second, after the initial qualification, we con
|
| 354 |
+
|
| 355 |
+
<table><tr><td>Noising Method</td><td>TweetNLP</td><td>IMDB</td></tr><tr><td>Uniform Noise</td><td>5.62</td><td>5.04</td></tr><tr><td>Class-Based Noise</td><td>5.23</td><td>4.91</td></tr><tr><td>Dissenting Label</td><td>4.02</td><td>-</td></tr><tr><td>Dissenting Worker</td><td>3.44</td><td>-</td></tr><tr><td>Crowd Majority</td><td>2.33</td><td>-</td></tr><tr><td>Real Label Errors</td><td>-</td><td>2.67</td></tr></table>
|
| 356 |
+
|
| 357 |
+
Table 5: Wasserstein distances between loss distributions of noisy and clean data points: Human-originated noising exhibits comparable levels of erroneous learning to organic label errors.
|
| 358 |
+
|
| 359 |
+
<table><tr><td></td><td>IMDB</td><td>Amazon</td></tr><tr><td>Original Protocol</td><td>0.1314</td><td>0.0141</td></tr><tr><td>New Protocol</td><td>0.4643</td><td>0.5561</td></tr></table>
|
| 360 |
+
|
| 361 |
+
Table 6: A comparison of inter-annotator agreement between the original and new MTurk protocol results using Fleiss' $\kappa$ . A score of 1.0 represents perfect agreement between workers, and 0.0 represents guessing at random. Annotations from the original protocol are substantially closer to random chance.
|
| 362 |
+
|
| 363 |
+
tinue to monitor worker quality by introducing sentinel questions with known answers into the workers' regular tasks. We periodically remove workers who fail the tasks.
|
| 364 |
+
|
| 365 |
+
Third, we set filter criteria to limit workers to the following Anglosphere countries: United States, Canada, United Kingdom, Ireland, Australia, and New Zealand (Moss and Litman, 2018), to improve the chances of finding annotators with sufficient cultural context to correctly interpret review text. Our filter criteria include the standard recommendations of requiring a $\geq 99\%$ positive task approval rate with $\geq 500$ tasks approved.
|
| 366 |
+
|
| 367 |
+
Finally, we set a baseline target rate of US$10 per hour, calculated using word counts and average reading speed (primarily for ethical reasons; the effect of compensation and annotation quality is an area of active research; Saravanos et al., 2021).
|
| 368 |
+
|
| 369 |
+
The new protocol's labels are produced using a final set of approximately 70 workers. Workers averaged at least 12 seconds on each task;
|
| 370 |
+
|
| 371 |
+
half the time needed to read prompts at an average reading speed. The average time spent by a worker in the Northcutt et al. (2021a) protocol was 5 seconds. $^6$
|
| 372 |
+
|
| 373 |
+
# C.2 Protocol Validation
|
| 374 |
+
|
| 375 |
+
We hypothesize that the Non-Agreements in the original protocol represent not only ambiguous data points, but also noise in the original protocol resulting from low quality work. Tables 2 and 6 show that the new protocol improves the level of agreement between workers. As such, we confirm that the increased agreement between workers in the new protocol results from higher quality labels.
|
| 376 |
+
|
| 377 |
+
Following the Northcutt et al. (2021a) protocol for expert review, we additionally select a total of 50 items from each of IMDB and Amazon for expert review. The experts are blinded to both the original labels and MTurk results and asked to label each item from scratch. They then reconciled results and came to a consensus for each item. The results are compared at the aggregate level of "Correctable," "Non-Agreement," and "Non-Error," as opposed to the individual sentiment level (Positive, Negative, Neutral, or Off-Topic). The expert agreement with one another was $79\%$ , so in $21\%$ of the items, the expert label was considered to be Non-Agreement and matched the MTurk workers only if the workers also produced Non-Agreement. Table 7 provides the result of this assessment.
|
| 378 |
+
|
| 379 |
+
For the original protocol, $52\%$ of the items agreed with expert annotators, $31\%$ of the items were incorrectly labeled as Non-Agreement, $12\%$ of the items were incorrectly labeled as Correctables, and $5\%$ of the items were incorrectly labeled as Non-Errors. $8\%$ of items were disagreements between experts and crowd workers where neither side had a Non-Agreement. In other words, $8\%$ of all items were disagreements between Correctable and Non-Error.
|
| 380 |
+
|
| 381 |
+
For the new protocol, $72\%$ of the items agreed with expert annotators, $4\%$ of the items were incorrectly labeled as Non-Agreement, $7\%$ of the items were incorrectly labeled as Correctable, and $17\%$ were incorrectly labeled as
|
| 382 |
+
|
| 383 |
+
<table><tr><td></td><td>IMDB</td><td>Amazon</td><td>Total</td></tr><tr><td>Original Correct</td><td>33</td><td>19</td><td>52</td></tr><tr><td>New Correct</td><td>41</td><td>31</td><td>72</td></tr><tr><td>Both Correct</td><td>28</td><td>14</td><td>42</td></tr></table>
|
| 384 |
+
|
| 385 |
+
Table 7: A comparison of original and new MTurk protocol results against 100 expert-labeled data points.
|
| 386 |
+
|
| 387 |
+
Non-Errors. $5\%$ of items were disagreements between experts and crowd workers where neither side had a Non-Agreement.
|
| 388 |
+
|
| 389 |
+
# D Overall LLM Performance Experiments
|
| 390 |
+
|
| 391 |
+
Due to the high costs associated with expert and crowdsourced validation, we use TweetNLP-5 as a development dataset for model selection.
|
| 392 |
+
|
| 393 |
+
We selected the following models for exploration: XLNet (base, large), RoBERTa (base, large), BERT (small, base, large), DeBERTa (V3: xsmall, small, base, large, and V2: xlarge, xxlarge), GPT (assorted). We performed 25 hyperparameter sweeps with each model, selecting the top three runs for further analysis. In order to avoid model family-level bias in the choice of hyperparameters, we set a broad shared range for three hyperparameters: learning rate varying from $10^{-6}$ to $10^{-3}$ , the number of epochs from 2 to 8, and the batch size between 8, 16, 64, and 128. Training time and the final hyperparameters varied based on the model.
|
| 394 |
+
|
| 395 |
+
We ultimately selected DeBERTA-v3-base as a compromise between performance and training speed. We used Google Cloud Platform for training infrastructure. Experiments were run using NVIDIA A100 GPUs, and runtime per training run was approximately 20 minutes for IMDB, Recon, and SNLI, 3 minutes for TweetNLP, and 4 hours for Amazon, when configured with a 2.5 million data point training split.
|
| 396 |
+
|
| 397 |
+
# E Main Experiment
|
| 398 |
+
|
| 399 |
+
# E.1 Metrics
|
| 400 |
+
|
| 401 |
+
We calculate the Area Under the Precision-Recall Curve (AUPR) using the trapezoidal rule, given individual measurements of precision and recall at every possible threshold.
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 10: Label noise detection performance by model size and family, evaluated on TweetNLP-5. GPT-based models exhibit similar scaling trends, despite intrinsic disadvantages on classification tasks (due to pure autoregressive pre-training).
|
| 405 |
+
|
| 406 |
+
We report the Truncated AUPR on IMDB and Amazon. Because IMDB and Amazon are too expensive to fully crowd verify, we cannot calculate precision and recall at the 25,000th item for each method, for each dataset, as it would require every data point to be relabeled on MTurk. Instead, we use the CL framework of predicting a fixed number of items. For example, for IMDB, CL hypothesizes 1,310 out of the 25,000 items to be label errors. We can calculate the precision and recall for every threshold, up to the number hypothesized by Confident Learning. We can calculate the precision and recall of the 1st, 2nd, 3rd, ..., and 1,310th items.
|
| 407 |
+
|
| 408 |
+
We know the exact recall for all synthetic datasets. For IMDB and Amazon, we use the estimate that $5\%$ of the data is erroneous, which is consistent with common understanding of the prevalence of label errors (Redman, 1998; Müller and Markert, 2019; Northcutt et al., 2021b; Kreutzer et al., 2022).
|
| 409 |
+
|
| 410 |
+
All results reported on synthetic datasets reflect the average of individual scores from the three top-performing models from 25 hyperparameter sweeps. However, for cost-efficiency, results which require crowdsourced evaluation (such as IMDB and Amazon) are based on one run selected at random from a top three.
|
| 411 |
+
|
| 412 |
+
# E.2 Confident Learning
|
| 413 |
+
|
| 414 |
+
Northcutt et al. (2021b) reports results using raw counts, not the accuracy, precision, recall,
|
| 415 |
+
|
| 416 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">Num. Errors Hypothesized</td><td colspan="3">Correctable</td><td colspan="3">Non-Agreement</td><td colspan="3">Non-Error</td></tr><tr><td>CL</td><td>FML</td><td>FME</td><td>CL</td><td>FML</td><td>FME</td><td>CL</td><td>FML</td><td>FME</td></tr><tr><td>IMDB</td><td>1310</td><td>183</td><td>323</td><td>328</td><td>358</td><td>573</td><td>581</td><td>769</td><td>414</td><td>401</td></tr><tr><td>Amazon</td><td>1000</td><td>357</td><td>508</td><td>517</td><td>148</td><td>131</td><td>143</td><td>495</td><td>361</td><td>340</td></tr><tr><td>TweetNLP-M</td><td>250</td><td>121</td><td>158</td><td>165</td><td>-</td><td>-</td><td>-</td><td>129</td><td>92</td><td>85</td></tr></table>
|
| 417 |
+
|
| 418 |
+
Table 8: The number of each type of error accurately identified for each dataset by each noise detection method, keeping the number of errors hypothesized fixed for ease of comparison. (TweetNLP is expert reviewed and by construction does not have any Non-Agreement types.)
|
| 419 |
+
|
| 420 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">Num. Errors Hypothesized</td><td colspan="2">Correctable</td><td colspan="2">Non-Agreement</td><td colspan="2">Non-Error</td><td rowspan="2">Jaccard Similarity</td></tr><tr><td>FME</td><td>FME+CL</td><td>FME</td><td>FME+CL</td><td>FME</td><td>FME+CL</td></tr><tr><td>IMDB</td><td>316</td><td>168</td><td>168</td><td>108</td><td>108</td><td>40</td><td>40</td><td>0.99</td></tr><tr><td>Amazon</td><td>381</td><td>226</td><td>204</td><td>65</td><td>56</td><td>90</td><td>121</td><td>0.60</td></tr><tr><td>TweetNLP-M</td><td>129</td><td>93</td><td>98</td><td>-</td><td>-</td><td>36</td><td>31</td><td>0.59</td></tr></table>
|
| 421 |
+
|
| 422 |
+
Table 9: Examining the performance of overlaying Confident Learning on FME, comparing the number of errors hypothesized by $\mathrm{FME + CL}$ . We also report the Jaccard similarity between the two models.
|
| 423 |
+
|
| 424 |
+
or any other metric. For ease of comparability, Table 8 reports the number of correctable, non-agreement, and non-error items identified by each method on each dataset. CL hypothesizes a fixed number of items, which is reported in the last column, and we assess a matching number of items from each method.
|
| 425 |
+
|
| 426 |
+
When hypothesizing a fixed number of items, the foundation model approaches far outperform CL baselines. On IMDB, FME correctly identifies 909 label errors, a $28\%$ absolute improvement in accuracy. On Amazon, the FME approach correctly identifies 660 label errors, compared to the 505 identified by CL, a $15.5\%$ absolute improvement.
|
| 427 |
+
|
| 428 |
+
Applying CL to FME results in a different model that hypothesizes a different number of items (fewer, in all cases). Table 9 shows the raw counts of correctable, non-agreement, and non-error items when each of our models hypothesizes items at this reduced threshold.
|
| 429 |
+
|
| 430 |
+
Overlaying CL on foundation model loss appears to have little marginal utility. Table 9 also shows a high Jaccard similarity across all datasets, suggesting that applying CL on top of an FM changes little about the items hypothesized. On many datasets, FME and $\mathrm{FME + CL}$ perform almost identically in the number of items correctly hypothesized, slightly harming performance on Amazon Reviews, and slightly improving it on TweetNLP-5 (Table 10). FME+CL decreases the total number of hypothesized items compared to FME
|
| 431 |
+
|
| 432 |
+
because of the threshold set by CL. We compare the FME and $\mathrm{FME + CL}$ approaches at the reduced number of hypothesized items in order to assess the impact of CL in the presence of pre-training.
|
| 433 |
+
|
| 434 |
+
Not only is aggregate performance nearly identical, we see in Figs. 1 and 6 that FME and $\mathrm{FME + CL}$ perform similarly for the entire range of items hypothesized along the Precision-Recall curve. The primary difference is that FME can continue hypothesizing items even past $\mathrm{FME + CL}$ 's threshold.
|
| 435 |
+
|
| 436 |
+
# E.3 Ensembling
|
| 437 |
+
|
| 438 |
+
Results from Tables 3 and 10 show that assembling (FME) improves error detection performance over using a single model (FML) in almost every scenario tested, at a rate several times higher than gains to underlying task performance.
|
| 439 |
+
|
| 440 |
+
We also observe a phenomenon of disproportionately high variance in model error detection performance: Table 10 quantifies the standard deviation of the former at three times the standard deviation of performance on the underlying task, and Fig. 2 shows this to be the case even when comparing models with a fixed loss. This finding persisted even when holding all hyperparameters and data constant, with only the random seed being changed.
|
| 441 |
+
|
| 442 |
+
We hypothesize that label noise in training data induces models to learn spurious correlations, which cause models to make errors in a
|
| 443 |
+
|
| 444 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Task Accuracy</td><td colspan="3">FM Error Detection Performance</td><td colspan="3">Effects of CL Overlay</td></tr><tr><td>Noisy</td><td>Clean</td><td>Precision</td><td>Recall</td><td>F1</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>Averaged</td><td>0.88 ± 0.03</td><td>0.91 ± 0.03</td><td>0.50 ± 0.11</td><td>0.65 ± 0.03</td><td>0.56 ± 0.08</td><td>0.51 ± 0.11</td><td>0.67 ± 0.03</td><td>0.57 ± 0.07</td></tr><tr><td>Ensembled</td><td>0.89 ± 0.02</td><td>0.92 ± 0.03</td><td>0.56 ± 0.12</td><td>0.62 ± 0.03</td><td>0.58 ± 0.08</td><td>0.58 ± 0.11</td><td>0.65 ± 0.03</td><td>0.61 ± 0.07</td></tr><tr><td>Difference</td><td>+1.14%</td><td>+1.24%</td><td>+12.52%</td><td>-4.31%</td><td>+4.66%</td><td>+13.89%</td><td>-2.98%</td><td>+6.03%</td></tr></table>
|
| 445 |
+
|
| 446 |
+
Table 10: Ensembling confers gains in error detection performance disproportionate to gains in underlying task performance, across a broad range of models and hyperparameters (on TweetNLP-5, results from top three models per sweep, as measured at the fixed threshold set by CL).
|
| 447 |
+
|
| 448 |
+
structured manner (Watson et al., 2022; Jiang et al., 2022); this results in greater levels of model disagreement, with minimal impact on top-line performance. Ensembling may be disproportionately effective because it serves an added function of reducing variance caused by these low-quality features.
|
| 449 |
+
|
| 450 |
+
# E.4 TAPT
|
| 451 |
+
|
| 452 |
+
We perform Task-Assisted Pretraining (TAPT; Gururangan et al., 2020) using the original hyperparameters everywhere except for the optimizer, in which we use AdamW instead of Adam for DeBERTa. We run TAPT on the all splits of the corresponding data for all datasets except Amazon Reviews, where because of its size, we use TAPT on only 50,000 data points, or $0.5\%$ of the full dataset. After running TAPT, we then run 25 fine-tune sweeps.
|
detectinglabelerrorsbyusingpretrainedlanguagemodels/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f8006f72ff694ca190640c4d9e5b5e0c0dfeaf743a52e90a6b17583cacb7dbc
|
| 3 |
+
size 725740
|
detectinglabelerrorsbyusingpretrainedlanguagemodels/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef563e06a0ef920ac4b509521481664ad933fc61faa27b40ff30155b4da766ba
|
| 3 |
+
size 505330
|
dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/8f34bcb5-3355-4574-97b3-f2b25a8107cd_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98af5a774b9737ff911ae145aa72b18431b396a9d01b0d01d8755a9528de7311
|
| 3 |
+
size 82443
|
dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/8f34bcb5-3355-4574-97b3-f2b25a8107cd_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:853cea04b4e2a754066f4540da3325e93dd807c75274e0d4d155477ec879e281
|
| 3 |
+
size 101317
|
dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/8f34bcb5-3355-4574-97b3-f2b25a8107cd_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3aca1eb64c2d38eddf2882d317b452f79bad8b84358f1f038044c4426604609f
|
| 3 |
+
size 555658
|
dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/full.md
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dial2vec: Self-Guided Contrastive Learning of Unsupervised Dialogue Embeddings
|
| 2 |
+
|
| 3 |
+
Che Liu, Rui Wang, Junfeng Jiang, Yongbin Li*, Fei Huang
|
| 4 |
+
DAMO Academy, Alibaba Group
|
| 5 |
+
|
| 6 |
+
{liuche.lc,wr224079,jiangunjfeng.jjf,shuide.lyb,f.huang}@alibaba-inc.com
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
In this paper, we introduce the task of learning unsupervised dialogue embeddings. Trivial approaches such as combining pre-trained word or sentence embeddings and encoding through pre-trained language models (PLMs) have been shown to be feasible for this task. However, these approaches typically ignore the conversational interactions between interlocutors, resulting in poor performance. To address this issue, we proposed a self-guided contrastive learning approach named dial2vec. Dial2vec considers a dialogue as an information exchange process. It captures the conversational interaction patterns between interlocutors and leverages them to guide the learning of the embeddings corresponding to each interlocutor. The dialogue embedding is obtained by an aggregation of the embeddings from all interlocutors. To verify our approach, we establish a comprehensive benchmark consisting of six widely-used dialogue datasets. We consider three evaluation tasks: domain categorization, semantic relatedness, and dialogue retrieval. Dial2vec achieves on average 8.7, 9.0, and 13.8 points absolute improvements in terms of purity, Spearman's correlation, and mean average precision (MAP) over the strongest baseline on the three tasks respectively. Further analysis shows that dial2vec obtains informative and discriminative embeddings for both interlocutors under the guidance of the conversational interactions and achieves the best performance when aggregating them through the interlocutor-level pooling strategy. All codes and data are publicly available at https://github.com/AlibabaResearch/DAMOConvAI/tree/main/dial2vec.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Dialogue embedding, as a critical prerequisite of semantically understanding a dialogue, has been
|
| 15 |
+
|
| 16 |
+
a central issue in dialogue-related research such as dialogue clustering (Shi et al., 2018; Lv et al., 2021), conversational sentiment analysis (Wang et al., 2020; Lv et al., 2021), context-dependent text-to-SQL (Hui et al., 2021; Wang et al., 2022), and dialogue summarization (Liu et al., 2019b; Liu and Chen, 2021). Trivial unsupervised approaches generally encode dialogues by combining their pretrained word or sentence embeddings (Pennington et al., 2014; Reimers and Gurevych, 2019) or using PLMs (Wu et al., 2020a; Bao et al., 2020; He et al., 2022a,b,c). However, such methods are not specifically designed for dialogues and thus fail to adequately capture the key conversational information. In this paper, we formally introduce the task of learning unsupervised dialogue embeddings, which aims to learn dialogue embeddings that can well reflect conversational semantics without any additional manual annotations.
|
| 17 |
+
|
| 18 |
+
Previous studies have extensively demonstrated the importance of encoding token-level interactions for learning semantic textual embeddings. However, for dialogue embedding, encoding interlocutor-level interactions is also essential but is overlooked in trivial approaches. Figure 1 shows
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
Figure 1: A dialogue from the SGD dataset.
|
| 22 |
+
|
| 23 |
+
an example. We highlight the significant interaction patterns between the interlocutors with red
|
| 24 |
+
|
| 25 |
+
color. As we can see, although these patterns only appear in three utterances, they highly represent the key conversational semantics (e.g., topics) and are more important than the other parts (e.g., greetings and chit-chats). We hold that capturing and leveraging them is one of the keys to learning high-quality unsupervised dialogue embeddings.
|
| 26 |
+
|
| 27 |
+
In this work, we propose dial2vec, a self-guided contrastive learning approach to solve the proposed task. Dial2vec considers a dialogue as an information exchange process between the two interlocutors and learns embeddings for both interlocutors with the help of each other. Specifically, dial2vec firstly encodes a dialogue through a PLM and assigns each interlocutor a self-representation by masking the non-corresponding positions in the encoding outputs. Then it calculates a matching matrix via the token-level dot-product operation between the two self-representations, obtaining a cross-representation for each interlocutor. Finally, the two cross-representations are leveraged as guidance to help the two self-representations gradually learn the interlocutor-level interaction-aware information and eliminate the interaction-free information during the training procedure.
|
| 28 |
+
|
| 29 |
+
To verify our model, we build a comprehensive benchmark comprising a total of 98,879 dialogues by introducing six widely-used dialogue datasets, including BiTOD (Lin et al., 2021), Doc2dial (Feng et al., 2020), MetalWOZ (Lee et al., 2019), MultiWOZ (Eric et al., 2019), Self-dialogue (Fainberg et al., 2018), and SGD (Rastogi et al., 2020). Each dataset consists of thousands of dialogues, where each dialogue is provided with a domain label (e.g., hotel booking and movie). We leverage these labels and design three evaluation tasks: domain categorization, semantic relatedness, and dialogue retrieval. We categorize them into intrinsic and extrinsic tasks according to their different focus.
|
| 30 |
+
|
| 31 |
+
Experimental results on this benchmark show that dial2vec outperforms the baselines by a substantial margin. Compared with the strongest baseline, dial2vec achieves on average 8.7, 9.0, and 13.8 points absolute improvements in terms of purity, Spearman's correlation, and mean average precision (MAP) on the three tasks respectively. We also conduct experiments with the single interlocutor's embeddings, their aggregation strategies, and the overall dialogue embedding distributions to study how dial2vec achieves such advanced performance. The results demonstrate that dial2vec
|
| 32 |
+
|
| 33 |
+
learns both informative and discriminative embeddings for the two interlocutors and achieves the best performance when combining them through the proposed interlocutor-level pooling aggregation strategy.
|
| 34 |
+
|
| 35 |
+
# 2 Related Work
|
| 36 |
+
|
| 37 |
+
# 2.1 Text Embedding
|
| 38 |
+
|
| 39 |
+
Text embedding aims to encode a piece of text into a distributed vector that could represent its semantics. Early works (Bengio et al., 2003; Mikolov et al., 2013; Pennington et al., 2014) learn unsupervised word embeddings by making use of word-level co-occurrence information in the skip-gram or CBOW tasks. Recently, Devlin et al. (2018); Liu et al. (2019a); Yang et al. (2019); Raffel et al. (2020) pre-train deep transformer (Vaswani et al., 2017) with a series of pretext tasks, setting a new state-of-the-art across the GLUE benchmark (Wang et al., 2018) as well as exhibiting a strong potential in producing general text embeddings. Along this line, Gao et al. (2021); Yan et al. (2021); Liu et al. (2021); Chuang et al. (2022); Nishikawa et al. (2022); Zhou et al. (2022); Klein and Nabi (2022) fine-tune the PLMs with contrastive learning objectives, achieving remarkable improvements in learning unsupervised sentence embeddings. Luo et al. (2021) introduce a data augmentation-based contrastive learning approach in learning document embeddings, achieving superior performance over word2vec-based approaches (Le and Mikolov, 2014; Chen, 2017).
|
| 40 |
+
|
| 41 |
+
For dialogue embedding, the above approaches are generally unsatisfactory, as they typically obtain dialogue embeddings by averaging the pretrained word or sentence embeddings, ignoring the interlocutor-level conversational interactions. Although conversational-PLMs pre-trained with dialogue data can solve this problem to some extent (Wu et al., 2020a; Bao et al., 2020; Roller et al., 2021), they mainly focus on learning end-to-end models which are not sufficient for our task. As a comparison, we study how to produce high-quality dialogue embeddings by fully exploiting the conversational information.
|
| 42 |
+
|
| 43 |
+
# 2.2 Contrastive Learning
|
| 44 |
+
|
| 45 |
+
Contrastive learning is an emerging self-supervised learning method which can improve the representation capability of PLMs in both pre-training and fine-tuning stages. Wu et al. (2020b); Meng et al.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 2: Architecture of dial2vec. Firstly, it encodes a dialogue through a PLM and assigns each interlocutor a self-representation through a masking layer (highlighted with yellow). Hollow circles in each self-representation represent zero embeddings. Then two matching matrices are calculated through the dot-product multiplication, based on which two cross-representations are generated. Each cross-representation and its corresponding self-representation are complementary in the token sequence dimension. Finally, the cosine distance between them will be minimized or maximized according to whether the training sample is positive or negative.
|
| 49 |
+
|
| 50 |
+
(2021); Giorgi et al. (2020) introduce the token-level and sentence-level contrastive learning tasks by correcting corrupted texts to encourage PLMs to learn noise-invariant representations. Zhang et al. (2022) propose phrase-guided and tree-guided contrastive learning objectives to inject syntactic knowledge into PLMs. Kim et al. (2021) propose a self-guided learning objective through which a PLM fine-tunes itself under the guidance of its different layers. Inspired by these works, we propose to leverage the interlocutor-level conversational interactions to guide the learning of dialogue embeddings in an unsupervised learning manner.
|
| 51 |
+
|
| 52 |
+
# 3 Proposed Approach
|
| 53 |
+
|
| 54 |
+
In this section, we take a two-party dialogue as an example to describe how dial2vec works. It is worth mentioning that dial2vec can be extended to the multi-party version through the OVR (one vs. the rest) scheme with no modification of the architecture.
|
| 55 |
+
|
| 56 |
+
# 3.1 Training Samples Generation
|
| 57 |
+
|
| 58 |
+
We first describe how we construct the positive and the negative training samples, which plays a key role in the self-guided contrastive learning approach. Suppose that we have a dialogue dataset $\mathcal{D} = \{S_k\}_{k=1}^K$ , where $S_k = \{u_1^{p_1}, u_2^{p_2}, u_3^{p_3}, u_4^{p_4}, \ldots, u_{t-1}^{p_1}, u_t^{p_2}\}$ is the $k$ -th dialogue session with $t$ utterances. $p_1$ and $p_2$ represent two interlocutors. We treat each utterance in a dialogue as a turn, regardless of which interlocutor it corresponds to. For the convenience of narration, $k$ in $S_k$ is omitted in the following sections.
|
| 59 |
+
|
| 60 |
+
We treat $S$ (i.e., the original dialogue) as a positive sample. To construct a negative sample $S'$ , we first randomly select an interlocutor in $S$ , say $p_1$ , and keep all the turns of it. Then we fill the other turns of $S$ with the utterances of $p_2$ randomly sampled from all dialogue sessions. For each positive sample, we repeat this operation multiple times to generate the desired number of negative samples.
|
| 61 |
+
|
| 62 |
+
# 3.2 Model Architecture
|
| 63 |
+
|
| 64 |
+
Figure 2 shows the architecture of dial2vec, which consists of two parts: encoding and contrastive learning. After training, dial2vec aggregates the embeddings from both interlocutors to obtain the final dialogue embedding, which is further used for downstream tasks.
|
| 65 |
+
|
| 66 |
+
# 3.2.1 Encoding
|
| 67 |
+
|
| 68 |
+
Following Bao et al. (2020), we use four types of embeddings as input to dial2vec: token embedding, relative positional embedding, turn embedding, and role embedding. To encode the dialogue, we first concatenate all the utterances and then tokenize them through WordPiece (Wu et al., 2016) to obtain a long token sequence. The tokens along with their corresponding position, turn, and role indices are respectively mapped into four embedding spaces and summed to form the final input embedding.
|
| 69 |
+
|
| 70 |
+
# 3.2.2 Contrastive Learning
|
| 71 |
+
|
| 72 |
+
Suppose that the output embeddings from the encoder are $\{\mathbf{h}_1,\mathbf{h}_2,\mathbf{h}_3,\dots ,\mathbf{h}_n\}$ , where $\mathbf{h}_i\in \mathbb{R}^d$ is the output embedding corresponding to the $i$ -th input token and $n$ is the length of the input sequence,
|
| 73 |
+
|
| 74 |
+
we stack the output embeddings as a matrix denoted as $\mathbf{E} \in \mathbb{R}^{n \times d}$ .
|
| 75 |
+
|
| 76 |
+
To obtain the self-representations, we first generate two binary mask vectors $\mathbf{m}^{p_1}$ and $\mathbf{m}^{p_2}$ for two interlocutors respectively. Let $m_i^{p_1}$ be the $i$ -th element in $\mathbf{m}^{p_1}$ , then $m_i^{p_1}$ is set to 1 only when $\mathbf{h}_i$ is derived from the input token of $p_1$ , otherwise it is 0. Similar operation is applied to generate $\mathbf{m}^{p_2}$ . Then, the self-representations are obtained by:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array}{l} \hat {\mathbf {E}} ^ {p _ {1}} = \mathbf {E} \odot (\mathbf {m} ^ {p _ {1}}) ^ {T}, \\ \hat {\mathbf {E}} ^ {p _ {2}} = \dots \end{array} \tag {1}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\hat {\mathbf {E}} ^ {p _ {2}} = \mathbf {E} \odot (\mathbf {m} ^ {p _ {2}}) ^ {T},
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\odot$ denote the broadcast element-wise multiplication.
|
| 87 |
+
|
| 88 |
+
To extract the interaction information, we perform the token-level dot-product multiplication between $\hat{\mathbf{E}}^{p_1}$ and $\hat{\mathbf{E}}^{p_2}$ and compute a correlation score matrix for each interlocutor, which is formulated by:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbf {C} ^ {p _ {1}} = \hat {\mathbf {E}} ^ {p _ {2}} \left(\hat {\mathbf {E}} ^ {p _ {1}}\right) ^ {T}, \tag {2}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathbf {C} ^ {p _ {2}} = \hat {\mathbf {E}} ^ {p _ {1}} \left(\hat {\mathbf {E}} ^ {p _ {2}}\right) ^ {T},
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $\mathbf{C}^{p_1}$ and $\mathbf{C}^{p_2}$ are both $n\times n$ square matrices and they are transposed to each other. Then we generate the cross-representations by:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\tilde {\mathbf {E}} ^ {p _ {1}} = \mathbf {C} ^ {p _ {1}} \hat {\mathbf {E}} ^ {p _ {1}}, \tag {3}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathbf {\tilde {E}} ^ {p _ {2}} = \mathbf {C} ^ {p _ {2}} \mathbf {\hat {E}} ^ {p _ {2}}.
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Note that $\tilde{\mathbf{E}}$ can be regarded as a refined representation of $\hat{\mathbf{E}}$ , which highlights the conversational interaction information in the trivial encoding results. The fact that $\tilde{\mathbf{E}}$ and $\hat{\mathbf{E}}$ share the same semantic space allows us to directly optimize their cosine distance without any additional transformations. In this circumstance, $\tilde{\mathbf{E}}$ acts as guidance for leading $\hat{\mathbf{E}}$ to be an interaction-aware self-representation, and this is why we call dial2vec works in a self-guided manner.
|
| 109 |
+
|
| 110 |
+
We further introduce $w$ as a restriction hyperparameter to mask the long-range semantic correlations among the utterances of $p_1$ and $p_2$ . Specifically, let $\mathbf{C}[i,j]$ denotes the element in the $i$ -th row and the $j$ -th column of $\mathbf{C}$ in Eq. (2). $T(i)$ represents a function which returns the turn index for the $i$ -th output embedding in $\mathbf{E}$ . Then $\forall i,j \in 1,2,\ldots,n$ , $\mathbf{C}[i,j]$ is masked with zero where $abs(T(i) - T(j)) > w$ , otherwise remains unchanged. Here we omit the superscript $p_1$ and $p_2$ in $\mathbf{C}$ since they are processed in the same way.
|
| 111 |
+
|
| 112 |
+
# 3.2.3 Aggregation
|
| 113 |
+
|
| 114 |
+
To obtain the dialogue embedding $\mathbf{e}$ , we compare two aggregation strategies. In the first strategy, we directly perform average pooling across all entire output embeddings $\mathbf{E}$ (here we do not distinguish between $p_1$ and $p_2$ ). We further propose the interlocutor-level pooling strategy, formulated as:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathbf {e} = \sum_ {r = 1} ^ {R} \frac {\sum_ {i = 1} ^ {n} m _ {i} ^ {p _ {r}} \mathbf {h} _ {i}}{\sum_ {i = 1} ^ {n} m _ {i} ^ {p _ {r}}}, \tag {4}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $m_{i}^{p_{r}}$ is the $i$ -th value in $\mathbf{m}^{p_r}$ and $R$ is the number of interlocutors. We compare the results of the two strategies in Section 5.3.2.
|
| 121 |
+
|
| 122 |
+
# 3.2.4 Learning Objective
|
| 123 |
+
|
| 124 |
+
We adopt the NT-Xent loss proposed in (Oord et al., 2018) to train our model. Let $N$ be the number of all training samples associated with $S$ , which actually equals one positive sample plus the number of its corresponding negative samples. The loss $l$ is defined as:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
l = - \sum_ {r = 1} ^ {R} \log \frac {e ^ {\operatorname {s i m} \left(\hat {\mathbf {E}} ^ {p r} , \tilde {\mathbf {E}} ^ {p r}\right) / \tau}}{\sum_ {j = 1} ^ {N} e ^ {\operatorname {s i m} \left(\tilde {\mathbf {E}} _ {j} ^ {p r} , \tilde {\mathbf {E}} _ {j} ^ {p r}\right) / \tau}}, \tag {5}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $\tau$ is the hyper-parameter of temperature. $\mathrm{sim}(\cdot ,\cdot)$ is defined as an average pooling operation followed by the cosine distance calculation. For all $K$ dialogues in the dataset $D$ the loss $\mathcal{L}$ is given by:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\mathcal {L} = \frac {1}{K} \sum_ {i = 1} ^ {K} l _ {i}. \tag {6}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
# 4 Experiments Setup
|
| 137 |
+
|
| 138 |
+
# 4.1 Evaluation Tasks
|
| 139 |
+
|
| 140 |
+
We introduce three evaluation tasks: domain categorization, semantic relatedness, and dialogue retrieval. We categorize them into intrinsic and extrinsic tasks. The intrinsic tasks, including domain categorization and semantic relatedness, focus on assessing the overall distribution of the learned dialogue embeddings. The extrinsic task (i.e., dialogue retrieval) is more concerned with the performance of embeddings in dense retrieval scenarios.
|
| 141 |
+
|
| 142 |
+
Domain Categorization. Given a dataset of dialogues, the task is to assign each dialogue the corresponding domain label. Following Schnabel et al. (2015), we conduct this experiment as an unsupervised clustering task. All the dialogue embeddings
|
| 143 |
+
|
| 144 |
+
<table><tr><td rowspan="2">Datasets</td><td colspan="3">Train</td><td colspan="3">Dev</td><td colspan="3">Test</td><td rowspan="2">#Domain</td></tr><tr><td>#Sample</td><td>#Turn</td><td>#Word</td><td>#Sample</td><td>#Turn</td><td>#Word</td><td>#Sample</td><td>#Turn</td><td>#Word</td></tr><tr><td>BiTOD</td><td>2952</td><td>19</td><td>217</td><td>70</td><td>11</td><td>109</td><td>106</td><td>10</td><td>106</td><td>6</td></tr><tr><td>Doc2dial</td><td>3474</td><td>11</td><td>187</td><td>661</td><td>12</td><td>182</td><td>661</td><td>12</td><td>182</td><td>4</td></tr><tr><td>MetalWOZ</td><td>30307</td><td>11</td><td>83</td><td>3788</td><td>11</td><td>82</td><td>3789</td><td>11</td><td>82</td><td>47</td></tr><tr><td>MultiWOZ</td><td>8437</td><td>13</td><td>177</td><td>1077</td><td>9</td><td>110</td><td>1084</td><td>9</td><td>110</td><td>7</td></tr><tr><td>Self-dialogue</td><td>19331</td><td>15</td><td>151</td><td>2416</td><td>15</td><td>151</td><td>2417</td><td>15</td><td>152</td><td>28</td></tr><tr><td>SGD</td><td>16142</td><td>20</td><td>199</td><td>836</td><td>14</td><td>140</td><td>1331</td><td>12</td><td>124</td><td>45</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Table 1: Statistics of the six dialogue datasets used in our experiments. #Turn and #Word represent the average number of turns and words per dialogue. #Domain represents the total number of domains in the dataset.
|
| 147 |
+
|
| 148 |
+
are clustered into $n$ categories with KMeans++ Algorithm (Arthur and Vassilvitskii, 2006), where $n$ is the number of domains in the dataset. We adopt the purity metric in this task.
|
| 149 |
+
|
| 150 |
+
Semantic Relatedness. We pair each dialogue with a dialogue randomly selected from the same dataset and evaluate their semantic relatedness score based on their cosine similarity. The ground-truth label assigned to each dialogue pair is a binary value and is decided by whether the two dialogues share the identical domain. Following Baroni et al. (2014), we calculate Spearman's correlation between the sorted semantic relatedness scores and their corresponding ground-truth labels. This task is more stable than the domain categorization task since it gets rid of the high variance of clustering algorithms when the embedding distribution changes.
|
| 151 |
+
|
| 152 |
+
Dialogue Retrieval. Given a dialogue as a query, this task requires a model to rank all the candidates based on the cosine similarities. We use mean average precision (MAP) as the evaluation measure.
|
| 153 |
+
|
| 154 |
+
# 4.2 Datasets
|
| 155 |
+
|
| 156 |
+
We collect six widely-used dialogue datasets as below. We choose these datasets because they hold clear domain labels. Other datasets either provide non-semantic labels (e.g., logical labels that are less relevant to conversational semantics) (Li et al., 2017) or provide the domain labels automatically annotated by algorithms (Chen et al., 2021), thus are not suitable in our experiments. We split each dataset into training, validation, and testing sets and filter out dialogues with multiple domains in validation and test sets to fit our evaluation tasks. All domain labels are invisible to the model during the training procedure. Table 1 shows their statistics.
|
| 157 |
+
|
| 158 |
+
BiTOD (Lin et al., 2021) is a bilingual multi-domain dataset proposed for end-to-end task
|
| 159 |
+
|
| 160 |
+
oriented dialogue modeling. It provides thousands of dialogues and a large and realistic bilingual knowledge base. We use the dialogues and conduct experiments under the monolingual setting.
|
| 161 |
+
|
| 162 |
+
Doc2dial (Feng et al., 2020) includes goal-oriented dialogues that are grounded in the associated documents. We take the document topics as the domain labels of the dialogues.
|
| 163 |
+
|
| 164 |
+
MetalWOZ (Lee et al., 2019) is proposed for DSTC8, aiming at helping models more accurately predict user responses in new domains.
|
| 165 |
+
|
| 166 |
+
MultiWOZ (Eric et al., 2019) is a multi-domain dialogue dataset that poses significant challenges to task-oriented dialogue modeling due to its complexity. We use the 2.1 version in our experiments.
|
| 167 |
+
|
| 168 |
+
Self-dialogue (Fainberg et al., 2018) consists of large-scale self-dialogues with a broad set of topics. Modeling these dialogues is relatively difficult since they have more turns and topics.
|
| 169 |
+
|
| 170 |
+
SGD (Rastogi et al., 2020) is another larger-scale multi-domain dialogue dataset. We take the service field as the domain label of the dialogues.
|
| 171 |
+
|
| 172 |
+
# 4.3 Comparison Methods
|
| 173 |
+
|
| 174 |
+
The baseline approaches compared to our model are categorized into four groups as follows.
|
| 175 |
+
|
| 176 |
+
Non-DL Approaches. We treat a dialogue as a document and apply Latent Dirichlet Allocation (LDA) (Blei et al., 2003) to assign each dialogue a topic. LDA is only used in the domain categorization task, since it cannot give a similarity score between two dialogues.
|
| 177 |
+
|
| 178 |
+
**Embedding-based Approaches.** We consider a dialogue as a sequence of words or sentences, and we obtain dialogue embeddings by combining their pre-trained embeddings. We adopt GloVe (Pennington et al., 2014) to obtain pre-trained word embeddings, SimCSE (Gao et al., 2021) to obtain pre-trained universal sentence embeddings, and DialogueCSE (Liu et al., 2021) to obtain pre-trained dialogue-based sentence embeddings. Also, we
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan="2">Model</td><td colspan="7">Domain Categorization</td><td colspan="7">Semantic Relatedness</td></tr><tr><td>bit</td><td>doc</td><td>met</td><td>mul</td><td>sel</td><td>sgd</td><td>Average</td><td>bit</td><td>doc</td><td>met</td><td>mul</td><td>sel</td><td>sgd</td><td>Average</td></tr><tr><td>LDA</td><td>44.7</td><td>35.2</td><td>19.3</td><td>45.9</td><td>24.7</td><td>20.2</td><td>31.7</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>GloVe</td><td>64.3</td><td>54.7</td><td>40.5</td><td>79.0</td><td>35.0</td><td>51.6</td><td>54.2</td><td>34.3</td><td>25.9</td><td>15.8</td><td>38.9</td><td>15.7</td><td>27.6</td><td>26.4</td></tr><tr><td>Doc2Vec</td><td>82.7</td><td>70.9</td><td>43.9</td><td>86.1</td><td>40.9</td><td>63.6</td><td>64.7</td><td>43.4</td><td>24.8</td><td>14.6</td><td>30.6</td><td>10.7</td><td>26.9</td><td>25.2</td></tr><tr><td>SimCSE</td><td>79.3</td><td>64.7</td><td>45.1</td><td>85.5</td><td>46.8</td><td>66.7</td><td>64.7</td><td>39.5</td><td>33.2</td><td>14.9</td><td>38.1</td><td>18.3</td><td>26.9</td><td>28.5</td></tr><tr><td>DialogueCSE</td><td>85.8</td><td>68.4</td><td>77.5</td><td>94.9</td><td>53.2</td><td>72.1</td><td>75.3</td><td>42.4</td><td>44.5</td><td>23.9</td><td>65.2</td><td>27.6</td><td>31.7</td><td>39.2</td></tr><tr><td>BERT</td><td>49.1</td><td>54.0</td><td>31.6</td><td>61.3</td><td>44.4</td><td>31.3</td><td>45.3</td><td>24.3</td><td>22.4</td><td>11.6</td><td>30.5</td><td>16.7</td><td>17.9</td><td>20.6</td></tr><tr><td>RoBERTa</td><td>63.2</td><td>40.4</td><td>46.4</td><td>62.8</td><td>44.9</td><td>40.8</td><td>49.8</td><td>30.2</td><td>14.8</td><td>15.4</td><td>28.5</td><td>17.5</td><td>16.7</td><td>20.5</td></tr><tr><td>T5</td><td>78.7</td><td>55.2</td><td>67.6</td><td>89.5</td><td>43.8</td><td>69.5</td><td>67.4</td><td>38.6</td><td>28.6</td><td>20.8</td><td>42.5</td><td>20.0</td><td>29.7</td><td>30.0</td></tr><tr><td>TOD-BERT</td><td>75.6</td><td>63.1</td><td>82.9</td><td>94.3</td><td>50.0</td><td>50.3</td><td>69.4</td><td>47.0</td><td>32.6</td><td>24.3</td><td>48.9</td><td>24.6</td><td>24.8</td><td>33.7</td></tr><tr><td>Blender</td><td>80.9</td><td>56.4</td><td>62.3</td><td>82.4</td><td>45.4</td><td>73.1</td><td>66.8</td><td>37.0</td><td>28.1</td><td>19.9</td><td>44.4</td><td>18.3</td><td>31.1</td><td>29.8</td></tr><tr><td>PLATO</td><td>74.1</td><td>79.0</td><td>73.9</td><td>82.5</td><td>62.5</td><td>71.0</td><td>73.8</td><td>46.6</td><td>38.7</td><td>22.7</td><td>45.3</td><td>35.1</td><td>32.4</td><td>36.8</td></tr><tr><td>Dial2Vec</td><td>90.6</td><td>90.2</td><td>77.2</td><td>96.7</td><td>63.1</td><td>86.2</td><td>84.0</td><td>68.8</td><td>50.7</td><td>24.5</td><td>71.0</td><td>37.2</td><td>36.9</td><td>48.2</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Table 2: Evaluation results of the intrinsic tasks on the six dialogue datasets, including BiTOD (bit), Doc2dial (doc), MetalWOZ (met), MultiWOZ (mul), Self-dialogue (sel) and SGD (sgd). The metrics are purity and Spearman's correlation for the two tasks respectively. All results reported are averaged across 10 independent runs to reduce the variance. Boldface and underline highlight the best and the second-best scores.
|
| 183 |
+
|
| 184 |
+
consider a dialogue as a document and embed it with Doc2Vec (Le and Mikolov, 2014).
|
| 185 |
+
|
| 186 |
+
PLMs. We consider three representative pretrained language models, including BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019a), and T5 (Raffel et al., 2020).
|
| 187 |
+
|
| 188 |
+
Conversational-PLMs. We adopt TOD-BERT (Wu et al., 2020a), Blender (Roller et al., 2021), and PLATO (Bao et al., 2020) as baselines in this group. TOD-BERT (Wu et al., 2020a) is pre-trained with nine dialogue datasets, including MultiWOZ and MetalWOZ. We adopt it as a strong baseline to compare against our model, especially on the MultiWOZ and MetalWOZ datasets. Blender (Roller et al., 2021) and PLATO (Bao et al., 2020) are pre-trained with large-scale open domain dialogue data including Twitter and Reddit (Cho et al., 2014; Zhou et al., 2018; Galley et al., 2019). We also include them as strong baselines for comparison.
|
| 189 |
+
|
| 190 |
+
For all PLMs and Conversational-PLMs, we use the average of the output embeddings from the top layer as the dialogue embedding. We do not experiment with the [CLS] token embedding since it may be relatively weak in representing long conversational texts.
|
| 191 |
+
|
| 192 |
+
# 4.4 Implement Details
|
| 193 |
+
|
| 194 |
+
Our model is implemented in PyTorch (Paszke et al., 2019). We initialize our encoder with PLATO's pre-trained parameters. During finetuning, we freeze the bottom 6 layers of the encoder to avoid the catastrophic forgetting problem. The maximum sequence length is limited to 512 but is
|
| 195 |
+
|
| 196 |
+
sufficient for most dialogues in our experiments. The temperature $\tau$ and the window size $w$ are set to 0.2 and 10 respectively, since such configuration performs best across all datasets. We optimize the model parameters with Adam optimizer (Kingma and Ba, 2015), using a learning rate of 1e-5 and a batch size of 5 per GPU. All models are trained with 4 NVIDIA Tesla V100 GPUs.
|
| 197 |
+
|
| 198 |
+
# 5 Experimental Results
|
| 199 |
+
|
| 200 |
+
# 5.1 Intrinsic Task
|
| 201 |
+
|
| 202 |
+
Table 2 shows the experimental results of the intrinsic tasks. For each task, dial2vec achieves on average 8.7 and 9.0 absolute improvements in terms of purity and Spearman's correlation against the strongest baseline DialogueCSE. We attribute the strong performance to the introduction of the interlocutor-level conversational interaction information in learning dialogue embeddings.
|
| 203 |
+
|
| 204 |
+
Conversational-PLMs show overwhelming superiority over PLMs, indicating that pre-training with conversational data plays a key role in producing better dialogue embeddings. The phenomenon that TOD-BERT achieves very competitive results against dial2vec on MultiWOZ and MetalWOZ also confirms this fact. Even so, dial2vec easily bridges or reverses the gaps between PLATO and TOD-BERT on both datasets, demonstrating its superiority in exploiting conversational information.
|
| 205 |
+
|
| 206 |
+
PLATO generally performs better than TODBERT and Blender. We hypothesize that the turn and role embeddings also play a crucial role in our task. To verify this, we employ BERT as the en
|
| 207 |
+
|
| 208 |
+
coder and train dial2vec(BERT) $^1$ under the same setting as dial2vec(PLATO). However, the results on the three tasks degrade rapidly after reaching the best performances. We believe that under such a setting, the inputs provide insufficient information for the model to maintain turn-aware and role-aware semantic information in the encoding outputs, making the training not robust.
|
| 209 |
+
|
| 210 |
+
The embedding-based methods suffer from poor performance since they ignore the weights when combining word and sentence embeddings. Among them, SimCSE releases the inherent representation capability of PLMs by introducing the twice-dropout operation in fine-tuning, achieving better results than GloVe and Doc2Vec. But since such an operation is generic and orthogonal to our work, we do not incorporate it into our model. Particularly, DialogueCSE yields superior results compared with other embedding-based methods and even shows competitive performances against our model. This is reasonable since it is the only baseline in this group that leverages conversational interactions to learn sentence embeddings. However, its performance is still unsatisfactory since it performs sentence-level instead of interlocutor-level interactions and fails to model the entire dialogue.
|
| 211 |
+
|
| 212 |
+
# 5.2 Extrinsic Task
|
| 213 |
+
|
| 214 |
+
Table 3 shows dial2vec's performances on the dialogue retrieval task. Compared to the experiment results on the intrinsic tasks, dial2vec achieves more significant improvements on all datasets. We attribute it to dial2vec's capability of understanding fine-grained conversational semantics. Since dial2vec is forced to distinguish the positive samples composed of the exact matching question-answers from the negative ones, the semantic information it learned is more fine-grained than tasks trained with only domain labels. Such characteristic makes it adept at ranking semantically similar candidates, resulting in better performance on the MAP metric.
|
| 215 |
+
|
| 216 |
+
# 5.3 Analysis
|
| 217 |
+
|
| 218 |
+
To further investigate the property of our model, we adopt PLATO as the baseline to conduct experiments with the single interlocutor's embeddings, the aggregation strategies, and the embedding distributions. We report the average results across all datasets.
|
| 219 |
+
|
| 220 |
+
<table><tr><td rowspan="2">Model</td><td colspan="7">Dialogue Retrieval</td></tr><tr><td>bit</td><td>doc</td><td>met</td><td>mul</td><td>sel</td><td>sgd</td><td>AVG</td></tr><tr><td>GloVe</td><td>63.8</td><td>49.1</td><td>29.4</td><td>65.9</td><td>24.1</td><td>52.6</td><td>47.5</td></tr><tr><td>Doc2Vec</td><td>67.7</td><td>43.7</td><td>15.1</td><td>50.9</td><td>16.3</td><td>43.1</td><td>39.5</td></tr><tr><td>SimCSE</td><td>62.5</td><td>52.5</td><td>23.8</td><td>62.1</td><td>27.0</td><td>44.8</td><td>45.5</td></tr><tr><td>DialogueCSE</td><td>72.9</td><td>58.2</td><td>66.7</td><td>82.9</td><td>34.5</td><td>62.5</td><td>62.9</td></tr><tr><td>BERT</td><td>52.4</td><td>44.8</td><td>17.0</td><td>56.4</td><td>25.8</td><td>26.0</td><td>37.1</td></tr><tr><td>RoBERTa</td><td>62.2</td><td>40.6</td><td>30.4</td><td>57.4</td><td>25.5</td><td>35.0</td><td>41.9</td></tr><tr><td>T5</td><td>67.3</td><td>49.9</td><td>43.9</td><td>69.7</td><td>27.8</td><td>53.8</td><td>52.1</td></tr><tr><td>TOD-BERT</td><td>73.2</td><td>53.0</td><td>65.7</td><td>84.2</td><td>33.0</td><td>45.3</td><td>59.1</td></tr><tr><td>Blender</td><td>69.1</td><td>50.1</td><td>44.6</td><td>70.1</td><td>25.4</td><td>63.0</td><td>53.7</td></tr><tr><td>PLATO</td><td>71.6</td><td>59.7</td><td>54.5</td><td>68.7</td><td>45.9</td><td>63.2</td><td>60.6</td></tr><tr><td>Dial2Vec</td><td>94.4</td><td>69.4</td><td>68.0</td><td>96.4</td><td>49.4</td><td>82.8</td><td>76.7</td></tr></table>
|
| 221 |
+
|
| 222 |
+
# 5.3.1 Single Interlocutor's Embeddings
|
| 223 |
+
|
| 224 |
+
Intuitively, each interlocutor holds their own unilateral information of the dialogue. However, such interaction-free information usually contains noises or overlaps with that from other interlocutors. Table 4 shows the experiment results of PLATO and dial2vec. We find that the PLATO's embeddings for individual interlocutors usually perform close to or even better than the aggregated results. As a comparison, dial2vec yields significantly better embeddings for both interlocutors, and achieves further improvements when aggregating them. We conclude that under the guidance of the conversational interactions, dial2vec eliminates the interlocutor-level interaction-free information and highlights the interaction-aware information, thus achieving better performances.
|
| 225 |
+
|
| 226 |
+
Table 3: Evaluation results of the dialogue retrieval task. We use the mean average precision (MAP) as the evaluation metric. Boldface and underline highlight the best and the second-best scores.
|
| 227 |
+
|
| 228 |
+
<table><tr><td>Model</td><td>Interlocutor</td><td>Purity</td><td>Spearman</td><td>MAP</td></tr><tr><td rowspan="4">PLATO</td><td>p1</td><td>71.78</td><td>36.23</td><td>59.38</td></tr><tr><td>p2</td><td>75.29</td><td>36.67</td><td>60.73</td></tr><tr><td>p1 + p1</td><td>73.83</td><td>36.80</td><td>60.60</td></tr><tr><td>diff</td><td>-1.46</td><td>0.13</td><td>-0.13</td></tr><tr><td rowspan="4">Dial2Vec</td><td>p1</td><td>83.27</td><td>47.82</td><td>75.72</td></tr><tr><td>p2</td><td>82.21</td><td>46.74</td><td>74.56</td></tr><tr><td>p1 + p1</td><td>83.97</td><td>48.19</td><td>76.73</td></tr><tr><td>diff</td><td>0.70</td><td>0.37</td><td>1.01</td></tr></table>
|
| 229 |
+
|
| 230 |
+
Table 4: Performances of dialogue embeddings for each interlocutor. $p1$ represents that we use the embeddings from the interlocutor who starts the conversation, and $p2$ represents the opposite. $p1 + p2$ represents the aggregated results. diff shows improvements of the aggregated results over the best single interlocutor's results. Boldface represents the best scores among the models.
|
| 231 |
+
|
| 232 |
+
# 5.3.2 Aggregation Strategies
|
| 233 |
+
|
| 234 |
+
As described in Section 3.2.3, we experiment with two aggregation strategies: average pooling and interlocutor-level pooling. For average pooling, we average all the output embeddings as the final dialogue embedding, while for interlocutor-level pooling, we sum the average pooling results of the output embeddings corresponding to each interlocutor.
|
| 235 |
+
|
| 236 |
+
<table><tr><td>Model</td><td>Purity</td><td>Spearman</td><td>MAP</td></tr><tr><td>Dial2Vecavg</td><td>83.69</td><td>47.93</td><td>76.39</td></tr><tr><td>Dial2Vecint</td><td>83.97</td><td>48.19</td><td>76.73</td></tr><tr><td>diff</td><td>+0.28</td><td>+0.26</td><td>+0.34</td></tr></table>
|
| 237 |
+
|
| 238 |
+
Table 5: Comparison between the average-pooling (denoted as avg) and interlocutor-level pooling (denoted as int) strategies. Boldface highlights the best scores.
|
| 239 |
+
|
| 240 |
+
Table 5 shows the results for the two strategies on all datasets. The interlocutor-level pooling strategy performs consistently better than the average pooling strategy. We hold that the interlocutor-level pooling strategy acts as a normalization operation that balances the weight of semantic information from different interlocutors.
|
| 241 |
+
|
| 242 |
+
# 5.3.3 Alignment and Uniformity Analysis
|
| 243 |
+
|
| 244 |
+
Inspired by Wang and Isola (2020), we employ the alignment and uniformity metrics to study the variation of dialogue embedding distribution during training. Given a set of data pairs and their corresponding labels, the alignment metric is calculated as the expected value of Euclidean distances of each positive data pair, formulated as:
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\ell_ {\text {a l i g n m e n t}} \triangleq \underset {x, x ^ {+} \sim p _ {p o s}} {\mathbb {E}} \| f (x) - f \left(x ^ {+}\right) \| ^ {2}. \tag {7}
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
The alignment metric is suitable for tasks such as Gao et al. (2021) since the positive pairs are encoded from a unique text. However, in our scenario, positive pairs generated from two different dialogues are only expected to have closer distances than negative pairs. Thus, we revise the Eq. (7) to be:
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\begin{array}{l} \ell_ {a d j \_ a l i g n m e n t} \triangleq \underset {x, x ^ {+} \sim p _ {p o s}} {\mathbb {E}} \| f (x) - f (x ^ {+}) \| ^ {2}, \\ - \underset {x, x ^ {-} \sim p _ {n e g}} {\mathbb {E}} \| f (x) - f \left(x ^ {-}\right) \| ^ {2}. \tag {8} \\ \end{array}
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
We name $\ell_{adj\_alignment}$ as the adjusted alignment metric.
|
| 257 |
+
|
| 258 |
+
The uniformity metric is defined to measure how close the embeddings are to the uniform distribution:
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\ell_ {\text {u n i f o r m i t y}} \triangleq \log \underset {x, y \stackrel {i. i. d} {\sim} p _ {\text {d a t a}}} {\mathbb {E}} e ^ {- 2 \| f (x) - f (y) \| ^ {2}}, \tag {9}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
where $p_{data}$ denotes the data distribution.
|
| 265 |
+
|
| 266 |
+
Figure 3 shows how the adjusted alignment and uniformity vary with the training iterations. 'Start' marks the results at the very beginning of training, which also stands for the vanilla PLATO's performances. As we can see, the two metrics decrease rapidly in the first few iterations. We believe dial2vec learns discriminative embeddings by pushing the embeddings for the two interlocutors in the negative samples away from each other in this stage. Since the dialogue embeddings are spread out over the unit hypersphere, both metrics decrease. As the training proceeds, the model learns the fine-grained informative dialogue embeddings from the positive samples. This makes the dialogues with similar semantics close to each other, causing the uniformity to increase again. The two metrics finally converge to the values much better than the start points, showing that dial2vec learns both informative and discriminative embeddings.
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 3: The scatter plot of $\ell_{\text{adj\_alignment}} - \ell_{\text{uniformity}}$ on the six testing sets. We plot the two metrics after every evaluation. For both metrics, lower values represent better distributions.
|
| 270 |
+
|
| 271 |
+
# 6 Conclusion
|
| 272 |
+
|
| 273 |
+
In this paper, we formally introduce the task of learning unsupervised dialogue embeddings and propose dial2vec to solve this task. We introduce a self-guided mechanism that leverages the conversational interactions to guide the learning of the embeddings for both interlocutors and propose the interlocutor-level strategy to aggregate them. We further release a benchmark consisting of six
|
| 274 |
+
|
| 275 |
+
widely-used dialogue datasets and three tasks designed based on the domain labels. Our model achieves superior performances on all datasets across the three tasks, and further analysis shows that the dialogue embeddings learned by our model are more informative and discriminative than the baselines. We believe there is still much room for improvement to generate satisfactory dialogue embedding.
|
| 276 |
+
|
| 277 |
+
# 7 Limitations
|
| 278 |
+
|
| 279 |
+
Our work has two limitations. First, although dial2vec is designed to be able to scale to multi-party conversations, we did not conduct such experiments due to the lack of a suitable multi-party evaluation dataset. As annotating for a multi-party dialogue dataset is indeed complicated, we leave it to future work. Besides, dial2vec still performs unsatisfactorily when employing BERT-like encoders. Although they also achieve very competitive results, we believe that a robust training procedure is more important since we do not know when to stop training under the unsupervised setting in practice. Dial2vec should be further improved to better adapt to the multiple formats of input embeddings.
|
| 280 |
+
|
| 281 |
+
# References
|
| 282 |
+
|
| 283 |
+
David Arthur and Sergei Vassilvitskii. 2006. k-means++: The advantages of careful seeding. Technical report, Stanford.
|
| 284 |
+
Siqi Bao, Huang He, Fan Wang, Hua Wu, and Haifeng Wang. 2020. Plato: Pre-trained dialogue generation model with discrete latent variable. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 85-96.
|
| 285 |
+
Marco Baroni, Georgiana Dinu, and German Kruszewski. 2014. Don't count, predict! a systematic comparison of context-counting vs. context-predicting semantic vectors. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 238-247.
|
| 286 |
+
Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Janvin. 2003. A neural probabilistic language model. The journal of machine learning research, 3:1137-1155.
|
| 287 |
+
David M Blei, Andrew Y Ng, and Michael I Jordan. 2003. Latent dirichlet allocation. the Journal of machine Learning research, 3:993-1022.
|
| 288 |
+
Minmin Chen. 2017. Efficient vector representation for documents through corruption. arXiv preprint arXiv:1707.02377.
|
| 289 |
+
|
| 290 |
+
Yulong Chen, Yang Liu, and Yue Zhang. 2021. Dialogsum challenge: Summarizing real-life scenario dialogues. In Proceedings of the 14th International Conference on Natural Language Generation, pages 308-313.
|
| 291 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using rnN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078.
|
| 292 |
+
Yung-Sung Chuang, Rumen Dangovski, Hongyin Luo, Yang Zhang, Shiyu Chang, Marin Soljačić, Shang-Wen Li, Wen-tau Yih, Yoon Kim, and James Glass. 2022. Diffcse: Difference-based contrastive learning for sentence embeddings. arXiv preprint arXiv:2204.10298.
|
| 293 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
|
| 294 |
+
Mihail Eric, Rahul Goel, Shachi Paul, Adarsh Kumar, Abhishek Sethi, Peter Ku, Anuj Kumar Goyal, Sanchit Agarwal, Shuyang Gao, and Dilek Hakkani-Tur. 2019. Multiwoz 2.1: A consolidated multi-domain dialogue dataset with state corrections and state tracking baselines. arXiv preprint arXiv:1907.01669.
|
| 295 |
+
Joachim Fainberg, Ben Krause, Mihai Dobre, Marco Damonte, Emmanuel Kahembwe, Daniel Duma, Bonnie Webber, and Federico Fancellu. 2018. Talking to myself: self-dialogues as data for conversational agents. arXiv preprint arXiv:1809.06641.
|
| 296 |
+
Song Feng, Hui Wan, Chulaka Gunasekara, Siva Patel, Sachindra Joshi, and Luis Lastras. 2020. doc2dial: A goal-oriented document-grounded dialogue dataset. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8118-8128.
|
| 297 |
+
Michel Galley, Chris Brockett, Xiang Gao, Jianfeng Gao, and Bill Dolan. 2019. Grounded response generation task at dstc7. In AAAI Dialog System Technology Challenges Workshop.
|
| 298 |
+
Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021. Simcse: Simple contrastive learning of sentence embeddings. arXiv preprint arXiv:2104.08821.
|
| 299 |
+
John M Giorgi, Osvald Nitski, Gary D Bader, and Bo Wang. 2020. Declutr: Deep contrastive learning for unsupervised textual representations. arXiv preprint arXiv:2006.03659.
|
| 300 |
+
Wanwei He, Yinpei Dai, Binyuan Hui, Min Yang, Zheng Cao, Jianbo Dong, Fei Huang, Luo Si, and Yongbin Li. 2022a. Space-2: Tree-structured semi-supervised contrastive pre-training for task-oriented dialog understanding. arXiv preprint arXiv:2209.06638.
|
| 301 |
+
|
| 302 |
+
Wanwei He, Yinpei Dai, Min Yang, Jian Sun, Fei Huang, Luo Si, and Yongbin Li. 2022b. Unified dialog model pre-training for task-oriented dialog understanding and generation. In Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 187-200.
|
| 303 |
+
Wanwei He, Yinpei Dai, Yinhe Zheng, Yuchuan Wu, Zheng Cao, Dermot Liu, Peng Jiang, Min Yang, Fei Huang, Luo Si, et al. 2022c. Galaxy: A generative pre-trained model for task-oriented dialog with semi-supervised learning and explicit policy injection. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 10749-10757.
|
| 304 |
+
Binyuan Hui, Ruiying Geng, Qiyu Ren, Binhua Li, Yongbin Li, Jian Sun, Fei Huang, Luo Si, Pengfei Zhu, and Xiaodan Zhu. 2021. Dynamic hybrid relation exploration network for cross-domain context-dependent semantic parsing. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 13116-13124.
|
| 305 |
+
Taeuk Kim, Kang Min Yoo, and Sang-goo Lee. 2021. Self-guided contrastive learning for bert sentence representations. arXiv preprint arXiv:2106.07345.
|
| 306 |
+
Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In ICLR (Poster).
|
| 307 |
+
Tassilo Klein and Moin Nabi. 2022. Scd: Self-contrastive decorrelation of sentence embeddings. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 394–400.
|
| 308 |
+
Quoc Le and Tomas Mikolov. 2014. Distributed representations of sentences and documents. In International conference on machine learning, pages 1188-1196. PMLR.
|
| 309 |
+
Sungjin Lee, Hannes Schulz, Adam Atkinson, Jianfeng Gao, Kaheer Suleman, Layla El Asri, Mahmoud Adada, Minlie Huang, Shikhar Sharma, Wendy Tay, and Xiujun Li. 2019. Multi-domain task-completion dialog challenge. In Dialog System Technology Challenges 8.
|
| 310 |
+
Yanran Li, Hui Su, Xiaoyu Shen, Wenjie Li, Ziqiang Cao, and Shuzi Niu. 2017. Dailydialog: A manually labelled multi-turn dialogue dataset. arXiv preprint arXiv:1710.03957.
|
| 311 |
+
Zhaojiang Lin, Andrea Madotto, Genta Indra Winata, Peng Xu, Feijun Jiang, Yuxiang Hu, Chen Shi, and Pascale Fung. 2021. Bitod: A bilingual multidomain dataset for task-oriented dialogue modeling. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1).
|
| 312 |
+
Che Liu, Rui Wang, Jinghua Liu, Jian Sun, Fei Huang, and Luo Si. 2021. Dialoguecse: Dialogue-based contrastive learning of sentence embeddings. arXiv preprint arXiv:2109.12599.
|
| 313 |
+
|
| 314 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019a. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692.
|
| 315 |
+
Zhengyuan Liu and Nancy Chen. 2021. Controllable neural dialogue summarization with personal named entity planning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 92-106.
|
| 316 |
+
Zhengyuan Liu, Angela Ng, Sheldon Lee, Ai Ti Aw, and Nancy F Chen. 2019b. Topic-aware pointer-generator networks for summarizing spoken conversations. In 2019 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pages 814-821. IEEE.
|
| 317 |
+
Dongsheng Luo, Wei Cheng, Jingchao Ni, Wenchao Yu, Xuchao Zhang, Bo Zong, Yanchi Liu, Zhengzhang Chen, Dongjin Song, Haifeng Chen, et al. 2021. Unsupervised document embedding via contrastive augmentation. arXiv preprint arXiv:2103.14542.
|
| 318 |
+
Chenxu Lv, Hengtong Lu, Shuyu Lei, Huixing Jiang, Wei Wu, Caixia Yuan, and Xiaojie Wang. 2021. Task-oriented clustering for dialogues. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 4338-4347.
|
| 319 |
+
Yu Meng, Chenyan Xiong, Payal Bajaj, Saurabh Tiwary, Paul Bennett, Jiawei Han, and Xia Song. 2021. Coco-lm: Correcting and contrasting text sequences for language model pretraining. arXiv preprint arXiv:2102.08473.
|
| 320 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781.
|
| 321 |
+
Sosuke Nishikawa, Ryokan Ri, Ikuya Yamada, Yoshi-masa Tsuruoka, and Isao Echizen. 2022. Ease: Entity-aware contrastive learning of sentence embedding. arXiv preprint arXiv:2205.04260.
|
| 322 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. 2018. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748.
|
| 323 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. 2019. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32.
|
| 324 |
+
Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532-1543.
|
| 325 |
+
|
| 326 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:1-67.
|
| 327 |
+
Abhinav Rastogi, Xiaoxue Zang, Srinivas Sunkara, Raghav Gupta, and Pranav Khaitan. 2020. Towards scalable multi-domain conversational agents: The schema-guided dialogue dataset. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 8689-8696.
|
| 328 |
+
Nils Reimers and Iryna Gurevych. 2019. Sentence-bert: Sentence embeddings using siamese bert-networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3982-3992.
|
| 329 |
+
Stephen Roller, Emily Dinan, Naman Goyal, Da Ju, Mary Williamson, Yinhan Liu, Jing Xu, Myle Ott, Eric Michael Smith, Y-Lan Boureau, et al. 2021. Recipes for building an open-domain chatbot. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 300-325.
|
| 330 |
+
Tobias Schnabel, Igor Labutov, David Mimno, and Thorsten Joachims. 2015. Evaluation methods for unsupervised word embeddings. In Proceedings of the 2015 conference on empirical methods in natural language processing, pages 298-307.
|
| 331 |
+
Chen Shi, Qi Chen, Lei Sha, Sujian Li, Xu Sun, Houfeng Wang, and Lintao Zhang. 2018. Autodialabel: Labeling dialogue data with unsupervised learning. In Proceedings of the 2018 conference on empirical methods in natural language processing, pages 684-689.
|
| 332 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in neural information processing systems, pages 5998-6008.
|
| 333 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. 2018. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461.
|
| 334 |
+
Jiancheng Wang, Jingjing Wang, Changlong Sun, Shoushan Li, Xiaozhong Liu, Luo Si, Min Zhang, and Guodong Zhou. 2020. Sentiment classification in customer service dialogue with topic-aware multitask learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9177-9184.
|
| 335 |
+
Lihan Wang, Bowen Qin, Binyuan Hui, Bowen Li, Min Yang, Bailin Wang, Binhua Li, Jian Sun, Fei Huang,
|
| 336 |
+
|
| 337 |
+
Luo Si, et al. 2022. Proton: Probing schema linking information from pre-trained language models for text-to-sql parsing. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pages 1889-1898.
|
| 338 |
+
Tongzhou Wang and Phillip Isola. 2020. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In International Conference on Machine Learning, pages 9929-9939. PMLR.
|
| 339 |
+
Chien-Sheng Wu, Steven CH Hoi, Richard Socher, and Caiming Xiong. 2020a. Tod-bert: Pre-trained natural language understanding for task-oriented dialogue. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 917-929.
|
| 340 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. 2016. Google's neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144.
|
| 341 |
+
Zhuofeng Wu, Sinong Wang, Jiatao Gu, Madian Khabsa, Fei Sun, and Hao Ma. 2020b. Clear: Contrastive learning for sentence representation. arXiv preprint arXiv:2012.15466.
|
| 342 |
+
Yuanmeng Yan, Rumei Li, Sirui Wang, Fuzheng Zhang, Wei Wu, and Weiran Xu. 2021. Consent: A contrastive framework for self-supervised sentence representation transfer. arXiv preprint arXiv:2105.11741.
|
| 343 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. Advances in neural information processing systems, 32.
|
| 344 |
+
Shuai Zhang, Wang Lijie, Xinyan Xiao, and Hua Wu. 2022. Syntax-guided contrastive learning for pretrained language model. In Findings of the Association for Computational Linguistics: ACL 2022, pages 2430-2440, Dublin, Ireland. Association for Computational Linguistics.
|
| 345 |
+
Hao Zhou, Tom Young, Minlie Huang, Haizhou Zhao, Jingfang Xu, and Xiaoyan Zhu. 2018. Commonsense knowledge aware conversation generation with graph attention. In *IJCAI*, pages 4623-4629.
|
| 346 |
+
Kun Zhou, Beichen Zhang, Wayne Xin Zhao, and Ji-Rong Wen. 2022. Debiased contrastive learning of unsupervised sentence representations. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6120-6130.
|
dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96f082f4a1c66679de7139869b33ce2c878dec8854a8b8b5f8ce4b5df61f363c
|
| 3 |
+
size 485424
|
dial2vecselfguidedcontrastivelearningofunsuperviseddialogueembeddings/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da458b2ceb2ef24f269c2ab0bc013345733330ea225c3bbf82603f2b25a43112
|
| 3 |
+
size 384116
|
dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/9d769241-d32a-497e-b955-7e3ec652b4d9_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a225b9793ca7aba4df5ad3ae2e8cf24338e9d6c7b05d42b6a6802fa4ce7ab7d
|
| 3 |
+
size 87876
|
dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/9d769241-d32a-497e-b955-7e3ec652b4d9_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:680207e2c75ac8204a6636bfdc47a7068418ffd60f6ffd89484810ded14decb6
|
| 3 |
+
size 105199
|
dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/9d769241-d32a-497e-b955-7e3ec652b4d9_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:94559edaedc4c52c1b4c0ac84dc550c65cc79b5f9d26c5f8fefb4872c3226b8c
|
| 3 |
+
size 1299954
|
dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/full.md
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DialogConv: A Lightweight Fully Convolutional Network for Multi-view Response Selection
|
| 2 |
+
|
| 3 |
+
Yongkang Liu<sup>1</sup>, Shi Feng<sup>1</sup>, Wei Gao<sup>2</sup>, Daling Wang<sup>1</sup> and Yifei Zhang<sup>1</sup>
|
| 4 |
+
|
| 5 |
+
1 Northeastern University, China
|
| 6 |
+
|
| 7 |
+
2 Singapore Management University, Singapore
|
| 8 |
+
|
| 9 |
+
misonsky@163.com, fengshi@cse.neu.edu.cn
|
| 10 |
+
|
| 11 |
+
weigao@smu.edu.sg, {wangdaling,zhangyifei}@cse.neu.edu.cn
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Current end-to-end retrieval-based dialogue systems are mainly based on Recurrent Neural Networks or Transformers with attention mechanisms. Although promising results have been achieved, these models often suffer from slow inference or huge number of parameters. In this paper, we propose a novel lightweight fully convolutional architecture, called DialogConv, for response selection. DialogConv is exclusively built on top of convolution to extract matching features of context and response. Dialogues are modeled in 3D views, where DialogConv performs convolution operations on embedding view, word view and utterance view to capture richer semantic information from multiple contextual views. On the four benchmark datasets, compared with state-of-the-art baselines, DialogConv is on average about $8.5 \times$ smaller in size, and $79.39 \times$ and $10.64 \times$ faster on CPU and GPU devices, respectively. At the same time, DialogConv achieves the competitive effectiveness of response selection.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
An important challenge in building intelligent dialogue systems is the response selection problem, which aims to select an appropriate response from a set of candidates given a dialogue context. Such retrieval-based dialogue systems have attracted great attention from academia and industry due to the advantages of informative and fluent responses produced (Tao et al., 2021).
|
| 20 |
+
|
| 21 |
+
The existing retrieval-based dialogue systems can be divided into three patterns according to the way of input handling (Zhang and Zhao, 2021): (i) Separate Pattern (Wu et al., 2017; Zhang et al., 2018; Zhou et al., 2018; Gu et al., 2019); (ii) Concatenated Pattern (Tan et al., 2015; Zhou et al., 2016); (iii) PrLM (Pretrained Language Model) Pattern (Cui et al., 2020; Gu et al., 2020; Liu et al., 2021). Separate Pattern (i.e., Figure 1 (a)) encodes utterances individually, while Concatenated Pat
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Flat modeling. (a) is separate pattern, (b) is concatenated pattern and (c) is PrLM pattern. Grey bars in (c) are embedded representations of special symbols.
|
| 25 |
+
|
| 26 |
+
tern (i.e., Figure 1 (b)) concatenates all utterances into a continuous word sequence. Methods based on these two patterns usually have Recurrent Neural Networks (RNNs) (Hochreiter and Schmidhuber, 1997; Cho et al., 2014) and attention mechanism (Bahdanau et al., 2015) as the backbone. Although promising results have been achieved, these methods are generally slow in training and inference due to their recurrent nature.
|
| 27 |
+
|
| 28 |
+
The PrLM Pattern (i.e., Figure 1 (c)) uses special symbols to connect all utterances into a continuous sequence, similar to Concatenated Pattern. While PrLM Pattern has obtained state-of-the-art performance in response selection (Cui et al., 2020; Gu et al., 2020; Liu et al., 2021), this method having Transformer (Vaswani et al., 2017) as the de facto standard architecture suffers from a large number of parameters and heavy computational cost. Very large models not only lead to increased training costs, but also prevent researchers from iterating quickly. At the same time, slow inference hinders development and deployment of dialogue systems in real-world scenarios.
|
| 29 |
+
|
| 30 |
+
Furthermore, these three patterns treat dialogue contexts as flat structures (Li et al., 2021). Methods based on such flat structures usually capture the sequential features of text by considering each word as a unit. However, previous work (Lu et al., 2019) revealed that given a multi-turn dialogue (e.g., Figure 2 (a)), the context of the dialogue can exhibit a composition of 3D stereo structures as
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Stereo view modeling. (a) An example of multi-turn dialogue; (b) Features from different views; (c) A schematic diagram of stereo view; (d) Convolution on different views ((1) is convolution in embedding view; (2) is convolution in word view; and (3) is convolution in utterance view)
|
| 34 |
+
|
| 35 |
+
we view utterances in each dimension (shown as Figure 2 (b) and (c))). As shown in Figure 2 (b), the embedding view can represent features of each individual word, the word view can represent the features from the whole conversation and a single utterance, and the utterance view can capture the dependencies between different localities composed of adjacent utterances. Existing methods (Gu et al., 2019; Zhou et al., 2016; Gu et al., 2020) only extract features based on the flat structures, but cannot simultaneously capture complex features from such stereoscopic views.
|
| 36 |
+
|
| 37 |
+
In this paper, we propose a lightweight fully convolutional network model, called DialogConv, without any RNN and attention module for multiview response selection. Different from previous studies (Zhou et al., 2016; Gu et al., 2019, 2020; Li et al., 2021) which model the dialogue in a flat view, DialogConv models the dialogue context and response together in the 3D space of the stereo views, i.e., embedding view, word view, and utterance view (as shown in Figure 2 (d)). In the embedding view, the word-level features will be refined through convolution operations on the plane formed by the word sequence dimension and the utterance dimension. In the word view, the global conversation features will be captured by concatenating all words into a continuous sequence, and the features of each utterance will be refined by performing convolution on each utterance. In the utterance view, the dependency features between different local contexts will be distilled by performing convolution across different utterances. In general, DialogConv can simultaneously extract features with different granularities from the stereo structure.
|
| 38 |
+
|
| 39 |
+
DialogConv is completely based on CNN, which uses much fewer parameters and computing resources. DialogueConv has an average number
|
| 40 |
+
|
| 41 |
+
of parameters of 12.4 million, which is on average about $8.5 \times$ smaller than other models. The inference speed of DialogConv can be on average about $79.39 \times$ faster on CPU device and $10.64 \times$ faster on GPU device than existing models. Moreover, DialogConv achieves competitive results on four benchmarks and performs even better when pretrained with contrastive learning. In summary, we make the following contributions:
|
| 42 |
+
|
| 43 |
+
- We propose an efficient convolutional response selection model, DialogConv, which, to our best knowledge, is the first response selection model built entirely on multiple convolutional layers without any RNN or attention module.
|
| 44 |
+
- We model dialogue from stereo views, where 2D and 1D convolution operations are performed on embedding, word and utterance views, and thus DialogConv can capture features from stereo views simultaneously.
|
| 45 |
+
- Extensive experiments on four benchmark datasets show that DialogConv with fewer parameters can achieve competitive performance with faster speed and less computing resources. The code is available o Github².
|
| 46 |
+
|
| 47 |
+
# 2 Related Work
|
| 48 |
+
|
| 49 |
+
# 2.1 Retrieval-based Dialogue System
|
| 50 |
+
|
| 51 |
+
Most existing retrieval-based dialogue systems (Wu et al., 2017; Gu et al., 2019; Liu et al., 2021) focus on matching between dialogue context and response. These methods attempt to mine deep semantic features through sequence modeling, e.g., using attention-based pairwise matching mechanisms to capture interaction features between dialogue context and candidate response. However, previous research (Sankar et al., 2019; Li et al., 2021) shows that these methods fail to fully exploit the conversation history information. In addition, methods based on recurrent neural network suffer
|
| 52 |
+
|
| 53 |
+
from slow inference speed due to the nature of recurrent structures. Although Transformer-based methods (Vaswani et al., 2017) get rid of the weakness of recurrent structure, they are usually plagued by a large number of parameters (Wu et al., 2019), making the training and inference of Transformer-based models require a lot of computational cost. In this paper, we propose a multi-view approach to model dialogue context based on a fully convolutional structure and a lightweight model that is smaller and faster than most existing methods.
|
| 54 |
+
|
| 55 |
+
# 2.2 Convolutional Neural Networks (CNN)
|
| 56 |
+
|
| 57 |
+
For the past few years, CNNs have been the go-to model in computer vision. The main reason is that CNN enjoys the advantage of parameter sharing and is better at modeling local structures. A large number of excellent architectures based on CNN have been proposed (Krizhevsky et al., 2012; He et al., 2016; Dai et al., 2021). For text processing, convolutional structures are good at capturing local dependencies of text and are faster than RNNs (Hochreiter and Schmidhuber, 1997). Therefore, some studies (Wu et al., 2016; Lu et al., 2019; Yuan et al., 2019) employ convolutional structures to aggregate the matching features between dialogue contexts and responses. However, these works usually require combining attention mechanisms or the skeleton structure of RNN with CNNs. Furthermore, these studies treat dialogue context as a flat structure. In this paper, we propose a novel fully convolutional architecture to extract matching features from stereo views, which can simultaneously extract the features with different granularities from different views.
|
| 58 |
+
|
| 59 |
+
# 3 Methodology
|
| 60 |
+
|
| 61 |
+
# 3.1 Problem Formulation
|
| 62 |
+
|
| 63 |
+
In this paper, an instance in the dialogue dataset can be represented as $(C,y)$ , where $C = (u_1,u_2,\ldots ,u_{t - 1},r)$ represents the set of dialogue contexts $(\pmb {u}_1,\pmb {u}_2,\dots ,\pmb{u}_{t - 1})$ and the response $\pmb{r}$ , $\pmb{u_i}$ is the $i$ -th utterance, and $y\in \{0,1\}$ is the class label of $C$ . As the core of retrieval-based dialogue system, the purpose of response selection is to build a discriminator $g(C)$ on $(C,y)$ to measure the matching between the dialogue context and response.
|
| 64 |
+
|
| 65 |
+
# 3.2 Fully Convolutional Matching
|
| 66 |
+
|
| 67 |
+
We propose a fully convolutional encoder for multi-view response selection. Multiple views include embedding view, word view, and utterance view. In the embedding view, the convolution operations are performed on the plane formed by the word sequence dimension and the utterance dimension, and word-level features can be extracted through nonlinear transformations between different embeddings. In the word view, global dialogue context features will be captured by convolution of a contiguous sequence connecting all words, and features of each utterance will be obtained by performing convolution on each utterance. In the utterance view, DialogConv is responsible for capturing the dependency features between different local contexts composed of adjacent utterances. Figure 3 shows an overview of our proposed DialogConv, which consists of six layers: (i) embedding layer; (ii) local matching layer; (iii) context matching layer; (iv) discourse matching layer; (v) aggregation layer; (vi) prediction Layer.
|
| 68 |
+
|
| 69 |
+
Symbol Definition: The embedding layer uses a pretrained word embedding model to map each word in $C$ to a vector space. We stack $C$ chronologically into a 3D tensor $G \in \mathbb{R}^{t \times \ell \times d}$ , where $d$ represents the dimension of word embedding, $\ell$ represents the length of the utterance and $t$ is the number of utterances including the response. $G$ is the input to DialogConv. We use $\mathrm{Conv2D}_{k \times s}^v$ and $\mathrm{Conv1D}_w^v$ to denote the convolution operations, where $\mathrm{Conv2D}_{k \times s}^v$ denotes a two-dimensional convolution with a convolution kernel size of $k \times s$ , $\mathrm{Conv1D}_w^v$ represents a one-dimensional convolution with a convolution kernel size of $w$ , and $v$ represents a specific view. We will describe the details of the remaining layers in the following subsections.
|
| 70 |
+
|
| 71 |
+
# 3.2.1 Local Matching Layer
|
| 72 |
+
|
| 73 |
+
The local matching layer is responsible for extracting features of each utterance. The local matching stage contains features from the embedding and word views. Firstly, we employ $1 \times 1$ convolutions in the embedding view and the word view, respectively. The process can be formally described as:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
G _ {1} = \operatorname {C o n v 2 D} _ {1 \times 1} ^ {\text {e m b e d d i n g}} (\sigma (G)) \tag {1}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
G _ {2} = \operatorname {C o n v 2 D} _ {1 \times 1} ^ {\text {w o r d}} \left(G _ {1}\right) + G \tag {2}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\sigma (\cdot)$ stands for GELUs activation function (Hendrycks and Gimpel, 2016). The $1\times 1$
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 3: Overview of our DialogConv. The conv@ $i$ symbol represents the $i$ -th convolution operation.
|
| 87 |
+
|
| 88 |
+
convolution pays attention to the information of the current element itself and does not consider the influence of local context. The features of individual words will be extracted from the embedding and word views by $1 \times 1$ convolution. Multi-scale convolution (Szegedy et al., 2015; Gao et al., 2019) has been shown to be effective in extracting local features. Therefore, we use a $k_{1} \times s_{1}$ convolution in the word view and a $1 \times 1$ convolution in the embedding view to capture the matching features of each utterance. The formal description is given as follows:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\boldsymbol {G} _ {3} = \operatorname {C o n v 2 D} _ {k _ {1} \times s _ {1}} ^ {\text {w o r d}} \left(\sigma \left(\boldsymbol {G} _ {2}\right)\right) \tag {3}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\boldsymbol {G} _ {4} = \operatorname {C o n v 2 D} _ {1 \times 1} ^ {\text {e m b e d d i n g}} \left(\boldsymbol {G} _ {3}\right) + \boldsymbol {G} _ {2} \tag {4}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Note that we focus on the features of a single utterance in the local matching layer.
|
| 99 |
+
|
| 100 |
+
# 3.2.2 Context Matching Layer
|
| 101 |
+
|
| 102 |
+
The context matching layer is responsible for extracting matching features of the global dialogue context. Firstly, we flatten $G_{4}$ into a two-dimensional tensor $G_{5} \in \mathbb{R}^{(t \times \ell) \times d}$ . This is equivalent to concatenating all utterances in chronological order into one continuous sequence of words. Then, we use convolution across words sequence with kernel size of $w_{1}$ in the embedding view, and kernel size of $w_{2}$ in the word view. Details are as follows:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\boldsymbol {G} _ {6} = \operatorname {C o n v 1 D} _ {w _ {1}} ^ {\text {e m b e d d i n g}} \left(\sigma \left(\boldsymbol {G} _ {5}\right)\right) \tag {5}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
G _ {7} = f _ {\text {r e s h a p e}} \left(\operatorname {C o n v 1 D} _ {w _ {2}} ^ {\text {w o r d}} \left(G _ {6}\right)\right) + G _ {5} (6)
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $f_{\text{reshape}}$ is a function that reshapes the output of the convolution to the same shape as $G_5$ and $G_7 \in \mathbb{R}^{t \times \ell \times d}$ . The features of the global dialogue context can be aggregated by a nonlinear transformation between different words concatenating all utterances. The features of the global context are basis for extracting the dependency features between different local contexts.
|
| 113 |
+
|
| 114 |
+
# 3.2.3 Discourse Matching Layer
|
| 115 |
+
|
| 116 |
+
The discourse matching layer is responsible for capturing the dependencies between different local contexts composed of adjacent utterances. Modeling dependency features is beneficial for capturing changes in implicit topics, intentions, etc. in the dialogue context, which is important for choosing the correct response. We employ orthogonal convolution to extract dynamic dialogue flow features across utterances to capture discourse-level changes. The specific process is formulated as follows:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
G _ {8} = \operatorname {C o n v 2 D} _ {1 \times s _ {2}} ^ {\text {u t t e r a n c e}} (\sigma (G _ {7})) \tag {7}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\boldsymbol {G} _ {9} = \operatorname {C o n v 2 D} _ {s _ {2} \times 1} ^ {\text {u t t e r a n c e}} \left(\boldsymbol {G} _ {8}\right) \tag {8}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\boldsymbol {G} _ {1 0} = \operatorname {C o n v 2 D} _ {1 \times 1} ^ {\text {u t t e r a n c e}} \left(\boldsymbol {G} _ {9}\right) + \boldsymbol {G} _ {7} \tag {9}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where the $1 \times s_2$ convolution and $s_2 \times 1$ convolution are called orthogonal convolutions because the direction of their convolution kernels is vertical. The $1 \times s_2$ convolution is responsible for forming semantic flow based on the context-level features of a single utterance, and the $s_2 \times 1$ convolution extracts discourse structural features according to the depth of dialogue. Finally, we integrate features of utterances through the $1 \times 1$ convolution.
|
| 131 |
+
|
| 132 |
+
# 3.2.4 Aggregation Layer
|
| 133 |
+
|
| 134 |
+
The aggregation layer is responsible for obtaining high-level semantic information by integrating the matching features from previous layers. First, we use max-pooling to obtain the sentence representation $G_{11} \in \mathbb{R}^{t \times d}$ . Then, we employ two layers of convolution to extract matching features along the embedding dimension in the embedding view and the depth of dialogue in the utterance view, respectively. The formulation is as follows:
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\boldsymbol {G} _ {1 2} = \operatorname {C o n v 1 D} _ {w _ {3}} ^ {\text {e m b e d d i n g}} (\boldsymbol {G} _ {1 1}) \tag {10}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\boldsymbol {G} _ {1 3} = \operatorname {C o n v l D} _ {w _ {4}} ^ {\text {u t t e r a n c e}} \left(\boldsymbol {G} _ {1 2}\right) + \boldsymbol {G} _ {1 1} \tag {11}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where $w_{3}$ and $w_{4}$ are the convolution kernel sizes. We again use a max-pooling operation based on $G_{13}$ to obtain the final context representation $O$ .
|
| 145 |
+
|
| 146 |
+
# 3.3 Self-supervised Pre-training
|
| 147 |
+
|
| 148 |
+
As a lightweight neural structure, the performance of DialogConv can be further improved by a pretraining strategy using a small corpus. While the masked language model pretraining (Devlin et al., 2019; Lan et al., 2020) usually requires large-scale corpora, self-supervised contrastive learning can generally learn representations with a relatively small-scale corpus. Therefore, we employ contrastive learning to learn effective representations by pulling semantically close neighbors together and pushing apart non-neighbors (Hadsell et al., 2006). Given a set of paired examples $D = (x_{i}, x_{i}^{+})$ , where $x_{i}$ is the dialogue context $c$ and $x_{i}^{+}$ is the correct response. We adopt the previous contrastive learning framework (Liu and Liu, 2021) and employ a cross-entropy objective, where the negatives $x_{i}^{-}$ include responses with $y = 0$ and in-batch negatives (Chen et al., 2017). The training objective is:
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
L = \log \frac {e ^ {\sin \left(x _ {i} , x _ {i} ^ {+}\right) / \tau}}{\sum_ {j = 1} ^ {| x _ {i} ^ {-} |} e ^ {\sin \left(x _ {i} , x _ {i j} ^ {-}\right) / \tau} + e ^ {\sin \left(x _ {i} , x _ {i} ^ {+}\right) / \tau}} \tag {12}
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where $\tau$ is a temperature hyperparameter, $x_{ij}^{-}$ represents the $j$ -th negative example of $x_{i}, x_{i}^{+}$ represents the positive example of $x_{i}$ , and $sim(\cdot, \cdot)$ is the cosine similarity.
|
| 155 |
+
|
| 156 |
+
# 4 Experiments and Results
|
| 157 |
+
|
| 158 |
+
The baselines are described in the Appendix A.1.
|
| 159 |
+
|
| 160 |
+
# 4.1 Datasets
|
| 161 |
+
|
| 162 |
+
We conduct extensive experiments on four public datasets: (i) Ubuntu Dialogue (Ubuntu) (Lowe et al., 2015); (ii) Multi-Turn Dialogue Reasoning (MuTual) (Cui et al., 2020); (iii) Douban Conversation Corpus (Douban) (Wu et al., 2016); (iv) E-commerce Dialogue Corpus (ECD) (Zhang et al., 2018). Ubuntu consists of 1 million context-response pairs for training, 0.5 million pairs for validation, and 0.5 million pairs for testing. The ratio of the positive and the negative is 1:1 for training, and 1:9 for validation and testing. Douban consists of 1 million context-response pairs for training, 50k pairs for validation, and 10k pairs for testing. Response candidates are retrieved from Sina Weibo
|
| 163 |
+
|
| 164 |
+
and labeled by human judges. ECD contains 1 million context-response pairs for training, 10k pairs for validation, and 10k pairs for testing and consists of five different types of conversations (e.g., commodity consultation, logistics express, recommendation, negotiation and chitchat) based on over 20 commodities. MuTual is the first human-labeled reasoning-based dataset for multi-turn dialogue, which contains 7,088 context-response pairs for training, 886 pairs for validation, and 886 pairs for testing. The ratio of the positive and the negative is 1:3 in the training, validation and test sets.
|
| 165 |
+
|
| 166 |
+
# 4.2 Evaluation Metrics
|
| 167 |
+
|
| 168 |
+
We follow previous research (Zhang and Zhao, 2021) using evaluation metric $\mathrm{Rn}@\mathrm{k}$ to measure model performance on the datasets Ubuntu, Douban and ECD, which calculates the proportion of truly positive responses among the top- $k$ responses selected from a list of $n$ available candidates for a context. In addition, the traditional metrics MAP (Mean Average Precision) (Baeza-Yates and Ribeiro-Neto, 1999) and MRR (Mean Reciprocal Rank) (Voorhees et al., 1999) are employed on Douban. We use recall at position 1 of 4 candidates $(\mathbb{R}@\mathbb{1})$ , recall at position 2 of 4 candidates $(\mathbb{R}@\mathbb{2})$ and MRR on MuTual dataset, following previous study (Liu et al., 2021). The Ubuntu, Douban and ECD test sets provide ten candidate responses, while the MuTual provides four candidate responses, leading them to adopt different evaluation metrics.
|
| 169 |
+
|
| 170 |
+
# 4.3 Implementation Details
|
| 171 |
+
|
| 172 |
+
Model Details: We implement DialogConv using Tensorflow 2 and train DialogConv on a server with an Intel(R) Core(TM) i7-10700 CPU 2.90HZ and a single GeForce RTX 2070 SUPER GPU (8G). In experiments, we consider up to 10 turns and 50 words for the Ubuntu, Douban and ECD datasets, and up to 8 turns and 50 words for the MuTual dataset. The dimension of word embeddings is set to 200. We set the convolution filter sizes $k_{1} = 1$ , $w_{1} = 1$ , $w_{2} = 5$ , $w_{3} = 3$ , $w_{4} = 1$ , $s_{1} = 3$ and $s_{2} = 3$ . Layers 1, 2, 3, 4, 8, 9 and 10 use 2D convolutions, and layers 6, 7, 12 and 13 use 1D convolutions. We set the stride of all convolutional layers to [1, 1] or 1. The filter size of convolution layers 1, 2, 4, 5, 9 and 11 is set to [1, 1]. The filter sizes of the convolution layers 3, 6, 7, 8 and 10 are set to [1, 3], 5, [1, 3], [3, 1] and 3, respectively.
|
| 173 |
+
|
| 174 |
+
Self-supervised Pre-training: We conduct
|
| 175 |
+
|
| 176 |
+
<table><tr><td></td><td colspan="3">Ubuntu (English)</td><td colspan="6">Douban (Chinese)</td></tr><tr><td>Method</td><td>R10@1</td><td>R10@2</td><td>R10@5</td><td>MAP</td><td>MRR</td><td>P@1</td><td>R10@1</td><td>R10@2</td><td>R10@5</td></tr><tr><td>MV-LSTM</td><td>0.653</td><td>0.804</td><td>0.946</td><td>0.498</td><td>0.538</td><td>0.348</td><td>0.202</td><td>0.351</td><td>0.710</td></tr><tr><td>MH-LSTM</td><td>0.653</td><td>0.799</td><td>0.944</td><td>0.500</td><td>0.537</td><td>0.345</td><td>0.202</td><td>0.348</td><td>0.720</td></tr><tr><td>DUA</td><td>0.757</td><td>0.868</td><td>0.962</td><td>0.551</td><td>0.599</td><td>0.421</td><td>0.243</td><td>0.421</td><td>0.780</td></tr><tr><td>DAM</td><td>0.767</td><td>0.874</td><td>0.969</td><td>0.550</td><td>0.601</td><td>0.427</td><td>0.254</td><td>0.410</td><td>0.757</td></tr><tr><td>MRFN</td><td>0.786</td><td>0.886</td><td>0.976</td><td>0.571</td><td>0.617</td><td>0.448</td><td>0.276</td><td>0.435</td><td>0.783</td></tr><tr><td>IMN</td><td>0.794</td><td>0.889</td><td>0.974</td><td>0.570</td><td>0.615</td><td>0.433</td><td>0.262</td><td>0.452</td><td>0.789</td></tr><tr><td>IoI</td><td>0.796</td><td>0.894</td><td>0.974</td><td>0.573</td><td>0.621</td><td>0.444</td><td>0.269</td><td>0.451</td><td>0.786</td></tr><tr><td>MSN</td><td>0.800</td><td>0.899</td><td>0.978</td><td>0.587</td><td>0.632</td><td>0.470</td><td>0.295</td><td>0.452</td><td>0.788</td></tr><tr><td>BERT-2-128</td><td>0.647</td><td>0.767</td><td>0.911</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BERT-4-256</td><td>0.706</td><td>0.809</td><td>0.932</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BERT-4-512</td><td>0.757</td><td>0.869</td><td>0.966</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BERT-8-512</td><td>0.788</td><td>0.888</td><td>0.978</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>BERT-12-768</td><td>0.808</td><td>0.897</td><td>0.975</td><td>0.591</td><td>0.633</td><td>0.454</td><td>0.280</td><td>0.470</td><td>0.828</td></tr><tr><td>DBERT-6-768</td><td>0.783</td><td>0.879</td><td>0.968</td><td>0.542</td><td>0.592</td><td>0.418</td><td>0.249</td><td>0.407</td><td>0.765</td></tr><tr><td>TBERT-4-312</td><td>0.638</td><td>0.766</td><td>0.922</td><td>0.532</td><td>0.567</td><td>0.378</td><td>0.235</td><td>0.397</td><td>0.742</td></tr><tr><td>TBERT-6-768</td><td>0.729</td><td>0.835</td><td>0.954</td><td>0.559</td><td>0.597</td><td>0.413</td><td>0.257</td><td>0.417</td><td>0.796</td></tr><tr><td>DialogConv</td><td>0.788</td><td>0.883</td><td>0.979</td><td>0.571</td><td>0.624</td><td>0.432</td><td>0.272</td><td>0.453</td><td>0.785</td></tr><tr><td>DialogConv*</td><td>0.801</td><td>0.904</td><td>0.976</td><td>0.572</td><td>0.634</td><td>0.457</td><td>0.282</td><td>0.452</td><td>0.825</td></tr></table>
|
| 177 |
+
|
| 178 |
+
Table 1: Results on Ubuntu and Douban datasets. The first, second and third groups of models belong to the Concatenated Pattern, Separate Pattern and PrLM-based Pattern, respectively. DialogConv* represents the performance when pretraining with contrastive learning. **Bold** indicates the best result, and **underline** indicates the second best result. $X$ represents the number of layers and $Y$ represents the hidden size of the model in BERT- $X-Y$ , DBERT- $X-Y$ and TBERT- $X-Y$ . TBERT stands for TinyBERT, and DBERT stands for DistilBERT. The ‘-’ indicates no corresponding BERT version is available.
|
| 179 |
+
|
| 180 |
+
<table><tr><td></td><td colspan="3">ECD (Chinese)</td><td colspan="3">MuTual (English)</td></tr><tr><td>Method</td><td>R10@1</td><td>R10@2</td><td>R10@5</td><td>R@1</td><td>R@2</td><td>MRR</td></tr><tr><td>MV-LSTM</td><td>0.412</td><td>0.591</td><td>0.857</td><td>-</td><td>-</td><td>-</td></tr><tr><td>QANET</td><td>0.455</td><td>0.662</td><td>0.920</td><td>0.247</td><td>0.517</td><td>0.522</td></tr><tr><td>BIDAF</td><td>0.491</td><td>0.708</td><td>0.933</td><td>0.357</td><td>0.589</td><td>0.589</td></tr><tr><td>MH-LSTM</td><td>0.410</td><td>0.590</td><td>0.858</td><td>-</td><td>-</td><td>-</td></tr><tr><td>DL2R</td><td>0.399</td><td>0.571</td><td>0.842</td><td>-</td><td>-</td><td>-</td></tr><tr><td>DUA</td><td>0.501</td><td>0.700</td><td>0.921</td><td>0.437</td><td>0.698</td><td>0.658</td></tr><tr><td>DAM</td><td>0.526</td><td>0.727</td><td>0.933</td><td>0.458</td><td>0.718</td><td>0.673</td></tr><tr><td>IMN</td><td>0.621</td><td>0.797</td><td>0.964</td><td>0.404</td><td>0.622</td><td>0.638</td></tr><tr><td>IoI</td><td>0.563</td><td>0.768</td><td>0.950</td><td>0.421</td><td>0.686</td><td>0.647</td></tr><tr><td>MSN</td><td>0.606</td><td>0.770</td><td>0.937</td><td>0.420</td><td>0.677</td><td>0.646</td></tr><tr><td>BERT-2-128</td><td>-</td><td>-</td><td>-</td><td>0.520</td><td>0.765</td><td>0.715</td></tr><tr><td>BERT-4-256</td><td>-</td><td>-</td><td>-</td><td>0.558</td><td>0.800</td><td>0.742</td></tr><tr><td>BERT-4-512</td><td>-</td><td>-</td><td>-</td><td>0.607</td><td>0.837</td><td>0.772</td></tr><tr><td>BERT-8-512</td><td>-</td><td>-</td><td>-</td><td>0.619</td><td>0.816</td><td>0.774</td></tr><tr><td>BERT-12-768</td><td>0.610</td><td>0.814</td><td>0.973</td><td>0.648</td><td>0.847</td><td>0.795</td></tr><tr><td>DBERT-6-768</td><td>0.517</td><td>0.695</td><td>0.885</td><td>0.602</td><td>0.836</td><td>0.769</td></tr><tr><td>TBERT-4-312</td><td>0.449</td><td>0.583</td><td>0.854</td><td>0.534</td><td>0.778</td><td>0.724</td></tr><tr><td>TBERT-6-768</td><td>0.587</td><td>0.794</td><td>0.953</td><td>0.615</td><td>0.833</td><td>0.785</td></tr><tr><td>DialogConv</td><td>0.827</td><td>0.889</td><td>0.962</td><td>0.602</td><td>0.834</td><td>0.769</td></tr><tr><td>DialogConv*</td><td>0.844</td><td>0.891</td><td>0.963</td><td>0.622</td><td>0.854</td><td>0.782</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Table 2: Results on ECD and MuTual datasets. The '-' indicates no corresponding BERT version is available.
|
| 183 |
+
|
| 184 |
+
small-scale pretraining on the training set of downstream tasks through contrastive learning, such as Ubuntu and Douban. Negative instances include not only negative examples provided by the dataset, but also candidate responses from other instances in the same batch. We use the Stochastic Gradient Descent (SGD) optimizer (Bottou, 2012) in the
|
| 185 |
+
|
| 186 |
+
self-supervised pretraining phase. We set the batch size to 128, the learning rates to 0.001, and the temperature $\tau$ to 0.007.
|
| 187 |
+
|
| 188 |
+
Fine-tuning: During the fine-tuning phase, we train DialogConv and other models using the Adam optimizer (Kingma and Ba, 2015). The learning rates are initialized to $1e-3$ , $5e-4$ , $1e-4$ , $5e-5$ and $1e-5$ via a multi-step strategy. The batch size is set to 32 for the MuTual dataset and 64 for the other datasets. The values of the above hyperparameters are all fixed using the validation set.
|
| 189 |
+
|
| 190 |
+
# 4.4 Results of Effectiveness
|
| 191 |
+
|
| 192 |
+
Tables 1 and 2 report the test results of DialogConv and all compared models on the four datasets. While DialogConv does not achieve the best performance, the model attains near-optimal results in most cases. Furthermore, we calculate the confidence level $(p < 0.05)$ of DialogConv compared to BERT $_{base}$ (i.e., BERT-12-768), which shows that the results of DialogConv are credible.
|
| 193 |
+
|
| 194 |
+
As shown in Table 1, DialogConv outperforms most classic models such as DUA and DAM, and achieves comparable performance to MRFN on the Ubuntu dataset. DialogConv also outperforms other lightweight variants of BERT such as DBETR-6-768 (i.e., DistilBERT-6-768) and
|
| 195 |
+
|
| 196 |
+
<table><tr><td rowspan="2">Model</td><td colspan="4">Inference Time (CPU/GPU)</td><td colspan="4">Parameters (M)</td></tr><tr><td>Ubuntu (m)</td><td>Douban (s)</td><td>ECD (s)</td><td>MuTual (s)</td><td>Ubuntu</td><td>Douban</td><td>ECD</td><td>MuTual</td></tr><tr><td>DAM</td><td>177/45</td><td>227/68</td><td>227/66</td><td>91/38</td><td>95</td><td>67</td><td>13</td><td>8</td></tr><tr><td>DUA</td><td>143/49</td><td>176/64</td><td>175/64</td><td>64/26</td><td>96</td><td>70</td><td>16</td><td>15</td></tr><tr><td>IOI</td><td>347/39</td><td>421/49</td><td>429/47</td><td>157/22</td><td>96</td><td>69</td><td>15</td><td>10</td></tr><tr><td>MSN</td><td>105/13</td><td>128/17</td><td>126/14</td><td>45/7</td><td>89</td><td>62</td><td>11</td><td>13</td></tr><tr><td>BERT-2-128</td><td>54/14</td><td>-</td><td>-</td><td>24/9</td><td>4</td><td>-</td><td>-</td><td>4</td></tr><tr><td>BERT-4-256</td><td>352/37</td><td>-</td><td>-</td><td>81/12</td><td>11</td><td>-</td><td>-</td><td>11</td></tr><tr><td>BERT-4-512</td><td>1372/53</td><td>-</td><td>-</td><td>339/24</td><td>29</td><td>-</td><td>-</td><td>29</td></tr><tr><td>BERT-8-512</td><td>3174/82</td><td>-</td><td>-</td><td>667/42</td><td>41</td><td>-</td><td>-</td><td>41</td></tr><tr><td>BERT-12-768</td><td>8991/219</td><td>4922/240</td><td>4681/239</td><td>1694/98</td><td>110</td><td>102</td><td>102</td><td>110</td></tr><tr><td>DBERT-6-768</td><td>1339/83</td><td>1591/92</td><td>1612/87</td><td>595/33</td><td>67</td><td>54</td><td>54</td><td>67</td></tr><tr><td>TBERT-4-312</td><td>376/34</td><td>450/35</td><td>445/30</td><td>165/13</td><td>14</td><td>11</td><td>11</td><td>14</td></tr><tr><td>DialogConv</td><td>13/5</td><td>18/7</td><td>16/7</td><td>7/3</td><td>23</td><td>13</td><td>9</td><td>4</td></tr></table>
|
| 197 |
+
|
| 198 |
+
Table 3: Comparison of model inference time and the scale of parameters. "m" ("s") stands for minutes (seconds). The number of parameters of Chinese and English BERT is different because their vocabularies differ. The '-' indicates no corresponding BERT version is available.
|
| 199 |
+
|
| 200 |
+
TBERT-6-768 (i.e., TinyBETR-6-768). When pretrained with contrastive learning, DialogConv performs close to BERT-12-768 and even outperforms BERT-12-768 on R10@2. On the Douban dataset, the performance of DialogConv is $2.3\%$ lower than the best result on R10@1. However, the performance of pretrained DialogConv can achieve nearoptimal results.
|
| 201 |
+
|
| 202 |
+
In Table 2, compared to BERT-12-768, DialogConv has a huge advantage of $21.7\%$ on R10@1 and $7.5\%$ higher on R10@2, is much better than other variants of BERT. We will discuss this phenomenon in Section 4.7. DialogConv outperforms some classic retrieval-based dialogue models such as DAM and MSN, and is close to some lightweight BERT variants such as DBERT-6-768 and BERT-4-512. Compared to BERT-12-768, DialogConv is $2.6\%$ lower on R10@1 on the MuTual. We believe that the lower performance of DialogConv on MuTual is caused by a limitation of DialogConv itself, which we will discuss in detail in Section 4.7.
|
| 203 |
+
|
| 204 |
+
# 4.5 Model Efficiency
|
| 205 |
+
|
| 206 |
+
To measure the complexity of our base model, we analyze the actual inference time of the model on CPU and GPU, as well as the number of parameters, as shown in Table 3. DialogConv a huge speed advantage over other models, no matter on CPU or GPU. For example, on the Ubuntu dataset, DialogConv $4.19 \times$ to $115.67 \times$ faster on CPU and $2.39 \times$ to $11.64 \times$ faster on GPU, and the average inference speed is $115.67 \times$ faster on CPU and $11.64 \times$ faster on GPU than other models. On all four bench
|
| 207 |
+
|
| 208 |
+
mark datasets, the inference speed of DialogConv is on average $79.39 \times$ faster on CPU and $10.64 \times$ faster on GPU compared to other models. Overall, the gain of inference speed ranges from $1.97 \times$ to $40.61 \times$ on GPU and from $3.47 \times$ to $697.00 \times$ on CPU. The CPU and GPU devices are described in the Implementation Details 4.3 subsection above.
|
| 209 |
+
|
| 210 |
+
The average number of parameters of DialogConv on the four benchmark datasets is 12.4 million, which is $2.8 \times$ larger than BERT-2-128, $1.1 \times$ than BERT-4-256, and comparable to TBERT-4-312. However, DialogConv has clear advantages in performance and inference time over these models. Compared to TBERT-6-768 and DBERT-7-768, the average number of parameters of DialogConv is $4.9 \times$ and $5.1 \times$ smaller, respectively. Compared with BERT-12-768, the average number of parameters of DialogConv on four datasets is $8.5 \times$ smaller. As compared to the classic models DUA, DAM, IOI and MSN, DialogConv needs approximately $3.5 \times$ less parameters. Overall, DialogConv achieves promising results in both performance and inference time, but relies on generally less parameters. The main reason is that convolutional structure enjoys the advantage of shared parameters, which make DialogConv have fewer parameters compared to other models based on RNN or attention mechanism.
|
| 211 |
+
|
| 212 |
+
# 4.6 Ablation Study
|
| 213 |
+
|
| 214 |
+
Table 4 reports the result of module ablation. 1) -LocM removes the local matching layer; 2) -ConM removes the context matching layer; 3) -DisM removes the discourse matching layer; 4) -Agg replaces the aggregation layer with max-pooling.
|
| 215 |
+
|
| 216 |
+
<table><tr><td></td><td colspan="3">MuTual (English)</td><td colspan="3">ECD (Chinese)</td></tr><tr><td>Setting</td><td>R@1</td><td>R@2</td><td>MRR</td><td>R10@1</td><td>R10@2</td><td>R10@5</td></tr><tr><td>DialogConv</td><td>0.614</td><td>0.825</td><td>0.778</td><td>0.833</td><td>0.901</td><td>0.988</td></tr><tr><td>-LocM</td><td>0.580</td><td>0.786</td><td>0.754</td><td>0.813</td><td>0.881</td><td>0.958</td></tr><tr><td>-ConM</td><td>0.577</td><td>0.801</td><td>0.759</td><td>0.806</td><td>0.823</td><td>0.919</td></tr><tr><td>-DisM</td><td>0.578</td><td>0.785</td><td>0.753</td><td>0.810</td><td>0.845</td><td>0.910</td></tr><tr><td>-Agg</td><td>0.573</td><td>0.783</td><td>0.750</td><td>0.804</td><td>0.824</td><td>0.870</td></tr></table>
|
| 217 |
+
|
| 218 |
+
Table 4: Ablation results on validation set.
|
| 219 |
+
|
| 220 |
+
We can observe that each submodule plays a vital role in DialogConv. Specifically, the local matching layer captures the features of each utterance by mixing the features from the embedding and word views. The context matching layer updates the matching features based on the entire dialogue context and response. The discourse matching layer extracts the dependencies between different local contexts composed of adjacent utterances. Comparatively, it seems that the local matching layer has a little less impact on the model performance than the other layers. We conjecture that the layer can only extract local features to some extent since convolution is better at capturing local features.
|
| 221 |
+
|
| 222 |
+
# 4.7 Result Analysis and Discussion
|
| 223 |
+
|
| 224 |
+
BERT-12-768 is a representative BERT base version among other BERT variants. Therefore, we use it as the basic comparison model. In Table 2, DialogConv has an absolute advantage of $21.7\%$ on R10@1 and $7.5\%$ on R10@2 compared with BERT-12-768 on ECD. We believe that there are three main reasons for this phenomenon. First, DialogConv focuses on matching, which can extract matching features from stereoscopic views. We visualize the convolution results of each layer of dialogConv as a heatmap (Figure 4 in Appendix A.2). According to the heatmap, DialogConv can capture key matching features between dialogue context and response. The local matching layer mainly focuses on the features between words. This is because we use $1 \times 1$ convolution in the conv@1 and conv@2 layers while matching features appear between several overlapping words in the two layers. When we use larger convolution kernels, DialogConv starts to focus on matching features between phrases. A similar phenomenon can be observed in the context matching layer. We can see that after the local and global features are extracted by the discourse matching layer, some important features are clearly captured. Second, for ECD, the average overlap of keywords between response
|
| 225 |
+
|
| 226 |
+
and context reaches about $40\%$ , which is beneficial for DialogConv to extract matching features from multi-view stereos. Third, ECD is a dataset in the domain of e-commerce. The domain-specific performance of BERT-12-768 may be mediocre because the pre-training corpora of BERT-12-768 is domain-agnostic.
|
| 227 |
+
|
| 228 |
+
In Table 2, DialogConv achieves relatively insufficient performance on MuTual. We believe the main reason is that Mutual is a human-labeled reasoning dataset for multi-turn dialogues. However, DialogConv focuses on matching between dialogue context and response, and lacks reasoning ability. Therefore, DialogConv cannot make a correct predictions on reasoning-oriented examples in MuTual. Figure 5 (in Appendix A.2) demonstrates the convolutional heatmap visualization of DialogConv on MuTual. According to the heatmap, DialogConv erroneously focuses on the features of "and", "their" and "in" in the dialogue context, and dose not consider "5" and "7" as key features.
|
| 229 |
+
|
| 230 |
+
DialogConv can effectively exploit the dependencies between different local contexts composed of adjacent utterances. To reveal its capabilities in this regard, we perturb the dialogue structure by randomly perturbing the dialogue context and report the results in Table 6 and Table 7 (in Appendix). We can see that the performance of DialogConv degrades to varying degrees on the four benchmark datasets. Specifically, the performance drops by $12.9\%$ R10@1 on Ubuntu, $12\%$ R10@1 on Douban, $17.7\%$ R10@1 on ECD, and $7.4\%$ R@1 on MuTual. We speculate that the dialogue structure contains the dependencies between different local contexts, which is important for multi-turn response selection. When perturbing the dialog stecture, the dependencies between local contexts will be severely broken, resulting in performance degradation of DialogConv.
|
| 231 |
+
|
| 232 |
+
# 5 Conclusion
|
| 233 |
+
|
| 234 |
+
In this paper, we propose DialogConv, a multi-view lightweight architecture based exclusively on CNN. DialogConv conducts convolutions on embedding, word, and utterance views to capture matching features. Experiment results show that DialogConv has fewer parameters, is faster, and requires less computing resources to achieve competitive results on four benchmark datasets. DialogConv provides a valuable reference for the dialogue system being deployed in real-world scenarios.
|
| 235 |
+
|
| 236 |
+
# 6 Limitations
|
| 237 |
+
|
| 238 |
+
Although our work can achieve competitive results with less computing resources, we acknowledge some limitations of our study. Firstly, DialogConv focuses on matching, resulting in insufficient reasoning ability. Therefore, DialogConv has a lot of room for improvement in the performance of dialogue reasoning (on the MuTual dataset). Secondly, we did not explore the performance of deep DialogConv. Our study mainly focuses on designing a lightweight model, ignoring the potential heavy-duty DialogConv under the blessing of large-scale training corpora. We will explore the performance potential of deep DialogConv in future work.
|
| 239 |
+
|
| 240 |
+
# 7 Acknowledgement
|
| 241 |
+
|
| 242 |
+
We would like to thank the reviewers for their constructive comments. The project is supported by the National Natural Science Foundation of China (61872074, 62172086, 62106039, 62272092).
|
| 243 |
+
|
| 244 |
+
# References
|
| 245 |
+
|
| 246 |
+
Ricardo A. Baeza-Yates and Berthier Ribeiro-Neto. 1999. Modern Information Retrieval.
|
| 247 |
+
Dzmitry Bahdanau, Kyung Hyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In 3rd International Conference on Learning Representations, ICLR 2015.
|
| 248 |
+
Léon Bottou. 2012. Stochastic gradient descent tricks. In Neural networks: Tricks of the trade, pages 421-436. Springer.
|
| 249 |
+
Ting Chen, Yizhou Sun, Yue Shi, and Liangjie Hong. 2017. On sampling strategies for neural network-based collaborative filtering. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 767-776.
|
| 250 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gülcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using rn encoder-decoder for statistical machine translation. In EMNLP.
|
| 251 |
+
Leyang Cui, Yu Wu, Shujie Liu, Yue Zhang, and Ming Zhou. 2020. Mutual: A dataset for multi-turn dialogue reasoning. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1406-1416.
|
| 252 |
+
Zihang Dai, Hanxiao Liu, Quoc Le, and Mingxing Tan. 2021. Coatnet: Marrying convolution and attention for all data sizes. Advances in Neural Information Processing Systems, 34.
|
| 253 |
+
|
| 254 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In *NAACL-HLT* 2019: Annual Conference of the North American Chapter of the Association for Computational Linguistics, pages 4171–4186.
|
| 255 |
+
Shanghua Gao, Ming-Ming Cheng, Kai Zhao, Xin-Yu Zhang, Ming-Hsuan Yang, and Philip HS Torr. 2019. Res2net: A new multi-scale backbone architecture. IEEE transactions on pattern analysis and machine intelligence.
|
| 256 |
+
Jia-Chen Gu, Tianda Li, Quan Liu, Zhen-Hua Ling, Zhiming Su, Si Wei, and Xiaodan Zhu. 2020. Speaker-aware bert for multi-turn response selection in retrieval-based chatbots. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, pages 2041-2044.
|
| 257 |
+
Jia-Chen Gu, Zhen-Hua Ling, and Quan Liu. 2019. Interactive matching network for multi-turn response selection in retrieval-based chatbots. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management, pages 2321-2324.
|
| 258 |
+
R. Hadsell, S. Chopra, and Y. LeCun. 2006. Dimensionality reduction by learning an invariant mapping. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06), volume 2, pages 1735-1742.
|
| 259 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778.
|
| 260 |
+
Dan Hendrycks and Kevin Gimpel. 2016. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415.
|
| 261 |
+
Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. *Neural computation*, 9(8):1735-1780.
|
| 262 |
+
Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. 2020. Tinybert: Distilling bert for natural language understanding. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4163-4174.
|
| 263 |
+
Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In International Conference on Learning Representations (Poster).
|
| 264 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. 2012. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097-1105.
|
| 265 |
+
Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. 2020. Albert: A lite bert for self-supervised learning of language representations. In ICLR 2020: Eighth
|
| 266 |
+
|
| 267 |
+
International Conference on Learning Representations.
|
| 268 |
+
Zekang Li, Jinchao Zhang, Zhengcong Fei, Yang Feng, and Jie Zhou. 2021. Conversations are not flat: Modeling the dynamic information flow across dialogue utterances. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 128-138.
|
| 269 |
+
Yixin Liu and Pengfei Liu. 2021. Simcls: A simple framework for contrastive learning of abstractive summarization. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 1065-1072.
|
| 270 |
+
Yongkang Liu, Shi Feng, Daling Wang, Kaisong Song, Feiliang Ren, and Yifei Zhang. 2021. A graph reasoning network for multi-turn response selection via customized pre-training. Proceedings of the AAAI Conference on Artificial Intelligence, 35(15):13433-13442.
|
| 271 |
+
Ryan Lowe, Nissan Pow, Iulian Vlad Serban, and Joelle Pineau. 2015. The ubuntu dialogue corpus: A large dataset for research in unstructured multi-turn dialogue systems. In Proceedings of the 16th Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 285-294.
|
| 272 |
+
Junyu Lu, Chenbin Zhang, Zeying Xie, Guang Ling, Tom Chao Zhou, and Zenglin Xu. 2019. Constructing interpretive spatio-temporal features for multi-turn responses selection. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 44-50.
|
| 273 |
+
Victor Sanh, Lysandre Debut, Julien Chaumont, and Thomas Wolf. 2019. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108.
|
| 274 |
+
Chinnadhurai Sankar, Sandeep Subramanian, Christopher Pal, Sarath Chandar, and Yoshua Bengio. 2019. Do neural dialog systems use the conversation history effectively? an empirical study. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 32-37.
|
| 275 |
+
Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. 2017. Bidirectional attention flow for machine comprehension. In *ICLR 2017: International Conference on Learning Representations* 2017.
|
| 276 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. 2015. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1-9.
|
| 277 |
+
|
| 278 |
+
Ming Tan, Cicero dos Santos, Bing Xiang, and Bowen Zhou. 2015. Lstm-based deep learning models for non-factoid answer selection. arXiv preprint arXiv:1511.04108.
|
| 279 |
+
Chongyang Tao, Jiazhan Feng, Rui Yan, Wei Wu, and Daxin Jiang. 2021. A survey on response selection for retrieval-based dialogues. IJCAI.
|
| 280 |
+
Chongyang Tao, wei wu, Can Xu, Wenpeng Hu, Dongyan Zhao, and Rui Yan. 2019. One time of interaction may not be enough: Go deep with an interaction-over-interaction network for response selection in dialogues. In ACL 2019: The 57th Annual Meeting of the Association for Computational Linguistics, pages 1-11.
|
| 281 |
+
Chongyang Tao, Wei Wu, Can Xu, Wenpeng Hu, Dongyan Zhao, and Rui Yan. 2019. Multi-representation fusion network for multi-turn response selection in retrieval-based chatbots. In Proceedings of the twelfth ACM international conference on web search and data mining, pages 267-275.
|
| 282 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30.
|
| 283 |
+
Ellen M Voorhees et al. 1999. The trec-8 question answering track report. In Trec, volume 99, pages 77-82.
|
| 284 |
+
Shengxian Wan, Yanyan Lan, Jiafeng Guo, Jun Xu, Liang Pang, and Xueqi Cheng. 2016. A deep architecture for semantic matching with multiple positional sentence representations. In Proceedings of the AAAI Conference on Artificial Intelligence, 1.
|
| 285 |
+
Shuohang Wang and Jing Jiang. 2016. Machine comprehension using match-lstm and answer pointer. arXiv preprint arXiv:1608.07905.
|
| 286 |
+
Yu Wu, Wei Wu, Chen Xing, Ming Zhou, and Zhoujun Li. 2016. Sequential matching network: A new architecture for multi-turn response selection in retrieval-based chatbots. arXiv preprint arXiv:1612.01627.
|
| 287 |
+
Yu Wu, Wei Wu, Chen Xing, Ming Zhou, and Zhoujun Li. 2017. Sequential matching network: A new architecture for multi-turn response selection in retrieval-based chatbots. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 496-505.
|
| 288 |
+
Zhanghao Wu, Zhijian Liu, Ji Lin, Yujun Lin, and Song Han. 2019. Lite transformer with long-short range attention. In International Conference on Learning Representations.
|
| 289 |
+
Rui Yan, Yiping Song, and Hua Wu. 2016. Learning to respond with deep neural networks for retrieval-based human-computer conversation system. In Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, pages 55-64.
|
| 290 |
+
|
| 291 |
+
Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui Zhao, Kai Chen, Mohammad Norouzi, and Quoc V. Le. 2018. Qanet: Combining local convolution with global self-attention for reading comprehension. In International Conference on Learning Representations.
|
| 292 |
+
Chunyuan Yuan, Wei Zhou, Mingming Li, Shangwen Lv, Fuqing Zhu, Jizhong Han, and Songlin Hu. 2019. Multi-hop selector network for multi-turn response selection in retrieval-based chatbots. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 111-120.
|
| 293 |
+
Zhuosheng Zhang, Jiangtong Li, Pengfei Zhu, Hai Zhao, and Gongshen Liu. 2018. Modeling multi-turn conversation with deep utterance aggregation. In Proceedings of the 27th International Conference on Computational Linguistics, pages 3740-3752.
|
| 294 |
+
Zhuosheng Zhang and Hai Zhao. 2021. Advances in multi-turn dialogue comprehension: A survey. arXiv preprint arXiv:2103.03125.
|
| 295 |
+
Xiangyang Zhou, Daxiang Dong, Hua Wu, Shiqi Zhao, Dianhai Yu, Hao Tian, Xuan Liu, and Rui Yan. 2016. Multi-view response selection for human-computer conversation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 372-381.
|
| 296 |
+
Xiangyang Zhou, Lu Li, Daxiang Dong, Yi Liu, Ying Chen, Wayne Xin Zhao, Dianhai Yu, and Hua Wu. 2018. Multi-turn response selection for chatbots with deep attention matching network. In ACL 2018: 56th Annual Meeting of the Association for Computational Linguistics, volume 1, pages 1118-1127.
|
| 297 |
+
Xiangyang Zhou, Lu Li, Daxiang Dong, Yi Liu, Ying Chen, Wayne Xin Zhao, Dianhai Yu, and Hua Wu. 2018. Multi-turn response selection for chatbots with deep attention matching network. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1118-1127.
|
| 298 |
+
|
| 299 |
+
# A Appendix
|
| 300 |
+
|
| 301 |
+
# A.1 Baselines
|
| 302 |
+
|
| 303 |
+
MV-LSTM (Wan et al., 2016) is a semantic matching method based on LSTM. QANET (Yu et al., 2018) is a machine reading comprehension method based on CNN. MH-LSTM (Wang and Jiang, 2016) is an extractive machine reading comprehension model based on LSTM. BIDAF (Seo et al., 2017) is a machine reading comprehension model based on bi-directional attention flow. Multi-View (Zhou et al., 2016) is a multi-turn dialogue retrieval-based method based on token view and
|
| 304 |
+
|
| 305 |
+
utterance view. DL2R (Yan et al., 2016) is a multi-turn retrieval-based dialogue model based on sentence pair matching. DUA (Zhang et al., 2018) is a hierarchical interaction model based on attention mechanism. DAM (Zhou et al., 2018) is a deep interaction method based on attention. IMN (Gu et al., 2019) is a retrieval-based dialogue model with bi-directional matching. MRFN (Tao et al., 2019) is a retrieval-based dialogue model with multiple types of representations. IoI (Tao et al., 2019) is a retrieval-based dialogue model based on multiple interactions. MSN (Yuan et al., 2019) is a retrieval-based dialogue model with multi-hop selector mechanism.
|
| 306 |
+
|
| 307 |
+
BERT (Devlin et al., 2019) is an autoencoding language model based on transformer. Here we employ multiple BERT versions including BERT-2-128 (two layers with hidden size 128), BERT-4-256 (four layers with hidden size 256), BERT-4-512, BERT-8-512 and BERT-12-768. TinyBERT (Jiao et al., 2020) is compressed BERT through a two-stage distillation technique. TinyBERT includes the officially releases TinyBERT-3-312 (short for TBERT-3-312) and TinyBERT-6-768 (short for TBERT-6-768) in Chinese and English. DistilBERT (Sanh et al., 2019) is a distilled version of BERT. DistilBERT includes the officially releases DistilBERT-6-768 (short for DBERT-6-768) in Chinese and English. Notationwise, we use $X$ to represent the number of layers and $Y$ represent the hidden size in BERT- $X-Y$ , DBERT- $X-Y$ and TBERT- $X-Y$ .
|
| 308 |
+
|
| 309 |
+
# A.2 Heatmap Visualization
|
| 310 |
+
|
| 311 |
+
Figure 4 and Figure 5 demonstrate example convolutional heatmap visualizations for each layer of DialogConv from datasets Mutual and ECD, respectively. Table 5 demonstrates the comparison between Chinese and English of an example of Ecomm. We obtain the heatmaps in Figure 5 and 4 through visualizing the similarity matrix between response and dialogue context. The larger the value of the similarity matrix, the brighter the corresponding visualization result, and the more important the corresponding word is. According to Figure 4, DialogConv can capture the key features in dialogue context and response such as "not" (不是或非), "quality" (质量), "problem" (问题). We can conclude that DialogConv makes decision based on the matching features between dialogue context and responses. According to Figure 5, DialogConv mis
|
| 312 |
+
|
| 313 |
+
<table><tr><td></td><td>Chinese</td><td>English</td></tr><tr><td rowspan="3">context</td><td>我提前问你了吧</td><td>I asked you in advance.</td></tr><tr><td>这不是质量问题哦</td><td>It's not a quality problem.</td></tr><tr><td>我要小的又不能用而且这么多包</td><td>I want small and unusable, and so many bags.</td></tr><tr><td rowspan="2">response</td><td>非质量问题退回的</td><td>For non-quality problems returned</td></tr><tr><td>运费亲自理</td><td>the freight will be handled by yourself</td></tr></table>
|
| 314 |
+
|
| 315 |
+
Table 5: An example of a Chinese-English aligned of ECD dataset.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 4: An example of visualization heatmap from ECD. The conv@i represents the i-th convolution operation in Figure 3. The horizontal axis represents the dialogue history, and the vertical axis represents the response. The English translation refers to Table 5.
|
| 319 |
+
|
| 320 |
+
takenly considers "their", "them", "see", and "i" as important features and ignores the key features "5" and "7" in the dialogue context.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 5: An example of visualization heatmap from Mutual. The conv@i represents the i-th convolution operation in Figure 3. The horizontal axis represents the dialogue history, and the vertical axis represents the response.
|
| 324 |
+
|
| 325 |
+
<table><tr><td></td><td colspan="3">Ubuntu (English)</td><td colspan="6">Douban (Chinese)</td></tr><tr><td>Types</td><td>R10@1</td><td>R10@2</td><td>R10@5</td><td>MAP</td><td>MRR</td><td>P@1</td><td>R10@1</td><td>R10@2</td><td>R10@5</td></tr><tr><td>Norm</td><td>0.788</td><td>0.883</td><td>0.979</td><td>0.571</td><td>0.624</td><td>0.432</td><td>0.272</td><td>0.453</td><td>0.785</td></tr><tr><td>Rand</td><td>0.659</td><td>0.781</td><td>0.948</td><td>0.422</td><td>0.458</td><td>0.267</td><td>0.152</td><td>0.270</td><td>0.630</td></tr></table>
|
| 326 |
+
|
| 327 |
+
Table 6: Performance of DialogConv with normal/perturbed dialogue structure on Ubuntu and Douban. Norm represents the normal dialogue structure. Rand represents the perturbing dialogue structure by shuffling the dialogue context randomly.
|
| 328 |
+
|
| 329 |
+
<table><tr><td></td><td colspan="3">ECD (Chinese)</td><td colspan="3">MuTual (English)</td></tr><tr><td>Types</td><td>R10@1</td><td>R10@2</td><td>R10@5</td><td>R@1</td><td>R@2</td><td>MRR</td></tr><tr><td>Norm</td><td>0.827</td><td>0.889</td><td>0.962</td><td>0.602</td><td>0.834</td><td>0.769</td></tr><tr><td>Rand</td><td>0.650</td><td>0.780</td><td>0.946</td><td>0.528</td><td>0.761</td><td>0.686</td></tr></table>
|
| 330 |
+
|
| 331 |
+
Table 7: Performance of DialogConv with normal/perturbed dialogue structure on ECD and MuTual. Norm represents the normal dialogue structure. Rand represents the perturbing dialogue structure by shuffling the dialogue context randomly.
|
dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87ac729d81e34498ca8a82b06097a9399532c2a1b03e0169dc60749e4ac6ac2f
|
| 3 |
+
size 764865
|
dialogconvalightweightfullyconvolutionalnetworkformultiviewresponseselection/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57ea3523a498e9c5567d59beea04c8e0eda956f169b4ca4c46234ed8933f01f4
|
| 3 |
+
size 425678
|
dictionaryassistedsupervisedcontrastivelearning/9f0f0466-a979-45df-aae4-a528f89ede32_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:07b302cefc77088711ddc57648d33224323518758fb75a0dd9e0c5e8111e5264
|
| 3 |
+
size 122777
|
dictionaryassistedsupervisedcontrastivelearning/9f0f0466-a979-45df-aae4-a528f89ede32_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c61589383b544a31c7dd1c19ba99504b9dfb602e6774e9436b82aca05a1057e
|
| 3 |
+
size 151858
|
dictionaryassistedsupervisedcontrastivelearning/9f0f0466-a979-45df-aae4-a528f89ede32_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:41cf636e11ba53bdee126029e14109bf03677edd223abf06491533ae993e4a73
|
| 3 |
+
size 923304
|
dictionaryassistedsupervisedcontrastivelearning/full.md
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dictionary-Assisted Supervised Contrastive Learning
|
| 2 |
+
|
| 3 |
+
Patrick Y. Wu $^{1}$ , Richard Bonneau $^{1,2,4,5}$ , Joshua A. Tucker $^{1,2,3}$ , and Jonathan Nagler $^{1,2,3}$
|
| 4 |
+
|
| 5 |
+
<sup>1</sup> Center for Social Media and Politics, New York University
|
| 6 |
+
|
| 7 |
+
$^{2}$ Center for Data Science, New York University
|
| 8 |
+
|
| 9 |
+
$^{3}$ Department of Politics, New York University
|
| 10 |
+
|
| 11 |
+
$^{4}$ Department of Biology, New York University
|
| 12 |
+
|
| 13 |
+
ourant Institute of Mathematical Sciences, New York University
|
| 14 |
+
|
| 15 |
+
{pyw230,onneau,joshua.tucker,jonathan.nagler}@nyu.edu
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Text analysis in the social sciences often involves using specialized dictionaries to reason with abstract concepts, such as perceptions about the economy or abuse on social media. These dictionaries allow researchers to impart domain knowledge and note subtle usages of words relating to a concept(s) of interest. We introduce the dictionary-assisted supervised contrastive learning (DASCL) objective, allowing researchers to leverage specialized dictionaries when fine-tuning pretrained language models. The text is first keyword simplified: a common, fixed token replaces any word in the corpus that appears in the dictionary(ies) relevant to the concept of interest. During fine-tuning, a supervised contrastive objective draws closer the embeddings of the original and keyword-simplified texts of the same class while pushing further apart the embeddings of different classes. The keyword-simplified texts of the same class are more textually similar than their original text counterparts, which additionally draws the embeddings of the same class closer together. Combining DASCL and cross-entropy improves classification performance metrics in few-shot learning settings and social science applications compared to using cross-entropy alone and alternative contrastive and data augmentation methods.<sup>1</sup>
|
| 20 |
+
|
| 21 |
+
# 1 Introduction
|
| 22 |
+
|
| 23 |
+
We propose a supervised contrastive learning approach that allows researchers to incorporate dictionaries of words related to a concept of interest when fine-tuning pretrained language models. It is conceptually simple, requires low computational resources, and is usable with most pretrained language models.
|
| 24 |
+
|
| 25 |
+
Dictionaries contain words that hint at the sentiment, stance, or perception of a document (see, e.g., Fei et al., 2012). Social science experts often
|
| 26 |
+
|
| 27 |
+
craft these dictionaries, making them useful when the underlying concept of interest is abstract (see, e.g., Brady et al., 2017; Young and Soroka, 2012). Dictionaries are also useful when specific words that are pivotal to determining the classification of a document may not exist in the training data. This is a particularly salient issue with small corpora, which is often the case in the social sciences.
|
| 28 |
+
|
| 29 |
+
However, recent supervised machine learning approaches do not use these dictionaries. We propose a contrastive learning approach, dictionary-assisted supervised contrastive learning (DASCL), that allows researchers to leverage these expert-crafted dictionaries when fine-tuning pretrained language models. We replace all the words in the corpus that belong to a specific lexicon with a fixed, common token. When using an appropriate dictionary, keyword simplification increases the textual similarity of documents in the same class. We then use a supervised contrastive objective to draw together text embeddings of the same class and push further apart the text embeddings of different classes (Khosla et al., 2020; Gunel et al., 2021). Figure 1 visualizes the intuition of our proposed method.
|
| 30 |
+
|
| 31 |
+
The contributions of this project are as follows.
|
| 32 |
+
|
| 33 |
+
- We propose keyword simplification, detailed in Section 3.1, to make documents of the same class more textually similar.
|
| 34 |
+
- We outline a supervised contrastive loss function, described in Section 3.2, that learns patterns within and across the original and keyword-simplified texts.
|
| 35 |
+
- We find classification performance improvements in few-shot learning settings and social science applications compared to two strong baselines: (1) ROBERTA (Liu et al., 2019) / BERT (Devlin et al., 2019) fine-tuned with cross-entropy loss, and (2) the supervised contrastive learning approach detailed in Gunel et al. (2021), the most closely related approach to DASCL. To be clear, although BERT and
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: The blue dots are embeddings of the original reviews and the white dots are the embeddings of the keyword-simplified reviews from the SST-2 dataset (Wang et al., 2018). Both reviews are positive, although they do not overlap in any positive words used. The reviews are more textually similar after keyword simplification. Using $\mathrm{BERT}_{\mathrm{BASE - UNC A S E D}}$ out-of-the-box, the cosine similarity between the original reviews is .654 and the cosine similarity between the keyword-simplified reviews is .842. Although there are some issues with using cosine similarity with BERT embeddings (see, e.g., Ethayarajh, 2019; Zhou et al., 2022), we use it as a rough heuristic here.
|
| 39 |
+
|
| 40 |
+
ROBERTA are not state-of-the-art pretrained language models, DASCL can augment the loss functions of state-of-the-art pretrained language models.
|
| 41 |
+
|
| 42 |
+
# 2 Related Work
|
| 43 |
+
|
| 44 |
+
Use of Pretrained Language Models in the Social Sciences. Transformers-based pretrained language models have become the de facto approach when classifying text data (see, e.g., Devlin et al., 2019; Liu et al., 2019; Raffel et al., 2020), and are seeing wider adoption in the social sciences. Terechshenko et al. (2021) show that RoBERTa and XLNet (Yang et al., 2019) outperform bag-of-words approaches for political science text classification tasks. Ballard et al. (2022) use BERTweet (Nguyen et al., 2020) to classify tweets expressing polarizing rhetoric. Lai et al. (2022) use BERT to classify the political ideologies of YouTube videos using text video metadata. DASCL can be used with most pretrained language models, so it can potentially improve results across a range of social science research.
|
| 45 |
+
|
| 46 |
+
Usage of Dictionaries. Dictionaries play an important role in understanding the meaning behind text in the social sciences. Brady et al. (2017) use a moral and emotional dictionary to predict whether tweets using these types of terms increase their dif
|
| 47 |
+
|
| 48 |
+
fusion within and between ideological groups. Simchon et al. (2022) create a dictionary of politically polarized language and analyze how trolls use this language on social media. Hopkins et al. (2017) use dictionaries of positive and negative economic terms to understand perceptions of the economy in newspaper articles. Although dictionary-based classification has fallen out of favor, dictionaries still contain valuable information about usages of specific or subtle language.
|
| 49 |
+
|
| 50 |
+
Text Data Augmentation. Text data augmentation techniques include backtranslation (Sennrich et al., 2016) and rule-based data augmentations such as random synonym replacements, random insertions, random swaps, and random deletions (Wei and Zou, 2019; Karimi et al., 2021). Shorten et al. (2021) survey text data augmentation techniques. Longpre et al. (2020) find that task-agnostic data augmentations typically do not improve the classification performance of pretrained language models. We choose dictionaries for keyword simplification based on the concept of interest underlying the classification task and use the keyword-simplified text with a contrastive loss function.
|
| 51 |
+
|
| 52 |
+
Contrastive Learning. Most works on contrastive learning have focused on self-supervised contrastive learning. In computer vision, images and their augmentations are treated as positives and other images as negatives. Recent contrastive learning approaches match or outperform their supervised pretrained image model counterparts, often using a small fraction of available annotated data (see, e.g., Chen et al., 2020a; He et al., 2020; Chen et al., 2020b; Grill et al., 2020). Self-supervised contrastive learning has also been used in natural language processing, matching or outperforming pretrained language models on benchmark tasks (see, e.g., Fang et al., 2020; Klein and Nabi, 2020).
|
| 53 |
+
|
| 54 |
+
Our approach is most closely related to works on supervised contrastive learning. Wen et al. (2016) propose a loss function called center loss that minimizes the intraclass distances of the convolutional neural network features. Khosla et al. (2020) develop a supervised loss function that generalizes NT-Xent (Chen et al., 2020a) to an arbitrary number of positives. Our work is closest to that of Gunel et al. (2021), who also use a version of NT-Xent extended to an arbitrary number of positives with pretrained language models. Their supervised contrastive loss function is detailed in Section A.1.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: Overview of the proposed method. Although ROBERTA is shown, any pretrained language model will work with this approach. The two RoBERTa networks share the same weights. The dimension of the projection layer is arbitrary.
|
| 58 |
+
|
| 59 |
+
# 3 Method
|
| 60 |
+
|
| 61 |
+
The approach consists of keyword simplification and the contrastive objective function. Figure 2 shows an overview of the proposed framework.
|
| 62 |
+
|
| 63 |
+
# 3.1 Keyword Simplification
|
| 64 |
+
|
| 65 |
+
The first step of the DASCL framework is keyword simplification. We select a set of $M$ dictionaries $\mathcal{D}$ . For each dictionary $d_{i} \in \mathcal{D}$ , $i \in \{1, \dots, M\}$ , we assign a token $t_{i}$ . Then, we iterate through the corpus and replace any word $w_{j}$ in dictionary $d_{i}$ with the token $t_{i}$ . We repeat these steps for each dictionary. For example, if we have a dictionary of positive words, then applying keyword simplification to
|
| 66 |
+
|
| 67 |
+
a wonderfully warm human drama that remains vividly in memory long after viewing
|
| 68 |
+
|
| 69 |
+
would yield
|
| 70 |
+
|
| 71 |
+
a <positive> <positive> human drama that remains <positive> in memory long after viewing
|
| 72 |
+
|
| 73 |
+
There are many off-the-shelf dictionaries that can be used during keyword simplification. Table 4 in Section A.2 contains a sample of dictionaries reflecting various potential concepts of interest.
|
| 74 |
+
|
| 75 |
+
# 3.2 Dictionary-Assisted Supervised
|
| 76 |
+
|
| 77 |
+
# Contrastive Learning (DASCL) Objective
|
| 78 |
+
|
| 79 |
+
The dictionary-assisted supervised contrastive learning loss function resembles the loss functions from Khosla et al. (2020) and Gunel et al. (2021). Consistent with Khosla et al. (2020), we project the final hidden layer of the pretrained language model to an embedding of a lower dimension before using the contrastive loss function.
|
| 80 |
+
|
| 81 |
+
Let $\Psi(x_i), i \in \{1, \dots, N\}$ , be the $L_2$ -normalized projection of the output of the pretrained language encoder for the original text and $\Psi(x_{i+N})$ be the corresponding $L_2$ -normalized projection of the output for the keyword-simplified text. $\tau > 0$ is the temperature parameter that controls the separation of the classes, and $\lambda \in [0,1]$ is the parameter that balances the cross-entropy and the DASCL loss functions. We choose $\lambda$ and directly optimize $\tau$ during training. In our experiments, we use the classifier token as the output of the pretrained language encoder. Equation 1 is the DASCL loss, Equation 2 is the multiclass cross-entropy loss, and Equation 3 is the overall loss that is optimized when finetuning the pretrained language model. The original text and the keyword-simplified text are used with the DASCL loss (Eq. 1); only the original text is used with the cross-entropy loss. The keyword-simplified text is not used during inference.
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathcal {L} _ {\mathrm {D A S C L}} = - \frac {1}{2 N} \sum_ {i = 1} ^ {2 N} \frac {1}{2 N _ {y _ {i}} - 1} \times
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\sum_ {j = 1} ^ {2 N} \mathbb {1} _ {i \neq j, y _ {i} = y _ {j}} \log \left[ \frac {\exp \left(\Psi \left(x _ {i}\right) \cdot \Psi \left(x _ {j}\right) / \tau\right)}{\sum_ {k = 1} ^ {2 N} \mathbb {1} _ {i \neq k} \exp \left(\Psi \left(x _ {i}\right) \cdot \Psi \left(x _ {k}\right) / \tau\right)} \right] \tag {1}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathcal {L} _ {\mathrm {C E}} = - \frac {1}{N} \sum_ {i = 1} ^ {N} \sum_ {c = 0} ^ {C} y _ {i, c} \cdot \log \hat {y} _ {i, c} \tag {2}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathcal {L} = (1 - \lambda) \mathcal {L} _ {C E} + \lambda \mathcal {L} _ {D A S C L} \tag {3}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
# 4 Experiments
|
| 100 |
+
|
| 101 |
+
# 4.1 Few-Shot Learning with SST-2
|
| 102 |
+
|
| 103 |
+
SST-2, a GLUE benchmark dataset (Wang et al., 2018), consists of sentences from movie reviews and binary labels of sentiment (positive or negative). Similar to Gunel et al. (2021), we experiment with SST-2 with three training set sizes: $N = 20$ , 100, and 1,000. Accuracy is this benchmark's primary metric of interest; we also report average precision. We use ROBERTA<sub>BASE</sub> as the pretrained language model. For keyword simplification, we use the opinion lexicon (Hu and Liu, 2004), which contains dictionaries of positive and negative words. Section A.3.3 further describes these dictionaries.
|
| 104 |
+
|
| 105 |
+
We compare DASCL to two other baselines: ROBERTA<sub>BASE</sub> using the cross-entropy (CE) loss function and the combination of the cross-entropy and supervised contrastive learning (SCL) loss functions used in Gunel et al. (2021). We also experiment with augmenting the corpus with the
|
| 106 |
+
|
| 107 |
+
<table><tr><td>Loss</td><td>N</td><td>Accuracy</td><td>Avg. Precision</td></tr><tr><td>CE</td><td>20</td><td>.675 ± .066</td><td>.791 ± .056</td></tr><tr><td>CE w/ DA</td><td>20</td><td>.650 ± .051</td><td>.748 ± .050</td></tr><tr><td>CE+SCL</td><td>20</td><td>.709 ± .077</td><td>.826 ± .068</td></tr><tr><td>CE+DASCL</td><td>20</td><td>.777 ± .024</td><td>.871 ± .014</td></tr><tr><td>CE+DASCL w/ DA</td><td>20</td><td>.697 ± .075</td><td>.796 ± .064</td></tr><tr><td>CE</td><td>100</td><td>.822 ± .019</td><td>.897 ± .023</td></tr><tr><td>CE w/ DA</td><td>100</td><td>.831 ± .032</td><td>.904 ± .031</td></tr><tr><td>CE+SCL</td><td>100</td><td>.833 ± .042</td><td>.883 ± .043</td></tr><tr><td>CE+DASCL</td><td>100</td><td>.858 ± .017</td><td>.935 ± .012</td></tr><tr><td>CE+DASCL w/ DA</td><td>100</td><td>.828 ± .020</td><td>.908 ± .012</td></tr><tr><td>CE</td><td>1000</td><td>.903 ± .006</td><td>.962 ± .007</td></tr><tr><td>CE w/ DA</td><td>1000</td><td>.899 ± .005</td><td>.956 ± .006</td></tr><tr><td>CE+SCL</td><td>1000</td><td>.905 ± .005</td><td>.960 ± .011</td></tr><tr><td>CE+DASCL</td><td>1000</td><td>.906 ± .006</td><td>.959 ± .009</td></tr><tr><td>CE+DASCL w/ DA</td><td>1000</td><td>.904 ± .004</td><td>.960 ± .011</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Table 1: Accuracy and average precision over the SST-2 test set in few-shot learning settings. Results are averages over 10 random seeds with standard deviations reported. DA refers to data augmentation, where the keyword-simplified text augments the training corpus.
|
| 110 |
+
|
| 111 |
+
keyword-simplified text (referred to as "data augmentation," or "DA," in results tables). In other words, when data augmentation is used, both the original text and the keyword-simplified text are used with the cross-entropy loss.
|
| 112 |
+
|
| 113 |
+
We use the original validation set from the GLUE benchmark as the test set, and we sample our own validation set from the training set of equal size to this test set. Further details about the data and hyperparameter configurations can be found in Section A.3. Table 1 shows the results across the three training set configurations.
|
| 114 |
+
|
| 115 |
+
DASCL improves results the most when there are only a few observations in the training set. When $N = 20$ , using DASCL yields a 10.2 point improvement in accuracy over using the cross-entropy loss function ( $p < .001$ ) and a 6.8 point improvement in accuracy over using the SCL loss function ( $p = .023$ ). Figure 3 in Section A.3.8 visualizes the learned embeddings using each of these loss functions using t-SNE plots. When the training set's size increases, the benefits of using DASCL decrease. DASCL only has a slightly higher accuracy when using 1,000 labeled observations, and the difference between DASCL and cross-entropy alone is insignificant ( $p = .354$ ).
|
| 116 |
+
|
| 117 |
+
# 4.2 New York Times Articles about the Economy
|
| 118 |
+
|
| 119 |
+
Barbera et al. (2021) classify the tone of New York Times articles about the American economy as positive or negative. 3,119 of the 8,462 labeled articles (3,852 unique articles) in the training set are la
|
| 120 |
+
|
| 121 |
+
<table><tr><td>Loss</td><td>N</td><td>Accuracy</td><td>Avg. Precision</td></tr><tr><td>L2 Logit</td><td>100</td><td>.614</td><td>.479</td></tr><tr><td>CE</td><td>100</td><td>.673 ± .027</td><td>.593 ± .048</td></tr><tr><td>CE w/ DA</td><td>100</td><td>.663 ± .030</td><td>.576 ± .058</td></tr><tr><td>CE+SCL</td><td>100</td><td>.614 ± .000</td><td>.394 ± .043</td></tr><tr><td>CE+DASCL</td><td>100</td><td>.705 ± .013</td><td>.645 ± .016</td></tr><tr><td>CE+DASCL w/ DA</td><td>100</td><td>.711 ± .013</td><td>.644 ± .027</td></tr><tr><td>L2 Logit</td><td>1000</td><td>.624</td><td>.482</td></tr><tr><td>CE</td><td>1000</td><td>.716 ± .012</td><td>.662 ± .030</td></tr><tr><td>CE w/ DA</td><td>1000</td><td>.710 ± .011</td><td>.656 ± .024</td></tr><tr><td>CE+SCL</td><td>1000</td><td>.722 ± .009</td><td>.670 ± .022</td></tr><tr><td>CE+DASCL</td><td>1000</td><td>.732 ± .011</td><td>.671 ± .025</td></tr><tr><td>CE+DASCL w/ DA</td><td>1000</td><td>.733 ± .008</td><td>.681 ± .021</td></tr><tr><td>L2 Logit</td><td>Full</td><td>.681</td><td>.624</td></tr><tr><td>CE</td><td>Full</td><td>.753 ± .012</td><td>.713 ± .015</td></tr><tr><td>CE w/ DA</td><td>Full</td><td>.752 ± .011</td><td>.708 ± .017</td></tr><tr><td>CE+SCL</td><td>Full</td><td>.756 ± .011</td><td>.723 ± .009</td></tr><tr><td>CE+DASCL</td><td>Full</td><td>.759 ± .006</td><td>.741 ± .010</td></tr><tr><td>CE+DASCL w/ DA</td><td>Full</td><td>.760 ± .008</td><td>.739 ± .014</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Table 2: Accuracy and average precision over the economic media test set (Barberá et al., 2021) when using 100, 1000, and all labeled examples from the training set for fine-tuning. Except for logistic regression, results are averages over 10 random seeds with standard deviations reported.
|
| 124 |
+
|
| 125 |
+
beled positive; 162 of the 420 articles in the test set are labeled positive. Accuracy is the primary metric of interest; we also report average precision. In addition to using the full training set, we also experiment with training sets of sizes 100 and 1,000. We use the positive and negative dictionaries from Lexicoder (Young and Soroka, 2012) and dictionaries of positive and negative economic terms (Hopkins et al., 2017). Barbera et al. (2021) use logistic regression with $L_{2}$ regularization. We use ROBERTA<sub>BASE</sub> as the pretrained language model. Section A.4 contains more details about the data, hyperparameters, and other evaluation metrics. Table 2 shows the results across the three training set configurations.
|
| 126 |
+
|
| 127 |
+
When $N = 100$ , DASCL outperforms cross-entropy only, cross-entropy with data augmentation, and SCL on accuracy ( $p < .005$ for all) and average precision ( $p < .01$ for all). When $N = 1000$ , DASCL outperforms cross-entropy only, cross-entropy with data augmentation, and SCL on accuracy ( $p < .05$ for all) and average precision (but not statistically significantly). DASCL performs statistically equivalent to DASCL with data augmentation across all metrics when $N = 100$ and 1000.
|
| 128 |
+
|
| 129 |
+
When using the full training set, ROBERTa<sub>BASE</sub> is a general improvement over logistic regression. Although the DASCL losses have slightly higher accuracy than the other RoBERTa-based models, the differences are not statistically significant. Us-
|
| 130 |
+
|
| 131 |
+
ing DASCL yields a 2.8 point improvement in average precision over cross-entropy $(p < .001)$ and a 1.8 improvement in average precision over SCL $(p < .001)$ . Figure 4 in Section A.4.9 visualizes the learned embeddings using each of these loss functions using t-SNE plots.
|
| 132 |
+
|
| 133 |
+
# 4.3 Abusive Speech on Social Media
|
| 134 |
+
|
| 135 |
+
The OffensEval dataset (Zampieri et al., 2020) contains 14,100 tweets annotated for offensive language. A tweet is considered offensive if "it contains any form of non-acceptable language (pro-fanity) or a targeted offense." Caselli et al. (2020) used this same dataset and more narrowly identified tweets containing "hurtful language that a speaker uses to insult or offend another individual or group of individuals based on their personal qualities, appearance, social status, opinions, statements, or actions." We focus on this dataset, AbusEval, because of its greater conceptual difficulty. 2,749 of the 13,240 tweets in the training set are labeled abusive, and 178 of the 860 tweets in the test set are labeled abusive. Caselli et al. (2021) pretrain a BERT<sub>BASE-UNCASED</sub> model, HateBERT, using the Reddit Abusive Language English dataset. Macro F1 and F1 over the positive class are the primary metrics of interest; we also report average precision. In addition to using the full training set, we also experiment with training sets of sizes 100 and 1,000. Section A.5 contains more details about the data and hyperparameters.
|
| 136 |
+
|
| 137 |
+
We combine DASCL with BERT<sub>BASE-UNCASED</sub> and HateBERT. Alorainy et al. (2019) detect cyberhate speech using threats-based othering language, focusing on the use of "us" and "them" pronouns. Following their strategy, we look at the conjunction of sentiment using Lexicoder and two dictionaries of "us" and "them" pronouns, which may suggest abusive speech. Table 3 compares the performance of BERT<sub>BASE-UNCASED</sub> and HateBERT with cross-entropy against BERT<sub>BASE-UNCASED</sub> and HateBERT with cross-entropy and DASCL.
|
| 138 |
+
|
| 139 |
+
When $N = 100$ , BERT with DASCL outperforms BERT on macro F1 ( $p = .008$ ), F1 over the positive class ( $p = .011$ ), and average precision ( $p = .003$ ); when $N = 1000$ , BERT with DASCL outperforms BERT on macro F1 ( $p = .021$ ), F1 over the positive class ( $p = .028$ ), and average precision ( $p = .007$ ). HateBERT with DASCL performs statistically on par with HateBERT across all metrics for $N = 100$ and $N = 1000$ . BERT with DASCL performs sta
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Model</td><td>N</td><td>Macro F1</td><td>F1, Pos</td><td>Avg. Precision</td></tr><tr><td>BERT</td><td>100</td><td>.293±.083</td><td>.334±.025</td><td>.233±.040</td></tr><tr><td>HateBERT</td><td>100</td><td>.513±.120</td><td>.346±.049</td><td>.303±.059</td></tr><tr><td>BERT w/ DASCL</td><td>100</td><td>.427±.112</td><td>.362±.017</td><td>.284±.022</td></tr><tr><td>HateBERT w/ DASCL</td><td>100</td><td>.449±.110</td><td>.345±.033</td><td>.281±.045</td></tr><tr><td>BERT</td><td>1000</td><td>.710±.018</td><td>.523±.034</td><td>.608±.024</td></tr><tr><td>HateBERT</td><td>1000</td><td>.711±.028</td><td>.512±.053</td><td>.626±.017</td></tr><tr><td>BERT w/ DASCL</td><td>1000</td><td>.729±.014</td><td>.559±.032</td><td>.637±.016</td></tr><tr><td>HateBERT w/ DASCL</td><td>1000</td><td>.704±.010</td><td>.501±.020</td><td>.626±.016</td></tr><tr><td>BERT</td><td>Full</td><td>.767±.008</td><td>.636±.012</td><td>.703±.006</td></tr><tr><td>HateBERT</td><td>Full</td><td>.768±.005</td><td>.630±.009</td><td>.695±.005</td></tr><tr><td>BERT w/ DASCL</td><td>Full</td><td>.779±.010</td><td>.653±.014</td><td>.716±.005</td></tr><tr><td>HateBERT w/ DASCL</td><td>Full</td><td>.766±.007</td><td>.623±.011</td><td>.695±.006</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 3: Macro F1, F1, and average precision over the AbusEval test set (Caselli et al., 2020) when using 100, 1000, and all labeled examples from the training set for fine-tuning. Results are averages over 10 random seeds with standard deviations reported.
|
| 144 |
+
|
| 145 |
+
tistically equivalent to HateBERT when $N = 100$ and $N = 1000$ on all metrics, except on F1 over the positive class when $N = 1000$ $(p = .030)$ .
|
| 146 |
+
|
| 147 |
+
When using the full training set, BERT with DASCL improves upon the macro F1, F1 over the positive class, and average precision compared with both BERT (macro F1: $p = .010$ ; F1: $p = .010$ ; AP: $p < .001$ ) and HateBERT (macro F1: $p = .007$ ; F1: $p < .001$ ; AP: $p < .001$ ). Figure 5 in Section A.5.8 visualizes the learned embeddings using BERT and BERT with DASCL using t-SNE plots.
|
| 148 |
+
|
| 149 |
+
# 5 Conclusion
|
| 150 |
+
|
| 151 |
+
We propose a supervised contrastive learning approach that allows researchers to leverage specialized dictionaries when fine-tuning pretrained language models. We show that using DASCL with cross-entropy improves classification performance on SST-2 in few-shot learning settings, on classifying perceptions about the economy expressed in New York Times articles, and on identifying tweets containing abusive language when compared to using cross-entropy alone or alternative contrastive and data augmentation methods. In the future, we aim to extend our approach to other supervised contrastive learning frameworks, such as using this method to upweight difficult texts (Suresh and Ong, 2021). We also plan to expand this approach to semi-supervised and self-supervised settings to better understand core concepts expressed in text.
|
| 152 |
+
|
| 153 |
+
# Limitations
|
| 154 |
+
|
| 155 |
+
We aim to address limitations to the supervised contrastive learning approach described in this paper in future works. We first note that there are no experiments in this paper involving multiclass or multilabel classification; all experiments involve only binary classification. Multiclass or multilabel classification may present further challenges when categories are more nuanced. We expect improvements in classification performance when applied to multiclass or multilabel classification settings, but we have not confirmed this.
|
| 156 |
+
|
| 157 |
+
Second, we have not experimented with the dimensionality of the projection layer or the batch sizes. At the moment, the projection layer is arbitrarily set to 256 dimensions, and we use batch sizes from previous works. Future work aims to study how changing the dimensionality of this projection layer and the batch size affects classification outcomes.
|
| 158 |
+
|
| 159 |
+
Third, we have used the DASCL objective with ROBERTA and BERT, but have not used it with the latest state-of-the-art pretrained language models. We focused on these particular pretrained language models because they are commonly used in the social sciences and because of computational constraints.
|
| 160 |
+
|
| 161 |
+
Fourth, we have not examined how the quality or size of the dictionary may affect classification outcomes. A poorly constructed dictionary may lead to less improvement in classification performance metrics or may even hurt performance. Dictionaries with too many words or too few words may also not lead to improvements in classification performance metrics. Future work aims to study how the quality and size of dictionaries affect the DASCL approach.
|
| 162 |
+
|
| 163 |
+
Fifth, we have not explored how this method can be used to potentially reduce bias in text classification. For example, we can replace gendered pronouns with a token (such as "<pronoun>"), potentially reducing gender bias in analytical contexts such as occupation.
|
| 164 |
+
|
| 165 |
+
Lastly, we have not explored how keyword simplification may be useful in a self-supervised or semi-supervised contrastive learning setting. This may be particularly helpful for social scientists who are often interested in exploring core concepts or perspectives in text rather than classifying text into specific classes.
|
| 166 |
+
|
| 167 |
+
# Ethics Statement
|
| 168 |
+
|
| 169 |
+
Our paper describes a supervised contrastive learning approach that allows researchers to leverage specialized dictionaries when fine-tuning pretrained language models. While we did not identify any systematic biases in the particular set of dictionaries we used, any dictionary may encode certain biases and/or exclude certain groups. This can be particularly problematic when working with issues such as detecting hate speech and abusive language. For example, in the context of abusive language, if words that attack a particular group are (purposely or unintentionally) excluded from the dictionaries, those words would not be replaced. This may under-detect abusive text that attacks this specific group.
|
| 170 |
+
|
| 171 |
+
This paper does not create any new datasets. The OffensEval/AbusEval dataset contains sensitive and harmful language. Although we did not annotate or re-associate any tweets, we are cognizant that particular types of abusive language against certain groups or identities may not have been properly annotated as abusive, or certain types of abusive language may have been excluded from the corpus entirely.
|
| 172 |
+
|
| 173 |
+
# Acknowledgements
|
| 174 |
+
|
| 175 |
+
We gratefully acknowledge that the Center for Social Media and Politics at New York University is supported by funding from the John S. and James L. Knight Foundation, the Charles Koch Foundation, Craig Newmark Philanthropies, the William and Flora Hewlett Foundation, the Siegel Family Endowment, and the Bill and Melinda Gates Foundation. This work was supported in part through the NYU IT High Performance Computing resources, services, and staff expertise. We thank the members of the Center for Social Media and Politics for their helpful comments when workshopping this paper. We would also like to thank the anonymous reviewers for their valuable feedback in improving this paper.
|
| 176 |
+
|
| 177 |
+
# References
|
| 178 |
+
|
| 179 |
+
Quinn Albaugh, Julie Sevenans, Stuart Soroka, and Peter John Loewen. 2013. The automated coding of policy agendas: A dictionary-based approach. Retrieved from https://www.almendron.com/tribuna/wp-content/uploads/2017/05/CAP2013v2.pdf.
|
| 180 |
+
Wafa Alorainy, Pete Burnap, Han Liu, and Matthew L.
|
| 181 |
+
|
| 182 |
+
Williams. 2019. "The enemy among us": Detecting cyber hate speech with threats-based othering language embeddings. ACM Trans. Web, 13(3).
|
| 183 |
+
American Defamation League. 2022. Hate on display hate symbols database. Retrieved from https:// www.adl.org/resources/hate-symbols/search. Accessed: 2022-08-28.
|
| 184 |
+
Muhammad Zubair Asghar, Shakeel Ahmad, Maria Qasim, Syeda Rabail Zahra, and Fazal Masud Kundi. 2016. SentiHealth: creating health-related sentiment lexicon using hybrid approach. SpringerPlus, 5(1).
|
| 185 |
+
Stefano Baccianella, Andrea Esuli, and Fabrizio Sebastiani. 2010. SentiWordNet 3.0: An enhanced lexical resource for sentiment analysis and opinion mining. In Proceedings of the Seventh International Conference on Language Resources and Evaluation (LREC'10), Valletta, Malta. European Language Resources Association (ELRA).
|
| 186 |
+
Andrew O. Ballard, Ryan DeTamble, Spencer Dorsey, Michael Heseltine, and Marcus Johnson. 2022. Dynamics of polarizing rhetoric in congressional tweets. *Legislative Studies Quarterly*.
|
| 187 |
+
Pablo Barbera, Amber E. Boydstun, Suzanne Linn, Ryan McMahon, and Jonathan Nagler. 2021. Automated text classification of news articles: A practical guide. Political Analysis, 29(1):19-42.
|
| 188 |
+
Elisa Bassignana, Valerio Basile, and Viviana Patti. 2018. Hurtlex: A multilingual lexicon of words to hurt. In Proceedings of the Fifth Italian Conference on Computational Linguistics (CLiC-It 2018).
|
| 189 |
+
Margaret M. Bradley and Peter J. Lang. 1999. Affective Norms for English Words (ANEW): Instruction manual and affective ratings. Technical Report C-1, The Center for Research in Psychophysiology, University of Florida. Retrieved from https://pdodds.w3.uvm.edu/teaching/courses/2009-08UVM-300/docs/others/everything/bradley1999a.pdf.
|
| 190 |
+
William J. Brady, Julian A. Wills, John T. Jost, Joshua A. Tucker, and Jay J. Van Bavel. 2017. Emotion shapes the diffusion of moralized content in social networks. Proceedings of the National Academy of Sciences, 114(28):7313-7318.
|
| 191 |
+
Marc Brysbaert, Amy Beth Warriner, and Victor Kuperman. 2013. Concreteness ratings for 40 thousand generally known english word lemmas. Behavior Research Methods, 46(3):904-911.
|
| 192 |
+
Tommaso Caselli, Valerio Basile, Jelena Mitrovic, and Michael Granitzer. 2021. HateBERT: Retraining BERT for abusive language detection in English. In Proceedings of the 5th Workshop on Online Abuse and Harms (WOAH 2021), pages 17-25, Online. Association for Computational Linguistics.
|
| 193 |
+
Tommaso Caselli, Valerio Basile, Jelena Mitrovic, Inga Kartoziya, and Michael Granitzer. 2020. I feel offended, don't be abusive! implicit/explicit messages
|
| 194 |
+
|
| 195 |
+
in offensive and abusive language. In Proceedings of the Twelfth Language Resources and Evaluation Conference, pages 6193-6202, Marseille, France. European Language Resources Association.
|
| 196 |
+
Eshwar Chandrasekharan, Umashanthi Pavalanathan, Anirudh Srinivasan, Adam Glynn, Jacob Eisenstein, and Eric Gilbert. 2017. You can't stay here: The efficacy of reddit's 2015 ban examined through hate speech. Proc. ACM Hum.-Comput. Interact., 1(CSCW).
|
| 197 |
+
Jeffrey T. Chang, Hinrich Schütze, and Russ B. Altman. 2002. Creating an Online Dictionary of Abbreviations from MEDLINE. Journal of the American Medical Informatics Association, 9(6):612-620.
|
| 198 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. 2020a. A simple framework for contrastive learning of visual representations. In Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 1597-1607. PMLR.
|
| 199 |
+
Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. 2020b. Improved baselines with momentum contrastive learning.
|
| 200 |
+
Yoonjung Choi and Janyce Wiebe. 2014. EffectWordNet: Sense-level lexicon acquisition for opinion inference. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1181-1191, Doha, Qatar. Association for Computational Linguistics.
|
| 201 |
+
Thomas Davidson, Dana Warmsley, Michael Macy, and Ingmar Weber. 2017. Automated hate speech detection and the problem of offensive language. Proceedings of the International AAAI Conference on Web and Social Media, 11(1):512-515.
|
| 202 |
+
Jesse Davis and Mark Goadrich. 2006. The relationship between precision-recall and roc curves. In Proceedings of the 23rd International Conference on Machine Learning, ICML '06, page 233-240, New York, NY, USA. Association for Computing Machinery.
|
| 203 |
+
Matías Dell' Amerlina Ríos and Agustín Gravano. 2013. Spanish DAL: A Spanish dictionary of affect in language. In Proceedings of the 4th Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis, pages 21-28, Atlanta, Georgia. Association for Computational Linguistics.
|
| 204 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics.
|
| 205 |
+
|
| 206 |
+
Kawin Ethayarajh. 2019. How contextual are contextualized word representations? Comparing the geometry of BERT, ELMo, and GPT-2 embeddings. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 55–65, Hong Kong, China. Association for Computational Linguistics.
|
| 207 |
+
Hongchao Fang, Sicheng Wang, Meng Zhou, Jiayuan Ding, and Pengtao Xie. 2020. CERT: Contrastive self-supervised learning for language understanding.
|
| 208 |
+
Ethan Fast, Binbin Chen, and Michael S. Bernstein. 2016. Empath: Understanding topic signals in largescale text. In Proceedings of the 2016 CHI Conference on Human Factors in Computing Systems, CHI '16, page 4647-4657, New York, NY, USA. Association for Computing Machinery.
|
| 209 |
+
Geli Fei, Bing Liu, Meichun Hsu, Malu Castellanos, and Riddhiman Ghosh. 2012. A dictionary-based approach to identifying aspects implied by adjectives for opinion mining. In Proceedings of COLING 2012: Posters, pages 309-318, Mumbai, India. The COLING 2012 Organizing Committee.
|
| 210 |
+
Sarah Fioroni, Ariel Hasell, Stuart Soroka, and Brian Weeks. 2022. Constructing a dictionary for the automated identification of discrete emotions in news content.
|
| 211 |
+
Konstantina Georgelou, Antje Hildebrandt, and Katerina Paramana. 2017. The PSi manifesto lexicon: An online discursive platform. Global Performance Studies, 1(1).
|
| 212 |
+
Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Remi Munos, and Michal Valko. 2020. Bootstrap your own latent - a new approach to self-supervised learning. In Advances in Neural Information Processing Systems, volume 33, pages 21271-21284. Curran Associates, Inc.
|
| 213 |
+
Belize Gunel, Jingfei Du, Alexis Conneau, and Veselin Stoyanov. 2021. Supervised contrastive learning for pre-trained language model fine-tuning. In International Conference on Learning Representations.
|
| 214 |
+
Hatebase. 2022. Hatebase is a collaborative, regionalized repository of multilingual hate speech. Retrieved from https://hatebase.org/. Accessed: 2022-08-28.
|
| 215 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. 2020. Momentum contrast for unsupervised visual representation learning. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 9726-9735.
|
| 216 |
+
|
| 217 |
+
Daniel J. Hopkins, Eunji Kim, and Soojong Kim. 2017. Does newspaper coverage influence or reflect public perceptions of the economy? Research & Politics, 4(4):1-7.
|
| 218 |
+
Minqing Hu and Bing Liu. 2004. Mining and summarizing customer reviews. In Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '04, page 168-177, New York, NY, USA. Association for Computing Machinery.
|
| 219 |
+
C. Hutto and Eric Gilbert. 2014. VADER: A parsimonious rule-based model for sentiment analysis of social media text. Proceedings of the International AAAI Conference on Web and Social Media, 8(1):216-225.
|
| 220 |
+
Akbar Karimi, Leonardo Rossi, and Andrea Prati. 2021. AEDA: An easier data augmentation technique for text classification. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 2748-2754, Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 221 |
+
Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. 2020. Supervised contrastive learning. In Advances in Neural Information Processing Systems, volume 33, pages 18661-18673. Curran Associates, Inc.
|
| 222 |
+
Svetlana Kiritchenko, Saif Mohammad, and Mohammad Salameh. 2016. SemEval-2016 task 7: Determining sentiment intensity of English and Arabic phrases. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pages 42-51, San Diego, California. Association for Computational Linguistics.
|
| 223 |
+
Svetlana Kiritchenko and Saif M. Mohammad. 2016a. Capturing reliable fine-grained sentiment associations by crowdsourcing and best-worst scaling. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 811-817, San Diego, California. Association for Computational Linguistics.
|
| 224 |
+
Svetlana Kiritchenko and Saif M. Mohammad. 2016b. Sentiment composition of words with opposing polarities. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1102-1108, San Diego, California. Association for Computational Linguistics.
|
| 225 |
+
Svetlana Kiritchenko, Xiaodan Zhu, Colin Cherry, and Saif Mohammad. 2014. NRC-Canada-2014: Detecting aspects and sentiment in customer reviews. In Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014), pages 437-442, Dublin, Ireland. Association for Computational Linguistics.
|
| 226 |
+
|
| 227 |
+
Tassilo Klein and Moin Nabi. 2020. Contrastive self-supervised learning for commonsense reasoning. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7517-7523, Online. Association for Computational Linguistics.
|
| 228 |
+
Angela Lai, Megan A. Brown, James Bisbee, Richard Bonneau, Joshua A. Tucker, and Jonathan Nagler. 2022. Estimating the ideology of political youtube videos.
|
| 229 |
+
Quentin Lhoest, Albert Villanova del Moral, Yacine Jernite, Abhishek Thakur, Patrick von Platen, Suraj Patil, Julien Chaumont, Mariama Drame, Julien Plu, Lewis Tunstall, Joe Davison, Mario Šaško, Gunjan Chhablani, Bhavitvya Malik, Simon Brandeis, Teven Le Scao, Victor Sanh, Canwen Xu, Nicolas Patry, Angelina McMillan-Major, Philipp Schmid, Sylvain Gugger, Clément Delangue, Theo Matussière, Lysandre Debut, Stas Bekman, Pierrick Cistac, Thibault Goehringer, Victor Mustar, François Lagunas, Alexander Rush, and Thomas Wolf. 2021. Datasets: A community library for natural language processing. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 175-184, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 230 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. RoBERTa: A robustly optimized BERT pretraining approach.
|
| 231 |
+
Shayne Longpre, Yu Wang, and Chris DuBois. 2020. How effective is task-agnostic data augmentation for pretrained transformers? In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 4401–4411, Online. Association for Computational Linguistics.
|
| 232 |
+
Tim Loughran and Bill McDonald. 2011. When is a liability not a liability? textual analysis, dictionaries, and 10-ks. The Journal of Finance, 66(1):35-65.
|
| 233 |
+
Xuan Lu and Qiaozhu Mei. 2022. Covid-core twitter dataset. Retrieved from https://midas.umich.edu/twitter-decahose-data/. Accessed: 2022-08-28.
|
| 234 |
+
Pekka Malo, Ankur Sinha, Pekka Korhonen, Jyrki Wallenius, and Pyry Takala. 2014. Good debt or bad debt: Detecting semantic orientations in economic texts. Journal of the Association for Information Science and Technology, 65(4):782-796.
|
| 235 |
+
C. Martindale. 1975. The Romantic Progression: The Psychology of Literary History. A Halsted Press Book. Hemisphere Publishing Corporation.
|
| 236 |
+
George A. Miller. 1995. Wordnet: A lexical database for english. Commun. ACM, 38(11):39-41.
|
| 237 |
+
|
| 238 |
+
Saif Mohammad. 2011. Even the abstract have color: Consensus in word-colour associations. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 368-373, Portland, Oregon, USA. Association for Computational Linguistics.
|
| 239 |
+
Saif Mohammad. 2018a. Obtaining reliable human ratings of valence, arousal, and dominance for 20,000 English words. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 174-184, Melbourne, Australia. Association for Computational Linguistics.
|
| 240 |
+
Saif Mohammad. 2018b. Word affect intensities. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA).
|
| 241 |
+
Saif M. Mohammad and Svetlana Kiritchenko. 2015. Using hashtags to capture fine emotion categories from tweets. Computational Intelligence, 31(2):301-326.
|
| 242 |
+
Saif M. Mohammad and Peter D. Turney. 2013. Crowdsourcing a word-emotion association lexicon. Computational Intelligence, 29(3):436-465.
|
| 243 |
+
Antonio Moreno-Ortiz, Javier Fernandez-Cruz, and Chantal Pérez Chantal Hernández. 2020. Design and evaluation of SentiEcon: a fine-grained economic/financial sentiment lexicon from a corpus of business news. In Proceedings of the Twelfth Language Resources and Evaluation Conference, pages 5065–5072, Marseille, France. European Language Resources Association.
|
| 244 |
+
Dat Quoc Nguyen, Thanh Vu, and Anh Tuan Nguyen. 2020. BERTweet: A pre-trained language model for English tweets. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 9-14, Online. Association for Computational Linguistics.
|
| 245 |
+
Nuno Oliveira, Paulo Cortez, and Nelson Areal. 2016. Stock market sentiment lexicon acquisition using microblogging data and statistical measures. Decision Support Systems, 85:62-73.
|
| 246 |
+
PeaceTech Lab. 2022. Our hate speech lexicons. Retrieved from https://www.peacetechlab.org/ hate-speech-lexicons. Accessed: 2022-08-28.
|
| 247 |
+
Kathryn Pearson and Logan Dancey. 2011. Speaking for the underrepresented in the house of representatives: Voicing women's interests in a partisan era. Politics & Gender, 7(4):493-519.
|
| 248 |
+
Kevin Quealy. 2021. The complete list of trump's twitter insults (2015-2021). Retrieved from https://www.nytimes.com/interactive/2021/01/19/upshot/trump-complete-insult-list.html. Accessed: 2022-08-28.
|
| 249 |
+
|
| 250 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1-67.
|
| 251 |
+
Sara Rosenthal, Preslav Nakov, Svetlana Kiritchenko, Saif Mohammad, Alan Ritter, and Veselin Stoyanov. 2015. SemEval-2015 task 10: Sentiment analysis in Twitter. In Proceedings of the 9th International Workshop on Semantic Evaluation (SemEval 2015), pages 451-463, Denver, Colorado. Association for Computational Linguistics.
|
| 252 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1715-1725, Berlin, Germany. Association for Computational Linguistics.
|
| 253 |
+
Kashish Ara Shakil, Kakh Kashan Tabassum, Fawziah S. Alqahtani, and Mudasir Ahmad Wani. 2021. Analyzing user digital emotions from a holy versus non-pilgrimage city in saudi arabia on twitter platform. Applied Sciences, 11(15).
|
| 254 |
+
Connor Shorten, Taghi M. Khoshgoftaar, and Borko Furht. 2021. Text data augmentation for deep learning. Journal of Big Data, 8.
|
| 255 |
+
Alexandra A. Siegel, Evgenii Nikitin, Pablo Barberá, Joanna Sterling, Bethany Pullen, Richard Bonneau, Jonathan Nagler, and Joshua A. Tucker. 2021. Trumping hate on twitter? online hate speech in the 2016 u.s. election campaign and its aftermath. Quarterly Journal of Political Science, 16(1):71-104.
|
| 256 |
+
Almog Simchon, William J Brady, and Jay J Van Bavel. 2022. Troll and divide: the language of online polarization. *PNAS Nexus*, 1(1). Pgac019.
|
| 257 |
+
Swapna Somasundaran, Josef Ruppenhofer, and Janyce Wiebe. 2007. Detecting arguing and sentiment in meetings. In Proceedings of the 8th SIGdial Workshop on Discourse and Dialogue, pages 26-34, Antwerp, Belgium. Association for Computational Linguistics.
|
| 258 |
+
Jacopo Staiano and Marco Guerini. 2014. Depeche mood: a lexicon for emotion analysis from crowd annotated news. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 427-433, Baltimore, Maryland. Association for Computational Linguistics.
|
| 259 |
+
Varsha Suresh and Desmond Ong. 2021. Not all negatives are equal: Label-aware contrastive loss for fine-grained text classification. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 4381-4394, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 260 |
+
|
| 261 |
+
Zhanna Terechshenko, Fridolin Linder, Vishakh Padmakumar, Michael Liu, Jonathan Nagler, Joshua A. Tucker, and Richard Bonneau. 2021. A comparison of methods in political science text classification: Transfer learning language models for politics.
|
| 262 |
+
Paul Thompson, John McNaught, Simonetta Montemagni, Nicoletta Calzolari, Riccardo del Gratta, Vivian Lee, Simone Marchi, Monica Monachini, Piotr Pezik, Valeria Quochi, CJ Rupp, Yutaka Sasaki, Giulia Venturi, Dietrich Rebholz-Schuhmann, and Sophia Ananiadou. 2011. The BioLexicon: a largescale terminological resource for biomedical text mining. BMC Bioinformatics, 12(1).
|
| 263 |
+
Laurens van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-sne. Journal of Machine Learning Research, 9(86):2579-2605.
|
| 264 |
+
Isabelle van der Vegt, Maximilian Mozes, Bennett Kleinberg, and Paul Gill. 2021. The grievance dictionary: Understanding threatening language use. Behavior Research Methods.
|
| 265 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. 2018. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 353-355, Brussels, Belgium. Association for Computational Linguistics.
|
| 266 |
+
Mudasir Ahmad Wani, Nancy Agarwal, Suraiya Jabin, and Syed Zeeshan Hussain. 2018. User emotion analysis in conflicting versus non-conflicting regions using online social networks. Telematics and Informatics, 35(8):2326-2336.
|
| 267 |
+
Michael Weaver. 2019. "Judge Lynch" in the court of public opinion: Publicity and the de-legitimation of lynching. American Political Science Review, 113(2):293-310.
|
| 268 |
+
Jason Wei and Kai Zou. 2019. EDA: Easy data augmentation techniques for boosting performance on text classification tasks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 6382-6388, Hong Kong, China. Association for Computational Linguistics.
|
| 269 |
+
Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. 2016. A discriminative feature learning approach for deep face recognition. In Computer Vision – ECCV 2016, pages 499–515, Cham. Springer International Publishing.
|
| 270 |
+
Cynthia Whissell. 2009. Using the revised dictionary of affect in language to quantify the emotional undertones of samples of natural language. Psychological Reports, 105(2):509-521. PMID: 19928612.
|
| 271 |
+
|
| 272 |
+
Cynthia M. Whissell. 1989. Chapter 5 - the dictionary of affect in language. In Robert Plutchik and Henry Kellerman, editors, The Measurement of Emotions, pages 113-131. Academic Press.
|
| 273 |
+
|
| 274 |
+
Tobias Widmann and Maximilian Wich. 2022. Creating and comparing dictionary, word embedding, and transformer-based models to measure discrete emotions in german political text. Political Analysis, page 1-16.
|
| 275 |
+
|
| 276 |
+
Janyce Wiebe and Rada Mihalcea. 2006. Word sense and subjectivity. In Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics, pages 1065-1072, Sydney, Australia. Association for Computational Linguistics.
|
| 277 |
+
|
| 278 |
+
Theresa Wilson, Janyce Wiebe, and Paul Hoffmann. 2005. Recognizing contextual polarity in phrase-level sentiment analysis. In Proceedings of Human Language Technology Conference and Conference on Empirical Methods in Natural Language Processing, pages 347-354, Vancouver, British Columbia, Canada. Association for Computational Linguistics.
|
| 279 |
+
|
| 280 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc.
|
| 281 |
+
|
| 282 |
+
Lori Young and Stuart Soroka. 2012. Affective news: The automated coding of sentiment in political texts. Political Communication, 29(2):205-231.
|
| 283 |
+
|
| 284 |
+
Marcos Zampieri, Preslav Nakov, Sara Rosenthal, Pepa Atanasova, Georgi Karadzhov, Hamdy Mubarak, Leon Derczynski, Zeses Pitenis, and Căgni Čoltekin. 2020. SemEval-2020 task 12: Multilingual offensive language identification in social media (OffensEval 2020). In Proceedings of the Fourteenth Workshop on Semantic Evaluation, pages 1425-1447, Barcelona (online). International Committee for Computational Linguistics.
|
| 285 |
+
|
| 286 |
+
Kaitlyn Zhou, Kawin Ethayarajh, Dallas Card, and Dan Jurafsky. 2022. Problems with cosine as a measure of embedding similarity for high frequency words. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 401-423, Dublin, Ireland. Association for Computational Linguistics.
|
| 287 |
+
|
| 288 |
+
# A Appendix
|
| 289 |
+
|
| 290 |
+
# A.1 Gunel et al. (2021)'s Supervised Contrastive Learning Objective
|
| 291 |
+
|
| 292 |
+
Equation 4 is the supervised contrastive learning objective from Gunel et al. (2021). The dictionary-assisted supervised contrastive learning objective in Equation 1 is similar to Equation 4 except Equation
|
| 293 |
+
|
| 294 |
+
1 is extended to include the keyword-simplified text.
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\begin{array}{l} \mathcal {L} _ {S C L} = \sum_ {i = 1} ^ {N} - \frac {1}{N _ {y _ {i}} - 1} \times \\ \sum_ {j = 1} ^ {N} \mathbb {1} _ {i \neq j} \mathbb {1} _ {y _ {i} = y _ {j}} \log \left[ \frac {\exp \left(\Phi \left(x _ {i}\right) \cdot \Phi \left(x _ {j}\right) / \tau\right)}{\sum_ {k = 1} ^ {N} \mathbb {1} _ {i \neq k} \exp \left(\Phi \left(x _ {i}\right) \cdot \Phi \left(x _ {k}\right) / \tau\right)} \right] \tag {4} \\ \end{array}
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
# A.2 Examples of Dictionaries and Lexicons
|
| 301 |
+
|
| 302 |
+
Table 4 contains a sample of dictionaries across various use cases and academic fields that can be potentially used with DASCL. There is no particular order to the dictionaries, with similar dictionaries clustered together. We did not include any non-open source dictionaries.
|
| 303 |
+
|
| 304 |
+
# A.3 Additional Information for the Few-Shot Learning Experiments with SST-2
|
| 305 |
+
|
| 306 |
+
# A.3.1 Data Description: Few-Shot Training Sets, Validation Set, and Test Set
|
| 307 |
+
|
| 308 |
+
The SST-2 dataset was downloaded using Hugging Face's Datasets library (Lhoest et al., 2021). The test set from SST-2 does not contain any labels, so we use the validation set from SST-2 as our test set. We create our own validation set by randomly sampling a dataset equivalent in size to the original validation set. Our validation set and few-shot learning sets were sampled with no consideration to the label distributions of the original training or validation sets.
|
| 309 |
+
|
| 310 |
+
When $N = 20$ , there are 11 positive examples and 9 negative examples. When $N = 100$ , there are 60 positive examples and 40 negative examples. When $N = 1000$ , there are 558 positive examples and 442 negative examples. Our validation set has 486 positive examples and 386 negative examples. Lastly, our test set has 444 positive examples and 428 negative examples.
|
| 311 |
+
|
| 312 |
+
# A.3.2 Text Preprocessing Steps
|
| 313 |
+
|
| 314 |
+
The only text preprocessing step taken is that nonASCII characters are removed from the dataset. The text is tokenized using a byte-level BPE tokenizer (Liu et al., 2019).
|
| 315 |
+
|
| 316 |
+
# A.3.3 Dictionaries Used During Keyword Simplification
|
| 317 |
+
|
| 318 |
+
We used the opinion lexicon from Hu and Liu (2004). This lexicon consists of two dictionaries: one with all positive unigrams and one with all negative unigrams. There are 2,006 positive words
|
| 319 |
+
|
| 320 |
+
<table><tr><td>Dictionary Name</td><td>Type of Words or Phrases</td><td>Source</td></tr><tr><td>Opinion Lexicon</td><td>Positive/negative sentiment</td><td>Hu and Liu (2004)</td></tr><tr><td>Lexicoder Sentiment Dictionary</td><td>Positive/negative sentiment</td><td>Young and Soroka (2012)</td></tr><tr><td>SentiWordNet</td><td>Sentiment</td><td>Baccianella et al. (2010)</td></tr><tr><td>ANEW</td><td>Emotions</td><td>Bradley and Lang (1999)</td></tr><tr><td>EmoLex</td><td>Emotions</td><td>Mohammad and Turney (2013)</td></tr><tr><td>DepecheMood</td><td>Emotions</td><td>Staiano and Guerini (2014)</td></tr><tr><td>Moodbook</td><td>Emotions</td><td>Wani et al. (2018)</td></tr><tr><td>Moral & Emotion Dictionaries</td><td>Moralization and Emotions</td><td>Brady et al. (2017)</td></tr><tr><td>Emotion Intensity Lexicon</td><td>Emotion intensity</td><td>Mohammad (2018b)</td></tr><tr><td>VAD Lexicon</td><td>Valence, arousal, and dominance of words</td><td>Mohammad (2018a)</td></tr><tr><td>SCL-NMA</td><td>Negators, modals, degree adverbs</td><td>Kiritchenko and Mohammad (2016a)</td></tr><tr><td>SCL-OPP</td><td>Sentiment of mixed polarity phrases</td><td>Kiritchenko and Mohammad (2016b)</td></tr><tr><td>Dictionary of Affect in Language</td><td>Affect of English words</td><td>Whissell (1989, 2009)</td></tr><tr><td>Spanish DAL</td><td>Affect of Spanish words</td><td>Dell' Amerlina Ríos and Gravano (2013)</td></tr><tr><td>Subjectivity Lexicon</td><td>Subjectivity clues</td><td>Wilson et al. (2005)</td></tr><tr><td>Subjectivity Sense Annotations</td><td>Subjectivity disambiguation</td><td>Wiebe and Mihalcea (2006)</td></tr><tr><td>Arguing Lexicon</td><td>Patterns representing arguing</td><td>Somasundaran et al. (2007)</td></tr><tr><td>+/- Effect Lexicon</td><td>Positive/negative effects on entities</td><td>Choi and Wiebe (2014)</td></tr><tr><td>AEELex</td><td>Arabic and English emotion</td><td>Shakil et al. (2021)</td></tr><tr><td>Discrete Emotions Dictionary</td><td>Emotions in news content</td><td>Fioroni et al. (2022)</td></tr><tr><td>Yelp/Amazon Reviews Dictionaries</td><td>Sentiments in reviews</td><td>Kiritchenko et al. (2014)</td></tr><tr><td>VADER</td><td>Sentiments on social media</td><td>Hutto and Gilbert (2014)</td></tr><tr><td>English Twitter Sentiment Lexicon</td><td>Sentiments on social media</td><td>Rosenthal et al. (2015)</td></tr><tr><td>Arabic Twitter Sentiment Lexicon</td><td>Sentiments on social media</td><td>Kiritchenko et al. (2016)</td></tr><tr><td>Hashtag Emotion Lexicon</td><td>Emotions associated with Twitter hashtags</td><td>Mohammad and Kiritchenko (2015)</td></tr><tr><td>Political Polarization Dictionary</td><td>Political polarizing language</td><td>Simchon et al. (2022)</td></tr><tr><td>ed8</td><td>Affective language in German political text</td><td>Widmann and Wich (2022)</td></tr><tr><td>Policy Agendas Dictionary</td><td>Keywords by policy area</td><td>Albaugh et al. (2013)</td></tr><tr><td>"Women" Terms</td><td>Terms related to the category "women"</td><td>Pearson and Dancey (2011)</td></tr><tr><td>Trump's Twitter Insults</td><td>Insults used by President Trump</td><td>Quealy (2021)</td></tr><tr><td>Hate Speech Lexicon</td><td>Hate speech</td><td>Davidson et al. (2017)</td></tr><tr><td>PeaceTech Lab's Hate Speech Lexicons</td><td>Hate speech</td><td>PeaceTech Lab (2022)</td></tr><tr><td>Hatebase</td><td>Hate speech</td><td>Hatebase (2022)</td></tr><tr><td>Hurtlex</td><td>Hate speech</td><td>Bassignana et al. (2018)</td></tr><tr><td>Hate on Display Hate Symbols</td><td>Hate speech and symbols</td><td>American Defamation League (2022)</td></tr><tr><td>Hate speech on Twitter</td><td>Hate speech on Twitter</td><td>Siegel et al. (2021)</td></tr><tr><td>Reddit hate lexicon</td><td>Hate speech on Reddit</td><td>Chandrasekharan et al. (2017)</td></tr><tr><td>Pro/Anti-Lynching</td><td>Pro/anti-lynching terms</td><td>Weaver (2019)</td></tr><tr><td>Grievance Dictionary</td><td>Terms related to grievance</td><td>van der Vegt et al. (2021)</td></tr><tr><td>Economic Sentiment Terms</td><td>Economic sentiment in newspapers</td><td>Hopkins et al. (2017)</td></tr><tr><td>Loughran-McDonald Dictionary</td><td>Financial sentiment</td><td>Loughran and McDonald (2011)</td></tr><tr><td>SentiEcon</td><td>Financial and economic sentiment</td><td>Moreno-Ortiz et al. (2020)</td></tr><tr><td>Financial Phrase Bank</td><td>Phrases expressing financial sentiment</td><td>Malo et al. (2014)</td></tr><tr><td>Stock Market Sentiment Lexicon</td><td>Stock market sentiment</td><td>Oliveira et al. (2016)</td></tr><tr><td>BioLexicon</td><td>Linguistic information of biomedical terms</td><td>Thompson et al. (2011)</td></tr><tr><td>SentiHealth</td><td>Health-related sentiment</td><td>Asghar et al. (2016)</td></tr><tr><td>MEDLINE Abbreviations</td><td>Abbreviations from medical abstracts</td><td>Chang et al. (2002)</td></tr><tr><td>COVID-CORE Keywords</td><td>COVID-19 keywords on Twitter</td><td>Lu and Mei (2022)</td></tr><tr><td>PSi Lexicon</td><td>Performance studies keywords</td><td>Georgelou et al. (2017)</td></tr><tr><td>Concreteness Ratings</td><td>Concreteness of words and phrases</td><td>Brysbaert et al. (2013)</td></tr><tr><td>Word-Colour Association Lexicon</td><td>Word-color associations</td><td>Mohammad (2011)</td></tr><tr><td>Regressive Imagery Dictionary</td><td>Primordial vs. conceptual thinking</td><td>Martindale (1975)</td></tr><tr><td>Empath</td><td>Various lexical categories</td><td>Fast et al. (2016)</td></tr><tr><td>WordNet</td><td>Various lexical categories</td><td>Miller (1995)</td></tr></table>
|
| 321 |
+
|
| 322 |
+
Table 4: A sample of dictionaries that can potentially be used with DASCL. There is no particular order to the dictionaries, with similar dictionaries clustered together. We did not include any non-open source dictionaries.
|
| 323 |
+
|
| 324 |
+
and 4,783 negative words. We replaced the positive words with the token “<positive>”. We replaced the negative words with the token “<negative>”.
|
| 325 |
+
|
| 326 |
+
# A.3.4 Number of Parameters and Runtime
|
| 327 |
+
|
| 328 |
+
This experiment uses the ROBERTA<sub>BASE</sub> pretrained language model, which contains 125 million parameters (Liu et al., 2019). When using DASCL, we also had an additional temperature parameter, $\tau$ , that was directly optimized. With the hyperparameters described in Section A.3.5 and using an NVIDIA V100 GPU, it took approximately 2.1 seconds to train over 40 batches using cross-entropy (CE) alone, 2.2 seconds to train over 40 batches using CE+SCL, and 3.3 seconds to train over 40 batches using CE+DASCL.
|
| 329 |
+
|
| 330 |
+
# A.3.5 Hyperparameter Selection and Configuration Details
|
| 331 |
+
|
| 332 |
+
We take our hyperparameter configuration directly from Gunel et al. (2021). For each configuration, we set the learning rate to $1 \times 10^{-5}$ and used a batch size of 16. When using the SCL objective, in line with Gunel et al. (2021), we set $\lambda = 0.9$ and $\tau = 0.3$ . When using the DASCL objective, we also set $\lambda = 0.9$ and initialized $\tau = 0.3$ . We trained for 100 epochs for all few-shot learning settings.
|
| 333 |
+
|
| 334 |
+
# A.3.6 Model Evaluation Details
|
| 335 |
+
|
| 336 |
+
The model from the epoch with the highest accuracy over our own validation set was chosen as the final model for each random seed. We report accuracy, which is the main metric of interest with this benchmark, and average precision. Average precision is used to summarily quantify the precision-recall tradeoff, and is viewed as the area under the precision-recall curve (Davis and Goadrich, 2006). Average precision is defined as
|
| 337 |
+
|
| 338 |
+
$$
|
| 339 |
+
A P = \sum_ {n} \left(R _ {n} - R _ {n - 1}\right) P _ {n}
|
| 340 |
+
$$
|
| 341 |
+
|
| 342 |
+
where $P_{n}$ and $R_{n}$ are the precision and recall at the nth threshold.
|
| 343 |
+
|
| 344 |
+
# A.3.7 Results over the Validation Set
|
| 345 |
+
|
| 346 |
+
Table 5 reports the accuracy and the average precision over the validation set for the SST-2 few-shot setting experiments. The validation set was used for model selection, so the reported results over the validation set are from the model with the highest accuracy achieved on the validation set across the 100 epochs.
|
| 347 |
+
|
| 348 |
+
<table><tr><td>Loss</td><td>N</td><td>Accuracy</td><td>Avg. Precision</td></tr><tr><td>CE</td><td>20</td><td>.680 ± .043</td><td>.768 ± .062</td></tr><tr><td>CE w/ DA</td><td>20</td><td>.668 ± .025</td><td>.729 ± .034</td></tr><tr><td>CE+SCL</td><td>20</td><td>.707 ± .049</td><td>.797 ± .060</td></tr><tr><td>CE+DASCL</td><td>20</td><td>.743 ± .016</td><td>.839 ± .023</td></tr><tr><td>CE+DASCL w/ DA</td><td>20</td><td>.700 ± .048</td><td>.765 ± .061</td></tr><tr><td>CE</td><td>100</td><td>.832 ± .015</td><td>.905 ± .021</td></tr><tr><td>CE w/ DA</td><td>100</td><td>.849 ± .023</td><td>.915 ± .027</td></tr><tr><td>CE+SCL</td><td>100</td><td>.848 ± .020</td><td>.905 ± .029</td></tr><tr><td>CE+DASCL</td><td>100</td><td>.872 ± .010</td><td>.942 ± .010</td></tr><tr><td>CE+DASCL w/ DA</td><td>100</td><td>.842 ± .020</td><td>.927 ± .010</td></tr><tr><td>CE</td><td>1000</td><td>.900 ± .005</td><td>.958 ± .010</td></tr><tr><td>CE w/ DA</td><td>1000</td><td>.905 ± .006</td><td>.959 ± .005</td></tr><tr><td>CE+SCL</td><td>1000</td><td>.904 ± .038</td><td>.958 ± .016</td></tr><tr><td>CE+DASCL</td><td>1000</td><td>.907 ± .004</td><td>.961 ± .011</td></tr><tr><td>CE+DASCL w/ DA</td><td>1000</td><td>.908 ± .005</td><td>.965 ± .008</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 5: Accuracy and average precision over the SST-2 validation set in few-shot learning settings. Results are averages over 10 random seeds with standard deviations reported.
|
| 351 |
+
|
| 352 |
+
# A.3.8 t-SNE Plots of the Learned Classifier Token Embeddings for the Test Set, N = 20
|
| 353 |
+
|
| 354 |
+
We use t-SNE (van der Maaten and Hinton, 2008) plots to visualize the learned classifier token embeddings, “ $\langle \mathrm{s} \rangle$ ”, over the SST-2 test set when using the cross-entropy objective alone, using the cross-entropy objective with the supervised contrastive learning (SCL) objective (Gunel et al., 2021), and using the cross-entropy objective with the dictionary-assisted supervised contrastive learning (DASCL) objective. These plots are in Figure 3. We see that DASCL draws embeddings of the same class closer and pushes embeddings of different classes farther apart compared to using cross-entropy alone or using cross-entropy with SCL.
|
| 355 |
+
|
| 356 |
+
# A.4 Additional Information for the New York Times Articles about the Economy Experiments
|
| 357 |
+
|
| 358 |
+
# A.4.1 Data Description: Few-Shot Training Set, Validation Set, and Test Set
|
| 359 |
+
|
| 360 |
+
The data for the New York Times articles was downloaded from https://dataverse.harvard.edu/dataset.xhtml?persistentId $\equiv$ doi:
|
| 361 |
+
|
| 362 |
+
10.7910/DVN/MXKRDE. The test set was created using the replication files included at the link. In the original code, there was an error with overlapping training and test sets. We removed the duplicated observations from the training set. Because a single article could be annotated multiple times by different annotators, our validation set was created
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
(a) CE
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
(b) $\mathrm{CE + SCL}$
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
(c) $\mathrm{CE + DASCL}$
|
| 372 |
+
Figure 3: t-SNE plots of the classifier token embeddings on the SST-2 test set fine-tuned using a training set size of 20. The loss configuration is noted below each plot. Blue are negative examples and red are positive examples.
|
| 373 |
+
|
| 374 |
+
using $15\%$ of the unique number of articles in the training data. 452 of the 1,317 labeled articles in the validation set are labeled positive. For our few-shot training sets, when $N = 100$ , there were 41 positive examples. When $N = 1000$ , there were 363 positive examples. Our validation set and few-shot learning sets were sampled with no consideration to the label distributions of the original training or validation sets.
|
| 375 |
+
|
| 376 |
+
# A.4.2 Text Preprocessing Steps
|
| 377 |
+
|
| 378 |
+
The only preprocessing was removing HTML tags that occasionally appeared in the text. The text is tokenized using a byte-level BPE tokenizer.
|
| 379 |
+
|
| 380 |
+
# A.4.3 Dictionaries Used During Keyword Simplification
|
| 381 |
+
|
| 382 |
+
We used two sets of dictionaries during keyword simplification. We first used Lexicoder, downloaded from http://www.snsoroka.com/data-lexicoder/. It is a dictionary specifically designed to study sentiment in news coverage (Young and Soroka, 2012). The dictionary is split into four separate sub-dictionaries: positive words, negative words, "negative" positive words (e.g., "not great"), and "negative" negative words (e.g., "not bad"). There are 1,709 positive words, 2,858 negative words, 1,721 negative positive words, and 2,860 negative negative words. We replaced positive words and negative negative words with the token "<positive)". We replaced negative words and negative positive words with the token "<negative)".
|
| 383 |
+
|
| 384 |
+
The second dictionary we used was the 21 economic terms from Hopkins et al. (2017). The 6 positive economic terms (in stemmed form) are "bull*", "grow*", "growth*", "inflat*", "invest*", and "profit*". The 15 negative economic terms (in stemmed form) are "bad*", "bear*", "debt*", "drop*", "fall*", "fear*", "jobless*", "layoff*", "loss*", "plung*", "problem*", "recess*", "slow*", "slump*", and "unemploy*". We replaced the positive economic words with the token "<positive_econ>". We replaced the negative economic words with the token "<negative_econ>".
|
| 385 |
+
|
| 386 |
+
# A.4.4 Number of Parameters and Runtime
|
| 387 |
+
|
| 388 |
+
This experiment uses the ROBERTA<sub>BASE</sub> pretrained language model, which contains 125 million parameters (Liu et al., 2019). When using DASCL, we also had an additional temperature parameter, $\tau$ , that was directly optimized. With the
|
| 389 |
+
|
| 390 |
+
hyperparameters described in Section A.4.5 and using an NVIDIA V100 GPU, it took approximately 5.7 seconds to train over 40 batches using cross-entropy (CE) alone, 5.7 seconds to train over 40 batches using $\mathrm{CE + SCL}$ , and 10.7 seconds to train over 40 batches using $\mathrm{CE + DASCL}$ .
|
| 391 |
+
|
| 392 |
+
# A.4.5 Hyperparameter Selection and Configuration Details
|
| 393 |
+
|
| 394 |
+
We selected hyperparameters using the validation set. We searched over the learning rate and the temperature initialization; we used $\lambda = 0.9$ for all loss configurations involving contrastive learning. We used a batch size of 8 because of resource constraints. We fine-tuned ROBERTA<sub>BASE</sub> for 5 epochs.
|
| 395 |
+
|
| 396 |
+
For the learning rate, we searched over $\{5 \times 10^{-6}, 1 \times 10^{-5}, 2 \times 10^{-5}\}$ ; for the temperature, $\tau$ , initialization, we searched over $\{0.07, 0.3\}$ . We fine-tuned the model and selected the model from the epoch with the highest accuracy. We repeated this with three random seeds, and selected the hyperparameter configuration with the highest average accuracy. We used accuracy as the criterion because Barbera et al. (2021) used accuracy as the primary metric of interest. The final learning rate across all loss configurations was $5 \times 10^{-6}$ . The final $\tau$ initialization for both SCL and DASCL loss configurations was 0.07. We used these same hyperparameters when we limited the training set to 100 and 1,000 labeled examples.
|
| 397 |
+
|
| 398 |
+
# A.4.6 Model Evaluation Details
|
| 399 |
+
|
| 400 |
+
During fine-tuning, the model from the epoch with the highest accuracy over the validation set was chosen as the final model for each random seed. We report accuracy, which is the main metric of interest with this dataset, and average precision. For a definition of average precision, see Section A.3.6.
|
| 401 |
+
|
| 402 |
+
The results in Table 2 for logistic regression using the full training set differ slightly from their paper because of an error in overlapping training and test sets in the original splits.
|
| 403 |
+
|
| 404 |
+
# A.4.7 Additional Classification Metrics: Precision and Recall
|
| 405 |
+
|
| 406 |
+
Table 6 contains additional classification metrics—precision and recall—for the test set when using 100, 1,000, and all labeled examples from the training set for fine-tuning.
|
| 407 |
+
|
| 408 |
+
<table><tr><td>Loss</td><td>N</td><td>Precision</td><td>Recall</td></tr><tr><td>L2 Logit</td><td>100</td><td>.000</td><td>.000</td></tr><tr><td>CE</td><td>100</td><td>.646 ± .079</td><td>.359 ± .126</td></tr><tr><td>CE+DA</td><td>100</td><td>.656 ± .096</td><td>.312 ± .170</td></tr><tr><td>SCL</td><td>100</td><td>.000 ± .000</td><td>.000 ± .000</td></tr><tr><td>DASCL</td><td>100</td><td>.653 ± .044</td><td>.519 ± .055</td></tr><tr><td>DASCL+DA</td><td>100</td><td>.690 ± .051</td><td>.475 ± .093</td></tr><tr><td>L2 Logit</td><td>1000</td><td>.542</td><td>.160</td></tr><tr><td>CE</td><td>1000</td><td>.670 ± .028</td><td>.526 ± .074</td></tr><tr><td>CE+DA</td><td>1000</td><td>.658 ± .029</td><td>.527 ± .089</td></tr><tr><td>SCL</td><td>1000</td><td>.674 ± .017</td><td>.543 ± .046</td></tr><tr><td>DASCL</td><td>1000</td><td>.684 ± .032</td><td>.575 ± .069</td></tr><tr><td>DASCL+DA</td><td>1000</td><td>.682 ± .036</td><td>.592 ± .062</td></tr><tr><td>L2 Logit</td><td>Full</td><td>.689</td><td>.315</td></tr><tr><td>CE</td><td>Full</td><td>.690 ± .036</td><td>.663 ± .055</td></tr><tr><td>CE+DA</td><td>Full</td><td>.696 ± .033</td><td>.643 ± .056</td></tr><tr><td>SCL</td><td>Full</td><td>.700 ± .036</td><td>.652 ± .053</td></tr><tr><td>DASCL</td><td>Full</td><td>.709 ± .021</td><td>.640 ± .041</td></tr><tr><td>DASCL+DA</td><td>Full</td><td>.718 ± .031</td><td>.628 ± .060</td></tr></table>
|
| 409 |
+
|
| 410 |
+
Table 6: Precision and recall over the economic media test set (Barberá et al., 2021) when using 100, 1000, and all labeled examples from the training set for fine-tuning. Except for the logistic regression model, results are averages over 10 random seeds with standard deviations reported.
|
| 411 |
+
|
| 412 |
+
# A.4.8 Results over the Validation Set
|
| 413 |
+
|
| 414 |
+
Table 7 reports the accuracy, precision, recall, and average precision over the validation set for the economic media data. The validation set was used for model selection, so the reported results over the validation set are from the model with the highest accuracy achieved on the validation set across the 5 epochs.
|
| 415 |
+
|
| 416 |
+
# A.4.9 t-SNE Plots of the Learned Classifier Token Embeddings for the Test Set
|
| 417 |
+
|
| 418 |
+
We use t-SNE plots to visualize the learned classifier token embeddings, “<s>”, over the New York Times articles about the economy test set when using the cross-entropy objective alone, using the cross-entropy objective with the supervised contrastive learning (SCL) objective (Gunel et al., 2021), and using the cross-entropy objective with the dictionary-assisted supervised contrastive learning (DASCL) objective. These plots are in Figure 4. We see that DASCL pushes embeddings of different classes farther apart compared to using cross-entropy alone or using cross-entropy with SCL.
|
| 419 |
+
|
| 420 |
+
# A.5 Additional Information for the AbusEval Experiments
|
| 421 |
+
|
| 422 |
+
# A.5.1 Data Description: Few-Shot Training Set, Validation Set, and Test Set
|
| 423 |
+
|
| 424 |
+
The data was downloaded from https://github. com/tommasoc80/AbuseEval. Because there was no validation set, we created our own validation set by sampling $15\%$ of the training set. 399 of the 1,986 tweets in the validation set are labeled abusive. For our few-shot training sets, when $N = 100$ , 17 tweets are labeled abusive. When $N = 1000$ , 210 tweets are labeled abusive. Our validation set and few-shot learning sets were sampled with no consideration to the label distributions of the original training or validation sets.
|
| 425 |
+
|
| 426 |
+
# A.5.2 Text Preprocessing Steps
|
| 427 |
+
|
| 428 |
+
We preprocessed the text of the tweets in the following manner: we removed all HTML tags, removed all URLs (even the anonymized URLs), removed the anonymized @ tags, removed the retweet ("RT") tags, and removed all "&" tags. The text is tokenized using the WordPiece tokenizer (Devlin et al., 2019).
|
| 429 |
+
|
| 430 |
+
# A.5.3 Dictionaries Used During Keyword Simplification
|
| 431 |
+
|
| 432 |
+
We used two sets of dictionaries during keyword simplification. For the first dictionary, we used Lexicoder. For a description of the Lexicoder dictionary, see Section A.4.3. We used the same token-replacements as described in Section A.4.3.
|
| 433 |
+
|
| 434 |
+
The second dictionary used was a dictionary of "us" and "them" pronouns. These pronouns are intended to capture directed or indirected abuse. The "us" pronouns are "we're", "we'll", "we'd", "we've", "we", "me", "us", "ours", and "let's". The "them" pronouns are "you're", "you've", "you'll", "you'd", "yours", "your", "you", "theirs", "their", "they're", "they", "them", "people", "men", "women", "man", "woman", "mob", "y'all", and "rest." This dictionary is loosely based on suggested words found in Alorainy et al. (2019).
|
| 435 |
+
|
| 436 |
+
# A.5.4 Number of Parameters and Runtime
|
| 437 |
+
|
| 438 |
+
This experiment uses the BERT<sub>BASE-UNCASED</sub> pretrained language model, which contains 110 million parameters (Liu et al., 2019). When using DASCL, we also had an additional temperature parameter, $\tau$ , that was directly optimized. With the hyperparameters described in Section A.5.5 and using an NVIDIA V100 GPU, it took approximately
|
| 439 |
+
|
| 440 |
+
<table><tr><td>Loss</td><td>Accuracy</td><td>Precision</td><td>Recall</td><td>Avg. Precision</td></tr><tr><td>CE</td><td>.723 ± .004</td><td>.644 ± .022</td><td>.438 ± .054</td><td>.605 ± .007</td></tr><tr><td>CE w/ DA</td><td>.726 ± .004</td><td>.662 ± .035</td><td>.423 ± .059</td><td>.607 ± .007</td></tr><tr><td>CE+SCL</td><td>.727 ± .003</td><td>.659 ± .037</td><td>.438 ± .065</td><td>.611 ± .006</td></tr><tr><td>CE+DASCL</td><td>.724 ± .006</td><td>.655 ± .020</td><td>.416 ± .037</td><td>.610 ± .007</td></tr><tr><td>CE+DASCL w/ DA</td><td>.724 ± .004</td><td>.662 ± .031</td><td>.406 ± .051</td><td>.609 ± .006</td></tr></table>
|
| 441 |
+
|
| 442 |
+
Table 7: Accuracy, precision, recall, and average precision over the validation set for economic media (Barberá et al., 2021). Results are averages over 10 random seeds with standard deviations reported.
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
|
| 446 |
+

|
| 447 |
+
|
| 448 |
+

|
| 449 |
+
(a) CE
|
| 450 |
+
(b) $\mathrm{CE} + \mathrm{SCL}$
|
| 451 |
+
(c) $\mathrm{CE + DASCL}$
|
| 452 |
+
Figure 4: t-SNE plots of the classifier token embeddings on the New York Times articles about the economy test set fine-tuned using the full training set. The loss configuration is noted below each plot. Blue are negative examples and red are positive examples.
|
| 453 |
+
|
| 454 |
+
2.6 seconds to train over 40 batches using cross-entropy (CE) alone and 4.9 seconds to train over 40 batches using CE+DASCL.
|
| 455 |
+
|
| 456 |
+
# A.5.5 Hyperparameter Selection and Configuration Details
|
| 457 |
+
|
| 458 |
+
We selected hyperparameters using the validation set. We searched over the learning rate and the temperature initialization; again, we used $\lambda = 0.9$ for all loss configurations involving contrastive learning. In line with Caselli et al. (2021), we used a batch size of 32. We fine-tuned BERT<sub>BASE-UNCASED</sub> and HateBERT for 5 epochs.
|
| 459 |
+
|
| 460 |
+
For the learning rate, we searched over $\{1 \times 10^{-6}, 2 \times 10^{-6}, 3 \times 10^{-6}, 4 \times 10^{-6}, 5 \times 10^{-6}, 1 \times 10^{-5}, 2 \times 10^{-5}\}$ ; for the temperature, $\tau$ , initialization, we searched over $\{0.07, 0.3\}$ . We fine-tuned the model and selected the model from the epoch with the highest F1 over the positive class. We repeated this with three random seeds, and selected the hyperparameter configuration with the highest average F1 over the positive class. We used the F1 score over the positive class as the criterion because it is one of the metrics of interest in Caselli et al. (2021). The final learning rate across all loss configurations was $2 \times 10^{-6}$ . The final $\tau$ initialization for both SCL and DASCL loss configurations was 0.3. We note that our hyperparameter search yielded a different set of hyperparameters from Caselli et al. (2021). We used these same hyperparameters when we limited the training set to 100 and 1,000 labeled examples.
|
| 461 |
+
|
| 462 |
+
# A.5.6 Model Evaluation Details
|
| 463 |
+
|
| 464 |
+
During fine-tuning, the model from the epoch with the highest F1 over the validation set was chosen as the final model for each random seed. We report macro F1 and F1, the main metrics of interest with this dataset, and average precision. For a definition of average precision, see Section A.3.6.
|
| 465 |
+
|
| 466 |
+
# A.5.7 Results over the Validation Set
|
| 467 |
+
|
| 468 |
+
Table 8 reports the macro F1, F1, and average precision over the validation set for AbusEval. The validation set was used for model selection, so the reported results over the validation set are from the model with the highest F1 achieved on the validation set across the 5 epochs.
|
| 469 |
+
|
| 470 |
+
# A.5.8 t-SNE Plots of the Learned Classifier Token Embeddings for the Test Set
|
| 471 |
+
|
| 472 |
+
We use t-SNE plots to visualize the learned classifier token embeddings, “<s>”, over the AbusEval
|
| 473 |
+
|
| 474 |
+
<table><tr><td>Model</td><td>Macro F1</td><td>F1, Pos</td><td>Avg. Precision</td></tr><tr><td>BERT</td><td>.756 ± .006</td><td>.632 ± .008</td><td>.681 ± .014</td></tr><tr><td>HateBERT</td><td>.754 ± .009</td><td>.635 ± .008</td><td>.708 ± .005</td></tr><tr><td>BERT+
|
| 475 |
+
DASCL</td><td>.759 ± .007</td><td>.639 ± .007</td><td>.683 ± .012</td></tr><tr><td>HateBERT+
|
| 476 |
+
DASCL</td><td>.755 ± .005</td><td>.635 ± .005</td><td>.706 ± .006</td></tr></table>
|
| 477 |
+
|
| 478 |
+
Table 8: The macro F1, F1, and average precision over the AbusEval validation set (Caselli et al., 2020). Results are averages over 10 random seeds with standard deviations reported.
|
| 479 |
+
|
| 480 |
+
test set when using BERT and when using BERT with DASCL. These plots are in Figure 5. We see that using DASCL with BERT pushes embeddings of different classes farther apart compared to using BERT alone.
|
| 481 |
+
|
| 482 |
+

|
| 483 |
+
(a) BERT
|
| 484 |
+
|
| 485 |
+

|
| 486 |
+
(b) BERT with DASCL
|
| 487 |
+
Figure 5: t-SNE plots of the classifier token embeddings on the AbusEval test set fine-tuned using the full training set. The model is noted below each plot. Blue are examples of non-abusive tweets and red are examples of abusive tweets.
|
dictionaryassistedsupervisedcontrastivelearning/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f10bd5a815eabe142ce814a6f94a19ef7294a5f58528489d510c4eedd7157000
|
| 3 |
+
size 1263217
|
dictionaryassistedsupervisedcontrastivelearning/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4bd6c46ae677ab4298e59319d0cf73c4d32a0e82b8e8dfdf191ec152dd7aabf0
|
| 3 |
+
size 552572
|
differentiabledataaugmentationforcontrastivesentencerepresentationlearning/0b9de31a-e330-433b-b996-a1ca7bf3d3fc_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d5a4b864963c1003ea7fba224dd3a3113af528b802a06ca1b455ecf6acd129c
|
| 3 |
+
size 106708
|
differentiabledataaugmentationforcontrastivesentencerepresentationlearning/0b9de31a-e330-433b-b996-a1ca7bf3d3fc_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c3ec678072654fa56193a39fac2060d2abc44ceb5613048cc1ec17971bda6e6c
|
| 3 |
+
size 126579
|