diff --git a/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_content_list.json b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2233f7ef9f27fcb094cc70cb099c42000728c0fc --- /dev/null +++ b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be5f9863eaf30ea1929efcbb6f9b3a911f6dec5a1114c91033651bdc34d3958d +size 103315 diff --git a/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_model.json b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5aa495f00b818b6cd6b985f2e672b8715c482ae6 --- /dev/null +++ b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38774f37258e4d29773a5b004c11a3ce5bfa33ea42fa57287704bd96a528d2a6 +size 124405 diff --git a/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_origin.pdf b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c6577a2578fd8117cb00f23b7c33a07ae9fd9d67 --- /dev/null +++ b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/774f5cc8-5cfe-41fb-905e-9679f75d52b8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0b793fbce001f05f9c92994c8b0ceb87ef82aac1b1e5d9b12878a9c55c04025 +size 1401865 diff --git a/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/full.md b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..219a123dcc59dae9c037f29a2cf958aef769ec58 --- /dev/null +++ b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/full.md @@ -0,0 +1,500 @@ +# Enabling Multimodal Generation on CLIP via Vision-Language Knowledge Distillation + +Wenliang Dai $^{1}$ , Lu Hou $^{2}$ , Lifeng Shang $^{2}$ , Xin Jiang $^{2}$ , Qun Liu $^{2}$ , Pascale Fung $^{1}$ + +$^{1}$ Hong Kong University of Science and Technology, $^{2}$ Huawei Noah's Ark Lab + +wdaiai@connect.ust.hk, pascale@ece.ust.hk, + +{houlu3, shang.lifeng, jiang.xin, qun.liu} @huawei.com + +# Abstract + +The recent large-scale vision-language pretraining (VLP) of dual-stream architectures (e.g., CLIP) with a tremendous amount of image-text pair data, has shown its superiority on various multimodal alignment tasks. Despite its success, the resulting models are not capable of multimodal generative tasks due to the weak text encoder. To tackle this problem, we propose to augment the dual-stream VLP model with a textual pre-trained language model (PLM) via vision-language knowledge distillation (VLKD), enabling the capability for multimodal generation. VLKD is pretty data- and computation-efficient compared to the pre-training from scratch. Experimental results show that the resulting model has strong zero-shot performance on multimodal generation tasks, such as open-ended visual question answering and image captioning. For example, it achieves $44.5\%$ zero-shot accuracy on the VQAv2 dataset, surpassing the previous state-of-the-art zero-shot model with $7\times$ fewer parameters. Furthermore, the original textual language understanding and generation ability of the PLM is maintained after VLKD, which makes our model versatile for both multimodal and unimodal tasks. + +# 1 Introduction + +Recent large-scale dual-stream Vision-Language Pre-training (VLP) models like CLIP (Radford et al., 2021) and ALIGN (Jia et al., 2021), have shown remarkable performance on various downstream multimodal alignment tasks, e.g., image-text retrieval and image classification. These models are pre-trained using cross-modal contrastive learning on tremendous image-text pairs and learn strong multimodal representations. Despite their success, as mentioned by Radford et al. (2021), their text encoder is relatively weak by only having a discriminative multimodal pre-training objective, + +![](images/baf86575c8eeb3a556f985782d7913f3de4f33670f3fd5be3018906ec4d6b103.jpg) +Figure 1: Intuition of our proposed approach. After VLKD, the model can fill in the masked locations with meaningful words to describe the image without further finetuning. Moreover, it can answer questions with proper reasoning over the given images and pre-trained knowledge inside PLMs, e.g., a napkin is for wiping the face at meals. + +which makes them incompetent on generative multimodal tasks such as image captioning and open-ended visual question answering (VQA). + +Meanwhile, the Transformer-based (Vaswani et al., 2017) auto-regressive large-scale pre-trained language models (PLMs), such as GPT (Radford and Narasimhan, 2018; Brown et al., 2020), have been dominating in the natural language generation (NLG) tasks. These models are usually trained with causal self-attention, which only allows the model to attend to past outputs (unidirectional) to satisfy their generative nature. More recently, BART (Lewis et al., 2020) and T5 (Raffel et al., 2020) propose to augment the auto-regressive decoder with a bidirectional Transformer encoder to + +further capture bidirectional information of the input. These encoder-decoder architectures excel on not only NLG but also understanding (NU) tasks. + +To tackle the aforementioned limitations of dual-stream VLP models and fully utilize PLMs, in this paper, we present Vision-Language Knowledge Distillation (VLKD), a simple yet effective approach to enable CLIP to perform generative multimodal tasks through knowledge distillation. Specifically, we align the BART encoder to CLIP's joint multimodal embedding space to gain the understanding of multimodal knowledge, along with an image-conditioned language modeling loss to consort BART encoder and decoder. During training, we freeze CLIP's weights to keep its learned multimodal space. For the finetuning and inference of downstream tasks, the original CLIP text encoder is discarded, which can be interpreted as being replaced by the distilled BART. Therefore, we leverage the strengths from both sides, the expressive multimodal representation space of CLIP and the strong text generation capability of BART. + +Compared to VLP from scratch, VLKD uses several magnitudes fewer image-text pairs and computational resources. As depicted in Figure 1, after VLKD pre-training, the model exhibits strong zero-shot performance on generative multimodal tasks, including open-ended VQA and image captioning. Without finetuning, it has the ability to generate answers by reasoning over the question, the visual information, and the textual knowledge embedded in the pre-trained BART. Furthermore, it can also directly generate a plausible caption given an image. Empirical results show that our model achieves $44.5\%$ accuracy on the VQAv2 dataset and 84.6 CIDEr on COCO image caption dataset in a zero-shot manner. Moreover, the original NLU and NLG ability of BART is maintained, which makes the model versatile for both multimodal and unimodal tasks. + +To summarize, our contributions are: 1) We introduce an efficient approach to distill knowledge from the dual-stream VLP model CLIP to BART. The resulting model shows strong zero-shot performance on generative multimodal tasks, as well as pure NLP tasks; 2) We exhaustively quantify these capabilities on six benchmarks under various settings; and 3) We conduct comprehensive analysis and ablation study to provide insights and grease future work on this direction. + +# 2 Related Work + +# 2.1 Vision-language Pre-training + +Based on how the two modalities interact, recent VLP models mainly fall into two categories: single-stream and dual-stream models. Single-stream models (Chen et al., 2020; Li et al., 2019; Ramesh et al., 2021; Lin et al., 2021; Kim et al., 2021a; Shen et al., 2022) concatenate the patch-wise or regional visual features and textual embeddings and feed them into a single model. Dual-stream models (Lu et al., 2019; Radford et al., 2021; Jia et al., 2021; Zhai et al., 2021; Yao et al., 2022) use separate encoders for images and texts, allowing efficient inference for downstream multimodal alignment tasks like image-text retrieval, by pre-computing image/text features offline. However, these models can not be directly used for multimodal generation tasks. In this paper, we propose an efficient method to align the dual-stream VLP model CLIP's multimodal embedding space with a powerful PLM BART to gain multimodal generation ability. + +There are also VLP models that can perform multimodal generation tasks, by expensive pretraining with objective of image-conditioned autoregressive language modeling (Lin et al., 2021; Wang et al., 2021; Hu et al., 2021; Li et al., 2022). However, the pre-training of these models requires a large number of image-text pairs and numerous computation resources. Other models like (Agrawal et al., 2019; Li et al., 2019, 2020; Cho et al., 2021; Li et al., 2021) rely on an extra pretrained object detector such as Faster-RCNN with labeled bounding-box data to extract image regional features offline and are less scalable. + +# 2.2 Knowledge Distillation + +Knowledge distillation (KD) in deep learning is first proposed by Hinton et al. (2015), which transfers knowledge embedded in the logits learned in a cumbersome teacher model to a smaller student model without sacrificing too much performance. Besides logits, other forms of knowledge like the intermediate representations and attentions (Jiao et al., 2019; Hou et al., 2020) have also been used in transferring the knowledge embedded in Transformer-based models. Recently, contrastive representation distillation (Tian et al., 2019) distills the knowledge from the teacher network to the student network by maximizing the mutual information between the two networks, and is recently extended to transfer the knowledge from the pre + +trained multimodal model CLIP for zero-shot detection (Gu et al., 2021) and multilingual setting (Jain et al., 2021). In this paper, we apply the conventional KD as well as the contrastive KD to transfer the knowledge from the pre-trained CLIP to BART. Besides, we also propose to transfer the knowledge in CLIP image encoder to BART decoder through the cross-attention. + +# 3 Proposed Method + +We propose to distill multimodal knowledge from CLIP to BART for generative multimodal tasks, which takes the strengths from both sides (powerful multimodal representations of CLIP and text generation ability of BART). To this end, we propose three objectives (Section 3.2). The overall architecture is illustrated in Figure 2. + +# 3.1 Model Architecture + +CLIP. CLIP (Radford et al., 2021) is a dual-stream VLP model pre-trained with a contrastive loss on 400 million image-text pairs. It consists of a text encoder which is a GPT (Radford et al., 2019) style Transformer model, and an image encoder which can be either a Vision Transformer (ViT) (Dosovitskiy et al., 2020) or Residual Convolutional Neural Network (ResNet) (He et al., 2016). CLIP learns a joint multimodal embedding space with its text encoder and image encoder aligned. Given an input image-text pair, the image encoder first reshapes the image into a sequence of 2D patches and then maps them into 1D embeddings with a prepended [CLS] token using a trainable linear projection. These embeddings are fed into the CLIP image encoder together with positional encodings. The output embedding of the [CLS] token can represent the whole image. For the text sentence, it is bracketed with [SOS] and [EOS] tokens, and the output embedding of the latter is used as the sentence-level representation. In this paper, we explore four CLIP variants, including ViT-B/16, ViT-L/14, RN50×16, and RN50×64. + +BART. BART is a Transformer-based (Vaswani et al., 2017) sequence-to-sequence model that has a bi-directional encoder and a uni-directional (left-to-right) decoder, which can be seen as a generalization of the BERT (Devlin et al., 2019) and GPT (Radford and Narasimhan, 2018). It is pretrained on 160GB text data in a self-supervised way by performing the text span infilling task with the input sentences corrupted and shuffled. Similar to + +the CLIP text encoder, BART also tokenizes and converts the input text into a sequence of embeddings, which are then fed into the BART encoder. BART excels at both NLG (e.g., abstractive summarization) and NLU tasks. + +# 3.2 Training Objectives + +To distill multimodal knowledge from CLIP to BART, we propose three objective functions: 1) Text-Text Distance Minimization (TTDM); 2) Image-Text Contrastive Learning (ITCL); and 3) Image-Conditioned Text Infilling (ICTI). During training, the model parameters of CLIP are frozen constantly, i.e. no gradients will be backpropagated through them (marked as SG in Figure 2), to ensure its two encoders are still aligned and the multimodal knowledge is not forgotten. + +For each training batch with $B$ image-text pairs, denote the $k$ -th image-text pair as $\mathbf{x}^k = \{\mathbf{x}_I^k,\mathbf{x}_T^k\}$ , and the output of multimodal encoders of CLIP and BART encoder as + +$$ +\operatorname {C L I P} _ {I} \left(\mathbf {x} _ {I} ^ {k}\right)\rightarrow \mathbf {V} ^ {k} = \left[ \mathbf {v} _ {c l s} ^ {k}, \mathbf {v} _ {1} ^ {k}, \dots , \mathbf {v} _ {n _ {1}} ^ {k} \right], +$$ + +$$ +\operatorname {C L I P} _ {T} \left(\mathbf {x} _ {T} ^ {k}\right)\rightarrow \mathbf {T} ^ {k} = \left[ \mathbf {t} _ {s o s} ^ {k}, \mathbf {t} _ {1} ^ {k}, \dots , \mathbf {t} _ {n _ {2}} ^ {k}, \mathbf {t} _ {e o s} ^ {k} \right], +$$ + +$$ +\mathrm {B A R T} _ {e n c} (\mathbf {x} _ {T} ^ {k}) \rightarrow \mathbf {E} ^ {k} = [ \mathbf {e} _ {b o s} ^ {k}, \mathbf {e} _ {1} ^ {k}, \dots , \mathbf {e} _ {n _ {3}} ^ {k}, \mathbf {e} _ {e o s} ^ {k} ]. +$$ + +Here, $n_1$ is the number of image patches, $n_2$ and $n_3$ denote the sequence lengths of the text encoder of CLIP and BART, respectively. $\mathbf{v}_{*}^{k}, \mathbf{t}_{*}^{k} \in \mathbb{R}^{d_{1}}$ represents the $\ell_2$ -normalized output embedding from the CLIP image and text encoder at a certain position. $\mathbf{e}_{*}^{k}$ is the unnormalized raw output embedding from the BART encoder. In the following, we elaborate on the three distillation objectives. + +# 3.2.1 Text-Text Distance Minimization + +To align the CLIP text encoder and BART encoder, i.e. making their output representations close given the same input text, we propose to minimize the $\ell_2$ distance between their sequence-level output representations. Specifically, for the $k$ -th input text, it can be formulated as + +$$ +\bar {\mathbf {e}} _ {\text {n o r m}} ^ {k} = \mathbf {W} _ {e} \bar {\mathbf {e}} ^ {k} / \| \mathbf {W} _ {e} \bar {\mathbf {e}} ^ {k} \| _ {2}, +$$ + +$$ +\mathcal {L} _ {T T D M} = \frac {1}{B} \sum_ {k = 1} ^ {B} \| \mathbf {t} _ {e o s} ^ {k} - \bar {\mathbf {e}} _ {\mathrm {n o r m}} ^ {k} \| ^ {2}, +$$ + +where $\bar{\mathbf{e}}^k\in \mathbb{R}^{d_2}$ is the average of all output embeddings from the BART encoder, and $\mathbf{W}_e\in \mathbb{R}^{d_1\times d_2}$ is a weight matrix to linearly project the output of BART encoder to CLIP's multimodal space. + +![](images/7875b006513f23347547c68a38d7760044d1cc2493d914963d6a332b4e35ee58.jpg) +(a) The TTDM and ITCL losses. + +![](images/cb4a89b2fae35db9ea68842d5e327a23cca81816844cbb639747cc15f0431bfe.jpg) +(b) The ICTI loss. +Figure 2: Architecture of the proposed VLKD method to distill multimodal knowledge from CLIP to BART. (a) shows the $TTDM$ and $ITCL$ losses between the dual-stream CLIP encoders and BART encoder. (b) illustrates the ICTI loss for image-conditioned language modeling. SG denotes the stop gradient operation, indicating that no gradients will be back-propagated through that part of model parameters. + +# 3.2.2 Image-Text Contrastive Learning + +Contrastive training has been shown to be very effective in cross-modal representation learning (Tian et al., 2020; Sigurdsson et al., 2020; Zhang et al., 2020; Radford et al., 2021). To further adapt the BART encoder to CLIP's multimodal space, we optimize a symmetric InfoNCE loss between the output representations of the BART encoder and CLIP image encoder. The image-to-text contrastive loss $\mathcal{L}_{i2t}$ is formulated as + +$$ +\mathcal {L} _ {i 2 t} = - \frac {1}{B} \sum_ {k = 1} ^ {B} \log \frac {\exp \big (\mathbf {v} _ {c l s} ^ {k \top} \bar {\mathbf {e}} _ {\mathrm {n o r m}} ^ {k} / \tau \big)}{\sum_ {j} \exp \big (\mathbf {v} _ {c l s} ^ {k \top} \bar {\mathbf {e}} _ {\mathrm {n o r m}} ^ {j} / \tau \big)}, +$$ + +where $\tau$ is a learnable temperature parameter. Different from Radford et al. (2021), we find that not clamping the $\tau$ shows a slight improvement. Similarly, the text-to-image contrastive loss $\mathcal{L}_{t2i}$ is + +$$ +\mathcal {L} _ {t 2 i} = - \frac {1}{B} \sum_ {k = 1} ^ {B} \log \frac {\exp \left(\mathbf {v} _ {c l s} ^ {k \top} \bar {\mathbf {e}} _ {\mathrm {n o r m}} ^ {k} / \tau\right)}{\sum_ {j} \exp \left(\mathbf {v} _ {c l s} ^ {j \top} \bar {\mathbf {e}} _ {\mathrm {n o r m}} ^ {k} / \tau\right)}. +$$ + +Then, the ITCL loss can be calculated as + +$$ +\mathcal {L} _ {I T C L} = \frac {1}{2} \big (\mathcal {L} _ {i 2 t} + \mathcal {L} _ {t 2 i} \big). +$$ + +Note that when computing the ITCL and TTDM losses, we do not introduce any new linear projections to the CLIP output features to avoid destroying the pre-trained alignment between its image and text encoders. Instead, we add one linear layer (parameterized by $\mathbf{W}_e$ ) to project the BART encoder to CLIP's representation space and match their feature dimension. + +# 3.2.3 Image-Conditioned Text Infilling + +With only TTDM and ITCL, the BART decoder is not updated at all. To consort BART encoder and decoder, we propose to perform the text span infilling task conditioned on the corresponding image features. As depicted in Figure 2b, for the $k$ -th image-text pair, following Lewis et al. (2020), we corrupt the input text by masking $15\%$ of whole-word tokens with span lengths drawn from a Poisson Distribution with $\lambda = 3$ . + +Considering that $\mathbf{V}^k$ and $\mathbf{W}_e\mathbf{E}^k$ are already aligned in the CLIP's multimodal space through TTDM and ITCL, and having a different feature dimension with the BART decoder, we further project them to the BART decoder dimension with $\mathbf{W}_i$ and $\mathbf{W}_e^\prime$ . Then, we concatenate them together as $\mathbf{C}^k$ before feeding into the BART decoder as shown in Eq.(1). As mentioned in Section 3.1, we explore two variants of CLIP. With a slight abuse of notation, for ResNet-based CLIP, $\mathbf{V}^k$ is composed of representations of all image patches $\{\mathbf{v}_i^k\}_{i=1}^{n_1}$ while for ViT-based CLIP, $\mathbf{V}^k$ consists of the representation of the [CLS] token $\mathbf{v}_{cls}^k$ only. + +Note that the weight matrix $\mathbf{W}_e^{\prime}$ is initialized to be the pseudo-inverse of $\mathbf{W}_e$ , such that text representations after the two projections $\mathbf{W}_e^{\prime}\mathbf{W}_e\mathbf{E}^k$ are the closest to the original pre-trained BART encoder space at initialization1. The BART decoder then interacts with $\mathbf{C}^k$ through standard Transformer cross-attention layers. We optimize a lan + +guage modeling loss $\mathcal{L}_{ICTI}$ by minimizing the negative log-likelihood in Eq.(2), in which $\mathbf{w}_j$ denotes the token to be predicted at each decoding step. + +$$ +\mathbf {C} ^ {k} = \operatorname {c o n c a t} \left(\mathbf {W} _ {i} \mathbf {V} ^ {k}, \mathbf {W} _ {e} ^ {\prime} \mathbf {W} _ {e} \mathbf {E} ^ {k}\right), \tag {1} +$$ + +$$ +\mathcal {L} _ {I C T I} = - \frac {1}{B} \sum_ {k = 1} ^ {B} \sum_ {j} \log P \left(\mathbf {w} _ {j} ^ {k} \mid \mathbf {w} _ {< j} ^ {k}, \mathbf {C} ^ {k}\right). (2) +$$ + +The ICTI loss is crucial for our methodology to work, as it not only coordinates the BART encoder and decoder, but also enables the BART decoder to understand the multimodal information by recovering texts with visual clues. + +Finally, we simultaneously optimize the summation of three losses $\mathcal{L}$ as + +$$ +\mathcal {L} = \gamma \mathcal {L} _ {T T D M} + \mathcal {L} _ {I T C L} + \mathcal {L} _ {I C T I}, +$$ + +where $\gamma$ is set to $10^{3}$ by default, as $\mathcal{L}_{ITCL},\mathcal{L}_{ICTI}$ are about three magnitudes larger than $\mathcal{L}_{TTDM}$ . + +# 3.3 Datasets for VLKD + +Our model is trained on the Conceptual Captions (CC3M) (Sharma et al., 2018) dataset, which contains 3 million image-text pairs crawled from the Internet. For larger model variants (ViT-L/14 and RN50x64), we further include the Visual Genome Caption data which contains $\sim 700\mathrm{K}$ image-text pairs. No images for pre-training appear in the downstream datasets. Compared to previous VLP work (Radford et al., 2021; Jia et al., 2021; Wang et al., 2021), VLKD is much cheaper by leveraging several magnitudes less data. Furthermore, we experiment with even smaller data (1M, 100K) by uniformly sampling a subset of CC3M to test the limit of dataset size of VLKD, with results discussed in Section 5. + +# 4 Experiments + +To demonstrate the effectiveness of VLKD, we evaluate it on generative multimodal tasks for both zero-shot and finetuning. Specifically, we test the image captioning task, and also the VQA task under the open-ended scenario. Furthermore, we also run the model on NLU and NLG tasks to investigate the influence of VLKD on the text processing ability of the original pre-trained BART. + +# 4.1 Finetuning Datasets + +Image Captioning. Image captioning requires the model to generate a relevant description given an image. We use the COCO image caption + +dataset (Lin et al., 2014) with the Karpathy split (Karpathy and Fei-Fei, 2017). Additionally, we use the NoCaps (Agrawal et al., 2019) dataset to test the model performance when there are out-of-domain objects. + +Open-Ended VQA. Unlike previous works (Anderson et al., 2018; Chen et al., 2020; Li et al., 2020; Yu et al., 2021a; Zhang et al., 2021; Kim et al., 2021b) that treat the VQA task as a discriminative problem, we let the model generate answers freely, which is more aligned with the real-world scenario of this task. We use the standard VQAv2 (Goyal et al., 2017), and also OK-VQA (Marino et al., 2019) which requires knowledge to answer questions correctly. + +NLU and NLG. For NLU, we test our model on the GLUE benchmark (Wang et al., 2019), which consists of nine text classification tasks. We exclude the WNLI task as it is problematic2. For NLG, we test the abstractive summarization task on XSUM (Narayan et al., 2018) dataset, which requires the model to comprehend long texts and generate short summaries with key information. + +# 4.2 Implementation Details + +We use BART-large as the pre-trained backbone NLP model, which has 12 layers in both encoder and decoder with a hidden size of 1024 and 16 heads in each multi-head attention (MHA) layer. In total, it contains 406M parameters. For the pre-trained CLIP (Radford et al., 2021) model, we report four variants with different visual backbones, including ViT-B/16, ViT-L/14, $\mathrm{RN}50\times 16$ and $\mathrm{RN}50\times 64$ . + +We use 64 Nvidia V100 GPUs for VLKD and 8 for the finetuning of downstream tasks. In total, we pre-train the model for 10 epochs, which takes about 5 hours. We use a batch size of 4608 for ViT-B/16 and ViT-L/14, 4096 for RN50x16 and 3840 for RN50x64. All of the models are optimized by the AdamW (Loshchilov and Hutter, 2019) optimizer. The learning rate is warmed up to $2.4e^{-4}$ within the first $2\%$ steps and then linearly decay to 0. More information of VLKD pre-training and the finetuning of each downstream task can be found in Appendix A. + +![](images/9edbc86c6d239dfa02a0cf0e4237a748151d7e51b41b9a13f21a708854b5f5fd.jpg) + +On what holiday do people traditionally eat this bird? Answer: [MASK]. + +Generated answer: Thanksgiving. + +![](images/88cf79a10f52f98f65b4d9b44fe63888a39314f7b59c1a75b39895cd907a5d91.jpg) + +What retractable appendage could this animal use to destroy the chair? Answer: [MASK]. + +Generated answer: Claw. + +![](images/4c0b5e0c2a7fefce51054188ac5aef5395508772ea11ad98dfa6253d225cf0b7.jpg) + +What area of a school might this be? Answer: [MASK]. + +Generated answer: Library + +![](images/1a667f53916fd562dd2f5bee3aad1d69d06e427d8151767b6d92912712063d5c.jpg) +(a) Zero-shot VQA. + +What's reflecting from the mirror? + +Candidate answer(s): Light; Wall; Shower. + +Generated answer: Light. + +![](images/e0334fada3ea7e348ae0006bb26978e15db68244cb0d310c562933887f665cf0.jpg) + +Reference caption: + +Two people sit on the beach with surfboards at their sides. + +Generated caption: + +A couple sitting on the beach with their surfboards in the background. + +![](images/6611ba1106338d324c3ad1cce6c55ee531de69f3fee489c88435ef5cb331f6c0.jpg) + +Reference caption: + +A cat is laying next to a blue book. + +Generated caption: + +A cat reading a book on a couch in the living room. + +![](images/b8f99d9e193917a96e127bf51a8e39099c07551d37a9f9cdbdec11fbda5e4d93.jpg) + +Reference caption: + +A woman sitting on a bench with a dog. + +Generated caption: + +A young woman sitting on a bench with her dog in the background. + +![](images/2cbc9f00030ddd6cd2ffc25703a498e67eb715c41e8d40a052cc58bbe9c3a479.jpg) +(b) Zero-shot image captioning. +Figure 3: Examples of (a) zero-shot VQA and (b) image captioning. Our model shows the ability to recognize visual objects and generate appropriate sentences based on their properties and relationship. Furthermore, the model can bind visual objects to text conceptual knowledge that is learned in the PLMs when generating answers given questions. + +Reference caption: + +A man holds a stick during a hockey game. + +Generated caption: + +A young man in the middle of a hockey game. + +# 4.3 Multimodal Zero-Shot Evaluation + +Benefit from the knowledge distillation, especially the ICTI loss, our model can perform various downstream multimodal tasks in a zero-shot manner. + +# 4.3.1 Zero-Shot Image Captioning + +During knowledge distillation, the ICTI loss can be seen as a simple version of the image captioning task, which asks the model to fill in the corrupted locations of image descriptions. If the masking ratio increases to $100\%$ , it reduces to the image captioning task. Therefore, it is intuitive to test the zero-shot performance of our model. + +Following Radford et al. (2021) and Wang et al. (2021), we compose the input with a text prompt and also $m$ mask tokens, i.e., "A picture of $[\mathrm{MASK}] \times m$ ," for the model to generate the caption for the image. The zero-shot results are included in Table 1. Our zero-shot model achieves comparable overall performance to the finetuned UpDown (Agrawal et al., 2019) model on NoCaps dataset. As shown in Figure 3b, the zero-shot generated captions are plausible with correct objects, relationships, and actions. However, sometimes details like colors could be omitted. + +In our experiments, we use $m = 6$ for COCO and $m = 8$ for NoCaps. Although it could poten- + +tially limit the length of generation, we find that it has negligible influence to the performance, as for each [MASK] token, the model is learned to fill one to three tokens depending on the context. Furthermore, this could be used to control the length of generated texts for different scenarios. See Section 5 for a more detailed discussion about the effects of number of the masks. + +# 4.3.2 Zero-Shot VQA + +Zero-shot VQA is much more challenging than image captioning, as it requires reasoning over both the image and question, which is very different from the ICTI loss during the knowledge distillation. As illustrated in Figure 1, we construct the input by appending a text prompt "Answer: $[\mathrm{MASK}]\times n.$ " to the question Given the context (image+question+prompt), the model is required to predict the answer by recovering the textual token in the [MASK] positions. In our experiments, we use $n = 2$ for the VQAv2, which is found performing best among $n\in \{1,2,3\}$ . + +In Table 2, compared to the strong baseline Frozen (Tsimpoukelli et al., 2021), our model improves the zero-shot accuracy by $13.1\%$ on the VQAv2 validation set and $7.4\%$ on the OK-VQA test set with $7\times$ fewer parameters, indicating the + +
Methods#Pretrain +Image-text +PairsODOTCOCO Caption +Karpathy TestIn +CSNoCaps Validation +NearOut +CSOverall +CS
BUTD†1.5M36.3120.127.721.480.012.073.611.366.49.773.111.1
OSCAR†Large6.5M41.7140.030.624.585.411.984.011.780.310.083.411.4
VinVLLarge6.5M41.0140.931.125.2103.713.795.613.483.811.994.313.1
VL-T59.2MX34.6116.128.821.9--------
VL-BART9.2MX34.2114.128.421.3--------
LEMONHuge203M42.6145.531.425.5118.015.4116.315.1120.214.5117.315.0
SIMVLMHuge1.8BXX40.6143.333.725.4113.7-110.9-115.2-112.2-
VLKD (Zero-shot)
ViT-B/163MXX16.758.319.713.4--------
RN50×163MXX18.261.120.814.552.69.752.99.658.69.354.09.6
RN50×643.7MXX25.885.123.116.964.813.662.313.666.99.963.612.8
VLKD (Finetuned)
ViT-B/163MXX37.2128.028.822.4--------
RN50×163MXX38.9131.129.623.992.312.682.011.870.310.481.111.7
RN50×643.7MXX40.3135.730.524.3105.114.599.713.890.212.197.613.6
+ +Table 1: Results on the COCO caption (Karpathy test set) and NoCaps (validation set). B@4, C, M, and S denote BLEU-4, CIDEr, METEOR, and SPICE, respectively. OD and OT indicate whether object detectors and object tags are used or not. Numbers of previous models are taken from (Anderson et al., 2018; Li et al., 2020; Zhang et al., 2021; Cho et al., 2021; Hu et al., 2021; Wang et al., 2021). Models marked by $\dagger$ additionally use the constrained beam search (CBS) (Anderson et al., 2017) for the NoCaps dataset. Note that LEMON and SIMVLM use significantly more pre-training data and have more trainable model parameters than the others. + +
Methods#ParamsVQAv2 val / test-devOK-VQA test
Generative (Open-ended)
Frozen (Zero-shot)7B29.5 / -5.9
Frozen (Finetuned)48.4 / -19.6
VLKD (Zero-shot)
RN50×1637.4 / 38.29.9
ViT-B/1638.6 / 39.710.5
ViT-L/14< 1B42.6 / 44.513.3
VLKD (Finetuned)
RN50×1667.4 / 68.836.2
ViT-B/1669.3 / 69.836.3
ViT-L/1473.9 / 74.539.0
Discriminative
UNITERLarge-- / 73.8-
OSCARLarge-- / 73.6-
VinVLLarge-- / 76.5-
SIMVLMBase-- / 77.9-
+ +efficiency and effectiveness of VLKD. Our model achieves $44.5\%$ zero-shot accuracy on the VQAv2 test-dev set, which to the best of our knowledge is the new state-of-the-art. Furthermore, as shown in Figure 3a, our model can bind visual objects to conceptual knowledge stored in the PLM to answer + +Table 2: Accuracies(%) on the VQAv2 and OK-VQA datasets. We categorize models into two parts: answer questions in a generative or discriminative way. + +
ModelIn-domainOut-of-domain
UNITER74.410.0
VL-T571.413.1
VL-BART72.113.2
VLKD (ViT-L/14)74.923.4
+ +Table 3: Accuracies(%) on VQAv2 Karpathy test-split. + +questions. For example, it connects the visual object Turkey with the traditional food people usually eat at the Thanksgiving festival. + +# 4.4 Multimodal Finetuning Evaluation + +When finetuning VLKD on downstream multimodal tasks, we keep the same input format as zero-shot to obtain outputs in a generative way. The CLIP model parameters are still frozen during finetuning. + +# 4.4.1 Finetuning Image Captioning + +In Table 1, we demonstrate that our model can achieve decent performance when finetuned on the COCO dataset. The SCST CIDEr optimization method (Rennie et al., 2017) is used to further improve the performance. Our model outperforms VL-T5/BART (Cho et al., 2021) without using an extra object detector, which is fairly time-consuming as explained by Kim et al. (2021b). Compared to state-of-the-art models, however, + +
ModelCoLASST-2RTEMRPCQQPMNLIQNLIAvg.
BERTLARGE (Devlin et al., 2019)60.693.270.482.9/88.091.3/87.986.492.382.6
BARTLARGE (Lewis et al., 2020)62.896.687.086.7/90.492.5/89.390.094.987.2
VisualBERT† (Li et al., 2019)38.689.456.671.9/82.189.4/86.081.687.074.0
UNITER† (Chen et al., 2020)37.489.755.669.3/80.389.2/85.780.986.073.1
VL-BERT† (Su et al., 2020)38.789.855.770.6/81.889.0/85.481.286.373.6
VilBERT† (Lu et al., 2019)36.190.453.769.0/79.488.6/85.079.983.872.1
LXMERT† (Tan and Bansal, 2019)39.090.257.269.8/80.475.3/75.380.484.271.6
SIMVLM‡ (Wang et al., 2021)46.790.963.975.2/84.490.4/87.283.488.677.4
VLKD (RN50×16)59.195.581.287.5/91.192.1/89.289.694.385.7
+ +there is still a small performance gap, which we conjecture is mainly due to their usage of object detector-tags and much more pre-training image-text pairs. We also evaluate our VLKD models with ResNet visual backbones on the NoCaps dataset (Table 1). For zero-shot image caption, the CIDEr score on the out-of-domain set is even higher than the in- and near-domain sets, which shows the generalization of our knowledge distillation method to common visual objects. After finetuned on the COCO training set, the performance on NoCaps of our model with the $\mathrm{RN}50\times 64$ backbone is comparable to the state-of-the-art models. + +# 4.4.2 Finetuning VQA + +From Table 2, the best performance of VQAv2 is achieved by VLP models that tackle this task in a discriminative way with a set of pre-defined answers. However, this approach does not generalize to real-world scenarios and cannot be directly applied to more diverse datasets (e.g., OK-VQA). Differently, Frozen (Tsimpoukelli et al., 2021) and our proposed VLKD formulate VQA as a generative problem to generate answers conditioned on the questions and images in an open-ended manner, which also enables zero-shot VQA. Specifically, for each question-answer pair in the VQAv2 dataset, we optimize the model to generate the answer with the cross-entropy loss and a label-smoothing of 0.1. The loss is weighted by the weight of each answer candidate. In addition, we augment the training data with VG-QA (Krishna et al., 2016). + +Furthermore, following (Cho et al., 2021), we test the performance on out-of-domain questions with rare answers using the Karpathy test-split. As + +Table 4: Results on the GLUE development set (single task single models). We report the Matthews correlation for CoLA, accuracy/F1 for MRPC and QQP, and accuracy for the rest of the tasks. The performance of models that are marked by $\diamond$ are taken from (Lewis et al., 2020), $\dagger$ are from (Iki and Aizawa, 2021), and $\ddagger$ are from (Wang et al., 2021). Compared to other VLP models, our VLKD model has a great advantage in text-only NLP tasks. + +
ModelROUGE-1ROUGE-2ROUGE-L
BARTLarge45.1422.2737.25
VLKD44.8622.0636.95
+ +Table 5: Results of abstractive summarization on XSUM. We use the best performing checkpoint of the $\mathrm{RN}50\times 16$ variant. + +shown in Table 3, our method shows a salient advantage on out-of-domain questions due to the benefit from VLKD and its generative nature without defining the answer list. + +# 4.5 Evaluation of NLU and NLG + +Table 4 shows results on the GLUE benchmark. Although prior VLP models are either initialized from the pre-trained BERT model, or trained by a text-only language modeling loss together with the vision-language (VL) losses, they generally suffer from the weakened performance of NLU. For example, SIMVLM performs significantly worse than BART, though trained with five times more textual data. We speculate that the weakened NLU ability of these models is caused by the catastrophic forgetting of the pre-trained BERT weights during the multimodal pre-training. Moreover, simultaneous optimization of multimodal and text-only objectives potentially shifts the latter to be an auxiliary loss, making the NLP ability not as effective. + +On the other hand, the resulting model of VLKD performs only slightly worse than the original BART and significantly outperforms BERT, as the original knowledge embedded in BART is well maintained. + +Additionally, as presented in Table 5, we also run VLKD on the abstractive summarization task to evaluate its NLG performance, since BART-based methods excel on the summarization (Lewis et al., 2020; Dou et al., 2021; Yu et al., 2021b). The gap between VLKD and its backbone BART is negligible. Overall, we empirically demonstrate that VLKD enables the backbone PLM to perform multimodal tasks without hurting its original NLP ability. + +# 5 Ablation Study + +Knowledge Distillation Objectives. Table 6 shows the ablation on the knowledge distillation objectives, except the ICTI loss which is necessary for our method to work. Without TTDM or ITCL, we observe a clear degradation of zero-shot performance on both VQAv2 and COCO image caption datasets. It is worth noting that ITCL contributes more to the image captioning task, which requires a deeper perception of visual features to generate captions. Oppositely, TTDM helps more for the VQA task, which involves reasoning over the question and image features. Removing both of them incurs a large performance drop, which demonstrates the importance of aligning the embedding space between CLIP and BART. + +
ModelVQAv2 (val)COCO Caption (test)
VLKDViT-B/16ZERO-SHOT38.658.3
w/o TTDM35.555.7
w/o ITCL36.354.1
w/o Both30.148.6
+ +Number of Masks. Furthermore, we also test the influence of the number of masks for zero-shot image captioning in Table 7. As discussed in Section 4.3.1, it has a trivial influence as the model learns to fill a variable length of tokens for each masked position. We achieve the best performance on the COCO caption dataset when $m = 6$ and NoCaps when $m = 8$ . + +Table 6: Ablation study on three distillation objectives. + +
#masks5678
CIDEr59.761.160.659.6
+ +Dataset Size of Distillation. In Table 8, we vary the size of dataset used for knowledge distillation. VLKD only has a slight performance drop when the size is reduced from 3M to 1M, and a sharp drop when further reduced to 100K. + +Table 7: Zero-shot image captioning on COCO test set using VLKD (RN50×16), with varying number of masks. + +
VQAv2 (val)COCO Caption (test)
VLKD3M38.658.3
VLKD1M38.356.2
VLKD100K33.845.1
+ +Table 8: Zero-shot performance of VLKD (ViT-B/16) on two datasets, with varying dataset size for distillation. + +Unfreeze CLIP Weights. To quantitatively measure the importance of freezing the model weights of CLIP during the VLKD pre-training, we tried unfreezing CLIP's weights and conduct the VLKD pre-training using the ViT-B/16 variant on CC3M without modifying other settings. It achieves 31.7 zero-shot accuracy on the VQAv2 validation set and 44.8 CIDEr on the COCO Caption test set. We speculate that unfreezing CLIP harms its pretrained multimodal space, which further downgrades the performance of VLKD. + +# 6 Conclusion + +Recent dual-stream VLP models (e.g., CLIP) are powerful in various multimodal classification and retrieval tasks. However, their ability of multimodal generation or pure NLP tasks is highly restricted. In this paper, we propose a novel knowledge distillation method to efficiently align CLIP's multimodal encoders and BART's textual encoder to the same multimodal space, as well as a cross-modal LM loss to consort BART encoder and decoder. This enables multimodal generation under zero-shot and also fully-finetuned settings without losing the original BART's NLP ability. Empirical results show that our model achieves new state-of-the-art zero-shot performance on VQA and excellent performance on both NLP and multimodal tasks when finetuned, demonstrating the effectiveness of our proposed method. + +# References + +Harsh Agrawal, Karan Desai, Yufei Wang, Xinlei Chen, Rishabh Jain, Mark Johnson, Dhruv Batra, Devi Parikh, Stefan Lee, and Peter Anderson. 2019. nocaps: novel object captioning at scale. In International Conference on Computer Vision, pages 8947-8956. +Peter Anderson, Basura Fernando, Mark Johnson, and Stephen Gould. 2017. Guided open vocabulary image captioning with constrained beam search. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing. +Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. 2018. Bottom-up and top-down attention for image captioning and visual question answering. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6077-6086. +Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems. +Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. 2020. Uniter: Universal image-text representation learning. In European Conference on Computer Vision. +Jaemin Cho, Jie Lei, Hao Tan, and Mohit Bansal. 2021. Unifying vision-and-language tasks via text generation. Preprint arXiv:2102.02779. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In North American Chapter of the Association for Computational Linguistics. +Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. 2020. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations. +Zi-Yi Dou, Pengfei Liu, Hiroaki Hayashi, Zhengbao Jiang, and Graham Neubig. 2021. GSum: A general framework for guided neural abstractive summarization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4830-4842, Online. Association for Computational Linguistics. +Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. 2017. Making the V in VQA matter: Elevating the role of image understanding in Visual Question Answering. In IEEE/CVF Conference on Computer Vision and Pattern Recognition. + +Xiuye Gu, Tsung-Yi Lin, Weicheng Kuo, and Yin Cui. 2021. Zero-shot detection via vision and language knowledge distillation. Preprint arXiv:2104.13921. +Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 770-778. +Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. Preprint arXiv:1503.02531. +Lu Hou, Zhiqi Huang, Lifeng Shang, Xin Jiang, Xiao Chen, and Qun Liu. 2020. Dynabert: Dynamic bert with adaptive width and depth. In Advances in Neural Information Processing Systems, volume 33. +Xiaowei Hu, Zhe Gan, Jianfeng Wang, Zhengyuan Yang, Zicheng Liu, Yumao Lu, and Lijuan Wang. 2021. Scaling up vision-language pre-training for image captioning. ArXiv, abs/2111.12233. +Taichi Iki and Akiko Aizawa. 2021. Effect of vision-and-language extensions on natural language understanding in vision-and-language models. Preprint arXiv:2104.08066. +Aashi Jain, Mandy Guo, Krishna Srinivasan, Ting Chen, Sneha Kudugunta, Chao Jia, Yinfei Yang, and Jason Baldridge. 2021. Mural: Multimodal, multitask retrieval across languages. Preprint arXiv:2109.05125. +Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V. Le, Yun-Hsuan Sung, Zhen Li, and Tom Duerig. 2021. Scaling up visual and vision-language representation learning with noisy text supervision. In International Conference on Machine Learning. +Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. 2019. Tinybert: Distilling bert for natural language understanding. Preprint arXiv:1909.10351. +Andrej Karpathy and Li Fei-Fei. 2017. Deep visualsemantic alignments for generating image descriptions. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39:664-676. +Wonjae Kim, Bokyung Son, and Ildoo Kim. 2021a. Vilt: Vision-and-language transformer without convolution or region supervision. In International Conference on Machine Learning. +Wonjae Kim, Bokyung Son, and Ildoo Kim. 2021b. Vilt: Vision-and-language transformer without convolution or region supervision. In International Conference on Machine Learning. +Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A. Shamma, Michael S. Bernstein, and Li Fei-Fei. 2016. Visual genome: Connecting language and vision using crowdsourced dense image annotations. International Journal of Computer Vision, 123:32-73. + +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Annual Meeting of the Association for Computational Linguistics. +Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. 2022. Blip: Bootstrapping language-image pretraining for unified vision-language understanding and generation. +Lianian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. 2019. Visualbert: A simple and performant baseline for vision and language. Preprint arXiv:1908.03557. +Wei Li, Can Gao, Guocheng Niu, Xinyan Xiao, Hao Liu, Jiachen Liu, Hua Wu, and Haifeng Wang. 2021. Unimo: Towards unified-modal understanding and generation via cross-modal contrastive learning. In Annual Meeting of the Association for Computational Linguistics. +Xiujun Li, Xi Yin, Chunyuan Li, Xiaowei Hu, Pengchuan Zhang, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, Yejin Choi, and Jianfeng Gao. 2020. Oscar: Object-semantics aligned pre-training for vision-language tasks. In European Conference on Computer Vision. +Junyang Lin, Rui Men, An Yang, Chang Zhou, Ming Ding, Yichang Zhang, Peng Wang, Ang Wang, Le Jiang, Xianyan Jia, et al. 2021. M6: A chinese multimodal pretrainer. Preprint arXiv:2103.00823. +Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dólar, and C. Lawrence Zitnick. 2014. Microsoft coco: Common objects in context. In European Conference on Computer Vision. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In International Conference on Learning Representations. +Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. 2019. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +Kenneth Marino, Mohammad Rastegari, Ali Farhadi, and Roozbeh Mottaghi. 2019. Ok-vqa: A visual question answering benchmark requiring external knowledge. In IEEE/CVF Conference on Computer Vision and Pattern Recognition. +Shashi Narayan, Shay B. Cohen, and Mirella Lapata. 2018. Don't give me the details, just the summary! Topic-aware convolutional neural networks for extreme summarization. In Conference on Empirical Methods in Natural Language Processing. + +Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. 2021. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning. +Alec Radford and Karthik Narasimhan. 2018. Improving language understanding by generative pretraining. +Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. +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. +Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. 2021. Zero-shot text-to-image generation. Preprint arXiv:2102.12092. +Steven J. Rennie, Etienne Marcheret, Youssef Mroueh, Jerret Ross, and Vaibhava Goel. 2017. Self-critical sequence training for image captioning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1179-1195. +Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. 2018. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Annual Meeting of the Association for Computational Linguistics, pages 2556-2565. +Sheng Shen, Liunian Harold Li, Hao Tan, Mohit Bansal, Anna Rohrbach, Kai-Wei Chang, Zhewei Yao, and Kurt Keutzer. 2022. How much can CLIP benefit vision-and-language tasks? In International Conference on Learning Representations. +Gunnar A. Sigurdsson, Jean-Baptiste Alayrac, Aida Nematzadeh, Lucas Smaira, Mateusz Malinowski, João Carreira, Phil Blunsom, and Andrew Zisserman. 2020. Visual grounding in video for unsupervised word translation. In IEEE/CVF Conference on Computer Vision and Pattern Recognition. +Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. 2020. Vl-bert: Pre-training of generic visual-linguistic representations. In International Conference on Learning Representations. +Hao Tan and Mohit Bansal. 2019. Lxmert: Learning cross-modality encoder representations from transformers. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. +Yonglong Tian, Dilip Krishnan, and Phillip Isola. 2019. Contrastive representation distillation. In International Conference on Learning Representations. + +Yonglong Tian, Dilip Krishnan, and Phillip Isola. 2020. Contrastive multiview coding. In European Conference on Computer Vision, pages 776-794. +Maria Tsimpoukelli, Jacob Menick, Serkan Cabi, S. M. Ali Eslami, Oriol Vinyals, and Felix Hill. 2021. Multimodal few-shot learning with frozen language models. Preprint arXiv:abs/2106.13884. +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. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations. +Zirui Wang, Jiahui Yu, Adams Wei Yu, Zihang Dai, Yulia Tsvetkov, and Yuan Cao. 2021. Simvlm: Simple visual language model pretraining with weak supervision. Preprint arXiv:2108.10904. +Lewei Yao, Runhui Huang, Lu Hou, Guansong Lu, Minzhe Niu, Hang Xu, Xiaodan Liang, Zhenguo Li, Xin Jiang, and Chunjing Xu. 2022. FILIP: Finegrained interactive language-image pre-training. In International Conference on Learning Representations. +Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. 2020. Large batch optimization for deep learning: Training bert in 76 minutes. In International Conference on Learning Representations. +Fei Yu, Jiji Tang, Weichong Yin, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. 2021a. Ernie-vil: Knowledge enhanced vision-language representations through scene graph. In AAAI Conference on Artificial Intelligence. +Tiezheng Yu, Wenliang Dai, Zihan Liu, and Pascale Fung. 2021b. Vision guided generative pre-trained language models for multimodal abstractive summarization. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3995-4007, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Xiaohua Zhai, Xiao Wang, Basil Mustafa, Andreas Steiner, Daniel Keysers, Alexander Kolesnikov, and Lucas Beyer. 2021. Lit: Zero-shot transfer with locked-image text tuning. CoRR, abs/2111.07991. +Pengchuan Zhang, Xiujun Li, Xiaowei Hu, Jianwei Yang, Lei Zhang, Lijuan Wang, Yejin Choi, and Jianfeng Gao. 2021. Vinvl: Revisiting visual representations in vision-language models. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5575-5584. + +Yuhao Zhang, Hang Jiang, Yasuhide Miura, Christopher D Manning, and Curtis P Langlotz. 2020. Contrastive learning of medical visual representations from paired images and text. Preprint arXiv:2010.00747. + +
Hyper-paramsValues
Batch size4608 (ViT-B/16 and ViT-L/14), 4096 (RN50x16), 3840 (RN50x64)
OptimizerAdamW, β = (0.99, 0.999)
Learning rate2.4e-4
Weight decay0.01
Eps1e-6
Temperature τInitialized to 0.07
Warmup steps2%
#Epochs10
Gradient clipping3.0
+ +Table 9: Hyper-parameters of VLKD pre-training. + +
Hyper-paramsVQAImage captioning
Batch size7264
Total epochs1010
#Masks26 (COCO), 8 (NoCaps)
Beam search size1 (greedy)6
OptimizerAdamW, β = (0.99, 0.999)
Learning rate1e-4
Weight decay0.01
Eps1e-8
LR warmupFirst epoch
Gradient clipping5.0
+ +Table 10: Hyper-parameters for two multimodal tasks. + +# A Hyper-parameters + +In this section, we show the hyper-parameters of vision-language knowledge distillation (VLKD), as well as downstream task finetuning. + +For VLKD, the hyper-parameters are shown in Table 9, for both two CLIP variants we explored. For finetuning multimodal downstream tasks, we use the hyper-parameters shown in Table 10. Within each task, we use the same setting for multiple datasets. + +For the GLUE benchmark, we use the LAMB optimizer (You et al., 2020) to train for 10 epochs. We conduct a hyper-parameter grid search with batch size $= \{16, 32, 64\}$ , lr $= \{1e-4, 5e-4, 1e-3\}$ , weight decay $= \{1e-4, 1e-3\}$ . We warm up the learning rate in the first epoch, then linearly decay it to zero. + +For XSUM, we directly follow the hyperparameters used in Lewis et al. (2020). + +# B More Examples of Zero-shot Inference + +In Figure 4, we show more examples of zero-shot image captioning. In Figure 5, we depict more cases of the results of zero-shot open-ended VQA. + +![](images/ea92d6f765a042f0624dcc89a24c6ad9d6fa2cca9799f2f9401600ea2ccd0728.jpg) + +Reference caption: A big cat laying down in a chair on a porch. + +Generated caption: A cat lounging on a chair in a hammock. + +![](images/5523612a712a487b205c4acc75e24b2840ba4ae12f6a036893ac0ee054f8c0b4.jpg) + +Reference caption: A little girl holding up a pink umbrella. + +Generated caption: A girl holding a pink umbrella in the rain. + +![](images/2143964338965bb0bfb852538c836ee7a80520b5e7194793d381257d0f4211b1.jpg) + +Reference caption: A white boat out in the middle of the ocean. +Generated caption: A small fishing boat in the middle of the ocean. + +![](images/fe81b9bec31e0f38be1d3e675b563482ae5b24924a4bf108c9bcff3cecd36887.jpg) +Figure 4: More examples of zero-shot image captioning. + +Reference caption: +A small herd of elephants standing in the grass. +Generated caption: +A herd of elephants in a field of grasses. + +![](images/c50bf24349ced4cd1a9ce5ec4b63eb55cec46a0cdaa1bf564e71322b738f0edb.jpg) + +What fruit is present on 3 items? Candidate answer(s): Apple. +Generated answer: Apple. + +![](images/2c65f66d2b7fa83a082ba8ad2de306d5299d741d8500d2c2e6ccfa55f6f48485.jpg) + +Where is the cell phone? + +Candidate answer(s): + +On table; In bowl; Yes. + +Generated answer: On table. + +![](images/357b77ddbc31415089bb07644006b4bea406fd701b022d75c0fdc42b2b945c9a.jpg) + +What are the people doing? + +Candidate answer(s): + +Standing; Playing; Talking. + +Generated answer: Playing. + +![](images/5378f3290f114a41820d370f09506c5199336ab74699a5e2379e9bee140d5f06.jpg) + +What type of fabric is the hat made of? Candidate answer(s): Cotton; Wool; Denim. + +Generated answer: Cotton. + +![](images/ccb59504bc266630f7de337b46d04321f612f12a2e308ed47c7e8c3bc1e17082.jpg) + +What is the animal on top of? Candidate answer(s): Laptop; Cat; Computer. + +Generated answer: Computer: + +![](images/f54a612b6cd74ba4c429f087203415f87417889965153aa9915bc6131e763dc0.jpg) +Figure 5: More examples of zero-shot VQA. + +Why is there a line? Candidate answer(s): No parking; Parking; Caution; Curb. Generated answer: Parking. \ No newline at end of file diff --git a/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/images.zip b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..19c362200b4da7c8bc79fb453e28d9b853d7db02 --- /dev/null +++ b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6914c3e9224b3275f8e499fcd9c99315b6df0711e10cd3098758e59d14cfb5a6 +size 683773 diff --git a/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/layout.json b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e7cbb3c64503892c552c740a2c51cb965bf1391d --- /dev/null +++ b/enablingmultimodalgenerationonclipviavisionlanguageknowledgedistillation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e611f54b64b1d35ac4ba04fb8ab9abe77d0c22a720b982f7b5dc3567b70a6eec +size 498709 diff --git a/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_content_list.json b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9a6946e75891c46f82a8c1a92e84a4ead7f9fe1e --- /dev/null +++ b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acfd7d7feca161acb8ff9c425a094bf87ebd1e87fbfe800dcfadf428af0d9736 +size 82791 diff --git a/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_model.json b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_model.json new file mode 100644 index 0000000000000000000000000000000000000000..11b8e252099cb0c5def8c90747ba23c1c7f234e2 --- /dev/null +++ b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:106f42923a5c0a24003aa3b055c2ee6466c11f4d5fc856984f349477296de09d +size 95585 diff --git a/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_origin.pdf b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9b81295b09d909a8da76a43d206c7278fb23ec97 --- /dev/null +++ b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/3adbe831-41a8-4970-9083-e485cc560e35_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:217a6f5ade5cdb23c5e3a035efa254eea34acb02bcb69eae39a71a253a27a2c8 +size 422320 diff --git a/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/full.md b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/full.md new file mode 100644 index 0000000000000000000000000000000000000000..61e6757dc673ef58ff3ae43b3e8ab2fe296b0c7f --- /dev/null +++ b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/full.md @@ -0,0 +1,261 @@ +# EnCBP: A New Benchmark Dataset for Finer-Grained Cultural Background Prediction in English + +Weicheng Ma, Samiha Datta, Lili Wang, and Soroush Vosoughi + +Department of Computer Science, Dartmouth College + +{weicheng.ma.gr, samiha.datta.23, lili.wang.gr, soroush.vosoughi} $@$ dartmouth.edu + +# Abstract + +While cultural backgrounds have been shown to affect linguistic expressions, existing natural language processing (NLP) research on culture modeling is overly coarse-grained and does not examine cultural differences among speakers of the same language. To address this problem and augment NLP models with cultural background features, we collect, annotate, manually validate, and benchmark EnCBP, a finer-grained news-based cultural background prediction dataset in English. Through language modeling (LM) evaluations and manual analyses, we confirm that there are noticeable differences in linguistic expressions among five English-speaking countries and across four states in the US. Additionally, our evaluations on nine syntactic (CoNLL-2003), semantic (PAWS-Wiki, QNLI, STS-B, and RTE), and psycholinguistic tasks (SST-5, SST-2, Emotion, and Go-Emotions) show that, while introducing cultural background information does not benefit the Go-Emotions task due to text domain conflicts, it noticeably improves deep learning (DL) model performance on other tasks. Our findings strongly support the importance of cultural background modeling to a wide variety of NLP tasks and demonstrate the applicability of EnCBP in culture-related research. + +# 1 Introduction + +Psychological research has revealed that people from different cultural background behave differently in the ways they think (Nisbett et al., 2001), talk (Kim, 2002), write (Krampetz, 2005; Almuhailib, 2019; Kitano, 1990), and express emotions (Hareli et al., 2015; Sun et al., 2021; Acheampong et al., 2020). NLP researchers have applied cultural background information to model differences in linguistic expressions across culture groups especially for psycholinguistic tasks1, e.g., + +distributional perspective identification (Tian et al., 2021) and sentiment analysis (Sun et al., 2021). In prior research, culture groups are usually defined by official language (Tian et al., 2021) (e.g., US, UK, and India are considered part of the same culture group) or, even more coarse-grained, by ideology (Imran et al., 2020) (e.g., "Western" countries and "Eastern" countries). These settings typically overlook the nuanced cultural differences across or within countries, and they do not provide useful information for modeling different language use behavior in mono-lingual contexts. + +To study culture-specific linguistic expressions in the same language and to apply culture-related knowledge to other NLP tasks, we build EnCBP, a cultural background prediction dataset in English. Following (Tambassi, 2018), we assume that language use patterns are more consistent inside each country or each district in a large country, e.g., states in the US. As such, we first construct news corpora by sampling news articles covering five frequently discussed and controversial topics from major news outlets in five English-speaking countries and four geographically dispersed states in the US. We then break the articles down to paragraphs and annotate them with the country and state codes of the news outlets to construct the country- and district-level subsets of EnCBP. We refer to the two subsets as EnCBP-country and EnCBP-district. To ensure annotation quality, we randomly sample 20 instances from each culture group and have them validated manually by local residents using Amazon Mechanical Turk (MTurk). The annotation accuracies and inter-validator agreement rates are both high for all the validation sets, supporting the correctness of the labels and demonstrating the differences in writing style across culture groups. In addition, we benchmark EnCBP for cultural background prediction with three widely-used NLP model architectures, namely BiLSTM, BERT (Vaswani et al., 2017), and RoBERTa (Liu et al., + +2019). Among the three models, the roberta-base model achieves the best overall performance, scoring 82.96 in F1-macro on the EnCBP-country and 73.96 on EnCBP-district. The better performance of BERT and RoBERTa over BiLSTM implies the importance of deep neural network architectures and large-scale pre-training for the challenging text-based cultural background prediction task. + +We conduct both quantitative and qualitative analyses on EnCBP to show the differences in linguistic expressions across culture groups. For the quantitative analysis, we fine-tune a BERT model on the corpus with each cultural background label and evaluate it on the corpora of all the culture groups. Results show that all the fine-tuned models are more compatible with the cultural domains of their training corpora and less compatible with the those of other corpora, with perplexity differences ranging from 0.43 to 14.90. For the qualitative analysis, we manually analyze sentence structures and the choices of words or phrases in instances randomly sampled from EnCBP to illustrate culture-specific English expressions. + +Furthermore, we evaluate a BERT model on nine psycholinguistic (sentiment analysis and emotion recognition), syntactic (named entity recognition), and semantic (paraphrase identification, natural language inference, semantic textual similarity, and text entailment) tasks to examine how modeling culture-specific English writing styles benefits the performance of NLP models. The models that incorporate cultural background information perform noticeably better on the named entity recognition (NER) task, most semantic tasks, and the sentiment analysis (SA) tasks. In our emotion recognition (ER) evaluation on the Go-Emotions dataset, however, the performance is slightly harmed by incorporating cultural background information. This is likely due to the imbalanced cultural background distribution in the dataset, as the evaluation performance of BERT clearly improves on Emotion, another ER dataset. On the paraphrase identification (PI) task, while the model performs better with cultural information incorporated, the improvement is lower than those on SA and NER tasks. This result suggests that differentiating linguistic expressions with the same semantic meaning may introduce additional noise to semantic tasks. + +Our analyses and evaluations support the importance of cultural background modeling for a wide range of NLP tasks and show that EnCBP can con + +tribute to future culture-related NLP research. + +The contributions of this paper are three-fold: + +- we construct, manually validate, and benchmark EnCBP, a mono-lingual news-based cultural background prediction dataset; +- we qualitatively and quantitatively examine the distinctions in writing style from different culture groups; and +- we show the effect of introducing cultural background information to nine downstream NLP tasks to showcase the importance of cultural information in natural language understanding. + +# 2 Dataset Construction + +This section introduces the construction, validation, and benchmarking of the EnCBP dataset. The EnCBP dataset adopts a multi-class classification objective. The labels are country codes of news outlets for the coarse-grained subset (EnCBP-country) and US state codes for the finer-grained subset (EnCBP-district). + +# 2.1 Data Collection and Annotation + +Our work relies on the hypothesis that news articles from mainstream news outlets of a country or district reflect the local language use patterns. Thus, we construct 5 text corpora with news articles posted by New York Times, Fox News, and the Wall Street Journal in the US, BBC in UK, Big News Network - Canada in Canada (CAN), Sydney Morning Herald in Australia (AUS), and Times of India in India (IND) for EnCBP-country. For EnCBP-district, we construct 4 corpora from Coosa Valley News, WJCL, and Macon Daily in Georgia (GA), Times Union, Gotham Gazette, and Newsday in New York (NY), NBC Los Angeles, LA Times, and San Diego Union Tribune in California (CA), and Hardin County News, Jasper Newsboy, and El Paso Times in Texas (TX). We stream news articles from Media Cloud $^{2}$ , a platform that collects articles from a large number of media outlets, using its official API. + +To maintain consistent mentions of events and named entities (NEs) in the corpora, we limit the articles to those under five frequently discussed topics, namely "global warming", "abortion", "immigration", "social safety net", and "mandatory vaccination". 1,000 news articles published between Jan. 1, 2020 and Jun. 30, 2021 are sampled from each news outlet to form our corpora. + +
TopicsSplits
Global WarmingAbortionImmigrationSocial Safety NetMandatory VaccinationTotalTrainDevTest
LabelsUS3324552533366242,0001,600200200
UK6481293834563842,0001,600200200
AUS5321884394024392,0001,600200200
CAN4183794303154582,0001,600200200
IND4781715403714402,0001,600200200
NY2061344437045132,0001,600200200
CA2742424735564552,0001,600200200
GA2453842143897682,0001,600200200
TX3653284685852542,0001,600200200
+ +After data collection, we remove duplicates and overly short documents (less than 100 words) to ensure data quality. We also replace the mentions of countries and districts with the "[country]" and "[district]" special tokens. Then, we chunk the remaining news articles into paragraphs and label the documents with the country or district codes of the news outlets by which they are posted. We adopt paragraph-level annotations since asking the annotators to read an overly-long document may cause them to lose track of culture-specific information when they are making judgments. Most state-of-the-art DL models also have input length limits that are not capable of encoding full-length news article. To avoid overly simplifying the task, we remove paragraphs containing NE mentions that are mainly used by news media in specific countries or districts. We quantify the specificity of NEs using inverse document frequency (IDF) scores. + +From the filtered news paragraphs, we sample 2,000 paragraphs from the corpus of each culture group to form the annotated dataset. Table 1 provides the statistics of the label and topic distribution of the instances in EnCBP. + +# 2.2 Manual Validation + +To ensure that the cultural background labels in EnCBP correlate with writing styles, we randomly sample 50 instances from each class and manually validate them on MTurk. In each questionnaire, we pair the sampled instance with another random news paragraph from EnCBP and ask three annotators whether the first, second, or both paragraphs are posted by media outlets in a specific country + +Table 1: Number of documents associated with each label and under each topic in EnCBP. For each country or district label, the documents under each topic are randomly sampled into the training, development, and test sets with a $80\% / 10\% / 10\%$ split. + +
Culture GroupsACC (%)IAA
US64.000.61
UK76.670.73
AUS74.000.71
CAN58.670.57
IND61.430.61
NY81.330.78
CA64.670.59
GA70.000.66
TX72.000.68
+ +Table 2: Validation results of the EnCBP dataset. ACC and IAA refer to validation accuracy and inter-annotator agreement rate in Fleiss' $\kappa$ , respectively. + +or district. We manually check the instances to ensure there are no country- or district-specific mentions remaining to avoid potential information leakage. For quality control purposes, we only hire crowdsourcing workers from the country or US state matching the label of the instances sampled for validation. + +To ensure the quality of annotations in EnCBP, we hire crowdsourcing workers from MTurk to validate randomly sampled data points. Since all the news articles are written by native English speakers and the culture groups are not strictly separated from each other, it is difficult for a validator to identify whether a news paragraph is written by a journalist from the same cultural background as them. Instead, we provide each validator with a news paragraph posted by an international or do + +![](images/116f638c707495fe1f083ddc83673ffb90c526d75b27aa0ee52779b8d9d49172.jpg) +Figure 1: An example of the questionnaire used for validating the annotations in EnCBP. + +mestic news outlet in the country or district they live in (MTurk allows for filtering based on location) and a randomly selected news paragraph from our dataset. The validators are asked to compare the two news paragraphs and decide which of the two paragraphs (or both) were written by their local news outlets through analyzing the use of words, phrases, and sentence structures. To avoid information leak and bias in the validation process, the mentions of countries and districts are replaced with "[country]" and "[district]" special tokens at the pre-processing stage of the dataset. An example questionnaire is shown in Figure 1. + +We display the validation accuracy (ACC), i.e., the proportion of the annotators' answers that match the labels of those instances in EnCBP, and inter-annotator agreement rate (IAA) in Table 2. Since we have three options in each of the questionnaires, the ACC of random guess is around $33\%$ for each culture group. We quantify IAA with Fleiss' $\kappa$ (Fleiss, 1971), a widely used metric for evaluating IAA. The Fleiss' $\kappa$ in Table 2 range from moderate ( $>0.40$ ) to substantial agreement ( $>0.60$ ). We infer from the relatively high ACC and IAA that: 1) news writing styles are affected by the cultural backgrounds of journalists and 2) writing styles in each culture group are identifiable by local residents. Since we removed country- or state-specific NEs and mentions of countries or states from the paragraphs, and as the distributions of topics and sentiments are balanced across corpora, the chance that the annotators make their judgments based on these external information is low. + +# 2.3 Dataset Benchmarking + +After data validation, we divide both EnCBP-country and EnCBP-district into training, development, and test sets with a $80\% / 10\% / 10\%$ split and a random state of 42. To show the predictability of cultural background labels with NLP models, + +
ModelEnCBP-countryEnCBP-district
BiLSTM50.89 (0.98)44.53 (1.39)
BERT78.13 (0.67)72.09 (1.84)
RoBERTa82.96 (0.89)73.96 (1.01)
+ +Table 3: Benchmark performance of BiLSTM, bert-base-cased (BERT), and robert-base (RoBERTa) models on EnCBP-country and EnCBP-district. Average F1-macro scores over five runs with different random seeds are reported and standard deviations are shown in parentheses. + +we benchmark the EnCBP-country and EnCBP-district separately with BiLSTM, bert-base-cased, and roberta-base models. We train the BiLSTM model for 20 epochs with a learning rate of 0.25 and fine-tune the other models for five epochs with a learning rate of 1e-4 on both subsets. + +Table 3 displays the average F1-macro scores across five runs with different random seeds for model initialization. For all the models, the standard deviations of the five runs are at most 0.98 on EnCBP-country and 1.84 on EnCBP-district, indicating that randomness does not severely affect the predictions of models, and that the culture-specific writing styles can be modeled by DL models. Both the BERT and RoBERTa models outperform the BiLSTM model with large margins, which suggests the importance of deep neural network architectures and large-scale pre-training for the task. We also note that all the three models perform worse on EnCBP-district, which may be caused by both the more difficult task setting and the higher level of noise in EnCBP-district, since local news outlets target audiences from all over the country. In the rest of this paper, we use the bert-base-cased model for the analyses and discussions since it is less resource-consuming than the roberta-base model, while the findings potentially apply to other model architectures as well. + +# 3 Cultural Domain Compatibility + +This section examines whether linguistic expressions are clearly separable across culture groups in EnCBP through LM evaluations. We also manually examine representative linguistic expressions associated with each label to illustrate the differences in linguistic expression across cultures. + +# 3.1 Language Modeling Analysis + +Since all the documents in EnCBP come from news articles, we assume they are well-written and grammatically correct. In addition, LMs trained on a grammatical corpus should produce similar perplexities on the corpus with each label if the writing styles are consistent across corpora. Thus, to examine culture-specific differences in writing styles, we fine-tune a bert-base-cased model on the training corpus of each class in EnCBP with the MLM objective and evaluate perplexity of the fine-tuned models on all the test corpora. + +As Table 4 shows, BERT models usually produce the lowest perplexities on the test portions of their training corpora, and the cross-corpus perplexities are usually considerably higher. This supports our hypothesis that English writing styles are culture-dependent, and that the writing styles across cultures are different enough to be detected by LMs. Meanwhile, we find that the cultural domain compatibility differs for different pairs of corpora, e.g., the IND corpus is more compatible with the UK corpus than other countries or districts. The relations are not symmetric either, e.g., while the LM trained on the CAN corpus well adapts to the US corpus, the US LM performs the worst on the CAN corpus among the five countries. These potentially result from the effects of geographical, geo-political, and historical backgrounds on the formation of cultural backgrounds. For instance, the US could be said to have greater influence on Canadian culture than vice versa. Potentially for similar reasons, compared to TX and GA, NY has a more consistent writing style with CAN. We also note clear cultural domain compatibility gaps between liberal (NY and CA) and conservative states (GA and TX), which, agreeing with Imran et al. (2020), shows that ideologies and policies of a district potentially has an effect on its culture-specific writing styles. We provide additional topic-level LM analysis in Appendix A. + +# 3.2 Topic and Sentiment Distributions + +To verify if the different expressions across classes in the EnCBP datasets are triggered by cultural differences, we analyze the distributions of topics and sentiment scores for each class. Specifically, we model the topics of each corpus using BERTopic (Grootendorst, 2020) and analyze sentiments of text using Stanza (Qi et al., 2020). + +We apply two-sided Kolmogorov-Smirnov (KS) tests on the topic distributions of each pair of classes to see whether the topic distributions for each country or state are similar. For all pairwise comparisons, the null hypothesis (which is that the distributions are identical) cannot be rejected using the KS test, with all p-values being above 0.1, and most in fact being above 0.7. This potentially results from both topic control at the data collection phase and data filtering eliminating paragraphs containing NEs with high IDF scores. Additionally, the sentiment score distribution is relatively consistent across classes (28.02% to 34.97% instances with negative sentiments). Since the classes in EnCBP contain documents that are similar in topics and sentiments, it is likely that the differences in linguistic expressions across classes are caused by cultural differences. + +# 3.3 Manual Analysis + +In addition to automatic evaluations, we manually examine distinguishable English expressions for each culture group in EnCBP. Specifically, we extract phrases with high TF-IDF values for each corpus in EnCBP, retrieve news paragraphs that contain these phrases, and examine sentence structures and phrase usages in these representative instances. + +From our analyses, we find that the different writing styles of countries and districts in EnCBP are affected by the choice of words or phrases, the ordering of phrases, and degrees of formality. For example, the phrases "in the wake of", "in the lead up to", and "the rest of the world" are much more frequently used by AUS news outlets than the others. Also, the use of auxiliaries, especially the word "may", is more frequent in the UK corpus, in the context of politeness. The US corpus is in general more colloquial than the other corpora, as the journalists often write subjective comments in the news articles. Additionally, the ways of referencing speeches differ across corpora, e.g., the quoted text usually appears prior to the "[name] said" in the UK corpus but reversely in the US corpus. In the + +
Evaluation Corpus
USUKAUSCANINDNYCAGATX
Training CorpusUS22.8024.1325.0827.6726.5428.0824.5427.5424.41
UK24.7714.0928.7628.9927.3025.5022.3726.3024.14
AUS22.4927.5621.8226.5327.2625.3124.1823.6925.61
CAN26.1337.4530.6023.3028.4124.3231.0426.3025.56
IND27.8724.6329.3630.1923.9129.6926.4634.4226.40
NY22.6522.9825.6821.8225.6620.5321.2222.9825.88
CA24.2329.5025.5324.4124.4524.7723.8028.2727.92
GA19.2124.6129.2926.7627.1621.4422.7820.2520.97
TX24.9926.9630.9129.9730.0930.3127.4626.6423.83
+ +Table 4: Perplexity of LMs fine-tuned on the training corpora of EnCBP with the MLM objective and evaluated on the test corpora. The lowest perplexity for each fine-tuned LM is in bold and the highest perplexity is underlined. + +EnCBP-district subset, the sentence structures are more consistent across corpora, while the mentions of NEs and wordings differ more. For example, the word "border" appears frequently in the TX corpus but less in the other corpora when discussing the "immigration" topic. Though the observations summarized from EnCBP may not be universally applicable to other datasets or text domains, they are validated by native speakers of English to be accounting for the high ACC in manual validations. + +# 4 Experiments and Analyses + +Since cultural background labels are expensive to annotate, most NLP models forego the use of this information to opt for larger training data amount. For example, BERT is trained on Wikipedia text written in styles from mixed cultural backgrounds without access to cultural background information of the writers. Using the EnCBP dataset we constructed, this section examines the relatedness between the cultural background prediction task and multiple other NLP tasks via model probing. We also examine the effectiveness of cultural feature augmentation, i.e., augmenting DL models on downstream NLP tasks with culture-specific writing style information. Specifically, we evaluate a bert-base-cased model with two common information injection methods, namely two-stage training and MTL, on nine syntactic, semantic, and psycholinguistic tasks. + +# 4.1 Tasks and Datasets + +The datasets used in our evaluations are: + +PAWS-Wiki (Zhang et al., 2019) is a PI dataset containing English Wikipedia articles. Each instance in PAWS-Wiki consists of a pair of sentences and + +a label indicating whether the two sentences are paraphrase (1) or not (0). There are 49,401 training instances, 8,000 development instances, and 8,000 test instances in this dataset. + +CoNLL-2003 English NER dataset (Tjong Kim Sang and De Meulder, 2003) contains news articles from Reuters news only, so the dataset has a more consistent UK writing style, compared to the other datasets we utilize. Each word in the documents is annotated with persons (PER), organizations (ORG), locations (LOC), or miscellaneous names (MISC) NE label in the IOB-2 format. We adopt the official data split of the CoNLL-2003 dataset in the experiments, where there are 7,140, 1,837, and 1,668 NEs in the training, development, and test sets, respectively. + +Go-Emotions (Demszky et al., 2020) is an ER dataset containing 58,009 English Reddit comments. Instances in this dataset are labeled with 28 emotion types including neutral, in the multi-label classification form. We split the dataset into training, development, and test sets with a $80\% /10\% /10\%$ split using 42 as the random seed. To be consistent with other evaluations, we switch the annotations to the multi-class classification form by duplicating the data points associated with multiple labels and assigning one emotion label to each copy. This results in an ER dataset containing 199,461 training instances, 35,057 development instances, and 34,939 test instances after removing instances with no labels. + +Stanford Sentiment Treebank (SST-5) (Socher et al., 2013) is a document-level SA dataset containing sentences from movie reviews. The documents are annotated with sentiment scores, which are turned to fine-grained (5-class) sentiment labels + +after pre-processing. Using the official data split, we divide the dataset into training, development, and test splits containing 156,817, 1,102, and 2,211 instances, respectively. Note that the training set of SST-5 contains a mixture of phrases and sentences, while the development and test sets contain only complete sentences. + +SST-2 is the coarse-grained SST-5 dataset, in which each document is labeled with positive (1) or negative (0) sentiments. There are 67,349 training instances, 872 development instances, and 1,821 test instances in this dataset. + +QNLI (Wang et al., 2019) is a natural language inference (NLI) dataset with a question answering background. Each instance in QNLI contains a question, a statement, and a label indicating whether the statement contains the answer to the question (1) or not (0). There are 104,743 training instances, 5,463 development instances, and 5,463 test instances in this dataset. + +STS-B (Cer et al., 2017) is a benchmarked semantic textual similarity (STS) dataset. Each instance in STS-B is a pair of sentences manually annotated with a semantic similarity score from 0 to 5. The dataset contains 5,749 training instances, 1,500 development instances, and 1,379 test instances. + +RTE is a textual entailment (TE) dataset. Each instance in RTE contains a pair of sentences and a label indicating whether the second sentence is an entailment (1) or not (0) of the first sentence. The RTE dataset we use is a combination of RTE1 (Dagan et al., 2005), RTE2 (Bar-Haim et al., 2006), RTE3 (Giampiccolo et al., 2007), and RTE5 (Bentivogli et al., 2009) datasets, which contains 2,490 training instances, 277 development instances, and 3,000 test instances. + +Emotion (Saravia et al., 2018) is a Twitter-based ER dataset labeled with six emotion types, i.e., sadness (0), joy (1), love (2), anger (3), fear (4), and surprise (5). There are 16,000 training instances, 2,000 development instances, and 2,000 test instances in this dataset. + +# 4.2 Feature Augmentation + +# 4.2.1 Experimental Settings + +We use the Huggingface (Wolf et al., 2020) implementation of BERT in all our evaluations. On each task, we fine-tune a bert-base-cased model for five epochs with different random seeds, and we report the average evaluation score on the test sets of downstream tasks over the five runs to avoid the + +influence of randomness. Each experiment is run on a single RTX-6000 GPU with a learning rate of 1e-4 and a batch size of 32. + +# 4.2.2 Two-Stage Training + +We first explore the two-stage training method which successively fine-tunes the pre-trained BERT model on a cultural background prediction dataset and the target task. We use EnCBP-country here to examine the efficacy of coarse-grained cultural feature augmentation, and we study the effect of using EnCBP-district in Section 4.2.4. + +As Table 5 shows, the two-stage training strategy brings noticeable performance improvements to the SA models. This agrees with prior psychological research (Sun et al., 2021), since the expressions of sentiments and attitudes differ across culture groups. Similarly, since NEs are usually mentioned differently across cultures, training the model to distinguish culture-specific writing styles helps resolve the conflict between the training domain of BERT and that of the CoNLL-2003 dataset and improves the performance of the NER model. On the PI task, while two-stage training has a positive effect on the performance of the model, the score improvement is not as significant as those on SA and NER tasks. The same trend holds for two other semantic tasks (QNLI and STS-B), where two-stage training brings only marginal performance improvements. We attribute this to the additional noise introduced by the cultural background labels for a semantic task, since expressions with the same semantic meaning can be associated with different cultural background labels in EnCBP. To verify this assumption, we conduct an additional experiment by applying the MLM objective instead of the classification objective in the first training stage. The model performance on PI is raised to 94.11 in F1-macro score, outperforming the previous two-stage training model by 2.44. The two-stage training performance also improves by 0.81 and $0.49 / 0.53$ for QNLI and STS-B when using the MLM objective at the first fine-tuning stage. These results imply that while the cultural background labels are noisy for semantic tasks, enhancing the LM with English expressions from multiple cultural backgrounds is beneficial. Quite differently, however, two-stage training brings noticeable performance improvements to the RTE model. One possible explanation is, as is supported by the large standard deviations of evaluation scores in five runs, that the RTE dataset is too small and the performance tend + +
PAWS-Wiki (PI)CoNLL-2003 (NER)Go-Emotions (ER)SST-5 (SA)
BERTorig90.01 (0.35)91.73 (0.39)31.67 (0.59)52.41 (1.20)
+ two-stage training91.67 (0.20)94.41 (0.10)30.72 (0.16)54.54 (0.45)
+ multi-task learning91.58 (0.19)92.92 (0.18)30.71 (0.24)54.47 (0.70)
QNLI (NLI)STS-B (STS)RTE (TE)SST-2 (SA)Emotion (ER)
BERTorig90.89 (0.06)89.22/88.83 (0.05/0.02)64.69 (1.13)91.86 (0.46)88.25 (0.49)
+ two-stage training91.77 (0.09)89.47/89.08 (0.11/0.13)68.45 (1.71)93.09 (0.33)91.94 (0.50)
+ multi-task learning91.20 (0.22)89.32/88.94 (0.10/0.11)70.76 (0.93)92.34 (0.42)91.70 (0.35)
+ +Table 5: The performance of BERT model without cultural feature augmentation (BERT-orig), and models with cultural feature augmentation via two-stage training and multi-task learning. EnCBP-country is used as the auxiliary dataset. We report accuracy for QNLI, RTE, and SST-2, Pearson's and Spearman's correlations for STS-B, and F1-macro for the other tasks. The average score and standard deviation (in parentheses) in five runs with different random seeds are reported for each experiment + +
PAWS-Wiki (PI)CoNLL-2003 (NER)Go-Emotions (ER)SST-5 (SA)
BERTorig90.01 (0.35)91.73 (0.39)31.67 (0.59)52.41 (1.20)
+ two-stage training91.40 (0.20)94.25 (0.11)30.21 (0.37)53.82 (0.45)
+ multi-task learning91.70 (0.23)93.64 (0.14)30.47 (0.14)53.52 (0.54)
QNLI (NLI)STS-B (STS)RTE (TE)SST-2 (SA)Emotion (ER)
BERTorig90.89 (0.06)89.22/88.83 (0.05/0.02)64.69 (1.13)91.86 (0.46)88.25 (0.49)
+ two-stage training91.77 (0.08)89.45/89.01 (0.12/0.13)67.87 (1.09)92.52 (0.32)91.65 (0.24)
+ multi-task learning91.21 (0.24)89.34/89.14 (0.11/0.10)69.68 (1.04)92.89 (0.36)92.07 (0.52)
+ +Table 6: The performance of BERT model without cultural feature augmentation (BERT-orig), and models with cultural feature augmentation via two-stage training and multi-task learning. The EnCBP-district is used as the auxiliary dataset. We report accuracy for QNLI, RTE, and SST-2, Pearson's and Spearman's correlations for STS-B, and F1-macro for the other tasks. The average score and standard deviation (in parentheses) in five runs with different random seeds are reported for each experiment + +to be affected more greatly by other issues such as model initialization. Unlike the other tasks, the performance of BERT drops on Go-Emotions in our evaluations, which is counter-intuitive since expressions of emotion are culture-specific (Hareli et al., 2015). We hypothesize that the negative effect of cultural feature augmentation is mainly caused by the imbalanced distribution of users' cultural backgrounds in the Go-Emotions dataset, as the dataset is constructed over a Reddit3 corpus and nearly $50\%$ Reddit users are from the US4. Supporting our hypothesis, cultural feature augmentation on the Emotion dataset notably improves the perfor + +mance of BERT, despite the domain differences between the EnCBP-country (news domain) and Emotion (social media domain) datasets. + +# 4.2.3 Multi-Task Learning + +We further explore MTL methods for cultural feature augmentation when training the BERT model on downstream tasks. Specifically, we use EnCBP-country as the auxiliary task and train the model alternatively on the primary and auxiliary tasks. + +According to Table 5, introducing cultural background information via MTL improves the performance of BERT on all the datasets except for GoEmotions, similar to the two-stage training method. However, the performance on NER is noticeably lower with MTL than with two-stage training. This + +potentially results from the mono-cultural nature of the CoNLL-2003 dataset, which is constructed on Reuters news, a UK news outlet. While the information and expressions in countries other than UK fade gradually during the second training stage, the MTL method strengthens the irrelevant information in the entire training process and harms the evaluation performance of the model more severely. To validate our hypothesis, we generate a binary cultural background prediction dataset by treating the UK documents as positive instances and the others as negative instances, and we re-run the MTL evaluation on the CoNLL-2003 dataset. The performance of BERT under this setting is raised to 93.97 in F1-macro score, which implies the importance of careful text domain selection for cultural feature augmentation on DL models. + +# 4.2.4 Finer-Grained Feature Augmentation + +We repeat the two-stage training and MTL evaluations on the nine downstream tasks using EnCBP-district to examine the effects of cultural feature augmentation with cultural background information with different granularity levels. The evaluation results are shown in Table 6. While the scores are very consistent with those in Table 5, we observe better MTL performance on CoNLL-2003 and Emotion and worse performance with both two-stage training and MTL on SST-5. Based on our analysis of EnCBP-country and EnCBP-district, the larger gaps in writing style among countries than those across states are likely the cause of the lower NER evaluation performance. In EnCBP-district, the linguistic expressions are more consistent since they all come from news outlets in the US, which relieves the problem and improves the MTL performance on CoNLL-2003. On the contrary, the lower diversity in expressions potentially negatively affects the performance of the SST-5 model since the SA task benefits from identifying culture-specific linguistic expressions, and since the corpus of SST-5 contains writings from all over the world. In addition, using EnCBP-district does not relieve the problem on the Go-Emotions dataset either, which suggests the limitation of cultural feature augmentation: trying to distinct expressions in different cultural backgrounds may introduce unexpected noise into models especially when the cultural background of a dataset is mostly the same. The performance of BERT on the Emotion dataset which consists of writings from more diverse cultural backgrounds, for example, is subject + +to comparable or even greater improvements when the model is augmented using the finer-grained EnCBP-district dataset. + +To summarize, while cultural feature augmentation using EnCBP is beneficial for a wide range of NLP tasks, the necessity of conducting cultural feature augmentation has to be carefully evaluated. We also examine the effect of feature augmentation with less auxiliary data in Appendix B, showing that the size of the auxiliary data has an affect on the performance of DL models. + +# 5 Conclusion and Future Work + +This paper presents EnCBP, a mono-lingual news-based cultural background prediction dataset containing country-level (coarse-grained) and district-level (finer-grained) cultural background labels. Through manual validation on MTurk and cultural domain compatibility evaluations, we find that writing style clearly differs across countries and districts, confirming that cultural background has a substantial effect on writing style even in the same language. We also benchmark the dataset with state-of-the-art NLP models to show that, though challenging, different English expressions across cultural backgrounds can be identified and classified into culture categories by DL models. Additionally, our evaluations on downstream NLP tasks of various types show that cultural feature augmentation is able to improve the performance of DL models on various semantic, syntactic, and psycholinguistic tasks. While the performance of the BERT model is negatively affected by introducing cultural background information on an ER dataset, the imbalanced distribution of cultural backgrounds in its corpus may account for the performance drop. Our results demonstrate that cultural feature augmentation with EnCBP is a practical way of improving the performance of DL models on various NLP tasks, as long as the text domains of EnCBP and the downstream tasks are not too divergent. + +Future work can extend our research to examine cultural differences in social media writings, which reflect even finer-grained cultural distinctions and are much noisier and difficult to annotate or validate than news articles. + +# 6 Acknowledgement + +We thank Mr. Aadil Islam for conducting additional evaluations on QNLI, STS-B, RTE, SST-2, and Emotion to respond to the reviewers' comments. + +# 7 Ethics Statement + +This paper presents and releases a news-based cultural background prediction dataset. The dataset is constructed on publicly available news outlets using the public API of Media Cloud and the labels are generated based on the country and district codes of the media outlets. Thus, there is no sensitive or private information in the dataset. Additionally, since we use mainstream news outlets for our data collection we believe there is less risk of overtly unethical information (though we cannot be sure given the current sociopolitical climate). Given the relatively large size of our dataset, we cannot manually examine all articles, however, the publicly released dataset will warn users of the possibility of the dataset containing unethical information and will allows users to flag unethical articles in our dataset. We also hired annotators from MTurk to validate the quality of annotations for a sample instances from our dataset. To ensure the quality of dataset validation, we require the annotators to be native English speakers from the same country or district as the label of each instance to be validated. The annotators were given clear instructions to choose the news paragraph(s) written by journalists in their countries or districts from a pair of paragraphs. We paid \(0.14 (USD)\) for validating each instance, which translates to over \)25 per hour since each data point takes no more than 1 minute to validate. This hourly rate is considerably higher than the federal minimum wage in the US. The entire annotation process was anonymized and the annotators were not asked for their personally identifiable information, so there was not any risk of harm associated with their participation. + +This paper presents one of the first attempts at tailoring NLP models to the writing styles of specific regions, thus reducing the out-sized influence of the linguistic style of larger countries in these models. + +# References + +Francisca Adoma Acheampong, Chen Wenyu, and Henry Nunoo-Mensah. 2020. Text-based emotion detection: Advances, challenges, and opportunities. Engineering Reports, 2(7):e12189. +Badar Almuailib. 2019. Analyzing cross-cultural writing differences using contrastive rhetoric: A critical review. Advances in Language and Literary Studies, 10(2):102-106. + +Roy Bar-Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. 2006. The second pascal recognising textual entailment challenge. In Proceedings of the second PASCAL challenges workshop on recognising textual entailment, volume 6, pages 6-4. Venice. +Luisa Bentivogli, Peter Clark, Ido Dagan, and Danilo Giampiccolo. 2009. The fifth pascal recognizing textual entailment challenge. In TAC. +Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. Semeval-2017 task 1: Semantic textual similarity-multilingual and cross-lingual focused evaluation. arXiv preprint arXiv:1708.00055. +Ido Dagan, Oren Glickman, and Bernardo Magnini. 2005. The pascal recognising textual entailment challenge. In *Machine Learning Challenges Workshop*, pages 177-190. Springer. +Dorottya Demszky, Dana Movshovitz-Attias, Jeongwoo Ko, Alan Cowen, Gaurav Nemade, and Sujith Ravi. 2020. GoEmotions: A dataset of fine-grained emotions. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4040–4054, Online. Association for Computational Linguistics. +Joseph L Fleiss. 1971. Measuring nominal scale agreement among many raters. Psychological bulletin, 76(5):378. +Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. 2007. The third pascal recognizing textual entailment challenge. In Proceedings of the ACL-PASCAL workshop on textual entailment and paraphrasing, pages 1-9. Association for Computational Linguistics. +Maarten Grootendorst. 2020. Bertopic: Leveraging bert and c-tfidf to create easily interpretable topics. +Shlomo Hareli, Konstantinos Kafetsios, and Ursula Hess. 2015. A cross-cultural study on emotion expression and the learning of social norms. Frontiers in psychology, 6:1501. +Ali Shariq Imran, Sher Mohammad Doudpota, Zenun Kastrati, and Rakhi Bhatra. 2020. Cross-cultural polarity and emotion detection using sentiment analysis and deep learning—a case study on COVID-19. arXiv preprint arXiv:2008.10031. +Heejung S Kim. 2002. We talk, therefore we think? a cultural analysis of the effect of talking on thinking. Journal of personality and social psychology, 83(4):828. +Hiroko Kitano. 1990. Cross-cultural differences in written discourse patterns: a study of acceptability of japanese expository compositions in american universities. +Erin McClure Krampetz. 2005. International educational administration and policy analysis. + +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. +Richard E Nisbett, Kaiping Peng, Incheol Choi, and Ara Norenzayan. 2001. Culture and systems of thought: holistic versus analytic cognition. *Psychological review*, 108(2):291. +Peng Qi, Yuhao Zhang, Yuhui Zhang, Jason Bolton, and Christopher D. Manning. 2020. Stanza: A Python natural language processing toolkit for many human languages. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations. +Elvis Saravia, Hsien-Chi Toby Liu, Yen-Hao Huang, Junlin Wu, and Yi-Shin Chen. 2018. CARER: Contextualized affect representations for emotion recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3687-3697, Brussels, Belgium. Association for Computational Linguistics. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics. +Jimin Sun, Hwijeen Ahn, Chan Young Park, Yulia Tsvetkov, and David R. Mortensen. 2021. Cross-cultural similarity features for cross-lingual transfer learning of pragmatically motivated tasks. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2403-2414, Online. Association for Computational Linguistics. +Timothy Tambassi. 2018. From geographical lines to cultural boundaries: Mapping the ontological debate. Rivista di estetica, 67:150-164. +Yufei Tian, Tuhin Chakrabarty, Fred Morstatter, and Nanyun Peng. 2021. Identifying distributional perspectives from collingual groups. In Proceedings of the Ninth International Workshop on Natural Language Processing for Social Media, pages 178-190, Online. Association for Computational Linguistics. +Erik F. Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the CoNLL-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning at HLT-NAACL 2003, pages 142-147. +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 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998-6008. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In the Proceedings of ICLR. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi 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 M. 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. +Yuan Zhang, Jason Baldridge, and Luheng He. 2019. PAWS: Paraphrase Adversaries from Word Scrambling. In Proc. of NAACL. + +# A Language Modeling Analysis Based on Topic + +We study the cultural domain compatibility across news topics in EnCBP by repeating the LM evaluations with the news paragraphs grouped by their topics. As Table A1 shows, for the topics "Immigration" and "Social Safety Net", the LMs do not achieve the lowest perplexities on their training topics. We speculate that this reflects the more controversial nature of these two topics, since linguistic expressions are heavily affected by attitudes and stances. In addition, since each country or state news outlet has a relatively stable attitude towards each topic, the discrepancy between each trained LM and the test set in the cultural domain of its training set implies that the EnCBP dataset is constructed over diverse culture groups. The diverse writing styles in EnCBP make it appropriate for improving DL models on downstream tasks via cultural feature augmentation, since EnCBP does not bias extremely towards the writing styles of a single culture group. + +# B Feature Augmentation with Less Data + +We repeat the joint modeling and two-stage training experiments on PAWS-Wiki, CoNLL-2003, Go-Emotions, and SST-5 datasets with randomly downsampled EnCBP-country and EnCBP-district training datasets to examine the effect of auxiliary data size. Specifically, we randomly reduce $20\%$ , $40\%$ , and $80\%$ of training instances from EnCBP-country and EnCBP-district with a random seed of 42 and use the reduced datasets in the evaluations. The experimental results are shown in Table B1 (EnCBP-country) and Table B2 (EnCBP-district). + +While removing $20\%$ of the training instances from EnCBP-country and EnCBP-district generally does not greatly affect the feature augmentation evaluation results, there is noticeable performance gap on all the tasks when over $40\%$ of the training instances are eliminated. This may be due to the poorer predictability of cultural background labels from the much smaller training datasets, as the BERT performance drops greatly from 78.13 to 60.92 (on EnCBP-country) and from 72.09 to 60.03 (on EnCBP-district) when $40\%$ of the training data is removed (see Table 3 for the original BERT performance results). On the other hand, though using more training data from EnCBP has positive overall effects on the performance of feature-augmented models, the improvements + +become gradually smaller when the training data amount increases. + +In brief, through these experiments we hypothesize that a cultural background prediction dataset of a moderate size such as EnCBP is sufficient for cultural feature augmentation. Even if datasets larger in size could potentially lead to better performance improvements, the gains are likely to be small compared to the effort required for constructing a larger dataset. + +
Evaluation Corpus
Global WarmingAbortionImmigrationSocial Safety NetMandatory Vaccines
Training CorpusGlobal Warming21.4225.7925.2926.3624.18
Abortion26.4020.7930.6624.3825.80
Immigration30.0025.0028.7025.5024.88
Social Safety Net25.5426.8027.7829.0127.88
Mandatory Vaccines25.4825.1329.5328.1823.22
+ +Table A1: Perplexity of each BERT model fine-tuned on a training topic with the MLM objective and evaluated on an evaluation topic. The lowest perplexity for each fine-tuned LM is in bold and the highest perplexity is underlined. + +
DRPAWS-Wiki (PI)CoNLL-2003 (NER)Go-Emotions (ER)SST-5 (SA)
BERT-orig90.0191.7331.6752.41
80%+ two-stage training91.2494.0729.7653.86
+ multi-task learning91.5093.8829.4254.37
60%+ two-stage training90.6092.5028.9850.54
+ multi-task learning90.8492.0028.9751.24
20%+ two-stage training90.1591.7528.8450.04
+ multi-task learning90.2391.5328.8150.71
+ +Table B1: The performance of BERT without cultural feature augmentation (BERT-orig), and models with cultural feature augmentation via two-stage training (+two-stage training) and multi-task learning (+multi-task learning). The downsampled EnCBP-country datasets are used as auxiliary datasets. DR represents the percentile of remaining data. + +
DRPAWS-Wiki (PI)CoNLL-2003 (NER)Go-Emotions (ER)SST-5 (SA)
BERT-orig90.0191.7331.6752.41
80%+ two-stage training91.1893.4829.5753.34
+ multi-task learning90.9193.2929.9653.38
60%+ two-stage training90.2393.3428.4351.86
+ multi-task learning90.4692.8528.5451.06
20%+ two-stage training89.9892.0028.8150.71
+ multi-task learning90.0091.6528.3950.02
+ +Table B2: The performance of BERT without cultural feature augmentation (BERT-orig), and models with cultural feature augmentation via two-stage training (+two-stage training) and multi-task learning (+multi-task learning). The downsampled EnCBP-district datasets are used as auxiliary datasets. DR represents the percentile of remaining data. \ No newline at end of file diff --git a/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/images.zip b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..671a6651f3e5455784c21885b7d4516787e69fe9 --- /dev/null +++ b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e541ee9570b158c4969b63a999cf05c1bf565cb02e8ccc30f3b1386cdfa660f +size 593190 diff --git a/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/layout.json b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a1e50f839ff0ff8b6b0a9ea3438f8fc25c80656d --- /dev/null +++ b/encbpanewbenchmarkdatasetforfinergrainedculturalbackgroundpredictioninenglish/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f7672e29a1edf36952ba28abcf05f463bce8e0f8041b92ae621a1f379af027f +size 280821 diff --git a/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_content_list.json b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bf880cc9ecef3f016b4f4f53e997a855092977e5 --- /dev/null +++ b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd739551591c39f1f4490377aa8a6cb9b913635a5dd24dd01de93a627778e5ab +size 74782 diff --git a/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_model.json b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b5f2324ee985567d38fc792e7e3df9d06b375d3f --- /dev/null +++ b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5970c09eef59c8a1e17c9f3bf81e928a224631a494b9a485529347340404770 +size 92376 diff --git a/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_origin.pdf b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c282c41d15812e34f371cb7bd1b795daf354478b --- /dev/null +++ b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/ee9fd883-524a-4da0-8fc0-dae76b155cec_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70c16046643a2e052997697c109efa80065f806d4c9f7773dc746359907a83c8 +size 2896056 diff --git a/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/full.md b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..79807fdebbc65b1474a81ca951c854402cdf2c78 --- /dev/null +++ b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/full.md @@ -0,0 +1,344 @@ +# Encoding and Fusing Semantic Connection and Linguistic Evidence for Implicit Discourse Relation Recognition + +Wei Xiang $^{1}$ , Bang Wang $^{1}$ , Lu Dai $^{1}$ , Yijun Mo $^{2*}$ + +$^{1}$ School of Electronic Information and Communications, Huazhong University of Science and Technology, Wuhan, China + +$^{2}$ School of Computer Science and Technology, + +Huazhong University of Science and Technology, Wuhan, China +xiangwei, wangbang, dailu18, moyj}@hust.edu. + +# Abstract + +Prior studies use one attention mechanism to improve contextual semantic representation learning for implicit discourse relation recognition (IDRR). However, diverse relation senses may benefit from different attention mechanisms. We also argue that some linguistic relation in between two words can be further exploited for IDRR. This paper proposes a Multi-Attentive Neural Fusion (MANF) model to encode and fuse both semantic connection and linguistic evidence for IDRR. In MANF, we design a Dual Attention Network (DAN) to learn and fuse two kinds of attentive representation for arguments as its semantic connection. We also propose an Offset Matrix Network (OMN) to encode the linguistic relations of word-pairs as linguistic evidence. Our MANF model achieves the state-of-the-art results on the PDTB 3.0 corpus. + +# 1 Introduction + +Implicit Discourse Relation Recognition (IDRR) is to detect and classify some latent relation in between a pair of text segments (called arguments) without an explicit connective word. It is of great importance for many downstream Natural Language Processing (NLP) applications, such as question answering (Liakata et al., 2013), machine translation (Guzmán et al., 2014), information extraction (Xiang and Wang, 2019), sentiment analysis (Wang and Wang, 2020), and etc. However, due to the absence of an explicit connective word, inferring discourse relations from the contextual semantics of arguments is still a challenging task. + +Conventional machine learning based methods usually train a relation classifier by using many handmade features to capture lexical, syntactic regularity and contextual information of arguments, which is time-consuming and labor-intensive (Pitler et al., 2009, 2008). Deep learning based methods + +design diverse neural networks to automatic learn the contextual semantic representation of each argument, such as the Shallow Conventional Neural Network (SCNN) (Zhang et al., 2015), Tree-like Long Short-Term Memory (Tree-LSTM) (Rutherford et al., 2017), and BiLSTM-CNN framework (Guo et al., 2019). Although these neural networks can autonomously learn a kind of deeper contextual semantics of arguments, they do not differentiate arguments' words in the representation learning. + +Recently, some attention mechanisms have been employed in neural networks to unequally treat words in representation learning. For example, the self-attention computes the local contextual importance of each word in one argument, which generally prioritizes content words for better learning substantive meaning of an argument (Zhou et al., 2016). The interactive attention weights each word in one argument according to its interaction with the representation of another argument, which usually focuses on the rhetorical device of two arguments, like prioritizing some function words with little substantive meaning but potentially indicating the connection of two arguments (Liu and Li, 2016; Guo et al., 2018). + +Both kinds of attention mechanisms have been proven effective for IDRR, as each can well exploit either content semantics or rhetorical devices of an argument pair. We regard these contextual semantic information derived from argument content as a kind of semantic connection for relation recognition. However, the IDRR task normally needs to recognize diverse senses of relations, while different senses may benefit from different attentions. To enjoy both advantages, we propose to learn two kinds of argument representation, each based on one attention mechanism. They are next fused to encode an argument pair as the semantic connection for relation recognition in this paper. + +Besides semantic connection, we argue that a + +kind of linguistic evidence can be obtained from word distributed representation for relation recognition. Indeed, many pre-trained language models, like the word2vec (Mikolov et al., 2013) and BERT (Devlin et al., 2019), are learned from a large amount of unlabeled text by encoding the linguistic regularities and patterns in an unsupervised way. As a word embedding contains inherent meaning of the word, it can be used to infer some linguistic relation in between two words by linear translation. This motivates us to encode such linguistic relations of word-pairs as linguistic evidence. + +In this paper, we propose a Multi-Attentive Neural Fusion (MANF) model to encode and fuse both semantic connection and linguistic evidence for the IDRR task. The MANF model contains two modules. One is a Dual Attention Network (DAN): It builds upon a BiLSTM to first encode a self-attentive representation and an inter-attentive representation for each argument. To adapt to different relation senses, we next use a fusion gate to integrate the two representations into the semantic connection representation. Another is an Offset Matrix Network (OMN): It first computes the offset between word embeddings of a word-pair that contains one word from the first argument and another word from the second argument. Upon the offset matrix, we next design an offset attention layer and a multilayer perceptron to encode the linguistic evidence representation. Finally, we design another fusion gate to integrate both semantic connection and linguistic evidence representation for relation recognition. Our MANF Model achieve the state-of-the-art results on the PDTB 3.0 corpus. Our main contributions are as follows: + +- Propose a MANF model to encode and fuse semantic connection and linguistic evidence for the IDRR task. +- Propose a DAN to enjoy both self-attention and interactive attention for semantic connection encoding. +- Propose an OMN to encode word-pairs' offsets as linguistic evidence. +- Provide a new baseline result for the IDRR task on the PDTB 3.0 corpus. + +# 2 The Multi-Attentive Neural Fusion Model + +Fig. 1 illustrates our MANF model, including the DAN, the OMN, and a hierarchical fusion mechanism. + +# 2.1 Dual Attention Network + +Our DAN is built upon a BiLSTM or BERT to encode a self-attentive representation and an inter-attentive representation for each argument, which are next fused to output the semantic connection representation for an argument pair. We note that a BiLSTM has been widely used to capture word contextual semantics for its good sequential encoding capability. In our experiments, we also replace the word2ve by a fine-tuned BERT for comparison. + +The DAN model is illustrated in the left part of Fig. 1, which consists of a BiLSTM layer, a dual attention layer, and a fusion gate layer. We use pretrained word2vec word embeddings $\mathbf{x} \in \mathbb{R}^{d_w}$ to input the BiLSTM. An argument pair $(\text{Arg}_1; \text{Arg}_2)$ can be denoted by: + +$$ +\operatorname {A r g} _ {1}: \left[ \mathbf {x} _ {1} ^ {1}, \mathbf {x} _ {2} ^ {1}, \dots , \mathbf {x} _ {L _ {1}} ^ {1} \right]; \tag {1} +$$ + +$$ +A r g _ {2}: [ \mathbf {x} _ {1} ^ {2}, \mathbf {x} _ {2} ^ {2}, \dots , \mathbf {x} _ {L _ {2}} ^ {2} ], \tag {2} +$$ + +where $\mathbf{x}_i^1$ and $\mathbf{x}_j^2$ represents the $i$ -th word embedding in the 1st argument and the $j$ -th word embedding in the 2nd argument respectively, and $d_w$ the word embedding dimension. + +BiLSTM layer: After the BiLSTM, we obtain two hidden states $\vec{\mathbf{h}}_i$ and $\vec{\mathbf{h}}_i$ for each word in one argument from the forward and backward sequence respectively, which are concatenated to obtain an intermediate state $\mathbf{h}_i = [\vec{\mathbf{h}}_i, \vec{\mathbf{h}}_i]$ . We use a matrix $\mathbf{H} = [\mathbf{h}_1, \mathbf{h}_2, \dots, \mathbf{h}_L]$ to denote an argument encoding after the BiLSTM, where $\mathbf{h}_i \in \mathbb{R}^{2d_h}$ , $\mathbf{H} \in \mathbb{R}^{L \times 2d_h}$ , $d_h$ is the dimension of hidden state. + +Dual attention layer: To enjoy both advantages of self-attention and interactive attention, we propose a dual attention mechanism to encode an argument pair. For self-attention, the representation of each argument $\mathbf{r_s}$ is formed by weighted sum of intermediate state vectors produced by BiLSTM (Zhou et al., 2016): + +$$ +\boldsymbol {\alpha} _ {s} = \operatorname {s o f t m a x} \left(\mathbf {w} _ {s} ^ {\top} \mathbf {H}\right), \tag {3} +$$ + +$$ +\mathbf {r} _ {s} = \mathbf {H} \boldsymbol {\alpha} _ {s} ^ {\mathsf {T}}, \tag {4} +$$ + +where $\alpha_{s} \in \mathbb{R}^{L}$ is the self-attention weight vector of an argument computed by local contextual importance of each word, $\mathbf{w}_{s}$ a learnable parameter vector. + +For interactive attention, we use the representation of one argument to weight each word in another argument (Ma et al., 2017; Meng et al., 2016). We sum up the intermediate states $\mathbf{h}_{\mathrm{i}}$ to obtain an intermediate argument representation, i.e., + +![](images/8401663af6876aec31b0bc640ea6bcd225afb2cb86318902c0826df5e70d507e.jpg) +Figure 1: Illustration of our multi-attentive neural fusion model. + +$\mathbf{S} = \sum_{i=1}^{L} \mathbf{h}_{i}$ . The weight vector $\alpha_{i} \in \mathbb{R}^{L}$ is computed by taking inner product between $\mathbf{S}$ and $\mathbf{H}$ cross two arguments, and followed by a softmax function as follows: + +$$ +\boldsymbol {\alpha} _ {i} ^ {1} = \operatorname {s o f t m a x} \left(\mathbf {H} _ {1} \mathbf {S} _ {2} ^ {\top}\right) \tag {5} +$$ + +$$ +\boldsymbol {\alpha} _ {i} ^ {2} = \operatorname {s o f t m a x} \left(\mathbf {H} _ {2} \mathbf {S} _ {1} ^ {\top}\right) \tag {6} +$$ + +Finally, we weighted sum the intermediate state vectors with corresponding weight vector to form the interactive attention representation $\mathbf{r}_i$ for each argument: + +$$ +\mathbf {r} _ {i} ^ {1} = \mathbf {H} _ {1} \left(\boldsymbol {\alpha} _ {i} ^ {1}\right) ^ {\top}, \quad \mathbf {r} _ {i} ^ {2} = \mathbf {H} _ {2} \left(\boldsymbol {\alpha} _ {i} ^ {2}\right) ^ {\top}. \tag {7} +$$ + +Fusion gate layer: Considering the importance of the two attentions not always the same for different relation sense classification, we use a fusion gate to integrate their representations. First, we concatenate the representation of $Arg_{1}$ and $Arg_{2}$ to model their discourse relation as $\mathbf{v}_s = [\mathbf{r}_s^1,\mathbf{r}_s^2 ]$ and $\mathbf{v}_i = [\mathbf{r}_i^1,\mathbf{r}_i^2 ]$ , where $\mathbf{v}_s,\mathbf{v}_i\in \mathbb{R}^{4d_h}$ . The transition functions of fusion gate layer are computed as follows: + +$$ +\mathbf {g} _ {d} = \operatorname {s i g m o i d} \left(\mathbf {W} _ {d} \mathbf {v} _ {s} + \mathbf {U} _ {d} \mathbf {v} _ {i} + \mathbf {b} _ {d}\right), \tag {8} +$$ + +$$ +\mathbf {v} _ {d} = \mathbf {g} _ {d} \odot \mathbf {v} _ {s} + (1 - \mathbf {g} _ {d}) \odot \mathbf {v} _ {i}, \tag {9} +$$ + +where $\mathbf{W}_d\in \mathbb{R}^{4d_h\times 4d_h}$ $\mathbf{U}_d\in \mathbb{R}^{4d_h\times 4d_h}$ and $\mathbf{b}_d\in$ $\mathbb{R}^{4d_h}$ are learnable parameters and $\odot$ donates the element-wise product of vectors. + +With the fusion gate, our DAN adaptively assigns different importance to self-attention and interactive attention, and outputs $\mathbf{v}_d\in \mathbb{R}^{4d_h}$ as the semantic connection vector for an argument pair. + +# 2.2 Offset Matrix Network + +We propose an OMN to encode the linguistic evidence representation based on the offsets of pretrained word embeddings, as shown in the right part of Fig. 1. First, we compute the offset between word embeddings of a word-pair that contains one word from the first argument and another word from the second argument. Then all the word-pair offsets of an argument pair compose an offset matrix $\mathbf{M} \in \mathbb{R}^{L_1 \times L_2 \times d_h}$ , where $\mathbf{e}_{ij} \in \mathbb{R}^{d_h}$ is the offset vector between the $i$ -th word in the 1st argument and the $j$ -th word in the 2nd argument. + +Considering that each word-pair in the offset matrix may have different contribution to the relation classification, we assign a weight score $\alpha_{ij}$ to every offset vectors, and the weight scores are compute as follows: + +$$ +\mathbf {A} = \operatorname {s o f t m a x} \left(\mathbf {w} _ {o} ^ {\top} \mathbf {M}\right), \tag {10} +$$ + +where $\mathbf{A} \in \mathbb{R}^{L_1 \times L_2}$ is the weight matrix, $\mathbf{w}_o$ is a learnable parameter vector. We compute a word-pair interaction vector $\mathbf{m} \in \mathbb{R}^{d_h}$ as the weighted + +sum of all word-pair offset vectors: + +$$ +\mathbf {m} = \sum_ {i = 1} ^ {L _ {1}} \sum_ {j = 1} ^ {L _ {2}} \mathbf {e} _ {i j} \boldsymbol {\alpha} _ {i j} \tag {11} +$$ + +Next, we input $\mathbf{m}$ into a multilayer perceptron (MLP) followed by a tanh activation function to output the linguistic evidence vector $\mathbf{v}_o\in \mathbb{R}^{4d_h}$ for an argument pair: + +$$ +\mathbf {v} _ {o} = \tanh (\mathbf {W} _ {o} \mathbf {m} + \mathbf {b} _ {o}), \tag {12} +$$ + +where $\mathbf{W}_o\in \mathbb{R}^{d_h\times 4d_h}$ and $\mathbf{b}_o\in \mathbb{R}^{4d_h}$ are learnable parameters. + +# 2.3 Implicit Discourse Relation Classification + +After obtaining the semantic connection vector $\mathbf{v}_d$ and the linguistic evidence vector $\mathbf{v}_o$ , we also argue that they may have different importance for diverse relation sense classification. So we use another fusion gate to integrate the two kinds of representation vectors and obtain the final representation $\mathbf{v} \in \mathbb{R}^{4d_h}$ of an argument pair for relation classification. The transition functions are: + +$$ +\mathbf {g} _ {o} = \operatorname {s i g m o i d} \left(\mathbf {W} _ {f} \mathbf {v} _ {d} + \mathbf {U} _ {f} \mathbf {v} _ {o} + \mathbf {b} _ {f}\right), \tag {13} +$$ + +$$ +\mathbf {v} = \mathbf {g} _ {o} \odot \mathbf {v} _ {d} + (1 - \mathbf {g} _ {o}) \odot \mathbf {v} _ {o}, \tag {14} +$$ + +where $\mathbf{W}_f, \mathbf{U}_f \in \mathbb{R}^{4d_h \times 4d_h}$ and $\mathbf{b}_f \in \mathbb{R}^{4d_h}$ are learnable parameters. + +The classifier is a fully connected layer with softmax to transform the final argument pair representation $\mathbf{v}$ to a probability distribution $\hat{\mathbf{y}}\in \mathbb{R}^n$ for predicting the discourse relation sense: + +$$ +\hat {\mathbf {y}} = \operatorname {s o f t m a x} \left(\mathbf {W} _ {c} \mathbf {v} + \mathbf {b} _ {c}\right), +$$ + +where $\mathbf{W}_c\in \mathbb{R}^{4d_h\times n}$ , $\mathbf{b}_c\in \mathbb{R}^n$ are learnable parameters. + +For model training, we adopt the cross entropy loss as the cost function: + +$$ +J (\theta) = - \frac {1}{K} \sum_ {k = 1} ^ {K} \mathbf {y} ^ {(k)} \log \left(\hat {\mathbf {y}} ^ {(k)}\right) + \lambda \| \theta \| ^ {2}, \tag {15} +$$ + +where $\mathbf{y}^{(k)}$ and $\hat{\mathbf{y}}^{(k)}$ are the gold label and predicted label of the $k$ -th training instance respectively. $\lambda$ and $\theta$ are the regularization hyper-parameters. We use the Adam optimizer and combine dropout with $L2$ regularization for model training. + +
RelationTrainDev.Test
Expansion8645748643
Comparison1937190154
Contingency5916579529
Temporal1447136148
Total1794516531474
+ +Table 1: Statistics of implicit discourse relation instances in PDTB 3.0 with four top-level relation senses. + +# 3 Experiment Setting + +# 3.1 The PDTB 3.0 Dataset + +We conduct experiments on the latest version 3.0 of Penn Discourse TreeBank (PDTB) corpus, which was released on March 2019 and updated on February 2020. Following the conventional data splitting in PDTB 2.0, we use sections 2-20 as the training set, sections 21-22 as the testing set and 0-1 as the development set (Ji and Eisenstein, 2015). Our experiments are conducted on the four top-level classes of relation sense as the existing studies, including Comparison, Contingency, Expansion and Temporal. The statistics of implicit discourse relation instances in the PDTB 3.0 corpus are summarized in Table 1. More details about PDTB 3.0 are provided in the supplementary material. + +# 3.2 Competitors + +- NNMA (Liu and Li, 2016) combines two arguments' representation for stacked interactive attentions. +- ANN (Lan et al., 2017) applies interactive attention into a multi-task learning framework. +IPAL (Ruan et al., 2020) propagates selfattention into interactive attention by a cross-coupled network. +- DAGRN (Chen et al., 2016b) encodes word-pair interactions by a neural tensor network. + +# 3.3 Parameter Setting + +We obtain the pre-trained word embeddings from the 300-dimensional English word2vec model $(d_w = 300)$ provided by Google $^{1}$ and the 768-dimensional English BERT model $(d_w = 768)$ provided by HuggingFace $^{2}$ . From our statistics, $99.46\%$ of arguments do not exceed 50 words in PDTB3.0. So we set the maximum length of argument to 50 ( $L = 50$ ). For the word2vec model, we set the mini-batch size to 32 and the + +initial learning rate to 5e-4; while for the BERT model, the mini-batch size and initial learning rate is 16 and 1e-5. The trainable parameters are randomly initialized from normal distributions, and the dropout rate is set to 0.2 in the fusion gates and 0.5 in the MLP. We release the code at: https://github.com/HustMinsLab/MANF. + +# 4 Result and Analysis + +# 4.1 Overall Result + +We implement four-way classification and binary classification (i.e. one-versus-others) on the PDTB 3.0, in which macro $F_{1}$ score and accuracy (Acc) are used for four-way classification and $F_{1}$ score is used for binary classification. + +Table 2 compares the overall performance between our MANF and the competitors. In four-way classification, our MANF achieves significant improvements over competitors in terms of both macro $F_{1}$ and Acc. In binary-classification, ours also achieves the best performance in three relation sense classification, while the second with a small $F_{1}$ gap to that of NNMA in the Temporal sense classification. + +We note that the first three competitors are neural models mainly for learning argument representation from contextual semantic connections; While the DAGRN is a neural model for learning representation from word linguistic evidences. The first observation is that the DARGN cannot outperform the first three competitors, though the performance gaps are not obvious. This might suggest that latent semantic connections learned from sequential contexts play the main role in relation recognition. This, however, is not unexpected. A relation is usually used for linking the meanings of two arguments, i.e., semantic connections, no matter with or without an explicit connective. + +The second observation is that in the first three competitors, the ANN cannot outperform either NNMA or IPAL, not even once in all the performance metrics. We note that although they all employ attention mechanisms in learning semantic connection, the ANN applies a straightforward interactive attention to learn argument representation; While the NNMA designs a sophisticated mechanism for stacking multiple levels of attention, and the IPAL employs a kind of sequential attention mechanism, i.e., interactive attention after self-attention. + +Finally, we attribute the outstanding perfor + +mance of our MANF model to its fusion of two attentions for learning semantic connection, as well as its exploitation of word linguistic evidence. This will be further analyzed in our ablation studies. + +# 4.2 Ablation Study + +Linguistic Evidence: We have argued that the inherent meaning of a word, other than its contextual semantics, can be exploited as a kind of linguistic evidence between two arguments for relation classification. To this end, we have designed the OMN module with the pre-trained word embeddings as its input. This input choice is from such considerations: A pre-trained word embedding is normally learned from a huge corpus containing materials from diverse backgrounds3, which not only could capture some polysemous property for one word, but also could encode some linguistic regularity and pattern in between words from different contexts. While such properties might be compromised, if we input the OMN with the contextual semantic encodings. + +To verify our arguments, we design two variants for the input of the OMN module. (1) Shared: It replaces the input of pre-trained $\mathbf{x}_i^1 (\mathbf{x}_j^2)$ by the hidden state $\mathbf{h}_i^1 (\mathbf{h}_j^2)$ of the respective BiLSTM in the DAN module. That is, two modules share the same BiLSTM for encoding word contextual semantics. (2) Parallel: We adopt additional BiLSM networks with their hidden states to replace pre-trained word embeddings. That is, two modules adopt parallel BiLSTM networks. + +Table 3 presents the results of the three input choices for the OMN module. The better performance of using pre-trained word embedding can support our arguments. Although a BiLSTM network is well capable of encoding a word contextual semantics for its sequential processing mechanism, our design objective is to exploit the inherent meaning of a word to capture linguistic evidence for an argument pair. This is particular evident in the binary classification of Comparison and Temporal relation sense for its larger improvements. So using the pre-trained word embedding is a wise choice. + +Module ablation study: To examine the effectiveness of different modules, we design the following ablation study. + +
ModelFour-way ClassificationBinary Classification (F1)
F1AccExpa.Comp.Cont.Temp.
NNMA (EMNLP, 2016)46.13%57.67%65.10%29.15%63.33%41.03%
ANN (EMNLP, 2017)47.29%57.06%64.03%30.10%60.91%33.71%
IPAL (COLING, 2020)49.45%58.01%64.28%30.37%61.95%34.74%
DAGRN (ACL, 2016)45.11%57.33%64.71%27.34%62.56%38.91%
Our MANF53.14%60.45%67.82%34.16%65.48%40.22%
+ +Table 2: Overall result of comparison models for implicit discourse relation classification. +Four-way Classification + +
MethodPre-trainedSharedParallel
F153.14 %50.41%51.54%
Acc60.45%58.82%60.85%
+ +Binary Classification (F1) + +
MethodPre-trainedSharedParallel
Expa.67.82%67.13%67.47%
Comp.34.16%31.43%30.48%
Cont.65.48%63.06%64.93%
Temp.40.22%38.83%38.36%
+ +Table 3: Ablation study for linguistic evidence by using different word encodings as the OMN input. + +- BiLSTM (B) is the building block of DAN, without two attentions and word-pair offsets. +- B+SelfAtt is a subpart of DAN, with only self-attention, but without interactive attention and word-pair offsets. +- B+InterAtt is a subpart of DAN, with only interactive attention, but without self-attention and word-pair offsets. +- B+DualAtt (DAN) is only the DAN module, with two attentions, but without word-pair offsets. +- WordPair (OMN) is only the OMN module, without argument representation for semantic connection. +- B+WordPair combines the OMN with a BiLSTM for encoding semantic connection but without any attention. +- B+DualAtt+WordPair is our MANF model. + +Table 4 presents the results of our module ablation study. Among the first four models without using word-pair offsets, we first observe that the bare BiLSTM cannot outperform those employing attention(s) to differentiate words in argument representation learning. On the other hand, the B+DualAtt achieves better performance compared with the B+SelfAtt and B+InterAtt each using only one kind of attention, except a slight gap of Acc in the four-way classification. This indicates that our + +fusion of both attention mechanisms is an effective approach to augment semantic connection learning for an argument pair. + +We also observe that the WordPair(OMN) only exploiting word-pair offsets performs the worst among all models. This, however, is not unexpected, as it totally ignores an argument semantics as well as latent semantic connection between arguments. On the other hand, the B+WordPair model, fusing linguistic evidence with semantic connection even learned by a bare BiLSTM without any attention, can greatly improve the performance of WordPair(OMN). The B+WordPair model can even achieve the best or the second best in some cases. This again validates our arguments of encoding and fusing both semantic connection and linguistic evidence to improve relation recognition. + +Table 5 presents experiments using fine-tuned BERT to replace the word2vec based BiLSTM for semantic connection encoding. In contrast, the OMN module uses the BERT without fine-tuning to exploit linguistic evidence. The first three ablation modules correspond to the BiLSTM (B), B+DualAtt (DAN) and B+WordPair, respectively. We can observe that the BERT+DualAtt and BERT+WordPair models achieve better performance than the baseline BERT model. This further confirms the necessity of fusing both attention mechanisms and exploiting linguistic evidence. Finally, our MANF model yields substantial improvements overall ablation modules, and the outstanding performance approves our arguments and design objectives. + +# 4.3 Case Study + +We use case study to visualize and compare different attention mechanisms. Fig. 2 visualizes the word weight obtained by self-attention and interactive attention for four cases of different relation senses. We observe that the two attentions assign different weights to different words. In particular, the interactive attention seems to mainly focus on + +
ModelFour-way ClassificationBinary Classification (F1)
F1AccExpa.Comp.Cont.Temp.
BiLSTM (B)47.80%57.67%63.07%28.05%61.79%36.40%
B+SelfAtt49.39%59.16%66.79%30.80%64.72%36.57%
B+InterAtt50.70%59.63%67.30%30.15%62.36%36.33%
B+DualAtt (DAN)51.64%59.50%67.50%32.18%65.42%38.53%
WordPair (OMN)39.62%51.22%60.81%25.95%57.37%26.87%
B+WordPair50.95%60.31%67.01%34.30%63.15%36.81%
B+DualAtt+WordPair (MANF)53.14%60.45%67.82%34.16%65.48%40.22%
+ +Table 4: Experiment results of module ablation study. + +
ModelFour-way ClassificationBinary Classification (F1)
F1AccExpa.Comp.Cont.Temp.
BERT54.74%62.69%68.01%34.75%64.45%40.25%
BERT+DualAtt (DAN)55.23%62.21%68.18%35.70%65.07%40.37%
BERT+WordPair55.02%61.67%68.49%36.12%65.45%42.65%
BERT+DualAtt+WordPair (MANF)56.63%64.04%70.00%35.83%66.77%42.13%
+ +Table 5: Experiment results with the fine-tuned BERT language model. + +one word with a very high weight in each argument, which is generally a kind of function word, such as the "in", "back" in the Temporal case, "His", "and" in Contingency case, and "I" in Comparison case. Such function words may be regarded as serving a kind of rhetorical devices for some common linguistic regularities and patterns. + +On the other hand, the self-attention tends to assign several words in one argument with similar yet non-ignorable weights, which are often kinds of content words, such as "slithered", "and", "slipped" in the Expansion case. Such a few of content words might be more important to capture the contextual semantics of an argument, which can be next exploited for encoding semantic connection between two arguments. Such functionality differences of the two attentions indeed have motivated us to try a fusion mechanism, so as for each to excel in relation recognition of different senses. + +Fig. 3 visualizes the weight matrix of word-pair offsets in the OMN module but with different input. It can be observed that using pre-trained word embeddings can help emphasizing the word-pair "don't-did" probably for their generally containing fewer contextual information. On the other hand, the other two using word contextual encoding pay attentions to word-pairs much similar to those words in the self-attention and interactive attention, such as "I-I", "I-think", "I-don't". As word contextual encoding has already been exploited in the DAN module, we argue that using + +pre-trained word embeddings for word-pair offsets could complete argument representation learning from another view of common linguistic evidence. + +# 5 Related Work + +The IDRR task is usually approached as a classification problem, and the key is the argument representation. + +Machine learning approaches, like using a Naive Bayes, Support Vector Machine (SVM) classifier, have designed various features to capture lexical, syntactic regularity and contextual information as argument representation (Pitler et al., 2008; Lin et al., 2009; Pitler et al., 2009; Louis et al., 2010). However, manually crafting features is not only time-consuming and labor-intensive, but also suffers from data sparsity problem due to the use of one-hot feature encoding. + +Deep learning models have prevailed for their capabilities of automatic learning argument representation (Zhang et al., 2015; Rutherford et al., 2017). For example, the SCNN model (Zhang et al., 2015) obtains each argument representation via a single convolution layer, and the concatenation of two arguments' representations is used for relation classification. Rutherford et al. (Rutherford et al., 2017) employ a LSTM network to capture word contextual semantics for argument representation. Some hybrid models have attempted to combine CNN, LSTM, graph convolutional networks and etc. for more sophisticated argument representa + +![](images/70a4d964f1eeb74f60527b51bd3e32db4ff339f1a1647ad0b86d5270badd068b.jpg) +Figure 2: Visualization of attention weights for four cases of relations senses. + +![](images/70578b81fa6752b3c86995aeca02ca6f2b04df45d85c4f63de9affac790483b6.jpg) +(a) Pre-trained word embedding + +![](images/2b8b4c0ceaa5890e259cc95e44ff75471738105658932a68fb7fc62b920687ed.jpg) +(b) Shared BiLSTM +Figure 3: Visualization of the weight matrix of word-pair offsets in the OMN module with the input of (a) pretrained word embeddings, (b) hidden states of shared BiLSTM, and (c) hidden states of parallel BiLSTM. + +![](images/46f8ab4182efbbc022b982f70511965a83303b81ed7fa6086cdaa3aa7cde1c70.jpg) +(c) Parallel BiLSTM + +tion (Guo et al., 2019; Xu et al., 2019; Zhang et al., 2021). These approaches, however, have ignored the fact that different words may contribute differently in argument representation learning. + +Attention mechanisms can guide a neural model to unequally encode each word according to its contextual importance for argument representation (Zhou et al., 2016; Bai and Zhao, 2018; Liu and Li, 2016; Guo et al., 2018, 2020). For example, Zhou et al. (Zhou et al., 2016) apply self-attention to weight a word according to its similarity to its belonging argument. Guo et al. (Guo et al., 2018, 2020) adopt an interactive attention to differentiae words in one argument, where a word is weighted according to the similarity between its encoding and another argument representation. Liu and Li (Liu and Li, 2016) design a multi-level attention to repeatedly compute word importance in a hierarchical way. Ruan et al. (Ruan et al., 2020) propose a pipeline workflow to apply interactive attention after self-attention. + +Word pair features have been exploited in machine learning and deep learning approaches for argument representation (Blair-Goldensohn et al., 2007; Biran and McKeown, 2013; Zhou et al., 2013; Chen et al., 2016a,b). For example, Biran + +and McKeown (Biran and McKeown, 2013) compute the appearance probabilities of aggregated word pairs to train a logistic regression classifier. Chen et al. (Chen et al., 2016b) construct a relevance score word-pair interaction matrix based on a bilinear model (Jenatton et al., 2012) and a single layer neural model (Collobert and Weston, 2008). + +The proposed MANF model is a deep neural model, employing a hierarchical fusion mechanism to fuse two kinds of attentive word encodings as well as word pair offset encodings in argument representation learning. + +# 6 Concluding Remarks + +In this paper, we argue that implicit relation recognition can benefit from both semantic connection and linguistic evidence between arguments. Motivated from such considerations, we have designed the MANF model to encode and fuse them for the IDRR task. The MANF model consists a DAN module to fuse both self-attentive and interattentive contextual semantics for learning representation of semantic connection, and a OMN module to attentively encode word-pair offsets for learning representation of linguistic evidence. Both kinds of representations are finally fused for rela + +tion recognition. Experiments on the latest PDTB 3.0 corpus have validated our design objectives for the new benchmark performance established by our MANF model. + +This paper has employed the pre-trained word embeddings trained by the word2vec and BERT; While other pre-training models shall also be adopted and tested in our future work. The performance differences of recognizing different relation senses also motivate to further investigate other advanced fusion mechanisms. + +# Acknowledgements + +This work is supported in part by National Natural Science Foundation of China (Grant No: 62172167). We also want to use our MANF model on MindSpore4, which is a new deep learning computing framework. These problems are left for future work. + +# References + +Hongxiao Bai and Hai Zhao. 2018. Deep Enhanced Representation for Implicit Discourse Relation Recognition. In Proceedings of the 27th International Conference on Computational Linguistics, pages 571-583, Stroudsburg, PA. The Association for Computational Linguistics. +Or Biran and Kathleen McKeown. 2013. Aggregated Word Pair Features for Implicit Discourse Relation Disambiguation. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics, pages 69-73, Stroudsburg, PA. The Association for Computational Linguistics. +Sasha Blair-Goldensohn, Kathleen McKeown, and Owen Rambow. 2007. Building and Refining Rhetorical-Semantic Relation Models. In Human Language Technology Conference of the North American Chapter of the Association of Computational Linguistics, pages 428-435, Stroudsburg, PA. The Association for Computational Linguistics. +Jifan Chen, Qi Zhang, Pengfei Liu, and Xuanjing Huang. 2016a. Discourse relations detection via a mixed generative-discriminative framework. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, pages 2921-2927, Menlo Park, Calif. AAAI Press. +Jifan Chen, Qi Zhang, Pengfei Liu, Xipeng Qiu, and Xuan-Jing Huang. 2016b. Implicit discourse relation detection via a deep architecture with gated relevance network. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, pages 1726-1735, Stroudsburg, PA. The Association for Computational Linguistics. + +Ronan Collobert and Jason Weston. 2008. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pages 160-167, New York, NY. ACMPress. +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 Computational Linguistics, pages 4171-4186, Stroudsburg, PA. The Association for Computational Linguistics. +Fengyu Guo, Ruifang He, and Jianwu Dang. 2019. Implicit discourse relation recognition via a bilstm-cnn architecture with dynamic chunk-based max pooling. IEEE Access, 7:169281-169292. +Fengyu Guo, Ruifang He, Jianwu Dang, and Jian Wang. 2020. Working Memory-Driven Neural Networks with a Novel Knowledge Enhancement Paradigm for Implicit Discourse Relation Recognition. In Proceedings of the Thirty-Fourth AAAI Conference on Artificial Intelligence, pages 7822-7829, Menlo Park, Calif. AAAI Press. +Fengyu Guo, Ruifang He, Di Jin, Jianwu Dang, Longbiao Wang, and Xiangang Li. 2018. Implicit discourse relation recognition using neural tensor network with interactive attention and sparse learning. In Proceedings of the 27th International Conference on Computational Linguistics, pages 547-558, Stroudsburg, PA. The Association for Computational Linguistics. +Francisco Guzmán, Shafiq Joty, Lluis Márquez, and Preslav Nakov. 2014. Using discourse structure improves machine translation evaluation. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics, pages 687-698, Stroudsburg, PA. The Association for Computational Linguistics. +Rodolphe Jenatton, Nicolas L Roux, Antoine Bordes, and Guillaume R Obozinski. 2012. A latent factor model for highly multi-relational data. In Advances in neural information processing systems, pages 3167-3175, Cambridge, MA. MIT Press. +Yangfeng Ji and Jacob Eisenstein. 2015. One vector is not enough: Entity-augmented distributed semantics for discourse relations. Transactions of the Association for Computational Linguistics, 3:329-344. +Man Lan, Jianxiang Wang, Yuanbin Wu, Zheng-Yu Niu, and Haifeng Wang. 2017. Multi-task attention-based neural networks for implicit discourse relationship representation and identification. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1299-1308, Stroudsburg, PA. The Association for Computational Linguistics. + +Maria Liakata, Simon Dobnik, Shyamasree Saha, Colin Batchelor, and Dietrich Rebholz Schuhmann. 2013. A discourse-driven content model for summarising scientific articles evaluated in a complex question answering task. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 747-757, Stroudsburg, PA. The Association for Computational Linguistics. +Ziheng Lin, Min-Yen Kan, and Hwee Tou Ng. 2009. Recognizing Implicit Discourse Relations in the Penn Discourse Treebank. In Proceedings of the 2009 Conference on Empirical Methods in Natural Language Processing, pages 343-351, Stroudsburg, PA. The Association for Computer Linguistics. +Yang Liu and Sujian Li. 2016. Recognizing Implicit Discourse Relations via Repeated Reading: Neural Networks with Multi-Level Attention. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1224-1233, Stroudsburg, PA. The Association for Computational Linguistics. +Annie Louis, Aravind Joshi, Rashmi Prasad, and Ani Nenkova. 2010. Using entity features to classify implicit discourse relations. In Proceedings of the SIG-DIAL 2010 Conference, pages 59-62, Stroudsburg, PA. The Association for Computer Linguistics. +Dehong Ma, Sujian Li, Xiaodong Zhang, and Houfeng Wang. 2017. Interactive Attention Networks for Aspect-Level Sentiment Classification. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, pages 4068-4074, Amsterdam, Netherlands. Elsevier. +Fandong Meng, Zhengdong Lu, Hang Li, and Qun Liu. 2016. Interactive Attention for Neural Machine Translation. In Proceedings of the 26th International Conference on Computational Linguistics: Technical Papers, pages 2174-2185, Stroudsburg, PA. The Association for Computational Linguistics. +Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111-3119, Cambridge, MA. MIT Press. +Emily Pittler, Annie Louis, and Ani Nenkova. 2009. Automatic sense prediction for implicit discourse relations in text. In Proceedings of the 47th Annual Meeting of the Association for Computational Linguistics and the 4th International Joint Conference on Natural Language Processing of the AFNLP, pages 683-691, Stroudsburg, PA. The Association for Computer Linguistics. +Emily Pitler, Mridhula Raghupathy, Hena Mehta, Ani Nenkova, Alan Lee, and Aravind K. Joshi. 2008. + +Easily Identifiable Discourse Relations. In Proceedings of the 22th International Conference on Computational Linguistics, pages 87-90, Stroudsburg, PA. The Association for Computer Linguistics. +Huibin Ruan, Yu Hong, Yang Xu, Zhen Huang, Guodong Zhou, and Min Zhang. 2020. Interactively-Propagative Attention Learning for Implicit Discourse Relation Recognition. In Proceedings of the 28th International Conference on Computational Linguistics, pages 3168-3178, Stroudsburg, PA. The Association for Computational Linguistics. +Attapol Rutherford, Vera Demberg, and Nianwen Xue. 2017. A systematic study of neural discourse models for implicit discourse relation. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics, pages 281-291, Stroudsburg, PA. The Association for Computational Linguistics. +Chang Wang and Bang Wang. 2020. An End-to-end Topic-Enhanced Self-Attention Network for Social Emotion Classification. In Proceedings of The Web Conference 2020, pages 2210–2219, New York, NY. ACMPress. +Wei Xiang and Bang Wang. 2019. A survey of event extraction from text. IEEE Access, 7:173111-173137. +Sheng Xu, Peifeng Li, Fang Kong, Qiaoming Zhu, and Guodong Zhou. 2019. Topic Tensor Network for Implicit Discourse Relation Recognition in Chinese. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 608-618, Stroudsburg, PA. The Association for Computational Linguistics. +Biao Zhang, Jinsong Su, Deyi Xiong, Yaojie Lu, Hong Duan, and Junfeng Yao. 2015. Shallow convolutional neural network for implicit discourse relation recognition. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 2230-2235, Stroudsburg, PA. The Association for Computational Linguistics. +Yingxue Zhang, Fandong Meng, Li Peng, Jian Ping, and Jie Zhou. 2021. Context tracking network: Graph-based context modeling for implicit discourse relation recognition. In Proceedings of the 2021 Conference of the North American Chapter of the Association Computational Linguistics, pages 1592-1599, Stroudsburg, PA. The Association for Computational Linguistics. +Peng Zhou, Wei Shi, Jun Tian, Zhenyu Qi, Bingchen Li, Hongwei Hao, and Bo Xu. 2016. Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Stroudsburg, PA. The Association for Computational Linguistics. +Xiaopei Zhou, Yu Hong, Tingting Che, Jianmin Yao, and Qiaoming Zhu. 2013. An unsupervised ap + +proach to inferring implicit discourse relation. Journal of Chinese Information Processing, 27(2):17-25. \ No newline at end of file diff --git a/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/images.zip b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1640603c168022fdc63e4fc45270e25131279107 --- /dev/null +++ b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e5658467dbd100651e101b80499ea5a0253adcf8672eff04224a2a110d2f2b2 +size 553722 diff --git a/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/layout.json b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cd8d26db4078e96d8b9c1412804bb482fda4741c --- /dev/null +++ b/encodingandfusingsemanticconnectionandlinguisticevidenceforimplicitdiscourserelationrecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b5db36b28337f76dd2c4620468118faad198f525a1b46fcfefae73bd30dd684 +size 366171 diff --git a/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_content_list.json b/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c9807190037d9790608dcd8f557f31f5f2feff78 --- /dev/null +++ b/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7ccbe6f74e884b721577b40bf05a24c889f1c63f8f4aa4c6536d3c74ce0f774 +size 82002 diff --git a/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_model.json b/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9c62172559590bcf3e7910aea50939f243f4e5f9 --- /dev/null +++ b/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a807d772439f0c99fc4a86f1a81a961557bde4a31289cb3ad47a581e3dd1cc2 +size 98908 diff --git a/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_origin.pdf b/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d468536e531607c640e8e2ac838b77ed5e54d255 --- /dev/null +++ b/endtoendsegmentationbasednewssummarization/c3927bc1-bfb7-48fd-bc81-3ec43ca46ad8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adcec14f90325f7377a3a341cc43ccde1f87b82fa5bb4639ad1b0b63b7a4e3ea +size 1033441 diff --git a/endtoendsegmentationbasednewssummarization/full.md b/endtoendsegmentationbasednewssummarization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bc951f6a647a4eb7c0a5afdb129ede1bd6029532 --- /dev/null +++ b/endtoendsegmentationbasednewssummarization/full.md @@ -0,0 +1,336 @@ +# End-to-End Segmentation-based News Summarization + +Yang Liu, Chenguang Zhu and Michael Zeng +Microsoft Cognitive Services Research + +{yaliu10, chezhu, nzeng}@microsoft.com + +# Abstract + +In this paper, we bring a new way of digesting news content by introducing the task of segmenting a news article into multiple sections and generating the corresponding summary to each section. We make two contributions towards this new task. First, we create and make available a dataset, SEGNEWS, consisting of 27k news articles with sections and aligned heading-style section summaries. Second, we propose a novel segmentation-based language generation model adapted from pretrained language models that can jointly segment a document and produce the summary for each section. Experimental results on SEG NEWS demonstrate that our model can outperform several state-of-the-art sequence-to-sequence generation models for this new task. + +# 1 Introduction + +In recent years, automatic summarization has received extensive attention in the natural language processing community, due to its potential for processing redundant information. The evolution of neural network models and availability of large-scale datasets have driven the rapid development of summarization systems. + +Despite promising results, there are specific characteristics of the traditional summarization task that impedes it to provide more beneficial ways of digesting long news articles. For instance, current news summarization system only provides one genetic summary of the whole article, and when users want to read in more details, the generated summary is not capable of helping navigate the reading. For example, given a news report, current system will output several highlight summaries (Nallapati et al., 2017; Liu and Lapata, 2019; Zhang et al., 2020). Under this circumstance, if a user expect to read more details about one highlight, he will still need to browse the whole article to locate related paragraphs. Meanwhile, when processing a long + +news article, current systems usually truncate the text and only generate a summary based on the partial article (Cheng and Lapata, 2016a; Zhang et al., 2020). Although this is reasonable since most important content usually lies in the initial portion, it also makes it difficult for users to quickly access information beyond the truncated portion. + +In this paper, we propose a new task of Segmentation-based News Summarization. Given a news article, we aim to identify its potential sections and at the same time, to generate the corresponding summary for each section. This new task provides a novel alternative to summarizing a news article. We argue that it can lead to a more organized way of understanding long articles and facilitates a more effective style of reading documents. + +First, segmenting a news article can provide a structural organisation of the content, which is not only helpful to reading but also benefit many important NLP tasks. For example, Brown et al. (1983) states that this kind of multi-paragraph division is one of the most fundamental tasks in discourse. However, many expository texts, like news articles, instruction manuals, or textbooks consist of long sequences of paragraphs with very little structural demarcation (Hearst, 1994), and for these documents a subtopical segmentation can be useful. Second, generating concise text descriptions of each sections further reduces the cognitive burden of reading the article (Florax and Ploetzner, 2010). Previous studies (Paice, 1990; Hearst, 1997) present that subtopic segments with their headings is an effective alternative to traditional summarization tasks. + +In this paper, we make two main contributions towards the development of Segmentation-based News Summarization systems. + +First, we create and publicize a large-scale + +![](images/e9817e63bda356ad0b3e7f06b5d6e953dd19f7f4ba1576048d568f6c58084d52.jpg) +Figure 1: One example from the segmentation-based summarization task SEGNEWS. The news article is taken from a CNN news article and we truncate the article for display. CNN editors have divided this article into several sections and written a heading to section. The goal of this task is to automatically identify sub-topic segments of multiple paragraphs, and generate the heading-style summary for each segment. Dotted lines in the figure indicate segment boundaries. In this article, paragraphs 1,2 are annotated as the first segment, paragraphs 3,4 are annotated as the second segment, paragraphs 5,6 are annotated as the third segment, and paragraphs 7,8 are annotated as the forth segment. To the right of the article are the heading-style summaries for segments. Since the first segment is usually an overview of the news, we do not assign a summary to it. + +benchmark, SEGNEWS, for Segmentation-based News Summarization task. Figure 4 shows one example article and its aligned segmentation and summaries from SEGNEWS. + +Second, we propose a novel end-to-end approach for this task, which can jointly segment an article while generating the corresponding summaries. These two sub-tasks can learn from each other via a shared encoder. The model is equipped with a segmentation-aware attention mechanism, allowing it to capture segmentation information during summary generation. One important advantage of our framework is that it is a non-invasive adaptation of the Transformer (Vaswani et al., 2017) model, i.e. it does not alter the inner structure of Transformers. And our framework can integrate many pretrained language generation models, including BART (Lewis et al., 2020), GPT (Radford et al., 2019) and UNILM (Bao et al., 2020). This enables our framework to enjoy a high degree of flexibility and better performance. + +We compare the proposed framework with several state-of-the-art methods on the SEGNEWS benchmark. Both automatic evaluation and human evaluation demonstrate the superiority of our model. + +# 2 Related Work + +# 2.1 Document Summarization + +Document summarization is the task of automatically generating a shorter version text of one or multiple documents while retaining its most important information (Radev et al., 2002). The task has received much attention in the natural language processing community due to its potential for various information access applications. Most large-scale summarization datasets are built on news articles. Popular single-document summarization benchmarks include CNN/DM (Hermann et al., 2015; Nallapati et al., 2016; Cheng and Lapata, 2016a), NYT (Durrett et al., 2016) and XSum (Narayan et al., 2018). + +Document summarization can be classified into different paradigms by different factors (Nenkova and McKeown, 2011). And among them, two have consistently attracted attention. extractive approaches form summaries by copying and concatenating the most important spans in a document; while in abstractive summarization, various text rewriting operations generate summaries using words or phrases that are not in the original text. + +Recent approaches to extractive summarization frame the task as a sequence labeling problem by taking advantage of the success of neural network architectures (Bahdanau et al., 2015). The idea is to predict a label for each sentence specify + +ing whether it should be included in the summary. Existing systems mostly rely on recurrent neural networks (Hochreiter and Schmidhuber, 1997) or Transformer model (Vaswani et al., 2017) to encode the document and obtain a vector representation for each sentence (Nallapati et al., 2017; Cheng and Lapata, 2016b; Liu et al., 2019). + +In recent years, neural sequence-to-sequence approaches dominate abstractive summarization methods. Rush et al. (2015) and Nallapati et al. (2016) are among the first to apply the neural encoder-decoder architecture to text summarization. See et al. (2017) enhance this model with a pointer-generator network and a coverage mechanism. Pretrained language models have recently emerged as a key technology for improving abstractive summarization systems. These models first pretrain a language model with self-supervised objectives on large corpora and then fine-tune it on summarization datasets. Liu and Lapata (2019) combine a pretrained encoder based on BERT (Devlin et al.) with a randomly initialized decoder, demonstrating substantial gains on summarization performance. MASS (Song et al., 2019) is an encoder-decoder neural model pretrained with the objective of reconstructing a masked text and can be fine-tuned on summarization tasks. BART (Lewis et al., 2020) is an encoder-decoder Transformer (Vaswani et al., 2017) pretrained by reconstructing a text corrupted with several arbitrary noising functions. Bao et al. (2020) design UNILMv2, a Transformer-based neural network pretrained as a pseudo-masked language model. + +# 2.2 Text Segmentation and Outline Generation + +Text segmentation has been widely used in the fields of natural language processing and information extraction. Existing methods for text segmentation fall into two categories: unsupervised and supervised. TextTiling (Hearst, 1997) is one of the first unsupervised topic segmentation algorithms. It segments texts in linear time by calculating the similarity between two blocks of words based on the cosine similarity. Choi (2000) introduce a statistical model which can calculate the maximum-probability segmentation of a given text. The TopicTiling (Riedl and Biemann, 2012) algorithm is based on TextTiling, which uses the Latent Dirichlet Allocation to find topical changes within documents. LCSeg (Galley et al., 2003) computes + +lexical chains of documents and segments texts by a score which captures the sharpness of the change in lexical cohesion. + +Supervised methods have also been proposed for text segmentation. Hsueh et al. (2006) integrate lexical and conversation-based features for topic and sub-topic segmentation. Hernault et al. (2010) use CRF to train a discourse segmenter with a set of lexical and syntactic features. Li et al. (2018) propose SEGBOT which uses a neural network model with a bidirectional recurrent neural network together with a pointer network to select text boundaries in the input sequence. + +Recently, Zhang et al. (2019) propose Outline Generation task, aiming to identify potential sections of a multi-paragraph document and generate the corresponding section headings as outlines. This task is in form similar to segmentation-based summarization. However, there are two main differences. First, outline generation focused on academic or encyclopaedic documents, where the section headings are extremely short (on average less than two words) and cannot be considered as a summarization task. Second, since outlines care more about briefly describing their corresponding sections, headings in outlines are independently from each other. In segmentation-based summarization, despite describing the sections, heading-style summaries also devote to navigating the reading, and they are usually related and coherent in content. + +# 3 The SEGNEWS Benchmark + +# 3.1 Data Collection + +In order to study and evaluate the Segmentation-based News Summarization task, we build a new benchmark dataset SEGNEWS. We take CNN website as our article source. As shown in Figure 1, there are a large part of CNN articles which are divided by editors into several sub-topic sections (see Appendix for details). And each section is assigned a heading-style summary also written by these editors. We collect articles published from 2017 to 2021, covering multiple CNN news channels, including US Politics, Business, Health, Entertainment, Travel and Sports. We filter articles with no sub-topic structures or editor written heading-style summaries. Since the first segment is usually an overview of the news, editors do not assign a summary to it. The resulting dataset contains 26,876 news articles. For each article, it has human annotated segmentation structures and each segment + +
#news articles26,876
#paragraphs40.31
#sections per article3.17
#tokens per article1362.24
#tokens per section summary4.70
+ +Table 1: Data statistics of the SEGNEWS dataset. + +![](images/5203a8170e267f74f76bc82223cc2dc662ecd4cdd31d0ea28986dcdd510307db.jpg) +Figure 2: The frequency of the non-stop words in summary appearing at different positions of the source article. The positions range from [0, 1024]. + +has a human-written heading-style summary. + +# 3.2 Data Statistics + +Table 1 shows the overall statistics of our SEG-NEWS benchmark dataset. We can see that the news articles in SEG-NEWS contain rich structural information and are much longer (1,362 tokens per article) than traditional news summarization datasets: articles in CNN/DM (Cheng and Lapata, 2016b) dataset has an average length of 686.63 tokens and articles in NYT (Sandhaus, 2008) dataset has an average length of 800.04 tokens. This is in line with our motivation that segmentation-based summarization can help readers better understand longer articles. + +It has been found that in many news articles, the most important information is often shown at the beginning (Kedzie et al., 2018). We compare SEGNEWS with CNN summarization dataset (Cheng and Lapata, 2016b) to investigate the difference of their positional bias. In Figure 2, we record the position of each non-stop word in the summary that also appears in the article. For both datasets, he beginning of article contains more summary words. However, different from conventional summarization dataset, SEGNEWS dataset has a much smoother position distribution and information in the middle of the article still contributes a lot to the summary. + +# 4 Task Formulation + +Given a multi-paragraph article, the segmentation-based summarization task aims to: i) identify sections of the article to unveil its inherent sub-topic structure, where each section consists of neighboring paragraphs with a coherent topic, and ii) generate the heading-style summary for each section to concisely summarize the section. Particularly, in one article, summaries of different sections should be coherent in content and consistent in style. + +Formally, let $d$ indicate a document consisting of paragraphs $[p_1,p_2,\dots ,p_M]$ . The segmentation-based summarization task aims to recognize a sequence of section boundaries $[b_{1},b_{2},\dots ,b_{N - 1}]$ . These boundaries divide the document into $N$ sections $s_1 = [p_1,\ldots ,p_{b_1}]$ , $s_2 = [p_{b_1 + 1},\ldots ,p_{b_2}],\dots ,s_N = [p_{b_{N - 1} + 1},\ldots ,p_M]$ . Meanwhile, summarization systems will generate the corresponding section summaries $[y_1,y_2,\dots ,y_N]$ . + +# 5 Systems for Segmentation-based News Summarization + +In this section, we present two different frameworks to tackle the segmentation-based summarization task. In Pipeline approach, we first apply a segmentation model to identify potential sections, and then apply a generation model to produce the headings. In Joint approach, one neural model is able to jointly segment an article and produce the summaries. To achieve this, we design a novel segmentation-aware attention mechanism, which allows the model to capture segmentation information when generating summaries. This new attention mechanism can also be considered as a non-invasive adaption for conventional Transformer models. Thus, to take the most advantage of existing pre-trained models, we propose SEGUNILM and SEGBART which are respectively based on pre-trained UNILM model and BART model. They can be initialized completely from pre-trained models and achieve substantial improvement on segmentation-based summarization. + +# 5.1 Pipeline Approach + +Segmentation model We formulate the section identification process as a sequence labeling task. We insert a special symbol [X_SEP] at the boundary of paragraph $p_i$ and $p_{i+1}$ , and then concatenate all paragraphs into a single text input. A neural encoder is then applied to encode this input. Define $u_i$ + +![](images/a0b118109a40c987e7a48142455bf4cb1fd16b73009751cc6305ff4fa0042fc3.jpg) +Figure 3: The overall framework of SEGTRANS model. The blue circles indicate input source text, where dark blue circles indicate paragraph boundaries. The yellow circles indicate output target text, where orange circles indicate heading boundaries. Dotted red lines indicate attention heads with segmentation-aware attention mechanism and dotted blue lines indicate attention heads with original full attention mechanism. + +as the output vector of [X_SEP] after paragraph $p_i$ . We then apply a binary classifier over $u_i$ to obtain $y_i \in \{0,1\}$ . $y_i = 0$ indicates paragraph $p_i$ and $p_{i + 1}$ are in one segmentation, and $y_{i} = 1$ indicates $p_{i + 1}$ should be the start of a new segment. + +Generation model We then generate an aligned heading-style summary for each identified section $s_j$ . The generation of each heading is independent. Here, we can choose existing extractive or abstractive summarization methods. + +- TOPICRANK (Bouguin et al., 2013) is an extractive method for keyphrase extraction which represents a document as a complete graph depending on topical representations. We use the top ranked phrase as the summary for input section; +- SEQ2SEQ represents the sequence-to-sequence neural model, which is usually used in abstractive summarization. It first encodes the concatenated text of all paragraphs within this section, and the decodes the heading in an auto-regressive manner. In experiments, we try both non-pretrained Transformer model and pretrained UNILM and BART models as SEQ2SEQ models. + +# 5.2 Joint Approach + +Instead of relying on a pipeline framework, we can also tackle the segmentation-based summarization task with a single encoder-decoder neural model. This brings two main advantages. First, the encoders for segmentation and generation can be + +shared, benefiting both tasks as a multi-task learner. Second, we can decode all summaries in an auto-regressive manner. In this way, when the decoder generates the $l$ -th heading, it will be exposed to the 1st to $(l - 1)$ -th generated headings. This is considerably helpful since in a news article, many headings are highly related and coherent in their content. + +We use Transformer (Vaswani et al., 2017) as base model for the encoder and decoder. Formally, the encoder maps a sequence of tokens in the source document $\pmb{x} = [x_{1},\dots,x_{n}]$ into a sequence of continuous representations $\pmb{t} = [t_1,\dots,t_n]$ . Then a segment classifier is applied over output vectors of paragraph boundaries to identify correct segments $B = [b_{1},b_{2},\dots,b_{N - 1}]$ for the input article. The decoder then generates the tokens of target text $y = (y_{1},\dots,y_{m})$ auto-regressively based on the conditional probability: $p(y_{1},\dots,y_{m}|x_{1},\dots,x_{n},B)$ . As the decoder produces summaries for all sections in one pass, we add a special symbol [Y_SEP] between summaries from neighboring sections to indicate their boundaries. However, in this vanilla sequence-to-sequence model, during inference, the decoder is not aware of the segmentation results and can only implicitly use this information when decoding the summaries. Thus, to better jointly learn segmentation and generation tasks, we propose SEGTRANS model, which is equipped with Segmentation-aware Attention mechanism. + +Segmentation-aware attention The multi-head decoder-to-encoder attention in a Transformer decoder defines that for a head $z \in \{1, \dots, n_{head}\}$ at each layer, the model calculates attention probabilities $a_{ij}^{z}$ against each source token $x_{j}$ when generating the $i$ -th token $y_{i}$ . + +$$ +q _ {i} ^ {z} = W _ {q} ^ {z} Y _ {i}; k _ {j} ^ {z} = W _ {k} ^ {z} X _ {j}, \tag {1} +$$ + +$$ +a _ {i j} ^ {z} = \frac {\exp \left(q _ {i} ^ {z T} k _ {j} ^ {z}\right)}{\sum_ {o = 1} ^ {n} \exp \left(q _ {i} ^ {z T} k _ {o} ^ {z}\right)}, \tag {2} +$$ + +where $Y_{i},X_{j}\in \mathbb{R}^{d}$ are the layer's input vectors corresponding to the token $y_{i}$ and $x_{j}$ , respectively. $W_{q}^{z},W_{k}^{z}\in \mathbb{R}^{d_{head}*d}$ are learnable weights. $n$ is the number of tokens in source input. + +However, in segmentation-based summarization, when generating the heading for the $i$ -th section, the decoder should focus more on the input tokens belonging to that section. Thus, we propose the segmentation-aware attention as follows. + +We select a subset $\hat{z}$ of decoder heads to apply a segmentation mask to enforce that these heads only + +attemto the corresponding section.For a head in $\hat{z}$ ,Eq.2is modified to: + +$$ +a _ {i j} ^ {z} = \frac {\exp \left(q _ {i} ^ {z T} k _ {j} ^ {z}\right) \operatorname {s e g} \left(y _ {i} , x _ {j}\right)}{\sum_ {o = 1} ^ {n} \exp \left(q _ {i} ^ {z T} k _ {o} ^ {z}\right) \operatorname {s e g} \left(y _ {i} , x _ {j}\right)} \tag {3} +$$ + +where $\text{seg}(y_i, x_j)$ is a indicator function. It equals 1 if and only if $y_i$ and $x_j$ both belong to the same section, and 0 otherwise. In this manner, parts of the heads in multi-head attention are able to dynamically capture segmentation information, while the other heads still model global features of the entire input article. + +We illustrate a detailed example of our framework with segmentation-aware attention in Figure 3. We first encode the source text, and apply a segmentation classification layer over output vectors of paragraph boundaries. For this example input, the model classifies the first and the third paragraph boundaries to be segmentation points. Then the decoder will apply a segmentation-aware multi-head attention over the source outputs. It generates the summary for the first identified section with parts of the attention heads over only the first and the second paragraphs. After generating the first heading ending symbol [Y_SEP], the decoder changes the segmentation-aware attention to the third paragraph for generating the summary for the second section. + +The final loss for training SEGTRANS is the summation of the segmentation loss (binary classification loss) $\mathcal{L}_{\mathrm{seg}}$ and generation loss (negative likelihood loss) $\mathcal{L}_{\mathrm{gen}}$ . + +One advantage of our framework is that it is a non-invasive adaptation of the Transformer model, i.e. it does not alter the inner structure of Transformers. This is important since this adaptation can be applied to many popular pretrained language generation models (e.g. MASS, BART and UNILM), offering our framework a high degree of flexibility and better performance. In this paper, we also augment pre-trained UNILM and BART with this mechanism and propose SEGUNILM and SEGBART to further boost their performance. + +# 6 Experiments + +In this section, we conduct experiments on SEG-News dataset by comparing our proposed model with several strong baselines. + +# 6.1 Experimental Settings + +In pre-processing, all the words in news articles and headings are transformed to lower case and to- + +kenized with wordpiece tokenizer from BERT (Devlin et al.). In data splitting, we guarantee the headings of articles in the test set have low bigram overlap with articles in the training set. We obtain a splitting of 21,748 articles in training set, 2,688 in validation set and 2,444 in test set. + +We experiment under both non-pretrained and pretrained settings. In non-pretrained setting, we use a 6-layer Transformer encoder-decoder model (SEGTRANS) with 512 hidden size and 2,048 feedforward size. In pretrained setting, we propose SEGUNILM and SEGBART which adopts the base version of UNILMv2 (Bao et al., 2020) and the large version of BART (Lewis et al., 2020) as the pretrained model. UNILMv2 is a Transformer-based neural network with 12 Transformer layers and 12 attention heads, pretrained as a pseudo-masked language model. BART is a Transformer-based neural encode-decoder model with 12 layers and 16 attention heads, pretrained via a denoising auto-encoder loss. Label smoothing is used with smoothing factor 0.1. For segmentation-aware attention, we choose the best $c$ (number of segmentation-aware heads) by experiments on the validation set, and $c = 9$ for SEGUNILM and $c = 13$ for SEGBART provide the best performance. + +During all decoding we use beam search (size 5), and tune $\alpha$ for the length penalty (Wu et al., 2016) between 0.6 and 1 on the validation set. To guarantee the number of generated headings can match the number of predicted source segments, we take a trick of only generating the end-of-generation token (EOS) when these two numbers match. + +We compare the proposed joint models with two sets of strong baselines. The first set of baselines are vanilla sequence-to-sequence models. These models take complete raw articles as input and output the concatenated headings. The second set are pipeline models. As described, these systems first use a segmentor to divide the article into several sections, and then apply a generator to produce summary for each section. + +In segmentation-based summarization, summarization systems require segmentation results. We set two settings of segmentation. For the first setting, we provide golden segments to the models to evaluate their performance of generating the summaries when given the correct segments. For the second setting, we require the models to first segment the article and then generate summaries for the predicted segments. + +
Vanilla Seq2SeqR1R2RL
TRANS8.661.518.16
UNILM19.227.1816.99
PipelineWith Gold SegmentsWith Predicted Segments
SegmentorGeneratorR1R2RLR1R2RL
TransformerTransformer8.691.839.09---
TransformerTopicRank5.091.146.28---
BARTBART21.427.7619.2816.015.2714.37
UNILMUNILM21.768.2219.7516.275.4514.65
JointR1R2RLR1R2RL
SEGTRANS8.941.859.35---
SEGBART21.498.2919.5216.365.1414.96
SEGUNILM22.178.8620.1717.596.2015.90
+ +Table 2: ROUGE F1 results on SEGNEWS test set. R1 and R2 are shorthands for ROUGE scores of unigram and bigram overlap; RL is the ROUGE score of longest common subsequence. In pipeline approach, we try combinations of different segmentators and generators. Due to their failure on segmentation, non-pretraind models have very low ROUGE scores with predicted segments, and we do not compare them in the table. + +
ModelsR1R2RL
SEGUNILM22.178.8620.17
(c=12)22.148.8120.09
(c=8)22.138.8420.10
(c=4)21.397.9919.23
(c=0)19.857.7417.62
(w/o seg loss)22.068.6620.02
+ +Table 3: Ablation study results on SEGNEWS. We compare multiple variants of SEGUNILM. $c$ indicates the number of decoder heads modified into segmentation-aware attention. Be default, SEGUNILM uses $c = 9$ to achieve the best performance. We also present a SEGUNILM model without (w/o) segmentation classification loss, and it is trained solely by generation loss. + +# 6.2 Evaluation Metrics + +Evaluation metrics for summarization performance are ROUGE (Lin, 2004) F1 scores of the generated headings against the gold headings. We report unigram and bigram overlap (ROUGE-1 and ROUGE-2) as a means of assessing informativeness and the longest common subsequence (ROUGE-L) as a means of assessing fluency. + +We use standard metrics $Pk$ (Beeferman et al., 1999) and WinDiff (Pevzner and Hearst, 2002) to evaluate segmentation results. Lower scores of these two metrics indicate that the predicted segmentation is closer to the ground truth. A EVEN baseline is included for comparison where it segments the whole article evenly. + +# 6.3 Results + +Table 2 describes our summarization results on the SEGNEWS dataset. The first vertical block includes the results of vanilla sequence-to-sequence models. TRANS is the non-pretrained Transformer encoder-decoder model. UNILM and BART are two + +pretrained baseline models. The second vertical block contains the results of pipeline models. We present the combinations of different segmentation models and generation models. For segmentor, we experiment non-pretrained Transformer model and pretrained BART and UNILM models. For generator, we also include TOPICRANK, which is a classical extractive summarization method. + +The last vertical block includes the results of our joint models: SEGTRANS, SEGBART and SEGUNILM. They respectively rely on non-pretrained Transformer and pretrained BART and UNILM as backbone models. Segmentation-aware attention mechanism is used to augment these jointly trained systems. + +We can see vanilla sequence-to-sequence models with no segmentation information input perform poorly on this task. End-to-end SEGUNILM model achieves the best performance among all systems. SEGUNILM outperforms the best pipeline system under both settings when gold segments or predicted segments are provided. This indicates SEGUNILM has better overall performance and will be more useful when applied as practical applications. It also shows higher summarization results than vanilla UNILM model, confirming the effectiveness of segmentation-aware attention mechanism. SEGBART and SEGTRANS also show similar superiority over their pipeline versions. Examples of system output are shown in Table 4. + +Table 3 summarizes ablation studies aiming to assess the contribution of individual components of SEGUNILM. We first modify SEGUNILM by varying $c$ , the number of heads of segmentation-aware attention. We can see the best results of ROUGE + +
Title: One JFK conspiracy theory that could be true
GOLD1. LBJ had it done; 2. The military industrial complex did it; 3. The mob did it; 4. Oswald acted alone as part of an unknown conspiracy; 5. The CIA did it
Pipeline UNILMThose Kennedys will never embarrass me again; Did Kennedy want to withdraw us troops from Vietnam?; 3. Different mobs; other conspirators ?; Would America be OK with that ?
SEGBART1. They thought he was a crook; 2. He was going to pull American troops out of Vietnam; 3. The mob did this; 4. There were others, but who were they?; 5. The CIA ordered the killing
SEGUNILM1. Those Kennedy's will never embarrass me again; 2. He said he'd pull troops out of Vietnam; 3. Mob members claim they were witnesses to the alleged shootings; 4. there were more people who knew where Oswald was; 5. The CIA didn't release any of the good stuff
Title: This man is tasked with finding out who failed Larry Nassar's victims
GOLDSeeking justice; A very youthful 68-year-old; A model independent prosecutor
Pipeline UNILMSearching for truth; He couldn't stay retired; He didn't have an agenda
SEGBARTSearching for the truth; Working with juveniles; No stone unturned
SEGUNILMSearching for the truth; He's has to do something; He doesn't have an agenda
+ +Table 4: GOLD reference summaries and automatic summaries produced by pipeline UNILM, SEGBART and SEGUNILM on the SEGNEWS datasets. Semicolons indicate the boundaries of headings. + +
ModelWDPK
EVEN0.4690.450
Transformer0.5630.462
BART0.4840.411
UNILM0.4790.391
SEGBART0.4710.405
SEGUNILM0.4620.380
+ +Table 5: Experimental results on document segmentation task. WD indicates WinDiff metric. + +
ModelQualityFluency
Pipeline UNILM1.932.62
SEGUNILM2.172.59
Gold2.442.79
+ +Table 6: Human evaluation results based on summary quality and fluency. + +are achieved when $c = 9$ . With more or less heads modified as segmentation-aware attention heads, the summarization performance show a clear trend of decreasing. Also, as shown in the last column, when segmentation layer and segmentation loss are removed, we observe a sharp decrease on ROUGE scores. The results prove that both segmentation-aware attention and joint training provide improvement to the summarization results. + +Table 5 describes the results on news segmentation task. SEGUNILM achieves the lowest WD and PK scores, revealing its ability to identify the structure of a news article. Compared with UNILM model without the segmentation-aware attention, SEGUNILM shows clear superiority on both metrics. The same trend is also observed in BART related models. + +# 6.4 Human Evaluation + +In addition to automatic evaluation, we also assess system performance by eliciting human judgments on 20 randomly selected test instances. The evaluation study assess the overall quality and fluency of the summaries by asking participants to rate them. We present the news article to evaluators along with system generated heading-style summaries, and we ask evaluators to read the complete article, and give scores based on summary quality and fluency respectively. Participants can have three scores (1-low quality/fluency, 2-median quality/fluency, 3-high quality/fluency). + +Gold summaries, outputs from pipeline UNILM and SEGUNILM models are compared in evaluation. We invite three evaluators with linguist background to conduct the human evaluation. The averaged results are shown in Table 4. Overall, we observe pipeline UNILM and SEGUNILM perform similarly on fluency, but SEGUNILM shows its superiority on summary quality. Gold summaries are marginally better than automatic generated summaries. + +# 7 Conclusion + +In this work, we proposed a new task, segmentation-based news summarization. It aims to segment a news article into multiple sections and generate the corresponding summary to each section. This new task provides a novel alternative to digesting a news article. We built a new benchmark dataset SEGNEWS to study and evaluate the task. Furthermore, we designed a segmentation-aware attention mechanism, which allows neural decoder to capture segmentation information in the source + +texts. We jointly train the model for generating summaries and recognizing news segments. Experimental results on SEGNEWS demonstrate that our framework produces better segmentation-based summaries than competitive systems. + +# 8 Ethical Statement + +We honor and support the ACL Code of Ethics. We have used only the publicly available news articles from the CNN website and adhere to their only-for-research-purpose guideline. Meanwhile, to make sure the downstream usage of the data will not break the permission of CNN website, we only release the URLs of these articles along with a script to download and process them. + +The content of the news and summaries only reflect the views of the media, and should be viewed with discretion. + +# References + +Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In *In Proceedings of the 3rd International Conference on Learning Representations*, San Diego, California. +Hangbo Bao, Li Dong, Furu Wei, Wenhui Wang, Nan Yang, Xiaodong Liu, Yu Wang, Songhao Piao, Jianfeng Gao, Ming Zhou, and Hsiao-Wuen Hon. 2020. UniLMv2: Pseudo-masked language models for unified language model pre-training. arXiv preprint arXiv:2002.12804. +Doug Beeferman, Adam Berger, and John Lafferty. 1999. Statistical models for text segmentation. Machine Learning, 1(34):177-210. +Adrien Bougouin, Florian Boudin, and Beatrice Daille. 2013. Topicrank: Graph-based topic ranking for keyphrase extraction. In International joint conference on natural language processing (IJCNLP), pages 543-551. +Gillian Brown, Gillian D Brown, Gillian R Brown, Brown Gillian, and George Yule. 1983. Discourse analysis. Cambridge university press. +Jianpeng Cheng and Mirella Lapata. 2016a. Neural summarization by extracting sentences and words. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 484-494, Berlin, Germany. +Jianpeng Cheng and Mirella Lapata. 2016b. Neural summarization by extracting sentences and words. In Proceedings of the ACL Conference. +Freddy Y. Y. Choi. 2000. Advances in domain independent linear text segmentation. In 1st Meeting of + +the North American Chapter of the Association for Computational Linguistics. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the NAACL Conference. +Greg Durrett, Taylor Berg-Kirkpatrick, and Dan Klein. 2016. Learning-based single-document summarization with compression and anaphoricity constraints. In Proceedings of the ACL Conference. +Mareike Florax and Rolf Ploetzner. 2010. What contributes to the split-attention effect? the role of text segmentation, picture labelling, and spatial proximity. Learning and instruction, 20(3):216-224. +Michel Galley, Kathleen McKeown, Eric Fosler-Lussier, and Hongyan Jing. 2003. Discourse segmentation of multi-party conversation. In Proceedings of the 41st Annual Meeting of the Association for Computational Linguistics, pages 562-569. +Marti A. Hearst. 1994. Multi-paragraph segmentation expository text. In 32nd Annual Meeting of the Association for Computational Linguistics, pages 9–16, Las Cruces, New Mexico, USA. Association for Computational Linguistics. +Marti A Hearst. 1997. Text tiling: Segmenting text into multi-paragraph subtopic passages. Computational linguistics, 23(1):33-64. +Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. 2015. Teaching machines to read and comprehend. Advances in neural information processing systems, 28. +Hugo Hernault, Danushka Bollegala, and Mitsuru Ishizuka. 2010. A sequential model for discourse segmentation. In International Conference on Intelligent Text Processing and Computational Linguistics, pages 315-326. Springer. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735-1780. +Pei-Yun Hsueh, Johanna D Moore, and Steve Renals. 2006. Automatic segmentation of multiparty dialogue. In 11th Conference of the European Chapter of the Association for Computational Linguistics. +Chris Kedzie, Kathleen McKeown, and Hal Daumé III. 2018. Content selection in deep learning models of summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1818-1828, Brussels, Belgium. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. 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. +Jing Li, Aixin Sun, and Shafiq R Joty. 2018. Segbot: A generic neural text segmentation model with pointer network. In IJCAI, pages 4166-4172. +Chin-Yew Lin. 2004. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out: Proceedings of the ACL-04 Workshop, pages 74-81, Barcelona, Spain. Association for Computational Linguistics. +Yang Liu and Mirella Lapata. 2019. Text summarization with pretrained encoders. 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 3730-3740, Hong Kong, China. +Yang Liu, Ivan Titov, and Mirella Lapata. 2019. Single document summarization as tree induction. In Proceedings of the NAACL Conference. +Ramesh Nallapati, Feifei Zhai, and Bowen Zhou. 2017. Summarrunner: A recurrent neural network based sequence model for extractive summarization of documents. In Proceedings of the AAAI Conference. +Ramesh Nallapati, Bowen Zhou, Cicero dos Santos, Caglar Gulcehre, and Bing Xiang. 2016. Abstractive text summarization using sequence-to-sequence RNNs and beyond. In Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning, pages 280-290, Berlin, Germany. Association for Computational Linguistics. +Shashi Narayan, Shay B. Cohen, and Mirella Lapata. 2018. Don't give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1797-1807, Brussels, Belgium. +Ani Nenkova and Kathleen McKeown. 2011. Automatic summarization. Foundations and Trends in Information Retrieval, 5(2-3):103-233. +Chris D Paice. 1990. Constructing literature abstracts by computer: techniques and prospects. Information Processing & Management, 26(1):171-186. +Lev Pevzner and Marti A Hearst. 2002. A critique and improvement of an evaluation metric for text segmentation. Computational Linguistics, 28(1):19-36. +Dragomir R. Radev, Eduard Hovy, and Kathleen McKeown. 2002. Introduction to the special issue on summarization. Computational Linguistics, 28(4):399-408. + +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Martin Riedl and Chris Biemann. 2012. Topictiling: a text segmentation algorithm based on lda. In Proceedings of ACL 2012 Student Research Workshop, pages 37-42. +Alexander M. Rush, Sumit Chopra, and Jason Weston. 2015. A neural attention model for abstractive sentence summarization. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 379-389, Lisbon, Portugal. +Evan Sandhaus. 2008. The New York Times Annotated Corpus. Linguistic Data Consortium, Philadelphia, 6(12). +Abigail See, Peter J. Liu, and Christopher D. Manning. 2017. Get to the point: Summarization with pointer-generator networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1073-1083, Vancouver, Canada. +Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, and TieYan Liu. 2019. MASS: Masked sequence to sequence pre-training for language generation. In Proceedings of International Conference on Machine Learning, pages 5926-5936, Long Beach, California. +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 I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 5998-6008. +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. In arXiv preprint arXiv:1609.08144. +Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter Liu. 2020. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization. In International Conference on Machine Learning, pages 11328-11339. PMLR. +Ruqing Zhang, Jiafeng Guo, Yixing Fan, Yanyan Lan, and Xueqi Cheng. 2019. Outline generation: Understanding the inherent content structure of documents. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 745-754. + +# A Build SEGNEWS from CNN website + +The SEGNEWS dataset is built from news articles on CNN website. For many news reports on CNN, news editors manually divide them into several sections and write a heading-style summary for each section. As illustrated in Figure 1, in a display of this news article2, it has a general title "Global businesses must address climate change before it's too late". Below the title, there are several paragraphs of news content. This news article is divided into 5 sections. Despite the first section, the other 4 sections are assigned with their heading-style summaries: "Reduce their own emissions", "Disclose risks and adopt new reporting standards", "Educate employees" and "Advocate for climate policies". + +We crawl news articles like this from CNN website. Articles without segmentation information or headings are filtered. The resulting SEGNEWS dataset contains 26,876 articles. Each instance in SEGNEWS consists of a news article, its segmentation structure and heading-style summaries for each segments. + +![](images/58c8296abfba324b3b53f6565ad8e5b8f156203bf9c160e928a6aabe86aa2c01.jpg) + +# PERSPECTIVES + +# Global businesses must address climate change before it's too late + +Updated by: Panit Ramani & Henry Business Media Ltd. +Updated: 1221 GMT (2021 HKT) August, 9, 2021 + +Editor's Note: Punit Renjen is the CEO of Deloitte Global. The opinions expressed in this commentary are his own. + +Climate change poses one of the greatest threats humanity has ever faced. In the past few weeks alone, wildlife have emerged across the globe, brutal heatwaves have devastated American cities and floodings has claimed the lives of hundreds in Europe and Asia. The global warming crisis is also a major concern for many countries. + +Making meaningful, measurable progress is a monumental task. For the sake of the planet and future generations, it is vital that global businesses, and the professionals who run them, step up in the fight against climate change and take urgent action. + +Here's how: + +# Reduce their own emissions + +At the recent GT Summit, world leaders doubled down on their climate pledges, focusing on the opportunity for a just energy transition that will likely create clean energy jobs around the world. Among other things, they committed to reach net-zero carbon emissions by 2030 and to achieve net-zero carbon emissions by 2050. + +The business community must match the ambition of world governments by cutting emissions across their own operations. + +Hundreds of companies have now taken the first step in doing so: committing to $100\%$ renewable energy. The tech sector in particular is leading this shift, with a number of companies already reaching their $100\%$ goal, and many more setting science-based plans to get there. + +# Disclose risks and adopt new reporting standards + +Companies must analyze the financial risks that climate change poses to them — and publicly disclose that information. + +Global capital markets need high-quality, consistent and comparable data to understand drivers of risk and return, allocate capital efficiently and finance the transition to a more resilient, low-carbon economy. + +![](images/6c4c0d12775a261a796ce3eb49b0cdbad7c12ea8262e2065b739e353eb4ea58b.jpg) +Related Article: How the business community can help protect voting rights. +Figure 4: One example news article on CNN website. It contains human-annotated segments and heading-style summaries. + +By providing financial markets with the right information, we can build confidence that money flows where it needs to go to boost resiliency and curb emissions across the globe. This means companies exposed to long-term climate-related risks may see higher costs of doing business in the long term. The current climate solutions could have access to cheaper capital. We are seeing this play out already. + +Allianz, for instance, will no longer offer property or casualty insurance coverage to mining companies. The company's "risk-free" stock market backrock is setting limits on its investments in companies that are exposed to climate risks. + +I am encouraged that businesses are increasingly reporting on the impact of climate change, and taking steps to increase transparency and accountability through initiatives like the World Economic Forum's Stakeholder Capitalism Metrics, a set of environmental, social and economic indicators that measure the impacts of climate change. I also encourage the G3T to adopt climate reporting standards reinforces the direction that the regulatory environment is + +heading in. + +# Educate employees + +As business leaders, we need to recognize that our people are our greatest asset - our "superpower." With organization-wide climate education programs, businesses can develop a culture of sustainability and climate-conscious thinking at the very core of their work. That is why, starting this month, Deloitte has begun to roll out a new climate learning program for all 330,000 of its professionals worldwide. + +Developed in collaboration with World Wildlife Fund (WWF), the program is designed to engage our people on the impacts of climate change and its consequences on biodiversity. The WWF's goal is to develop a framework that supports the implementation of sustainable business models, culture of climate action, we will create a network of support for a transition to sustainable business models with far-reaching influence. + +# Advocate for climate policies + +Businesses must leverage their collective power to advocate for climate policies that meet the ambition of reaching net-zero by 2050 or earlier. + +Alongside fellow CEOs from across the world, I recently signed on to a call for government leaders to place a price on carbon and invest in the infrastructure needed to accelerate a transition away from fossil fuels. Companies ranging from shipping and logistics giants to major retailers have taken similar steps to drive systemic change in recent years. And even the oil and gas sector has lent its support for carbon pricing. + +I call on other leaders to rise to this challenge. They must make climate knowledge a core competency across their businesses — a springboard for greater action — and take concrete steps to address the climate crisis head-on. + +Watching the world come together to fight Covid-19 has been nothing short of inspiring, but as communities begin to recover from the pandemic, we are more aware that our efforts will be built on this global cooperation that we know it possible and step up to the next greatest challenge humanity has ever confronted. + +For companies to build long-term sustainable value for all stakeholders, they must do their part to build an equitable and sustainable future. Our future depends on it. \ No newline at end of file diff --git a/endtoendsegmentationbasednewssummarization/images.zip b/endtoendsegmentationbasednewssummarization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8f667ec98a08d4b25452543bc98a05afa82a4ec0 --- /dev/null +++ b/endtoendsegmentationbasednewssummarization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:740dbba2ecf542ae09a9a55b019fa63d92d47ee020c72a7788beaf508ffc0228 +size 437816 diff --git a/endtoendsegmentationbasednewssummarization/layout.json b/endtoendsegmentationbasednewssummarization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8f7b042419da2422ca81579595f7a8e13fe1eed8 --- /dev/null +++ b/endtoendsegmentationbasednewssummarization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:405eecc59e72ae73a2fe4a1cbb56ecfa2a7d52da29431f742bb07f71a56dc7d0 +size 353798 diff --git a/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_content_list.json b/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c2ed8bea8be2b042bd3dd6b01394f0381b81780f --- /dev/null +++ b/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d653e9b8302d95f5039a739439d89e2666dc198fab87f308c3a7901a6876e02 +size 92645 diff --git a/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_model.json b/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7b112c1c2c45ab74c041b2d6c7be09908ecfdf06 --- /dev/null +++ b/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15485dfc7877b7cedb826cae09c85268e43ffe12f69de6bf9ae8fb77d94b4418 +size 111998 diff --git a/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_origin.pdf b/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0a45acbea8ff483814731a3da82465c00a7ec7bb --- /dev/null +++ b/endtoendspeechtranslationforcodeswitchedspeech/0d727901-bfd5-475f-af31-7c070c33cbaa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbc50fc058ad14f88d64642e7b741cba206664ff155f7b77d3444cef73200b4f +size 840584 diff --git a/endtoendspeechtranslationforcodeswitchedspeech/full.md b/endtoendspeechtranslationforcodeswitchedspeech/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9324e53c592dd0dc9e38a1dcb087406d6d22fecc --- /dev/null +++ b/endtoendspeechtranslationforcodeswitchedspeech/full.md @@ -0,0 +1,300 @@ +# End-to-End Speech Translation for Code Switched Speech + +Orion Weller $^{1*}$ , Matthias Sperber $^{2}$ , Telmo Pires $^{2}$ , Hendra Setiawan $^{2}$ , Christian Gollan $^{2}$ , Dominic Telaar $^{2}$ , Matthias Paulik $^{2}$ $^{1}$ Johns Hopkins University + $^{2}$ Apple oweller@cs.jhu.edu, sperber@apple.com + +# Abstract + +Code switching (CS) refers to the phenomenon of interchangeably using words and phrases from different languages. CS can pose significant accuracy challenges to NLP, due to the often monolingual nature of the underlying systems. In this work, we focus on CS in the context of English/Spanish conversations for the task of speech translation (ST), generating and evaluating both transcript and translation. To evaluate model performance on this task, we create a novel ST corpus derived from existing public data sets. We explore various ST architectures across two dimensions: cascaded (transcribe then translate) vs end-to-end (jointly transcribe and translate) and unidirectional (source $\rightarrow$ target) vs bidirectional (source $\leftrightarrow$ target). We show that our ST architectures, and especially our bidirectional end-to-end architecture, perform well on CS speech, even when no CS training data is used. + +# 1 Introduction + +Over half of the world's population is estimated to be bilingual.2 Those that know multiple languages are prone to code switch, i.e., to interchangeably use words and phrases from two (or more) languages in situations such as casual dialog, while traveling abroad, or simply to use a word they find more fitting (Myers-Scotton and Ury, 1977; Heredia and Altarriba, 2001). In CS, the base language is referred to as the matrix language while the contributing language is called the embedded language (Myers-Scotton, 1995), where speakers often use the matrix language the majority of the time. + +Code switched language is challenging to both automatic speech recognition (ASR) and machine translation (MT) - and therefore also to the composite task of speech translation (ST). While a rich + +![](images/4623a9e72e02742d32899754a7a0c4d97894814db5ed56c29a00c845999456ae.jpg) +Figure 1: An example instance of the joint speech recognition and translation task for code-switching (CS). Red indicates English words in the transcript and their corresponding words in the translation, whereas blue indicates Spanish words in the transcript and their corresponding translation. + +amount of prior works exist on CS in the context of ASR (Lyu et al., 2006; Ahmed and Tan, 2012; Vu et al., 2012; Johnson et al., 2017; Yue et al., 2019) and MT (Sinha and Thakur, 2005; Winata et al., 2021; Zhang et al., 2021; Yang et al., 2020), there is little prior work in the context of ST. + +The aforementioned challenges to ASR, MT and ST arise largely due to the lack of CS data as well as the often monolingual nature of ASR systems, and of encoders of MT and ST systems. The lack of CS data is often addressed via synthetic data, e.g. as seen in Xu and Yvon (2021); Nakayama et al. (2019). Instead, in this work we derive two novel natural CS datasets from existing public corpora. CS is also difficult for modeling due to its mixed multilingual nature. In order to support multiple languages on the utterance level, automatic language identification (LID) is often performed before applying monolingual systems on a per utterance basis. However, this does not address within-utterance CS, where embedded foreign words and phrases result in recognition errors for monolingual ASR systems, making multilingual models an attractive alternative. Furthermore, CS increases speech recognition errors, significantly increasing the problem of error propagation (Ruiz and Fed + +erico, 2014) in cascaded ST systems, where MT is then performed on the erroneous ASR output. Thus, multilingual end-to-end (E2E) ST systems may be especially appropriate to tackle CS speech. + +As both the transcript and translation are important in many CS ST use cases, we focus on the joint transcription and translation ST setting (Anastasopoulos and Chiang, 2018; Weller et al., 2021), extending it to CS data. We follow the methodology of these previous works and focus on the triangle E2E ST model to jointly generate both a transcript of the CS utterance and a translation of that utterance into text containing only one language (c.f. Figure 1 for an illustration). We perform a comparison along two axes: (1) comparing this E2E model to the standard cascaded ST systems, and (2) exploring the difference between bilingual systems and primarily monolingual systems gated by utterance-level LID. Following recent work that has shown the effectiveness of pre-trained models for ST (Li et al., 2020; Gallego et al., 2021), we use Wav2Vec 2.0 (Baevski et al., 2020) as our encoder model and the multilingual mBART 50-50 (Tang et al., 2020) as our decoder model. + +We also make several modeling contributions in order to use these pre-trained models for joint transcription and translation. For the E2E ST model, we extend Li et al. (2020) to adapt the mBART decoder to jointly produce both transcription and translation. Furthermore, we introduce a triangle E2E ST model with a shared bilingual decoder and show that this improves transcription and translation accuracy. Our model analysis shows a surprising amount of robustness to CS speech, with the amount (or proportion) of CS words in a sentence not affecting model accuracy. Overall, we observe strong accuracy scores (WER, BLEU) on the CS task, both without CS training data and in the low-resource setting. We believe this opens the door to new and exciting progress in this area. + +# 2 Related Work + +Code-switching in NLP has seen a rise of interest in recent years, including a dedicated workshop starting in 2014 (Diab et al., 2014) and still ongoing (Solorio et al., 2021). CS in machine translation also has a long history (Le Féal, 1990; Climent et al., 2003; Sinha and Thakur, 2005; Johnson et al., 2017; Elmadany et al., 2021; Xu and Yvon, 2021), + +but has seen a rise of interest with the advent of large multilingual models such as mBART (Liu et al., 2020) or mT5 (Xue et al., 2020; Gautam et al., 2021; Jawahar et al., 2021). Due to the lack of available CS data and the ease of single-word translation, most of these recent related MT works have synthetically created CS data for either training or testing by translating one or more of the words in a sentence (Song et al., 2019; Nakayama et al., 2019; Xu and Yvon, 2021; Yang et al., 2020). We differ from those works by using naturally occurring CS data (Section 3) which models the real-world CS distribution rather than arbitrary language mixing. + +For spoken input, as present in ASR and ST, synthetically creating realistic CS data is more challenging than it is for MT. However, dedicated ASR corpora that contain natural CS exist, including the Bangor Miami (Deuchar et al., 2014), SEAME (Zeng et al., 2018), and the recent large-scale ASRU 2019 task (Shi et al., 2020). These corpora generally do not contain translations of the ASR annotations, since they were designed for the ASR task only. However, there exist two exceptions, which we leverage to derive our ST CS data set, described in Section 3. + +There also exists a wide range of prior modeling work on CS in ASR models, for a variety of strategies (Lyu et al., 2006; Ahmed and Tan, 2012; Seki et al., 2018; Luo et al., 2018; Lu et al., 2020; Du et al., 2021; Zhang et al., 2021). However, the recently introduced large multilingual models for speech, such as Wav2Vec, Wav2Vec 2.0, Schneider et al. (2019); Baevski et al. (2020) and HuBERT (Hsu et al., 2021), are still underexplored with regards to their CS performance. + +Handling mixed languages also requires understanding what languages are being spoken. Systems that support mixed language input therefore require some form of automatic LID – either as an explicit component on the utterance (Mabokela et al., 2014; Xu and Yvon, 2021) or word-level (Lyu and Lyu, 2008a; Nakayama et al., 2019), or implicitly learned by the underlying model(s) via a multi-task learning setup (Lyu and Lyu, 2008b; Watanabe et al., 2017; Hou et al., 2020). In our work, we leverage both, exploring utterance-level LID components as well as implicit learning of utterance and word level LID. + +In both MT and ASR, prior publications have also included the study of intra-word mixing of languages (Yilmaz et al., 2018; Mager et al., 2019), + +a phenomenon we do not explore in our work. + +Finally, our work builds off of advances made by Gallego et al. (2021); Li et al. (2020) that show that combining large multilingual speech and text models provide consistent improvements. We differ however, by exploring ST in the novel CS setting. + +# 3 Task Description & Data Used + +# 3.1 Task Description + +We investigate systems suitable for bilingual English/Spanish conversational scenarios where some of the English and Spanish utterances may include some amount of words and phrases of the respective other language. That is, we are focusing on ST systems that can automatically and seamlessly handle utterances that are either purely English, purely Spanish, English with some Spanish words/phrases embedded or Spanish with some English words/phrases embedded. For transcription, we aim for models to generate the exact mixed-language transcript with each word written in its original spoken language. For translation, we aim to generate purely monolingual translations. See Figure 1 for an example. The experiments and results presented in this paper focus on translating into monolingual English only due to data availability, although we expect similar results for Spanish translations, due the bidirectional model training on standard ST data (Appendix D). We will leave it to future work to more closely examine translation into Spanish – or even a third language not present in the original utterance. + +It must be noted that word-level language categorization is sometimes ambiguous. A word in one language may also be considered part of a different language. That is for example true for loan words (Baugh, 1935), e.g., $e$ -mail in many non-English languages such as German. This issue can be further complicated by attempting to categorize what language named entities fall under: is a Spanish speaker saying Joe Biden or New York code-switching? Although we acknowledge the complexity of separating words between languages, our work, following previous work (Modipa et al., 2013; Nakayama et al., 2018), uses data annotated by crowd-sourced workers, counting any sentence annotated as having a least one foreign word as being CS. This approach also makes intuitive sense for speech, as the CS words (classified as foreign) will have phonemes that will align more with the embedded language, while the non-CS phonemes + +will align more with the matrix language. + +# 3.2 Code-Switched Speech Datasets + +We use the Fisher (Cieri et al., 2004) and Bangor Miami3 (Deuchar et al., 2014) corpora for CS data, as they are the only publicly available corpora we are aware of that contains both annotated CS ASR transcripts, as well as translations of those transcripts (Table 1). Although these corpora contain the translations, to our knowledge they have not been used to study CS translation before. + +The Miami corpus was collected for linguistic code-switching analysis and gathered from recorded conversations between bilingual English/Spanish speakers in casual settings, primarily in Miami, Florida. These conversations include a high proportion of naturally occurring CS speech. However, in order to collect these naturally occurring conversations, the participants were recorded throughout their day using a small digital recorder worn on belts and lapels. Due to this, the Miami audio contains lower audio quality and much noiser background conditions than standard ASR datasets. + +The Fisher dataset was collected for ASR and was gathered by pairing sets of Spanish speakers, located in the U.S. and Canada, to each other through phone calls. Although the Fisher dataset is not a CS focused dataset, we found that it contains a large amount of (annotated) CS utterances, due to the speakers being situated in English-speaking contexts. The recording method (phone recordings in 2004) makes this a noisy ASR dataset, although significantly less so than Miami. + +To prepare the data for the joint ST CS task, we separate the data with CS utterances (utterances that contain at least one word annotated as CS) from those with none, creating a CS set and a monolingual set for each dataset. We note that for the Miami dataset the monolingual split contains both English-only and Spanish-only monolingual audio. As the Miami corpus was also annotated with both ambiguous and unambiguous code-switching, we only include utterances in the CS set if the annotations were tagged as unambiguously code-switched (i.e. excluding words such as ok, aha, and named entities). The Fisher CS dataset consists of majority (matrix4) Spanish $77\%$ of the time, English-majority $17\%$ , and $6\%$ evenly + +
DatasetRaw TranscriptClean Transcript
Fisherun <foreign lang="English"> show <\foreign>, a mi me gusta ver是多么這些 <foreign lang="English"> shows <\foreign> de la medicina forenseun show, a mi me gusta ver是多么這些 show de la medicina forense
Miamihay una [/] una que dice (.) it's@s:eng five@s:eng o'clock@s:eng somewhere@s:enghay una una que dice it's five o'clock somewhere
+ +![](images/886e928acbce02c24d728f1b30efc11d3f5cddc7d195d352e343843d66553a53.jpg) +Figure 2: Histogram of the proportions of code-switched words in a sentence for the CS test sets (Fisher on the left, Miami on the right). For example, 0.2 means that $20\%$ of the words in the sentence are CS. + +![](images/5cb6fffa3bd145370f48e4178904b50e72d6cb58601716c832597033f4a428fe.jpg) + +Table 1: Examples of the raw and clean data for Miami and Fisher. Text in red indicates English text while blue text indicates Spanish. The Miami dataset uses the CHAT annotation format (MacWhinney and Snow, 1990). + +
DatasetSplitTypeHoursInstances
MiamiTrainMono3.606,489
TestCS2.823,296
Mono3.616,490
FisherTrainCS13.287,398
Mono157.3130,600
DevCS1.45821
TestCS1.63986
Mono12.1510,595
+ +Table 2: Dataset Statistics. CS stands for Code-Switched and Mono for Monolingual. + +split between English/Spanish. For the Miami CS dataset the languages are more evenly distributed, with $51\%$ majority-Spanish, $35\%$ majority-English, and $9\%$ evenly split. $^{5}$ + +The Fisher data consists of three evaluation sets (Dev/Dev2/Test) that together contain approximately a thousand instances of CS with corresponding translations in monolingual English. We com + +bine them into a Fisher CS Test set. The Fisher dataset also contains a large amount of CS utterances in the training set (appx. 8k or 15 hrs) which we use as fine-tuning $(90\%)$ and validation data $(10\%)$ . As the Miami dataset contains no splits, we use all CS data for the test set and split the monolingual data into even train/test sets. We include basic summary statistics in Table 2. Note that when compared to standard ST datasets, these CS ST datasets would be considered low-resource settings. + +In Figure 2, we see the proportion of CS words in a sentence for the CS test sets. We note that there are no sentences with more than $50\%$ of the words CS since the minority language cannot be more than $50\%$ by definition. For instances that are exactly $50\%$ code switched their language identification was chosen by randomly selecting either English or Spanish. We see that for the Fisher dataset there are more sentences with less than $15\%$ CS with a small uptick around $50\%$ . For Miami it is more uniform, with a large amount of sentences being approximately $25\%$ CS. + +To prepare our models for Spanish-English CS, we use the CoVoST (Wang et al., 2020a,b) and MuST-C (Cattoni et al., 2019) datasets for standard + +![](images/bba6a5f125044be8349dae8558174cc15b123f2c11cba23f20e872e2ee1434cb.jpg) +Figure 3: Illustration of model architectures, with cascaded architectures on the top and E2E architectures on the bottom. Left to right shows the progression of models with the least and the most amount of shared parameters respectively. Subscripts are present to indicate shared modules within each model. Dotted lines indicate a decision where only one path is chosen using the LID. Note that there is no cascade equivalent to the BIDIRECTIONAL E2E SHARED model, as the cascaded model by definition generates transcript then translation separately. The numbers in parentheses stand for the number of model parameters in billions. + +ST training, as CoVoST contains only $\mathrm{Es} \rightarrow \mathrm{En}$ and MuST-C contains only $\mathrm{En} \rightarrow \mathrm{Es}$ . Although high scores on these datasets are not our primary target, we note that our scores come close to or improve the state of the art (SoTA) on these tasks (see Appendix A, Table 9) albeit with different data used in training, showing that our base ST models are representative of current SoTA techniques. + +# 4 Experimental Settings + +# 4.1 Models + +Joint Transcript/Translation Models Many different types of E2E models exist for joint transcript/translation ST (Sperber and Paulik, 2020). Here, we focus on the triangle E2E architecture due to its strong performance in previous work (Anastasopoulos and Chiang, 2018; Sperber et al., 2020). Following recent work (Gallego et al., 2021; Li et al., 2020) we use pre-trained modules as a starting place for our ST model, using a Wav2Vec 2.0 (Baevski et al., 2020) encoder and a mBART 50-50 (Liu et al., 2020; Tang et al., 2020) decoder. + +Because our task involves joint ASR and ST, we need to adapt the pre-trained decoder to work with the E2E triangle architecture. Specifically, the triangle model's second decoder computes cross attention separately over both the first decoder and the encoder states. We place an additional cross-attention layer after each encoder-attention layer in mBARTs decoder blocks, initializing them with the pre-trained encoder-attention weights. To make sure these weights converge properly, we freeze the entire model for approximately the first epoch while training only the bridge and additional cross attention layers (c.f. Appendix A). + +As described in Section 3, our task involves modeling intra-sentence CS. This means that any model used for this task must either explicitly or implicitly learn to model the language of each word in the sentence. Furthermore, as more than one language is being modeled, each sub-component of the model can either be unidirectional or bidirectional. We can thus categorize potential models by how much information is shared within the parameters: the + +least shared models would be unidirectional and joined together by explicit LID, whereas the most shared would be bidirectional models that learn the LID implicitly. Models and their categorization along this scale are shown in Figure 3. + +For cascade models, the most basic would be separate unidirectional cascaded models joined by an LID model. The LID model will explicitly decide what the matrix language is and send the utterance to the model that is best equipped to handle that language (Figure 3A). Note that this approach may suffer from error propagation issues due to incorrect LID. A more parameter-shared version of this model is to make the cascaded model encoder shared between both unidirectional models (Figure 3B). Finally, we can examine a bidirectional cascade model that shares each component across both languages. This architecture implicitly learns to model the language of the input, removing the need for an explicit LID model (Figure 3C). + +We also examine similar analogues for the E2E triangle model: unidirectional models joined by LID (Figure 3D) and a bidirectional model with LID and a shared encoder (Figure 3E). We can also use the standard triangle model (see Anastasopoulos and Chiang (2018) for implementation details) that includes one encoder and two decoders (one for each sub-task) (Figure 3F). Furthermore, we propose to alter the standard triangle model and share both decoder parameters for both languages with a joint bidirectional decoder (Figure 3G, note that the cascade model cannot do this due to the definition of the cascade). By doing so, we hope to provide an inductive bias for the model to more easily handle code-switched data, as the weights of that decoder will already be used to handling multiple languages for both tasks (compared to the bidirectional cascade model, which only shares multilingual parameters for each task of transcript and translation). + +Language Identification Model We train the language identification (LID) model to identify the matrix language. For consistency with our other models (and similar to concurrent work, e.g. Tjandra et al. (2021)), we use a pre-trained Wav2Vec2 along with a classifier layer to predict whether the utterance is majority Spanish or majority English. We train the model in the same fashion as the joint transcription and translation models (Section 4.1 and Appendix A) but train on the LID data instead. + +The data for the LID model was gathered by tak + +ing the CS data from the training set of the Fisher corpus and combining it with randomly sampled data from several different datasets in order to help the model learn despite the domain of the audio. We use MuST-C English audio, CoVoST English audio, CoVoST Spanish audio, and the monolingual Spanish audio from the training sets of Fisher and Miami. We found that upsampling the CS training set by 2 and using the same amount of data (2x the number of the CS set) for CoVoST and MuST-C provided the best results: $98\%+$ accuracy on CoVoST and MuST-C, $89\%$ on the Fisher CS validation and test sets, and $72\%$ on the Miami CS test set (due to the noisy data). As a large proportion of the CS data is close to $50\%$ code-switched (see Figure 2), it becomes more difficult for the model to predict the matrix language correctly. + +# 4.2 Training Process and Evaluation + +For all dataset evaluations, we use word error rate (WER) and character error rate (CER) for the transcript and Charcut (CCT) (Lardilleux and Lepage, 2017) and sacreBLEU (Post, 2018) for the translation. However, we found that there was no difference in conclusions between each of the two metrics (WER vs CER and BLEU vs Charcut) and thus we only report BLEU/WER in the main text (see Appendix A for implementation details). For tables showing all metrics, see Appendix E. + +We evaluate our models on the Fisher and Miami test sets (with both CS-only and monolingual-only test sets) in two different settings: (1) without finetuning them on CS data (No-FT) and (2) after finetuning the already trained ST models on the Fisher CS Training set (FT). For models consisting of two monolingual sub-models we fine-tune both on the CS data. During fine-tuning we employ the same hyperparameters as in the original experiment, but perform early stopping on the Fisher CS Dev set. We use significance tests to verify the reliability of our results (Koehn, 2004). We run bootstrap resampling tests against the best performing model, using $\alpha = 0.05$ . More training parameters such as learning rates, etc. can be found in Appendix A. + +# 5 Results + +# 5.1 Scores on Test Sets + +In this section, we explore the results of doing ST for CS data along the two axes of unidirectional vs + +
ModelsNot Fine-TunedFine-Tuned
CSMono.CSMono.
↓WER↑BLEU↓WER↑BLEU↓WER↑BLEU↓WER↑BLEU
CASCADE UNIDIRECT37.122.526.624.733.524.624.825.5
(-0.8)(-0.4)(-3.1)(+0.9)(-0.4)(0.0)(-1.0)(+0.2)
CASCADE UNI SHARED ENC36.021.625.624.331.225.425.624.8
(0.0)(+0.6)(0.0)(+0.5)(+0.1)(+0.2)(-0.3)(+0.1)
E2E UNIDIRECT36.622.326.725.033.424.425.325.5
(-0.9)(-0.1)(-3.5)(+1.0)(-0.2)(+0.1)(-1.4)(+0.4)
E2E BIDIRECT BY LANG37.023.427.225.036.722.827.325.0
(-0.9)(-0.1)(-1.9)(+0.5)(-0.8)(+0.2)(-2.0)(+0.4)
+ +Table 3: Comparison of Oracle vs Predicted LID results on the Fisher dataset. Numbers in parenthesis are the difference to the corresponding model with oracle LID. Note that the Oracle LID improves upon the Predicted LID in most cases. Conclusions are similar for the Miami corpus (see Appendix B Table 7) + +
ModelNot Fine-TunedFine-Tuned
CSMono.CSMono.
↓WER↑BLEU↓WER↑BLEU↓WER↑BLEU↓WER↑BLEU
FisherCASCADE UNIDIRECT37.122.526.624.733.524.624.825.5
CASCADE UNI SHARED ENC36.021.625.624.331.2*25.425.624.8
CASCADE BIDIRECT37.221.826.524.133.223.228.123.2
E2E UNIDIRECT36.622.326.725.033.424.425.325.5
E2E BIDIRECT BY LANG37.023.427.225.036.722.827.325.0
E2E BIDIRECT BY TASK*34.1*23.023.626.0*30.125.6*24.325.6
E2E BIDIRECT SHARED33.8*23.323.226.230.0*25.424.126.1
MiamiCASCADE UNIDIRECT65.28.852.316.864.810.851.516.8
CASCADE UNI SHARED ENC60.29.753.815.755.014.755.615.3
CASCADE BIDIRECT61.49.354.014.857.410.658.214.0
E2E UNIDIRECT65.610.153.017.265.111.7*51.417.6
E2E BIDIRECT BY LANG69.512.455.216.569.311.554.516.6
E2E BIDIRECT BY TASK59.911.0*50.0*18.1*53.6*13.852.6*17.5
E2E BIDIRECT SHARED58.9*11.849.918.353.0*14.152.1*17.4
+ +Table 4: Test set scores, with results from the Fisher corpus on the top half and the Miami corpus on the bottom half. Bold scores indicate the best score in the column, while asterisks indicate results that are statistically similar to the best score in the column group using a bootstrap resampling test with $\alpha = 0.05$ . + +bidirectional and end-to-end vs cascade. + +We see results for models using explicit LID prediction in Table 3, showing that models that use the predicted LID perform worse than those that use Oracle LID (e.g. 36.6 vs 35.7 WER for the E2E UNIDIRECT). This provides a slight advantage for the bidirectional models that learn LID implicitly. However, the predicted LID case is the realistic setting, and thus we use it for the remainder of our experiments. + +When we examine the models along the scale of unidirectional to bidirectional, we see that higher amounts of shared parameters are correlated with higher scores, e.g. bidirectional is better. We see that on all datasets and evaluation settings (Table 4) that the E2E BIDIRECT SHARED model is either statistically similar or outperforms all other models, except for the Miami Monolingual FT case, where it comes in 3rd. Thus, the inductive bias of + +![](images/fcb723395ccdba822f96a17c962081c6a2428ea64e8844647ee52a7cf12a4b75.jpg) +Figure 4: Accuracy of the models in generating the CS spans. Note that this excludes all non-exact matches and is a lower bound on performance. + +sharing the multilingual task parameters provides a gain of approximately 3.5 WER points (33.8 vs 37.3) and 1.5 BLEU points (23.3 vs 21.9) for the E2E BIDIRECT SHARED model over the E2E UNIDIRECT model on the Fisher dataset, with similar + +
ModelTranscriptTranslation
Referencesi entonces volví ahora a la casa si el fall breakyes so I returned here to the house yes the fall break
Cascadesi entonces volví ahora a la casa si esolvereakyes then I returned here at home yes itsolvereak
E2Esi entonces volví ahora a la casa si es fallbreakyes so I came back to the house yes its fallbreak
+ +Table 5: Example generated output from the CASCADE BIDIRECT and E2E BIDIRECT SHARED models. Note the error propagation in the cascade model. + +performance on the Miami dataset. + +We can also examine Table 4 to see how the cascade models compare to the E2E models. The results show that the cascaded models perform the same or worse than the E2E models they compare to w.r.t. parameter sharing, with the best overall model being the E2E BIDIRECT SHARED, beating the CASCADE BIDIRECT (e.g. 33.8 vs 37.2 WER or 23.3 vs 21.8 BLEU on Fisher No-FT). + +Table 4 also illustrates that fine-tuning models on CS data improves scores on CS test sets (33.8 vs 30.0 WER for the E2E BIDIRECT SHARED on Fisher, 58.9 vs 53.0 for Miami). These gains are consistent for the Fisher dataset, which is the domain of the CS training set, however there are still gains for the out-of-domain Miami CS data. These results suggest that additional pre-training on natural or synthetic data (in both audio/text modalities) would likely be fruitful future work. When we examine how fine-tuning on CS data changes the model's monolingual scores, we find that they generally improve the monolingual results for the unidirectional models, but tend to make bidirectional models slightly worse, perhaps due to interference between the languages and tasks in the same weights. However, overall we find that fine-tuning provides large gains for CS with only minor decreases in monolingual performance. + +# 5.2 Model Analysis + +We also provide further analysis of the CS output of the best model and its cascaded counterpart (BIDIRECT CASCADE and E2E BIDIRECT SHARED). We perform three analyses: (1) comparing utterance level scores vs the proportion of CS words in the utterance, (2) computing the exact match accuracy of the CS spans in the model's output, and (3) qualitatively examining model output. + +We check the correlation between the proportion of CS words in a sentence and the model's score, using a linear model to find the $R^2$ values. We found that surprisingly, there was no correlation between the proportion of CS words and the models score for any of the different models + +or metrics $(R^2 < 0.025$ for all models and metrics). A graphical depiction of the model's scores over CS proportions is in the Appendix, Figure 5. We note that this finding was the same for comparing the number of CS words instead of the proportion. This finding implies that the models are surprisingly robust to the amount of CS in a sentence. + +Although BLEU andWER scores show how well the models do on the CS data, we can further isolate the performance of these models on only the code-switched parts of the utterances. To do so, we isolate all CS spans in the sentences and check to see if the model's output contains the exact-match of those spans. We note that this metric does not take into account synonyms or different tenses of the same word, making it a stricter metric serving as a lower bound of absolute performance. We see in Figure 4 that the E2E model still outperforms the cascade on CS spans, with Fisher No-FT scores around $20 - 30\%$ and Fisher FT scores around $45\%$ . + +Finally, we can also examine the model's outputs. We inspected 200 output sentences for the monolingual subsets and found that both models generated the correct language in every case, indicating that they correctly learned the implicit LID. However, we can see that the cascade model does struggle with error propagation (especially so in the CS setting, Table 5), likely causing part of the difference between the E2E and cascade models. + +Although the CS WER and BLEU scores are not as high as they are on cleaner monolingual datasets such as CoVoST (Appendix A), their performance is competitive with their respective monolingual performance on Miami and Fisher, even in the NoFT setting. We believe that with additional data and improvements ST models will be well-equipped to handle CS in practical situations and that overall, models show strong CS performance. + +# 6 Conclusion + +In this work, we expand the ST literature to explore code-switching, contributing a new task framework for ST that extends the joint transcription and translation setup. To further progress, we built and open + +sourced a new ST corpus for CS from existing public datasets. We evaluated a range of models, showing that using bilingual joint decoders provides gains over using separate task decoders. We also showed that E2E systems provide better performance than their cascading counterparts on the CS task. Overall, our work shows that ST models can perform well on CS applications with both no fine-tuning and in low-resource settings, opening the door to new and exciting areas of future work. + +# References + +Basem HA Ahmed and Tien-Ping Tan. 2012. Automatic speech recognition of code switching speech using 1-best rescoring. In 2012 International Conference on Asian Language Processing, pages 137-140. IEEE. +Antonios Anastasopoulos and David Chiang. 2018. Tied multitask learning for neural speech translation. arXiv preprint arXiv:1802.06655. +Alexei Baevski, Henry Zhou, Abdelrahman Mohamed, and Michael Auli. 2020. wav2vec 2.0: A framework for self-supervised learning of speech representations. arXiv preprint arXiv:2006.11477. +Albert C Baugh. 1935. The chronology of french loan-words in english. Modern Language Notes, 50(2):90-93. +Roldano Cattoni, Mattia Antonino Di Gangi, Luisa Bentivogli, Matteo Negri, and Marco Turchi. 2019. Must-c: A multilingual corpus for end-to-end speech translation. 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 2012-2017, Minneapolis, Minnesota. Association for Computational Linguistics. +Christopher Cieri, David Miller, and Kevin Walker. 2004. The fisher corpus: A resource for the next generations of speech-to-text. In LREC, volume 4, pages 69-71. +Salvador Climent, Joaquim Moré, Antoni Oliver, Miriam Salvatierra, Imma Sánchez, Mariona Taule, and Lluisa Vallmanya. 2003. Bilingual newsgroups in catalonia: A challenge for machine translation. Journal of Computer-Mediated Communication, 9(1):JCMC919. +Margaret Deuchar, Peredur Davies, Jon Russell Herring, M Carmen Parafita Couto, and Diana Carter. 2014. 5. building bilingual corpora. In Advances in the Study of Bilingualism, pages 93-110. Multilingual Matters. + +Mona Diab, Julia Hirschberg, Pascale Fung, and Thamar Solorio. 2014. Proceedings of the first workshop on computational approaches to code switching. In Proceedings of the First Workshop on Computational Approaches to Code Switching. +Chenpeng Du, Hao Li, Yizhou Lu, Lan Wang, and Yanmin Qian. 2021. Data augmentation for end-to-end code-switching speech recognition. In 2021 IEEE Spoken Language Technology Workshop (SLT), pages 194-200. IEEE. +AbdelRahim Elmadany, Muhammad Abdul-Mageed, et al. 2021. Investigating code-mixed modern standard arabic-egyptian to english machine translation. In Proceedings of the Fifth Workshop on Computational Approaches to Linguistic Code-Switching, pages 56-64. +Gerard I Gallego, Ioannis Tsiamas, Carlos Escolano, José AR Fonollosa, and Marta R Costa-jussà. 2021. Upc's speech translation system for iwslt 2021. arXiv preprint arXiv:2105.04512. +Devansh Gautam, Prashant Kodali, Kshitij Gupta, Anmol Goel, Manish Shrivastava, and Ponnurangam Kumaraguru. 2021. Comet: Towards code-mixed translation using parallel monolingual sentences. In Proceedings of the Fifth Workshop on Computational Approaches to Linguistic Code-Switching, pages 47-55. +Roberto R Heredia and Jeanette Altarriba. 2001. Bilingual language mixing: Why do bilinguals code-switch? Current Directions in Psychological Science, 10(5):164-168. +Wenxin Hou, Yue Dong, Bairong Zhuang, Longfei Yang, Jiatong Shi, and Takahiro Shinozaki. 2020. Large-scale end-to-end multilingual speech recognition and language identification with multi-task learning. In INTERSPEECH, pages 1037-1041. +Wei-Ning Hsu, Yao-Hung Hubert Tsai, Benjamin Bolte, Ruslan Salakhutdinov, and Abdelrahman Mohamed. 2021. Hubert: How much can a bad teacher benefit asr pre-training? In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6533-6537. IEEE. +Ganesh Jawahar, El Moatez Billah Nagoudi, Muhammad Abdul-Mageed, and Laks VS Lakshmanan. 2021. Exploring text-to-text transformers for english to henglish machine translation with synthetic code-mixing. arXiv preprint arXiv:2105.08807. +Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viégas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. 2017. Google's Multilingual Neural Machine Translation System: Enabling Zero-Shot Translation. Transactions of the Association for Computational Linguistics, 5:339-351. + +Philipp Koehn. 2004. Statistical Significance Tests for Machine Translation Evaluation. In *Conference on Empirical Methods in Natural Language Processing (EMNLP)*, pages 388-395. +Adrien Lardilleux and Yves Lepage. 2017. Charcut: Human-targeted character-based mt evaluation with loose differences. In Proceedings of IWSLT 2017. +Karla Dejean Le Féal. 1990. A different approach to machine translation. *Meta: journal des traducteurs*, 35(4):710-719. +Xian Li, Changhan Wang, Yun Tang, Chau Tran, Yuqing Tang, Juan Pino, Alexei Baevski, Alexis Conneau, and Michael Auli. 2020. Multilingual speech translation with efficient finetuning of pretrained models. arXiv preprint arXiv:2010.12829. +Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. 2020. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726-742. +Yizhou Lu, Mingkun Huang, Hao Li, Jiaqi Guo, and Yanmin Qian. 2020. Bi-encoder transformer network for mandarin-english code-switching speech recognition using mixture of experts. In INTER-SPEECH, pages 4766-4770. +Ne Luo, Dongwei Jiang, Shuaijiang Zhao, Caixia Gong, Wei Zou, and Xiangang Li. 2018. Towards end-to-end code-switching speech recognition. arXiv preprint arXiv:1810.13091. +D. Lyu and Ren-Yuan Lyu. 2008a. Language identification on code-switching utterances using multiple cues. In INTERSPEECH. +Dau-Cheng Lyu and Ren-Yuan Lyu. 2008b. Language identification on code-switching utterances using multiple cues. In Ninth Annual Conference of the International Speech Communication Association. +Dau-Cheng Lyu, Ren-Yuan Lyu, Yang-chin Chiang, and Chun-Nan Hsu. 2006. Speech recognition on code-switching among the chinese dialects. In 2006 IEEE International Conference on Acoustics, Speech and Signal Processing Proceedings, volume 1, pages I-I. IEEE. +Koena Ronny Mabokela, Madimetja Jonas Manamela, and Mabu Manaileng. 2014. Modeling codeswitching speech on under-resourced languages for language identification. In Spoken Language Technologies for Under-Resourced Languages. +Brian MacWhinney and Catherine Snow. 1990. The child language data exchange system: An update. Journal of child language, 17(2):457-472. +Manuel Mager, Özlem Çetinoğlu, and Katharina Kann. 2019. Subword-level language identification for intra-word code-switching. In arXiv preprint arXiv:1904.01989. + +Thipe Modipa, Marelie Hattingh Davel, and F. D. Wet. 2013. Implications of sepedi/english code switching for asr systems. In researchgate. +Carol Myers-Scotton. 1995. Social motivations for codeswitching: Evidence from Africa. Oxford University Press. +Carol Myers-Scotton and William Ury. 1977. Bilingual strategies: The social functions of code-switching. International journal of the sociology of language, pages 5-20. +Sahoko Nakayama, Takatomo Kano, Andros Tjandra, S. Sakti, and Satoshi Nakamura. 2019. Recognition and translation of code-switching speech utterances. 2019 22nd Conference of the Oriental COCOSDA International Committee for the Co-ordination and Standardisation of Speech Databases and Assessment Techniques (O-COCOSDA), pages 1-6. +Sahoko Nakayama, Andros Tjandra, S. Sakti, and Satoshi Nakamura. 2018. Speech chain for semi-supervised learning of japanese-english code-switching asr and tts. 2018 IEEE Spoken Language Technology Workshop (SLT), pages 182-189. +Matt Post. 2018. A call for clarity in reporting bleu scores. arXiv preprint arXiv:1804.08771. +Nicholas Ruiz and Marcello Federico. 2014. Assessing the impact of speech recognition errors on machine translation quality. In 11th Conference of the Association for Machine Translation in the Americas (AMTA), Vancouver, BC, Canada. +Steffen Schneider, Alexei Baevski, Ronan Collobert, and Michael Auli. 2019. wav2vec: Unsupervised pre-training for speech recognition. arXiv preprint arXiv:1904.05862. +Hiroshi Seki, Shinji Watanabe, Takaaki Hori, Jonathan Le Roux, and J. Hershey. 2018. An end-to-end language-tracking speech recognizer for mixed-language speech. 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 4919-4923. +Xian Shi, Qiangze Feng, and Lei Xie. 2020. The asru 2019 mandarin-english code-switching speech recognition challenge: Open datasets, tracks, methods and results. arXiv preprint arXiv:2007.05916. +R Mahesh K Sinha and Anil Thakur. 2005. Machine translation of bi-lingual Hindi-english (hinglish) text. 10th Machine Translation summit (MT Summit X), Phuket, Thailand, pages 149-156. +Thamar Solorio, Shuguang Chen, Alan W. Black, Mona Diab, Sunayana Sitaram, Victor Soto, Emre Yilmaz, and Anirudh Srinivasan, editors. 2021. Proceedings of the Fifth Workshop on Computational Approaches to Linguistic Code-Switching. Association for Computational Linguistics, Online. + +Kai Song, Yue Zhang, Heng Yu, Weihua Luo, Kun Wang, and M. Zhang. 2019. Code-switching for enhancing nmt with pre-specified translation. In NAACL. +Matthias Sperber and Matthias Paulik. 2020. Speech Translation and the End-to-End Promise: Taking Stock of Where We Are. In Association for Computational Linguistic (ACL), Seattle, USA. +Matthias Sperber, Hendra Setiawan, Christian Gollan, Udhyakumar Nallasamy, and Matthias Paulik. 2020. Consistent Transcription and Translation of Speech. Transactions of the Association for Computational Linguistics (TACL). +Yuqing Tang, Chau Tran, Xian Li, Peng-Jen Chen, Naman Goyal, Vishrav Chaudhary, Jiatao Gu, and Angela Fan. 2020. Multilingual translation with extensible multilingual pretraining and finetuning. arXiv preprint arXiv:2008.00401. +Andros Tjandra, Diptanu Gon Choudhury, Frank Zhang, Kritika Singh, Alexei Baevski, Assaf Sela, Yatharth Saraf, and Michael Auli. 2021. Improved language identification through crosslingual self-supervised learning. arXiv preprint arXiv:2107.04082. +Ngoc Thang Vu, Dau-Cheng Lyu, Jochen Weiner, Dominic Telaar, Tim Schilpe, Fabian Blaicher, Eng-Siong Chng, Tanja Schultz, and Haizhou Li. 2012. A first speech recognition system for mandarin- english code-switch conversational speech. In 2012 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 4889-4892. IEEE. +Changhan Wang, Juan Pino, Anne Wu, and Jiatao Gu. 2020a. Covost: A diverse multilingual speech-to-text translation corpus. arXiv preprint arXiv:2002.01320. +Changhan Wang, Anne Wu, and Juan Pino. 2020b. Covost 2 and massively multilingual speech-to-text translation. arXiv preprint arXiv:2007.10310. +Shinji Watanabe, Takaaki Hori, and John R Hershey. 2017. Language independent end-to-end architecture for joint language identification and speech recognition. In 2017 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pages 265-271. IEEE. +Orion Weller, Matthias Sperber, Christian Gollan, and Joris Kluivers. 2021. Streaming models for joint speech recognition and translation. arXiv preprint arXiv:2101.09149. +Genta Indra Winata, Samuel Cahyawijaya, Zihan Liu, Zhaojiang Lin, Andrea Madotto, and Pascale Fung. 2021. Are multilingual models effective in code-switching? ArXiv, abs/2103.13309. +Jitao Xu and François Yvon. 2021. Can you traducir this? machine translation for code-switched input. arXiv preprint arXiv:2105.04846. + +Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. 2020. mt5: A massively multilingual pre-trained text-to-text transformer. arXiv preprint arXiv:2010.11934. +Zhen Yang, Bojie Hu, Ambyera Han, Shen Huang, and Qi Ju. 2020. Csp: Code-switching pre-training for neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2624-2636. +Emre Yilmaz, Astik Biswas, Ewald van der Westhuizen, Febe de Wet, and Thomas Niesler. 2018. Building a unified code-switching asr system for south african languages. arXiv preprint arXiv:1807.10949. +Xianghu Yue, Grandee Lee, Emre Yilmaz, Fang Deng, and Haizhou Li. 2019. End-to-end code-switching asr for low-resourced language pairs. In 2019 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pages 972-979. IEEE. +Zhiping Zeng, Yerbolat Khassanov, Van Tung Pham, Haihua Xu, Eng Siong Chng, and Haizhou Li. 2018. On the end-to-end solution to mandarin- english code-switching speech recognition. arXiv preprint arXiv:1811.00241. +Shuai Zhang, Jiangyan Yi, Zhengkun Tian, Jianhua Tao, and Ye Bai. 2021. Rnn-transducer with language bias for end-to-end mandarin-english code-switching speech recognition. In 2021 12th International Symposium on Chinese Spoken Language Processing (ISCSLP), pages 1-5. IEEE. + +
ModelsCSMono.
↓WER↑BLEU↓WER↑BLEU
Random Init69.611.059.613.2
Pre-trained33.823.323.226.2
+ +Table 6: Comparison of the E2E bidirectional shared model with pre-training vs random initialization on the Fisher code-switched test sets. + +# A Training and Evaluation Details + +We follow Gallego et al. (2021); Li et al. (2020) and use a triangular learning rate, adapting the step count to depend on the batch size (as not all models could fit the same batch size) with (64 / batch size) * 500 warm up steps, (64 / batch size) * 500 hold steps, (64 / batch size) * 3000 decay steps, a beta of 0.9, and a beta2 of 0.98. The learning rate was selected from running a search over {0.01, 0.005, 0.001, 0.0005, 0.0001, 0.0005}. We found that 0.0005 was best for all models, so we examined learning rates again between 0.0001 to 0.001 (by 0.0001) and found that they all performed similarly, thus we use 0.0005 in our experiments. For efficiency in batch size while training, we removed all instances whose audio length was longer than 20 seconds. We freeze the attention layers for the first $500 \times (64 / \text{batch size})$ steps, which is approximately the first epoch of training. + +We initially trained the models on only CoVoST and MuST-C and found there was a large domain shift between these datasets and the comparatively noisier Fisher and Miami datasets. As domain shift was not the focus of this paper, we further trained the models on the Fisher and Miami monolingual training sets to reduce the effect of domain shift. + +As a sanity check of the effectiveness of our training, we also include scores in Table 9 for the test sets of CoVoST and MuST-C. We note that our scores are close to the SoTA scores of Li et al. (2020) on CoVoST (and they use the large Wav2Vec2 model while we use the base version) and our MuST-C scores are higher than that of Gallego et al. (2021). + +We evaluate using word error rate, character error rate, charcut, and BLEU. As the models learn different punctuation techniques from a variety of sources, including MuST-C, CoVoST, Miami, and Fisher, we remove all punctuation from the output before evaluating on the CS/Mono test sets, in order to only measure scores on the content. For BLEU, we use SacreBLEU with parameters + +![](images/6f1cfa3fe88bdb338b978e28eea7b0dc654bc5dd2de3a11ecab55f15ef343445.jpg) +Figure 5: Charcut performance of the E2E BIDIRECT SHARED model on sentences with various levels of CS proportions. Note that there is no clear correlation, as described in Section 5.2. Black lines indicate error bars of 2 standard deviations while the bar represents the average. + +case.lc+numrefs.1+smooth.4.0+tok.13a. + +# B More LID Comparisons + +We show results for all models that use LID on both datasets in Table 7. Note the conclusions remain the same as Table 3. + +# C Random Initialization Results + +We also perform an ablation of these pre-trained scores (Table 6) for the E2E BIDIRECT SHARED model, as it is the best performing model overall. We tried many different setups for training it from scratch rather than loading the pre-trained weights. We found that it was very difficult for this model to converge, and when it did, the results were sub-par. + +# D Training Results + +We include the scores of evaluating our models on the test sets of the ST training data (MuST-C and CoVoST) in Table 9. We also include the results of fine-tuning performance on the CS dev set in Table 8, which roughly mirrors the main results. + +# E Expanded Results + +For brevity, we do not include the CER and Charcut metrics in the main text. In this section we included tables with all metrics for all results (Table 10 for Miami and Table 11 for Fisher). We note however, that the WER and BLEU scores align with the CER and Charcut scores, and thus our conclusions remain the same. + +
ModelNo Fine-TuningFine-Tuned
CSMono.CSMono.
↓WER↑BLEU↓WER↑BLEU↓WER↑BLEU↓WER↑BLEU
FisherCASCADE UNIDIRECT37.1(36.3)22.5(22.1)26.6(23.5)24.7(25.6)33.5(33.1)24.6(24.6)24.8(23.8)25.5(25.7)
E2E UNIDIRECT36.6(35.7)22.3(22.2)26.7(23.2)25.0(26.0)33.4(33.2)24.4(24.5)25.3(23.9)25.5(25.9)
CASCADE UNI SHARED ENC36.0(36.0)21.6(22.2)25.6(25.6)24.3(24.8)31.2(31.3)25.4(25.6)25.6(25.3)24.8(24.9)
E2E BIDIRECT BY LANG37.0(36.1)23.4(23.3)27.2(25.3)25.0(25.5)36.7(35.9)22.8(23.0)27.3(25.3)25.0(25.4)
MiamiCASCADE UNIDIRECT65.2(61.4)8.8(8.3)52.3(50.0)16.8(17.3)64.8(64.4)10.8(10.8)51.5(50.9)16.8(16.9)
E2E UNIDIRECT65.6(63.1)10.1(9.4)53.0(51.2)17.2(17.7)65.1(65.6)11.7(11.7)51.4(50.7)17.6(17.7)
CASCADE UNI SHARED ENC60.2(60.2)9.7(8.8)53.8(53.8)15.7(16.0)55.0(56.0)14.7(14.4)55.6(55.5)15.3(15.3)
E2E BIDIRECT BY LANG69.5(69.7)12.4(10.7)55.2(53.4)16.5(16.7)69.3(69.7)11.5(10.4)54.5(53.2)16.6(16.6)
+ +Table 7: Scores on the code-switched test sets for the models using LID, with results from zero CS training on the left and results after fine-tuning on the right. + +
ModelsFisher CS Dev Set
↓WER↓CER↓CCT↑BLEU
CASCADE UNIDIRECT34.219.338.426.4
E2E UNIDIRECT33.018.937.327.8
CASCADE UNI SHARED ENC32.317.938.424.9
E2E BIDIRECT BY LANG36.323.039.326.3
E2E BIDIRECT BY TASK31.117.035.129.0
CASCADE BIDIRECT35.119.239.723.8
E2E BIDIRECT SHARED31.717.535.228.3
+ +Table 8: Scores on the Fisher CS Dev set. CCT stands for Charcut. Note that this mirrors the main results in Table 4. + +
ModelsMuST-C Test SetCoVoST Test Set
↓WER↓CER↓CCT↑BLEU↓WER↓CER↓CCT↑BLEU
CASCADE UNIDIRECT11.27.636.329.417.25.835.626.9
E2E UNIDIRECT13.08.937.327.818.66.436.026.2
CASCADE UNI SHARED ENC12.08.137.726.922.97.336.226.0
E2E BIDIRECT BY LANG11.67.836.628.619.77.737.125.4
E2E BIDIRECT BY TASK11.47.636.628.417.96.035.326.8
CASCADE BIDIRECT13.69.539.724.522.97.338.822.8
E2E BIDIRECT SHARED11.67.736.628.518.16.235.027.4
+ +Table 9: Scores on the MustC and CovoST datasets. CCT stands for Charcut. + +
ModelsMami
CS Test SetMonolingual Test Set
↓WER↓CER↓CCT↑BLEU↓WER↓CER↓CCT↑BLEU
Not Fine-TunedCASCADE UNIDIRECT63.643.365.28.752.334.151.917.0
CASCADE UNIDIRECT ORA.61.441.667.48.350.032.450.917.3
E2E UNIDIRECT64.043.064.09.953.034.651.017.4
E2E UNIDIRECT ORA.63.142.266.59.451.233.150.117.7
CASCADE UNI SHARED ENC60.239.763.79.353.834.152.715.9
CASCADE UNI SHARED ENC ORA.60.239.766.18.853.834.152.216.0
E2E BIDIRECT BY LANG68.848.461.211.554.637.352.016.7
E2E BIDIRECT BY LANG ORA.69.749.463.610.753.436.351.516.7
E2E BIDIRECT BY TASK59.939.659.411.050.032.649.718.1
CASCADE BIDIRECT61.439.862.29.354.034.153.114.8
E2E BIDIRECT SHARED58.939.158.511.849.932.249.318.3
Fine-TunedCASCADE UNIDIRECT64.842.056.510.851.533.451.116.8
CASCADE UNIDIRECT ORA.64.441.856.410.850.932.950.616.9
E2E UNIDIRECT65.143.056.911.751.433.750.417.6
E2E UNIDIRECT ORA.65.643.157.011.750.733.249.917.7
CASCADE UNI SHARED ENC55.035.251.414.755.635.952.915.3
CASCADE UNI SHARED ENC ORA.56.035.751.714.455.535.952.715.3
E2E BIDIRECT BY LANG69.348.661.311.554.537.252.116.6
E2E BIDIRECT BY LANG ORA.69.749.563.810.453.236.151.516.6
E2E BIDIRECT BY TASK53.635.053.313.852.634.450.517.5
CASCADE BIDIRECT57.436.358.810.658.236.655.114.0
E2E BIDIRECT SHARED53.035.054.414.152.133.950.417.4
+ +Table 10: Scores on the Miami dataset. CCT stands for Charcut. Results from zero CS training are on the top half and results after fine-tuning are on the bottom half. Ora stands for Oracle. + +
ModelsFisher
CS Test SetMonolingual Test Set
↓WER↓CER↓CCT↑BLEU↓WER↓CER↓CCT↑BLEU
Not Fine-TunedCASCADE UNIDIRECT37.322.245.621.928.015.340.024.4
CASCADE UNIDIRECT ORA.36.321.545.022.123.512.038.025.6
E2E UNIDIRECT36.922.045.121.828.215.639.724.7
E2E UNIDIRECT ORA.35.721.344.422.223.212.037.626.0
CASCADE UNI SHARED ENC36.020.544.721.925.613.039.824.3
CASCADE UNI SHARED ENC ORA.36.020.544.222.225.613.038.824.8
E2E BIDIRECT BY LANG36.923.643.023.227.215.539.225.1
E2E BIDIRECT BY LANG ORA.36.122.942.623.325.314.038.425.5
E2E BIDIRECT BY TASK34.119.442.323.023.611.937.426.0
CASCADE BIDIRECT37.221.343.821.826.513.339.524.1
E2E BIDIRECT SHARED33.819.341.523.323.211.837.126.2
Fine-TunedCASCADE UNIDIRECT33.518.539.624.624.812.938.225.5
CASCADE UNIDIRECT ORA.33.118.439.424.623.812.137.725.7
E2E UNIDIRECT33.419.140.024.425.313.338.325.5
E2E UNIDIRECT ORA.33.219.039.924.523.912.237.725.9
CASCADE UNI SHARED ENC31.217.138.425.425.613.038.724.8
CASCADE UNI SHARED ENC ORA.31.317.138.225.625.312.838.524.9
E2E BIDIRECT BY LANG36.723.342.922.827.315.539.325.0
E2E BIDIRECT BY LANG ORA.35.922.742.523.025.314.038.425.4
E2E BIDIRECT BY TASK30.116.238.325.624.312.337.825.6
CASCADE BIDIRECT33.218.341.023.228.114.340.123.2
E2E BIDIRECT SHARED30.016.438.025.424.112.237.326.1
+ +Table 11: Scores on the Fisher dataset. CCT stands for Charcut. Results from zero CS training are on the top half and results after fine-tuning are on the bottom half. Ora stands for Oracle. \ No newline at end of file diff --git a/endtoendspeechtranslationforcodeswitchedspeech/images.zip b/endtoendspeechtranslationforcodeswitchedspeech/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5b9fb760f54b2d003b25d8d3e411626ea43284a8 --- /dev/null +++ b/endtoendspeechtranslationforcodeswitchedspeech/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da035a6384c3928b5edf5d55020e208ff9f76a409da2f75b0b12027a16933fea +size 998766 diff --git a/endtoendspeechtranslationforcodeswitchedspeech/layout.json b/endtoendspeechtranslationforcodeswitchedspeech/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..16a926748216149f08f22a9105fb59caf1f2fbc6 --- /dev/null +++ b/endtoendspeechtranslationforcodeswitchedspeech/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5cf7c247b0612bb7206355a9de240780e3582e0354a134ac05d692024d4cca1 +size 361726 diff --git a/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_content_list.json b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9f1c2166ca21709e9b1c8e5fc34df8554be4242f --- /dev/null +++ b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3308a39ac7141279f1f7f68597f0d722f9f36b44050a141593fe5f99b5d57410 +size 75693 diff --git a/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_model.json b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c0efac90e332eed03df712b5aff6b1e0feca4083 --- /dev/null +++ b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:483ecd7af2f499aa77076888830e68fc85fce1095dcb38bbc68c78140c9b91bb +size 90139 diff --git a/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_origin.pdf b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..24b5ee568addb6298d14f9ac0a8e65248f9c6bc4 --- /dev/null +++ b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/e46f025a-b8b2-4be0-afb2-586cc6a74893_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13c3f459e2be223e4a63366b49d2c4539c851f5de015c93d4b84208420b8a708 +size 633043 diff --git a/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/full.md b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bde3f951f05a0503842f6e06eb5a470ddb1c2041 --- /dev/null +++ b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/full.md @@ -0,0 +1,316 @@ +# Enhancing Natural Language Representation with Large-Scale Out-of-Domain Commonsense + +Wanyun Cui, Xingran Chen + +Shanghai University of Finance and Economics + +cui.wanyun@sufe.edu.cn, xingran.chen.sufe@gmail.com + +# Abstract + +We study how to enhance text representation via textual commonsense. We point out that commonsense has the nature of domain discrepancy. Namely, commonsense has different data formats and is domain-independent from the downstream task. This nature brings challenges to introducing commonsense in general text understanding tasks. A typical method of introducing textual knowledge is continuing pre-training over the commonsense corpus. However, it will cause catastrophic forgetting to the downstream task due to the domain discrepancy. In addition, previous methods of directly using textual descriptions as extra input information cannot apply to large-scale commonsense. + +In this paper, we propose to use large-scale out-of-domain commonsense to enhance text representation. In order to effectively incorporate the commonsense, we proposed OK-Transformer (Out-of-domain Knowledge enhanced Transformer). OK-Transformer effectively integrates commonsense descriptions and enhances them to the target text representation. In addition, OK-Transformer can adapt to the Transformer-based language models (e.g. BERT, RoBERTa) for free, without pre-training on large-scale unsupervised corpora. We have verified the effectiveness of OK-Transformer in multiple applications such as commonsense reasoning, general text classification, and low-resource commonsense settings. + +# 1 Introduction + +Although unsupervised language models have achieved big success on many tasks (Devlin et al., 2019), they are incapable of learning low-frequency knowledge. For example, in the masked language model task in Fig. 1, even if we replace "Kevin was" (left) with "Jim was" (right), BERT (Devlin + +et al., 2019) still predicts the masked word as sick, crying, dying, etc. This is because similar texts in its training corpus rarely describe the subject of "comforted". To improve the model's ability to generalize and understand low-frequency knowledge, we propose to incorporate commonsense into language models. In Fig. 1, to make correct predictions, we need to enhance the language model with the commonsense $c_{1}$ . + +However, commonsense has the nature of domain discrepancy. The downstream task and the commonsense knowledge have distribution discrepancies. Taking the commonsense knowledge base we use (i.e. ATOMIC2020 (Hwang et al., 2020)) as an example, the distribution discrepancy is specifically manifested in (1) their data formats. The format of a commonsense description usually belongs to some specific patterns (e.g. "... As a result ..., "... Because ..."), while the downstream tasks can have arbitrary patterns. (2) The commonsense belongs to the domain of event causality, while the downstream tasks may belong to arbitrary domains. + +Here we highlight the challenges caused by the domain discrepancy. To introduce external textual knowledge to a pre-trained language model, a common practice is to continue pre-training the language model on the corpus of the external knowledge (Gururangan et al., 2020; Sun et al., 2019). However, the study (Gururangan et al., 2020) also found that continuing pre-training requires external knowledge and downstream tasks to have similar domains. Due to its domain discrepancy, introducing commonsense through continuing pre-training will cause catastrophic forgetting to downstream tasks, thereby injuring the effectiveness. We have verified this empirically in Sec 6.3. Therefore, the domain discrepancy prevents us from introducing commonsense by continuing pre-training. + +To enhance the representation of the target text with external commonsense, we propose to directly use its candidate commonsense as an extra input. + +![](images/39dd2f9d26b97517fdc8301aef66c45c00db715c21e7f5847056794f53a6e3f7.jpg) +Figure 1: The prediction of [MASK] by BERT. BERT cannot distinguish between Jim and Kevin in Jim comforted Kevin because. + +Our setup is different from a typical natural language understanding setup since the latter one only takes the target text as the input (Devlin et al., 2019). We argue that our setup – where the commonsense is introduced explicitly as input – is a more practicable setup to introduce out-of-domain commonsense that cannot be learned through pretraining. As far as we know, ExpBERT (Murty et al., 2020) is the closest setup to us. It also uses external knowledge (manually constructed templates) as the input. + +Another challenge is the scale of the commonsense. Although ExpBERT also allows extra textual commonsense as input, it only captures small-scale commonsense with a fixed size. In addition, when we introduce commonsense from a large-scale knowledge base for general purpose (i.e. ATOMIC2020), unrelated commonsense (e.g. $c_{2}$ and $c_{3}$ in Fig. 1) will certainly occur. However, ExpBERT lacks the ability to distinguish related and unrelated commonsense. Therefore, the power of large-scale commonsense knowledge was restricted in ExpBERT. We will verify this empirically in Sec 6.3. + +In order to incorporate the large-scale out-of-domain commonsense, we propose the OK-Transformer (Out-of-domain Knowledge enhanced Transformer) on the basis of Transformer (Vaswani et al., 2017). OK-Transformer has two modules. The knowledge enhancement module is used to encode the target text with commonsense, and the knowledge integration module is used to encode and integrate all candidate commonsense. OK-Transformer has two advantages. First, it fully represents the contextual information of the textual commonsense. Second, it can be adapted to existing pre-trained language models (e.g. BERT and RoBERTa) for free. That is, we are able to + +adapt OK-Transformer to the pre-trained language models, without pre-training OK-Transformer over large-scale unsupervised corpora from scratch. + +Some other methods are related to our work, such as introducing structured knowledge (Peters et al., 2019; Zhang et al., 2019; Guan et al., 2020; Zhou et al., 2018) and plain text knowledge (Guu et al., 2020) in language models. These methods do not represent the specific inductive bias of commonsense knowledge and therefore are not suitable to introduce commonsense. We will compare these studies with more details in Sec 2. + +# 2 Related work + +In this section, we compare different ways to introduce knowledge into language models. We divide the knowledge introduction methods into (1) continuing pre-training method (Gururangan et al., 2020; Sun et al., 2019) and (2) explicit introduction in the downstream task (Guu et al., 2020; Murty et al., 2020). + +Continuing pre-training the language model is effective when the external knowledge is similar to the downstream task (Gururangan et al., 2020; Sun et al., 2019). However, commonsense and downstream tasks have domain discrepancies, so continuing pre-training is unsuitable for introducing commonsense. We have empirically verified this in Sec 6.3. + +Introducing explicit knowledge in downstream tasks We classify the knowledge into structured knowledge, plain text, and semi-structured knowledge, depending on its form. The entries of structured knowledge are represented as individual embeddings (Peters et al., 2019; Zhang et al., 2019; Guan et al., 2020; Zhou et al., 2018), while commonsense descriptions in this paper can be represented more accurately by the contextual + +information of their word sequences. + +# 3 Problem Setup: Commonsense as the Extra Input + +We consider a text classification task where the text $x$ and its label $y$ are provided for training. Assuming that the candidate commonsense descriptions for enhancing $x$ come from a large-scale commonsense knowledge base (i.e. ATOMIC2020), we retrieve candidate commonsense for $x$ as the extra input. We denote the commonsense descriptions for $x$ as $cs(x) = \{c_1 \cdots c_n\}$ , where each $c_i$ is a commonsense description. The retrieval process will be shown in Sec 6. The model takes both $x$ and $cs(x)$ as the input. Since ATOMIC2020 contains if-then knowledge for general purposes, the problem setup can be expanded to a broad range of text understanding tasks. The goal of training is to find parameter $\theta$ that minimizes the loss of training examples given the texts and candidate commonsense descriptions: + +$$ +\arg \min _ {\theta} \mathbb {E} _ {(\mathrm {x}, \mathrm {y}) \in \operatorname {t r a i n}} \mathcal {L} (\mathrm {f} (\mathrm {x}, \operatorname {c s} (\mathrm {x}) | \theta), \mathrm {y}) \tag {1} +$$ + +where $\mathrm{f}(\cdot |\theta)$ is the model taking $x$ and $cs(x)$ as inputs, $\mathcal{L}$ is the loss function. + +# 4 OK-Transformer + +In this section, we propose OK-Transformer based on Transformer to introduce extra commonsense descriptions. We first show OK-Transformer on an abstract level in Sec 4.1. Then we elaborate two modules within it, i.e. knowledge enhancement and knowledge integration, in Sec 4.2 and Sec 4.3, respectively. + +# 4.1 Framework + +In this subsection, we show how our OK-Transformer works at an abstract level. For the target sentence $x$ , OK-Transformer takes both $x$ and $cs(x)$ as inputs. To incorporate all the information of $x$ and $cs(x)$ , the OK-Transformer contains three vanilla Transformers, denoted by $\mathrm{Transformer}^{(1)(2)(3)}$ . The knowledge enhancement module uses $\mathrm{Transformer}^{(1)}$ to encode the target text. Compared with the vanilla Transformer, $\mathrm{Transformer}^{(1)}$ leverages a new knowledge token to represent the commonsense that interacts with other words. The knowledge integration module encodes each individual commonsense description by $\mathrm{Transformer}^{(2)}$ , and then integrates all candidate commonsense descriptions by $\mathrm{Transformer}^{(3)}$ . This is shown in Fig. 2. + +![](images/5fb7ab70d61758207e82f2b823d08155ab06be918d1d49dbf55652ec6f911474.jpg) +Figure 2: OK-Transformer. $\mathrm{Transformer}^{(1)}$ encodes the target text $x$ with enhanced commonsense $k_{i}$ . $\mathrm{Transformer}^{(2)}$ encodes each individual commonsense description. $\mathrm{Transformer}^{(3)}$ integrates all candidate commonsense descriptions and transfers knowledge to $\mathrm{Transformer}^{(1)}$ . + +# 4.2 Knowledge Enhancement Module + +The knowledge enhancement module allows commonsense knowledge to enhance the representation of the target text. + +Interaction between words and commonsense. We use $\mathrm{Transformer}^{(1)}$ to represent the interaction between words of the target text $x$ . In addition, we introduce a special token $[k]$ to represent the commonsense knowledge. We denote it as the knowledge token. $\mathrm{Transformer}^{(1)}$ encodes all words and the knowledge token together via multi-head attention. Formally, given word sequence $\mathrm{x = w_1,\dots,w_n}$ , $\mathrm{Transformer}^{(1)}$ accepts a sequence of $n + 1$ word-piece tokens: $[\mathbf{k}]$ , $\mathrm{w}_1,\dots ,\mathrm{w}_n$ . We denote the knowledge embedding and word embeddings produced by the $i$ -th layer of $\mathrm{Transformer}^{(1)}$ as $k_{i}\in \mathbb{R}^{d}$ and $\mathbf{H_i}\in \mathbb{R}^{\mathbf{n}\times \mathbf{d}}$ , respectively. The $\mathrm{Transformer}^{(1)}$ block first uses a multi-head self-attention layer followed by a residual connection and a layer normalization to model their interactions: + +$$ +\mathrm {k} _ {\mathrm {i}} ^ {\prime}, \mathbf {H} _ {\mathrm {i}} ^ {\prime} = \text {L a y e r N o r m} ([ \mathrm {k} _ {\mathrm {i} - 1}, \mathbf {H} _ {\mathrm {i} - 1} ] + +$$ + +$$ +\text {M u l t i H e a d A t t n} \left(\left[ k _ {i - 1}, \mathbf {H} _ {i - 1} \right], \left[ k _ {i - 1}, \mathbf {H} _ {i - 1} \right], \left[ k _ {i - 1}, \mathbf {H} _ {i - 1} \right]\right) \tag {2} +$$ + +where $[\mathrm{k_{i - 1}},\mathbf{H}_{\mathrm{i - 1}}]\in \mathbb{R}^{(\mathrm{n + 1})\times \mathrm{d}}$ means appending $k_{i - 1}$ at the front of $\mathbf{H}_{i - 1}$ . $[\mathrm{k_{i - 1}},\mathbf{H}_{\mathrm{i - 1}}]$ is used as the query, key, and value in the multi-head attention. + +Knowledge update The vanilla Transformer projects $\mathbf{k}_{\mathrm{i}}^{\prime}, \mathbf{H}_{\mathrm{i}}^{\prime}$ in Eq. (2) to the output space with a multi-layer perceptron neural network (MLP). Compared to the vanilla Transformer, we use an extra update operation to update the knowledge token by the integrated commonsense knowledge after the MLP. As in the vanilla Transformer, the update layer is followed by a residual connection and a layer normalization. This can be formulated by: + +$$ +\begin{array}{l} \mathrm {k} _ {\mathrm {i}} = \text {L a y e r N o r m} \left(\mathrm {k} _ {\mathrm {i}} ^ {\prime} + \mathrm {M L P} \left(\mathrm {k} _ {\mathrm {i}} ^ {\prime}\right) + \mathrm {c s} _ {\mathrm {e m b}}\right) \\ \mathbf {H} _ {\mathrm {i}} = \operatorname {L a y e r N o r m} \left(\mathbf {H} _ {\mathrm {i}} ^ {\prime} + \operatorname {M L P} \left(\mathbf {H} _ {\mathrm {i}} ^ {\prime}\right)\right) \\ \end{array} +$$ + +where $c s_{emb}$ is the embedding of the commonsense computed by the knowledge integration module in Sec 4.3. + +# 4.3 Knowledge Integration Module + +The knowledge integration module encodes all candidate commonsense descriptions and integrates them. We first use $\mathrm{Transformer}^{(2)}$ to represent each candidate commonsense description. Then, we use $\mathrm{Transformer}^{(3)}$ to integrate all candidate commonsense, and transfer the integrated knowledge to the knowledge enhancement module. + +Representing single commonsense We use a vanilla Transformer as $\mathrm{Transformer^{(2)}}$ to model each candidate commonsense description. For all the retrieved commonsense $cs(x) = \{c_1,\dots ,c_n\}$ , we compute the embedding $emb_{j}$ of each commonsense description $c_{j}$ by: + +$$ +\mathrm {e m b} _ {\mathrm {j}} = \operatorname {T r a n s f o r m e r} ^ {(2)} \left(\mathrm {c} _ {\mathrm {j}}\right) \tag {4} +$$ + +Knowledge integration We integrate all candidate commonsense by $\mathrm{Transformer^{(3)}}$ . Since not all the candidate commonsense leads to high confidence prediction as we have discussed in Sec 1, we need to select relevant commonsense and ignore irrelevant commonsense. Transformer is adequate to conduct this selection. Specifically, in the query-key-value mechanism in Transformer, we use the embedding of the knowledge token in $\mathrm{Transformer^{(1)}}$ as the query of $\mathrm{Transformer^{(3)}}$ , and the commonsense embeddings by $\mathrm{Transformer^{(2)}}$ as keys and values of $\mathrm{Transformer^{(3)}}$ . Then, we integrate representations of all different commonsense descriptions based on their similarities with the knowledge token. + +Transformer $^{(3)}$ also uses multi-head attention to allow the knowledge token to interact with the candidate commonsense in multiple ways. The output of multi-head self-attention is followed by a residual connection and a layer normalization. + +$$ +\begin{array}{l} \mathrm {c s} _ {\text {e m b}} = \text {L a y e r N o r m} \left(\mathrm {k} _ {\mathrm {i} - 1}\right) \tag {5} \\ + \text {M u l t i H e a d A t t n} \left(\mathrm {k} _ {\mathrm {i} - 1}, \mathbf {e m b}, \mathbf {e m b}\right)) \\ \end{array} +$$ + +where $\mathbf{emb} = [\mathrm{emb}_1, \dots, \mathrm{emb}_n]$ denotes the sequence of embeddings of all candidate commonsense descriptions. We then apply a residual connection and a layer normalization to it. + +Null Commonsense Some target texts may not have valid commonsense from ATOMIC2020 to enhance their representations. Therefore, we refer to the settings of REALM (Guu et al., 2020) to add a null commonsense into the candidate commonsense of all target texts. We denote the null commonsense as $c_{0}$ . Matching to the null commonsense indicates that the commonsense knowledge base cannot help enhance the target text. + +# 5 Adaptation to Pre-trained Language Models + +In this section, we take BERT as an example to illustrate how we adapt OK-Transformer to existing pre-trained language models. We denote the adapted model as OK-BERT. An important manifestation of the effectiveness of the Transformer structure is its applications in large-scale pre-trained models (e.g. BERT, RoBERTa). In order to introduce external knowledge, many other studies conduct training over large-scale unsupervised corpus (Peters et al., 2019; Xiong et al., 2019). However, OK-Transformer is able to directly adapt to the existing pre-trained language models for free. In other words, when adapting OK-Transformer to OK-BERT, we directly use the parameters of each Transformer layer of BERT to initialize the OK-Transformer layers of OK-BERT. This property greatly improves the applicability of OK-BERT. In the rest of this section, we will describe how $\mathrm{Transformer}^{(1)}$ , $\mathrm{Transformer}^{(2)}$ , and $\mathrm{Transformer}^{(3)}$ are adapted respectively in Sec 5.1, and how to fine-tune OK-BERT in Sec 5.2. + +# 5.1 Layer-by-Layer Adaptation + +The OK-BERT we designed uses two original BERTs to serve as $\mathrm{Transformer}^{(1)}$ and $\mathrm{Transformer}^{(2)}$ , respectively. We denote them as BERT1 and BERT2. We connect the + +Transformer $^{(1)}$ and Transformer $^{(2)}$ in the corresponding layer of each BERT by Transformer $^{(3)}$ . Therefore, OK-BERT makes full use of the multi-layer structure of BERT, while allowing commonsense in the knowledge token to fully interact with the target text in each layer. The architecture is shown in Fig. 3. + +![](images/2706676cda0e054f3e7bd4dad48527154f50e4a6a03e4bfbea44dc4668b23913.jpg) +Figure 3: The architecture of OK-BERT. We only draw edges that connect to the $i$ -th layer. + +$\mathbf{Transformer^{(1)}}$ We adapt the Transformer of BERT1 to $\mathbf{Transformer^{(1)}}$ in the knowledge enhancement module of OK-Transformer. Note that the original BERT's tokens are [CLS] $\mathrm{w}_1\dots \mathrm{w_L}$ [SEP] (for a single sentence) or [CLS] $\mathrm{w}_1\dots \mathrm{w_m}$ [SEP] $\mathrm{w}_{\mathrm{m} + 1}\dots \mathrm{w_L}$ [SEP] (for a sentence pair). We follow (Wang et al., 2020) and use a special token $[k]$ as the knowledge token. When tokenizing sentences, we insert the $[k]$ token after the [CLS] token for each given text. In this way, the input tokens become [CLS] $[\mathrm{k}]$ w1 wL [SEP] or [CLS] $[\mathrm{k}]$ w1...wm [SEP] $\mathrm{w}_{\mathrm{m} + 1}\dots \mathrm{w}_{\mathrm{L}}$ [SEP], respectively. This simple modification allows us to use $[k]$ as the knowledge token in the knowledge enhancement module. + +$\mathbf{Transformer}^{(2)}$ We adapt each Transformer layer of BERT2 to the $\mathbf{Transformer}^{(2)}$ layer. The adaptation is straightforward since $\mathbf{Transformer}^{(2)}$ uses the vanilla Transformer structure. We use the encoding of the [CLS] token in each corresponding layer as the commonsense representation $emb_{j}$ to enhance the representation of the corresponding layer in BERT1. + +$\mathbf{Transformer}^{(3)}$ For each pair of corresponding $\mathbf{Transformer}^{(1)}$ and $\mathbf{Transformer}^{(2)}$ from the same layer, we use one $\mathbf{Transformer}^{(3)}$ to connect them to transfer the information from BERT2 to BERT1. + +In summary, when adapting to BERT-base with 12 Transformer layers, OK-BERT con + +tains 12 Transformer $^{(1)}$ layers for BERT1, 12 Transformer $^{(2)}$ layers for BERT2, and 12 Transformer $^{(3)}$ layers for layer-wise knowledge integration. + +# 5.2 Parameter Initialization and Model Training + +In our implementation, BERT1 and BERT2 have independent parameters. We use the parameters of BERT to initialize both BERT1 and BERT2. The parameters of Transformer $^{(3)}$ layers are randomly initialized. For downstream tasks, we then finetune all the parameters in the fashion of end2end. + +# 6 Experiments + +We evaluate the effectiveness of our proposed models in three scenarios: cloze-style commonsense reasoning, text classification, and low-resource commonsense settings. All the experiments run over a computer with 4 Nvidia Tesla V100 GPUs. + +Models We consider adapting OK-Transformer to BERT and RoBERTa, which are denoted as OK-BERT and OK-RoBERTa, respectively. We use the BERT-base and RoBERTa-large from the Hugging-Face Transformer library (Wolf et al., 2020). + +Implementation details for candidate knowledge retrieval For a given text $x$ , we retrieve candidate commonsense from ATOMIC2020. We use the if-then descriptions in ATOMIC2020 (e.g. Fig. 1). Since these descriptions cover 173k different verb phrases – one of the fundamental elements of language – the retrieval is applicable to a broad range of downstream text understanding tasks. + +We use a simple retrieval method. We simply consider word segments with window size 5 of the input text $x$ . All the commonsense descriptions matching one of these text segments will be regarded as the candidate commonsense descriptions $c_{i} \in cs(x)$ . + +# 6.1 Commonsense Reasoning + +# 6.1.1 Setup + +Datasets We consider the following commonsense reasoning benchmarks: WSC273 (Levesque et al., 2012), PDP (Morgenstern et al., 2016), Winogender (Rudinger et al., 2018), WinoGrande (Sakaguchi et al., 2019), CommonsenseQA (Talmor et al., 2019) and PhysicalQA (Bisk et al., 2020). + +Model details Due to the different implementations between (Kocijan et al., 2019b) and (Sakaguchi et al., 2019), in this paper, we also follow + +their settings to compare with them, respectively. For (Kocijan et al., 2019b), we conduct disambiguation tasks directly through masked language modeling in OK-BERT. For the latter one, we convert cloze-style problems to multiple-choice classification problems in OK-RoBERTa. In particular, we replace the target pronoun of one query sentence with each candidate reference, then put the new sentences into the language model. We use a single linear layer and a softmax layer over the encoding of its [CLS] token to compute the probability of each new sentence, and select the one with the highest probability as the pronoun disambiguation result. + +Hyperparameters of pre-training We follow (Kocijan et al., 2019b; Sakaguchi et al., 2019) to first pre-train models for 30 and 3 epochs over WSCR (Kocijan et al., 2019b) or WinoGrande (Sakaguchi et al., 2019), respectively. Then we fine-tune models over specific tasks. We use AdamW as the optimizer with learning rate 5e-6, which is selected from $\{2e - 5, 1e - 5, 5e - 6\}$ . We set the batch size to 8. + +
ModelWSCPDP
KEE(Liu et al., 2016)52.858.3
WKH (Emami et al., 2018)57.1-
MAS (Klein and Nabi, 2019)60.368.3
DSSM (Wang et al., 2019)63.075.0
LM(Trinh and Le, 2018)63.870.0
CSS (Klein and Nabi, 2020)69.690.0
GPT2 (Radford et al., 2019)70.7-
BERT-large+WSCR (Kocijan et al., 2019b)71.479.2
HNN (He et al., 2019)75.190.0
Human (Sakaguchi et al., 2019)96.592.5
BERT+WSCR66.385.0
OK-BERT+WSCR67.486.7
RoB.+WinoGrande90.187.5
OK-RoB.+WinoGrande91.691.7
+ +Table 1: Results on WSC and PDP. RoB. denotes RoBERTa. + +
ModelWinoGen.WinoGran.
WikiCREM (Kocijan et al., 2019a)82.1-
WinoGrande (Sakaguchi et al., 2019)94.679.3
BERT+WSCR68.251.4
OK-BERT+WSCR72.453.4
RoB.+WinoGrande94.679.3
OK-RoB.+WinoGrande96.279.6
+ +# 6.1.2 Results + +We compare our models with state-of-the-art commonsense reasoning models in Table 1, 2, and 3. + +Table 2: Results on WinoGender and WinoGrande. + +
ModelCommonsenseQAPhysicalQA
BERT55.8668.71
OK-BERT56.2769.09
RoBERTa73.5579.76
OK-RoBERTa75.9280.09
+ +Table 3: Results on CommonsenseQA and PhysicalQA. + +It can be seen that our models outperform other models in most settings. This verifies the effectiveness of our proposed models for commonsense reasoning. + +Ablations In Table 1, 2, and 3 we also compare OK-BERT with BERT. We found that OK-BERT with OK-Transformers effectively improved the accuracy of BERT with Transformers. Similar results can be found between OK-RoBERTa and RoBERTa. This shows that the proposed OK-Transformer improves pre-trained language models by adapting to them for free, i.e. without retraining on large-scale unsupervised corpora. + +# 6.2 General Text Classification + +We use MRPC, CoLA, RTE, STS-B, SST-2, and QNLI in the GLUE dataset (Wang et al., 2018) to verify the effectiveness of the proposed models on general text classification tasks. We did not evaluate over MNLI, because our model needs to represent the corresponding $n$ commonsense for each sentence, which is too costly for MNLI. We believe that this efficiency problem can be solved by further applying model compression (Iandola et al., 2020), but this is beyond the scope of this paper. It can be seen from Table 4 that OK-BERT and OK-RoBERTa outperform their baselines. + +# 6.3 Commonsense Introduction Methods + +Continue pre-train In the introduction section, we mentioned that a typical method of introducing textual knowledge is continuing pre-training (Gururangan et al., 2020; Sun et al., 2019). However, due to the domain discrepancy of commonsense, this method will cause catastrophic forgetting. To verify this intuition, in this subsection we compare with the continuing pre-trained model. We first continue pre-training the language model over ATOMIC2020, then fine-tune it over the target task. + +ExpBERT (Murty et al., 2020) We also compare our OK-Transformer with ExpBERT, another model that is able to introduce textual knowledge. In Sec 1, we mentioned that ExpBERT is not appli + +
GLUE TaskMRPCCoLARTEQNLISTS-BSST-2
BERT86.27/90.2159.5071.4391.2089.35/88.9391.97
OK-BERT87.25/90.8458.2973.6591.5889.82/89.4693.69
RoBERTa90.44/93.1566.5784.1194.0091.83/91.9595.70
OK-RoBERTa91.91/94.2466.8986.2894.4192.41/92.2096.10
+ +Table 4: Results on text classification tasks. Models are evaluated by the dev split from GLUE. + +cable to large-scale commonsense knowledge bases for its disability to select related commonsense and ignore unrelated commonsense. To verify this, we use the retrieved candidate commonsense descriptions from ATOMIC2020 as the additional explanations for ExpBERT. ExpBERT concatenates all the embedding of a fixed number of commonsense, which is inflexible for ATOMIC2020. For this reason, we fix the number of commonsense to 48. If there are more than 48 candidate commonsense descriptions for one sample, we will randomly select 48 of them. Otherwise, we will pad null commonsense to it. In our experiments, we also apply ExpBERT to RoBERTa (Liu et al., 2019) (i.e. ExpRoBERTa). + +We show the results in Table 5. We do not report the results of ExpBERT on WSC273, as ExpBERT cannot solve the cloze-style problems. It can be seen that the performance of language models was suffered when we simply continue pre-training the models on the commonsense knowledge base. This verifies that the continuing pre-training on the out-of-domain commonsense will cause catastrophic forgetting and injure the effectiveness. On the other hand, using OK-Transformer to introduce commonsense as the extra input significantly improves the accuracy. The results also suggest that ExpBERT is not applicable to large-scale commonsense knowledge bases. + +# 6.4 Why is OK-Transformer effective? + +We now analyze why OK-Transformer can effectively introduce out-of-domain commonsense without pre-training. We are inspired by an observation of language model fine-tuning LMs (Radiya-Dixit and Wang, 2020), i.e., the parameters after fine-tuning are close to those before fine-tuning. Therefore, we argue that the key to effective introduction is whether the parameters of the meta LM is good initialization for the commonsense-enhanced LM, that the parameters do not change much before and after fine-tuning. + +To verify this, we compare the parameter + +![](images/5a4ba77195b7a4ea3455504788feab1f4688abf499a57eda47f2c09cdc7cf781.jpg) +Figure 4: $L_{1}$ distances in parameter space between pretrained and fine-tuned meta LMs. We show the metrics of $W_{I}$ across the 12 Transformer layers. + +![](images/fc19e1f83ac81aee8dfe44d42ed89dfa548ed8c76bb5864600a28b6cdb4067df.jpg) +Figure 5: Losses of different knowledge integration methods in SST-2. The [CLS] token method does not converge. + +![](images/6be8aeaadbe27bddf16792b5b166a38542624de272b14d6b9cd8977459b14145.jpg) +Figure 6: Effect in lowresource commonsense settings with different $k$ s over SST-2. + +changes of different knowledge integration methods. These methods include (1) OK-Transformer, (2) KnowBERT (Peters et al., 2019), (3) using the original $[CLS]$ token instead of the proposed knowledge token, and (4) abandoning the knowledge token and instead calculating the $cs_{emb}$ of each verb phrase of the target sentence separately, and adding them to these verb phrases' hidden states in $\mathbf{H}_{\mathrm{i - 1}}$ . We follow (Radiya-Dixit and Wang, 2020) to use the $L1$ as the distance metric. (Radiya-Dixit and Wang, 2020) found that the main change in parameters occurs on the $W_{I}$ matrix of the Transformer. Our experimental results also follow this phenomenon. Therefore, for greater clarity, we only show the distances of the $W_{I}$ matrices after fine-tune. We show the distances of different methods in Fig. 4, and their training losses in Fig. 5. + +
MRPCCoLARTEQNLISTS-BSST-2WSC273
BERT86.27/90.2159.5071.4391.2089.35/88.9391.9766.30
BERT-continue83.58/88.8154.7062.0990.2487.41/87.4691.7463.00
ExpBERT85.78/89.7958.2962.8287.0684.78/84.6791.51-
OK-BERT87.25/90.8458.2973.6591.5889.82/89.4693.6967.40
RoBERTa90.44/93.1566.5784.1194.0091.83/91.9595.7090.10
RoBERTa-continue87.01/90.3861.7474.0193.6189.57/89.6695.9987.91
ExpRoBERTa89.46/92.2266.9083.3993.7889.81/89.9495.99-
OK-RoBERTa91.91/94.2466.8986.2894.4192.41/92.2096.1091.58
+ +Table 5: Comparison of different commonsense introduction approaches. Continuing pre-training even injures the effectiveness. On the other hand, using OK-Transformers to introduce external knowledge achieves better results than using Transformer. + +It can be seen that the distances of OK-Transformer are much smaller than other methods, except the [CLS] token method, which does not converge as shown in Fig. 5. This fits our intuition of reducing the parameter variations to introduce external knowledge more effectively. + +# 6.5 Effect in Low-Resource Commonsense Settings + +Since there is a large number of commonsense descriptions in ATOMIC2020, a large portion of descriptions only occur a few times in the training set. In this subsection, we want to verify for these rare descriptions, can the model still benefit from it? If so, we think it means that the model uses the contextual information of the commonsense to improve the understanding of the commonsense. + +To do this, we proposed a low-resource commonsense setting. We evaluate the effect of the model if the training dataset only contains $k = 8 / 16 / 32 / 64$ samples. Therefore the frequency of the appeared commonsense descriptions is low. In order to exclude the influence of other samples, we only use test samples whose candidate commonsense descriptions have already occurred in the $k$ training samples. For example, when $k = 8$ , we randomly select 8 samples from the training set for training, and use all samples in the test set which contains the commonsense of the 8 training samples for evaluation. We show the results over the SST-2 dataset in Fig. 6. It can be seen that our models still benefit from low-frequency commonsense. + +# 6.6 Does OK-Transformer Provide Interpretability? + +In this subsection, we try to answer if the integration of candidate commonsense descriptions by + +OK-Transformer is interpretable. To answer this question, we calculate the influence of different commonsense descriptions on the model's predictions. We follow (Wu et al., 2020) to quantify the influence of a commonsense description $c_{i}$ as: If $c_{i}$ is removed from $cs(x)$ , how much will the prediction change? This change is measured by the Euclidean distance between the prediction by $cs(x) - c_{i}$ and by $cs(x)$ . The greater the change in the prediction, the greater the influence of this commonsense. + +John promised Bill to leave, so an hour later [John] left. + +
PersonX promises PersonY.
1.···As a result, PersonX wants to fulfill his promise.
2.···PersonX is seen as truthful
3.···PersonX is seen as trustworthy.
4.···Before, PersonX needed to talk to PersonY.
5.···Before, PersonX needed to go to PersonY's house.
+ +Table 6: A case study of top 5 commonsense descriptions. + +Through the case studies of the samples in WSC273, we found that although commonsense with higher influence is somewhat interpretable for people, the interpretability is not significant. We show some examples in Table 6. We believe that this is because some commonsense for people has been learned in pre-training. Therefore, the out-of-domain commonsense that these pre-trained language models need to incorporate for downstream tasks is inconsistent with human understanding. + +# 7 Conclusion + +In this paper, we study how to use commonsense to enhance the general text representation. We first analyzed the challenges brought by the domain discrepancy of commonsense. Then, we propose OK- + +Transformer to allow commonsense integration and enhancement. In the experiments, we verified the effectiveness of our proposed models in a variety of scenarios, including commonsense reasoning, general text classification, and low-resource commonsense. Our models consistently outperform the baselines. We have also empirically analyzed other properties (e.g. interpretability) of the model. + +# Acknowledgments and Disclosure of Funding + +We thank Wenting Ba for her valuable plotting assistance. This paper was supported by National Natural Science Foundation of China (No. 61906116), by Shanghai Sailing Program (No. 19YF1414700). + +# References + +Yonatan Bisk, Rowan Zellers, Jianfeng Gao, Yejin Choi, et al. 2020. Piqa: Reasoning about physical commonsense in natural language. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7432-7439. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In *NAACL*, pages 4171–4186. +Ali Emami, Adam Trischler, Kaheer Suleman, and Jackie Chi Kit Cheung. 2018. A generalized knowledge hunting framework for the winograd schema challenge. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Student Research Workshop, pages 25-31. +Jian Guan, Fei Huang, Zhihao Zhao, Xiaoyan Zhu, and Minlie Huang. 2020. A knowledge-enhanced pretraining model for commonsense story generation. Transactions of the Association for Computational Linguistics, 8:93-108. +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. arXiv preprint arXiv:2004.10964. +Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. 2020. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909. +Pengcheng He, Xiaodong Liu, Weizhu Chen, and Jianfeng Gao. 2019. A hybrid neural network model for commonsense reasoning. arXiv preprint arXiv:1907.11983. + +Jena D Hwang, Chandra Bhagavatula, Ronan Le Bras, Jeff Da, Keisuke Sakaguchi, Antoine Bosselut, and Yejin Choi. 2020. Comet-atomic 2020: On symbolic and neural commonsense knowledge graphs. arXiv preprint arXiv:2010.05953. +Forrest Iandola, Albert Shaw, Ravi Krishna, and Kurt Keutzer. 2020. Squeezebert: What can computer vision teach nlp about efficient neural networks? In Proceedings of SustainNLP: Workshop on Simple and Efficient Natural Language Processing, pages 124-135. +Tassilo Klein and Moin Nabi. 2019. Attention is (not) all you need for commonsense reasoning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4831-4836. +Tassilo Klein and Moin Nabi. 2020. Contrastive self-supervised learning for commonsense reasoning. arXiv preprint arXiv:2005.00669. +Vid Kocijan, Oana-Maria Camburu, Ana-Maria Cretu, Yordan Yordanov, Phil Blunsom, and Thomas Lukasiewicz. 2019a. Wikicrem: A large unsupervised corpus for coreference resolution. 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 4294-4303. +Vid Kocijan, Ana-Maria Cretu, Oana-Maria Camburu, Yordan Yordanov, and Thomas Lukasiewicz. 2019b. A surprisingly robust trick for winograd schema challenge. In The 57th Annual Meeting of the Association for Computational Linguistics (ACL). +Hector Levesque, Ernest Davis, and Leora Morgenstern. 2012. The winograd schema challenge. In Thirteenth International Conference on the Principles of Knowledge Representation and Reasoning. +Quan Liu, Hui Jiang, Zhen-Hua Ling, Xiaodan Zhu, Si Wei, and Yu Hu. 2016. Commonsense knowledge enhanced embeddings for solving pronoun disambiguation problems in winograd schema challenge. arXiv preprint arXiv:1611.04146. +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. +Leora Morgenstern, Ernest Davis, and Charles L Ortiz. 2016. Planning, executing, and evaluating the winograd schema challenge. AI Magazine, 37(1):50-54. +Shikhar Murty, Pang Wei Koh, and Percy Liang. 2020. Expert: Representation engineering with natural language explanations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2106-2113. + +Matthew E Peters, Mark Neumann, Robert Logan, Roy Schwartz, Vidur Joshi, Sameer Singh, and Noah A Smith. 2019. Knowledge enhanced contextual word representations. 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 43-54. +Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. +Evani Radiya-Dixit and Xin Wang. 2020. How fine can fine-tuning be? learning efficient language models. In International Conference on Artificial Intelligence and Statistics, pages 2435-2443. PMLR. +Rachel Rudinger, Jason Naradowsky, Brian Leonard, and Benjamin Van Durme. 2018. Gender bias in coreference resolution. 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 8-14. +Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. 2019. Winogrande: An adversarial winograd schema challenge at scale. arXiv preprint arXiv:1907.10641. +Chi Sun, Xipeng Qiu, Yige Xu, and Xuanjing Huang. 2019. How to fine-tune bert for text classification? In Proceedings of China National Conference on Computational Linguistics, pages 194-206. +Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. 2019. *Commonsenseqa: A question answering challenge targeting commonsense knowledge.* 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 4149-4158. +Trieu H Trinh and Quoc V Le. 2018. A simple method for commonsense reasoning. arXiv preprint arXiv:1806.02847. +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 Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6000-6010. +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. + +Shuohang Wang, Yuwei Fang, Siqi Sun, Zhe Gan, Yu Cheng, Jingjing Liu, and Jing Jiang. 2020. Cross-thought for sentence encoder pre-training. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 412-421. +Shuohang Wang, Sheng Zhang, Yelong Shen, Xiaodong Liu, Jingjing Liu, Jianfeng Gao, and Jing Jiang. 2019. Unsupervised deep structured semantic models for commonsense reasoning. arXiv preprint arXiv:1904.01938. +Thomas Wolf, Julien Chaumont, Lysandre Debut, Victor Sanh, Clement Delangue, Anthony Moi, Pierric Cistac, Morgan Funtowicz, Joe Davison, Sam Shleifer, et al. 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. +Zhiyong Wu, Yun Chen, Ben Kao, and Qun Liu. 2020. Perturbed masking: Parameter-free probing for analyzing and interpreting bert. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4166-4176. +Wenhan Xiong, Jingfei Du, William Yang Wang, and Veselin Stoyanov. 2019. Pretrained encyclopedia: Weakly supervised knowledge-pretrained language model. In International Conference on Learning Representations. +Zhengyan Zhang, Xu Han, Zhiyuan Liu, Xin Jiang, Maosong Sun, and Qun Liu. 2019. Ernie: Enhanced language representation with informative entities. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1441-1451. +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. + +# A Experimentation Details + +When continuing pre-training BERTcontinue/RoBERTa-continue in Table 5, we follow (Kocijan et al., 2019b) and set learning rate to $1e - 5$ , batch size to 64, and train the model for only one epoch. + +When fine-tuning the models in Sec 6.2 and Sec 6.3, we train the models for 10 epochs. We use grid search to select their learning rates and batch sizes from $\{1e - 5,2e - 5,5e - 5\}$ and $\{8,16,32,64\}$ , respectively. + +
DatasetWSCPDPWinoGenderWinoGrande
Dataset size2736072040938/1267
Matched ratio67%83%65%71%
Average |cs(x)|129.71189.6880.63140.56
Average length of c17.8817.9116.8317.91
+ +Table 7: Statistical results on commonsense reasoning datasets. + +
DatasetMRPCCoLARTEQNLISTS-BSST-2
Dataset size3668/4088551/10432490/277104743/54635749/150067349/872
Matched ratio59%40%72%52%56%25%
Average |cs(x)|80.7184.85122.6081.35117.0083.07
Average length of c17.4717.6017.7117.5917.3417.59
+ +Table 8: Statistical results on sentence classification datasets. + +# B Statistics of Commonsense Descriptions + +In Table 7 and Table 8, we report statistics about down-stream tasks and their commonsense descriptions. Our report includes the size of the train/test splits for the downstream tasks, the proportion of samples that matched to at least one commonsense description (Matched proportion) in each task, the average number of matched commonsense descriptions per sample (Average $|cs(x)|$ ), and the average length of each matched commonsense description (Average length of $c$ ). + +From the results, we found that more than half of the samples matched to at least one commonsense description in most of the datasets. This indicates that the OOD commonsense used in this paper is generalizable to different datasets. Also, the average length of the matched commonsense descriptions is short (about 17), thus encoding them via Transformer is efficient. \ No newline at end of file diff --git a/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/images.zip b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3c913d71cd6b9882698a74fb0d6db1210c7f271f --- /dev/null +++ b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66528a962832893796dd6c7e044080d1a91069322d548e5ec9c267b7294a65c2 +size 515259 diff --git a/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/layout.json b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..da3cc4b5a261731bb949fe9915d5bc5b6553ad4e --- /dev/null +++ b/enhancingnaturallanguagerepresentationwithlargescaleoutofdomaincommonsense/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbc158012a60151747ce3c05097ef25af453c93b94ae33e941e1bc669f6f2d41 +size 392673 diff --git a/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_content_list.json b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..74ecc8980945852bf2faad407fd916afd7ab65bf --- /dev/null +++ b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c6b916f055cbcd281d02d42bfb58e64e9fa04d337aaa0bb89b9f27f77b1a269 +size 98425 diff --git a/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_model.json b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c3a73f909c5cfd42c40c325b1f0c32f4b9f31f3a --- /dev/null +++ b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15c5bd768348000efccd4d4939ee152f250cc270cc3f27792ef47f6ffd172ed3 +size 119568 diff --git a/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_origin.pdf b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..38320753ca5dbc250ce6819251b7b86a893d38ee --- /dev/null +++ b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/661d542b-40b1-43e3-bac7-49df4d2ed7b8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd0ccd9c015357229940b5e08b40a9d4d020d3f5574d3115bea964e1aba1828a +size 586020 diff --git a/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/full.md b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e31433c9b5878cf65a86f7d6f0beb536adfec76f --- /dev/null +++ b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/full.md @@ -0,0 +1,380 @@ +# Entropy-based Attention Regularization Frees Unintended Bias Mitigation from Lists + +Giuseppe Attanasio $^{1,2}$ , Debora Nozza $^{1}$ , Dirk Hovy $^{1}$ , Elena Baralis $^{2}$ + +1Bocconi University, Milan, Italy + +$^{2}$ Politecnico di Torino, Turin, Italy + +{giuseppe.attenasio3,debora.nozza,dirk.hovy}@unibocconi.it, + +elena.baralis@polito.it + +# Abstract + +Warning: This paper contains examples of language that some people may find offensive. + +Natural Language Processing (NLP) models risk overfitting to specific terms in the training data, thereby reducing their performance, fairness, and generalizability. E.g., neural hate speech detection models are strongly influenced by identity terms like gay, or women, resulting in false positives, severe unintended bias, and lower performance. Most mitigation techniques use lists of identity terms or samples from the target domain during training. However, this approach requires a-priori knowledge and introduces further bias if important terms are neglected. Instead, we propose a knowledge-free Entropy-based Attention Regularization (EAR) to discourage overfitting to training-specific terms. An additional objective function penalizes tokens with low self-attention entropy. We fine-tune BERT via EAR: the resulting model matches or exceeds state-of-the-art performance for hate speech classification and bias metrics on three benchmark corpora in English and Italian. EAR also reveals overfitting terms, i.e., terms most likely to induce bias, to help identify their effect on the model, task, and predictions. + +# 1 Introduction + +Online hate speech is growing at a rapid pace, with effects that can result in dangerous criminal acts offline. Due to its verbal nature, various Natural Language Processing approaches have been proposed (Qian et al., 2018; Indurthi et al., 2019; Atanasio and Pastor, 2020; Kennedy et al., 2020; Vidgen et al., 2021, inter alia). Recently, detection performance has significantly improved with the use of large pre-trained language models based on Transformers (Vaswani et al., 2017), such as Bidirectional Encoder Representations from Transformers (BERT) (Devlin et al., 2019). However, + +![](images/8a61bd4038890f12dcc45ff7b6ec5dbff8b48075783fbf2eff3f3c0f3d468802.jpg) +Figure 1: False positive from BERT as a hate speech detector. The darker and taller the bar, the higher the overfitting on the term. + +several works have shown that by fine-tuning neural language models on hate speech detection, the classifiers obtained contain severe unintended bias (Dixon et al., 2018), i.e. they perform better or worse when texts mention specific identity terms (such as gay, Muslim, or woman). As a result, a sentence like "As a Muslim woman, I agree" would be wrongly classified as hate speech, purely due to the presence of two identity terms, i.e., terms referring to specific groups based on their socio-demographic features. One cause of false positives is selection bias in the keyword-driven collection of corpora (Ousidhoum et al., 2020). Figure 1 shows a false positive example for a fine-tuned BERT model on hate speech detection. Ideally, the model should rely on the words adore and you. Instead, BERT overfitted to the word Girl and associated it with a hateful context. This unwanted effect demonstrates the issues of lexical overfitting, and how they cause unintended bias on identity terms. + +Various methods have been proposed to mitigate and measure (unintended) bias (Elazar and Goldberg, 2018; Park et al., 2018; Dixon et al., 2018; Nozza et al., 2019; Kennedy et al., 2020; Vaidya et al., 2020). However, all those methods rely on the availability of a set of identity terms. This is a severe limitation, which hinders the generalizability and applicability of hate detection models + +to real-world contexts. For example, a model designed to reduce the unintended bias on gender-related terms (such as woman, wife) will not address unintended bias for religious affiliation. So practitioners must decide a-priori "which vulnerable groups are present in our data?" + +We propose an Entropy-based Attention Regularization (EAR) that forces the model to build token representations by attending to a wider context, i.e., consider a larger number of tokens from the rest of the sentence. We measure the attended context as the entropy of the self-attention weight distribution over the input sequence. We use EAR as a regularization term in the loss computation to maximize each token's entropy. We apply EAR to BERT. The resulting model (BERT+EAR) significantly improves performance on unintended bias mitigation in English and Italian. In addition, it requires no a-priori knowledge (e.g., sets of identity terms), making it fairer and more general. The contextualized representations EAR induces avoid basing the classification on individual terms and, ultimately, mitigate lexical overfitting and intrinsic bias from pre-trained weights. + +As a training by-product, EAR lets us extract the overfitting terms, i.e., terms accounting for narrower context that most likely induce unintended bias. These terms can highlight possible weaknesses in the model: from the over-sensitivity of pre-trained weights to specific words (Sheng et al., 2019; Nangia et al., 2020; Vig et al., 2020), to overspecialization of training corpora on the keywords used for collecting data (Ousidhoum et al., 2020). + +Note that while we show results on BERT, EAR is applicable to any attention-based architecture. + +Contributions. EAR is a novel entropy-based attention regularization method to mitigate unintended bias by reducing lexical overfitting. It is applied to all terms, so it does not need a-priori domain knowledge (e.g., predefined term lists). Independent of domain-specific information, EAR generalizes better to different languages and contexts compared to similar approaches. Attention entropy is used to extract a list of the most likely biased terms. EAR code is available at https://github.com/g8a9/ear. + +# 2 Entropy-based Attention Regularization + +Attention was originally designed for aligning target and source sequences in machine translation + +![](images/a1fa958aadb8f0f836afe004acb20966c8c8bbb2620e22ff923508be7d0cf139.jpg) +Figure 2: Self-attention distribution on tokens Girl (solid orange) and you (shaded blue). Attention for Girl is concentrated on its representation: its entropy is low. Attention for you is spread: its entropy is high. + +(Graves, 2013; Bahdanau et al., 2015). However, in the Transformer architecture (Vaswani et al., 2017), it has become a means to account for lexical influence and long-range dependencies. It also provides useful information about the importance of a term for the output (Wiegreffe and Pinter, 2019; Brunner et al., 2020; Sun and Marasovic, 2021). Here, we use the notion of attention entropy, and EAR's use of it in BERT. Note, though, that EAR can be used with any attention-based architecture. + +Self-attention in Transformers. The Transformer model consists of two connected units, an encoder and a decoder, designed for sequence-to-sequence tasks. + +A transformer encoder applies scaled-dot product self-attention over the input tokens to compute $N$ independent attention heads. Let $E = [e_0, \dots, e_{d_s}]$ be the sequence of input embeddings, with $e_i \in \mathbb{R}^{d_m}$ . For the $h$ -th attention head and $i$ -th position, each embedding $e_i$ is projected into a query $q_{h,i}$ , a key $k_{h,i}$ and value $v_{h,i}$ . So each token expresses an attention distribution over all input embeddings as + +$$ +a _ {h, i} = \operatorname {s o f t m a x} \left(\frac {\mathbf {q} _ {h , i} ^ {T} K _ {h}}{\sqrt {d _ {k}}}\right) \tag {1} +$$ + +where $K_{h}$ is the matrix of keys and $d_{k}$ their dimension. + +Attention weights $a_{h,i} = [a_{h,i,0},\dots,a_{h,i,d_s}]$ where $a_{h,i,j}\in [0,1]$ and $\sum_{j}a_{h,i,j} = 1$ , can be seen as a soft-indexing over the values. Since the values are projections of the tokens themselves, each weight in self-attention measures the contribution of its token to the attention head and, in turn, to the new token representation. We provide additional details to the self-attention mechanism in Appendix A. + +Attention entropy. Information entropy was first introduced in Shannon (1948), and measures the average information content of a random variable $X$ with the set $[x_0, \dots, x_n]$ of possible outcomes. It is defined as + +$$ +H (X) = - \sum_ {i} P \left(x _ {i}\right) \log P \left(x _ {i}\right) \tag {2} +$$ + +Following Ghader and Monz (2017), we compute the entropy in the self-attention heads by interpreting each token's attention distribution as a probability mass function of a discrete random variable. The input embeddings are the possible outcomes, and the attention weights their probability. + +For the sake of simplicity, we now discuss the computation of attention entropy of a single token in a standard transformer encoder. Attention weights are first averaged over heads by defining $a_{i,j}^{\prime} = \frac{1}{h}\sum_{h}a_{h,i,j}$ as the mean attention that the token at position $i$ pays to the token at position $j$ . Then, we define a probability mass function by applying a softmax operator: + +$$ +a _ {i, j} = \frac {e ^ {a _ {i , j} ^ {\prime}}}{\sum_ {j} e ^ {a _ {i , j} ^ {\prime}}} \tag {3} +$$ + +We define the attention entropy as follows + +$$ +H _ {i} = - \sum_ {j = 0} ^ {d _ {s}} a _ {i, j} \log a _ {i, j} \tag {4} +$$ + +Intuitively, attention entropy measures the degree of contextualization while constructing the model's upper level's embedding. A large entropy suggests that a wider context contributes to the new embedding, while a small entropy tells the opposite: only a few tokens are deemed relevant. From a broader viewpoint, contextualized tokens improve the information passage between continuous layers by re-distributing the information content for every unit involved. + +Figure 2 shows a toy example of self-attention distributions for two arbitrary tokens. Solid orange bars correspond to $a_{\mathrm{Girl},j}$ , while shaded blue bars correspond to $a_{\mathrm{you},j}$ . The toy example illustrates the correlation between attention distributions and entropy. The representation of you uses a wider context and, thus, it has a higher attention entropy. Note that, if present, we discard padding tokens from the attention entropy computation. Conversely, we include special tokens when required by the downstream task. + +![](images/7fd7db2e754567e0302acb893a5e7e60420c67e3095282cf09498a7881e39f98.jpg) +Figure 3: Overview of BERT+EAR. Grey boxes are Transformer layers. Each builds a token with attention entropy $H_{i}^{\ell}$ . Right green box pools layer-wise contextualization contributions and outputs regularization loss. First layer self-attention distribution (bottom) shown for you (shaded blue) and Girl (solid orange). + +EAR in BERT. We introduced attention entropy as a proxy for the degree of contextualization of token representations above. Following this intuition, we propose BERT with EAR mitigation (BERT+EAR), a novel model trained to learn tokens with maximal self-attention entropy over the input sequence. We fine-tune BERT+EAR in the downstream task of hate speech detection. Note, though, that the approach is feasible for any classification task. In classification models, having more contextualized tokens avoids individual terms driving the classification outcome because they got over-attentioned. + +Although EAR is applicable to any Transformer-based model, we base our approach here on the BERT (Devlin et al., 2019) base architecture. BERT provides an informative case study, given the number of architectures it has spawned and the recent interest in its attention patterns (Clark et al., 2019b; Kovaleva et al., 2019; Serrano and Smith, 2019). BERT consists of twelve stacked transformer encoders, each running self-attention on the output of the previous encoder. In BERT+EAR, we build new tokens with the maximal information content coming from the previous layer for every transformer layer in the architecture. Using Equation 4, we first compute the attention entropy of each token in the input sentence. We then take their + +mean and define the average contextualization for the $\ell$ -th layer as + +$$ +H ^ {\ell} = \frac {1}{d _ {s}} \sum_ {i = 0} ^ {d _ {s}} H _ {i} ^ {\ell} \tag {5} +$$ + +where $H_{i}^{\ell}$ is the attention entropy of the token at position $i$ , and $d_{s}$ is the length of the input sequence (excluding the padding tokens but including the [CLS] and [SEP] special tokens). Finally, we introduce a new regularization term to the model loss to maximize the entropy at each layer: + +$$ +\mathcal {L} = \mathcal {L} _ {C} + \mathcal {L} _ {R}, \quad \mathcal {L} _ {R} = - \alpha \sum_ {l} H ^ {\ell} \tag {6} +$$ + +$\mathcal{L}$ is the total loss, $\mathcal{L}_C$ and $\mathcal{L}_R$ are the classification and regularization loss, respectively, and $\alpha \in \mathbb{R}$ is the regularization strength. As in previous work, $\mathcal{L}_C$ is the Cross Entropy loss obtained with a linear layer on top of the last encoder as a classification head. It receives the [CLS] embedding and outputs the probability of the positive class (Hate). + +The new regularization term $\mathcal{L}_R$ frames the task of maximal contextualization learning in the network. This framing has several advantages over existing approaches. First, it is a sum of differentiable terms and is hence differentiable. We can thus optimize BERT+EAR with classical back-propagation updates. Second, the regularization is agnostic to specific identity terms. It instead induces the network to learn contextualized tokens globally. This induction is crucial to regularize biased terms that might not be known in advance. Finally, note that the $\mathcal{L}_R$ pools each layer's entropy-based contributions $H^{\ell}$ . Each term $H^{\ell}$ is in turn dependent on the sole attention entropy defined in Equation 4. This makes the setup a general framework not limited to BERT. $\mathcal{L}_R$ can be used to evaluate and maximize the token contextualization in any attention-based architecture. + +Figure 3 shows a graphical overview of BERT+EAR. Each layer provides a contextualization contributing to the loss independently, where layers with a low average contextualization increase the loss the most. Note also that, similarly to He et al. (2016), $\mathcal{L}_R$ introduces skip connections between layers and the classification head, so shorter paths for the contextualization information to flow. + +Insights from attention entropy. On the one hand, we use attention entropy maximization to + +train BERT+EAR and test its classification and bias mitigation performance. On the other hand, we can leverage attention entropy to automatically extract the tokens with the lowest contextualization, which are the most likely to induce unintended bias. When a sentence is fed through a model like BERT, we can inspect the attention distribution of its terms2. + +We propose to exploit entropy, and hence contextualization, to gain insights into any attention-based model. Given a corpus and a model we want to inspect, we repeatedly query the model with sentences from the corpus and collect each token's attention entropy. Finally, we take each token's mean to measure the impact it has on bias, where lower is worse. Note that the same term can impact bias differently depending on the sentence. + +While our approach works for any attention-based model and data set, we test it on fine-tuned classifiers to extract the biased terms learned on the training data set. We discuss this functionality in Section 5. + +# 3 Experimental settings + +In this work, we consider the problem of unintended bias (Dixon et al., 2018): "a model contains unintended bias if it performs better for comments containing some particular identity terms than for comments containing others". + +Datasets. Unintended bias is measured on synthetic test sets, artificially generated by filling manually defined contexts with identity terms (e.g., I hate all _, I love all ). By construction, each identity term appears $50\%$ of the time in hateful contexts and $50\%$ in non-hateful ones. If a model then classifies the instances related to one identity term differently than the others, it means that the model contains unintended bias towards that term, e.g., if every instance containing the term women is labelled hateful, independently of the context. Synthetic test sets simulate new data, so a model that has low performance on this set demonstrates low generalization abilities and incapacity to be used in real-world contexts and applications. + +We test BERT+EAR on hate speech datasets with associated synthetic test sets to measure unintended bias. + +MISOGNY (EN) (Fersini et al., 2018) is a state-of-the-art corpus for misogyny detection in English. + +
MISOGINY (EN)MISOGINY (IT)MLMA
# Train4,0005,0005082
# Test1,0001,000565
% Validation101010
% Hate (train, test)45, 4647, 5388, 88
\(B_{2}\)0.8580.8520.881
# Synthetic1,4641,90877,000
# Identity terms121850
% Hate (Synthetic)505050
+ +Table 1: Statistics of the data sets. + +The related synthetic test set (Nozza et al., 2019) was created via several manually defined templates and synonyms for "woman" as identity terms. + +MISOGNY (ITA) (Fersini et al., 2020) is the benchmark corpus for misogyny detection in Italian. The synthetic test set has been generated similarly to the English one. This dataset allows us to study EAR's impact on cross-lingual adaptation. + +MULTILINGUAL AND MULTI-ASPECT HATE SPEECH (MLMA) (Ousidhoum et al., 2019) consists of tweets with various hate speech targets. We choose to work on its English part. We use the synthetic test provided in Dixon et al. (2018), generated by slotting a wide range of identity terms into manually defined templates. + +Table 1 reports statistics of the data sets. Alongside the size of train, test, and validation sets, we report also the percentage of hateful instances to show the class balance. Note that MLMA is highly unbalanced with $88\%$ of instances associated with the hateful class. Note that the original MULTILINGUAL AND MULTI-ASPECT dataset comes in a multi-label, multiple class setting. Following Ousidhoum et al. (2021), we used the Hostility dimension of the dataset as target label and created a Hate binary from it as follows. We considered single-labeled "Normal" instances to be non-hate/non-toxic and all the other instances to be toxic. + +To further characterize our data sets, we explore the aspect of selection bias, reporting the measure $B_{2}$ (Ousidhoum et al., 2020). The metric ranges from 0 to 1 and evaluates how likely topics of the data set are to contain keywords of the data collection. Values above 0.7 demonstrate high selection bias, implying the need for unbiaseding procedures. + +We report also the size and number of identity terms used in the synthetic test sets. The percentage of hateful content is perfectly balanced (50%) since each identity term should appear exactly in + +the same context as the others to measure the unintended bias. See Appendix B for the list of identity terms and further preprocessing details. + +# 3.1 Metrics + +We use the weighted and binary F1-score of the hateful class $(\mathbf{F1}_{\mathbf{w}}$ and $\mathbf{F1}_{\mathbf{hate}})$ as classification metrics. We consider both due to the class imbalance of test sets (see Table 1). + +We compute the unintended bias metrics from Dixon et al. (2018) and Borkan et al. (2019). They are computed from differences in the score distributions between instances mentioning a specific identity-term (subgroup distribution) and the rest (background distribution). The three per-term AUC-based bias scores are: + +1) $AUC_{subgroup}$ calculates AUC only on the data subset of a given identity term. A low value means the model performs poorly in distinguishing between hateful and non-hateful comments that mention the identity term. +2) Background Positive Subgroup Negative $(AUC_{bpsn})$ calculates AUC on the hateful background examples and the non-hateful subgroup examples. A low value means that the model confuses non-hateful examples that mention the identity term with hateful examples that do not. +3) Background Negative Subgroup Positive $(AUC_{bnp})$ calculates AUC on the non-hateful background examples and the hateful subgroup examples. A low value means that the model confuses hateful examples that mention the identity with non-hateful examples that do not. + +We report the averaged metrics across identity terms, i.e., $\mathbf{AUC}_{\mathrm{subgroup}}$ , $\mathbf{AUC}_{\mathrm{bpsn}}$ , and $\mathbf{AUC}_{\mathrm{bnsp}}$ .3 + +# 3.2 Baselines + +We compare BERT+EAR against the following existing approaches: (1) BERT (Devlin et al., 2019), (2) BERT+SOC mitigation (Kennedy et al., 2020), where the authors modify BERT's loss to lower the importance weight of identity terms, computed with the Sampling-and-Occlusion (SOC) algorithm (Jin et al., 2019), (3) Nozza et al. (2019), a single-layer neural network architecture based on the Universal Sentence Encoder (USE) representation (Cer et al., 2018), (4) Lees et al. (2020), a multilingual BERT model fine-tuned on the training data, (5) Ousidhoum et al. (2021), a classifier based on TF- + +
Unintended bias (synthetic)test
AUCsubgroupAUCbnpAUCbpsnF1wF1hateF1wF1hate
Nozza et al. (2019), no mitigation49.8349.8349.8349.9751.3372.2971.62
Nozza et al. (2019), debiased50.2750.2150.2145.4029.3171.4369.37
Zhang et al. (2020)69.9962.1962.1943.0166.7031.3563.21
BERT, no mitigation70.9766.6266.6258.1964.6169.6070.21
BERT+SOC mitigation78.1176.6076.6051.8858.8957.3960.47
BERT+SOC mitigation, missing ITs68.5867.3867.3838.4941.3851.1443.65
BERT+EAR80.0875.1875.1862.59▲70.58▲70.90▲70.83▲
Lees et al. (2020), debiased---47.0058.5879.8782.45
Zhang et al. (2020)48.1048.2948.2933.3366.6633.5466.69
BERT, no mitigation47.3047.5447.5439.7261.1781.5783.56
BERT+SOC mitigation, translated ITs45.5445.8845.8846.3451.6280.2881.73
BERT+EAR48.5948.6548.6540.6462.71▲83.29▲84.68▲
Ousidhoum et al. (2021), no mitigation63.8760.8061.1033.3366.6682.8493.80
Zhang et al. (2020)74.1464.7465.7633.3366.6682.8493.79
BERT, no mitigation69.3867.1267.1250.2439.6564.7070.14
BERT+SOC mitigation56.1555.8355.5833.7959.8976.4986.24
BERT+EAR74.3171.4371.2540.0967.45▲83.05▲91.88▲
+ +Table 2: Results (in %) on MISOGYNY (EN) (top), MISOGYNY (ITA) (middle), and MLMA. Significance of BERT+EAR over BERT without mitigation ( $\bullet$ : $p \leq 0.01$ ) and BERT with SOC mitigation ( $\triangle$ : $p \leq 0.01$ ). + +IDF and Logistic Regression, and (6) Zhang et al. (2020), a debiasing training framework based on instance weighting. + +The debiased version proposed in Lees et al. (2020) is obtained by training the model on additional samples from Wikipedia articles (assumed to be non-hateful) to balance the distribution of specific identity terms. Nozza et al. (2019) extracted these additional non-hateful samples from an external Twitter corpus (Waseem and Hovy, 2016). + +To address the impact of different term lists, we also consider two different versions of BERT+SOC mitigation, one where we test the effect of missing identity terms and the other where the identity terms are translated for adapting to a new language. + +# 4 Experimental Results + +Table 2 shows classification and bias metrics on both synthetic and test set for the three corpora, i.e., MISOGNY (EN) (top), MISOGNY (ITA) (middle), and MLMA (bottom). The top rows in each table section report the performance of hate speech detection models specifically proposed for the respective dataset. The lower rows show the results of baselines and BERT+EAR. BERT+SOC mitigation uses the identity terms from Kennedy et al. (2020) (see Appendix C), unless a different identity terms lists is specified (e.g., "BERT+SOC mitigation, translated ITs"). + +BERT+EAR obtains comparable and, in most + +cases, better performance on all three datasets than all state-of-the-art debiasing approaches, which are based on (i) the knowledge of identity terms and (ii) data augmentation techniques. However, identity terms are not always readily available, which severely limits the generalization of those approaches. Similarly, there are several drawbacks to data augmentation with (assumed) non-hateful samples containing the identity terms. 1) Data augmentation is expensive. It requires filtering a large dataset (usually Wikipedia) and retraining the model with a much larger set of instances. 2) Data augmentation with task-specific identity terms requires prior knowledge of those terms, and is therefore limited by the authors' knowledge. 3) The overlap between identity terms in the evaluation set and the augmented data inevitably (but somewhat unfairly) improves the performance on the synthetic dataset. + +BERT+EAR is overall the best debiasing model considering the proposed bias metrics. The only exception is MISOGNY (EN), for which BERT+EAR has lower $\mathbf{AUC}_{\mathrm{bnp}}$ and $\mathbf{AUC}_{\mathrm{bpsn}}$ than BERT+SOC mitigation. The latter's advantage, however, comes with high variability in the results. BERT+SOC mitigation seems more sensitive to random initialization. The standard deviation over 10 runs is $37\%$ , compared to $13\%$ of BERT+EAR. Figure 4 shows the AUCsubgroup metric separately by identity term on MISOGNY (EN). We compare + +![](images/024b2df0bd44550c7c2177a50f63dbcdf52a9335a791781582e368e501cc9b7b.jpg) +Figure 4: $\mathrm{AUC}_{\mathrm{subgroup}}$ results broken down by identity term on MIsOGYNY (EN). + +BERT and BERT+EAR over 10 different initialization runs. EAR improves BERT across all identity terms + +Most existing models and AUC-based metrics for unintended bias focus only on the false positives (i.e., hateful instances wrongly recognized as non-hateful). While correctly recognizing hateful instances is important, we believe that the problem of false negatives is equally important. Since BERT+EAR does not rely on identity term lists, it regularizes terms that impact both the positive and negative class. BERT+EAR obtains an average decrease of $15.04\%$ in false negative rate compared to BERT and BERT+SOC mitigation. Indeed, the performance difference between BERT+EAR vs. BERT and BERT+SOC is mainly due to nonhateful instances ( $\sim 95\%$ of the time). Reducing the impact of overfitting terms like $f^{*}ck$ and $p^{*}ssy$ in MISOGNY (EN) causes BERT+EAR to consider a larger context, and correctly labels them as non-hateful. + +# 4.1 Error Analysis + +Table 3 shows tweets from the MISOGNY (EN) data set which have been correctly predicted by BERT+EAR but misclassified by BERT or BERT+SOC. These tweets serve as qualitative examples of the effectiveness of forcing the model to attend to a wider context and not overfit to training-specific terms, exploiting the richness of information (Nozza et al., 2017). The examples are an excerpt of the most common cases where BERT+EAR classifies the non-hateful examples correctly: (1) when slurs or negative words (such as $sk^{*}nk$ ) are used in a non-hateful context, like slang or lyrics, (2) when many words associated + +with misogyny appear in the sentence (e.g., rape, abuse) and (3) when the hateful target is male and the instance should not be classified as misogynous. The use of a wider context by BERT+EAR allows the model identify such non-misogynous instances compared to BERT and BERT+SOC. In particular, BERT+SOC is even more biased in these cases because its debiasing techniques overly rely on specific terms (e.g. woman) and increase overfitting to training-specific examples. + +# 4.2 Impact of predefined identity terms + +We also analyze the impact of predefined identity term lists on performance by evaluating the effect of (i) missing identity terms, and (ii) adapting to a new language where the list is unavailable. + +First, we remove every identity term of BERT+SOC from MISOGNY (EN) that appears at least once in the evaluation set, here women and woman out of 24 terms. This reflects the real-world case where the identity term list does not contain a specific group present in the data. The significant performance drop resulting from this case (Table 2, top, "missing ITs") highlights a strong weakness of term-based mitigation strategies. + +Second, we analyze the case where identity terms need to be adapted to a new language, e.g., Italian. We translated the English identity terms from BERT+SOC to Italian via Google Translate.4 Table 2 (middle, "translated ITs") shows that the performance is lower than BERT+EAR. A simple translation of predefined identity terms is therefore not an option for cross-lingual settings. This aligns with the findings by Nozza (2021), that demon + +
textGround truthBERTBERT+SOCBERT+EAR
I'm just a sk*nk for understanding the basics of life!0110
You're such a f*cking hoe, I love it - the new Kanye and Lil Pump I kings make women feel comfortable about their sexuality.0110
GIRL, YOU'RE HYSTERICAL. I AM DANCING SO HAPPY FOR TODAY0010
#metoo I'm a victim of rape, abuse and harassment. Every woman who had any these experiences.0110
some people at school drive me insane. like cool b*tch! im depressed too!! doesn't mean im a f*cking c*nt0110
@male_user And you are a hysterical k*nt.0010
@male_user F*ck you p*ssy0110
+ +Table 3: Examples of MISOGNY (EN) tweets misclassified by BERT or BERT+SOC, and correctly classified by BERT+EAR. Next to the tweet text, we report the ground truth label and the prediction of each model. Exact phrasing changed to protect privacy. + +strated that cross-lingual hate speech detection is limited by the use of non-hateful, language-specific taboo interjections that are not directly translatable. + +In sum, we demonstrated that relying on a predefined list of identity terms is a strong limitation for performance and generalizability of the model. In contrast, BERT+EAR's independence from any predefined terms makes it the ideal model in real-world scenarios. + +# 5 Extracting overfitting terms + +While being the core of EAR, attention entropy serves another purpose. Once standard fine-tuning is concluded (i.e., with no regularization involved), models have overfitted specific terms. We identify these terms using attention entropy. + +To extract the most indicative terms, we replicate training conditions. Specifically, we run inference using all the training data using a fine-tuned checkpoint and a standard BERT tokenizer. We collect attention entropy values for each term and average them over all training instances. Terms with lowest average entropy show the highest overfitting as the model learned them with a narrow context. + +Retrieving these terms after training allows us to gain insights into the domain and language-specific aspects driving the outcome. + +Table 4 shows the top 10 terms with highest lexical overfitting on the studied datasets extracted from the corresponding fine-tuned model. We extract terms strongly correlated with the positive + +class, e.g., $\text{womens} * \text{ck}$ (97%), $\text{shut}$ (96%), $\text{n} * \text{gger}$ (92%), $\text{sb} * \text{rro}$ (97%), $\text{c} * \text{lone}$ (95%). Note that these terms are not frequent in the corpus. Overfitting terms appear with an average document frequency of only 4.7%, while the most frequent terms have 32.5% average document frequency across datasets. These results suggest that the higher the class polarization of a token, the narrower the context BERT will use to learn its representation, and the higher the overfitting. + +# 6 Related Work + +The first works to study bias measurement and mitigation in neural representation aimed at removing implicit gender bias from word embeddings (Bolukbasi et al., 2016; Caliskan et al., 2017; Garg et al., 2018; Romanov et al., 2019; Ravfogel et al., 2020). More recently, researchers have started to focus on contextualized sentence representations and effective neural models for understanding the presence and resolution of bias (Nozza et al., 2021; Ousidhoum et al., 2021). + +While the majority of proposed approaches focus on data augmentation (Dixon et al., 2018; Nozza et al., 2019; Sharma et al., 2020; Bartl et al., 2020; de Vassimon Manela et al., 2021), different approaches have been proposed for bias mitigation intervening directly in the objective function. Kennedy et al. (2020) proposed to apply regularization during training to the explanation-based importance of identity terms, obtained with Sampling-and-Occlusion (SOC) explanations (Jin et al., 2019). Kaneko and Bollegala (2021) pro + +
DatasetOverfitting terms
MISOGNY (EN)girls, womens*ck, hoes, c*ck, shut, stupid, hoe, p*ssy, trying, f*ck
MISOGNY (ITA)pezzo, bel, bellissima, scoperei, p*ttanona, zitta, sb*tro, t*ttona, bella, c*lon
(piece, nice, very nice, I'd f*ck, sl*t, shut up, c*m, b*sty, beautiful, fat*ss)
MLMAn*gger, n*gro, shut, chong, ching, d*ke, okay, sp*c, tw*t, f*ggot
+ +Table 4: Terms with highest lexical overfitting identified using attention entropy. + +posed a method for debiasing pre-trained contextual representation by retaining the learned semantic information for gender-related words (e.g., she, woman, he, man) and simultaneously removing any stereotypical biases in the pre-trained model. Zhou et al. (2021) exploited debiasing methods for natural language understanding (Clark et al., 2019a) to explicitly determine how much to trust the bias given the input. Vaidya et al. (2020) proposed a multi-task learning model for predicting the presence of identity terms alongside the toxicity of a sentence. + +The main drawback of all aforementioned works is their strict reliance on a set of predefined identity terms. This list can be either defined manually by experts or extracted a-priori from the data set. In both cases, the subsequent debiasing models will be strongly affected by these biased terms, limiting the applicability of the trained model to new data. This is a severe limitation, since it is not always possible to retrain a model on new data to reduce bias, resulting in limited use in real-world cases. + +# 7 Conclusion + +We introduce EAR, a regularization approach applicable to any attention-based model. Our approach does not require any a-priori knowledge of identity terms, e.g., lists. This feature (i) allows us to generalize to different languages and contexts, and (ii) avoids neglecting important terms. Thus, it prevents the introduction of further bias. As part of the training procedure, EAR also discovers the impact of relevant domain-specific terms. This automatic term extraction provides researchers with an analysis tool to improve data collection and bias mitigation approaches. + +EAR, applied to BERT, reliably classifies data with competitive performance and substantially improves various bias metrics. BERT+EAR generalizes better to new domains and languages than similar methods. + +In future work, we will apply EAR-based models to different downstream tasks to both improve bias mitigation and automatically extract biased terms. + +# Acknowledgments + +We would like to thank the anonymous reviewers and area chairs for their suggestion to strengthen the paper. This research is partially supported by funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (No. 949944, INTEGRATOR), and by Fondazione Cariplo (grant No. 2020-4288, MONICA). DN, and DH are members of the MilaNLP group, and of the Data and Marketing Insights Unit at the Bocconi Institute for Data Science and Analysis. EB is member of the DataBase and Data Mining Group (DBDMG) at Politecnico di Torino. GA did part of the work as a member of the DBDMG and is currently a member of MilaNLP. Computing resources were partially provided by the SmartData@PoliTO center on Big Data and Data Science. + +# Ethical Considerations + +In this paper, we propose term attention entropy as a proxy for unintended bias in attention-based architectures. Our approach allows us to extract, for a given classifier and data set, a list of terms that induce most of the bias in the model. While this list is intuitive and easy to obtain, we would like to point out some ethical dual-use considerations. + +The process of collecting the list is a data-driven approach, i.e., it is strongly dependent on the task, collected corpus, term frequencies, and the chosen model. Therefore, the list might lack specific terms or include terms that do not strictly perpetrate harm, but are prevalent in the sample. Because of these twin issues, the resulting lists should not be read as complete or absolute. We discourage users from developing new models based solely on the extracted terms. We want, instead, the terms to stand as a starting point for debugging and searching for potential bias issues in the task at hand, be it in data collection or model development. + +Further, while the probability is low, we can not exclude the possibility that future users run EAR on other tasks and data sets to derive private information or profile vulnerable groups. + +# References + +Giuseppe Attanasio and Eliana Pastor. 2020. PoliTeam @ AMI: Improving sentence embedding similarity with misogyny lexicons for automatic misogyny identification in Italian tweets. In Valerio Basile, Danilo Croce, Maria Maro, and Lucia C. Passaro, editors, EVALITA Evaluation of NLP and Speech Tools for Italian - December 17th, 2020, pages 48-54. Academia University Press. +Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. +Marion Bartl, Malvina Nissim, and Albert Gatt. 2020. Unmasking contextual stereotypes: Measuring and mitigating BERT's gender bias. In Proceedings of the Second Workshop on Gender Bias in Natural Language Processing, pages 1-16, Barcelona, Spain (Online). Association for Computational Linguistics. +Tolga Bolukbasi, Kai-Wei Chang, James Zou, Venkatesh Saligrama, and Adam Kalai. 2016. Man is to computer programmer as woman is to homemaker? Debiasing word embeddings. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS'16, page 4356-4364, Red Hook, NY, USA. Curran Associates Inc. +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*, WWW '19, page 491-500, New York, NY, USA. Association for Computing Machinery. +Gino Brunner, Yang Liu, Damian Pascual, Oliver Richter, Massimiliano Ciaramita, and Roger Wattenhofer. 2020. On identifiability in transformers. In International Conference on Learning Representations. +Aylin Caliskan, Joanna J. Bryson, and Arvind Narayanan. 2017. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183-186. +Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St. John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, Brian Strope, and Ray Kurzweil. 2018. Universal sentence encoder for English. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 169-174, Brussels, Belgium. Association for Computational Linguistics. +Christopher Clark, Mark Yatskar, and Luke Zettlemoyer. 2019a. 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. +Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. 2019b. 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, Florence, Italy. Association for Computational Linguistics. +Daniel de Vassimon Manela, David Errington, Thomas Fisher, Boris van Breugel, and Pasquale Minervini. 2021. Stereotype and skew: Quantifying gender bias in pre-trained and fine-tuned language models. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2232-2242, Online. Association for Computational Linguistics. +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. +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, AIES '18, page 67-73, New York, NY, USA. Association for Computing Machinery. +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, Brussels, Belgium. Association for Computational Linguistics. +Elisabetta Fersini, Debora Nozza, and Paolo Rosso. 2018. Overview of the EVALITA 2018 Task on Automatic Misogyny Identification (AMI). In Proceedings of Sixth Evaluation Campaign of Natural Language Processing and Speech Tools for Italian. Final Workshop (EVALITA 2018). CEUR-WS.org. +Elisabetta Fersini, Debora Nozza, and Paolo Rosso. 2020. AMI @ EVALITA2020: Automatic Misogyny Identification. In Proceedings of the 7th evaluation campaign of Natural Language Processing and Speech tools for Italian (EVALITA 2020), Online. CEUR.org. +Nikhil Garg, Londa Schiebinger, Dan Jurafsky, and James Zou. 2018. Word embeddings quantify 100 years of gender and ethnic stereotypes. Proceedings of the National Academy of Sciences, 115(16):E3635-E3644. + +Hamidreza Ghader and Christof Monz. 2017. What does attention in neural machine translation pay attention to? In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 30-39, Taipei, Taiwan. Asian Federation of Natural Language Processing. +Alex Graves. 2013. Generating sequences with recurrent neural networks. CoRR, abs/1308.0850. +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. +Vijayasaradhi Indurthi, Bakhtiyar Syed, Manish Shrivastava, Nikhil Chakravartula, Manish Gupta, and Vasudeva Varma. 2019. FERMI at SemEval-2019 task 5: Using sentence embeddings to identify hate speech against immigrants and women in Twitter. In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 70-74, Minneapolis, Minnesota, USA. Association for Computational Linguistics. +Xisen Jin, Zhongyu Wei, Junyi Du, Xiangyang Xue, and Xiang Ren. 2019. Towards hierarchical importance attribution: Explaining compositional semantics for neural sequence models. In International Conference on Learning Representations. +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, Online. Association for Computational Linguistics. +Brendan Kennedy, Xisen Jin, Aida Mostafazadeh Davani, Morteza Dehghani, and Xiang Ren. 2020. Contextualizing hate speech classifiers with post-hoc explanation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5435-5442, Online. Association for Computational Linguistics. +Olga Kovaleva, Alexey Romanov, Anna Rogers, and Anna Rumshisky. 2019. Revealing the dark secrets of BERT. 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 4365-4374, Hong Kong, China. Association for Computational Linguistics. +Alexandre Lacoste, Alexandra Luccioni, Victor Schmidt, and Thomas Dandres. 2019. Quantifying the carbon emissions of machine learning. arXiv preprint arXiv:1910.09700. +Alyssa Lees, Jeffrey Sorensen, and Ian Kivlichan. 2020. Jigsaw@ AMI and HaSpeeDe2: Fine-Tuning a Pre-Trained Comment-Domain BERT Model. In Proceedings of the 7th evaluation campaign of Natural + +Language Processing and Speech tools for Italian (EVALITA 2020), Online. CEUR.org. +Nikita Nangia, Clara Vania, Rasika Bhalerao, and Samuel R. Bowman. 2020. CrowS-pairs: A challenge dataset for measuring social biases in masked language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1953-1967, Online. Association for Computational Linguistics. +Debora Nozza. 2021. Exposing the limits of zero-shot cross-lingual hate speech detection. 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 907–914, Online. Association for Computational Linguistics. +Debora Nozza, Federico Bianchi, and Dirk Hovy. 2021. HONEST: Measuring hurtful sentence completion in language models. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2398-2406, Online. Association for Computational Linguistics. +Debora Nozza, Elisabetta Fersini, and Enza Messina. 2017. A multi-view sentiment corpus. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 273-280, Valencia, Spain. Association for Computational Linguistics. +Debora Nozza, Claudia Volpetti, and Elisabetta Fersini. 2019. Unintended bias in misogyny detection. WI '19, page 149-155, New York, NY, USA. Association for Computing Machinery. +Nedjma Ousidhoum, Zizheng Lin, Hongming Zhang, Yangqiu Song, and Dit-Yan Yeung. 2019. Multilingual and multi-aspect hate speech analysis. 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 4675-4684, Hong Kong, China. Association for Computational Linguistics. +Nedjma Ousidhoum, Yangqiu Song, and Dit-Yan Yeung. 2020. Comparative evaluation of label-agnostic selection bias in multilingual hate speech datasets. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2532-2542, Online. Association for Computational Linguistics. +Nedjma Ousidhoum, Xinran Zhao, Tianqing Fang, Yangqiu Song, and Dit-Yan Yeung. 2021. Probing toxic content in large pre-trained language models. 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 4262-4274, Online. Association for Computational Linguistics. + +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, Brussels, Belgium. Association for Computational Linguistics. +Jing Qian, Mai ElSherief, Elizabeth Belding, and William Yang Wang. 2018. Hierarchical CVAE for fine-grained hate speech classification. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3550-3559, Brussels, Belgium. Association for Computational Linguistics. +Shauli Ravfogel, Yanai Elazar, Hila Gonen, Michael Twiton, and Yoav Goldberg. 2020. Null it out: Guarding protected attributes by iterative nullspace projection. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7237-7256, Online. Association for Computational Linguistics. +Alexey Romanov, Maria De-Arteaga, Hanna Wallach, Jennifer Chayes, Christian Borgs, Alexandra Chouldechova, Sahin Geyik, Krishnamaram Kenthapadi, Anna Rumshisky, and Adam Kalai. 2019. What's in a name? Reducing bias in bios without access to protected attributes. 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 4187-4195, Minneapolis, Minnesota. Association for Computational Linguistics. +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, Florence, Italy. Association for Computational Linguistics. +C. E. Shannon. 1948. A mathematical theory of communication. The Bell System Technical Journal, 27(3):379-423. +Shubham Sharma, Yunfeng Zhang, Jesus M. Ríos Aliaga, Djallel Bouneffouf, Vinod Muthusamy, and Kush R. Varshney. 2020. Data augmentation for discrimination prevention and bias disambiguation. In Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society, AIES '20, page 358-364, New York, NY, USA. Association for Computing Machinery. +Emily Sheng, Kai-Wei Chang, Premkumar Natarajan, and Nanyun Peng. 2019. The woman worked as a babysitter: On biases in language generation. 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 3407-3412, Hong Kong, China. Association for Computational Linguistics. +Anders Søgaard, Anders Johannsen, Barbara Plank, Dirk Hovy, and Hector Martínez Alonso. 2014. + +What's in a p-value in NLP? In Proceedings of the Eighteenth Conference on Computational Natural Language Learning, pages 1-10, Ann Arbor, Michigan. Association for Computational Linguistics. +Kaiser Sun and Ana Marasovic. 2021. Effective attention sheds light on interpretability. In *Findings of the Association for Computational Linguistics: ACLIJCNLP* 2021, pages 4126-4135, Online. Association for Computational Linguistics. +Ameya Vaidya, Feng Mai, and Yue Ning. 2020. Empirical analysis of multi-task learning for reducing identity bias in toxic comment detection. In Proceedings of the International AAAI Conference on Web and Social Media, volume 14, pages 683-693. +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, volume 30. Curran Associates, Inc. +Bertie Vidgen, Tristan Thrush, Zeerak Waseem, and Douwe Kiela. 2021. Learning from the worst: Dynamically generated datasets to improve online hate detection. 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 1667-1682, Online. Association for Computational Linguistics. +Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Yaron Singer, and Stuart Shieber. 2020. Investigating gender bias in language models using causal mediation analysis. In Advances in Neural Information Processing Systems, volume 33, pages 12388-12401. Curran Associates, Inc. +Zeerak Waseem and Dirk Hovy. 2016. Hateful symbols or hateful people? predictive features for hate speech detection on Twitter. In Proceedings of the NAACL Student Research Workshop, pages 88-93, San Diego, California. Association for Computational Linguistics. +Sarah Wegreffe 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, Hong Kong, China. Association for Computational Linguistics. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric 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. +Guanhua Zhang, Bing Bai, Junqi Zhang, Kun Bai, Conghui Zhu, and Tiejun Zhao. 2020. Demographics should not be the reason of toxicity: Mitigating discrimination in text classifications with instance weighting. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4134-4145, Online. Association for Computational Linguistics. +Xuhui Zhou, Maarten Sap, Swabha Swayamdipta, Yejin Choi, and Noah Smith. 2021. Challenges in automated debiasing for toxic language detection. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 3143-3155, Online. Association for Computational Linguistics. + +# A Details on self-attention in Transformers + +The Transformer (Vaswani et al., 2017) is the building block of many recent neural language models. A Transformer model consists of two connected encoder and a decoder units which align a source and a target sequence. Differentiating from the original formulation, large language models, such as BERT, drop the encoder and use the remaining encoder to process a single input sequence. + +A transformer encoder consists of a multi-head self-attention block and a position-wise, fully connected feed forward neural network. Both the self-attention block and the feed forward network adopt a residual skip connection and batch normalization. We provide details for a standard forward pass in the encoder. In attention blocks, the multi-head output is computed with Scaled Dot-Product Attention between a set of queries and keys of dimension $d_{k}$ and a set of values of dimension $d_{v}$ . Let $Q$ , $K$ and $V$ be the respective matrix representations. The attention is then computed as + +$$ +\mathrm {A t t e n t i o n} (Q, K, V) = \mathrm {s o f t m a x} \left(\frac {Q K ^ {T}}{\sqrt {d _ {k}}}\right) V +$$ + +To improve expressiveness, the operation is performed on $N$ different, independent linear projections of the same queries, keys and values, so that $N$ attention heads are produced. The heads are then concatenated, projected back to the original input space, and finally fed through the fully connected neural network to produce the next layer embeddings. Let $E = [e_0,\dots ,e_{d_s}]$ be the sequence of input embeddings $^6$ , with $e_i\in \mathbb{R}^{d_m}$ . In the specific case of a transformer encoder, queries, keys and values correspond to the input embeddings - i.e. $Q = K = V = E$ . As such, the output of the multi-head self-attention block is computed applying the previously presented Equation to the $N$ token projections, concatenating and projecting back to the original space: + +$$ +\operatorname {M u l t i H e a d} (Q, K, V) = \left(\mathrm {o} _ {0} | | \dots | | \mathrm {o} _ {N}\right) W ^ {O} +$$ + +where + +$$ +\mathrm {o} _ {h} = \text {A t t e n t i o n} \left(Q W _ {h} ^ {Q}, K W _ {h} ^ {K}, V W _ {h} ^ {V}\right) +$$ + +and $W^{O}$ and each $W_{h}^{Q}, W_{h}^{K}, W_{h}^{V}$ are projection matrices. + +# B Experimental setup + +Hyper-parameters All our experiments use the Hugging Face transformers library (Wolf et al., 2020). We base our models and tokenizers on the bert-base-uncased checkpoint for English tasks and on the dbmdz/bert-base-italian-uncased checkpoint for Italian. We pre-process and tokenize our data using the standard pre-trained BERT tokenizer, with a maximum sequence length of 120 and right padding. We train all models with the following hyperparameters: batch size=64, learning rate=0.00002, weight decay=0.01, learning rate warmup steps=10%, full precision, maximum number of training epochs=30, and early stopping on non-improving validation loss after 5 epochs. Table 2 report results of BERT+EAR trained for 20 epochs with no early stopping, and regularization strength $\alpha = 0.01$ . We chose the latter parameters with grid search on $\alpha \in [0.0001, 0.001, 0.01, 0.1, 1]$ and epochs $\in [10, 20, 30, 40, 50]$ . When fine-tuning on MULTILINGUAL AND MULTI-ASPECT, we use a weighted cross-entropy classification loss $(\mathcal{L}_C)$ to discount class unbalance. Specifically, we normalize the loss for data points belonging to class $C$ by the prior probability of $C$ , evaluated as its relative frequency in the training set. + +For Kennedy et al. (2020), Nozza et al. (2019), Lees et al. (2020), and Ousidhoum et al. (2021), we kept all the parameters as specified by the respective authors. Please refer to our repository (https://github.com/g8a9/ear) for further details or the respective publications. + +We trained all models with 10 different initialization seeds per parameter configuration and averaged over them to obtain stable results and meaningfully compute significance. + +Statistical significance We compute the statistical significance of BERT+EAR over BERT and BERT with SOC mitigation via bootstrap sampling, following Søgaard et al. (2014), using $\circ$ and $\triangle$ (and their filled counterparts for a stronger significance) symbols, respectively. We use 1000 bootstrap samples and a sample size of $20$ . For Hate Speech, significance can only be computed on F1-scores, since bias metrics require an assumption about the label distribution across identity terms that is not given. + +Selection bias We computed the $\mathbf{B}_2$ metric following Ousidhoum et al. (2020). Specifically, we run the authors' code on each of our training dataset, using the query keywords used to sample each dataset. In case of queries composed of multiple words, we split and considered them separate keywords. + +Dataset preprocessing The original MULTILINGUAL AND MULTI-ASPECT dataset comes in a multi-label, multiple class setting. Following Ousidhoum et al. (2021), we used the Hostility dimension of the dataset as target label and created a Hate binary from it as follows. We considered single-labeled "Normal" instances to be non-hate/non-toxic and all the other instances to be toxic. + +Computation time We report NVIDIA Tesla V100 PCIE-16GB -equivalent computation time for the tested models. Averaging across the three presented data sets, training and evaluating 10 seeds of BERT+EAR (without early stop) requires 22 hours, compared to 72 hours for BERT+SOC and 7 hours for BERT. The regularization of attention entropy does not affect the computation time by a significant amount. + +$\mathrm{CO}_{2}$ emission Experiments were conducted using a private infrastructure, which has an estimated carbon efficiency of $0.432\mathrm{kgCO}_{2}\mathrm{eq / kWh}$ . A cumulative of 319 hours of computation was performed on the hardware of type Tesla V100-PCIE-16GB (TDP of 300W). Total emissions are estimated to be $41.34\mathrm{kgCO}_{2}\mathrm{eq}$ . + +Estimations were conducted using the Machine Learning Impact calculator presented in (Lacoste et al., 2019). + +# C List of identity terms + +In the following, we report the list of identity terms used in the considered data sets and methods. + +(Kennedy et al., 2020): muslim, jew, jews, white, islam, blacks, muslims, women, whites, gay, black, democrat, islamic,allah,jewish, lesbian, transgender race,brown,woman,mexican,religion, homosexual, homosexuality,africans + +(Nozza et al., 2019): woman, women, daughter, girl, girls, mother, she, wife, lady, ladies, girlfriend, sister + +(Fersini et al., 2020):onne, matrone, mamme, casalinghe, compagne, mo + +rose, femmine, donne, fidanzate, nonna, matrona, casalinga, morosa, femmina, mamma, donna, fidanzata, compagna + +(Dixon et al., 2018): lesbian, gay, bisexual, transgender, trans, queer, lgbt, lgbtq, homosexual, straight, heterosexual, male, female, nonbinary, african, african american, black, white, european, hispanic, latino, latina, latinx, mexican, canadian, american, asian, indian, middle eastern, chinese, japanese, christian, muslim, jewish, buddhist, catholic, protestant, sikh, Taoist, old, older, young, younger, teenage, millenial, middle aged, elderly, blind, deaf, paralyzed \ No newline at end of file diff --git a/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/images.zip b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f2d6344c5fc63e18c28ab5a56a58aacba66e69e6 --- /dev/null +++ b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:472c72c6f9a32b9fdb182eee8bc0efda730d0afc4f7c4fed6dee9db28e1df646 +size 389366 diff --git a/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/layout.json b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6bf3e495b7eaddec2e9d4bea43edd5e6f8ba5368 --- /dev/null +++ b/entropybasedattentionregularizationfreesunintendedbiasmitigationfromlists/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7b0f7e0401650f11496d133165ffecd4bf781811de0e4e8e3bf0c06eb7f0f02 +size 446570 diff --git a/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_content_list.json b/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6f1fb5aaeab86d7b3a72926e88a94ef22acb0dfc --- /dev/null +++ b/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9286ad4e3feab893818f81ae726b73d8cf889a882c24f4f80cbee236106eff69 +size 99203 diff --git a/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_model.json b/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_model.json new file mode 100644 index 0000000000000000000000000000000000000000..089d1e3772ca6a686735fa22bfd4f026e345319e --- /dev/null +++ b/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29008f7abcf4f2b1426696091938d778fd5679008cba37e9389e17cfa71e3008 +size 122651 diff --git a/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_origin.pdf b/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8ca55e604a1cda7c2d6188c7be01a7415a29e867 --- /dev/null +++ b/eventtransitionplanningforopenendedtextgeneration/f6776941-6b61-4512-9543-e06c24f81d83_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62ae3a9124f6fa13deaa61f3f5a1b8bfccf21ffac980c6077de092e254beb82d +size 705648 diff --git a/eventtransitionplanningforopenendedtextgeneration/full.md b/eventtransitionplanningforopenendedtextgeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..de94202c187b1f633654e7c0453333cb545c62fe --- /dev/null +++ b/eventtransitionplanningforopenendedtextgeneration/full.md @@ -0,0 +1,423 @@ +# Event Transition Planning for Open-ended Text Generation + +Qintong Li $^{\text{♥}}$ Piji Li $^{\text{♣}}$ Wei Bi $^{\text{♣}}$ Zhaochun Ren $^{\diamond}$ Yuxuan Lai $^{\text{♥}\dagger}$ Lingpeng Kong $^{\text{♥}\text{♣}}$ + +Department of Computer Science, The University of Hong Kong + +Tencent AI Lab Shandong University + +$\spadesuit$ Shanghai Artificial Intelligence Laboratory + +qtli@connect.hku.hk + +{lipiji.pz, erutan.pkuicst}@gmail.com + +victoriabi@tencent.com, zhaochun. ren@sdu.edu.cn + +lpk@cs.hku.hk + +# Abstract + +Open-ended text generation tasks, such as dialogue generation and story completion, require models to generate a coherent continuation given limited preceding context. The open-ended nature of these tasks brings new challenges to the neural auto-regressive text generators nowadays. Despite these neural models are good at producing human-like text, it is difficult for them to arrange causalities and relations between given facts and possible ensuing events. To bridge this gap, we propose a novel two-stage method which explicitly arranges the ensuing events in open-ended text generation. Our approach can be understood as a specially-trained coarse-to-fine algorithm, where an event transition planner provides a "coarse" plot skeleton and a text generator in the second stage refines the skeleton. Experiments on two open-ended text generation tasks demonstrate that our proposed method effectively improves the quality of the generated text, especially in coherence and diversity. The code is available at: https://github.com/qtli/EventPlanforallGen. + +# 1 Introduction + +With the fast development of large-scale pre-trained models, considerable progress has been made in improving the quality of machine generated text (Radford et al., 2019; Rashkin et al., 2019a; Zhang et al., 2020b; Brown et al., 2020; Guan et al., 2021; Bakhtin et al., 2021). Today, machine learning models can do extremely well in generating text that looks human (Clark et al., 2021). The problem is still far from solved, however, as further reading of the machine-generated text often exposes defects such as self-contradiction and topic drifting (Bisk et al., 2020; Gao et al., 2020; Tan et al., + +![](images/00796d78be30d5a866eac9c69efe38e0b5ec61a3a8327896b576cb154c50574a.jpg) +Figure 1: An illustration of our planning based framework in story completion task. Given story context, we extract corresponding event transition path, and use model EP to develop potential ensuing event transition paths. The planned paths accordingly guide the path-aware text generation model PG. + +2021; Fan et al., 2019; Dou et al., 2021; Dziri et al., 2021). These issues are particularly serious in open-ended text generation tasks (e.g., story completion), where the model is asked to produce a coherent continuation which often involves multiple events, given limited preceding context. + +To bridge this gap, we propose a two-stage method which explicitly models the event transitions in open-ended text generation. Multi-step generation has been adopted to control the generated content at a high level (Dong and Lapata, 2018; Ji et al., 2020; Xu, 2021). Different from previous works that rely on inflexible pattern retrieval, we leverage a generative model as an event transition planner in the first stage to boost the high-level coherence and causalities in open-ended text generation. + +Specifically, in stage one, an event transition planner (§3.1) outlines a transition path of events starting from the ones extracted from the input context. In stage two, this path is used to ensure a relevant and sound continuation from the actual text generator (§3.2). This method can be understood as a specially-trained coarse-to-fine algorithm, where + +
Dialogue GenerationStory Completion
Input Context — Events[1] my husband lost a job but i'm hop-ing he can find a full time job soon. — my husband lost job, I hope he find job [2] He will, I have faith. — I have faith [3] thank you so much! — thank you[1] John got laid off from his company. — john get laid off [2] He was close to retirement age. —john is close retirement [3] John felt bored and listless his first week of unemployment. —john feel bored and listless [4] John decided to start a business of his own. —john decide start business
Target Output — EventsNo problem. What kind of work does he do? — what work he doHe now has a flourishing online company. — john have a company
Event Transition Pathmy husband lost jobXATTRi hope he find job OREACTjohn get laid offXATTRjohn is close to retirement XREACT
thank you OREACTwhat work he doXREACTjohn feel bored and listless XREACT
decide start business XEFFECTjohn have a company
+ +Table 1: Examples of event transition paths acquired from downstream tasks, i.e., dialogue generation and story completion. Events are marked in blue box. + +an event transition planner provides a "coarse" plot skeleton and a path-aware text generator refines the skeleton. Figure 1 shows an illustration of our approach. + +There are two main challenges in this method. First, the planer should produce high-quality and diverse paths that can generalize well to the unseen events at test time. For this challenge, we fine-tune a GPT-2 (Radford et al., 2019) on a large amount of event paths extracted from commonsense graphs (Sap et al., 2019), as well as from the training set of the specific task, aiming to extrapolate to event sequences that never appeared in these sources with the help of general knowledge stored in the large pre-trained model (Petroni et al., 2019; Lee et al., 2021). + +For the second challenge, the auto-regressive text generator need to work effectively under the supervision of the even transition path. We thus design an event query layer to absorb information from the planned paths and use the query layer to guide the text generation process. + +We validate our method thorough extensive experiments on two standard open-ended text generation tasks, dialogue generation (Rashkin et al., 2019b) and story completion (Mostafazadeh et al., 2016). Our two-stage approach outperforms a strong knowledge enhanced GPT-2 baseline (Guan et al., 2020a) in both automatic and human evaluation metrics. Further analysis shows that the improvements of the event transition planning model come in particular from the high-level consistency and diversity in long and difficult generation cases. + +# 2 Event Transition Path. + +In this work, the event transition path is defined as an alternating sequence between events and relations, where an event is a subject-verb phrase, a relation is chosen from a pre-defined label set (e.g., OREACT - object reaction; XATTR - subject attribute) of a commonsense atlas (Sap et al., 2019). Table 1 shows some text examples and their corresponding event transition paths. We collect event transition paths from a commonsense atlas ATOMIC (Sap et al., 2019), as well as from the training set of the specific task, to train an event transition planner. + +Sampling Paths from ATOMIC. We use everyday commonsense atlas ATOMIC (Sap et al., 2019) to acquire plenty event paths. ATOMIC is organized through 9 relations and 877k events (textual descriptions) of inferential commonsense, e.g., if "PersonX pays PersonY a compliment", then "PersonY will likely return the compliment". It has been demonstrated that ATOMIC is useful for open-ended text generation tasks, such as story generation (Guan et al., 2020b). + +Besides, to increase the flexibility, we introduce a reverse relation (e.g., _XATTR) for each original relation (e.g., XATTR) so that a sampled path can contain reverse triplets. The intuition is that, in open-ended text generation, the narrative maybe in a reverse order. After explaining the event A, the author may want to introduce the subsequent event B. Meanwhile, if the author introduce the event B first, she/he may want to describe the event A as an explanation for the reason/motivation. + +Finally, we collect sufficient event paths of variant lengths from ATOMIC via random walk + +![](images/03c422080a3fa2d5adccbf58fc63d82deb979a1570f3db099dd9ddabfad3f4aa.jpg) +Figure 2: Overall architecture of the proposed coarse-to-fine framework. It consists of two components. (1) Event Transition Planner: given a input context, it first extracts corresponding event path and then generates possible ensuing event path. The planner directly inherits the pre-trained parameters from GPT-2; (2) Event-path-aware Text Generator: another GPT-2-based generator is applied to generate a natural language sentence by attending to input context and explicit event transition path. + +ing1. We split the sampled paths into training/validation/test with the ratio of 18:1:1. We use these sampled paths to optimize the event transition planner which is responsible for generative event planning (see §3.1). The statistics of sampled paths are shown in Table 6 of Appendix A. We display several examples of the randomly sampled event transition paths in Table 7 of Appendix A. + +Extracting Paths from Specific Dataset. We use two kinds of event transition paths. A general kind is obtained from random walking on a daily commonsense graph, ATOMIC, as mentioned above. Another kind is extracted from the natural language instances of downstream datasets, which is used for the training and prediction stage of task-specific event planning. For example, given the inputs, "When the bride and groom entered, the audience cheered", the extracted event path is "bride and groom enter OFFECT audience cheer". + +In detail, for each sentence, to ensure the extracted events have complete semantics and keep a similar format with the events in ATOMIC, we use ASER event extractor tool $^2$ to distil events for all sentences of downstream datasets. We further predict the relations between these events, linking these isolated events as event transition paths. Specifically, we train a BERT (Devlin et al., 2019) classifier using event triples and relations in ATOMIC. The sizes of training/validation/test + +instances are 639,045/35,503/35,502, respectively. We finally achieve a accuracy score of $85\%$ on the test set for the relation prediction. + +# 3 Methodology + +We focus on the conditional language modeling problem in open-ended text generation tasks. Formally, given an input context $\mathbf{x}$ , models are required to generate a sentence $\mathbf{y}$ that is consistent with input context and not contradicts itself. + +In this work, we propose a two-stage model for the generation process. In the first stage, we extract the starting event sequence $\boldsymbol{r}_x$ from the input context and employ the event transition planer to generate subsequent event transition path $\boldsymbol{r}_y$ based on $\boldsymbol{r}_x$ . In the second stage, the output text is generated from an auto-regressive model conditioning on the path and the preceding context $\boldsymbol{x}$ . + +Figure 2 gives an overview of our coarse-to-fine framework for open-ended text generation. In a nutshell, we first fine-tune a GPT-2 on event transition sequences as an event planner (i.e., a conditional generative model for event paths). This fine-tuning involves event transition sequences extracted from both commonsense graphs and the training set. We then build a path-aware text generator with an event query layer specifically designed to refer to the planned path when generating the output. + +# 3.1 Generative Event Transition Planner + +In this section, we describe the event transition planner which completes the partial event path + +given certain input context. Pre-trained language models can be good representation learners of relational knowledge (Petroni et al., 2019; Bosselut et al., 2019). In our model, we choose GPT-2 (Radford et al., 2019) as the backbone of our event transition planner. + +Specifically, we first fine-tune GPT-2 with large-scaled event transition paths sampled from ATOMIC (Sap et al., 2019). After that, we fine-tune the resulting model in addition on the event transitions extracted from the training corpus, so that the planner is aware of general transitions in the commonsense while focusing on the transitions in the specific domain in the meantime. + +In preliminary experiments, we find that directly running a full fine-tuning (i.e., updating all GPT-2 parameters) leads to a drop in the final performance. We suspect the reason is the full fine-tuning flushes out the original general knowledge from the largescale pre-training (Chen et al., 2019; Lee et al., 2020; Chen et al., 2020). + +To overcome this drawback, we pretend a trainable continuous event prompt $\mathbf{z}$ to the input path $\mathbf{r} = [r_x; r_y]$ of every transformer layer in event transition planner, as prefix-tuning (Li and Liang, 2021) does. A trainable matrix $\mathbf{U}_{\theta}$ with parameters $\theta$ is randomly initialized to embed event prompt $\mathbf{z}$ . The aim is to use parameters $\theta$ introduced by $\mathbf{z}$ to store event transition patterns from ATOMIC. Then the representation of each input event transition path $\mathbf{r}$ is prompted as $\mathbf{r}' = [z; r]$ . To increase training speed and performance robustness, we apply an additional linear reparameterization function on $\mathbf{U}_{\theta}$ . + +$$ +\mathbf {U} _ {\theta} = F F N _ {\theta} \left(\mathbf {U} _ {\theta} ^ {\prime}\right), \tag {1} +$$ + +where $U_{\theta}^{\prime}$ is another randomly initialized matrix with smaller dimension, $FFN$ is a large feedforward neural network (Vaswani et al., 2017). We perform gradient updates on the following log-likelihood objective: + +$$ +\begin{array}{l} \max _ {\theta} \log \left(\boldsymbol {r} _ {y} \mid [ \boldsymbol {z}; \boldsymbol {r} _ {< y} ]\right) = \\ \sum_ {y \in \mathbf {z} _ {\mathrm {i d x}}} \log E P _ {\phi , \theta} (\mathbf {r} _ {y} \mid \mathbf {h} _ {< y}), \tag {2} \\ \end{array} +$$ + +where $\phi$ denotes the pre-trained parameters from the backbone LM of event transition planner, $\theta$ denotes the newly introduced parameters for the event prompt, $z_{\mathrm{idx}}$ denotes the index sequence of the event prompt, $EP$ is short for event transition + +planner, and $\mathbf{h}_{< y}$ denotes the hidden states calculated by the trainable event prompt matrix and activation layers of the backbone LM: + +$$ +\mathbf {h} _ {y} = \left\{ \begin{array}{l l} \mathbf {U} _ {\theta} [ y, : ], & \text {i f} y \in \mathbf {z} _ {\mathrm {i d x}}, \\ \boldsymbol {L M} _ {\phi} (\boldsymbol {r} _ {y} \mid \mathbf {h} _ {< y}) & \text {o t h e r w i s e .} \end{array} \right. \tag {3} +$$ + +Similar to the above event prompting technique, for the paths from downstream dataset, we pretend another event prompt $z^{\prime}$ to the $r^{\prime}$ and only optimize the parameters introduced by $z^{\prime}$ . This effectively preserves the newly-learned event transition patterns from ATOMIC and continuously adapts the event transition planner to different downstream event transition patterns. + +# 3.2 Event-path-aware Text Generation + +Current state-of-the-art systems for open-ended text generation are based on fine-tuning pretrained language models with different downstream datasets. Although text generation fluency is usually not a crucial issue nowadays, topic-related mistakes (Dou et al., 2021) such as off-prompt and self-contradiction are common. We therefore integrate the event transition paths produced by the planner into the text generation model via an event query layer using the multi-head attention mechanism (MHA). + +The event query layer is built on top of the stacked transformer layers, aiming to explicitly induce the expected output with event transition paths. The input of the event query layer is the event transition path $\mathbf{r}$ given the current input $\mathbf{x}$ . $\mathbf{r}$ not only summarizes the event transition in $\mathbf{x}$ , also indicates possible event path following $\mathbf{x}$ . The structure of the event query layer resembles the transformer layer. Its output serves as the key and value vectors in the multi-head attention mechanism, which computes another attention vector $MHA(\mathbf{r})$ . We concatenate two multi-head attention vectors and derive the final event-path-aware attention vector $\mathbf{m}$ : + +$$ +\mathbf {m} = M L P \left(\left[ M H A (\boldsymbol {x}); M H A (\boldsymbol {r}) \right]\right), \tag {4} +$$ + +where $MHA(\boldsymbol{x})$ is the output from the multi-head attention function of the original transformer layer, $MHA(\boldsymbol{r})$ is the output from the event query layer. The event-path-aware attention vector $\mathbf{m}$ replaces the original multi-head attention vector $MHA(\boldsymbol{x})$ and participates the remaining calculation of the language model. + +The optimization of the event-path-aware text generator is the standard cross-entropy objective: CrossEntropy $(\mathbf{y}_j\mid \mathbf{y}_{< j},\mathbf{x},\mathbf{r})$ + +# 3.3 Implementation Details + +We base our event planner and event-plan-aware text generator on pre-trained GPT-2-small models3. The event prompt length during training ATOMIC event transition paths are set to 5 according to pilot study. We inject and optimize the event query layer on the last layer of the stacked Transformers. When training the event-path-aware text generator, event path $r_y$ is derived from the ground truth. During inference, $r_y$ is the prediction from event transition planner given the input event transition path $r_x$ . More details are elaborated in Appendix B. + +# 4 Experiments + +We conduct experiments on two open-ended text generation tasks, dialogue generation and story completion, to answer the following questions: + +- RQ1: How to develop a better event transition planner? +- RQ2: Whether the integration of event transition paths enhances the open-ended text generation? +- RQ3: How do the event transition paths benefit text generation? + +# 4.1 Evaluated Tasks + +- Story Completion requires models to complete a story given the first few sentences. We evaluated our framework on ROCSTORIES (Mostafazadeh et al., 2016), which contains 98k five-sentence stories. Our default setting is to predict the last sentence given the first four ones. +- Dialogue Generation aims to generate reasonable and human-like responses given the dialogue history. We evaluated our framework on EMPATHETICDIALOGUES (Rashkin et al., 2019b) which consists of $25\mathrm{k}$ conversations grounded in prespecified situations. + +# 4.2 Event Transition Planning (RQ1) + +We compare our event transition planner, named as PLANGGeneration, with fine-tuned pre-trained GPT-2 (Radford et al., 2019) and several ablation settings, investigating how to develop a better event transition planner. + +Specifically, the compared settings include: + +- GPT-2 is a pre-trained GPT-2 model (Radford et al., 2019) directly fine-tuned on the event paths extracted from specific tasks, i.e., dialogue generation or story completion in our work. +- PLANGGeneration is our proposed event planning method, which explores a two-stage finetuning on event transition paths from ATOMIC (Sap et al., 2019) and the downstream task, equipping with the proposed event prompting module. +- w/o PROMPT is our proposed method without the event prompting module, but still using the two-stage fine-tuning strategy. +- w/o TUNING ON ATOMIC is our proposed method without the first-stage fine-tuning on the event paths extracted from external commonsense atlas ATOMIC. +- PLANRETRIEVAL is a retrieval based planning methods, which employs the BM25 ranking function (ROBERTSON et al., 1995) to retrieve from the paths extracted from the training sets according to the given context. + +Results. We use BLEU (Papineni et al., 2002) and DIST (Li et al., 2016) as the automatic metrics to evaluate the generated sentences in terms of the coherence and diversity, respectively. BLEU evaluates $n$ -gram overlap between generation and ground truth. BLEU scores will become extremely low for large $n$ . We thus experiment with $n \in \{1,2,4\}$ . DIST measures the ratio of distinct $n$ -grams to all the generated $n$ -grams from the perspective of the generation diversity. For DIST metric, we adopt $n \in \{1,2\}$ . The experimental results are shown in Table 2. The dataset needed in this section consists of event transition paths sampled from ATOMIC and extracted from downstream datasets. i.e., ROCSTORIES and EMPATHETICDIALOGUE. The details of event transition paths are shown in §2 and Appendix A. + +On both dialogue generation and story completion tasks, our proposed PLANGENERATION greatly outperforms baseline GPT-2 on event planning coherence (BLEU) and event path diversity (DIST). Specifically, on two downsteam tasks, our event transition planner PLANGENERATION surpasses the fine-tuned GPT-2 by 3.09 and 3.53 on BLEU-1, 0.31 and 0.30 on DIST-1. This improvement indicates that (1) the two-stage event prompting module could endow event transition planner powerful abilities on predicting the ensuing event paths; (2) enhanced with the large-scale event transition patterns from ATOMIC, our event transition + +
TasksMethodsBELU-1BLEU-2BLEU-4DIST-1DIST-2
Dialogue GenerationGPT-223.4311.503.311.574.18
PLANGENERATION (Ours)26.5212.383.291.885.52
w/o PROMPT23.5811.853.581.805.13
w/o TUNING ON ATOMIC19.827.901.811.162.54
PLANRETRIEVAL0.750.140.0013.0539.52
Story CompletionGPT-215.987.191.085.5317.44
PLANGENERATION (Ours)19.519.011.355.8317.48
w/o PROMPT13.646.141.124.7115.77
w/o TUNING ON ATOMIC12.744.610.476.0812.27
PLANRETRIEVAL1.280.150.0011.8837.70
+ +Table 2: Experimental results on event transition planning. For detailed description about the compared models, please refer to §4.2. + +planner becomes more creative and produces more diverse outcomes. + +Considering the ablation settings, without tuning on ATOMIC (w/o TUNING ON ATOMIC) or without the event prompting module (w/o PROMPT), the method performs worse on both tasks and across almost all metrics. The limited performance of w/o TUNING ON ATOMIC suggests the necessity and effectiveness of learning general event transition patterns from ATOMIC before optimizing on task-specific event paths. Tuning on ATOMIC event patterns could make event transition planner get familiar with the event-path-like language and generalize well on unseen event patterns. Compared to ablation model w/o PROMPT, EVENTPLANNING is comparatively more effective. This is because when optimizing on event paths of target tasks, the proposed event prompt protects the parameters of pre-trained language model from drastic change when training with event transition paths. This comparison confirms our intuition that event prompting module could improve event planning performance without destroying the eventual commonsense stored in pre-trained parameters. It provides a more flexible approach to blend the event transition patterns in both ATOMIC and specific tasks with the pre-trained GPT-2 model. + +We also attempt a variation of our PLANGENERATION method, i.e., PLANRETRIEVAL. We can see that the BELU scores of PLANRETRIEVAL are substantially lower than the generation based methods. The main reason is that the target event paths are flexible, infinite, and task-related. Many transition patterns are not seen in the training data or external commonsense graph. + +# 4.3 Event-path-aware Text Generation (RQ2) + +In this section, we compare our overall framework EP-PG with several baselines to investigate whether the integration of generative event transition paths benefits the open-ended text generation. + +We consider the following settings: + +- GPT-2 is a pre-trained GPT-2 model (Radford et al., 2019) fine-tuned on the task-specific dataset. +- GPT-2-CS-FT is a commonsense-enhanced GPT-2 model. By following Guan et al. (2020b), we conduct a first-stage post-training on the ATOMIC commonsense triples and then fine-tuning on task-specific dataset. +- EP-PG is our proposed framework, which is a fine-tuned GPT-2 model integrated with the event transition path produced from event transition planner PLANGeneration via an event query layer. +- R-EP-PG is another version of EP-PG to explore the proposed event query layer. The input event transition paths are produced by PLANRETRIEVAL in a retrieval way. + +Results. We consider the same evaluation metrics as in §4.2. As demonstrated in Table 3, EP-PG achieves the most satisfying performance among all settings on both tasks4. Integrated with the explicit guidance of the event transition paths, EP-PG produces more accurate open-ended generations with higher diversity. + +Particularly, our proposed framework EP-PG consistently and significantly improves GPT-2 baseline for all tasks on content quality (BLEU) and diversity (DIST), showcasing the advantage of injecting event query layer on fine-tuned GPT-2. Without the explicit modeling of event transition + +
TasksModelsBLEU-1BLEU-2BLEU-4DIST-1DIST-2
Dialogue GenerationGPT-216.076.412.132.067.70
GPT-2-CS-FT (Guan et al.)16.436.832.312.168.28
R-EP-PG16.686.712.272.218.44
EP-PG (Ours)16.746.942.392.198.25
Story CompletionGPT-225.039.582.708.3831.33
GPT-2-CS-FT (Guan et al.)25.099.642.728.0730.68
R-EP-PG24.729.272.637.0126.49
EP-PG (Ours)25.479.712.748.9934.48
+ +Table 3: Results of experiments on open-ended text generations. For detailed information about each compared model, please refer to §4.3. + +paths, GPT-2-CS-FT which post-trains on commonsense triples only obtains a slight improvement or even performs comparable with GPT-2 model. EP-PG further improves generation performance from GPT-2-CS-FT across all metrics on the two tasks, highlighting the efficacy of long-range event planning via an additional event query layer. + +Particularly remarkable are the relative differences between R-EP-PG and EP-PG. Although R-EP-PG manages to bring generations more diversity, but in most cases, EP-PG is more effective on content planning and informativeness due to generative event transition patterns in higher qualities. Moreover, R-EP-PG performs even worse than GPT-2 on story completion. This implies that low-quality event paths even damage the generations. Thus, a reliable event path is a key guarantee for effective downstream text generation. + +# 4.4 Analysis: Event Transition Planning for Different Generation Scenarios (RQ3) + +To further investigate how do the event paths benefit text generation, we analyse the effectiveness of event paths on differently difficult levels of generation, i.e., token-level and sentence-level. + +Token-level. We first separate the test set into 5 groups according to the averaged target sentence lengths, and then observe the improvements of our proposed EP-PG over GPT-2 on BLUE-1 score. We find that our framework gains more on the longer instances in both story completion (from 0.4 to 1.3 on instances with more than 15 non-stop-words) and dialogue generation (from 0.3 to 0.9 on instances with more than 5 non-stop-words). We argue that the longer targets imply more sophisticated upcoming event transitions, where the guidance from the event transition planner becomes more important. + +![](images/4b11990dd3347470596cc7af19e8bb9d3b97ed17ea7929cbc63d236887d18036.jpg) +Figure 3: The log of BLEU-1 scores on story completion with different numbers of sentences as input. + +Sentence-level. For story completion on five-sentence story dataset ROCSTORIES, we further conduct experiments on EP-PG with various input sentences and output sentences, i.e., the numbers of input (output) sentence are 1 (4), 2 (3), 3 (2), and 4 (1), respectively. Figure 3 shows that, compared to GPT-2, the relative improvement proportion of EP-PG is nearly doubled on the most difficult setting where there is only one sentence as input. This improvement is much larger than the easiest situation where 4 sentences are input to the model. Despite less input context, EP-PG with event transition planning manages to perform better with smaller performance drop. + +# 4.5 Human Evaluation + +We set up a human evaluation as a complementary evaluation beyond automatic evaluation. For both tasks, we randomly select 100 samples from test set. For each sample, we compare three pairs of models: EP-PG versus GPT-2, GPT-2-CS-FT, and R-EP-PG. Each comparison is rated by three crowd workers, who are asked to give a preference (win, lose or tie) from two perspectives: + +
TasksModelsCoherenceDiversity
WinLoseTieκWinLoseTieκ
Dialogue GenerationOurs vs. GPT-245%11%44%0.29071%10%19%0.226
Ours vs. GPT-2-CS-FT34%10%56%0.28654%7%39%0.288
Ours vs. R-EP-PG32%8%60%0.47267%11%22%0.291
Story CompletionOurs vs. GPT-245%12%42%0.39759%10%31%0.220
Ours vs. GPT-2-CS-FT47%17%36%0.38756%17%27%0.210
Ours vs. R-EP-PG43%17%40%0.39361%6%33%0.340
+ +Table 4: Manual evaluation results on downstream text generation. The scores indicate the percentages of Win, Lose or Tie when our model is compared with other baselines. $\kappa$ denotes Fleiss' kappa (all are fair agreement or moderate agreement). + +- Coherence. It indicates whether the inference is natural, relevant, and follows logically from the given context. +- Diversity. Particularly, for baseline models, we use beam search decoding with a top- $k$ ( $k = 5$ ) sampling scheme (Fan et al., 2018) and a softmax temperature $\tau$ ( $\tau = 0.7$ ) to generate three inferences per sample. For our method EP-PG, its event transition planner first predicts three paths via the same beam decoding, then its text generator uses greedy decoding based on the generated three paths to produce three inferences per sample. During pair-wise comparison, we ask annotators to evaluate which model's predictions contain more reasonable and coherent event transition patterns. + +The two aspects are independently evaluated and results are shown in Table 4. According to human evaluations, our proposed EP-PG significantly outperforms compared baselines in terms of both criteria on the test set of all datasets. Overall inter-rater agreement measured by Fleiss' kappa (Fleiss, 1971) and all the results show fair agreement $(0.2 \leq k \leq 0.4)$ or moderate agreement $(0.4 \leq k \leq 0.6)$ . The results indicate that explicit incorporating event transition patterns yields significant improvement in generating coherence texts given the input context. Specifically, with guidance from different event transition paths, our method could produce more diverse and reasonable inferences. + +# 4.6 Qualitative Study + +Table 5 illustrates how our model tends to produce more contentful and coherent predictions compared to the other systems. In this story completion case, the generated event path successfully captures the correlations between working out and pass physical test, which further helps our model produce the most reasonable output, Alex was able to pass + +# Story Context: + +Alex was in training to be a police officer. + +He was not in the best shape. + +Alex failed the physical assessment. + +Alex started working out. + +# Golden Event Path: + +XEFFECT he take the test again XEFFECT he pass + +# Retrieved Event Path: + +wants to be best police officer XWANT tells person to stop + +# Generated Event Path: + +XEFFECT Alex able get good shape XEFFECT Alex able pass physical test + +# Reference: + +He took the test again and passed. + +# PT-2: + +Alex was able to get a good job. + +# GPT-2-CS-FT: + +Alex made the squad. + +# R-EP-PG: + +Alex was able to become a police officer. + +# EP-PG: + +Alex was able to pass the physical exam. + +Table 5: Case study on story completion. The three sections from top to bottom are the input context, the event transition plans, and inferences from our model and baseline models, respectively. + +the physical exam. For the baseline without commonsense knowledge, GPT-2, is instead not related to the core context failed the physical assessment. Tuning on commonsense atlas ATOMIC, GPT-2-CSFT produces informative inference but contradicts the context. The retrieval-based model R-EP-PG searches a related event transition police officer. However, its flexibility is limited by search space and cannot maintain a long-range event path, which is easy to produce hallucinated inference. More case analysis are stated in the Appendix C. + +# 5 Related Work + +Recent advances in pre-trained language models have resulted in impressive performances on open-domain text generation, such as story com + +pletion (See et al., 2019; Yao et al., 2019; Fan et al., 2019; Ippolito et al., 2020), dialogue generation (Rashkin et al., 2019b; Zhang et al., 2020b; Li, 2020; Vulic et al., 2021), question generation (Cheng et al., 2021; Wang et al., 2021), and so on. For example, in dialogue generation, Zhang et al. (2020b) design a trainable generative pretrained transformer by training an autoregressive language model on large-scale Reddit context-response pairs with a maximum mutual information scoring function to improve diversity. Goldfarb-Tarrant et al. (2020) integrate semantic role labels and prompts into pre-trained BART (Lewis et al., 2020) during fine-tuning for prompt based story telling. In this paper, we focus on story completion and dialogue generation and build a generative coarse-to-fine method to generate open-ended text with explicit event transition paths. + +Despite the success of generative pre-trained language models on a series of open-ended text generation tasks, they still suffer in maintaining coherence throughout multiple sentences due to the left-to-right word-by-word generation style (Fan et al., 2019; Yu et al., 2020). To alleviate this problem, one research direction adopts coarse-to-fine progressive text generation (Tan et al., 2021). This generation paradigm has been studied in many text generation systems for specific tasks, such as data-to-text generation (Moryossef et al., 2019; Puduppully and Lapata, 2021), storytelling (Goldfarb-Tarrant et al., 2020; Orbach and Goldberg, 2020), and dialogue generation (Xu et al., 2020a). Our work adopts a generative event transition planner that is trained on a large amount of event transition paths, aiming to arrange the ensuing events in open-ended text generation. + +Another research direction incorporates external entities to guide the open-ended text generation (Guan et al., 2019; Zhang et al., 2020a; Dziri et al., 2021; Li et al., 2020; Peng et al., 2021). Ji et al. (2020) and Xu et al. (2020b) retrieve entities from knowledge bases to control the generated content. However, the retrieval-based methods also suffer from the sparsity problem and the domain shift between external sources and downstream tasks (Wang et al., 2020). Guan et al. (2020b) integrate entity relations into pre-trained language model via additional tuning on entity triples. Even with such specialized learning, the resulted model still often stuck in logical errors or repeats pieces of narratives (Guan et al., 2020b; Peng et al., 2021). + +This phenomenon demonstrates the need for an intact inductive bias on organizing event transition patterns for open-ended text generation. Different from using event triples as additional training instances, our method explicitly maintains generative event transition paths to make the generation process more explainable and improve the coherence. + +# 6 Conclusion + +In this paper, we propose a novel two-stage method to improve high-level consistency and diversity in open-ended text generation. We design a specialized event transition planner to explicitly arrange the ensuing events and introduce an event-path-aware text generator to exploit the event transition guidance for language generation. We investigate two open-ended text generation tasks, i.e., story completion and dialogue generation. Thorough experiments demonstrate that the explicit arrangement of event transition path indeed facilitate models to generate more coherent and diverse text in open-ended scenery. Besides, with the proposed event prompt and event query layer, our method could be extended to any other language models and open-ended generation tasks. A future line of investigation is to explore the effect of the proposed method on other open-ended tasks, such as commonsense question answering. + +# Acknowledgments + +We thank the anonymous reviewers whose suggestions helped clarify this work. This research is supported in part by the National Natural Science Foundation of China (Grant No. 62106105, 61902219), the Shanghai Committee of Science and Technology, China (Grant No. 21DZ1100100), and the Tencent AI Lab Rhino-Bird Focused Research Program. + +# References + +Anton Bakhtin, Yuntian Deng, Sam Gross, Myle Ott, Marc'Aurelio Ranzato, and Arthur Szlam. 2021. Residual energy-based models for text. J. Mach. Learn. Res., 22:40:1-40:41. +Yonatan Bisk, Ari Holtzman, Jesse Thomason, Jacob Andreas, Yoshua Bengio, Joyce Chai, Mirella Lapata, Angeliki Lazaridou, Jonathan May, Aleksandr Nisnevich, Nicolas Pinto, and Joseph Turian. 2020. Experience grounds language. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8718-8735, Online. Association for Computational Linguistics. + +Antoine Bosselut, Hannah Rashkin, Maarten Sap, Chaitanya Malaviya, Asli Celikyilmaz, and Yejin Choi. 2019. COMET: Commonsense transformers for automatic knowledge graph construction. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4762-4779, Florence, Italy. Association for Computational Linguistics. +Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. +Sanyuan Chen, Yutai Hou, Yiming Cui, Wanxiang Che, Ting Liu, and Xiangzhan Yu. 2020. Recall and learn: Fine-tuning deep pretrained language models with less forgetting. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7870-7881, Online. Association for Computational Linguistics. +Xinyang Chen, Sinan Wang, Bo Fu, Mingsheng Long, and Jianmin Wang. 2019. Catastrophic forgetting meets negative transfer: Batch spectral shrinkage for safe transfer learning. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 1906-1916. +Yi Cheng, Siyao Li, Bang Liu, Ruihui Zhao, Sujian Li, Chenghua Lin, and Yefeng Zheng. 2021. Guiding the growth: Difficulty-controllable question generation through step-by-step rewriting. 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 5968-5978, Online. Association for Computational Linguistics. +Elizabeth Clark, Tal August, Sofia Serrano, Nikita Hahuong, Suchin Gururangan, and Noah A. Smith. 2021. All that's 'human' is not gold: Evaluating human evaluation of generated text. 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 7282-7296, Online. Association for Computational Linguistics. +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. +Li Dong and Mirella Lapata. 2018. Coarse-to-fine decoding for neural semantic parsing. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 731-742, Melbourne, Australia. Association for Computational Linguistics. +Yao Dou, Maxwell Forbes, Rik Koncel-Kedziorski, Noah A Smith, and Yejin Choi. 2021. Scarecrow: A framework for scrutinizing machine text. ArXiv preprint, abs/2107.01294. +Nouha Dziri, Andrea Madotto, Osmar Zaiane, and Avishek Joey Bose. 2021. Neural path hunter: Reducing hallucination in dialogue systems via path grounding. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 2197-2214, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Angela Fan, Mike Lewis, and Yann Dauphin. 2018. Hierarchical neural story generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 889-898, Melbourne, Australia. Association for Computational Linguistics. +Angela Fan, Mike Lewis, and Yann Dauphin. 2019. Strategies for structuring story generation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2650-2660, Florence, Italy. Association for Computational Linguistics. +Joseph L Fleiss. 1971. Measuring nominal scale agreement among many raters. Psychological bulletin, 76(5):378. +Jianfeng Gao, Baolin Peng, Chunyuan Li, Jinchao Li, Shahin Shayandeh, Lars Liden, and Heung-Yeung Shum. 2020. Robust conversational AI with grounded text generation. CoRR, abs/2009.03457. +Seraphina Goldfarb-Tarrant, Tuhin Chakrabarty, Ralph Weischedel, and Nanyun Peng. 2020. Content planning for neural story generation with aristotelian rescoring. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4319-4338, Online. Association for Computational Linguistics. +Jian Guan, Fei Huang, Zhihao Zhao, Xiaoyan Zhu, and Minlie Huang. 2020a. A knowledge-enhanced pretraining model for commonsense story generation. Transactions of the Association for Computational Linguistics, 8:93-108. + +Jian Guan, Fei Huang, Zhihao Zhao, Xiaoyan Zhu, and Minlie Huang. 2020b. A knowledge-enhanced pretraining model for commonsense story generation. Transactions of the Association for Computational Linguistics, 8:93-108. +Jian Guan, Xiaoxi Mao, Changjie Fan, Zitao Liu, Wenbiao Ding, and Minlie Huang. 2021. Long text generation by modeling sentence-level and discourse-level coherence. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume I: Long Papers), pages 6379-6393, Online. Association for Computational Linguistics. +Jian Guan, Yansen Wang, and Minlie Huang. 2019. Story ending generation with incremental encoding and commonsense knowledge. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pages 6473-6480. AAAI Press. +Daphne Ippolito, David Grangier, Douglas Eck, and Chris Callison-Burch. 2020. Toward better storylines with sentence-level language models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7472-7478, Online. Association for Computational Linguistics. +Haozhe Ji, Pei Ke, Shaohan Huang, Furu Wei, Xiaoyan Zhu, and Minlie Huang. 2020. Language generation with multi-hop reasoning on commonsense knowledge graph. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 725-736, Online. Association for Computational Linguistics. +Cheolhyoung Lee, Kyunghyun Cho, and Wanmo Kang. 2020. Mixout: Effective regularization to finetune large-scale pretrained language models. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Kenton Lee, Kelvin Guu, Luheng He, Tim Dozat, and Hyung Won Chung. 2021. Neural data augmentation via example extrapolation. *ArXiv preprint*, abs/2102.01335. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pretraining 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. + +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016. A diversity-promoting objective function for neural conversation models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 110-119, San Diego, California. Association for Computational Linguistics. +Piji Li. 2020. An empirical investigation of pre-trained transformer language models for open-domain dialogue generation. ArXiv preprint, abs/2003.04195. +Qintong Li, Piji Li, Zhaochun Ren, Pengjie Ren, and Zhumin Chen. 2020. Knowledge bridging for empathetic dialogue generation. arXiv e-prints, pages arXiv-2009. +Xiang Lisa Li and Percy Liang. 2021. Prefix-tuning: Optimizing continuous prompts for generation. 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 4582-4597, Online. Association for Computational Linguistics. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Amit Moryossef, Yoav Goldberg, and Ido Dagan. 2019. Step-by-step: Separating planning from realization in neural data-to-text generation. 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 2267-2277, Minneapolis, Minnesota. Association for Computational Linguistics. +Nasrin Mostafazadeh, Lucy Vanderwende, Wen-tau Yih, Pushmeet Kohli, and James Allen. 2016. Story cloze evaluator: Vector space representation evaluation by predicting what happens next. In Proceedings of the 1st Workshop on Evaluating Vector-Space Representations for NLP, pages 24-29, Berlin, Germany. Association for Computational Linguistics. +Eyal Orbach and Yoav Goldberg. 2020. Facts2Story: Controlling text generation by key facts. In Proceedings of the 28th International Conference on Computational Linguistics, pages 2329-2345, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Sebastian Padó. 2006. User's guide to sigf: Significance testing by approximate randomisation. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pages 311-318, Philadelphia, + +Pennsylvania, USA. Association for Computational Linguistics. +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. +Xiangyu Peng, Siyan Li, Sarah Wiegreffe, and Mark Riedl. 2021. Inferring the reader: Guiding automated story generation with commonsense reasoning. CoRR, abs/2105.01311. +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. +Ratish Puduppully and Mirella Lapata. 2021. Data-to-text generation with macro planning. Transactions of the Association for Computational Linguistics, 9:510-527. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Hannah Rashkin, Eric Michael Smith, Margaret Li, and Y-Lan Boureau. 2019a. Towards empathetic open-domain conversation models: A new benchmark and dataset. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5370-5381, Florence, Italy. Association for Computational Linguistics. +Hannah Rashkin, Eric Michael Smith, Margaret Li, and Y-Lan Boureau. 2019b. Towards empathetic open-domain conversation models: A new benchmark and dataset. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5370-5381, Florence, Italy. Association for Computational Linguistics. +SE ROBERTSON, S WALKER, S JONES, MM HANCOCK-BEAULIEU, and M GATFORD. 1995. Okapi at trec-3. NIST special publication, (500225):109-123. +Maarten Sap, Ronan Le Bras, Emily Allaway, Chandra Bhagavatula, Nicholas Lourie, Hannah Rashkin, Brendan Roof, Noah A. Smith, and Yejin Choi. 2019. ATOMIC: an atlas of machine commonsense for if-then reasoning. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pages 3027-3035. AAAI Press. + +Abigail See, Aneesh Pappu, Rohun Saxena, Akhila Yerukola, and Christopher D. Manning. 2019. Do massively pretrained language models make better storytellers? In Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL), pages 843-861, Hong Kong, China. Association for Computational Linguistics. +Bowen Tan, Zichao Yang, Maruan Al-Shedivat, Eric Xing, and Zhiting Hu. 2021. Progressive generation of long text with pretrained language models. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4313-4324, Online. Association for Computational Linguistics. +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 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998-6008. +Ivan Vulic, Pei-Hao Su, Samuel Coope, Daniela Gerz, Paweł Budzianowski, Inigo Casanueva, Nikola Mrkšić, and Tsung-Hsien Wen. 2021. ConvFiT: Conversational fine-tuning of pretrained language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1151-1168, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Bingning Wang, Ting Yao, Weipeng Chen, Jingfang Xu, and Xiaochuan Wang. 2021. Multi-lingual question generation with language agnostic language model. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 2262-2272, Online. Association for Computational Linguistics. +Peifeng Wang, Nanyun Peng, Filip Ilievski, Pedro Szekely, and Xiang Ren. 2020. Connecting the dots: A knowledgeable path generator for commonsense question answering. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 4129-4140, Online. Association for Computational Linguistics. +Jun Xu, Zeyang Lei, Haifeng Wang, Zheng-Yu Niu, Hua Wu, and Wanxiang Che. 2020a. Enhancing dialog coherence with event graph grounded content planning. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 3941-3947. ijcai.org. +Peng Xu, Mostofa Patwary, Mohammad Shoeybi, Raul Puri, Pascale Fung, Animashree Anandkumar, and Bryan Catanzaro. 2020b. Controllable story generation with external knowledge using large-scale language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2831-2845. + +Yang Xu. 2021. Global divergence and local convergence of utterance semantic representations in dialogue. In Proceedings of the Society for Computation in Linguistics 2021, pages 116-124, Online. Association for Computational Linguistics. + +Lili Yao, Nanyun Peng, Ralph M. Weischedel, Kevin Knight, Dongyan Zhao, and Rui Yan. 2019. Plan-and-write: Towards better automatic storytelling. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pages 7378-7385. AAAI Press. + +Changlong Yu, Hongming Zhang, Yangqiu Song, and Wilfred Ng. 2020. Cocolm: Complex commonsense enhanced language model. CoRR, abs/2012.15643. + +Houyu Zhang, Zhenghao Liu, Chenyan Xiong, and Zhiyuan Liu. 2020a. Grounded conversation generation as guided traverses in commonsense knowledge graphs. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2031-2043, Online. Association for Computational Linguistics. + +Yizhe Zhang, Siqi Sun, Michel Galley, Yen-Chun Chen, Chris Brockett, Xiang Gao, Jianfeng Gao, Jingjing Liu, and Bill Dolan. 2020b. DIALOGPT: Large-scale generative pre-training for conversational response generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 270-278, Online. Association for Computational Linguistics. + +# A Event Transition Path + +The statistics about event transition paths sampled from ATOMIC are shown in Table 6. We display several examples of the sampled event transition paths in Table 7. + +# B Implementation Details + +For all the systems, including the event transition planner and text generator in our proposed method, we employ the small version of GPT-2 model which is a Transformer with 12-head, 12-layer, and hidden size of 768. The total parameter scalse is 117M. We use pre-trained GPT-2 Byte Pair Encoding (BPE) tokenizer with an extended vocabulary of 50,282 tokens to tokenize texts. + +The event prompt length during training ATOMIC event transition paths, EMPATHETICDI-LOGUES paths, and ROCSTORIES paths are 5, + +
TotalTrainingValidationTest
4,016,4683,614,981200,752200,735
+ +Table 6: Numbers of the sampled event transition paths from ATOMIC. + +
Sampled Event Transition Paths of Variant Lengths
[1] PersonX earns a bachelor's degree XWANT Per-sonX wants to find a good job
[2] PersonX asks PersonY to join OWANT PersonY wants to be friends XREACT PersonY feels loved
[3] PersonX is inebriated _XATTR PersonX loses control of PersonX's car XREACT PersonX feels scared _OREACT PersonY takes PersonX by force XREACT PersonY feels triumphant
+ +Table 7: Event transition paths sampled from daily commonsense reasoning atlas ATOMIC (Sap et al., 2019). + +5, and 10, respectively. The dimension of the randomly initialized smaller matrix $\mathbf{U}_{\theta}^{\prime}$ in Eq.1 is 512. + +The batch size is 128 using AdamW optimizer (Loshchilov and Hutter, 2019) with a learning rate of 5e-5. We select the best checkpoint according to the perplexity on the development set of each task and apply early stopping on training where the patient value is set to 2. We adopt the pre-trained BERT-base model to train the event relation classifier. All experiments are implemented by PyTorch framework (Paszke et al., 2017) and run on NVIDIA V100 GPUs. The training time of the event transition planner and event-path-aware text generator are less than 5 hours and 3 hours with 8 GPUs. + +# C Case Study + +We qualitatively analyze our model predictions and find that although the proposed model outperforms the state-of-the-art baselines, many of predictions are still wrong. Table 8 shows several satisfying and unsatisfying predictions on the two datasets. One significant error originates from the weak alignment between event transition path and final prediction. For example, in the second case, despite "XEFFECT tommy be happy" is imperfect, the prediction "bought it" do not convey its information and makes co-reference mistake (the expected output is "bought them"). Another serious error type is event transition hallucination, where both the predicted event path and its corresponding + +inference fail to maintain the logic coherence, such as the fourth case. These problems could be alleviated if we design a better format of event transition path which is easier to learn or improve the relation modeling between events and sentences. + +
InputCorresponding Event Transition Path
Good Case on Story CompletionContext: +Our granddaughter is two. +Today she went to the doctor for a blood draw. +She did very well. +Our daughter sent a photo of her licking a lollypop afterward. +Target: +We were very proud of her. +Prediction: +We were amused by the photo.Our granddaughter be two +XEFFECT she go doctor for draw +XEFFECT she do well +OREACT we daughter send a photo XEFFECT she lick lollypop +OEFFECT we be proud +XEFFECT we get good photo XEFFECT we be happy
Bad Case on Story CompletionContext: +Tommy wanted to buy a new computer. +After some research he decided to build a PC him-self. +He found a site that spelled out compatible partslists. +He shopped around for the cheapest parts he couldget. +Target: +The PC he made was more powerful than computers twice its price. +Prediction: +He finally found the perfect parts list and bought it.tommy want buy new computer +XEFFECT After research decide build PC +XEFFECT he find site +XEFFECT he shop around part _XEFFECT he could get +XEFFECT he make powerful computer +XREACT he find part XEFFECT tommy be happy
Good Case on Dialogue GenerationContext: +Hi, I joined a firm 6 months ago and then I got apromotion for Junior Manager.Target: +Congratulations. That sounds like the fast track.Prediction: +That's awesome! I bet you are excited!i join firm ago XEFFECT i get promotion for manager +OREACT that like fast track +OREACT that be great XEFFECT you must be proud
Bad Case on Dialogue GenerationContext: +I got my four year old daughter her first tricycle yesterday.Target: +that's so sweet of you.Prediction: +Wow, that's a lot of fun. What kind of tricycle?i get my daughter tricycle yesterday +OREACT that sweet +OEFFECT that be great XEFFECT what be tricycle
+ +Table 8: Summary table of issues found through a qualitative analysis of our model predictions. The errors that occur in our model predictions are colored in blue. \ No newline at end of file diff --git a/eventtransitionplanningforopenendedtextgeneration/images.zip b/eventtransitionplanningforopenendedtextgeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..56226541a366e9156b31230a34d51d6f222d58eb --- /dev/null +++ b/eventtransitionplanningforopenendedtextgeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d8c1f7dcc29d41ba0434edcceed0080a85b4ddf5dc2a01952c60c31d362fcc4 +size 629337 diff --git a/eventtransitionplanningforopenendedtextgeneration/layout.json b/eventtransitionplanningforopenendedtextgeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..32c989ee4675d73e7c6c982e9f6e5ea5656a397d --- /dev/null +++ b/eventtransitionplanningforopenendedtextgeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2c708e95fa94cc0bd883ce3fea06ef824bea1127020aa428d715de4eb6f3148 +size 435422 diff --git a/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_content_list.json b/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a69cdeac08b8b4acd38c35831898593d3798196e --- /dev/null +++ b/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb72fd80bcb1b5350a35a5004679ba31b6c27a372f5f32d418e69e4de7e11c1a +size 82119 diff --git a/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_model.json b/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b547f5cdae4b211130762d550815bbee80eed743 --- /dev/null +++ b/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:706607177dd40f853186eba9007dc543de4f84e8ba25aebc0fcafedde78faaed +size 97227 diff --git a/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_origin.pdf b/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2b32dd312990411b6c0f3906323a17361e9d752c --- /dev/null +++ b/explainingclassesthroughstablewordattributions/7a59d2d8-3f9e-4bb1-a7af-4f4928f35dae_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f8a689d4497a73ed6dfea89462003edcdecae8756655cdfe06dd89ee2cd40fc +size 5226640 diff --git a/explainingclassesthroughstablewordattributions/full.md b/explainingclassesthroughstablewordattributions/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0d21f222bbbcf4b47aa919ffc6632f2ef8213021 --- /dev/null +++ b/explainingclassesthroughstablewordattributions/full.md @@ -0,0 +1,308 @@ +# Explaining Classes through Stable Word Attributions + +# Samuel Rönnqvist, Amanda Myntti, Aki-Juhani Kyröläinen Filip Ginter and Veronika Laippala + +TurkuNLP University of Turku, Finland first.last@utu.fi + +# Abstract + +Input saliency methods have recently become a popular tool for explaining predictions of deep learning models in NLP. Nevertheless, there has been little work investigating methods for aggregating prediction-level explanations to the class level, nor has a framework for evaluating such class explanations been established. We explore explanations based on XLM-R and the Integrated Gradients input attribution method, and propose 1) the Stable Attribution Class Explanation method (SACX) to extract keyword lists of classes in text classification tasks, and 2) a framework for the systematic evaluation of the keyword lists. We find that explanations of individual predictions are prone to noise, but that stable explanations can be effectively identified through repeated training and explanation. We evaluate on web register data and show that the class explanations are linguistically meaningful and distinguishing of the classes. + +# 1 Introduction + +In recent years, various approaches to explaining predictions of deep neural networks have been attracting interest in the fields of NLP and computer vision (see, Montavon et al. (2018)). Several techniques have been suggested in this vein, including model attention visualization (see, e.g., Vig and Belinkov (2019)), and input attribution (or saliency) methods (see Bastings and Filippova, 2020; Ding and Koehn, 2021; Simonyan et al., 2014), which focus on explaining individual predictions. However, showing how a model perceives larger units such as entire classes in a text classification task would be crucial for gaining a global understanding of deep classifiers and salient word features. + +Moreover, text classification models often struggle to truly generalize (Laippala et al., 2021; Petrenz and Webber, 2011). For instance, McCoy et al. (2020) show in repeated experiments with + +BERT on a text inference task that, while consistent test set performance was achieved, the degree of generalization as measured on a related task varied significantly, due to randomized initializations of the decision layer and order of training examples. Similarly, Laippala et al. (2021) demonstrate that resampling of the data had a positive impact on feature stability of linear support vector machines. Thus, various random aspects of the training process may affect the reliability of modeling results, beyond predictive performance on a test set, especially in deep language models. + +In this paper, we propose a method for explaining classes in a text classification task using deep language models based on input attributions estimated with the Integrated Gradients (IG) method (Sundararajan et al., 2017). We focus specifically on IG as it provides a general framework for estimating feature importance in deep neural networks and has been shown to provide reliable saliency maps in text classification among other tasks. For a discussion on the merits of IG, cf. Prasad et al. (2021), and Bastings and Filippova (2020) on saliency vs. attention methods in general. + +Our class explanation method works by aggregating attributions in two ways: across documents and across models. On the one hand, we classify documents and aggregate word attribution scores from them, in order to extract the overall most predictive word features of a particular class. On the other hand, we aggregate these attributions over multiple random train/validation data splits and instances of a classifier, in order to identify stable attributions that are consistently assigned across rounds. Thus, we consider the level of a particular classifier configuration—i.e., the combination of language model, decision layer, hyperparameters, loss function, etc.—and strive to capture its perception of a corpus. + +Our method explains a class in the form of a list of words ranked by the aggregated attribution + +scores, and filtered based on their stability across experiments. Following corpus linguistics' long tradition of analyzing style and content of text classes, we refer to these attributions as keywords (see Scott and Tribble, 2006; Stubbs, 2010, for discussion). This type of analysis is concerned with identifying the words that are most informative about the characteristics conveyed by a given text class. + +While keyword analysis is widely employed in corpus linguistics, quantitative measures have been used only for extraction and not as a framework for evaluation, which is rather done qualitatively (cf. Egbert and Biber, 2019). Thus, as a contribution of this paper, we propose three lexical measures of keyword quality, which help us optimize and evaluate our method. We also study syntactic and semantic properties to nuance our understanding of keywords obtained with a deep classifier and IG. + +We test our method by training a set of classifiers on the Corpus of Online Registers of English (CORE) (Egbert et al., 2015). CORE is sampled from the searchable English-language web and aims to be representative of the distribution of registers (or genres) found online. Recent work in both linguistics and NLP has, however, demonstrated challenges of categorizing language use on the web pertaining to its extreme variation within and across classes (Titak and Robertson, 2013; Dayter and Messerli, 2021; Madjarov et al., 2019; Biber and Egbert, 2019). Therefore, explanation methods are especially needed in web register classification, in order to explore the robustness and linguistic motivation of blackbox models. + +We put forward our Stable Attribution Class Explanation method (SACX)1 as a support in understanding classes and their modeling by deep language model classifiers, in text classification tasks where keywords provide a suitable means of explanation. It can assist model development and debugging by highlighting salient word features, at a more general level compared to attributions at the document and classifier instance level. + +# 2 Data + +CORE (Egbert et al., 2015) is a large-scale collection of web texts annotated for their genre, or register (Biber, 1988). In total, the dataset consists of nearly 50,000 texts. In our experiments, we combine the train and development sets, total + +ing 38,760 texts. The CORE register classes are coded using a two-level taxonomy developed in a data-driven manner to cover the full range of web language use. We focus on the upper level which consists of eight register classes: Narrative (NA), Opinion (OP), How-to (HI), Interactive discussion (ID), Informational description (IN), Lyrical (LY), Spoken (SP) and Informational persuasion (IP). Additionally, the dataset includes hybrid documents featuring characteristics of several registers and thus coded with several register labels (see Table 5 in Appendix). + +# 3 Methods + +# 3.1 Classifier and attribution method + +As a classifier, we use the XLM-R deep language model (Conneau et al., 2020) because of its strong ability to model multiple languages, both in monolingual and cross-lingual settings. We opt for the base size rather than the large, due to its relatively frugal use of resource and comparable predictive performance on CORE (Repo et al., 2021). The task is modeled as a multilabel classification task using a sequence classification head, binary cross-entry with sigmoid loss and a fixed prediction threshold. We optimize the classifier hyperparameters against the development set, in order to reuse the settings in the explanation process described below. + +We use the IG method to obtain explanations from the XLM-R predictions $^2$ (Sundararajan et al., 2017). IG takes the network input in the form of token embeddings and a corresponding blank reference input (same-length sequence of embeddings for a fixed placeholder token), and calculates a linear interpolation between them over a number of steps (e.g., 50). It then calculates gradients to measure the relationship between changes in an embedding and changes in the model predictions. This produces attribution scores for each dimension of the input token embeddings. Our explanation method then aggregates these in several steps into class representations. + +# 3.2 The Stable Attribution Class Explanation method (SACX) + +The class descriptions are extracted through the steps detailed below and illustrated in Figure 1. + +![](images/a0a283c37805d0ca93596faa484062a41c43e4f70edb641e37f114f996ca86b7.jpg) +Figure 1: Overview of the SACX method. + +Step 1: Train and explain. We combine the training and development sets of the corpus and randomly split them into a new training and validation set according to a set ratio $r$ , using stratification to keep class distributions stable (cf. Laippala et al., 2021). The pre-trained language model is loaded and the decision layer is randomly initialized. Both are fine-tuned on the new training set. Documents in the validation set are classified by a threshold $\tau$ on the posterior probabilities, and the IG method is applied in order to obtain attribution scores for the network inputs, i.e., each dimension of each input token embedding, w.r.t. each predicted class $c$ . + +Step 2: Aggregate attributions from documents. The attribution scores for each embedding dimension are summed up per token to provide a token-level score, while all tokens in a document $d$ are normalized by the $\mathrm{L}_2$ norm. This provides a word attribution score $s_{w,d,c}$ directly if the word $w$ consists of a single token, otherwise it is calculated as the maximum of all sub-word token scores. We calculate the average attribution scores $\overline{s}_{w,c}$ , for each $(w,c)$ , as a means for ranking the keywords for each class. In order to reduce noise, we only select the $n$ top-scoring words per document $d$ , and we only consider true positive predictions. We note that the method could alternatively be used for error analysis by targeting false predictions. + +Step 3: Select stable keywords. The above process is repeated $N$ times, each time randomly shuffling and splitting the data and reinitializing the classification head according to Step 1, in order to quantify the stability of the keywords. The keyword candidates ranked by $\overline{s}_{w,c}$ are filtered based on selection frequency: a word is considered stable if the ratio by which it is selected (in Step 2) across the experiments is larger than a threshold value $t$ . + +Finally, we perform a light cleaning by ignoring words that occur in less than $k$ documents and do not contain any alphabetic characters. We optimize the parameters $t$ , $n$ and $\tau$ in the experiments. + +# 3.3 Baseline methods + +We use the two following methods for extraction of class keywords, as baselines in comparison: + +TF-IDF. As a naive approach, we create a TF-IDF model with logarithmic scaling, a minimum document frequency of 10 and a maximum document frequency at $50\%$ of the number of documents in the largest class. To extract the keywords, a class vector is formed by first averaging the document vectors for a given class from the weight matrix and then taking the 100 highest scoring terms as keywords for each class. + +SVMs. As a strong baseline, we follow Sharoff et al. (2010); Laippala et al. (2021). We use a linear Support Vector Machine (SVM) with L2 penalty and TF-IDF vectorizer with a minimum document frequency of $0.05\%$ , in Scikit-learn (LinearSVC). SVMs were adapted to the multilabel setting using a one-versus-rest strategy, and the C value optimized with grid search (0.5 providing the best scores). We train the SVMs on the same random splits as XML-R. During each round, the 1000 best positive features for each class are extracted. For the selection of the stable keywords, a selection frequency threshold of 0.6 was chosen. + +# 4 Evaluation setting + +We evaluate the keyword quality based on usefulness and relevance, which are established concepts in feature selection and evaluation in machine learning (e.g., Blum and Langley, 1997; Kohavi and John, 1997; Guyon and Elisseeff, 2003). Usefulness refers to the discriminative power of the features used in a task, e.g., as measured by how well they allow to discriminate the classes in a test set. Relevance refers to the association of the features with the actual object of study, i.e., their generalizability beyond a test set. Not all useful features are relevant—for instance, some useful features may inherit their usefulness from data idiosyncrasies, unrepresentative train/test splits and spurious statistics (see Ribeiro et al., 2016). In the case of keywords, useful keywords allow to discriminate the classes in the data, while relevant keywords reflect meaningful and linguistically motivated characteristics associated with the classes. + +We propose three measures for assessing usefulness of keywords based on lexical overlap, presented in Section 4.1, which we use to optimize parameters of our explanation method and to compare against the baseline methods. In Section 4.2, + +we present further analyses conducted to assess the relevance of keywords and to form a qualitative understanding of the differences in output of the methods. The results are presented in Section 5. + +# 4.1 Lexical measures of usefulness + +Our measures related to usefulness focus on 1) distinctiveness—how distinct or overlapping keywords are between classes, 2) coverage—how well the keywords cover the documents of the corpus, and 3) a combination of the two that measures distinctiveness based on coverage. Similar to previous studies, we only consider the top-100 keywords (see Pojanapunya and Todd, 2018). + +# 4.1.1 Distinctiveness (intrinsic) + +We first propose a simple intrinsic measure, which assesses the distinctiveness of keywords, by looking at keyword overlap. Specifically, it measures the fraction of keywords unique to a class, averaged across classes: + +$$ +D i s t _ {i n t} = \frac {1}{| C |} \sum_ {c \in C} \frac {| \{k | k \in K _ {c} \setminus K _ {\neg c} \} |}{| K _ {c} |} +$$ + +for the set of classes $C$ and keywords $K$ for class $c$ or all other classes $\neg c$ . Whereas keyword analysis tends to focus on binary categories and methods that separate keyword by design, our measure fits more general uses, e.g., in settings with multiple classes. + +# 4.1.2 Coverage + +In the next step, we look at lexical coverage of the keywords in associated documents in the corpus as an indicator of usefulness. We define coverage of a class as the average proportion of keywords that occur across all its documents, and the global coverage measure as the macro average across all classes: + +$$ +C o v = \frac {1}{| C |} \sum_ {c \in C} \frac {1}{| T _ {c} |} \sum_ {t \in T _ {c}} \frac {| \{k | k \in K _ {c} \cap t \} |}{| K _ {c} |} +$$ + +where $T_{c}$ is the set of texts of class $c$ , either based on true class membership or true positive predictions. We again focus on true positives as we are interested in evaluating the quality of the keywords relative to the learned representation, not factoring in the model's predictive performance. + +# 4.1.3 Distinctiveness (extrinsic) + +Having defined a measure of coverage, we derive an extrinsic measure of distinctiveness as the coverage of keywords within a class relative to the + +coverage across the class boundary, of unrelated documents. We define a cross-coverage measure: + +$$ +X C o v = \frac {1}{| C |} \sum_ {c \in C} \frac {1}{| T _ {\neg c} |} \sum_ {t \in T _ {\neg c}} \frac {| \{k | k \in K _ {c} \cap t \} |}{| K _ {c} |} +$$ + +of keywords $K$ and texts $T_{\neg c}$ , which is the set of texts not labeled with class $c$ . + +The extrinsic distinctiveness is then defined as: + +$$ +D i s t _ {e x t} = \frac {C o v - X C o v}{C o v} +$$ + +which provides an easy-to-interpret metric in the range [0, 1], where a distinctiveness score of 0 means that there is no difference in keyword coverage within and across classes, and a score of 1 indicates a perfect separation between classes. + +Egbert and Biber (2019) propose a similar notion of "content-distinctiveness" based on text dispersion keyness (incorporating document frequency) as a desirable quality of keywords. + +# 4.2 Syntactic and semantic analysis of relevance + +Our analysis of relevance focuses on syntactic and semantic properties associated with the keywords. While traditionally the relevance of keywords is assessed qualitatively and based on intuition (e.g., Scott and Tribble, 2006; Bondi and Scott, 2010; Gabrielatos and Marchi, 2011; Phillips, 1989; Williams, 1976), the goal of the proposed analysis is to provide inference for contrasting the three methods. This also allows us to deepen our understanding of the keywords. + +First, we assess the proportion of content and function words among the keywords. This is an important qualitative distinction in keyword analysis, and generally methods extracting keywords with a stronger affinity to topicality/content rather than grammatical/functional elements are considered to be superior (cf. Egbert and Biber, 2019). + +We parse the corpus with Turku Neural Parser (Kanerva et al., 2018), identify the most frequent part-of-speech (POS) per keyword, and group their distribution into two lexical categories: function and content words. Function words consist of adpositions, conjunctions, pronouns, auxiliaries, adverbs, interjections and determiners, and content words of adjectives, nouns, proper nouns and verbs. Other POS classes (numbers, symbols, punctuation, particles) are excluded from the analysis. + +
ClassF1 (M)SDSup. (M)
Lyrical (LY)82.288.78180.58
Narrative (NA)77.831.795779.71
Inter. discussion (ID)75.673.06915.35
Inform. description (IN)65.731.423352.49
Opinion (OP)55.415.082803.13
How-to (HI)54.235.85538.51
Inform. persuasion (IP)43.836.14527.80
Spoken (SP)25.9323.10195.49
Micro AVG68.371.84-
+ +Table 1: Predictive performance of XML-R classifier as mean F1-score (\%), with standard deviation and mean support across the resampling rounds ( $N = 100$ ). + +Second, we examine the keywords from the perspective of semantic coherence. We analyze keyword similarities relative to the semantic structure of the corpus as a whole using word embeddings and clustering. We turn the dataset vocabulary into word vectors, using FastText vectors pre-trained on Common Crawl, 600B tokens in 300 dimensions (Mikolov et al., 2018). This ensures that the semantic vectors are independent from the explanation methods, while being trained on data similar to CORE, namely unrestricted web text. The analysis is further described in Section 5.5. + +# 5 Results + +After completing $N = 100$ rounds of experiments, we first inspect the predictive performances of the trained classifiers and study the degree of stability of the attributions. Then, we report the results of the optimization of our method against the usefulness-focused lexical measures, and qualitatively inspect the extracted top keywords. Finally, we present the syntactic and semantic analyses focusing on keyword relevance. + +![](images/a8ae55f0d2a5cedbd2cc39ca7e8b3cca1be37a152443a04b43031b40367093d1.jpg) +Figure 2: Distribution of selection frequency of keyword candidates for all classes, based on $N = 100$ rounds. The upper panel shows the full range and the lower the subrange of stable keywords. + +# 5.1 Predictive performance + +Table 1 summarizes the predictive performance of the 100 XLM-R classifiers that we have trained. The micro average F1-score was a good $68\%$ on average. Similar to previous studies (Repo et al., 2021; Ronnqvist et al., 2021; Biber and Egbert, 2016), we observed a large variation among classes, ranging from an F1-score of $44\%$ (Informational persuasion) to $81\%$ (Lyrical). Our method was able to extract stable keywords for all the classes except for Spoken, where no keyword candidate passed the selection frequency threshold. This was mirrored both in its significantly lower class-specific F1-score of $26\%$ and the exceptionally high standard deviation of $23\%$ , likely related to the small sample size. For comparison, the SVMs baseline achieved a micro F1-score of $65.00\%$ ( $SD = 0.33\%$ ). + +# 5.2 Stability of keywords + +We investigated the (in)stability of keywords across the 100 runs, and the utility of the selection frequency threshold $t$ , by studying the selection frequency of the keyword candidates. The distribution of selection frequency is visualized in Figure 2. We see that the vast majority of keyword candidates appear only in a low number of runs. + +For instance, for Informational Description exhibiting the lowest standard deviation in F1-score $(1.42\%)$ , the top-10 unfiltered words were: lollies, verdant, especially, endorsing, forebears, equations, gerald, colin, indy and exaggerating. These keyword candidates scored in the range 0.79-0.93, but had selection frequencies of only 1 and 3 (for colin). By comparison, the first word with a selection frequency above $t = 0.7$ is abstract (selection frequency $98\%$ ), with a score of 0.56 which ranks it $45^{\text{th}}$ before filtering (cf. Table 3). In fact, in order to extract the top-100 stable keywords we consider in evaluation, we need to traverse the unfiltered lists of keyword candidates, on average, down to rank 22,940 (range 1,775-67,859 for all classes). This illustrates the extent of instability among the attributions. + +Finally, comparing the keywords extracted from the XLM-R and SVMs, we observed that the SVMs produced more consistent results with a mean selection frequency of $92.16\%$ among the top-100 filtered keywords vs. $74.01\%$ for the aggregations based on XLM-R and IG. This further highlights + +
MethodDist., intrinsicDist., extrinsicCoverage
SACX82.5744.2710.08
SVMs91.4339.9410.53
TF-IDF29.8643.9210.37
+ +Table 2: Method comparison based on distinctiveness (dist.) and coverage (in %). + +how inconsistent the attributions obtained by the IG method are across different runs, and thereby confirms the necessity of selection frequency filtering in obtaining stable and likely meaningful keywords. + +# 5.3 Comparison on lexical usefulness measures + +We apply the three lexical measures introduced in Section 4.1 to evaluate the keywords of our proposed method and the baselines. We set the parameters $r = 0.67$ (split), $N = 100$ (runs) and $k = 5$ (minimum document frequency), while optimizing the rest with grid search against the lexical measures. Weighting the three measures against each other is not entirely trivial, as they capture different qualities and we do not have a clear preference a priori. With different settings we are able to maximize different measures: intrinsic distinctiveness to $85.43\%$ , extrinsic distinctiveness to $58.98\%$ , and coverage to $11.33\%$ . However, maximizing either form of distinctiveness severely hurts coverage. We found a good balance with the settings $t = 0.7$ (selection frequency threshold), $n = 20$ (words per document) and $\tau = 0.7$ (prediction threshold), which achieves comparable coverage to the other methods and competitive numbers for the distinctiveness measures. The results for this setting and the baselines are listed in Table 2. + +Based on intrinsic distinctiveness both our SACX method $(83.6\%)$ and SVMs $(91.4\%)$ displayed strong discriminative power, contrasting TF-IDF $(29.9\%)$ . In terms of lexical coverage across the documents, all methods performed at the same level (10.08–10.53%). Similarly, the methods displayed a modest difference in performance based on extrinsic distinctiveness: SACX $(44.3\%)$ followed by TF-IDF $(43.9\%)$ and SVMs $(39.9\%)$ . Taken together, the results demonstrate that the keywords extracted by our method were useful in discriminating between the classes, performing similarly to SVMs, while TF-IDF stood out with its + +weak separation of keywords across the classes. + +# 5.4 Extracted keywords + +The top-15 keywords of each class are presented in Table 3 and the keywords extracted with the baseline methods in Table 6 in Appendix. + +Our method was able to extract relevant keywords that clearly reflect our understanding of these seven classes and also share similarities with keywords discovered for these data in previous studies (e.g., Biber and Egbert, 2019; Laippala et al., 2021). The keywords are predominantly content words reflecting the class characteristics, such as faq, question, answer, forum extracted for Interactive discussion (ID). Similarly, linguistically-motivated patterns emerged from other classes, such as keywords associated with research papers and reports from Informational description (IN) (abstract, introduction, summary, bio) and keywords, in particular proper nouns, reflecting news and sports from Narrative (NA) (afp, reuters and bundesliga, nba, ufc, playoffs, nfl, uefa, psg). + +The keywords extracted with the baseline methods are linguistically motivated as well. However, instead of extracting mainly content words, they identified also function words as keywords, such as or, it, we, doesn and dont (cf. Section 4.2). Many of these function words identified as keywords are linguistically motivated and reflect descriptions established in previous studies on register analysis (Biber, 1988; Biber and Egbert, 2016, 2019). + +# 5.5 Analysis of relevance of the keywords + +In our syntactic analysis, we evaluate relevance based on the relative frequencies of content and function words, as listed in Table 4. Relative to the baselines, SACX shows a tendency to extract less function and more content words, in particular more nouns (including proper nouns). This suggests that it is more likely to focus on topical keywords. The distributional differences were statistically significant $(X^{2}(8,N = 2,100) = 111.33,p < 0.001)$ and a residual analysis confirmed the negative association with function words and the positive one with proper nouns. + +In our semantic analysis, we visualize the full lexical space by reducing the 300 dimensions to two using Uniform Manifold Approximation and Projection (McInnes et al., 2018). The SACX key- + +
- How-to (HI) -- Inter. Discussion (ID) -- Inform. Description (IN) -- Inform. Persuasion (IP) -
KeywordScoreSFKeywordScoreSFKeywordScoreSFKeywordScoreSF
how0.520697faq0.580698abstract0.563398description0.504996
howto0.402487question0.551498storyline0.458988ISBN0.418170
diy0.353877answer0.481598FAQs0.441295product0.280496
recipe0.336897forum0.473398faq0.419895book0.277696
recipes0.296597answers0.455498aspect0.340397important0.260393
to0.242596thread0.420298introduction0.305798shop0.243173
ingredients0.234497forums0.400798summary0.302398details0.232293
tutorial0.231196re0.378698contents0.301698amazon0.213196
tutorials0.226878discuss0.372398abstracts0.283890reviews0.203496
tips0.219497answered0.364593bio0.263592buy0.180796
tip0.201294repplies0.355498disclaimer0.253898available0.178796
navigation0.191077threads0.349098meta0.251974review0.177296
remove0.187097resolved0.328498profiles0.250086item0.173276
build0.184991quote0.328098downloads0.247172package0.171170
preheat0.183187answerer0.318898dictionary0.244198products0.168196
+ +
- Lyrical (LY) -- Narrative (NA) -- Opinion (OP) -
KeywordScoreSFKeywordScoreSFKeywordScoreSF
lyrics0.411797bundesliga0.358898review0.545698
poem0.283975afp0.346298weblog0.502872
written0.158381nba0.345598psalm0.444495
sorry0.147170ufc0.332798feminist0.337694
lyricsmode0.146291blog0.330798tips0.329292
truth0.135191playoffs0.328398blog0.327998
songs0.134373nfl0.326398bible0.325098
yeah0.133795wordpress0.325387thursday0.300098
tired0.133179flickr0.324895lgbt0.295787
finally0.131476playoff0.307598eucharistic0.292571
tonight0.131287reuters0.307398monday0.289997
something0.130297uefa0.306598tuesday0.287398
heaven0.130077zlatan0.305598wednesday0.286198
lord0.129974psg0.303897testament0.278098
fucking0.128779responses0.300092post0.268898
+ +Table 3: Top-15 extracted keywords for each class ranked by mean aggregated attribution score (Score). The lists are filtered by threshold on selection frequency (SF in %). + +![](images/9065043f7f508a6060307d78f6395f4c311b80d50b0d3482d00b148d2665eaca.jpg) +Figure 3: The lexical space of CORE, with keywords extracted from XLM-R colored based on class. + +words are highlighted and colored by class, in Figure 3, and the baseline keywords in Figure 6 in Appendix. We observe that the SACX keywords cluster densely to a higher degree, suggesting semantically more coherent keywords. + +To formally test this, we clustered the semantic vectors of the whole vocabulary using model-based clustering with mixtures from von Mises-Fisher distributions (Banerjee et al., 2005; Hornik and Grün, 2014) as the data were unit vectors. We + +
MethodContent wordFunction
Adj.NounProp.n.Verb
SACX8.6148.4913.7716.7912.34
SVMs12.1049.866.3415.9915.71
TF-IDF13.0939.861.2930.0715.68
+ +Table 4: Distribution of lexical classes of the keywords for each method (in %). + +![](images/c5b8b230bc9979e4bb988ac8442bfa924a8f077c080aade0c4f1296eefd6392c.jpg) +Figure 4: Cluster solution with clusters mapped to SACX keywords (columns) relative to the classes (rows). The color indicates the strength of association. + +found 500 clusters to be optimal, based on BIC (Schwarz, 1978) and visual inspection indicating no substantive difference with fewer clusters. + +Density was parametrized by the mean direction $\mu$ and the concentration parameter $\kappa$ characterizing the strength of concentration of the data about the mean direction. This analysis showed that SACX was 1.25 times (OR $95\%$ CIs = 1.03, 1.5) more likely to extract the keywords from dense clusters (above average $k$ ) than the other two methods together. Considering the previously noted propensity of SACX to extract proper nouns, we also studied their frequencies in dense vs. sparse clusters. We found that SACX was 5.85 times (OR $95\%$ CIs = 3.07, 11.1) more likely to extract proper nouns from dense clusters than the other two methods together. This suggests that its keywords are both more specific and coherent in terms of vector space similarity. + +Figure 4 visualizes the SACX keywords by the clusters they were assigned (columns) relative to the classes (rows), with a hierarchical biclustering on the axes. It further demonstrates the semantic coherence of the keywords as indicated clearly by the horizontal tightness and the strength of association (increase in redness). By comparison, in Figure 5 in Appendix, we see somewhat less coherence with SVMs, and clearly less with TF-IDF. + +# 6 Conclusion + +We have presented the Stable Attribution Class Explanation method (SACX) for explaining classes in text classification, based on IG input attributions from deep language model classifiers. SACX produces lists of keywords reflecting a classifier's perception of classes. However, input attributions are prone to noise, which we have shown can be effectively filtered, as we performed 100 rounds of training an XLM-R classifier and applying IG. + +We have demonstrated that these stable keywords are of good quality—both useful as features and meaningfully relevant of the text classes studied. We have proposed lexical measures for evaluating distinctiveness and corpus coverage of keywords, and we have compared our method against two baseline class explanation methods. We compared the methods based on syntactic and semantic properties of the keywords, and found SACX to distinguish itself in that it extracts more content and less function words—a property which is generally considered to be a hallmark of a superior keyword analysis method in corpus linguistics. In particular, SACX has the ability to focus on more specific, topical words in the form of proper nouns, when relevant for depicting the class (such as for Narrative). + +We have shown that SACX produces keywords that are highly coherent and tend to cluster densely throughout semantic vector space, rather than being evenly dispersed such as the word features extracted from SVMs. We also demonstrated that proper nouns are a distinguishing feature of these dense clusters, further illustrating the coherence of SACX keywords. We speculate that the use of token embeddings, and the XLM-R model's ability to learn local and highly non-linear functional forms afforded by the significant number of parameters, may give rise to these keyword characteristics. + +In the future, we seek to explore the utility of the method in various settings, and further investigate the quality and nature of its class explanations. We will test it on further text classification tasks and types of models, as well as apply the approach to other languages and cross-lingual settings. In particular, understanding model behavior in zero-shot classification through stable explanations at the class level may provide a useful tool in detecting systematic biases. In the context of register identification, recent pursuits in this direction of multi- and cross-lingual modeling (Repo + +et al., 2021; Rönnqvist et al., 2021; Laippala et al., 2019) have been making good progress in terms of predictive performance, but interpretability tools such as ours could offer linguistic insight, e.g., into language-independent markers of the classes. + +Moreover, as we have demonstrated that input attributions are highly prone to noise at the level of individual classifier instances, the type of filtering we have proposed can be used, not only to stabilize class-level explanations, but, more generally to generate stable saliency maps for particular text inputs based on multiple classifier instances. Future work should explore this direction further, as the contextualized interpretation of individual text inputs can provide a useful complement to the keyword-based class explanations for understanding model behavior. + +# Acknowledgements + +We thank CSC - IT Center for Science in Finland for computational resources. The work was funded by grants received from Emil Aaltonen foundation and Academy of Finland. + +# References + +Arindam Banerjee, Inderjit S Dhillon, Joydeep Ghosh, Suvrit Sra, and Greg Ridgeway. 2005. Clustering on the unit hypersphere using von Mises-Fisher distributions. Journal of Machine Learning Research, 6(9):1345-1382. +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 Blackbox NLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 149-155. +Douglas Biber. 1988. Variation across speech and writing. Cambridge University Press, Cambridge. +Douglas Biber and Jesse Egbert. 2016. Using grammatical features for automatic register identification in an unrestricted corpus of documents from the open web. Journal of Research Design and Statistics in Linguistics and Communication Science, 2(1):3-36. +Douglas Biber and Jesse Egbert. 2019. Register Variation Online. Cambridge University Press, Cambridge. +Avrim L Blum and Pat Langley. 1997. Selection of relevant features and examples in machine learning. Artificial Intelligence, 97(1-2):245-271. +Marina Bondi and Mike Scott. 2010. Keyness in Texts. John Benjamins Publishing Company. + +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettle-moyer, and Veselin Stoyanov. 2020. Unsupervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8440-8451, Online. Association for Computational Linguistics. +Daria Dayter and Thomas Messerli. 2021. Persuasive language and features of formality on the rchangemyview subreddit. *Internet Pragmatics*. +Shuoyang Ding and Philipp Koehn. 2021. Evaluating saliency methods for neural language models. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5034-5052. +Jesse Egbert and Doug Biber. 2019. Incorporating text dispersion into keyword analyses. Corpora, 14(1):77-104. +Jesse Egbert, Douglas Biber, and Mark Davies. 2015. Developing a bottom-up, user-based method of web register classification. Journal of the Association for Information Science and Technology, 66:1817-1831. +Costas Gabrielatos and Anna Marchi. 2011. Keyness: Matching metrics to definitions. In Theoretical methodological challenges in corpus approaches to discourse studies and some ways of addressing them. +Isabelle Guyon and André Elisseeff. 2003. An introduction to variable and feature selection. The Journal of Machine Learning Research, 3:1157-1182. +Kurt Hornik and Bettina Grün. 2014. movMF: an R package for fitting mixtures of von Mises-Fisher distributions. Journal of Statistical Software, 58(10):1-31. +Jenna Kanerva, Filip Ginter, Niko Miekka, Akseli Leino, and Tapio Salakoski. 2018. Turku neural parser pipeline: An end-to-end system for the conll 2018 shared task. In Proceedings of the CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies. Association for Computational Linguistics. +Ron Kohavi and George H. John. 1997. Wrappers for feature subset selection. Artificial Intelligence, 97(1-2):273-324. +Narine Kokhlikyan, Vivek Miglani, Miguel Martin, Edward Wang, Bilal Alsallakh, Jonathan Reynolds, Alexander Melnikov, Natalia Kliushkina, Carlos Araya, Siqi Yan, et al. 2020. Captum: A unified and generic model interpretability library for PyTorch. arXiv preprint arXiv:2009.07896. + +Veronika Laippala, Jesse Egbert, Douglas Biber, and Aki-Juhani Kyroläinen. 2021. Exploring the role of lexis and grammar for the stable identification of register in an unrestricted corpus of web documents. Language Resources and Evaluation. +Veronika Laippala, Roosa Kyllönen, Jesse Egbert, Douglas Biber, and Sampo Pyysalo. 2019. Toward multilingual identification of online registers. In Proceedings of the 22nd Nordic Conference on Computational Linguistics, pages 292-297, Turku, Finland. Linköping University Electronic Press. +Gjorgji Madjarov, Vedrana Vidulin, Ivica Dimitrovski, and Dragi Kocev. 2019. Web genre classification with methods for structured output prediction. Information Sciences, 503:551 - 573. +R Thomas McCoy, Junghyun Min, and Tal Linzen. 2020. BERTs of a feather do not generalize together: Large variability in generalization across models with similar test set performance. In Proceedings of the Third Blackbox NLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 217-227. +Leland McInnes, John Healy, and James Melville. 2018. UMAP: Uniform Manifold Approximation and Projection for dimension reduction. arXiv:1802.03426. +Tomas Mikolov, Edouard Grave, Piotr Bojanowski, Christian Puhrsch, and Armand Joulin. 2018. Advances in pre-training distributed word representations. In Proceedings of the International Conference on Language Resources and Evaluation (LREC 2018). +Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. 2018. Methods for interpreting and understanding deep neural networks. Digital Signal Processing, 73:1-15. +Philipp Petrenz and Bonnie Webber. 2011. Stable classification of text genres. Computational Linguistics, 37(2):385-393. +Martin A. Phillips. 1989. Lexical structure of text. English Language Research. +Punjaporn Pojanapunya and Richard Watson Todd. 2018. Log-likelihood and odds ratio: Keyness statistics for different purposes of keyword analysis. Corpus Linguistics and Linguistic Theory, 14(1):133-167. +Grusha Prasad, Yixin Nie, Mohit Bansal, Robin Jia, Douwe Kiela, and Adina Williams. 2021. To what extent do human explanations of model behavior align with actual model behavior? In Proceedings of the Fourth BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 1-14, Punta Cana, Dominican Republic. Association for Computational Linguistics. + +Liina Repo, Valteri Skantsi, Samuel Ronnqvist, Saara Hellström, Miika Oinonen, Anna Salmela, Douglas Biber, Jesse Egbert, Campo Pyysalo, and Veronika Laippala. 2021. Beyond the English web: Zero-shot cross-lingual and lightweight monolingual classification of registers. In Proceedings of the EACL 2021 Student Research Workshop. +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, page 1135-1144. +Samuel Ronnqvist, Valtteri Skantsi, Miika Oinonen, and Veronika Laippala. 2021. Multilingual and zero-shot is closing in on monolingual web register classification. In Proceedings of the 23rd Nordic Conference on Computational Linguistics (NoDaLiDa), pages 157-165, Reykjavik, Iceland (Online). Linkoping University Electronic Press, Sweden. +Gideon Schwarz. 1978. Estimating the dimension of a model. The Annals of Statistics, 2:461-464. +Mike Scott and Chris Tribble. 2006. Textual patterns: Key words and corpus analysis in language education. John Benjamins. +Serge Sharoff, Zhili Wu, and Katja Markert. 2010. The web library of babel: evaluating genre collections. In Proceedings of LREC). +Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. 2014. Deep inside convolutional networks: Visualising image classification models and saliency maps. In Workshop at International Conference on Learning Representations. ICLR. +Michael Stubbs. 2010. Three concepts of keywords. In Marina Bondi and Mark Scott, editors, *Keyness in texts: corpus linguistic investigations*, page 21-42. John Benjamins. +Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017. Axiomatic attribution for deep networks. In International Conference on Machine Learning, pages 3319-3328. PMLR. +Ashley Titak and Audrey Robertson. 2013. Dimensions of web registers: An exploratory multidimensional comparison. Corpora, 8:239-271. +Jesse Vig and Yonatan Belinkov. 2019. Analyzing the structure of attention in a transformer language model. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 63-76. +Raymond Williams. 1976. Keywords: A vocabulary of culture and society. Oxford University Press. + +# Appendix + +
ClassDocsTokensVocab.
Narrative14,13615,256k498k
Informational description7,46010,171k387k
Opinion6,2909,880k360k
Interactive discussion2,6232,919k151k
Informational persuasion2,2461,197k93k
How-to1,0661,210k78k
Lyrical512248k26k
Spoken470961k67k
Hybrids4,5455,939k270k
+ +Table 5: Quantitative descriptors of the data. + +![](images/9ad89636f97c37a4815bf910ab34d665467bff02e5055509e987658ff7de6c2c.jpg) + +![](images/1e934e050fdc54985ef73e957092299a63b102fb1ce817ed6976ce4c19e5d9a8.jpg) +Figure 5: Cluster solution of the keywords relative to the classes extracted with SVMs (upper panel) and TF-IDF (lower panel). The row correspond to the classes and the columns to the keywords. + +Keywords from SVMs + +
How-toI. DiscussionI. DescriptionI. PersuasionLyricalNarrativeOpinionSpoken
howanswersabstractdescriptionlyricssaidreviewdid
tipsresolvedorbookcommentweallahaesthetic
addforumstorylineauthorfromaccordngtrulywe
stepquotesymptomsbrisbaneallcommentsandapplause
yourquestionusedproductpoemsaysrelationshipvery
recipethreadoverviewdecdownitbloginterview
nichechosensummarygiftmelastjesustrue
dryaskercoursesmembershippoemsaddedgodabc
tutorialrepleaseseriessongthisseemsthere
mixanswercausescasinoohlovelybiblethat
useetcinformationdatepoetryexcitedipodthink
pilatesdontdiscussesdealsgonnaconfirmedwhilewhat
contractoriginallycontactpledgeyeahannouncedevenyou
advancepostedresearchattractslordtheycharacterhon
makewouldvarietypinkrevolutionearlierratherdo
+ +Keywords from TF-IDF + +
How-toI. DiscussionI. DescriptionI. PersuasionLyricalNarrativeOpinionSpoken
usingquestioninformationbooklyricsteamlovedoing
addetcresearchfreeloveweekfeelkind
informationanswernumberauthorsonggameletmusic
starttryusingamazonchorusagainstdoesnfeel
keepsomeoneavailablepriceohsaysgodlove
tipsanswersincludingreadhttpgovernmentreadyeah
trybitimportantbusinesscauseseasonfactwanted
yourselfanythingbasedorderwwwtoldmoneybit
checkgettingmustlovebabytodayactuallyworking
importantproblembusinessbooksyeahdidnbookstarted
pagedoesnhealthinformationfeelcitysomeonedidn
easyfeelprovideaddgonnamanmanactually
createanyonewithinfullgirlnightdoingdone
setdontoftenproductwannasecondevertell
listkeepsocialfamilyheartnewsbusinessplay
+ +Table 6: Top-15 keywords per class extracted by baseline methods. + +Keywords: SVMs + +![](images/93f556af7e57e818c6ad4f13e267935d0a8fa7d33e9e8ce7061388a1d00511db.jpg) + +Keywords: TF-IDF + +![](images/fe1f6cc914602e10c88e68d288210c20031734a55f118bf5c2fdce171e4dfc5f.jpg) +Figure 6: The lexical space of CORE and the keywords extracted with SVMs (upper panel) and TF-IDF (lower panel) are colored based on the class. + +H H IN LY OP + +Class ID IP NA \ No newline at end of file diff --git a/explainingclassesthroughstablewordattributions/images.zip b/explainingclassesthroughstablewordattributions/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5f2a801df3da64c59d677abec35f950f8301550c --- /dev/null +++ b/explainingclassesthroughstablewordattributions/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d31e3bea29f0078d4b662061f752b23f69fdc72987e71aec1a2342fc76cab6f1 +size 783135 diff --git a/explainingclassesthroughstablewordattributions/layout.json b/explainingclassesthroughstablewordattributions/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ffd3c001c981fde41051cf79398e69eefa5d510d --- /dev/null +++ b/explainingclassesthroughstablewordattributions/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:220f5b8f9664828550f3cc2026518737722965ba4a2a7a55894c2457e5327d04 +size 358738 diff --git a/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_content_list.json b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..481882718580642359ccc0a1b2c15e3d02ce511d --- /dev/null +++ b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc1ea295e255f4ae35c01efdf74697a240f1bd1b888f51f536a9baec48bbb2c3 +size 72013 diff --git a/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_model.json b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b24502d26107665ae3ea9b7485c45e4d77dc8a54 --- /dev/null +++ b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35c6844e74b3e2d9c2ed635ae95c9f1dcc1e17ced15e07e3fa5e6fa9d92eaad4 +size 85521 diff --git a/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_origin.pdf b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..590ab9edfc5acf9ae879cd4f9b8e1ecf077419b5 --- /dev/null +++ b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/8e1be7c2-f38d-47c0-9c23-81a5d9357bbd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c3e4d58a57475f05c0c4d8e0dd2a59123941642768b0c93f28365cdfba39850 +size 712984 diff --git a/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/full.md b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/full.md new file mode 100644 index 0000000000000000000000000000000000000000..453406393ed7874390a00554534bdca8b9e3d21d --- /dev/null +++ b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/full.md @@ -0,0 +1,291 @@ +# Exploring the Capacity of a Large-scale Masked Language Model to Recognize Grammatical Errors + +Ryo Nagata + +Konan University / Japan + +nagata-ac12022@ ml.hyogo-u.ac.jp. + +Manabu Kimura + +GRAS Group, Inc. / Japan + +manabu.kimura@gras-group.co.jp + +Kazuaki Hanawa + +RIKEN / Japan + +Tohoku University / Japan + +kazuaki.hanawa@riken.jp + +# Abstract + +In this paper, we explore the capacity of a language model-based method for grammatical error detection in detail. We first show that 5 to $10\%$ of training data are enough for a BERT-based error detection method to achieve performance equivalent to what a non-language model-based method can achieve with the full training data; recall improves much faster with respect to training data size in the BERT-based method than in the non-language model method. This suggests that (i) the BERT-based method should have a good knowledge of the grammar required to recognize certain types of error and that (ii) it can transform the knowledge into error detection rules by fine-tuning with few training samples, which explains its high generalization ability in grammatical error detection. We further show with pseudo error data that it actually exhibits such nice properties in learning rules for recognizing various types of error. Finally, based on these findings, we discuss a cost-effective method for detecting grammatical errors with feedback comments explaining relevant grammatical rules to learners. + +# 1 Introduction + +Recent studies have shown that masked language models pre-trained on a large corpus (hereafter, simply language models) achieve tremendous improvements over a wide variety of natural language processing tasks with fine-tuning. These results suggest that they are also effective in recognizing erroneous words and phrases, the task known as grammatical error detection. There has been, however, much less work on this aspect of grammatical error detection than in other tasks. One can argue that since language models are trained on language data produced by native speakers of a language (specifically, English in this paper), they might not + +work well on the target language data produced by non-native speakers of that language. In other words, English language models do not know at all about grammatical errors made by non-native speakers. Even apart from grammatical errors, the target language is different from the canonical English, meaning that it contains unnatural phrases and characteristic language usages that native speakers do not normally use, as Nagata and Whittaker (2013) demonstrate. These differences might affect performance of language model-based methods in grammatical error detection. + +Actually, researchers have reported on performance of language models on grammatical error detection and correction. Cheng and Duan (2020) and Kaneko and Komachi (2019) have shown that BERT (Devlin et al., 2019)-based methods improve grammatical error detection performance in Chinese and English, respectively. Kaneko et al. (2020) and Didenko and Shaptala (2019) have shown a similar tendency in grammatical error correction. While these studies empirically prove the effectiveness of language models in grammatical error detection and correction, the questions of why and where language models benefit error detection/correction methods are left unanswered. + +In this paper, we explore this aspect of language models in grammatical error detection to better answer the research questions. We first show that a BERT-based method incredibly quickly learns to recognize various types of error as summarized in Figure 1; it achieves only with 5 to $10\%$ of training data an $F_{1.0}$ that a non-language model-based method can achieve with the full training data (the details will be described in Sect. 4). This implies that the BERT-based method (i) should have a good knowledge of the grammar required to recognize certain types of error and (ii) can transform it into error detection rules by fine-tuning with very few + +![](images/6e8b053a12c0808df5815cd316c37099e362d93b2f09097f41df62ef60a6a887.jpg) +Figure 1: Detection Performance in Relation with Training Size (FCE). + +![](images/3fead7e654b18727c7fd164ac497a936b4ab5c5f10e2ea4ad904deba1a9027f1.jpg) + +training samples. Following this, we further show with real and pseudo error data why and where it gains in error detection, revealing the insights of language model-based methods. For instance, we show that the BERT-based method trained on few instances of a transitive verb with a preposition (e.g., *discuss about) can detect the same type of error in other verbs (e.g., *approach to and *attend in). Finally, based on these findings, we discuss a cost-effective method for detecting grammatical errors with feedback comments explaining relevant grammatical rules to learners. + +# 2 Related Work + +Rei (2017) shows it is useful for neural error detection models to introduce a secondary language model objective together with the main error detection objective. Rei and Yannakoudakis (2017) compare several other auxiliary training objectives including Part-Of-Speech (POS) tagging and error type identification and find that the language model objective is the most effective. This line of work suggests that grammatical error detection benefits from language modeling, although these studies use BiLSTM-based language models instead of masked language models trained on a large corpus. + +As mentioned in Sect. 1, several researchers have applied masked language models including BERT to grammatical error detection and correction. Cheng and Duan (2020) and Kaneko and Komachi (2019) show that error detection methods gain in recall and precision with the use of language models. Bell et al. (2019) use BERT-based contextual embeddings for grammatical error detection and compare it with other types of contextual embedding. They show the BERT-based context + +tual embeddings are effective in almost all error types provided by ERRANT (Bryant et al., 2017) although BERT is not fine-tuned in their study. Yuan et al. (2021) compare BERT, XLNet (Yang et al., 2019), ELECTRA (Clark et al., 2020) in grammatical error detection to show their effectiveness in grammatical error detection1. Kaneko et al. (2020) and Didenko and Shaptala (2019) also show performance improvements in grammatical error correction. To strengthen the findings of these previous studies, we will explore why and where error detection methods benefit from language models, revealing their generalization ability, in the following sections. + +There has been a long history of studies that investigate the linguistic knowledge of language models including the work by Li et al. (2021); Ettinger (2020); Warstadt et al. (2020) to name a few. A popular approach is to test whether a language model assigns higher likelihood to the appropriate word than an inappropriate one, given context. The linguistic knowledge to be explored ranges from syntactic/semantic knowledge to common sense. These studies mostly use (i) synthetic test data: sentences that are generated synthetically by using a certain kind of template or (ii) perturbed test data: sentences that are generated by perturbing a natural corpus. Our work is different from these previous studies in two points: (i) to our best knowledge, we examine linguistic phenomena that have never been explored before in the conventional studies (e.g., subjects marked with a preposition and errors involving the usages of transitive and intransitive verbs); (ii) we use a real learner corpus with real + +errors as our test data. + +Mita and Yanaka (2021) examine if an encoder-decoder neural network for grammatical error correction (not BERT-based) can learn the knowledge of grammar through the task of grammatical error correction. They target five error types: subject-verb agreement, verb form, word order, adjective/adverb comparison, noun number. They use both synthetic and real learner data. They report a negative answer to the research question except for word order errors. They also report that their model learns the knowledge to detect the target errors in their synthetic data. However, there is still room for debate in this argument because error positions tend to be rather obvious in their synthetic data (e.g., adjective forms erroneously used as adverbs almost always appear at the end of a sentence). Our study expands and deepens their findings for a wider variety of error types that are much more difficult to detect (in that it requires a much wider range of linguistic knowledge including POS, lexical, and syntactic knowledge). + +# 3 Data and Methods + +# 3.1 Real and Pseudo Error Data + +In this paper, we use two kinds of data: real and pseudo data. Real data are error-annotated learner corpora while pseudo error data are automatically generated by perturbing a native English corpus. + +For the real data, we use four English learner corpora: the First Certificate of English error detection dataset (FCE) (Yannakoudakis et al., 2011); NUS Corpus of Learner English (NUCLE) (Dahlmeier et al., 2013); BEA-2019 shared task dataset (BEA) (Bryant et al., 2019); the International Corpus Network of Asian Learners of English with feedback comments (ICNALE) (Na + +gata et al., 2020). We use the data splits provided by the creator except for ICNALE where we randomly split the essays into training, development, and test sets in the ratios of $85\%$ , $7.5\%$ , and $7.5\%$ , respectively. Table 1 shows their statistics2. + +ICNALE provides information about errors in preposition use and their corresponding feedback comments. We use it to investigate in detail why and where language model-based methods gain an advantage. Their essay topics are controlled; they are written on either (a) It is important for college students to have a part-time job. or (b) Smoking should be completely banned at all the restaurants in the country., which hereafter will be referred to as PART-TIME JOB and SMOKING, respectively. Each essay is manually annotated with errors in preposition use and their corresponding feedback comments. For example, the major errors in the corpus include deverbal prepositions (e.g., *include → including), intransitive verbs with a direct object (e.g., *agree it → agree with it), a verb phrase used as a noun phrase (*Learn English is difficult. → To learn/Learning English is difficult.), and comparison between a phrase and a clause (e.g., *because an error → because of an error); see the work (Nagata et al., 2020) for the details. + +To investigate the relationship between the number of training sentences and detection performance, we randomly sample 100, 300, 500, 1,000, 3,000, 5,000, 10,000, and all sentences, resulting in eight sets of training data for each corpus3. Note that these training, development, and test sets con + +2The data development is still ongoing in the work (Nagata, 2019). For this work, we used data that had not been open to the public yet from the developer. +3In the sub-corpora A and C in BEA, only seven sets are used because they consist of less than 10,000 sentences. + +
Split +StatisticssentsTraining +tokenserrorsDevelopmentsentsTest +tokenserrors
sentstokenserrors
FCE27,380435,76841,2772,12933,7203,3352,58140,4984,374
ICNALE
PART-TIME JOB12,163205,3552,4391,12918,2762441,04217,192222
SMOKING12,312201,3042,3421,16018,2422301,02317,318212
BEA
A9,244160,81824,5201,01417,4172,5661,01418,1062,801
B11,410207,25220,5801,26122,4352,2611,26122,8062,362
C9,410179,1568,6491,02019,0359901,02020,3921,052
NUCLE16,969433,78738,7232,12054,7994,0192,12056,8044,406
+ +Table 1: Statistics on Real Datasets. + +tain error-free sentences. + +For the pseudo error data, we use the 1998-2000 New York Times in the AQUAINT Corpus of English News Text (Graff, 2002) as a base corpus. We automatically generate erroneous sentences by injecting errors into them (one error per sentence). We first obtain chunks and parses by using $\mathsf{spaCy}^4$ . Here, we only use sentences whose lengths are longer than three tokens and shorter than 26 to obtain reliable chunks and parses. We then add, remove, or replace a word in the sentences based on the analyses. + +While we target all errors labeled as errors in the real data, we only target the following five error types in the pseudo error data: + +Prepositional infinitive: to-infinite with other prepositions than to. + +(e.g., a book to read $\rightarrow$ *a book for read) + +Subject verb: Verb phrases used as a subject (e.g., *Learn English is difficult.) + +Preposition + subject: Subjects used with a preposition + +(e.g., *In the restaurant serves good food.) + +Transitive verb + preposition: Transitive verbs used with a preposition + +(e.g., *We discussed about it.) + +Intransitive verb + object: Intransitive verbs taking a direct object + +(e.g., *We agree it.) + +These five error types are selected with the following two criteria: (i) they are major errors in ICNALE; (ii) we can write a software program to generate pseudo errors based on chunks and parses. For example, we can find the subject of a sentence from its parse and then can add a randomly-chosen preposition before the subject noun phrase (e.g., The restaurant serves good food. $\rightarrow$ *In the restaurant serves good food.). We randomly choose one of the following five prepositions: at, about, to, in, and with for addition and replacement; an exception is that we only use for "Prepositional infinitive" (e.g., a book to read $\rightarrow$ *a book for read), which often appears in ICNALE. Similarly, we can extract pairs of a verb and its direct object from parses and then can add one of the prepositions before the direct object noun phrase as in discuss the matter $\rightarrow$ *discuss about the matter. We select the following transitive verbs as our targets: in training/development data: answer, attend, + +discuss, inhabit, mention, oppose, and resemble; in test data: approach, consider, enter, marry, obey, reach, visit. Similarly, we select the following intransitive verbs: in training/development data: agree, belong, disagree, and relate; in test data: apply, graduate, listen, specialize, worry. It should be emphasized that there is no overlap of the target transitive/intransitive verbs in the training/development and test data. + +From the resulting pseudo error data, we randomly sample $2^k (1 \leq k \leq 10)$ sentences for each error type, resulting in ten sets of training data (e.g., when $k = 1$ , the set comprises two instances of each error type, ten instances in total). We use these training sets to estimate the relationship between the number of training sentences and detection performance. For a validation set, we randomly sample 200 sentences for each error type. Similarly, we use a test set consisting of 200 sentences randomly sampled for each error type plus another 200 error-free sentences. The validation and test sets are fixed regardless of the training data. + +# 3.2 Grammatical Error Detection Methods + +This subsection describes the three methods to be explored and compared. Before looking into them, let us define grammatical error detection formally. Grammar error detection can be solved as a token classification problem5. We will denote a sequence of words and its length by $w_{1}, \ldots, w_{i}, \ldots, w_{N}$ and $N$ , respectively. We will denote the corresponding sequence of labels by $l_{1}, \ldots, l_{i}, \ldots, l_{N}$ where $l_{i}$ corresponds to the label of $w_{i}$ . We assume two sets of labels: (i) either C or E denoting correct or erroneous in the real data, respectively; and (ii) $K$ labels for $K$ error types plus C for correct in the pseudo error data. Then, grammatical error detection is defined as a problem of predicting the optimal label sequence given $w_{1}, \ldots, w_{i}, \ldots, w_{N}$ . + +We use neural networks to predict the optimal label sequence. In this paper, training is repeated five times with different (but fixed) random seeds. The reported performance values (i.e., recall, precision, and $F_{1.0}$ ) are averaged over the five runs. Training epochs are 50 for the real data or ten for the pseudo error data at the maximum and we adopt + +the epoch achieving the best $F_{1,0}$ on the development set. Other major hyper parameters are shown in Appendix A. + +# 3.2.1 BERT-based Method + +The BERT-based method takes as input a word sequence $w_{1},\ldots ,w_{i}\ldots ,w_{N}$ and conducts the following procedures: + +(1) Subword: convert all $w_{i}$ into their corresponding subwords: $s_1, \ldots, s_j, \ldots, s_M$ . Note that the total number of all subwords are generally different from that of all words in the input word sequence. +(2) Encode: encode all $s_j$ into BERT embeddings $b_{j}$ by: + +$$ +b _ {j} = \operatorname {B E R T} \left(s _ {j}\right) \tag {1} +$$ + +where $\mathrm{BERT}(\cdot)$ denotes BERT taking subwords as input and outputs their corresponding embedding vectors of $h$ -dimension (specifically, $h = 768$ for 'bert-base') from the final layer. We use 'bert-base-uncased' for $\mathrm{BERT}(\cdot)$ . + +(3) Token classification: output the optimal labels by: + +$$ +l _ {i} = \arg \max \operatorname {s o f t m a x} \left(W b _ {j}\right) \tag {2} +$$ + +where $W$ is a $k \times h$ weight matrix where $k$ is either 2 or $K + 1$ (the number of different labels). To take care of the difference in the lengths of the input word sequence and the corresponding subword sequence, only the first subword of each word is considered in prediction. + +# 3.2.2 Methods to Be Compared + +For comparison, we select a BiLSTM-based error detection method. Basically, it follows the above steps (1) to (3), but uses BiLSTM as an encoder in place of BERT. Also, the input word sequence is turned into a sequence of embedding vectors where each embedding vector consists of the concatenation of the conventional word embedding and a character-based embedding. The character-based embedding is obtained by another BiLSTM taking the characters of each word following the work (Akbik et al., 2018). The concatenated embeddings are put into the encoder BiLSTM to produce vectors for prediction in step (3). Specifically, we use the implementation FLAIR (Akbik et al., 2019). We + +will refer to this method for comparison as the BiLSTM-based method hereafter. + +We also investigate how effective the fine-tuning of BERT is. Namely, the BERT part of the BERT-based method is fixed during training and only the output layer is adjusted by the training data. We will refer to this method as the BERT-based method without BERT training hereafter. + +# 4 Performance on Real Data + +Figure 1 (see the second page) to Figure 3 show the relationship between the number of training sentences and $F_{1.0}$ in $\mathrm{FCE^6}$ , NUCLE, and BEA with its corresponding precision-recall curves, respectively. All $F_{1.0}$ graphs show the high generalization ability of the BERT-based method. They also show that the BERT-based method exhibits a performance saturation at a very early stage (1,000-3,000 training sentences). It is worthwhile to point out the fact that the $F_{1.0}$ curves for all proficiency levels (A, B, and C)7 in BEA (Figure 3) exhibit the same trend as the other corpora although the absolute performances differ depending on the levels. These results empirically confirm that the high generation ability of the BERT-based method holds in various writer populations. + +Unlike the BERT-based method, the BiLSTM-based method improves steadily as the number of training sentences increases although even with the full training data, it only achieves an $F_{1.0}$ that the BERT-based method can achieve with only 500 or less training sentences. Also, the BERT-based method without BERT training does not perform well at all. This is probably because it requires much more degrees of freedom in terms of the network parameters to learn rules for detecting a wide variety of grammatical errors, which have a certain degree of complexity. + +To investigate the results from a different point of view, let us now consider precision-recall curves + +![](images/2bf7b0a5ebc2e8a5c965a9e90964e0903056f9ea85ea959252162382f957e4b4.jpg) +Figure 2: Detection Performance in Relation with Training Size (NUCLE). + +![](images/7ab484eca95dd5b05bc9a86b4687d11b573d09d8f1bd778487abf0ffa70cbd8e.jpg) + +![](images/de74786628a5b5241abd1ea2c953982118ab8f141d6862c84612232b44f5fded.jpg) +Figure 3: Detection Performance in Relation with Training Size (BEA). Essays in BEA are classified into three categories A, B, and C corresponding to the CEFR levels. The categories are referred to by the labels such as "A:BERT" and "B:BERT" in the legend. + +![](images/9a3fc6ff139d4717925011927d2f389505a2a305a04593ff820e00755fd5230d.jpg) + +(the right graphs; the numbers at the edges of each curve correspond to the numbers of minimum and maximum training sentences and the plots are lined in minimum to maximum order). All precision-recall curves show that only the BERT-based method quickly improves in recall as the number of training sentences increases while the BERT-based and BiLSTM-based methods both improve in precision. In other words, only the BERT-based method learns to recognize various error types with little exposure to error examples. + +Figure 4 shows recalls per detailed error types in $\mathrm{FCE^8}$ where error types are automatically obtained by using ERRANT. Figure 4 shows that the BERT-based method quickly achieves a good recall in SPELL (spelling errors) while the BiLSTM-based + +method shows a much milder rise. This is not surprising considering that BERT is trained on large native corpora. Namely, it virtually has a large vocabulary list and knows about English spellings well. More interestingly, it exhibits a performance saturation at a very early stage (500-3,000 training sentences) in all errors, resulting in log-like-shape curves while the BiLSTM-based method improves rather linearly (except for SPELL). Even more interestingly, it shows a sharp rise in recall in DET (determiner errors) and NOUN:NUM (errors in noun number). The notion of noun countability with POS plays an important role in detecting these two types of error as in *I am student/countable. and an evidence/uncountable. This suggests that BERT contains some kind of knowledge corresponding to noun countability and POS (singular/plural nouns). More generally, from these, one + +![](images/7b89352582bd94f7dbc916365aae89af74757c662b7246320f16bda4147d2e9f.jpg) +Figure 4: Detection Performance (Recall) per Error Type in Relation with Training Size (FCE). + +![](images/897832668faa2b274ed48cfda6b791341ad50803278aa68bd136ec2ac3a66923.jpg) + +![](images/3dc2489d496d71619d574c381ee74e1b4ac1bcc189ca96f8cb7812d9bd431269.jpg) +Figure 5: Detection Performance in Relation with Training Size (ICNALE, in-domain test data). + +![](images/81102238328d56eb5ba2fad984ac26bf6230a4ad1bc18ed58b3c902d3fe54066.jpg) + +can expect that it has broad knowledge about linguistic properties, which we will observe presently in the experiments with ICNALE. + +Let us then turn to ICNALE where we only target errors concerning preposition use (meaning that the other errors are unmarked and that if other errors are detected, they are treated as false positives). Here, we only present performance on PART-TIME JOB due to the space limitation; the results for SMOKING exhibit a very similar tendency, which can be found in Appendix B. + +Figure 5 and Figure 6 show performance in PART-TIME JOB in ICNALE; in Figure 5, all models are trained on essays on PART-TIME JOB and tested on (test) essays on the same topic (domain setting) while in Figure 6, they are trained on SMOKING and tested on PART-TIME JOB (out-of-domain setting). In both settings, 300 to 500 training sentences are again enough for the BERT-based method to rival the BiLSTM-based method with the full training data, which exhibits again a linear improvement in $F_{1.0}$ . Also, only the BERT-based method quickly improves in recall. + +A closer look at the detection results reveals that many of the errors require linguistic knowledge including POS, syntactic relations, and lexical properties such as transitive/intransitive verbs. For example, "Preposition + subject" errors, which were introduced in Subsect. 3.1, require the notions of POS such as verbs and syntactic relations such as subjects. Similarly, the distinction between transitive and intransitive verbs play a crucial role in "transitive verb + preposition" and "intransitive verb + object". The fact that the BERT-based method can detect these types of errors with a few training instances suggest that it has an access to grammar-like knowledge and that it can turn the knowledge into error detection rules by fine-tuning. We will explore this in more detail in the following section. + +These results also shed light on an important aspect of the BERT-based method in practice. Namely, a cost-effective way of developing an error detection system based on BERT would be to create a small amount of training sentences (e.g., 1,000) for each essay topic; according to the above + +![](images/db8388037f2dfbc0df7bb2f58c78a9315561d113409abdb989b7709675971941.jpg) +Figure 6: Detection Performance in Relation with Training Size: (ICNALE, out-of-domain test data). + +![](images/0bf4ff67074fa20a6bda7dbb5b046f643d2cdba1aaed788bc95f72aea467cde6.jpg) + +figures, the gain would be much smaller after 1,000 training sentences. Of course, the results are only for a simple BERT-based method. No one knows how differently the performance curves grow with different architectures and/or with a much larger set of training instances. It will be interesting to investigate these points for future work. + +# 5 Performance on Synthetic Data + +In the previous section, we have seen that the BERT-based method has a much higher generalization ability in grammatical error detection. To analysis this phenomenon in detail, we now turn to detection performance of the BERT-based method on the pseudo error data. As described in Subsect. 3.1, we train it on the ten sets of training data (i.e., 2, 4, ..., 1024 training sentences for each error type) and test the trained models on the fixed test set. Doing so, we estimate the relationship between the number of training sentences and detection performance for each error type. + +Figure 7 shows the relationship between the size of training data and $F_{1.0}$ for each error type where the size is measured by the number of sentences. Figure 7 reveals that the BERT-based method already recognizes some of the target errors at early stages (even with two or four training sentences). Performance goes much higher even with eight training sentences in most of the error types with an exception of the error type "Intransitive verb + object". For instance, the BERT-based method recognizes more than half of the "Preposition + subject" errors with a precision of 0.800 only with eight training instances. This implies again that BERT has certain knowledge about the notions of POS such as verbs and syntactic relations such as subjects; otherwise, it would be difficult to achieve + +![](images/ab235689c762cc78c6b6b99c5d021957f1af87043516d78ce4059efed6a519a9.jpg) +Figure 7: Detection Performance $(F_{1,0})$ per Error Type in Relation with Training Size: Synthetic Data. + +a similar performance in this type of error considering that the noun phrase of a subject and its position in the sentence considerably vary depending on the target sentence. + +The same argument applies to "transitive verb + preposition" and "intransitive verb + object". It should be emphasized that the BERT-based method has to detect errors in verbs that never appear in the training data; recall that there is no overlap of the target transitive/intransitive verbs in the training and test data. In other words, the BERT-based method can recognize unseen erroneous combinations, for example, *visited in Atlanta (transitive verb + preposition type) and *specialized environ- + +mental litigation (intransitive verb + direct object error type) after just seeing *mention in, discussed about and *were related drugs and belongs Lon's grandmother. These training and test sentences have almost nothing in common except that they are the combinations of transitive/intransitive verbs and prepositions/objects. Besides, the fact that correct combinations of other verbs and prepositions/objects often appear in the test data makes the task even more difficult without the knowledge of POS and syntactic relations. These findings support the hypotheses that BERT has linguistic knowledge and that it can turn the knowledge into error detection rules by fine-tuning. + +# 6 Exploration for Cost-Effective Error Detection with Feedback Comments + +The findings we have obtained so far bring out the possibility that one can implement with few training instances a system that accurately detects grammatical errors and recognizes their detailed error types. For example, manually or automatically, by creating few instances of the erroneous combination of transitive verbs and prepositions as we saw in the previous sections (e.g., *discuss about), one can develop a system detecting the same type of error in other transitive verbs and prepositions (e.g., *attend in it). With the detailed error types, the system can also output feedback comments to the user such as Transitive verbs do not take a preposition. Instead, they take a direct object instead of just indicating them as preposition errors. + +As a pilot study, we trained the BERT-based method on the pseudo error data and tested it on the real (learner) data to examine the above possibility. To achieve it, we manually annotated the real data with the target five error types based on the feedback comments available in ICNALE. + +Figure 8 shows the results. It reveals that the BERT-based method trained on the pseudo data does not perform on the real data as well as on the pseudo data. Performance growths stop at an early stage (around eight training sentences). A possible reason for this is that in the real data, multiple errors often appear in a sentence. Also, multiple errors in a sentence can range over multiple types of error. Besides, the error rate is much lower in the real data than in the pseudo error data where one error occurs per sentence except 200 error-free sentences (although multiple types of error appear in the whole data set). These conditions make the + +![](images/f1b6cde05c0149a5b0cd678e807a61b119492f9d8d2b88d180251207310273d8.jpg) +Figure 8: Detection Performance $(F_{1.0})$ on per Error Type in Relation with Training Size: Trained on Synthetic Data; Tested on Real Data (PART-TIME JOB and SMOKING merged). + +task much more difficult on the real data, as Flachs et al. (2019) demonstrate. + +Having said that, the results shown in Figure 7 still encourage us to develop language model-based systems with a small amount of in-domain training data in order to detect grammatical errors with detailed error types. One possible way to achieve it is to sample sentences from unannotated essays written on the target topic, and then to annotate them with the specific error types that the developer wants to give feedbacks to learners. This will naturally mitigate the problems caused by the multiple-type multiple error situation and the error rate difference. One can also manually create sample error sentences (and their correct versions). + +# 7 Conclusions + +In this paper, we have explored the capacity of a large-scale masked language model to recognize grammatical errors. Our findings are summarized in the following three points: (1) Experiments with the real learner data show that a BERT-based error detection method has a much higher generalization ability in grammatical error detection than a non-language model-based method, and the first performance saturation comes at the point of around 1,000-3,000 training instances; (2) It starts to recognize the target errors involving a wide variety of grammatical knowledge with very few instances of them; (3) The high generalization ability brings out its potential for developing systems that detect and explain grammatical errors with very few training instances. + +# Acknowledgments + +This work was partly supported by Japan Science and Technology Agency (JST), PRESTO Grant Number JPMJPR1758, Japan. This work was partly conducted by using computational resource of AI Bridging Cloud Infrastructure (ABCI) provided by National Institute of Advanced Industrial Science and Technology (AIST). + +# References + +Alan Akbik, Tanja Bergmann, Duncan Blythe, Kashif Rasul, Stefan Schweter, and Roland Vollgraf. 2019. FLAIR: An easy-to-use framework for state-of-the-art NLP. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations), pages 54-59, Minneapolis, Minnesota. Association for Computational Linguistics. +Alan Akbik, Duncan Blythe, and Roland Vollgraf. 2018. Contextual string embeddings for sequence labeling. In Proceedings of the 27th International Conference on Computational Linguistics, pages 1638-1649, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Samuel Bell, Helen Yannakoudakis, and Marek Rei. 2019. Context is key: Grammatical error detection with contextual word representations. In Proceedings of the Fourteenth Workshop on Innovative Use of NLP for Building Educational Applications, pages 103-115. Association for Computational Linguistics. +Christopher Bryant, Mariano Felice, Øistein E. Andersen, and Ted Briscoe. 2019. The BEA-2019 shared task on grammatical error correction. In Proceedings of 14th Workshop on Innovative Use of NLP for Building Educational Applications, pages 52–75, Florence, Italy. Association for Computational Linguistics. +Christopher Bryant, Mariano Felice, and Ted Briscoe. 2017. Automatic annotation and evaluation of error types for grammatical error correction. In Proceedings of 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 793-805. +Yong Cheng and Mofan Duan. 2020. Chinese grammatical error detection based on BERT model. In Proceedings of 6th Workshop on Natural Language Processing Techniques for Educational Applications, pages 108-113. Association for Computational Linguistics. +Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. 2020. ELECTRA: Pretraining text encoders as discriminators rather than generators. In International Conference on Learning Representations. + +Daniel Dahlmeier, Hwee Tou Ng, and Siew Mei Wu. 2013. Building a large annotated corpus of learner English: The NUS corpus of learner English. In Proceedings of 8th Workshop on Innovative Use of NLP for Building Educational Applications, pages 22-31, Atlanta, Georgia. Association for Computational Linguistics. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of 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. +Bohdan Didenko and Julia Shaptala. 2019. Multi-headed architecture based on BERT for grammatical errors correction. In Proceedings of 14th Workshop on Innovative Use of NLP for Building Educational Applications, pages 246-251. +Allyson Ettinger. 2020. What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models. Transactions of the Association for Computational Linguistics, 8:34-48. +Simon Flachs, Ophélie Lacroix, Marek Rei, Helen Yannakoudakis, and Anders Søgaard. 2019. A simple and robust approach to detecting subject-verb agreement errors. In Proceedings of 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 2418–2427. Association for Computational Linguistics. +David Graff. 2002. The aquaint corpus of english news text. +Masahiro Kaneko and Mamoru Komachi. 2019. Multihead multi-layer attention to deep language representations for grammatical error detection. +Masahiro Kaneko, Masato Mita, Shun Kiyono, Jun Suzuki, and Kentaro Inui. 2020. Encoder-decoder models can benefit from pre-trained masked language models in grammatical error correction. In Proceedings of 58th Annual Meeting of the Association for Computational Linguistics, pages 4248-4254. Association for Computational Linguistics. +Bai Li, Zining Zhu, Guillaume Thomas, Yang Xu, and Frank Rudzicz. 2021. How is BERT surprised? layerwise detection of linguistic anomalies. In Proceedings of 59th Annual Meeting of the Association for Computational Linguistics and 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 4215-4228, Online. +Masato Mita and Hitomi Yanaka. 2021. Do grammatical error correction models realize grammatical generalization? In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages + +4554-4561. Association for Computational Linguistics. +Ryo Nagata. 2019. Toward a task of feedback comment generation for writing learning. 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 3206-3215, Hong Kong, China. Association for Computational Linguistics. +Ryo Nagata, Kentaro Inui, and Shin'ichiro Ishikawa. 2020. Creating corpora for research in feedback comment generation. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 340-345, Marseille, France. European Language Resources Association. +Ryo Nagata and Edward Whittaker. 2013. Reconstructing an Indo-European family tree from non-native English texts. In Proceedings of 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1137-1147, Sofia, Bulgaria. Association for Computational Linguistics. +Marek Rei. 2017. Semi-supervised multitask learning for sequence labeling. In Proceedings of 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2121-2130. +Marek Rei and Helen Yannakoudakis. 2017. Auxiliary objectives for neural error detection models. In Proceedings of 12th Workshop on Innovative Use of NLP for Building Educational Applications, pages 33-43. Association for Computational Linguistics. +Alex Warstadt, Alicia Parrish, Haokun Liu, Anhad Mohananey, Wei Peng, Sheng-Fu Wang, and Samuel R. Bowman. 2020. BLiMP: The benchmark of linguistic minimal pairs for English. Transactions of the Association for Computational Linguistics, 8:377-392. +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime G. Carbonell, Ruslan Salakhutdinov, and Quoc V. Le. 2019. XLNet: Generalized autoregressive pretraining for language understanding. In Proceedings of 33rd Conference on Neural Information Processing Systems, pages 5753-5763. +Helen Yannakoudakis, Ted Briscoe, and Ben Medlock. 2011. A new dataset and method for automatically grading ESOL texts. In Proceedings of 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 180-189. +Zheng Yuan, Shiva Taslimipoor, Christopher Davis, and Christopher Bryant. 2021. Multi-class grammatical error detection for correction: A tale of two systems. In Proceedings of 2021 Conference on Empirical Methods in Natural Language Processing, pages 8722-8736, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. + +# A Hyper parameter settings + +Table 2 shows major hyper parameters used in the experiments. Note that when we use the pseudo error data for training, the number of training sentences can be as small as ten, and we use a rather small batch of five; otherwise we use 32. + +
Batch size5 or 32
OptimizationAdam with decoupled weight decay regularization
Learning rate5e-5, (0.9, 0.999)
Epsilon1e-8
Weight decay1e-2
+ +Table 2: Major Hyper parameters. + +# B Performance on SMOKING in ICNALE + +![](images/1938ba0a8e7817ce78a3c9e02113a8c3b03451ef2209208dc7e1c577df660da9.jpg) +Figure 9 and Figure 10 show performance in SMOKING in ICNALE. We can see the same ten + +dency as in Figures 5 and 6. + +![](images/25f3066184025b1d2bf86f5a1e36da7cfcfc0a5bb9e0dba3bb6766d464a3636e.jpg) +Figure 9: Detection Performance in Relation with Training Size (ICNALE, in-domain test data). + +![](images/e9cae636c758a3f68235fe1a53d977988b9c589076829eba86bfa0dd4714d310.jpg) +Figure 10: Detection Performance in Relation with Training Size: (ICNALE, out-of-domain test data). + +![](images/17bc81f461396a676a33d20cbb8ef60efb4e4aacecaf9c977088c77e8dd4ea1d.jpg) \ No newline at end of file diff --git a/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/images.zip b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d01600d67a560610d19489367fe16c4d03916009 --- /dev/null +++ b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:477f9d9a4836cbee03e8272a39c6b25f006a07c4ebb1838053ebfc945578ce7f +size 702592 diff --git a/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/layout.json b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fb246500f05d31c28d8a15cc7755a05faae60a50 --- /dev/null +++ b/exploringthecapacityofalargescalemaskedlanguagemodeltorecognizegrammaticalerrors/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca84559edf2766e42d816b9595658ec4c9a8c8868eede38f7ac8acf39540aa15 +size 319434 diff --git a/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_content_list.json b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0e3bad7276550313a567e31e7c160cf4b8ee9b85 --- /dev/null +++ b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5c840fab4207a53799a7a1d70a9703ac5d6e8150470d012c49bd0ab0e7e91cc +size 95399 diff --git a/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_model.json b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ff37cc8eb01a7c0c2e8fec30ea312cb1d17751a6 --- /dev/null +++ b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a25f8ecd669376265f3e05c7ec8261fd7d4dbe03f73371eecace1f53c0345a4f +size 113663 diff --git a/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_origin.pdf b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b6540353a633dd9b56607b0bc73a7cea4e4814e2 --- /dev/null +++ b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/df115bc8-11fa-4b0b-9d08-91ab89632a7c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65b8649ad4a2eef2129c4ede8037dbe2777eaa3598339a19469413f35dce6463 +size 482024 diff --git a/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/full.md b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b2c155d36f58796c59a96910f5db94b36ae4967f --- /dev/null +++ b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/full.md @@ -0,0 +1,420 @@ +# Exploring the Impact of Negative Samples of Contrastive Learning: A Case Study of Sentence Embedding + +Rui Cao $^{1,*}$ and Yihao Wang $^{1,*}$ and Yuxin Liang $^{1}$ + +Ling Gao $^{1,\dagger}$ and Jie Zheng $^{1}$ and Jie Ren $^{2}$ and Zheng Wang $^{3}$ + +$^{1}$ Northwest University, $^{2}$ Shaanxi Normal University, and $^{3}$ University of Leeds + +{caorui, wangyihao, liangyuxin}@stumail.nwu.edu.cn, + +{gl, jzheng}@nwu.edu.cn, renjie@snnu.edu.cn, z.wang5@leeds.ac.uk + +# Abstract + +Contrastive learning is emerging as a powerful technique for extracting knowledge from unlabeled data. This technique requires a balanced mixture of two ingredients: positive (similar) and negative (dissimilar) samples. This is typically achieved by maintaining a queue of negative samples during training. Prior works in the area typically uses a fixed-length negative sample queue, but how the negative sample size affects the model performance remains unclear. The opaque impact of the number of negative samples on performance when employing contrastive learning aroused our in-depth exploration. This paper presents a momentum contrastive learning model with negative sample queue for sentence embedding, namely MoCoSE. We add the prediction layer to the online branch to make the model asymmetric and together with EMA update mechanism of the target branch to prevent the model from collapsing. We define a maximum traceable distance metric, through which we learn to what extent the text contrastive learning benefits from the historical information of negative samples. Our experiments find that the best results are obtained when the maximum traceable distance is at a certain range, demonstrating that there is an optimal range of historical information for a negative sample queue. We evaluate the proposed unsupervised MoCoSE on the semantic text similarity (STS) task and obtain an average Spearman's correlation of $77.27\%$ . Source code is available here. + +# 1 Introduction + +In recent years, unsupervised learning has been brought to the fore in deep learning due to its ability to leverage large-scale unlabeled data. Various unsupervised contrastive models is emerging, continuously narrowing down the gap between supervised and unsupervised learning. Contrastive learning + +suffers from the problem of model collapse, where the model converges to a constant value and the samples all mapped to a single point in the feature space. Negative samples are an effective way to solve this problem. + +In computer vision, SimCLR from Chen (Chen et al., 2020) and MoCo from He (He et al., 2020) is known for using negative samples and get the leading performance in the contrastive learning. SimCLR uses different data augmentation (e.g., rotation, masking, etc.) on the same image to construct positive samples, and negative samples are from the rest of images in the same batch. MoCo goes a step further by randomly select the data in entire unlabeled training set to stack up a first-in-first-out negative sample queue. + +Recently in natural language processing, contrastive learning has been widely used in the task of learning sentence embedding. One of current state-of-the-art unsupervised method is SimCSE (Gao et al., 2021). Its core idea is to make similar sentences in the embedding space closer while keeping dissimilar away from each other. SimCSE uses dropout mask as augmentation to construct positive text sample pairs, and negative samples are picked from the rest of sentences in the same batch. The mask adopted from the standard Transformer makes good use of the minimal form of data augmentation brought by the dropout. Dropout results in a minimal difference without changing the semantics, reducing the negative noise introduced by augmentation. However, the negative samples in SimCSE are selected from the same training batch with a limited batch size. Our further experiments show that SimCSE does not obtain improvement as the batch size increases, which arouses our interest in using the negative sample queue. + +To better digging in the performance of contrastive learning on textual tasks, we build a contrastive model consisting of a two-branch structure and a negative sample queue, namely MoCoSE + +(Momentum Contrastive Sentence Embedding with negative sample queue). We also introduce the idea of asymmetric structure from BYOL (Grill et al., 2020) by adding a prediction layer to the upper branch (i.e., the online branch). The lower branch (i.e., the target branch) is updated with exponential moving average (EMA) method during training. We set a negative sample queue and update it using the output of target branch. Unlike directly using negative queue as in MoCo, for research purpose, we set an initialization process with a much smaller negative queue, and then filling the entire queue through training process, and update normally. We test both character-level (e.g., typo, back translation, paraphrase) and vector-level (e.g., dropout, shuffle, etc.) data augmentations and found that for text contrastive learning, the best results are obtained by using FGSM and dropout as augmentations. + +Using the proposed MoCoSE model, we design a series of experiments to explore the contrastive learning for sentence embedding. We found that using different parts of samples from the negative queue leads to different performance. In order to test how much text contrastive learning benefit from historical information of the model, we proposed a maximum traceable distance metric. The metric calculates how many update steps before the negative samples in the queue are pushed in, and thus measures the historical information contained in the negative sample queue. We find that the best results can be achieved when the maximum traceable distance is within a certain range, reflected in the performance of uniformity and alignment of the learned text embedding. Which means there is an optimal interval for the length of negative sample queue in text contrastive learning model. + +# Our main contributions are as follows: + +1. We combine several advantages of frameworks from image contrastive learning to build a more generic text unsupervised contrastive model. We carried out a detailed study of this model to achieve better results on textual data. +2. We evaluate the role of negative queue length and the historical information that the queue contains in text contrastive learning. By slicing the negative sample queue and using different positions of negative samples, we found those near the middle of the queue provides a better performance. +3. We define a metric called 'maximum traceable distance' to help analyze the impact of negative + +sample queue by combining the queue length, EMA parameter, and batch size. We found that changes in MTD reflects in the performance of uniformity and alignment of the learned text embedding. + +# 2 Related Work + +# Contrastive Learning in CV + +Contrast learning is a trending and effective unsupervised learning framework that was first applied to the computer vision (Hadsell et al., 2006). The core idea is to make the features of images within the same category closer and the features in different categories farther apart. Most of the current work are using two-branch structure (Chen et al., 2021). While influential works like SimCLR and MoCo using positive and negative sample pairs, BYOL (Grill et al., 2020) and SimSiam (Chen and He, 2021) can achieve the same great results with only positive samples. BYOL finds that by adding a prediction layer to the online branch to form an asymmetric structure and using momentum moving average to update the target branch, can train the model using only positive samples and avoid model collapsing. SimSiam explores the possibility of asymmetric structures likewise. Therefore, our work introduces this asymmetric idea to the text contrastive learning to prevent model collapse. In addition to the asymmetric structure and the EMA mechanism to avoid model collapse, some works consider merging the constraint into the loss function, like Barlow Twins (Zbontar et al., 2021), W-MSE (Ermolov et al., 2021), and ProtoNCE (Li et al., 2021). + +# Contrastive Learning in NLP + +Since BERT (Devlin et al., 2018) redefined state-of-the-art in NLP, leveraging the BERT model to obtain better sentence representation has become a common task in NLP. A straightforward way to get sentence embedding is by the [CLS] token due to the Next Sentence Prediction task of BERT. But the [CLS] embedding is non-smooth anisotropic in semantic space, which is not conducive to STS tasks, this is known as the representation degradation problem (Gao et al., 2019). BERT-Flow (Li et al., 2020) and BERT-whitening (Su et al., 2021) solve the degradation problem by post-processing the output of BERT. SimCSE found that utilizing contrasting mechanism can also alleviate this problem. + +Data augmentation is crucial for contrastive learning. In CLEAR (Wu et al., 2020), word and + +phrase deletion, phrase order switching, synonym substitution is served as augmentation. CERT (Fang and Xie, 2020) mainly using back-and-forth translation, and CLINE (Wang et al., 2021) proposed synonym substitution as positive samples and antonym substitution as negative samples, and then minimize the triplet loss between positive, negative cases as well as the original text. ConSERT (Yan et al., 2021) uses adversarial attack, token shuffling, cutoff, and dropout as data augmentation. CLAE (Ho and Nvasconcelos, 2020) also introduces Fast Gradient Sign Method, an adversarial attack method, as text data augmentation. Several of these augmentations are also introduced in our work. The purpose of data augmentation is to create enough distinguishable positive and negative samples to allow contrastive loss to learn the nature of same data after different changes. Works like (Mitrovic et al., 2020) points out that longer negative sample queues do not always give the best performance. This also interests us how the negative queue length affects the text contrastive learning. + +# 3 Method + +Figure 1 depicts the architecture of proposed MoCoSE. In the embedding layer, two versions of the sentence embedding are generated through data augmentation (dropout $= 0.1$ and $fgsm = 5e - 9$ ). The resulting two slightly different embeddings then go through the online and target branch to obtain the query and key vectors respectively. The structure of encoder, pooled and projection of online and target branch is identical. We add a prediction layer to the online branch to make asymmetry between online and target branch. The pooled, projection and prediction layers are all composed of several fully connected layers. + +Finally, the model calculates contrasting loss between query, key and negative queue to update the online branch. In the process, key vector serves as positive sample with respect to the query vector, while the sample from queue serves as negative sample to the query. The target branch truncates the gradient and updated with the EMA mechanism. The queue is a first-in-first-out collection of negative samples with size $K$ which means it sequentially stores the key vectors generated from the last few training steps. + +The PyTorch style pseudo-code for training MoCoSE with the negative sample queue is shown in + +Algorithm 1 in Appendix A.3. + +Data Augmentation Comparing with SimCSE, we tried popular methods in NLP such as paraphrasing, back translation, adding typos etc., but experiments show that only adversarial attacks and dropout have improved the results. We use FGSM (Goodfellow et al., 2015) (Fast Gradient Sign Method) as adversarial attack. In a white-box environment, FGSM first calculates the derivative of model with respect to the input, and use a sign function to obtain its specific gradient direction. Then, after multiplying it by a step size, the resulting 'perturbation' is added to the original input to obtain the sample under the FGSM attack. + +$$ +x ^ {\prime} = x + \varepsilon \cdot \operatorname {s i g n} (\nabla_ {x} \mathcal {L} (x, \theta)) \tag {1} +$$ + +Where $x$ is the input to the embedding layer, $\theta$ is the online branch of the model, and $\mathcal{L}(\cdot)$ is the contrastive loss computed by the query, key and negative sample queue. $\nabla_{x}$ is the gradient computed through the network for input $x$ , $\text{sign}()$ is the sign function, and $\varepsilon$ is the perturbation parameter which it controls how much noise it added. + +EMA and Asymmetric Branches Our model uses EMA mechanism to update the target branch. Formally, denoting the parameters of online and target branch as $\theta_{o}$ and $\theta_{t}$ , EMA decay weight as $\eta$ , we update $\theta_{t}$ by: + +$$ +\theta_ {t} \leftarrow \eta \theta_ {t} + (1 - \eta) \theta_ {o} \tag {2} +$$ + +Experiments demonstrate that not using EMA leads to model collapsing, which means the model did not converge during training. The prediction layer we added on the online branch makes two branches asymmetric to further prevent the model from collapsing. For more experiment details about symmetric model structure without EMA mechanism, please refer to Appendix A.2. + +Negative Sample Queue The negative sample queue has been theoretically proven to be an effective means of preventing model from collapsing. Specifically, both the queue and the prediction layer of the upper branch serves to disperse the output feature of the upper and lower branches, thus ensuring that the contrastive loss obtains features with sufficient uniformity. We also set a buffer for the initialization of the queue, i.e., only a small portion of the queue is randomly initialized at the beginning, and then enqueue and dequeue normally until the end. + +![](images/e2b3b0b72c006e87ec228525b6558656788cedee4fee17c725feaf953b676bed.jpg) +Figure 1: The model structure of MoCoSE. The embedding layer consists of a BERT embedding layer with additional data augmentation. The pooled, projection, and predictor layers all keep the same dimensions with the encoder layer. The MoCoSE minimizes contrastive loss between query, queue and keys (i.e. InfoNCE loss). + +Contrastive Loss Similar to MoCo, we also use InfoNCE (Oord et al., 2018) as contrastive loss, as shown in eq.(3). + +$$ +\mathcal {L} = - \log \frac {\exp (q \cdot k / \tau)}{\exp (q \cdot k / \tau) + \sum_ {l} \exp (q \cdot l / \tau)} \tag {3} +$$ + +Where, $q$ refers to the query vectors obtained by the online branch; $k$ refers to the key vectors obtained by the target branch; and $l$ is the negative samples in the queue; $\tau$ is the temperature parameter. + +# 4 Experiments + +# 4.1 Settings + +We train with a randomly selected corpus of 1 million sentences from the English Wikipedia, and we conduct experiments on seven standard semantic text similarity (STS) tasks, including STS 2012-2016 (Agirre et al., 2012, 2013, 2014, 2015, 2016), STSBenchmark (Cer et al., 2017) and SICK-Relatedness (Wijnholds and Moortgat, 2021). The SentEval1 toolbox is used to evaluate our model, and we use the Spearman's correlation to measure the performance. We start our training by loading pre-trained BERT checkpoints2 and use the [CLS] token embedding from the model output as the sentence embedding. In addition to the semantic similarity task, we also evaluate on seven transfer learning tasks to test the generalization performance of the model. For text augmentation, we tried several vector-level methods mentioned in ConBERT, + +including position shuffle, token dropout, feature dropout. In addition, we also tried several text-level methods from the nlpaug $^3$ toolkit, including synonym replace, typo, back translation and paraphrase. + +Training Details The learning rate of MoCoSE-BERT-base is set to 3e-5, and for MoCoSE-BERT-large is 1e-5. With a weight decay of 1e-6, the batch size of the base model is 64, and the batch size of the large model is 32. We validate the model every 100 step and train for one epoch. The EMA decay weight $\eta$ is incremented from 0.75 to 0.95 by the cosine function. The negative queue size is 512. For more information please refer to Appendix A.1. + +# 4.2 Main Results + +We compare the proposed MoCoSE with several commonly used unsupervised methods and the current state-of-the-art contrastive learning method on the text semantic similarity (STS) task, including average GloVe embeddings (Pennington et al., 2014), average BERT or RoBERTa embeddings, BERT-flow, BERT-whitening, ISBERT (Zhang et al., 2020a), DeCLUTR (Giorgi et al., 2021), CT-BERT (Carlsson et al., 2021) and SimCSE. + +As shown in Table 1, the average Spearman's correlation of our best model is $77.27\%$ , outperforming unsupervised SimCSE with BERT-base. Our model outperforms SimCSE on STS2012, STS2015, and STS-B, and SimCSE perform better on the STS2013 task. Our MoCoSE-BERT + +
ModelSTS12STS13STS14STS15STS16STS-BSICK-RAvg.
Unsupervised Models (Base)
GloVe (avg.)55.1470.6659.7368.2563.6658.0253.7661.32
BERT (first-last avg.)39.7059.3849.6766.0366.1953.8762.0656.70
BERT-flow58.4067.1060.8575.1671.2268.6664.4766.55
BERT-whitening57.8366.9060.9075.0871.3168.2463.7366.28
IS-BERT56.7769.2461.2175.2370.1669.2164.2566.58
CT-BERT61.6376.8068.4777.5076.4874.3169.1972.05
RoBERTa (first-last avg.)40.8858.7449.0765.6361.4858.5561.6356.57
RoBERTa-whitening46.9963.2457.2371.3668.9961.3662.9161.73
DeCLUTR-RoBERT52.4175.1965.5277.1278.6372.4168.6269.99
SimCSE68.4082.4174.3880.9178.5676.8572.2376.25
MoCoSE71.4881.4074.4783.4578.9978.6872.4477.27
Unsupervised Models (Large)
SimCSE-RoBERTa72.8683.9975.6284.7781.8081.9871.2678.90
SimCSE-BERT70.8884.1676.4384.5079.7679.2673.8878.41
MoCoSE-BERT74.5084.5477.3284.1179.6780.5373.2679.13
+ +Table 1: Spearman correlation of MoCoSE on seven semantic text similarity tasks. We compared with the state-of-the-art method SimCSE. MoCoSE achieves the best results with both BERT-base and BERT-large pre-trained models. + +
ModelMRCRSUBJMPQASSTTRECMRPCAvg.
Unsupervised Model (Base)
GloVe (avg.)77.2578.3091.1787.8580.1883.0072.8781.52
Skip-thought76.5080.1093.6087.1082.0092.2073.0083.50
Avg. BERT embeddings78.6686.2594.3788.6684.4092.8069.5484.94
BERT-[CLS]embedding78.6884.8594.2188.2384.1391.4071.1384.66
SimCSE-RoBERTa81.0487.7493.2886.9486.6084.6073.6884.84
SimCSE-BERT81.1886.4694.4588.8885.5089.8074.4385.81
MoCoSE-BERT81.0786.4394.7689.7086.3584.0675.8685.46
Unsupervised Model (Large)
SimCSE-RoBERTa82.7487.8793.6688.2288.5892.0069.6886.11
MoCoSE-BERT83.7189.0795.5890.2687.9684.9276.8186.90
+ +Table 2: Performance of MoCoSE on the seven transfer tasks. We compare the performance of MoCoSE and other models on the seven transfer tasks evaluated by SentEval, and MoCoSE remains at a comparable level with the SimCSE. + +large model outperforms SimCSE-BERT-Large by about 0.7 on average, mainly on STS12, STS13, and STS14 tasks, and maintains a similar level on other tasks. + +Furthermore, we also evaluate the performance of MoCoSE on the seven transfer tasks provided by SentEval. As shown in Table 2, MoCoSE-BERT-base outperforms most of the previous unsupervised method, and is on par with SimCSE-BERT-base. + +# 5 Empirical Study + +To further explore the performance of the MoCo-like contrasting model on learning sentence embedding, we set up the following ablation trials. + +# 5.1 EMA Decay Weight + +We use EMA to update the model parameters for the target branch and find that EMA decay weight affects the performance of the model. The EMA decay weight affects the update process of the model, which further affects the vectors involved in the contrastive learning process. Therefore, we set different values of EMA decay weight and train the model with other hyperparameters held constant. As shown in Table 3 and Appendix A.5, the best result is obtained when the decay weight of EMA is set to 0.85. Compared to the choice of EMA decay weight in CV (generally as large as 0.99), the value of 0.85 in our model is smaller, which means that the model is updated faster. We speculate that this is because the NLP model is more sensitive in the fine-tuning phase and the model weights change + +
EMA0.50.80.850.90.950.99
Avg.75.7675.1976.4976.0576.0875.12
+ +Table 3: Effect of EMA decay weight on model performance. The best results are obtained with the EMA decay weight at 0.85. + +
Proj.Pred.Corr.Proj.Pred.Corr.
0160.462166.96
262.67266.29
363.62361.57
1176.743131.51
276.89243.97
376.24339.13
+ +more after each step of the gradient, so a faster update speed is needed. + +# 5.2 Projection and Prediction + +Several papers have shown (e.g. Section F.1 in BYOL (Grill et al., 2020)) that the structure of projection and prediction layers in a contrastive learning framework affects the performance of the model. We combine the structure of projection and prediction with different configurations and train them with the same hyperparameters. As shown in Table 4, the best results are obtained when the projection is 1 layer and the prediction has 2 layers. The experiments also show that the removal of projection layers degrades the performance of the model. + +# 5.3 Data Augmentation + +We investigate the effect of some widely-used data augmentation methods on the model performance. As shown in Table 5, cut off and token shuffle do not improve, even slightly hurt the model's performance. Only the adversarial attack (FGSM) has slight improvement on the performance. Therefore, in our experiments, we added FGSM as a default data augmentation of our model in addition to dropout. Please refer to Appendix A.7 for more FGSM parameters results. We speculate that the reason token cut off is detrimental to the model results is that the cut off perturbs too much the vector formed by the sentences passing through the embedding layer. Removing one word from the text may have a significant impact on the semantics. We tried two parameters 0.1 and 0.01 for the feature cut off, and with these two parameters, the results of using the feature cut off is at most the same as + +Table 4: The impact of different combinations of projection and predictor on the model. + +
Augmentation MethodsAvg.
Dropout only76.76
+ FGSM (ε=5e-9)77.04
+ Position_shuffle (True)73.80
+ Token dropout (prob=0.1)41.32
+ Feature dropout (prob=0.01)76.33
+ Feature dropout (prob=0.1)71.62
+ Typos22.32
+ Synonym replace (roberta-base)28.70
+ Paraphrasing (xlnet-base-cased)60.45
+ Backtranslation (en->de->en)69.35
+ +Table 5: The effect of different data augmentation methods. + +without using feature the cut off, so we discard the feature cut off method. More results can be found in Appendix A.6. + +The token shuffle is slightly, but not significantly, detrimental to the results of the model. This may be due to that BERT is not sensitive to the position of token. In our experiment, the sentence-level augmentation methods also failed to outperform than the drop out, FGSM and position shuffle. + +Among the data augmentation methods, only FGSM together with dropout improves the results, which may due to the adversarial attack slightly enhances the difference between the two samples and therefore enables the model to learn a better representation in more difficult contrastive samples. + +# 5.4 Predictor Mapping Dimension + +The predictor maps the representation to a feature space of a certain dimension. We investigate the effect of the predictor mapping dimension on the model performance. Table 6.a shows that the predictor mapping dimension can seriously impair the performance of the model when it is small, and when the dimension rises to a suitable range or larger, it no longer has a significant impact on the model. This may be related to the intrinsic dimension of the representation, which leads to the loss of semantic information in the representation when the predictor dimension is smaller than the intrinsic dimension of the feature, compromising the model performance. We keep the dimension of the predictor consistent with the encoder in our experiments. More results can be found in Appendix A.8. + +# 5.5 Batch Size + +With a fixed queue size, we investigated the effect of batch size on model performance, the results is in Table 6.b, and the model achieves the best per + +
DimAvg.
25673.91
51276.07
76877.04
102477.02
204877.03
+ +(a) + +
SizeAvg.
3273.86
6477.25
12876.78
25676.62
+ +Table 6: (a) Impact of prediction dimension on model performance. (b) Impact of batch size on the model with fixed queue size. Both table under a batch size setting to 512. + +formance when the batch size is 64. Surprisingly the model performance does not improve with increasing batch size, which contradicts the general experience in image contrastive learning. This is one of our motivations for further exploring the effect of the number of negative samples on the model. + +# 5.6 Size of Negative Sample Queue + +The queue length determines the number of negative samples, which direct influence performance of the model. We first test the size of negative sample queue to the model performance. With queue size longer than 1024, the results get unstable and worse. We suppose this may be due to the random interference introduced to the training by filling the initial negative sample queue. This interference causes a degradation of the model's performance when the initial negative sample queue becomes longer. To reduce the drawbacks carried out by this randomness, we changed the way the negative queue is initialized. We initialize a smaller negative queue, then fill the queue to its set length in the first few updates, and then update normally. According to experiments, the model achieves the highest results when the negative queue size set to 512 and the smaller initial queue size set to 128. + +According to the experiments of MoCo, the increase of queue length improves the model performance. However, as shown in Table 7, increasing the queue length with a fixed batch size decreases our model performance, which is not consistent with the observation in MoCo. We speculate that this may be due to that NLP models updating faster, and thus larger queue lengths store too much outdated feature information, which is detrimental to the performance of the model. Combined with the observed effect of batch size, we further conjecture that the effect of the negative sample queue on model performance is controlled by the model + +(b) + +
Initial +SizeQueue Size
12825651210244096
w.o. init.76.4076.1975.3876.6350.17
init. 1/4 queue75.9276.3477.3076.2050.42
init. 1/2 queue76.1676.3976.9476.5738.74
init. all (normal)76.8775.8176.2976.4545.80
+ +Table 7: Correlation performance of initializing different proportion of negative queue with different negative queue size. + +
Corr.0~512256~768512~1024Without256~768All
Avg.76.1077.0275.7176.1876.86
+ +Table 8: The impact of negative samples at different locations in the queue on the model performance. + +history information contained in the negative sample in the queue. See Appendix A.9 and A.10 for more results of the effect of randomization size and queue length. + +Since the queue is first-in-first-out, to test the hypothesis above, we sliced the negative sample queue and use different parts of the queue to participate in loss calculation. Here, we set the negative queue length to 1024, the initial queue size to 128, and the batch size to 256. Thus, 256 negative samples will be push into the queue for each iteration. We take $0 \sim 512$ , $256 \sim 768$ , $512 \sim 1024$ , a concatenated slice $0 \sim 256$ and $768 \sim 1024$ , and all negative sample queues respectively for testing. The experiment results are shown in Table 8. + +The experiments show that the model performs best when using the middle part of the queue. So we find that the increase in queue length affects the model performance not only because of the increased number of negative samples, but more because it provides historical information within a certain range. + +# 5.7 Maximum Traceable Distance Metric + +To testify there are historical information in negative sample queue influencing the model performance, we define a Maximum Traceable Distance Metric $d_{trace}$ to help explore the phenomenon. + +$$ +d _ {t r a c e} = \frac {1}{1 - \eta} + \frac {\text {q u e u e _ s i z e}}{\text {b a t c h _ s i z e}} \tag {4} +$$ + +The $\eta$ refers to the decay weight of EMA. The $d_{trace}$ calculates the update steps between the current online branch and the oldest negative samples in the queue. The first term of the formula represents the traceable distance between target and + +![](images/3c4303c48e4900953595bcbcab4031c59eb01e6e1ad30435f9bdcd9a6d4f2ccc.jpg) +Figure 2: The relationship between traceable distance and model correlation. + +![](images/33fb8fe2126f7c9a93447714e99188cd86d8d110bc9b36d69a5ffb5a5147c1ab.jpg) +Figure 3: The batch size does not invalidate the traceable distance. The traceable distance needs to be maintained within a reasonable range even for different batch sizes. This explains why increasing the batch size only does not improve the performance, because increasing the batch size only can cause the distance changes into unsuitable regions. + +online branch due to the EMA update mechanism. The second term represents the traceable distance between the negative samples in the queue and the current target branch due to the queue's first-in-first-out mechanism. The longer traceable distance, the wider the temporal range of the historical information contained in the queue. We obtained different value of traceable distance by jointly adjust the decay weight, queue size, and batch size. As shown in Figure 2 and Figure 3, the best result of BERT base is obtained with $d_{trace}$ is set around 14.67. The best result of BERT large shows the similar phenomenon, see Appendix A.11 for details. This further demonstrates that in text contrastive learning, the historical information used should be not too old and not too new, and the appropriate traceable distance between branches is also important. Some derivations about eq.4 can be found in Appendix A.12. + +However, for an image contrast learning model, like MoCo, experimental results suggests that + +![](images/13a4892cfa2a1953249208e673871f123891bc6578582a245e3107520737c2dd.jpg) +Figure 4: L1 and L2 distances of learned embedding's uniformity and alignment with a fixed point changes along with MTD. + +longer queue size increases the performance. We believe that this is due to the phenomenon of unique anisotropy (Zhang et al., 2020b) of text that causes such differences. The text is influenced by the word frequency producing the phenomenon of anisotropy with uneven distribution, which is different from the near-uniform distribution of pixel points of image data. Such a phenomenon affects the computation of the cosine similarity (Wang and Isola, 2020), and the loss of InfoNCE that we use depends on it, which affects the performance of the model through the accumulation of learning steps. To test such a hypothesis, we use alignment and uniformity to measure the distribution of the representations in space and monitor the corresponding values of alignment and uniformity for different MTDs. As shown in the Figure 4, it can be found that a proper MTD allows the alignment and uniformity of the model to reflects an optimal combination. The change in MTD is reflected in the performance of uniformity and alignment of the learned text embedding, and the increase and decrease of MTD is a considering result of uniformity and alignment moving away from their optimal combination region. + +# 6 Conclusion + +In this study, we propose MoCoSE, it applies the MoCo-style contrastive learning model to the empirical study of sentence embedding. We conducted experiments to study every detail of the model to provide some experiences for text contrastive learning. We further delve into the application of the negative sample queue to text contrastive learning and propose a maximum traceable distance metric to explain the relation between the queue size and model performance. + +# Acknowledgments + +Our work is supported by the National Key Research and Development Program of China under grant No.2019YFC1521400, National Natural Science Foundation of China under grant No.62072362 and No.61902229 and International Science and Technology Cooperation Project of Shaanxi (2020KW-006). + +# References + +Eneko Agirre, Carmen Banea, Claire Cardie, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, Weiwei Guo, Inigo Lopez-Gazpio, Montse Maritxalar, Rada Mihalcea, German Rigau, Larraitz Uria, and Janyce Wiebe. 2015. Semeval-2015 task 2: Semantic textual similarity, english, spanish and pilot on interpretability. In Proceedings of the 9th International Workshop on Semantic Evaluation (SemEval 2015), pages 252-263. +Eneko Agirre, Carmen Banea, Claire Cardie, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, Weiwei Guo, Rada Mihalcea, German Rigau, and Janyce Wiebe. 2014. Semeval-2014 task 10: Multilingual semantic textual similarity. In Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014), pages 81-91. +Eneko Agirre, Carmen Banea, Daniel M. Cer, Mona T. Diab, Aitor Gonzalez-Agirre, Rada Mihalcea, German Rigau, and Janyce Wiebe. 2016. Semeval-2016 task 1: Semantic textual similarity, monolingual and cross-lingual evaluation. In Proceedings of the 10th International Workshop on Semantic Evaluation (SemEval-2016), pages 497-511. +Eneko Agirre, Daniel Cer, Mona Diab, and Aitor Gonzalez-Agirre. 2012. Semeval-2012 task 6: A pilot on semantic textual similarity. In *SEM 2012: The First Joint Conference on Lexical and Computational Semantics – Volume 1: Proceedings of the main conference and the shared task, and Volume 2: Proceedings of the Sixth International Workshop on Semantic Evaluation (SemEval 2012), volume 1, pages 385–393. +Eneko Agirre, Daniel Cer, Mona Diab, Aitor Gonzalez-Agirre, and Weiwei Guo. 2013. *sem 2013 shared task: Semantic textual similarity. In Second Joint Conference on Lexical and Computational Semantics (*SEM), Volume 1: Proceedings of the Main Conference and the Shared Task: Semantic Textual Similarity, volume 1, pages 32-43. +Fredrik Carlsson, Magnus Sahlgren, Evangelia Gogoulou, Amaru Cuba Gyllensten, and Erik Ylipää Hellqvist. 2021. Semantic re-tuning with contrastive tension. In ICLR 2021: The Ninth International Conference on Learning Representations. + +Daniel M. Cer, Mona T. Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. Semeval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 1-14. +Pengguang Chen, Shu Liu, and Jiaya Jia. 2021. Jigsaw clustering for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11526-11535. +Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. 2020. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597-1607. PMLR. +Xinlei Chen and Kaiming He. 2021. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15750-15758. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina N. Toutanova. 2018. 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. +Aleksandr Ermolov, Aliaksandr Siarohin, Enver Sangineto, and Nicu Sebe. 2021. Whitening for self-supervised representation learning. In ICML 2021: 38th International Conference on Machine Learning, pages 3015-3024. +Hongchao Fang and Pengtao Xie. 2020. Cert: Contrastive self-supervised learning for language understanding. arXiv preprint arXiv:2005.12766. +Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and TieYan Liu. 2019. Representation degeneration problem in training natural language generation models. arXiv preprint arXiv:1907.12009. +Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021. Simcse: Simple contrastive learning of sentence embeddings. arXiv preprint arXiv:2104.08821. +John Giorgi, Osvald Nitski, Bo Wang, and Gary Bader. 2021. DeCLUTR: Deep contrastive learning for unsupervised textual representations. 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 879-895, Online. Association for Computational Linguistics. +Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. 2015. Explaining and harnessing adversarial examples. In *ICLR 2015: International Conference on Learning Representations* 2015. + +Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi 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. +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. +Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. 2020. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729-9738. +Chih-Hui Ho and Nuno Nvasconcelos. 2020. Contrastive learning with adversarial examples. In Advances in Neural Information Processing Systems, volume 33, pages 17081-17093. +Quentin Lhoest, Albert Villanova del Moral, Patrick von Platen, Thomas Wolf, Yacine Jernite, Abhishek Thakur, Lewis Tunstall, Suraj Patil, Mariama Drame, Julien Chaumont, Julien Plu, Joe Davison, Simon Brandeis, Victor Sanh, Teven Le Scao, Kevin Canwen Xu, Nicolas Patry, Steven Liu, Angelina McMillan-Major, Philipp Schmid, Sylvain Gugger, Nathan Raw, Sylvain Lesage, Anton Lozhkov, Matthew Carrigan, Theo Matussiere, Leandro von Werra, Lysandre Debut, Stas Bekman, and Clément Delangue. 2021. huggingface/datasets: 1.13.2. +Bohan Li, Hao Zhou, Junxian He, Mingxuan Wang, Yiming Yang, and Lei Li. 2020. On the sentence embeddings from pre-trained language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9119-9130. +Junnan Li, Pan Zhou, Caiming Xiong, and Steven Hoi. 2021. Prototypical contrastive learning of unsupervised representations. In ICLR 2021: The Ninth International Conference on Learning Representations. +Jovana Mitrovic, Brian McWilliams, and Melanie Rey. 2020. Less can be more in contrastive learning. "I Can't Believe It's Not Better!" NeurIPS 2020 workshop. +Aaron van den Oord, Yazhe Li, and Oriol Vinyals. 2018. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748. +Jeffrey Pennington, Richard Socher, and Christopher 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, Doha, Qatar. Association for Computational Linguistics. +Jianlin Su, Jiarun Cao, Weijie Liu, and Yangyiwen Ou. 2021. Whitening sentence representations for better semantics and faster retrieval. arXiv preprint arXiv:2103.15316. +Dong Wang, Ning Ding, Piji Li, and Haitao Zheng. 2021. Cline: Contrastive learning with semantic negative examples for natural language understanding. In ACL 2021: 59th annual meeting of the Association for Computational Linguistics, pages 2332-2342. +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. +Gijs Wijnholds and Michael Moortgat. 2021. Sick-nl: A dataset for dutch natural language inference. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 1474-1479. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi 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 M. 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. +Zhuofeng Wu, Sinong Wang, Jiatao Gu, Madian Khabsa, Fei Sun, and Hao Ma. 2020. Clear: Contrastive learning for sentence representation. arXiv preprint arXiv:2012.15466. +Yuanmeng Yan, Rumei Li, Sirui Wang, Fuzheng Zhang, Wei Wu, and Weiran Xu. 2021. Consent: A contrastive framework for self-supervised sentence representation transfer. In ACL 2021: 59th annual meeting of the Association for Computational Linguistics, pages 5065-5075. +Jure Zbontar, Li Jing, Ishan Misra, yann lecun, and Stephane Deny. 2021. Barlow twins: Self-supervised learning via redundancy reduction. In ICML 2021: 38th International Conference on Machine Learning, pages 12310-12320. +Yan Zhang, Ruidan He, Zuozhu Liu, Kwan Hui Lim, and Lidong Bing. 2020a. An unsupervised sentence embedding method by mutual information maximization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1601-1610. + +Zhong Zhang, Chongming Gao, Cong Xu, Rui Miao, Qinli Yang, and Junming Shao. 2020b. Revisiting representation degeneration problem in language modeling. In Findings of the Association for Computational Linguistics: EMNLP 2020, Online Event, 16-20 November 2020, volume EMNLP 2020 of Findings of ACL, pages 518-527. Association for Computational Linguistics. + +# A Appendix + +# A.1 Experiment Settings + +We train our MoCoSE model using a single NVIDIA RTX3090 GPUs. Our training system runs Microsoft Windows 10 with CUDA toolkit 11.1. We use Python 3.8 and PyTorch version v1.8. We build the model with Transformers 4.4.2 (Wolf et al., 2020) and Datasets 1.8.0 (Lhoest et al., 2021) from Huggingface. We preprocess the training data according to the SimCSE to directly load the stored data in training. We compute the uniformity and alignment metrics of embedding on the STS-B dataset according to the method proposed by Wang (Wang and Isola, 2020). The STS-B dataset is also preprocessed. We use the nlpaug toolkit in our data augmentation experiments. For synonym replace, we use 'ContextualWordEmbsAug' function with 'roberta-base' as parameter. For typo, we use 'SpellingAug' and back translation we use 'BackTranslationAug' with parameter 'facebook/wmt19-en-de' and paraphrase we use 'ContextualWordEmbsForSentenceAug' with parameter 'xlnet-base-cased'. All the parameter listing here is default value given by official. + +# A.2 Symmetric Two-branch Structure + +We remove the online branch predictor and set the EMA decay weight to 0, i.e., make the structure and weights of the two branches identical. As shown in Figure 5, it is clear that the model is collapsing at this point. And we find that the model always works best at the very beginning, i.e., training instead hurts the performance of the model. In addition, as the training proceeds, the correlation coefficient of the model approaches 0, i.e., the prediction results have no correlation with the actual labeling. At this point, it is clear that a collapse of the model is observed. We observed such a result for several runs, so we adopted a strategy of double branching with different structures plus EMA momentum updates in our design. Subsequent experiments demonstrated that this allowed the model to avoid from collapsing. + +![](images/7e47502c1e453660bf80902ae2b070d4c8705673d56563411ee0f4bf1904c03e.jpg) +Figure 5: Experiment on a symmetric two-branch structure with EMA decay weight set to 0. + +![](images/e2f2ee6888d774253e31bbbbe242fa06acbc5cbf29bae3c119d4505edff37dfd.jpg) +Figure 6: Experiment after adding predictor on the online branch with EMA decay weight set to 0. + +We add predictor to the online branch and set the EMA decay weight to 0. We find that the model also appears to collapse and has a dramatic oscillation in the late stage of training, as shown in Figure 6. + +# A.3 Pseudo-Code for Training MoCoSE + +The PyTorch style pseudo-code for training MoCoSE with the negative sample queue is shown in Algorithm 1. + +# A.4 Distribution of Singular Values + +Similar to SimCSE, we plot the distribution of singular values of MoCoSE sentence embeddings with SimCSE and BERT for comparison. As illustrated in Figure 7, our method is able to alleviate the rapid decline of singular values compared to other methods, making the curve smoother, i.e., our model is able to make the sentence embedding more isotropic. + +Algorithm 1: Momentum Contrastive Sentence Embedding +Input: $\mathcal{D}$ : Training data set; $\mathcal{Q}$ : Negative Sample Queue; $E_{a}$ : Embedding with random data augmentation; $\theta_o,\theta_t$ : weights of online branch and target branch; Optimizer : Adam optimizer $K,K_s$ : Queue size, Queue size at initialisation; $\eta$ : ema decay ema and ema scheduling strategy; $\tau$ Temperature parameters Output: MoCoSE model $\theta_{o}$ +1 Initializing the queue $\mathcal{Q}$ with size $K_{s}$ . +2 foreach $\mathcal{B}\in \mathcal{D}$ do +3 $v_{o},v_{t}\gets E_{a}(\mathcal{B}),E_{a}(\mathcal{B}) / /$ Using data Augmentation to generate different views +4 $z_{o}\gets \theta_{o}(v_{o}) / / (N,d),N$ is batch size, $d$ is dimension of sentence embedding +5 $z_{t}\gets \theta_{t}(v_{t})$ +6 $l_{zo,zt,Q}\gets -\log \frac{\exp(z_0\cdot z_t / \tau)}{\exp(z_0\cdot z_t / \tau) + \sum_{x\in Q}\exp(z_0\cdot x / \tau)} / /$ compute contrastive loss using InFoNCE +7 optimizer $(l_{zo,zt,Q},\theta_o)$ // Update only the parameters of the online branch according to the loss gradient; +8 $\theta_t\gets \eta *\theta_t + (1 - \eta)*\theta_o / /$ Update the parameters of the target branch using EMA +9 enqueue(Q,vt) // Update the negative sample queue Q +10 dequeue(Q) +11 return $\theta_{o}$ + +![](images/550ee02bc968b5a38a414564166cdbbb96f70527aaba5bb8f0346eb4eea2d499.jpg) +Figure 7: Singular value distributions of sentence embedding matrix from sentences in STS-B. + +![](images/b3599833875b9dfe37ec13ef926e2de779c54e151b6247d5900ed4aa3c9a4762.jpg) +Figure 8: Effect of EMA decay weight on model performance. + +# A.5 Experiment Details of EMA Hyperparameters + +The details of the impact caused by the EMA parameter are shown in the Figure 8. We perform this experiment with all parameters held constant except for the EMA decay weight. + +# A.6 Details of Different Data Augmentations + +We use only dropout as a baseline for the results of data augmentations. Then, we combine dropout with other data augmentation methods and study their effects on model performance. The results are shown in Figure 9. + +![](images/ae25c73682847c144a1ef71294a15ac8367172b6fbc147652d56250102205b26.jpg) +Figure 9: Impact of four additional data enhancements with dropout combinations on the model. + +# A.7 Experiment Details of FGSM + +We test the effect of the intensity of FGSM on the model performance. We keep the other hyperparameters fixed, vary the FGSM parameters (1e-9, 5e-9, 1e-8, 5e-8). As seen in Table 9, the average results of the model are optimal when the FGSM parameter is 5e-9. + +
Epsilon1e-95e-91e-85e-8No
Avg.75.6176.6475.3976.6276.26
+ +Table 9: Different parameters of FGSM in data augmentation affect the model results. + +# A.8 Dimension of Sentence Embedding + +In both BERT-whitening (Su et al., 2021) and MoCo (He et al., 2020), it is mentioned that the dimension of embedding can have some impact on the performance of the model. Therefore, we also changed the dimension of sentence embedding in MoCoSE and trained the model several times to observe the impact of the embedding dimension. Because of the queue structure of MoCoSE, we need to keep the dimension of negative examples consistent while changing the dimension of sentence embedding. As shown in the Figure 10, when the dimension of Embedding is low, this causes considerable damage to the performance of the model; while when the dimension rises to certain range, the performance of the model stays steady. + +# A.9 Details of Random Initial Queue Size + +We test the influence of random initialization size of the negative queue on the model performance when queue length and batch size are fixed. + +![](images/4ad96584009e8f68bb88fcba2525a2edc1134c456bb4279291711f406880f5ff.jpg) +Figure 10: Impact of dimensions of the sentence embedding. + +As seen in Figure 11, random initialization does have some impact on the model performance. + +![](images/4893d329f0d1fb2b4afb7b2dfae0845ef72b15ce9fb38d0f5997d5f191933f55.jpg) +Figure 11: The effect of the initial queue size on the model results when the queue length is 512 and the batch size is 64. + +# A.10 Queue Size and Initial Size + +We explored the effect of different combinations of initial queue sizes and queue length on the model performance. The detailed experiment results are shown in Figure 12. It can be found that model performance relies deeply on initialization queue size. Yet, too large queue size will make the model extremely unstable. This is quite different from the observation of negative sample queue in image contrastive learning. + +# A.11 Maximum Traceable Distance in BERT-large + +We also train vocose with different batch size and queue size on BERT-large. As shown in Figure 13, we observe the best model performance in MoCoSE-BERT-large within the appropriate Maximum Traceable Distance range (around 22). Once again, this suggests that even on BERT-large, the longer queue sizes do not improve the model performance indefinitely. Which also implies that the + +![](images/3bba014a707aa82cda0d3d1708e3be013b8e5a6d031ab11b38e99ab83f48ebcb.jpg) +Figure 12: The impact of different initial negative sample queue sizes for different initial sizes on model performance. (left):Zoomed view. (right):Overview with different negative queue size. Results of different initial size under same queue size. + +![](images/1592a5d587435180627e0643adfceeffc9671136b624fb976db3233b18dbe583.jpg) +Figure 13: The relationship between MTD and correlation of MoCoSE-BERT-large. It can be seen that even at large model, peaks occur within a certain MTD range. + +history information contained in the negative sample queue needs to be kept within a certain range on BERT-large as well. + +# A.12 Proof of Maximum Traceable Distance + +Here, we prove the first term of the formula for Maximum Traceable Distance. Due to the EMA update mechanism, the weight of target branch is a weighted sum of the online weight in update history. The first term of Maximum Traceable Distance calculate the weighted sum of the historical update steps given a certain EMA decay weight $\eta$ . From the principle of EMA mechanism, we can get the following equation. + +$$ +\mathcal {S} _ {n} = \sum_ {i = 0} ^ {k} (1 - \eta) \cdot \eta^ {i} \cdot (i + 1) \tag {5} +$$ + +$S_{n}$ represents the update steps between online and target branch due to the EMA mechanism. Since EMA represents the weighted sum, we need to ask for $S_{n}$ to get the weighted sum. + +We can calculate $S_{n}$ as: + +$$ +\mathcal {S} _ {n} = (- 1) * \eta^ {k + 1} * (k + 1) - \frac {\left(1 - \eta^ {k + 1}\right)}{(\eta - 1)} \tag {6} +$$ + +As $k$ tends to infinity, the limit for $\mathcal{S}_n$ can be calculated as following: + +$$ +\lim _ {k \to \infty} \mathcal {S} _ {n} = +$$ + +$$ +\lim _ {k \rightarrow \infty} \left[ (- 1) * \eta^ {k + 1} * (k + 1) - \frac {\left(1 - \eta^ {k + 1}\right)}{(\eta - 1)} \right] \tag {7} +$$ + +It is obvious to see that the limit of the equation 7 consists of two parts, so we calculate the limit of these two parts first. + +$$ +\lim _ {k \rightarrow \infty} (- 1) * \eta^ {k + 1} * (k + 1) \stackrel {\eta \leq 1} {=} 0 \tag {8} +$$ + +The limit of the first part can be calculated as 0. Next, we calculate the limit of the second part. + +$$ +\lim _ {k \rightarrow \infty} \frac {\left(1 - \eta^ {k + 1}\right)}{(\eta - 1)} \stackrel {\eta \leq 1} {=} \frac {1}{1 - \eta} \tag {9} +$$ + +We calculate the limit of the second part as $\frac{1}{1 - \eta}$ . Since the limits of both parts exist, we can obtain + +the limit of $S_{n}$ by the law of limit operations. + +$$ +\begin{array}{l} \lim _ {k \to \infty} \mathcal {S} _ {n} \\ = \lim _ {k \to \infty} \left[ (- 1) * \eta^ {k + 1} * (k + 1) - \frac {(1 - \eta^ {k + 1})}{(\eta - 1)} \right] \\ = \lim _ {k \rightarrow \infty} (- 1) * \eta^ {k + 1} * (k + 1) - \lim _ {k \rightarrow \infty} \frac {\left(1 - \eta^ {k + 1}\right)}{(\eta - 1)} \\ = \frac {1}{1 - \eta} \\ \end{array} +$$ + +(10) \ No newline at end of file diff --git a/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/images.zip b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c5c723b2438a9b5211e02b4174318a2c4e1a1751 --- /dev/null +++ b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3cf55a306a911d7e7732837dbdabc9f74bcde198c90a4d4412367c869918e91 +size 631370 diff --git a/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/layout.json b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3d5244f0e7e1e6116c61539af9cabe23c99a1635 --- /dev/null +++ b/exploringtheimpactofnegativesamplesofcontrastivelearningacasestudyofsentenceembedding/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32c024a234285a8746ac7f072a39438b742c14ee962610e27265822b91277d6c +size 427942 diff --git a/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_content_list.json b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..75b73d818359ec0881e63c9520ca0c19501f0415 --- /dev/null +++ b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:384d2d605c20238f2e57bf3b5b3f0453390b457588f7d9bea868b3fb975a430c +size 98674 diff --git a/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_model.json b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4f76151139973c6c82e964c4208515f916e1893e --- /dev/null +++ b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c876623603293774dd093eb78298b045dc84c4dd0c005ac2049b831aa1dcde9d +size 117014 diff --git a/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_origin.pdf b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1be1ea0dae4ff55f5cdd4a3c56fd54fe973b3619 --- /dev/null +++ b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/dcaf7a7b-731f-4174-968e-4f058ceac503_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82e62e54b662639bb28d4ad72a26c2045021d684c1f90845857606a5145f05a5 +size 1115390 diff --git a/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/full.md b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e5b54ceff7083954941335b0f26762e8bf02102a --- /dev/null +++ b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/full.md @@ -0,0 +1,333 @@ +# Extracting Latent Steering Vectors from Pretrained Language Models + +Nishant Subramani† Nivedita Suresh $\diamond$ Matthew E. Peters† + +†Allen Institute for Artificial Intelligence, Seattle, WA, USA + +$\diamond$ Arrive Bio, San Francisco, CA, USA + +{nishants,matthewp} $@$ allenai.org + +{nive}@arrivebio.com + +# Abstract + +Prior work on controllable text generation has focused on learning how to control language models through trainable decoding, smart-prompt design, or fine-tuning based on a desired objective. We hypothesize that the information needed to steer the model to generate a target sentence is already encoded within the model. Accordingly, we explore a different approach altogether: extracting latent vectors directly from pretrained language model decoders without fine-tuning. Experiments show that there exist steering vectors, which, when added to the hidden states of the language model, generate a target sentence nearly perfectly (>99 BLEU) for English sentences from a variety of domains. We show that vector arithmetic can be used for unsupervised sentiment transfer on the Yelp sentiment benchmark, with performance comparable to models tailored to this task. We find that distances between steering vectors reflect sentence similarity when evaluated on a textual similarity benchmark (STS-B), outperforming pooled hidden states of models. Finally, we present an analysis of the intrinsic properties of the steering vectors. Taken together, our results suggest that frozen LMs can be effectively controlled through their latent steering space. + +# 1 Introduction + +Leveraging large pretrained language models trained on massive Web corpora has become the go-to approach to solve natural language processing tasks (Peters et al., 2018; Radford et al., 2018; Devlin et al., 2018; Brown et al., 2020). As a result, controlling these models has become paramount as many applications of NLP technology require control over the generations of the model. Prior work aims to learn how to control language models and falls in three categories: trainable decoding (Gu + +et al., 2017; Deng et al., 2020), smart-prompt design (Shin et al., 2020; Lester et al., 2021), and fine-tuning based on a desired objective (Krause et al., 2021; Weng, 2021). Further, many works opt to train auto-encoder based models for controllable text generation (Shen et al., 2017, 2020; Mai et al., 2020). These approaches make controllability easier by learning a latent space that is more easily manipulated to encourage models to generate text corresponding to a target attribute such as positive sentiment in the case of sentiment transfer. + +We take a more direct approach and explore whether it is possible to extract latent vectors directly from pretrained language model decoders without fine-tuning. We call these vectors steering vectors and define the latent steering space of a sentence under a language model by the set of extracted steering vectors, which steer the model to generate that sentence exactly. During decoding, we add our steering vector to the hidden states of the language model to generate the target sentence. Rather than training a model to learn steering vectors, we provide several methods to extract fixed-length steering vectors directly from pretrained language model decoders. Experiments show that we can extract steering vectors effectively, achieving nearly perfect recovery for English sentences from a variety of domains without fine-tuning the underlying language model at all. + +Next, we take our extracted steering vectors and explore whether they can be used for unsupervised sentiment transfer on the Yelp sentiment benchmark (Zhang et al., 2015). We find that adding an offset vector to extracted steering vectors performs comparably to carefully designed, autoencoder-based models. To see whether steering vectors encode semantics, we explore whether they can be used for unsupervised textual similarity. On the semantic textual similarity benchmark (STS-B, Cer et al. (2017)), our steering vectors outperform extractive methods such as averaging language model + +![](images/4fa2dd55c1f21b7e5e080c21461ff3e2fd6e214c66d39fd579cde9f23e0b97e8.jpg) +Figure 1: Our approach adds a vector $\mathbf{z}_{steer}$ to the activations of a pretrained transformer decoder to steer it to decode a desired target sentence. We experiment with adding $\mathbf{z}_{steer}$ to different locations inside a GPT-2 model at different timesteps. Experiments reveal that our approach can recover sequences nearly perfectly and that injecting the steering vector in the middle layers of the transformer stack performs best. Layer normalizations and residual connections inside the transformer block are omitted for clarity. + +hidden states and GloVe vectors (Pennington et al., 2014) when measuring the cosine similarity between vectors, but fall short of lexical methods tailored to semantic similarity tasks and methods that finetune on natural language inference datasets. + +Lastly, we analyze the intrinsic properties of the latent space of our steering vectors. Experiments show that decoding from interpolations in the latent space produces meaningful output, and that steering vectors from different domains cluster together. Also, we find that our methods do not simply memorize the target sequence like a naive compression algorithm, and instead leverage the model. Taken together, our results suggest that frozen language models can be controlled effectively through their latent steering space. + +# 2 Extracting Steering Vectors + +This section discusses our method for extracting a steering vector for a target sentence from a frozen, pretrained language model. Throughout this paper, we use GPT2 as our language model and use its 117M parameter model size (Radford et al., 2019), although our approach can be directly applied to any transformer-based autoregressive language model decoder (Vaswani et al., 2017). + +# 2.1 Steering Vectors + +In controllable text generation and textual style transfer, prior work based on denoising and variational autoencoders opt for a disentangling approach. These approaches encode the source sequence into a fixed-length vector using an encoder, apply style transformations using a controller, and finally decode from the transformed vector using a decoder (Shen et al., 2017; Jin et al., 2020). Instead of learning an encoder and controller to uncover a representation, we ask whether its possible to extract a vector directly from a pretrained language model decoder in order to steer the model. + +Due to the success of hidden layer manipulations for language models including adapter-based fine-tuning (Houlsby et al., 2019), plug-and-play language models (Dathathri et al., 2019), and offset-vector-based recovery and style transfer among others (Subramani et al., 2019; Shen et al., 2020; Mai et al., 2020; Montero et al., 2021), we choose to manipulate the hidden states as well. + +Our method works by adding a fixed-length vector $\mathbf{z}_{steer}$ to the hidden states of a pretrained and frozen LM. For a desired target sentence, we randomly initialize $\mathbf{z}_{steer}$ and optimize it via gradient descent to maximize the likelihood of the model given the target sentence. At decoding time, we + +feed a $\mathbf{z}_{steer}$ to the model and perform decoding as usual. The choice of a fixed-length vector makes analysis more meaningful, allowing us to compare vectors for different sentences with different lengths in the same representation space. + +# 2.2 Discovering steering vectors + +We define our steering vectors $\mathbf{z}_{steer} \in \mathbb{R}^{d'}$ . In our experiments, $d' \leq d$ , where $d$ is the hidden dimension of the underlying language model (for GPT2-117M, $d = 768$ ). If $d' < d$ , we project $\mathbf{z}_{steer}$ using a semi-orthogonal matrix, $W_{steer} \in \mathbb{R}^{d' \times d}$ , which preserves scale. $W_{steer}$ is initialized randomly, never trained, and never updated. + +We estimate a steering vector $\hat{z}_{steer} \in \mathbb{R}^{d'}$ via the language model for a sentence $x$ by maximizing the log probability of $x$ , while keeping the language model fixed: + +$$ +\hat {\boldsymbol {z}} _ {s t e e r} = \underset {\boldsymbol {z} _ {s t e e r} \in \mathcal {Z}} {\operatorname {a r g m a x}} \sum_ {t = 1} ^ {T} \log p \left(x _ {t} \mid \boldsymbol {x} _ {< t}, \boldsymbol {z} _ {s t e e r}\right) \tag {1} +$$ + +Here, $\mathcal{Z} \in \mathbb{R}^{d'}$ . Note: we find a single steering vector $\boldsymbol{z}_{steer}$ for each sentence $\boldsymbol{x}$ . We use stochastic gradient descent with the Adam (Kingma and Ba, 2014) optimizer and cross entropy loss to find the best $\hat{\boldsymbol{z}}_{steer}$ , while freezing the language model. See algorithm 1 for the pseudocode. + +Since our method adds $\mathbf{z}_{steer}$ to the activations of the model, the layer we add $\mathbf{z}_{steer}$ to affects recoverability. We experiment with injecting $\mathbf{z}_{steer}$ at different layers (injection locations): at the embedding layer, right before language model head (LM Head), after self-attention layer in the transformer stack, after feed-forward layer in the transformer stack as well as combinations of them. In addition to varying injection locations, we also vary the timesteps where $\mathbf{z}_{steer}$ gets added. We experiment with adding $\mathbf{z}_{steer}$ at just the first timestep and at every timestep. See Figure 1 for details. + +# 2.3 Steering Language Models + +We steer the language model using $z_{steer}$ to generate a target sentence $x$ by passing in a beginning-of-sentence token and $z_{steer}$ to the model. Since we are interested in exact generation, all results presented use greedy decoding without assuming a true length. We stop when decoding produces an end-of-sentence token or produces 1024 tokens, the maximum length that GPT-2 can generate. + +ALGORITHM 1: Extracting $z_{steer}$ for a sentence +Input :x - target sentence M - pretrained language model $\theta$ - pretrained language model weights $I_{L}$ injection location $I_{T}$ injection timestep d - dimension of $z_{steer}$ Output: $z_{steer}$ - extracted candidate steering vector 1 $z_{steer}\sim$ xavier_normal(d) for $i\gets [1,2,\dots,N]$ do 3 $\begin{array}{rl} & {\mathrm{logits} = \mathsf{M}_{\theta}.forward(x,z_{steer},I_L,I_T)}\\ & {\mathcal{L} = XENT(logits,x)}\\ & {\mathcal{L}.backward()}\\ & {z_{steer} = z_{steer} + lr*\frac{\partial\mathcal{L}}{\partial z_{steer}}} \end{array}$ 5 6 7 end 8 return $z_{steer}$ + +# 3 Can we extract steering vectors? + +Here, we show that we can robustly extract steering vectors that generate target sentences perfectly. + +# 3.1 Experimental setup + +We gather a broad corpus spanning four different domains and measure the extent to which our approach can extract a steering vector for each sentence under a variety of experimental conditions, where we vary injection locations and timesteps. + +Data Collection For these experiments on sentence recoverability, we create a dataset which combines four corpora from different domains: movie dialogs (movies), classic books (books), news articles (news), and Wikipedia (wiki). For movies, we choose the Cornell Movie Dialogs corpus (Danescu-Niculescu-Mizil and Lee, 2011), which consists of fictional conversations from movie scripts. We choose NLTK's Gutenberg dataset for our books portion, which consists of a subset of texts from Project Gutenberg (Lebert, 2008). Our news subset comes from the Gigaword dataset for abstractive summarization (Graff et al., 2003). Lastly, our Wikipedia portion comes from WikiText-103 (Merity et al., 2017). For movies, news, and wiki, we extract sentences from its prespecified validation set. For books, since NLTK's Gutenberg dataset lacks a pre-specified data split, we consider the entire dataset. + +Data Preprocessing We sentence tokenize all datasets using NLTK's sentence tokenizer. To construct our dataset, we group sentences by sentence length into 8 bins: 5-10, 10-15, 15-20, 20-25, 25-30, 30-35, 35-40, and 40-128 using NLTK's word-level, regular expression tokenizer. Next, we ran + +
Injection locationTimestepBLEU-4
Embeddingall timesteps33.99
Layer 6 (self attn)all timesteps100.0
Layer 6 (self attn)first timestep99.80
Layer 7 (feed fwd)all timesteps100.0
Layer 7 (feed fwd)first timestep99.25
All layers (self attn + feed fwd)all timesteps100.0
All layers (self attn + feed fwd)first timestep91.72
LM headall timesteps6.72
+ +Table 1: Sentence recovery for steering vectors when injected into different layers of the transformer model (Figure 1) and at multiple timesteps (all timesteps or first timestep). Results show that injecting a steering vector into the transformer stack, even at just the first timestep, can lead to nearly perfect recovery as long as it is in the middle of the network (layers 6 or 7 of 12). + +domly sample 8 sentences from each bin to examine the efficacy of our method for a variety of sequence lengths. + +Measuring the Effectiveness of Steering Given a target sentence $s$ , we measure how well the steering vector $\mathbf{z}_{steer}$ can recover the target sentence by first greedily decoding from the language model with $\mathbf{z}_{steer}$ , and then computing smoothed BLEU-4 using the target sentence $s$ and our decoded reconstruction $\hat{s}$ (Papineni et al., 2002; Chen and Cherry, 2014). + +Hyperparameter Search Our initial experiments showed little variation to most hyperparameters such as initialization method and learning rate schedule, so we fixed them in subsequent experiments using the values in Table 6 in the appendix. We choose GPT2-117M as our language model and evaluate recovery on our dataset while varying injection locations and injection timesteps, the two hyperparameters that affect results significantly. We present a subset of the results in Table 1 and the full set in the appendix (Tables 7, 8, and 9). + +# 3.2 Recovery effectiveness + +Table 1 shows reconstruction performance for several injection methods and indicates that we can recover a target sentence with perfect recovery when injecting $\mathbf{z}_{steer}$ in the middle of the transformer stack (layers 6 or 7 of 12) at just the first timestep and at all timesteps, for sequences up to 128 to + +![](images/0fb702eeff85f7fa20bf1b0703dd70e7cc639d02e77f37f4febf93f68f8b7f18.jpg) +Figure 2: TSNE projection of 8 steering vectors initialized from different random seeds for 20 different sentences (injected at layer 6, after self-attention). $z_{steer}$ is well-separated for different sentences, and the different seeds are tightly clustered for the same target sentence, indicating that our extraction method is robust. + +kens. We surmise that the middle layers of the transformer stack encode sufficiently rich feature representations that a small perturbation of a hidden layer, a steering vector, is sufficient to recover a sentence. The success of steering vectors when injected in the middle of the transformer could help explain why adapter-based fine-tuning is effective. + +In contrast, we find that we cannot steer GPT-2 at either the embedding or final language model head locations. We suspect this is due to the fact that the embedding layer solely captures low-level information (Lin et al., 2019; Ethayarajh, 2019; Rogers et al., 2020). Poor recovery at the LM head location is somewhat surprising, but could be explained by noting that the model has very low capacity above this layer. This suggests that alternative steering mechanisms, such as DExperts, that intervene at the output layers could potentially be improved by modifying hidden states elsewhere in the transformer stack (Liu et al., 2021). + +Robustness Now that we have established that steering vector extraction is possible, we explore whether there exist multiple steering vectors which recover the same sentence, and if so, what the relationship is between these vectors. To do this, we take all 64 sentences from the books subset of the main dataset and initialize 8 different steering vectors for each sentence from different seeds. Experiments reveal that for most sentences (63 of 64) all initializations recover the target sentence + +perfectly, confirming the robustness of our method. + +Latent geometry in text-based auto-encoders struggle with mapping vectors from one space to another consistently (e.g. token space to latent space) (Bowman et al., 2016; Shen et al., 2020). The denoising auto-encoder offers a more consistent token space to latent space mapping (Vincent et al., 2008). To explore whether our steering vectors have a distance-preserving mapping, we cluster the different initializations of steering vectors. We extract 8 steering vectors for each of 20 sentences from the books corpus and down-project them into two-dimensions via TSNE (Maaten and Hinton, 2008). Figure 2 shows 20 distinct clusters, one for each sentence. This indicates that distances between different vectors representing the same target sentence are much smaller than distances between vectors representing different sentences, and that distances in token space could be reflected in the latent steering space. + +Motivated by the clustering results, we investigate whether the mean vector of the 8 extracted steering vectors for each target sentence recover the same sentence. Experiments show that mean vectors are able to recover target sentences nearly perfectly, leading to a BLEU-4 of 99.4, further establishing the robustness of our method. + +# 4 Is unsupervised style transfer in the latent steering space possible? + +We explore whether vector arithmetic in this space is possible in the context of unsupervised style transfer. In other words, we measure whether adding an offset vector, which captures the desired style transfer, to the steering vector effectively changes the style of the generated sentence. Here, we show that unsupervised vector arithmetic with steering vectors is effective for unsupervised sentiment transfer, with performance comparable to models tailored to this task. + +After extracting steering vectors for each sentence, we compute offset vectors by averaging steering vectors for a set of sentences in the source style $\bar{z}_{source}$ and subtracting from the average of a set of steering vectors for the target style $\bar{z}_{target}$ . Next, we flip the style of each sentence in our test set by adding the respective style transfer vector directly to its steering vector after scaling it by $\lambda$ : + +$$ +z _ {t o t a r g e t} = \bar {z} _ {t a r g e t} - \bar {z} _ {s o u r c e} \tag {2} +$$ + +$$ +\hat {z} _ {\text {t a r g e t}} = z _ {\text {s o u r c e}} + \lambda \cdot z _ {\text {t o t a r g e t}} \tag {3} +$$ + +![](images/56403682033bf3da0eca936d187649347d972a7d1c46edced959573901b365a2.jpg) +Figure 3: Evaluation of unsupervised sentiment transfer on the Yelp dataset. The plot shows accuracy vs. self-BLEU by varying $\lambda = (0.25, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 10.0)$ for our method. Overall, the steering vectors perform comparably to prior work. + +Unsupervised Sentiment Transfer Using the Yelp Sentiment dataset preprocessed by Shen et al. (2017), we take 100 sentences from the validation set from each of the two classes of sentiment to compute offset vectors and evaluate on the test set. Following prior work (Shen et al., 2017), we measure how well this approach flips the sentiment of the sentence by measuring the accuracy of a RoBERTA-base model fine-tuned on the Yelp sentiment dataset. We also measure the BLEU-4 between the style transferred sentences and the original and report the results in Figure 3. We call this Self-BLEU following prior work. For this experiment, our steering vectors are injected after the 7th self-attention layer at the first timestep. + +We find that simple vector arithmetic via our steering vectors, which is fully unsupervised, performs comparably to Shen et al. (2017), who learn an autoencoder-based model for the task in a fully supervised manner. Our method also compares well with the Autobot (Montero et al., 2021), AAE, and DAAE models (Shen et al., 2020), which although are unsupervised, either require training on in-domain data or require pretraining on millions of tokens in order to be effective. Other methods that use techniques from unsupervised machine translation to leverage the unpaired data in the task outperform all of these methods significantly (Hu et al., 2017; Lample et al., 2019; He et al., 2020). + +
Steering vectors
Positive Inputthe taste is excellent!
+0.5 * ztone negativethe taste is excellent!
+1.0 * ztone negativethe taste is excellent!
+1.5 * ztone negativethe taste is bitter and bitter
+2.0 * ztone negativetaste is bitter taste is bitter
the taste is unpleasant.
Negative Inputthe desserts were very bland.
+0.5 * ztopositivethe desserts were very bland.
+1.0 * ztopositivethe desserts were very bland.
+1.5 * ztopositivethe desserts were very tasty.
+2.0 * ztopositivethe desserts were very tasty.
+ +Table 2: Examples of transferring sentiment using steering vectors for a positive input sentence (top) and negative input sentence (bottom). These results show fluency and accuracy in transfers while preserving the content of the input sentence. + +These methods are not directly comparable to ours, as they evaluate on a different test set altogether and use the training set to train directly. Our method only requires access to 100 labeled examples per class to compute $\bar{z}_{source}$ and $\bar{z}_{target}$ , far fewer than other baselines. With as few as 10 examples per class, performance of our method remains competitive with autoencoder-based baselines. + +Table 2 shows examples generated by our method for two input sentences. We find that resulting sentences become more positive or negative with increasing $\lambda$ and often modify adjectives by swapping them out. On closer inspection, we find that fluency is often challenging for higher values of $\lambda$ and that the generated sequences repeat individual words or phrases. In addition, we find that negative to positive sentiment transfer is qualitatively more fluent and accurate than positive to negative sentiment transfer; see Table 12 in the appendix for more example generations. Lastly, we evaluate on 19 paired style transfer tasks from the StylePTB dataset (Lyu et al., 2021), but modify the tasks to be unsupervised, following the same approach as above. We find that our method is similarly effective on these tasks; see Table 10 in the appendix for details. + +# 5 Do distances between steering vectors reflect sentence similarity? + +Previously, we found there exist multiple steering vectors that recover a target sentence and that those steering vectors are close together. This indicates the potential for distances in token space to be reflected in distances in the latent space occupied + +![](images/f600ea65a17b85c5f6f92154db56262cc029684e85a10644f21744d0695e572a.jpg) +Figure 4: On the test split of STS-B, we measure Spearman rank correlation $(\rho \cdot 100)$ between sentence similarity scores and cosine similarities between the steering vectors extracted from GPT2-117M when injected at different layers at the first timestep for those sentences. The vertical lines indicate extractive baselines: mean-pooled final hidden states for GPT2-117M and BERT-base as well as mean-pooled GloVe vectors. Results show that extracted steering vectors outperform these. + +by steering vectors. In this section, we explore whether distances relate to semantic similarity. To do so, we use the STS-B test dataset, which consists of sentence pairs and similarity scores. To evaluate our method we extract steering vectors for each sentence separately, compute cosine similarity, and then correlate cosine similarity with annotator similarity via Spearman rank correlation. + +In Figure 4, we show how well extracted steering vectors perform when injected at different layers and at the first timestep in the transformer stack. This observation mirrors the results from the experiment on recovery effectiveness: middle layers in the transformer stack are ideal for steering, leading to perfect recovery and highest performance on semantic similarity. We outperform mean pooling the final hidden states of GPT2-117M and BERT-base as well as averaged GloVe vectors. Even though our method is fully extractive, cosine distances reflect semantic similarity well. We take our two best performing configurations, the 7th self-attention layer and the 7th feedforward layer, and compare with unsupervised methods for tex + +
MethodSpearmanPearson
Extractive methods
Avg GPT2-117M embeddings25.9216.52
Avg Bert embeddings47.2947.91
Avg GloVe embeddings42.5340.25
Layer-7 self attention (ours)52.0451.17
Layer-7 feedforward (ours)52.0851.18
NLI-finetuned methods
AutoBot-base58.49-
InferSent - GloVe68.03-
SBERT-NLI-base77.03-
Lexical methods
GloVe+UP-71.5
GloVe+WR-72.0
+ +Table 3: We evaluate performance on the STS-B test set by measuring Spearman rank correlation and Pearson correlation $(\rho \cdot 100)$ . We take our two best performing configurations from Figure 4 and compare them with three classes of unsupervised methods: extractive, NLI-finetuned, and lexical methods. Our method outperforms the extractive methods, but performs worse than the other methods, which are tailored for this task. + +tual similarity. Table 3 shows that our extracted steering vectors out-perform prior extractive unsupervised methods. Predictably, however, methods which pretrain or fine-tune models on natural language inference datasets such as AutoBot (Montero et al., 2021), InferSent (Conneau et al., 2017), and SBERT (Reimers and Gurevych, 2019) perform better. Lexical methods tailored for semantic similarity such as GloVe with uSIF-weighting and piecewise component removal (GloVE + UP; Ethayarajh (2018)) and GloVe + WR (Arora et al., 2017) also outperform our method. + +# 6 Analysis of Properties + +# 6.1 Interpolation + +Previous experiments indicate that the latent space occupied by steering vectors could be well-formed and smooth. To evaluate this qualitatively, we show linear interpolations of two pairs of steering vectors extracted from the Yelp Sentiment dataset in Figure 5. The space between the vectors look smooth with well-formed grammatical sentences that mix the content of two sentences effectively. The first interpolation (sentence pair 1) in Figure 5 shows that the positive sentiment of the first sentence car + +
λSentence Pair 1Sentence Pair 2
0.0all was hot and good.four peaks also offers great food too.
0.1all was hot and good.four peaks also offers a great range of food and food products too.
0.2all was hot and good.four peaks also offers a number of other great food and drink options too.
0.3all was hot and good.four years ago
0.4all was goodfour years ago
0.5all was goodwhen you're young.
0.6when it came to my turkey sandwich, my husband and I had a great time.when you are young, you simply cannot wait any longer.
0.7when it came to my turkey sandwich, my turkey sandwich was pretty darn good.when you are young, you simply do not know any better.
0.8when it finally came, my turkey sandwich was kinda blah.when you are that young, you simply do not know any better.
0.9when it finally came, my turkey sandwich was kinda blah.when you are that young, you simply don't know any better.
1.0when it finally came, my turkey sandwich was kinda blah.when you are that young, you simply don't know any better.
+ +Figure 5: Interpolation between steering vectors extracted from two pairs of random sentences from the Yelp Sentiment test set. Decoding from interpolated vectors from two sentences produces well-formed output that incrementally changes the sentiment and meaning. + +ries all the way to $\lambda = 0.7$ , despite the content of the sentence changing to the second sentence. The second interpolation (sentence pair 2) in Figure 5 indicates that the latent space could encode some semantics relating to time. The second sentence includes the word "young" and so the transition between the two in $\lambda = 0.3, 0.4$ combines the word "four" from the first sentence with the temporal component of "years ago" to relate the two sentences. Lastly, for each individual sentence there exists a radius around it where those vectors also steer the language model to generate the same target sentence. This could indicate that sentences have a representative volume from which, if any vector was sampled, could recover the sentence. + +# 6.2 Sampling + +Previous experiments show distances reflect semantic similarity and hint at the possibility that the latent space is smooth. Given this, we evaluate whether we can sample from this space. We take 4000 extracted steering vectors from the Yelp Sentiment test set. We treat each dimension of the steering vector as an independent random variable that is normally distributed with a mean and variance equal to the mean and variance across that dimension over this set of steering vectors. Table 11 shows the results of sampling 24 steering vectors and generating from them. We observe + +mixed results: 5 samples lead to fully-formed sentences, and the remaining 19 lead to single tokens or phrases, indicating that treating steering vectors as samples from a multivariate Gaussian is not a reliable approach for sampling well-formed text. + +# 6.3 Intrinsic Dimension & Space Complexity + +We define the intrinsic dimension of the task of steering a language model as the minimum dimension of $z_{steer}$ that achieves perfect recovery on a set of sentences. To measure intrinsic dimension, we vary the dimensions of $z_{steer}$ , choosing 192, 384, 576, 768. We observe that reconstruction BLEU increases as the steering vector dimension increases, indicating that 768 dimensions may be needed to recover sequences nearly perfectly. Given this, we conclude that the intrinsic dimension is at most 768. However, a lower-dimensional representation can recover most sentences: 384 dimensions led to a reconstruction BLEU of 83.29. See Table 4 for more details. Additionally, we find that sentence length and reconstruction BLEU are inversely correlated, i.e. longer sequences are harder to recover. This is well-known; the number of bits needed to encode a sequence grows linearly with its length. We find that all four dimensions of steering vectors can recover short sentences, but lower dimensional steering vectors struggle to recover longer ones. + +
Steering vector dimension192384576768
Reconstruction BLEU-443.4383.2993.93100.00
+ +Table 4: Reconstruction BLEU for different steering vector dimensions. Sentence recovery increases monotonically as the dimension increases, up to $100\%$ recovery at the model's hidden dimension. + +Since steering vectors do not depend on sequence length, space complexity may not be a problem. For a sequence of length 128, assuming 7 characters per word on average (including spaces), storage as a string takes $128 * 7 = 896$ bytes. Our 768d steering vector uses 1536 bytes (fp16), but we can compress it by a factor of 2 (384d) sacrificing a little recovery (see Table 4) and store it using 768 bytes, less than its string representation. + +# 6.4 Memorization + +Our nearly perfect recoverability performance indicates that steering vectors could either be encoding important properties by leveraging the language + +![](images/67da5bfcee33ab9df0ca14991f5571e2f4dbb940af53a77d9a1db59b0657b4a8.jpg) +Figure 6: We measure reconstruction BLEU for steering vectors learned for three datasets: books, shuffled, and gibberish. Reconstruction BLEU for gibberish and shuffled data is lower than books indicating that the steering vector isn't just memorizing the sequence, but also leveraging the language model well. + +model, which would help generalization, or just simply be memorizing arbitrary sequences without using the underlying language model at all. In order to evaluate this, we randomly sample 64 sentences with lengths matching that of the books subset of our dataset, where each token is sampled uniformly at random with replacement from the vocabulary, and call this the gibberish fold of our dataset, following Subramani et al. (2019). Secondly, to measure whether both content and word order affect recoverability, we construct another fold, the shuffled fold, by randomly shuffling the tokens in the sentences in the books subset. + +Figure 6 shows the results of injecting steering vectors into the 6th layer after the self-attention block in the transformer for all timesteps and the first timestep across all three datasets. We observe that recoverability is highest for books, then shuffled, and lastly gibberish. The gap between performance on books and gibberish indicates that steering vectors are not simply memorizing. Since recovery on books is greater than recovery on shuffled, we conclude that steering vectors encode some information about word order. Lastly, we notice that only passing the steering vector at the first timestep may reduce unwanted memorization capability because the relative difference in recovery between gibberish and the other sets is large. + +# 6.5 Connection to Prompting + +Motivated by the successes of prompt-based methods on zero-shot tasks with large generative lan + +guage models such as GPT-3 (Brown et al., 2020), we evaluate a prompt-based version of our method. Instead of adding $\mathbf{z}_{steer}$ to the hidden states of the language model, we concatenate $k$ steering vectors with the input embeddings, so that all tokens can attend to these $\mathbf{z}_{steer}$ vectors. Experiments on the books subset show that recovery is much lower with this prompt-based approach than when injecting steering vectors directly into the transformer stack of the model. Even with $k = 50$ steering vectors injected via this prompt-based approach, recovery fails to match that of a single steering vector $\mathbf{z}_{steer}$ injected into the hidden states of the language model. + +
Num prompt vectors15102050
Reconstruction BLEU-481.794.398.798.698.5
+ +Table 5: We measure reconstruction BLEU using a prompt-based approach, where latent steering vectors are concatenated to the embeddings. Even though each prompt vector is 768 dimensional, reconstruction BLEU is much lower in this setting than injecting a single steering vector into the layers of the transformer stack. + +# 7 Related Work + +There exist many works, often using text-based autoencoders that try to induce a sentence representation space for controllable text generation by learning new models (Hu et al., 2017; Shen et al., 2017, 2020; Mai et al., 2020; Montero et al., 2021). Our work concludes that we can extract steering vectors from pretrained models that have latent spaces that allow operations like this, without having to train any new models at all. Other approaches control language models by adapting their hidden states using steerable layers, adapters, or steering their logits using auxiliary language models (Gulcehre et al., 2015; Dathathri et al., 2019; Houlsby et al., 2019; Zhang et al., 2020; Liu et al., 2021; Krause et al., 2021). Our method differs from all of these: we extract steering vectors directly from a language model and operate on the latent space occupied by these vectors, never fine-tuning any component of the model. Subramani et al. (2019) investigate whether LSTM-based language models have sentence representations from which they can generate the original sentence. Although this premise relates to our first question: can we extract steering vectors, we extend far beyond that + +showing that vector arithmetic in the context of unsupervised style transfer is effective in our latent steering space. + +# 8 Conclusion + +In this paper we introduce a different approach to controllable text generation, where we extract latent steering vectors directly from a pretrained language model without fine-tuning. Further, we find that our steering vectors lead to near perfect recovery on English sentences from a variety of domains. We show that vector arithmetic can be used in the context of unsupervised style transfer on the Yelp sentiment dataset and StylePTB benchmark, performing comparably to models tailored to these tasks. Experiments reveal that distances between steering vectors reflect sentence similarity when evaluated on STS-B, outperforming extractive methods. Finally, we analyze properties of the steering vectors. Our results indicate that we can control frozen pretrained language models effectively through their latent steering space. + +# 9 Ethics Statement + +We introduce a new approach for controllable text generation by extracting vectors from a pretrained language model, leveraging information that is already encoded in the language model. Large pretrained models are known to be biased and our method of extracting steering vectors can reflect biases already present in these large pretrained language models (Bender et al., 2021). The methods we present for controllable text generation could potentially be used for many downstream tasks such as unsupervised style transfer, abstractive summarization, and offensive content removal. Unfortunately, this also means that this technology has the potential to be misused to perpetuate biases or generate offensive or toxic text. + +Our technology does not guarantee removal of toxic content, even in the case of unsupervised style transfer from toxic to nontoxic text. To use this method, we encourage readers to first take steps to address biases that are already present in the underlying language model. Further we recommend that this technology not be used in high-stakes settings, especially those where deployment of this technology could cause harm. + +# References + +Sanjeev Arora, Yingyu Liang, and Tengyu Ma. 2017. A simple but tough-to-beat baseline for sentence embeddings. In ICLR. +Emily M. Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. 2021. On the dangers of stochastic parrots: Can language models be too big?. FAccT. +Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. 2016. Generating sentences from a continuous space. CoNLL 2016. +Tom B. Brown, Benjamin Pickman Mann, Nick Ryder, Melanie Subbiah, Jean Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, G. Krüger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric J Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. arXiv preprint arXiv:2005.14165. +Isaac Caswell, Julia Kreutzer, Lisa Wang, Ahsan Wahab, Daan van Esch, Nasanbayar Ulzii-Orshikh, Allahsera Auguste Tapo, Nishant Subramani, Artem Sokolov, Claytone Sikasote, Monang Setyawan, Supheakmungkol Sarin, Sokhar Samb, Benoit Sagot, Clara Rivera, Annette Rios Gonzales, Isabel Papadimitriou, Salomey Osei, Pedro Ortiz Suarez, Iroro Orife, Kelechi Ogueji, Rubungo Andre Niyongabo, Toan Q. Nguyen, Mathias Muller, Andr'e Muller, Shamsuddeen Hassan Muhammad, Nanda Firdausi Muhammad, Ayanda Mnyakeni, Jamshidbek Mirzakhalov, Tapiwanashe Matangira, Colin Leong, Nze Lawson, Sneha Kudugunta, Yacine Jernite, M. Jenny, Orhan First, Bonaventure F. P. Dossou, Sakhile Dlamini, Nisansa de Silva, Sakine cCabuk Balli, Stella Rose Biderman, Alessia Battisti, Ahmed Baruwa, Ankur Bapna, Pallavi N. Baljekar, Israel Abebe Azime, Aodyele Awokoya, Duygu Ataman, Orevaoghene Ahia, Oghenefego Ahia, Sweta Agrawal, and Mofetoluwa Adeyemi. 2022. Quality at a glance: An audit of web-crawled multilingual datasets. TACL. +Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. SemEval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 1-14, Vancouver, Canada. Association for Computational Linguistics. +Boxing Chen and Colin Cherry. 2014. A systematic comparison of smoothing techniques for sentence-level bleu. In Proceedings of the Ninth Workshop on Statistical Machine Translation. +Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. 2017. Supervised + +learning of universal sentence representations from natural language inference data. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 670-680, Copenhagen, Denmark. Association for Computational Linguistics. +Cristian Danescu-Niculescu-Mizil and Lillian Lee. 2011. Chameleons in imagined conversations: A new approach to understanding coordination of linguistic style in dialogs. In CMCL@ACL. +Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, and Rosanne Liu. 2019. Plug and play language models: A simple approach to controlled text generation. In ICLR. +Yuntian Deng, Anton Bakhtin, Myle Ott, and Arthur D. Szlam. 2020. Residual energy-based models for text generation. In ICLR. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. CoRR. +Kawin Ethayarajh. 2018. Unsupervised random walk sentence embeddings: A strong but simple baseline. In Proceedings of The Third Workshop on Representation Learning for NLP, pages 91-100, Melbourne, Australia. Association for Computational Linguistics. +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. +David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. 2003. English gigaword. Linguistic Data Consortium, Philadelphia. +Jiatao Gu, Kyunghyun Cho, and Victor O.K. Li. 2017. Trainable greedy decoding for neural machine translation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1968-1978, Copenhagen, Denmark. Association for Computational Linguistics. +Caglar Gulcehre, Orhan First, Kelvin Xu, Kyunghyun Cho, Loic Barrault, Huei-Chi Lin, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2015. On using monolingual corpora in neural machine translation. arXiv preprint arXiv:1503.03535. +Junxian He, Xinyi Wang, Graham Neubig, and Taylor Berg-Kirkpatrick. 2020. A probabilistic formulation of unsupervised text style transfer. In ICLR. + +Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-efficient transfer learning for nlp. In ICML. +Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P. Xing. 2017. Toward controlled generation of text. In ICML. +Di Jin, Zhijing Jin, Zhiting Hu, Olga Vechtomova, and Rada Mihalcea. 2020. Deep learning for text style transfer: A survey. ArXiv, abs/2011.00416. +Yoon Kim. 2021. Sequence-to-sequence learning with latent neural grammars. ArXiv, abs/2109.01135. +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +Ben Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar, Shafiq Joty, Richard Socher, and Nazneen Fatema Rajani. 2021. GeDi: Generative discriminator guided sequence generation. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 4929-4952, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Guillaume Lample, Sandeep Subramanian, Eric Michael Smith, Ludovic Denoyer, Marc'Aurelio Ranzato, and Y-Lan Boureau. 2019. Multiple-attribute text rewriting. In ICLR. +Marie Lebert. 2008. Project Gutenberg (1971-2008). +Brian Lester, Rami Al-Rfou, and Noah Constant. 2021. The power of scale for parameter-efficient prompt tuning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3045-3059, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Yongjie Lin, Yi Chern Tan, and Robert Frank. 2019. Open sesame: Getting inside BERT's linguistic knowledge. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pages 241-253, Florence, Italy. Association for Computational Linguistics. +Alisa Liu, Maarten Sap, Ximing Lu, Swabha Swayamdipta, Chandra Bhagavatula, Noah A. Smith, and Yejin Choi. 2021. DExperts: Decoding-time controlled text generation with experts and anti-experts. 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 6691-6706, Online. Association for Computational Linguistics. +Yiwei Lyu, Paul Pu Liang, Hai Pham, Eduard Hovy, Barnabás Póczos, Ruslan Salakhutdinov, and Louis-Philippe Morency. 2021. StylePTB: A compositional + +benchmark for fine-grained controllable text style transfer. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2116-2138, Online. Association for Computational Linguistics. +L. V. D. Maaten and Geoffrey E. Hinton. 2008. Visualizing data using t-sne. JMLR. +Florian Mai, Nikolaos Pappas, Ivan Montero, Noah A. Smith, and James Henderson. 2020. Plug and play autoencoders for conditional text generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6076-6092, Online. Association for Computational Linguistics. +Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2017. Pointer sentinel mixture models. ArXiv, abs/1609.07843. +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. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In ACL. +Jeffrey Pennington, Richard Socher, and Christopher 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, Doha, Qatar. Association for Computational Linguistics. +Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke S. Zettlemoyer. 2018. Deep contextualized word representations. In NAACL-HLT. +Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding by generative pre-training. Unpublished ms. available through a link at https://blog.openai.com/language-unsupervised/. +Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. +Nils Reimers and Iryna Gurevych. 2019. SentenceBERT: Sentence embeddings using Siamese BERTnetworks. 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, Hong Kong, China. Association for Computational Linguistics. + +Anna Rogers, Olga Kovaleva, and Anna Rumshisky. 2020. A primer in BERTology: What we know about how BERT works. Transactions of the Association for Computational Linguistics, 8:842-866. +Alexis Ross, Tongshuang (Sherry) Wu, Hao Peng, Matthew E. Peters, and Matt Gardner. 2021. Tailor: Generating and perturbing text with semantic controls. ArXiv, abs/2107.07150. +Tianxiao Shen, Tao Lei, Regina Barzilay, and T. Jaakkola. 2017. Style transfer from non-parallel text by cross-alignment. In NIPS. +Tianxiao Shen, Jonas Mueller, Regina Barzilay, and T. Jaakkola. 2020. Educating text autoencoders: Latent representation guidance via denoising. In ICML. +Taylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace, and Sameer Singh. 2020. AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4222-4235, Online. Association for Computational Linguistics. +Nishant Subramani, Samuel Bowman, and Kyunghyun Cho. 2019. Can unconditional language models recover arbitrary sentences? In NeurIPS. +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 NeurIPS. +Pascal Vincent, H. Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. 2008. Extracting and composing robust features with denoising autoencoders. In ICML. +Lilian Weng. 2021. Controllable neural text generation. _lilianweng.github.io/lil-log_. +Jeffrey O. Zhang, Alexander Sax, Amir Roshan Zamir, Leonidas J. Guibas, and Jitendra Malik. 2020. Side-tuning: A baseline for network adaptation via additive side networks. In ECCV. +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. NIPS. + +# A Appendix + +# A.1 Extracting steering vectors + +In this section, we show the hyperparameter configurations used for extracting steering vectors from GPT2-117M. Table 6 contains the list of final hyperparameters that we use to extract steering vectors for the different analyses in this paper. Table 7 shows the recovery performance of steering vectors when injected at different layers in the transformer stack on our compiled dataset. These experiments reveal that injecting in the middle of the transformer stack either after the self attention layer or the feedforward layer leads to the highest BLEU-4 performance. In fact, any layer other than the first or last layer achieves nearly perfect recovery. + +In Table 8 we look at recovery performance when injecting steering vectors at the embedding layer, transformer stack, and language modeling head, as well as different combinations of them. Injecting steering vectors at every layer in the transformer stack performed best. Table 9 shows how recoverability changes with respect to how many timesteps $z_{steer}$ is injected at. Injecting at all timesteps performs negligibly better than injecting at just the first timestep. + +
HyperparametersValues
ModelGPT-2-117M
Max train steps500
Vector initialization strategyXavier normal
Learning rate[0.01, 1.0]
OptimizerAdam
Learning rate SchedulerDecay on a plateau
Scheduler decay factor0.9
Scheduler decay patience1.0
+ +# A.2 Unsupervised Sentiment Transfer + +Yelp Sentiment We also include generations from the unsupervised sentiment transfer experiment on the Yelp dataset. Table 12 shows 8 more generations. These generations highlight the same trends as before: with increasing $\lambda$ , sentiment transfer strength increases. We find that some genera + +Table 6: List of hyperparameter configurations used to extract ${z}_{steer}$ from GPT2-117M. + +
Injection locationlayerstimesteplrBLEU-4
self_attn0all timesteps133.25
feedforward0all timesteps197.68
self_attn1all timesteps198.06
feedforward1all timesteps199.54
self_attn2all timesteps1100.00
feedforward2all timesteps199.69
self_attn3all timesteps1100.00
feedforward3all timesteps1100.00
self_attn4all timesteps1100.00
feedforward4all timesteps1100.00
self_attn5all timesteps1100.00
feedforward5all timesteps1100.00
self_attn6all timesteps1100.00
feedforward6all timesteps199.62
self_attn7all timesteps199.62
feedforward7all timesteps1100.00
self_attn8all timesteps1100.00
feedforward8all timesteps198.84
self_attn9all timesteps199.22
feedforward9all timesteps198.61
self_attn10all timesteps197.50
feedforward10all timesteps195.24
self_attn11all timesteps186.04
feedforward11all timesteps16.29
+ +Table 7: This table shows the reconstruction BLEU-4 for steering vectors from our compiled dataset when injected after different self attention and feedforward layers in the transformer stack. Injecting at the middle layer of the language model performs best. + +tions do more than just flip the sentiment of the major adjective in the sentence such as adding the phrase "a great way to get a good laugh" in the 4th negative to positive generation when $\lambda = 2.5$ . + +StylePTB For this study, we use 19 of 21 paired style transfer tasks from the StylePTB dataset (Lyu et al., 2021), but modify the tasks to be unsupervised, following the same approach as sentiment transfer. We randomly sample 100 sentences for each class from the training split for each of the style classes and use those to compute offset vectors. This offset vector is then added to the steering vector of the sentence to transfer style. We follow the evaluation in Lyu et al. (2021) because we have ground truth data and compare with fully + +
Injection locationtimesteplrBLEU-4
embeddingall timesteps0.0133.99
every_layerall timesteps0.01100.00
lm_headall timesteps0.016.72
embedding+every_layerall timesteps0.0196.52
every_layer+lm_headall timesteps0.01100.00
embedding+lm_headall timesteps0.0183.27
embedding+every_layer+lm_headall timesteps0.0198.11
every_layer_self_attnall timesteps0.0199.62
every_layer+every_layer_self_attnall timesteps0.01100.00
every_layer_self_attn+embedding+lm_headall timesteps0.0197.31
every_layer_self_attn+lm_headall timesteps0.0199.62
every_layer_self_attn+embeddingall timesteps0.0194.28
+ +Table 8: Here, we present the reconstruction BLEU-4 results for steering vectors on our multi-domain compiled dataset. We vary injection location here and observe that injecting into the transformer stack is necessary for good recovery. Injecting at the embedding or language model head performs poorly. + +
Injection locationtimesteplrBLEU-4
every_layer+every_layer_self_attnall timesteps0.01100.0
every_layer+every_layer_self_attnfirst timestep0.0191.7
Layer 7 (feedforward)all timesteps1100.0
Layer 7 (feedforward)first timestep199.2
Layer 6 (self_attn)all timesteps1100.0
Layer 6 (self_attn)first timestep199.8
+ +Table 9: In this table, we vary the timestep where we inject $z_{steer}$ (all timesteps or first timestep) for three of our best injection locations. We again evaluate on our multi-domain compiled dataset and find that injecting at just the first timestep has a negligible decrease in recovery performance. + +supervised methods. Experiments show that unsupervised vector arithmetic with steering vectors performs comparably using BLEU-1 to supervised methods designed for style transfer on tasks that require minimal edits (adjective emphasis (AEM), active to passive (ATP), information addition (IAD), and PP front to back (PFB)). We report BLEU-1 following prior work. See Table 10 for results on all 19 tasks. Note Lyu et al. (2021) do not report any baseline numbers for AAR, ASR, LFS, MFS, NAR, NSR, and VSR for any of their models. + +# A.3 Sampling + +In order to evaluate whether we can sample steering vectors reliably, we collect 4,000 extracted steering vectors from the Yelp Sentiment test set. To generate, we consider each dimension of the steering vector as an independent random variable that is normally distributed. The dimension means and + +variances are equal to the mean and variance for that dimension across this set of steering vectors. In Table 11, we show the results of sampling 24 steering vectors from these independent normally distributed random variables and generating from them using GPT2-117M as our language model. These results are mixed with approximately $20\%$ of the generations leading to fully formed sentences and the remaining $80\%$ corresponding to individual words or short phrases. This could perhaps be partially explained by the fact that text from the web, including the corpora GPT2 was trained on, can often be of poor quality, especially when automatically crawled (Caswell et al., 2022). Alternatively, our choice of considering $d$ -dimensional steering vectors as samples from $d$ independent normally distributed random variables could be an incorrect assumption. Alternative formulations could lead to more fluent and reliable generations. + +
Ours: λ = 0.25GPT2-finetuneSeq2seqTAILORNeural QCFG + copyRetrieve-Edit
AAR0.825-----
AEM0.7740.2630.187-0.6760.387
ARR0.7210.6470.4500.781-0.897
ASR0.819-----
ATP0.6660.4760.3730.5560.8360.681
IAD0.7720.4790.345--0.493
LFS0.396-----
MFS0.748-----
NAR0.825-----
NSR0.677-----
PFB0.8190.3980.3930.842-0.541
PPR0.3930.7630.3300.717-0.798
PTA0.5740.4330.339--0.714
SBR0.1200.4300.317--0.706
TFU0.6990.8950.5270.873-0.899
TPA0.4780.8360.4780.884-0.935
TPR0.6920.7540.5160.710-0.909
VEM0.5480.3090.289-0.6640.416
VSR0.739-----
+ +Table 10: In this table, we show performance on StylePTB. Although our method is unsupervised, we outperform GPT2-finetune and seq2seq on most tasks. For minimal edit tasks such as AEM, ARR, ATP, and PFB, we achieve comparable performance to TAILOR, Neural QCFG + copy, and Retrieve-Edit, which are models trained specifically for these types of tasks. Note: we obtain the numbers for GPT2-finetune, Seq2seq, and Retrieve-Edit from (Lyu et al., 2021), for TAILOR from (Ross et al., 2021), and for Neural QCFG+copy from (Kim, 2021). + +
Sampled Sequences
...mobile
wine..the first time that we’ve seen a team that looked good on paper.
peopled by.Gathering around the world, we can all agree that the next step is to get our voices heard.
kitchen....x
lifeitem link
nomnomnomnomappointments
ofkitate.com
We’re going to make sure that we have a safe and secure environment for our employees.3
apphotel
racialimagine a world where every day we see a new voice in our communities.
apply(AAP) - The United States and its European allies are pressing ahead with plans to boost the number of refugees arriving in the country from Iraq and Syria.\nThe United States and its allies are pressing ahead on the issue as they work to boost the number and scope of refugees arriving in Europe.
ivthe best.
+ +Table 11: Here we show results from our sampling experiment, where we treat steering vectors as samples from $d$ independent normally distributed random variables. We sample 24 steering vectors, pass them to GPT2-117M, and decode, resulting in the 24 generations presented here. + +Unsupervised sentiment transfer using steering vectors + +
Positive to negativeNegative to positive
input+0.5*ztone negative+1.0*ztone negative+1.5*ztone negative+2.0*ztone negativei highly recommend this place!i highly recommend this place!i highly recommend this place!i highly recommend this place!i was very disappointed.input+0.5*ztopositive+1.0*ztopositive+1.5*ztopositive+2.0*ztopositivemy goodness it was so gross.my goodness it was so gross.my goodness it was so gross.my goodness it was so good.
input+0.5*ztone negative+1.0*ztone negative+1.5*ztone negative+2.0*ztone negativeit is always good to find quality local spots when traveling.it is always good to find quality local spots when traveling.it is always good to find quality local spots when traveling.it is always good to find local spots when traveling.it was always going to be a long time.input+0.5*ztopositive+1.0*ztopositive+1.5*ztopositive+2.0*ztopositivewent here for the first time to try something new ... bad idea.went here for the first time to try something new.went here for the first time to try something new.went here for the first time to try something new.went here for the first time to try something new.went here for the first time to try something new.I'm really looking forward to trying something new for the first time.
input+0.5*ztone negative+1.0*ztone negative+1.5*ztone negative+2.0*ztone negativeit was delicious!it was delicious!it was delicious!it was a very bad night.it was a very bad night.input+0.5*ztopositive+1.0*ztopositive+1.5*ztopositive+2.0*ztopositiveif i could give them a zero star review i would!if i could give them a star i would!if i could give them a star i would!if i could give them a star i would!if i could give them a star i would!
input+0.5*ztone negative+1.0*ztone negative+1.5*ztone negative+2.0*ztone negativethe food is fresh and the environment is good.the food is fresh and the environment is good.the food is fresh and the environment is good.the food is bad.the food was produced in the past.input+0.5*ztopositive+1.0*ztopositive+1.5*ztopositive+2.0*ztopositive+2.5*ztopositivefries are n't worth coming back.fries are good.fries are good.fries are good.fries are good.fries are a great way to get a good laugh.
+ +Table 12: This table shows some generations from unsupervised sentiment transfer of steering vectors. Sentences are from the Yelp dataset. We find that with increasing $\lambda$ sentiment transfers more strongly towards positive or negative, often switching at $\lambda = 1.5$ . \ No newline at end of file diff --git a/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/images.zip b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d3c71e5acfadca92ef5bac85b9d1736c6d1de7bc --- /dev/null +++ b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe2e0e6f24baf4fda7ff1cbe000eafe314a4719610c82c7099c8385c43acf6a3 +size 1014656 diff --git a/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/layout.json b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..37b26e002827630f5f57d7bdd91d06f9f84cbf35 --- /dev/null +++ b/extractinglatentsteeringvectorsfrompretrainedlanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:365addb17ed179317b9d36e255a8fdecc9b72111ced5f3083647dd330dc1a151 +size 413711 diff --git a/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_content_list.json b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..706cf370d61cd30b9e044913413d27813279b5be --- /dev/null +++ b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f028e81cd6911d150f43183d7e6d89e432012358fc0444b93ffd32df6487067d +size 113777 diff --git a/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_model.json b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..479264728d4c918834aff6e1387958b07cc9a722 --- /dev/null +++ b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90f532823fb08030ba29e95128cc0e6d900686082d58648221050d092ea0a08c +size 141094 diff --git a/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_origin.pdf b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..29a624080d5305a739957edbe397638fd9799a3e --- /dev/null +++ b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/b9f65200-3e4b-4f6b-a25b-3abedc8d9a1e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1365801e3b27b723b6e902bfc2dec03781fe87236024c565b354d47ee65a6c4 +size 418430 diff --git a/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/full.md b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4c49068ca6be26810f11e8e4c6010d0eb8f1b0e3 --- /dev/null +++ b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/full.md @@ -0,0 +1,475 @@ +# Extracting Person Names from User Generated Text: Named-Entity Recognition for Combating Human Trafficking + +Yifei Li + +Pratheeksha Nair + +Kellin Peline + +Reihaneh Rabbany + +School of Computer Science + +McGill University + +Mila - Quebec AI Institute + +# Abstract + +Online escort advertisement websites are widely used for advertising victims of human trafficking. Domain experts agree that advertising multiple people in the same ad is a strong indicator of trafficking. Thus, extracting person names from the text of these ads can provide valuable clues for further analysis. However, Named-Entity Recognition (NER) on escort ads is challenging because the text can be noisy, colloquial and often lacking proper grammar and punctuation. Most existing state-of-the-art NER models fail to demonstrate satisfactory performance in this task. In this paper, we propose NEAT (Name Extraction Against Trafficking) for extracting person names. It effectively combines classic rule-based and dictionary extractors with a contextualized language model to capture ambiguous names (e.g. penny, hazel) and adapts to adversarial changes in the text by expanding its dictionary. NEAT shows $19\%$ improvement on average in the F1 classification score for name extraction compared to previous state-of-the-art in two domain-specific datasets. + +# 1 Introduction + +There are approximately 4.8 million people being trafficked around the world for commercial sex, a global industry estimated to be worth $99 billion USD (Office, 2017). Technology has been a critical tool for traffickers to recruit, advertise and exploit victims (on Drugs and Crime, 2020) and the majority of human trafficking (HT) victims are advertised on online escort websites (Rhodes and Rhodes, 2016). Recently, there have been multiple efforts to leverage AI techniques for analyzing the online advertising market and providing law enforcement with actionable intelligence to counter human trafficking (Tong et al., 2017; Rabbany et al., 2018; Lee et al., 2021). One of the key + +tasks in this domain is extracting information from the online escort ads e.g. names, phone numbers, locations, prices and activity types, which are critical for higher level analysis and modus operandi detection. This information needs to be extracted from the text of the ads, and it plays a vital role in tasks such as identifying groups of related ads and finding links between them. However, this is a challenging task since in order to avoid detection, this data is made: + +- noisy and obscured e.g. using 'rose' symbols as a proxy for dollar sign and spelling variations such as 'Cathy' and 'Kathy.' +- evolving and adversarial e.g. traffickers are actively introducing new patterns and intentional misspellings to avoid detection, e.g. adapting new phrases to indicate underage victims such as 'amber alert' or intentionally misspelling 'miss' as 'mizz.' + +Names have a particular importance. Trafficking is an organized activity (Lee et al., 2021) and multiple people being involved in an escort ad is a strong indicator of human trafficking. Also, the more victims involved in a case, the higher priority of investigation it needs to be given in order to minimize the harm. Hence, accurately retrieving all the names in an advertisement is critical for further analysis and action. + +Thus, while the general task of Named Entity Recognition (NER) usually includes diverse entities such as person names, organizations, and geolocations, in this paper, we focus on person name extraction from escort ads for combating human trafficking. + +Most advanced NER models are trained on annotated structured text corpora and/or rely on contextual information for identifying entities. However, escort advertisements are usually colloquial and consist of segmented phrases instead of continuous sentences. The state-of-the-art extractor in this domain (TJBatch Nagpal et al., 2017) is rule-based + +but has limited dictionaries and has difficulty dealing with ambiguity such as distinguishing person names from location names. Therefore, simple rule-based extractors or machine learning models that are context-based alone will fail in several instances in this domain. To better illustrate this, we compared the results from TJBatch and TransformerBERT (a baseline NLP model) on two example ads collected from an escort advertisement website: + +- TJBatch – The state-of-the-art named entity extractor (Dubrawski et al., 2015; Chambers et al., 2019) in the human trafficking domain. This method extracts words from a dictionary and is based on manually designed regex rules. +- Transformer-Bert - A BERT model (Devlin et al., 2018) fine-tuned on the English version of the standard CoNLL-2003 Named Entity Recognition dataset. + +My name is Mizz Mercedes Aka BBW CARAMEL + +Im a Big juicy escort- voluptuous classy, sweet, sensual, warm and tender person by nature. + +TJBatch: ['mizz', 'juicy'] + +Transformer-Bert: ['aka', 'mercedes', 'mizz'] +True: ['mercedes'] + +Dundas west and Jane [phone_number] $70 HH + +♥ ROSE SUPER-BUSTY! SUPER-TIGHT! + +TIFFANY ULTRA-TIGHT BRUNETTE SENSATION! $\text{心}$ CAMILLA BIG-BUM + +SCHOOLGIRL FUN! [phone_number] +Location:DUNDAS WEST and JANE + +TJBatch: ['jane', 'rose', 'tiffany', 'camilla', 'jane'] + +Transformer-Bert: None + +True: ['camilla', 'rose', 'tiffany'] + +Figure 1: State-of-the-art tools fail to precisely and accurately extract all person names in an escort ads + +The results (Figure 1) show that both the domain-specific and general NER models fail in identifying certain person names in the ad. In this paper, we focus on designing an improved technique for name extraction from noisy escort advertisements. The main contributions of this paper are three-fold. + +- We show that existing state-of-the-art tools and language models fall short in accurately identifying names from extremely noisy and unstructured escort advertisement text. +- We introduce a name extractor, NEAT (Name Extraction Against Trafficking), that enhances a core rule-based extractor with masked language models to perform disambiguation. +We show that NEAT outperforms the previous state-of-the-art NER model for name extraction from escort advertisements, with an average of $19\%$ improvement in F1 for our two domain + +specific datasets. + +# 2 Related Work + +There have been several surveys and systematic reviews of the problem of named entity recognition (NER) from text (Goyal et al., 2018; Li et al., 2020; Yadav and Bethard, 2019; Saju and Shaja, 2017) which all tend to outline three broad techniques: rule-based, learning-based and hybrid approaches (Goyal et al., 2018). We group the related works as: + +Rule-based NER: Rule-based approaches involve predefined lists, dictionaries and/or rules based on syntactic-lexical patterns which text snippets are matched against. These methods have the obvious limitation of missing out on uncommon rules and never-seen-before dictionary keys. These methods tend to fail especially in applications where text may be informal and unstructured and need to be fortified with additional modules. + +Statistical learning models for NER: Some of the methods used for the general NER problem include Hidden Markov Models (HMM) (Wang et al., 2014), Support Vector Machines (SVM) (Saha et al., 2010), Conditional Random Fields (CRF) (Majumder et al., 2012; Wang et al., 2014), Maximum Entropy Markov Models (MEMM) (Saha et al., 2009) and Logistic Regression based systems (Ek et al., 2011). In semi-supervised approaches, a small set of the training data is first used for extracting word and context features and the rest of the data is used for training a learning algorithm in a supervised fashion (Goyal et al., 2018). However, these methods require large quantities of labelled data for training which is difficult to achieve in many real world applications, including our domain of interest. + +Embedding Models for NER: Embedding methods such as Word2Vec (Mikolov et al., 2013a,b), GloVe (Pennington et al., 2014), and FastText (Joulin et al., 2017) generate fixed vectors for each input token and more recent methods such as ELMo (Peters et al., 2018) and BERT (Devlin et al., 2018) and its variations give context-aware embeddings and have been shown to improve entity extraction. A more recent work, LUKE (Yamada et al., 2020), based on a transformer model that treats not only words but also entities as independent tokens. It computes intermediate and output representations for all tokens, and reports the state-of-the-art results in general NER. Other + +popular architectures for NER include bidirectional LSTM + CRF (Lample et al., 2016), enhanced with character-level contextualized representations (Ak-bik et al., 2018) and contextualized word representations (CWR) based on a bidirectional transformer (Alexei et al., 2019). + +Applying pre-trained models directly on escort ads performs poorly because of the very limited amount of labeled data available for training. Noncontext-aware models are limited in this domain due to a significant number of names that are also common nouns which may occur with an abnormal frequency due to the adversarial and pseudonymous nature of the domain (e.g. Amber, Joy, Angel...). + +NER for noisy text: Kumar et al. (2020) conducted experiments to explore the sensitivity of BERT to synthetic noise (such as spelling mistakes) in text data and showed that performance decreases drastically with increase in noise. Mishra and Diesner (2016) introduced a linear CRF model called TwitterNER that uses random feature dropout and a modified encoding scheme in combination with semi-supervised learning from unlabelled data to handle noisy and unstructured user-generated text such as tweets. However, the low F1-score in HT datasets, as shown in Table 2, show that it is not best suited for this domain. It is worth mentioning that there are also recent efforts (Liu et al., 2021) to deal with noisy labelled NER, which is a different setting from ours. + +NER for Combating Human Trafficking: Apart from a few, there haven't been significant efforts towards extracting names and other entities from noisy escort advertisement text. Dubrawski et al. (2015) and Nagpal et al. (2017) used rule-based approaches specifically designed for tackling this problem. This work suffers from the shortcomings of any rule-based approaches as discussed before. Kejriwal and Kapoor (2019) proposed a network-based approach that focused on the assessment of NER algorithms in the human trafficking domain that can overcome the lack of labeled evaluation data. There have also been efforts in extracting entities for general illegal activity from data scraped from Tor Darknet (Al-Nabki et al., 2020, 2019). NEAT draws on both domain-specific rule-based approaches as well embedding based models to address the shortcomings and limitations of current methods. + +# 3 Problem Definition + +In this section, we formally define the problem of person name extraction in the human trafficking domain both at the word-level and at the ad-level. + +Word-level definition: Given an advertisement $A = (a_{1}, a_{2}, a_{3}, \dots, a_{n})$ , where $a_{i}$ represents a sequence of words in the given ad, the NER task is to output a sequence with labels $Y = (y_{1}, y_{2}, y_{3}, \dots, y_{n})$ where $y_{i} \in \{0, 1\}$ ( $\neg \text{Person}$ , $\text{Person}$ ). + +Since our focus is in correctly retrieving all the names in a given escort ad, we also consider a slightly reformulated problem: + +Ad-level definition: Given an advertisement $A = (a_{1}, a_{2}, a_{3}, \ldots, a_{n})$ , we want to find a list of names that have appeared in this ad. The corresponding NER task is to output a set of words $N = \{a_{i} | a_{i} \in A \land y_{i} = 1\}$ . + +The language used in a typical escort ad may be both unstructured and ambiguous. The sentences are usually short and segmented using white spaces or special characters, making it harder to tokenize. It has a free choice in syntax and many person names appear in the text without a proper context. In the second example in Figure 1 the names 'Rose', 'Tiffany' and 'Camilla' are not particularly in context. Additionally, some names may be similar to location names ('Jane' in Figure 1) or adjectives (Olive, Hazel). Such names cannot simply be omitted from the dictionary either without hurting the recall. + +# 4 Proposed Method + +We propose a person name recognition system (Figure 2) for combating human trafficking. This system consists of three modules - a rule-based extractor, a disambiguation layer and a dictionary expansion procedure. The first two modules handle named-entity recognition and disambiguation of names respectively. The third module is designed to adapt the system to evolving changes in the advertisement text like newly introduced (pseudo)names. + +Preprocessing: Due to its colloquial nature, the input text needs to undergo preprocessing. Contractions related to a person name context are expanded (e.g "I'm" is changed to "I am") to fit the rule-based extractor, and all special characters and emojis are + +![](images/6f65506af664d249f9305b3d4149c1c837e89e41697c2e91c08a103c204ef502.jpg) +Figure 2: NEAT Overview + +removed. The text is also true-cased as the extractor relies on correct part-of-speech tags. + +Rule-based extraction: Our base extractor draws on the rule-based extraction process of TJ-Batch (Nagpal et al., 2017). It consists of 2 parts - regular expression (regex) rule matching and gazetteer matching (person name dictionary). For the regex rule matching, we manually created 15 rules, including common titles for women (e.g. 'miss') and patterns like 'my name is + NNP'. For the gazetteer matching, we collected a list of common female names as the gazetteer. The rule-based extractors find exactly matched word tokens from the input text. + +Confidence estimation: We further measure the degree to which a pattern from the base extractors appears to be used consistently as a true person name throughout the training corpus. For a rule-based matching pattern $i$ where $i$ can be either a word in the dictionary or a regex-rule, we define its weight as: + +$$ +p _ {i} = \frac {c p f (i) + 1}{c t f (i) + 2} +$$ + +where $cpf(i)$ denotes the number of times that a word is correctly predicted by the pattern $i$ , and $ctf(i)$ is the number of occurrence of the pattern $i$ in the entire training corpus. Here, we are using the Laplace smoothing to account for unseen patterns. + +These patterns' weights are used to assign a confidence to extracted words. More specifically, each extracted word $j$ will have two associated weights: $p_j^n$ from the pattern it is matched to with + +gazetteer/dictionary extractor and $p_j^r$ from the pattern it is matched to with regex-rule extractor (zero if not matched in both cases). The arithmetic mean of these two weights is considered as the total confidence of the base module on this word being a name, i.e. $p_j^b = 1/2(p_j^n + p_j^r)$ . + +The simple rule-based strategy, although effective, often wrongly tags certain ambiguous words as names (e.g. hazel, penny). + +Disambiguation layer: The disambiguation layer helps to distinguish if a word extracted by the rule-based extractors is in fact a proper person name in its context. For this, we exploit masked word prediction capabilities resulting from a standard training procedure for language models such as BERT (Devlin et al., 2018). In this procedure, individual words are masked, and the model learns to predict them. Although this is typically done for training a language model on a large unlabeled corpus, we use it differently, for disambiguation. + +Specifically, we use RoBERTa (Liu et al., 2019), a variant of BERT with improved pre-training, finetuned for the task of NER on a dataset consisting of collected escort ads (please see Section 5 for details). We call this model HT-bert. + +After training, we can mask a word and get a vector of word probabilities where the highest probabilities suggest words that could reasonably replace the masked word. Therefore, if we mask a potential name, we can examine if the probable replacements are words that we are confident are names (suggesting the masked word is also a name) or that we are confident are not names (suggesting the masked work might not be a name)2. + +Calibrating the confidence estimation: Next, we re-estimate the confidence of an extracted word being a proper person name given its context based on the weight returned by the disambiguation layer, as shown in Algorithm 1. For an extracted word $j$ , we calculate the weight for the disambiguation step $p_j^d$ , by measuring the proportion of the predicted words in the context that are known names in our dictionary. Given the $p_j^d$ from the disambiguation step and $p_j^b$ from the base extractor, we recalibrate our confidence in $j$ being a name again as the mean of the two, i.e. $w_j = 1/2(p_j^b + p_j^d)$ . Further, we set $p_j^d = -1$ if the masked word appears in the predicted words list, resulting in a final $w_j$ smaller than or equal to zero. Since it is highly unlikely + +Input: a word $j$ and its context + +Require: fill_mask function + +Require: $k$ , the number of words to predict + +Require: $ND$ , a dictionary of names predictions = fill_mask(context of $j$ ); counter = 0; + +for each word $w$ in predictions do + +if $w$ is in ND then counter++; end + +end + +$p_j^d = \text{count} / k$ ; + +for each word $w$ in predictions do + +if $w$ is equal to $j$ then $\begin{array}{l}p_j^d = -1\\ \mathrm{end} \end{array}$ + +end + +Return: $p_j^d$ + +Algorithm 1: Disambiguation based on a contextual language model's fill_mask function. + +for the language model to predict the exact person name based on the context. Finally, each word $j$ is accepted as a person name if $w_{j}$ is higher than a set threshold, which is a hyperparameter. + +Dictionary expansion: We design a dictionary expansion module to deal with out-of-dictionary(OOD) names. Using our confidence on how likely a word is a name, $w_{j}$ , we simply apply a different threshold/hyperparameter to add some of the more confident OOD names to our dictionary3; which we call HT_filter. We also consider combining this with two common dictionary expansion techniques: (i) W2V (Gentile et al., 2019) expands the dictionary by finding the neighbors of known dictionary names in the embedding space learned by a Word2Vec model, and (ii) PFIDF (Minkov et al., 2005) computes a Pf-Idf score that takes into consideration both the probability of a word being a name from a regex-rule extractor, and how common it is in the training corpus. + +# 5 Experiment Setting + +Evaluation metrics: We use two evaluation criteria to compare the performance of NEAT and all baseline models for person name extraction. + +Word level evaluation: Given a list of ads $A = \{A_{1}, A_{2}, \dots, A_{n}\}$ , for an ad $A_{i}$ , let $\hat{Y}_{A_{i}}$ represent the predicted set of person names and $Y_{A_{i}}$ represent + +the set of true person names. A word $w$ is defined as a True Positive (TP) instance if $w \in Y_{A_i} \cap \hat{Y}_{A_i}$ , a False Negative (FN) instance if $w \in Y_{A_i} \setminus \hat{Y}_{A_i}$ , and a False Positive (FP) instance if $w \in \hat{Y}_{A_i} \setminus Y_{A_i}$ . Here, we report precision, recall and F1-score of word-level classification as in general NER models. + +Ad-level evaluation: Since the proposed system is defined for a noisy text setting, we define an evaluation metric which measures the performance on a document level or an ad level. We use Intersection over Union (IoU) as the ratio of the number of common words and total number of words in the predicted set $\hat{Y}_A$ and ground truth set $Y_{A}$ . Before calculating IoU, we split each string in $\hat{Y}_{A_i}$ and $Y_{A_i}$ by space and compute IoU based on the individual words. + +$$ +I o U _ {A _ {i}} = \frac {Y _ {A _ {i}} \cap \hat {Y} _ {A _ {i}}}{Y _ {A _ {i}} \cup \hat {Y} _ {A _ {i}}} +$$ + +We define the prediction of an ad $A_{i}$ to be a TP if $I_oU_{A_i} \geq 0.5$ and a FP if $I_oU_{A_i} < 0.5$ . A prediction will be counted as a FN if $\hat{Y}_{A_i} = \emptyset$ and $Y_{A_i} \neq \emptyset$ and TN if $\hat{Y}_{A_i} = \emptyset$ and $Y_{A_i} = \emptyset$ . + +In addition to precision, recall, and F1-score, we also report F2-score for the ad-level evaluation. + +$$ +F 2 \text {s c o r e} = \frac {5 \times \text {p r e c i s i o n} \times \text {r e c a l l}}{4 \times \text {p r e c i s i o n} + \text {r e c a l l}} +$$ + +This assigns more importance to recall than F1. In trafficking detection applications, it is often important to extract all the names in the text correctly (have strong recall) as this serves as the basis for downstream tasks like detecting micro-clusters of related ads (Lee et al., 2021) or finding links between connected ads (Rabbany et al., 2018). + +While we acknowledge that span-level evaluation is considered standard for NER, we believe a token-level evaluation is better suited for our application. We discuss about this choice in Appendix F. + +Baselines: We compared NEAT variants with five types of baselines, ordered by their appearance in our result tables. + +General-purpose NER packages: + +- Stanza (Qi et al., 2020) +- Spacy + +BERT-based models fine-tuned for NER: + +- Transformer-bert (Devlin et al., 2018) - designed for general NER, trained on CoNLL2003. + +4https://spacy.io/usage/ + +linguistic-features#named-entities + +
HT1KHT2KCoNLLWNUT17
# of examples994197059985690
# of names913141856232142
# of unique names59063124041461
# of no name examples26788539324481
# of names per example0.920.720.940.37
# of unique OOD names24023621821182
# of unique in-dictionary names350395222279
# of non-unique in-dictionary names6331068583439
# of ads with more than one name1442221620575
dataset typedomain specificgeneric
labeling methodCrowd + ManualCrowd + ManualProvidedProvided
+ +Table 1: Dataset statistics for both domain specific and generic benchmarks. + +- Fine-tuned-bert - 'bert-base-uncased' model fine-tuned for NER. +- Whole-mask-bert - bert trained by masking of whole words instead of tokens, fine-tuned for NER. + +NER algorithms based on language models: + +- Flair (Akbik et al., 2018) - trained character language model that learns contextualized string embeddings tuned for NER. +- ELMo (Peters et al., 2018) - model that learns contextualized word representations tuned for NER. +- LUKE (Yamada et al., 2020) - transformer based model that learns contextualized embeddings, fine-tuned on TACRED dataset (Zhang et al., 2017). + +NER models for noisy text: + +- TwitterNER (Mishra and Diesner, 2016) – semi-supervised approach that combines text cluster information and word embeddings and uses a CRF for NER. +- TJBatch (Nagpal et al., 2017) - state-of-the-art rule-based named entity extractor in the human trafficking domain. + +RoBERTa with and without domain adaptation: + +- Fine-tuned-roberta (Liu et al., 2019) - RoBERTa language model with improved pretraining, fine-tuned for NER. +- HT-bert - RoBERTa model further trained on unsupervised masked word prediction with 1.1 million escort ads $^5$ , then fine-tuned for NER. + +NEAT variants: + +- NEAT-base - rule-based extractors only that returns all the matched words regardless of the confidence threshold. +- NEAT-fixed - NEAT model including disambiguation layer and confidence threshold. The + +dictionary used is fixed across all datasets. + +- NEAT-update - full NEAT model with augmented dictionary using true names from the training set. The weights of newly added words are computed by the same method used to compute $p_i$ . +- NEAT - full NEAT model with augmented dictionary using one pass of dictionary expansion module. + +Datasets: The performance of NEAT and all baseline models was evaluated on four datasets - two new escort ad datasets we curated ourselves and two general NER datasets common in the literature (CoNLL 2003 Sang and Meulder, 2003 and WNUT17 Derczynski et al., 2017). We split all datasets 80-20 train-test. For hyperparameter tuning, we split another $20\%$ from the train set for validation. The summary of the datasets can be found in Table 1. In particular, we have: + +- HT1K: 994 examples crawled from an escort advertisement website.5 Names were annotated by crowdsourcing through Amazon Mechanical Turk, plus a member of our team resolving conflicting cases. $75.6\%$ of the examples were labeled with the majority of crowd workers in agreement, $12.2\%$ were resolved manually, and the remaining $12.2\%$ were excluded from the test set. More details on the annotation process can be found in Appendix B. + +For training HT-bert, a separate batch of 1.1 million escort ads were also crawled from this source. + +- HT2K: 1970 examples crawled from a different escort advertisement website, with annotations similar to the HT1K dataset. In this case $88.7\%$ + +of the labels use the crowd worker majority, $6.8\%$ were resolved manually, and the last $4.5\%$ were excluded from the test set. + +- CoNLL2003: 6000 examples. The general dataset includes many types of entities; we evaluate both this general prediction (for models that are not designed specifically for names) and the names only (the B-PER and I-PER annotations). +- WNUT17: 5689 examples. We restrict evaluation to the names (B-PER and I-PER). + +# 6 Results and Discussion + +Name Extraction: We evaluate the performance of the baseline models and NEAT for name extraction from text and display the results in tables 2, 3 and 4. We see that NEAT gives the best overall F1 score performance in the word-level evaluation (Table 2) on both domain-specific datasets: HT1K and HT2K. In Table 3, we perform equally well in ad-level evaluation on HT1K and HT2K in both F1 and F2 metrics. + +It's worth mentioning that NEAT has better performance on HT2K than on HT1K. This outcome is not surprising because our weight assignments are trained with HT2K training set explicitly. Since advertisements from different websites have different language features and it is unrealistic for our tool to be retrained on every new website we crawl, it's important for our proposed system to do effective transfer learning. Results in Table 2 and Table 3 support that even though the assignments are trained on HT2K, NEAT still performs relatively well in F1 (and F2), outperforming all other models. + +Conversely, both NEAT and TJBatch perform worse on the non-HT datasets. This is likely because their rule-based components are specifically designed to capture patterns common in escort ads but less so in generic data. We found that using our regex-rule extractor alone, without the rest of our model, NEAT would only extract 3 words from all of CoNLL and 10 from all of WNUT17, confirming the rules do not fit these datasets. The dictionary component of our model also lacks many traditional male names and last names of all genders. + +We include an ablation study to review the effectiveness of modules. Results from NEAT-base and NEAT-fixed performs well on the domain datasets but poorly on the generic datasets due to the reason mentioned above. NEAT-fixed in general performs better than NEAT-base because of the additional disambiguation module. + +Finally, we see that HT-bert, as well as the other BERT-based models, gives mediocre performance in this domain. This shows that standard methods for domain adaptation of language models (i.e. unsupervised training on a domain-specific corpus, and supervised fine-tuning) are insufficient to produce optimal results. An approach that can leverage stronger domain adaptation, like ours, is needed. + +Parameter tuning: We investigate the consequence of adding weight components and experiment with different parameter combinations (of threshold and $k$ ) on the HT2K dataset. The threshold is the minimum score a word extracted by NEAT needs to have to be considered a candidate in the list of words predicted by HT-bert 'fill_mask'. The dataset is split into train, validation and test sets. $M_{base}$ represents the performance measures of the base extractors alone without weights. $M_{weighted}$ denotes the performance measures of the proposed weighted extractor. The results in Table 5 are relative changes in the metrics calculated as $(M_{weighted} - M_{base}) / M_{base}$ . The table demonstrates that adding weight components can effectively disambiguate the output words thereby increasing precision. The F1-score increase reaches its peak when the weights threshold is set to be 0.1. On the other hand, when the parameter $k$ of fill_mask equals 40, the relative metrics have the best overall scores. The results in the preceding section use this best parameter pair. + +Dictionary Expansion: We study the effect of dictionary expansion and experiment with different methods on the HT2K dataset as shown in Table 6. We first randomly remove half of the names in the dictionary and run the dictionary expansion using three methods: W2V, PFIDF, and NEAT. The threshold value is tuned on the validation set for each method (tuning results for W2V and PFIDF are shown in Appendix D). $M_{half\_dict}$ represents the performance measures of the dictionary extractor using only half of the original dictionary. $M_{expanded}$ denotes the performance measures of dictionary extractor after dictionary expansion. The results in Table 6 are relative metrics calculated by $(M_{expanded} - M_{half\_dict}) / M_{half\_dict}$ and 'count' indicates the number of new words added to the dictionary after expansion. The goal for dictionary expansion is to tackle the unseen word problem in a gazetteer based extractor and increase the recall rate. From the experiment results, recall is greatly + +
MethodHT1KHT2KCoNLL2003WNUT17
F1PrecRecF1PrecRecF1PrecRecF1PrecRec
Stanza.41±.01.40±.01.41±.01.38±.04.43±.04.35±.05.83±.01.83±.01.83±.02.64±.03.66±.03.62±.03
Spacy.22±.03.19±.03.27±.03.19±.02.18±.02.21±.03.74±.01.81±.01.69±.01.44±.01.46±.02.42±.01
Transformer-bert.20±.04.57±.11.12±.02.46±.06.63±.07.36±.04.84±.01.85±.01.83±.01.55±.01.67±.01.47±.02
Fine-tuned-bert.56±.02.69±.01.47±.02.60±.01.76±.03.49±.01.96±.01.98±.00.95±.01.78±.02.83±.01.73±.02
Whole-mask-bert.31±.01.45±.02.25±.01.41±.03.38±.04.56±.01.87±.01.86±.01.86±.00.42±.01.69±.00.30±.03
Flair.40±.04.65±.06.29±.03.37±.03.61±.03.27±.02.98±.00.99±.00.96±.01.62±.01.65±.02.59±.02
ELMO.49±.03.56±.06.43±.02.46±.05.59±.05.38±.04.97±.01.97±.01.98±.01.64±.02.67±.02.62±.03
Luke.50±.03.80±.03.36±.02.49±.02.73±.04.37±.01.28±.02.94±.01.16±.01.45±.01.55±.01.38±.02
TwitterNER.52±.04.81±.03.38±.04.47±.03.71±.06.35±.02.41±.01.90±.01.26±.01.57±.01.81±.01.44±.01
TJBatch.67±.02.64±.01.71±.04.64±.02.63±.03.65±.02.10±.00.40±.03.06±.00.18±.01.31±.01.13±.01
Fine-tuned-roberta.57±.02.69±.01.49±.03.59±.01.76±.04.59±.03.96±.01.98±.00.94±.01.78±.05.81±.03.72±.04
HT-bert.58±.02.71±.03.49±.02.60±.02.76±.04.50±.02.95±.01.96±.01.93±.01.73±.01.79±.04.67±.02
NEAT-base.74±.01.77±.02.72±.03.73±.02.69±.03.77±.03.17±.01.50±.02.10±.01.29±.01.51±.03.21±.01
NEAT-fixed.75±.01.81±.03.70±.03.79±.03.80±.03.77±.03.17±.01.50±.02.10±.01.26±.02.48±.03.18±.01
NEAT-update.76±.01.80±.02.73±.03.81±.02.79±.02.83±.03.69±.01.82±.01.59±.01.47±.01.55±.02.41±.02
NEAT.76±.01.81±.02.71±.03.80±.02.79±.03.79±.03.17±.01.50±.02.10±.01.27±.02.48±.03.19±.01
+ +Table 2: Word-level strict match results on 5-split test sets: F1 score, Precision, Recall. NEAT gives a significant improvement on HT domain datasets (HT1K and HT2K). + +
MethodHT1KHT2K
F1F2PrecRecF1F2PrecRec
Stanza.47±.01.47±.01.47±.02.48±.02.47±.05.44±.05.51±.05.43±.05
Spacy.30±.03.31±.04.25±.03.33±.04.26±.02.27±.02.24±.02.29±.02
Transformer-bert.22±.03.17±.04.52±.07.14±.02.56±.04.46±.05.63±.07.36±.04
Fine-tuned-bert.65±.01.64±.01.67±.03.63±.02.65±.02.58±.03.82±.01.54±.03
Whole-mask-bert.41±.02.39±.01.46±.03.38±.00.55±.02.64±.01.44±.00.79±.02
Flair.45±.03.35±.03.77±.07.31±.02.42±.02.33±.01.73±.04.29±.01
ELMO.56±.04.51±.03.67±.06.49±.02.55±.04.49±.03.67±.04.46±.04
Luke.58±.03.49±.03.83±.03.45±.04.54±.04.46±.03.76±.06.42±.03
TwitterNER.60±.04.52±.05.80±.03.48±.05.53±.03.45±.03.76±.06.41±.03
TJBatch.84±.02.87±.02.78±.03.89±.03.76±.03.77±.02.74±.03.78±.02
Fine-tuned-roberta.65±.01.64±.01.68±.01.64±.01.65±.03.57±.03.82±.03.53±.04
HT-bert.66±.01.64±.01.69±.03.64±.01.66±.02.59±.03.83±.03.55±.03
NEAT-base.87±.02.87±.02.86±.03.88±.02.82±.02.86±.01.76±.04.90±.02
NEAT-fixed.86±.02.85±.02.88±.03.85±.02.87±.03.89±.03.84±.04.90±.03
NEAT-update.87±.02.88±.01.86±.02.88±.02.88±.02.90±.02.85±.03.91±.02
NEAT.87±.01.88±.02.85±.03.89±.02.88±.02.90±.02.83±.04.93±.02
+ +Table 3: Ad-level match results: F2 score, Precision, Recall. As in the previous table, NEAT gives a significant improvement on HT domain datasets (HT1K and HT2K). + +increased as expected. It is also worth noticing the NEAT_filter method has a slight increase in precision after the expansion. This result shows that most of the expanded words from NEAT_filter are actual person names in their context. NEAT_filter also has the highest F1 increase among the three primary methods. However, PFIDF finds more words than NEAT_filter while having a comparable F1 increase. By combining both, we get the highest increase in F1 and recall. + +While this seems effective for improving this halved version of our dictionary, we found it did not significantly improve the performance of our overall model with the full dictionary as the result of NEAT suggests. We hypothesize this is + +because the full dictionary is already saturated for the domain specific datasets and hard to improve. Also, since regex-rule can only match a few instances in the generic corpus, the corresponding candidate pool for expanding the dictionary is limited. Nonetheless, these results show this procedure can be helpful as obscuration and adversarial strategies evolve and the dictionary needs improvement. + +An additional observation is that after we included all the true names from the training sets and rerun NEAT, the performance of NEAT-update shows significant performance increases in the generic datasets. This suggests that we can adapt our system to other topic specific corpus by choosing the appropriate dictionary. + +
MethodCoNLL2003WNUT17
F1F2PrecRecF1F2PrecRec
Stanza.84±.01.84±.01.83±.01.85±.01.66±.03.66±.02.66±.04.66±.02
Spacy.75±.01.74±.01.77±.02.74±.01.44±.02.44±.02.44±.02.44±.01
Transformer-bert.88±.01.84±.01.85±.01.83±.01.58±.01.55±.01.67±.01.47±.02
Fine-tuned-bert.97±.01.97±.01.97±.01.97±.01.79±.02.79±.03.79±.02.79±.04
Whole-mask-bert.83±.02.84±.01.85±.02.82±.03.49±.01.43±.00.63±.01.40±.02
Flair.98±.00.98±.01.99±.00.98±.01.62±.02.65±.02.59±.02.63±.05
ELMO.98±.00.98±.00.97±.00.98±.01.64±.02.65±.03.64±.02.65±.04
Luke.40±.03.32±.02.69±.04.29±.02.52±.01.53±.02.5±.01.54±.02
TwitterNER.55±.01.50±.01.64±.02.48±.02.67±.01.65±.01.71±.01.64±.02
TJBatch.14±.00.11±.00.24±.02.10±.00.19±.01.17±.01.21±.01.17±.01
Fine-tuned-roberta.97±.01.97±.01.97±.01.97±.01.77±.03.78±.04.77±.03.78±.04
HT-bert.95±.01.96±.01.95±.02.96±.01.74±.01.74±.01.75±.04.74±.03
NEAT-base.21±.01.19±.01.28±.01.18±.01.32±.02.28±.01.40±.03.26±.01
NEAT-fixed.21±.01.18±.02.28±.01.17±.02.28±.02.24±.02.36±.03.23±.02
NEAT-update.74±.02.77±.02.71±.02.78±.02.51±.01.54±.03.48±.01.55±.04
NEAT.21±.01.18±.01.28±.02.17±.01.29±.02.25±.02.37±.03.24±.02
+ +Table 4: Ad-level match results: F2 score, F1 score, Precision, Recall on CoNLL2003 and WNUT17. + +
Thresk
304050
F1PrecF1PrecF1Prec
0.08+4.0+11.1+4.4+12.0+4.4+12.0
0.09+4.3+17.2+4.3+17.3+4.3+16.6
0.10+4.8+20.1+4.8+20.1+4.8+20.1
0.11+4.1+21.6+4.1+21.6+4.1+21.6
0.12+3.7+22.4+3.8+22.5+3.8+22.4
0.13-0.7+26.1-0.3+25.1-0.3+25.1
+ +Table 5: Percentage change in word-level performance on HT2K test set using different parameters for the weighted extractor and disambiguation. + +
MethodF1PreReccount
W2V+1.9%-8.4%+10.3%52
PF-IDF+9.8%-1.2%+18.9%82
NEAT_filter+10.9%+2.8%+17.2%48
Combined+13.9%+0.1%+25.9%98
+ +Table 6: Percentage change in performance scores using different dictionary expansion methods on HT2K test set. + +# 7 Conclusions + +We presented NEAT, which addresses the problem of name extraction from noisy, adversarial escort advertisement text. NEAT consists of two main components - a rule-based extractor (combining a dictionary of names and regex matching) and a disambiguation layer. + +NEAT significantly improves on the previous state-of-the-art for this task, with around 19 percentage points at the word-level and 9 percentage points at the ad-level improvements in F1 score on two datasets. Both our method and the previous state-of-the-art outperform generic methods, highlighting the continued need for and benefit of domain-driven approaches. + +By modifying the dictionary and regex matching, our pipeline can be adapted to other domains and tasks to a greater extent than is possible with many generic models and methods. In future work, we plan to investigate this further, by examining other tasks (such as extracting locations as well as person names) and domains (such as more generic but still noisy, Twitter data). + +Reproducibility: Our code is made available online at https://github.com/tudou0002/NEAT. The domain related data used in this paper contains person identifying information and can be made available for research purposes only, based on a data-sharing agreement. Please reach out to the authors of the paper for getting access to this data. + +# Acknowledgements + +This research is partially funded by the Canada CIFAR AI Chairs Program. It is also partially supported by Samsung-Mila Research Grant on Entity Extraction from Noisy Adversarial Data. The third author receives funding from IVADO. + +# References + +Alan Akbik, Duncan Blythe, and Roland Vollgraf. 2018. Contextual string embeddings for sequence labeling. In Proceedings of the 27th international conference on computational linguistics, pages 1638-1649. +Mhd Wesam Al-Nabki, Eduardo Fidalgo, and Javier Velasco Mata. 2019. Darkner: A platform for named entity recognition in tor darknet. Jornadas Naciones de Investigación en Ciberseguidad (JNIC2019), 1:279-280. +Mhd Wesam Al-Nabki, Francisco Jaez-Martino, Roberto A Vasco-Carofilis, Eduardo Fidalgo, and Javier Velasco-Mata. 2020. Improving named entity recognition in tor darknet with local distance neighbor feature. arXiv preprint arXiv:2005.08746. +Baevski Alexei, Edunov Sergey, Liu Yinhan, Zettlemoyer Luke, and Auli Michael. 2019. Cloze-driven pretraining of self-attention 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). Association for Computational Linguistics, Hong Kong, China. +Nathanael Chambers, Timothy Forman, Catherine Griswold, Kevin Lu, Yogaish Khastgir, and Stephen Steckler. 2019. Character-based models for adversarial phone extraction: Preventing human sex trafficking. In Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019), pages 48-56, Hong Kong, China. Association for Computational Linguistics. +Leon Derczynski, Eric Nichols, Marieke van Erp, and Nut Limsopatham. 2017. Results of the wnut2017 shared task on novel and emerging entity recognition. In Proceedings of the 3rd Workshop on Noisy User-generated Text, pages 140-147. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805. +Artur Dubrawski, Kyle Miller, Matthew Barnes, Benedikt Boecking, and Emily Kennedy. 2015. Leveraging publicly available data to discern patterns of human-trafficking activity. Journal of Human Trafficking, 1(1):65-85. + +Tobias Ek, Camilla Kirkegaard, Håkan Jonsson, and Pierre Nugues. 2011. Named entity recognition for short text messages. Procedia-Social and Behavioral Sciences, 27:178-187. +A. L. Gentile, D. Gruhl, P. Ristoski, S. Welch, and Eswc th th International Semantic Web Conference. 2019. Explore and exploit. dictionary expansion with human-in-the-loop. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 11503 LNCS:131-145. +Archana Goyal, Vishal Gupta, and Manish Kumar. 2018. Recent named entity recognition and classification techniques: a systematic review. Computer Science Review, 29:21-43. +Hakan Inan, Khashayar Khosravi, and Richard Socher. 2017. Tying word vectors and word classifiers: A loss framework for language modeling. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. +Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomás 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, EACL 2017, Valencia, Spain, April 3-7, 2017, Volume 2: Short Papers, pages 427-431. Association for Computational Linguistics. +Mayank Kejriwal and Rahul Kapoor. 2019. Network-theoretic information extraction quality assessment in the human trafficking domain. Applied Network Science, 4(1):44. +Ankit Kumar, Piyush Makhija, and Anuj Gupta. 2020. Noisy text data: Achilles' heel of BERT. In Proceedings of the Sixth Workshop on Noisy User-generated Text, W-NUT@EMNLP 2020 Online, November 19, 2020, pages 16-21. Association for Computational Linguistics. +Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. In *NAACL HLT* 2016, The 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego California, USA, June 12-17, 2016, pages 260-270. The Association for Computational Linguistics. +Meng-Chieh Lee, Catalina Vajiac, Aayushi Kulshrestha, Sacha Levy, Namyong Park, Cara Jones, Reihaneh Rabbany, and Christos Faloutsos. 2021. Info-shield: Generalizable information-theoretic humantrafficking detection. In 2021 IEEE 37th International Conference on Data Engineering (ICDE), pages 1116-1127. IEEE. +Yoav Levine, Barak Lenz, Or Dagan, Ori Ram, Dan Padnos, Or Sharir, Shai Shalev-Shwartz, Amnon + +Shashua, and Yoav Shoham. 2020. Sensebert: Driving some sense into BERT. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 4656-4667. Association for Computational Linguistics. +Jing Li, Aixin Sun, Jianglei Han, and Chenliang Li. 2020. A survey on deep learning for named entity recognition. IEEE Transactions on Knowledge and Data Engineering. +Kun Liu, Yao Fu, Chuanqi Tan, Mosha Chen, Ningyu Zhang, Songfang Huang, and Sheng Gao. 2021. Noisy-labeled NER with confidence estimation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6-11, 2021, pages 3437-3445. Association for Computational Linguistics. +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. CoRR, abs/1907.11692. +Mukta Majumder, Utsav Barman, Rahul Prasad, Kumar Saurabh, and Sujan Kumar Saha. 2012. A novel technique for name identification from homeopathy diagnosis discussion forum. *Proceeding Technology*, 6:379-386. +Tomás Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013a. Efficient estimation of word representations in vector space. In 1st International Conference on Learning Representations, ICLR 2013, Scottsdale, Arizona, USA, May 2-4, 2013, Workshop Track Proceedings. +Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013b. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111-3119. +Einat Minkov, Richard C. Wang, and William W. Cohen. 2005. Extracting personal names from email: Applying named entity recognition to informal text. In Proceedings of Human Language Technology Conference and Conference on Empirical Methods in Natural Language Processing, pages 443-450, Vancouver, British Columbia, Canada. Association for Computational Linguistics. +Shubhanshu Mishra and Jana Diesner. 2016. Semi-supervised named entity recognition in noisy-text. In Proceedings of the 2nd Workshop on Noisy User-generated Text (WNUT), pages 203-212. +Chirag Nagpal, Kyle Miller, Benedikt Boecking, and Artur Dubrawski. 2017. An entity resolution approach to isolate instances of human trafficking online. In Proceedings of the 3rd Workshop on Noisy User-generated Text, NUT@EMNLP 2017, Copenhagen, + +Denmark, September 7, 2017, pages 77-84. Association for Computational Linguistics. +International Labour Office. 2017. Global estimates of modern slavery. +United Nations Office on Drugs and Crime. 2020. Global report on trafficking in persons. +Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. Glove: Global vectors for word representation. In Empirical Methods in Natural Language Processing (EMNLP), pages 1532-1543. +Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pages 2227-2237. Association for Computational Linguistics. +Ofir Press and Lior Wolf. 2017. Using the output embedding to improve language models. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics, EACL 2017, Valencia, Spain, April 3-7, 2017, Volume 2: Short Papers, pages 157-163. Association for Computational Linguistics. +Peng Qi, Yuhao Zhang, Yuhui Zhang, Jason Bolton, and Christopher D. Manning. 2020. Stanza: A Python natural language processing toolkit for many human languages. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations. +Reihaneh Rabbany, David Bayani, and Artur Dubrawski. 2018. Active search of connections for case building and combating human trafficking. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2120-2129. +Leanne Maree Rhodes and Leanne Maree Rhodes. 2016. Human trafficking as cybercrime. *Agora Int J Admn Sci*, 1(1):23-29. +Sujan Kumar Saha, Shashi Narayan, Sudeshna Sarkar, and Pabitra Mitra. 2010. A composite kernel for named entity recognition. Pattern Recognition Letters, 31(12):1591-1597. +Sujan Kumar Saha, Sudeshna Sarkar, and Pabitra Mitra. 2009. Feature selection techniques for maximum entropy based biomedical named entity recognition. Journal of biomedical informatics, 42(5):905-911. +C Janarish Saju and AS Shaja. 2017. A survey on efficient extraction of named entities from new domains using big data analytics. In 2017 Second International Conference on Recent Trends and Challenges in Computational Models (ICRTCCM), pages 170-175. IEEE. + +Erik F. Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the conll-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning, CoNLL 2003, Held in cooperation with HLT-NAACL 2003, Edmonton, Canada, May 31 - June 1, 2003, pages 142-147. ACL. +Edmund Tong, Amir Zadeh, Cara Jones, and Louis-Philippe Morency. 2017. Combating human trafficking with multimodal deep models. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1547-1556. +Yaqiang Wang, Zhonghua Yu, Li Chen, Yunhui Chen, Yiguang Liu, Xiaoguang Hu, and Yongguang Jiang. 2014. Supervised methods for symptom name recognition in free-text clinical records of traditional Chinese medicine: an empirical study. Journal of biomedical informatics, 47:91-104. +Vikas Yadav and Steven Bethard. 2019. A survey on recent advances in named entity recognition from deep learning models. CoRR, abs/1910.11470. +Ikuya Yamada, Akari Asai, Hiroyuki Shindo, Hideaki Takeda, and Yuji Matsumoto. 2020. LUKE: deep contextualized entity representations with entity-aware self-attention. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 6442-6454. Association for Computational Linguistics. +Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D Manning. 2017. Position-aware attention and supervised data improve slot filling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 35-45. + +# A Appendix: Terminology + +Here we define key terminology used in the scope of this work and briefly discuss some of its properties. + +- Advertisement. In the scope of this paper, an online advertisement is defined as a notice or announcement in a public website promoting a sexual service. + +Unstructured Text. The sentences in online escort ads are usually short and segmented using white spaces or special characters, making it harder to split the sentences correctly. Also, since online advertisement has a relatively free choice in syntax, many person names appear in the text without a proper context. Since we cannot accurately predict the next word based on the context, a simple language model cannot play to its strength in these scenarios. In the second example in Figure + +1 the names 'Rose', 'Tiffany' and 'Camilla' are not particularly in context. + +Ambiguity. Another significant challenge is the ambiguity in the text. Person names can be very similar to some of the location names ('Jane' in 1). Additionally, certain names may also be adjectives (Penny, Hazel), thus confusing dictionary and rule-based extractors. Removing these ambiguous words from the dictionary can partially solve this, but then we face a decrease in the recall rate. + +- Person Name. A Person Name that appears in an advertisement is usually associated with other pronouns or adjectives. We declare a word as a person name if it is both a person name in a regular context and a word that refers to the person mentioned in the advertisement. Some names may also have varying spellings or be misspelled. + +# B Appendix: Annotated Process + +As noted in the main paper, to get the base for HT1K, we randomly selected 1000 examples from a large dataset of escort advertisements crawled from a single website. We followed the same procedure for HT2K, but with 2000 examples and from another website. We then crowdsourced annotations with Amazon Mechanical Turk. Examples were preprocessed to remove special characters, such as emoji, which could not be input into Mechanical Turk. Each example was annotated by 3 different workers using IE-Turk,[6] a package that gives workers an interface where they can click on or highlight named entities to mark them. Workers were required to be Mechanical Turk Masters (a designation Amazon awards for consistent quality) and to have at least an $85\%$ approval rate on all tasks. Amazon also requires workers to have Adult Content Qualification for a task like this with sensitive content. Workers were paid $0.03 per example, which lead to fast completion. + +The short-form instructions were "Select (or click) all person names in the text." The long-form instructions were: + +Select all words in the text that name a person, including repeats. Some names may contain spaces, other characters, or have other issues with the writing. Please ignore those issues and + +select the name anyways. For example, if the text contains "Alex ander" or "Alex@nder" or "HiImAlexander" or "Alexander@email.com," please select all of them. In the latter two cases, it will only let you select the entire "word," but that is fine. Pronouns like she/her/he/his do not count as names. Not all text will contain names; if there is no name, please check the "There is no person name" box and continue. + +Your annotations will be used for research to help fight human trafficking. + +IE-Turk does not differentiate between two successive names and a first name plus last name. Therefore, similar to other NER datasets like CoNLL and WNUT17, our labels are individual words. + +The annotator agreement is given in Table 7. There are four cases. When none of the annotators agree, we take one randomly for training examples, and do not use them for evaluation. When two of the annotators find the same names, or all three annotators agree, we follow the standard procedure of taking the majority vote. + +The most complex case is when two of the annotators agree on an empty set (i.e. find no names) but the third does find one or more names. The conventional approach might be to still take the majority vote, but we observed many valid names among the minority annotation. Therefore, one of our team members manually resolved the labels for these cases to produce a more accurate result. Based on these stronger labels, these cases are likely to contain a name: $82.6\%$ of such cases in HT1K, and $56.1\%$ in HT2K, contained at least one name. This suggests that if additional annotation is not possible, it will be optimal to use the label from the single annotator who found one or more names, rather than the majority who found no names. However, for best quality, it is necessary to either drop or re- annotate these cases, as we did for these datasets. + +A small number of examples which produced errors or ambiguity during the annotation or its post-processing were removed, leaving 994 and 1970 examples in HT1K and HT2K respectively. + +The "Two (non-empty)" and "All" categories, which reflect the strongest agreement from the crowd workers, comprise most of the examples – over $75\%$ in HT1K and over $88\%$ in HT2K. Thus, + +
Workers in AgreementHT1KHT2K
None121 (12.2%)88 (4.5%)
Two (empty)121 (12.2%)134 (7.0%)
Two (non-empty)302 (30.4%)399 (20.3%)
All450 (45.2%)1349 (68.5%)
+ +Table 7: Number of examples grouped by worker agreement. Two or more workers agree on the majority of examples. + +this crowdsourcing is effective in producing accurate labeled examples for this domain. In combination with our manual resolutions for the "Two (empty)" category, we obtain accurate labels for over $85\%$ and $95\%$ of the original data. + +# C Appendix: Disambiguation with Masked Word Prediction + +We exploit masked word prediction capabilities resulting from a standard training procedure for language models such as BERT (Devlin et al., 2018). In this procedure, individual words are masked, and the model learns to predict them. This is typically done using weight tying (Levine et al., 2020; Inan et al., 2017; Press and Wolf, 2017). First, one-hot vectors representing each token, including the special mask token, are converted to input embedding vectors through multiplication by a matrix $W$ . After adding a positional encoding, these embeddings are passed through the core transformer part of the model. This produces output embeddings for each token. In weight tying, the output embedding of the mask token is then decoded to word predictions using $W^T$ , the transpose of the matrix that encodes the inputs. Finally, after applying a softmax, the predictions are trained with a cross-entropy loss to approach the one-hot coding of the real token that was masked. + +Typically, this procedure provides an effective way of training a language model on a large unlabeled corpus. We use it differently, for disambiguation. For each word extracted by the rule-extractor as a potential name, we mask it in its sentence and use HT-bert 'fill_mask' to obtain a confidence score for that word being a valid person name. + +# D Appendix: Parameter Tuning for other Dictionary Expansion Methods + +Table 8 shows the parameter tuning for dictionary expansion using Word2Vec, Table 9 shows results for different thresholds using PF-IDF and Table 10 shows results with different thresholds on weights + +
Thres Top_k258
5+1.0%-3.0%+7.0%
10-10.8%-3.1%+4.3%
15-14.9%+0.1%+6.1%
+ +Table 8: Parameter tuning for W2V. The best/ bold setting is used for Table 6. Change in F1-score using different parameters for the Word2Vec method. + +
ThresholdF1PrecisionRecall
0.1+13.8%-0.6%+26.0%
0.3+3.1%-3.2%+8.0%
0.5+1.6%-1.7%+4.0%
+ +in NEAT. + +# E Appendix: Baseline models + +# General-purpose NER packages: + +- Stanza (Qi et al., 2020) is a collection of accurate and efficient tools for the linguistic analysis developed by Stanford NLP group. The named entity recognition (NER) module in Stanza recognizes mention spans of a particular entity type in the input sentence. +- Spacy is an open-source python-based software library for NLP tasks including NER. + +# BERT-based models fine-tuned for NER: + +- Transformer-bert (Devlin et al., 2018) uses the BERT model from the NER pipeline as implemented by Huggingface +- Fine-tuned-bert (Devlin et al., 2018) is a 'bert-base-uncased' model that has been fine-tuned for NER using a combination of CoNLL2003 and names extracted from escort advertisements. +- Whole-mask-bert (Devlin et al., 2018) uses a BERT model that has been trained by masking + +Table 9: Parameter tuning for PF-IDF. The best/ bold setting is used for Table 6. The table shows percentage change in metrics using different threshold for Pfidf. + +
ThresholdF1PrecisionRecall
0.10+10.1%-3.7%+21.9%
0.12+11.2%+2.5%+28.0%
0.14+9.8%+1.8%+16.0%
+ +Table 10: Parameter tuning for dictionary expansion using NEAT. The overall best/bold setting is used for Table 6. Change in metrics using different threshold on weights in NEAT. + +entire words at random instead of tokens. We use the 'bert-large-cased-whole-word-masking' model and fine-tune it for the task of NER using the same combined dataset as the other baselines. + +# NER algorithms based on language models: + +- ELMo (Peters et al., 2018) is a context word representation based on deep bidirectional LSTM used for the downstream task of NER. +LUKE (Yamada et al., 2020) is a transformer based model that treats words and entities as independent tokens and learns contextualized representations. The LUKE model fine-tuned on TACRED dataset (Zhang et al., 2017) as implemented in the Hugging Face library is used for the experiments. +- Flair (Akbik et al., 2018) uses the internal states of a trained character language model to produce a novel type of word embedding known as as contextual string embeddings which is used for the downstream task of NER. + +# NER models for noisy text: + +- TwitterNER (Mishra and Diesner, 2016) designed for noisy and unstructured text such as tweets uses a semi-supervised approach which includes text cluster information along with word embeddings and employs random feature dropout and a CRF for entity recognition. +- TJBatch (Nagpal et al., 2017) The state-of-the-art named entity extractor in the human trafficking domain. It is able to extract more than 20 kinds of entity types using the rule-based strategy. We only consider the person name entity type in our experiment. + +# RoBERTa with and without domain adaptation: + +- Roberta-base (Liu et al., 2019) is a language model based on BERT, with modifications to the pre-training to improve efficiency and performance. We fine-tune it for NER in the same way as fine-tuned-bert. +- HT-bert adapts Roberta-base to the HT domain by training unsupervised masked word prediction on 1.1 million ListCrawler escort ads. It is then fine-tuned for name extraction, again as with fine-tuned-bert. + +As a pre-processing step, all emojis and non-ASCII characters are removed from the advertisement texts before passing them through the NER models. Each dataset was split into 80-20 train-test split and the train set was used to fine-tune the BERT-based models. We do-not distinguish + +between 'B-PER' and 'I-PER' in the labels (i.e if they appear in the beginning or in the middle of the text). For evaluation, both the predicted and ground truth names are converted to lower case. + +# F Appendix: Token-level Evaluation Metric + +Due to the informal language nature of the escort advertisements, most, if not all, of the person name in the descriptions are first name or nickname basis. In these cases, the token-level evaluation and the span-level evaluation will end up having the same performance. For example, "Lia available now" with "Lia" predicted as PER has the same precision and recall score irrespective of whether the true label sequence is [B-PER, O, O] or [PER, O, O]. + +Moreover, the token-level evaluation can be considered as a partial span-level evaluation where the constraints on the entity boundaries are loosened. We still gain valid information about a person being advertised even if the prediction model gets the entity boundary wrong. For example, using our token-level evaluation, "Jane Smith left" with a true label [B-PER, I-PER, O] will have the same performance metric whether the predicted sequence is [B-PER, O, O] or [O, B-PER, O]. + +Lastly, in the context of name extraction from escort ads, it is common to see the same name appearing multiple times consecutively in a single ad. This could be done in order to make a better impression of the persons being advertised. The span-level sequence evaluation may count every correctly predicted occurrence of a name, regardless of whether it has already been extracted. This may give extra false credibility to the extraction algorithm since what we really want to measure is the individual being advertised. \ No newline at end of file diff --git a/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/images.zip b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..883973eeef9b20fa890657f1155712c153641012 --- /dev/null +++ b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c3144684a82bfed5b5cebb3d1f87163e2e25914a7166334f0d73a2a4fc6b6a2 +size 710692 diff --git a/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/layout.json b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cf4001fe9dda20fe4a61ed87ea9daadfa14b98f9 --- /dev/null +++ b/extractingpersonnamesfromusergeneratedtextnamedentityrecognitionforcombatinghumantrafficking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:348285a5193ef4955def307f5ecf2432d903ae83fadfb645ba8dcb545c91d8d8 +size 515735 diff --git a/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_content_list.json b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e75fd88b1d9bf1c81a381670911cfd1d6cc094d0 --- /dev/null +++ b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5098c651d9e6a66880c4958d05e5c6b117ff09c4a7561b5b390af2199eddbdee +size 94736 diff --git a/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_model.json b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2edf1c1e9c74060a9901b2889b32d6fd545752d6 --- /dev/null +++ b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c29e97fafb1c999ebad4be87a2a74ada90a79d63b5c96be9882157d24eb834c9 +size 116561 diff --git a/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_origin.pdf b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..253d2809bf3c81ba7dfbc08201ba2801064abb4b --- /dev/null +++ b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/3bec5dbc-86d0-4f28-b618-47b2bca324d6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d60aec7cda87a97d0d8142495f1e5c348c28dbb6ff900d79a5e4b5fbf884e4e +size 707971 diff --git a/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/full.md b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/full.md new file mode 100644 index 0000000000000000000000000000000000000000..bc84953b0d1042e1ad26100a52bb7dd051e3eda4 --- /dev/null +++ b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/full.md @@ -0,0 +1,425 @@ +# Extract-Select: A Span Selection Framework for Nested Named Entity Recognition with Generative Adversarial Training + +Peixin Huang $^{1}$ , Xiang Zhao $^{1,2}$ , Minghao Hu $^{3*}$ , Yang Fang $^{1}$ , Xinyi Li $^{1}$ and Weidong Xiao $^{1,2}$ + +$^{1}$ National University of Defense Technology, Changsha, China +$^{2}$ Collaborative Innovation Center of Geospatial Technology, Wuhan, China +3 Information Research Center of Military Science, Beijing, China {huangpeixin15, xiangzhao, fangyang12, wdxiao}@nudt.edu.cn huminghao16@gmail.com + +# Abstract + +Nested named entity recognition (Nested NER) aims to identify named entities which may overlap. Span-based approaches regard nested NER as a two-stage task—span extraction and classification, thus having the innate ability to handle this task. However, they face the problems of error propagation, ignorance of span boundary, difficulty in long entity recognition and requirement on large-scale annotated data. In this paper, we propose Extract-Select, a span selection framework for nested NER, to tackle these problems. Firstly, we introduce a span selection framework in which nested entities with different entity categories would be separately extracted by the extractor, thus naturally avoiding error propagation in prior two-stage approaches. In the inference phase, the trained extractor selects final results specific to the given entity category. Secondly, we propose a hybrid selection strategy in the extractor, which not only makes full use of both span boundary and span content, but also improves the ability of long entity recognition. Thirdly, we design a discriminator to evaluate the extraction result, and train both extractor and discriminator with generative adversarial training (GAT). The use of GAT greatly alleviates the stress on the dataset size. Experimental results on four benchmark datasets demonstrate that Extract-Select outperforms competitive nested NER models, obtaining state-of-the-art results. The proposed model also performs well with less labeled data, proving the effectiveness of GAT. + +# 1 Introduction + +Named entity recognition (NER) aims at detecting the spans and semantic categories of entities from the text. Previous studies usually treat NER as a sequential labeling problem (Ma and Hovy, 2016; Chiu and Nichols, 2016). These studies restrict each token belonging to at most one entity mention, and hence it is unable to handle nested NER (Huang et al., 2015), where one token may + +![](images/7994c81d99ac3049df9a00a06d3eeff786d2675e3229b21569cf0c0335e146c3.jpg) +Figure 1: Examples for nested entities from ACE2005 and GENIA corpora. + +belong to multiple mentions. For example in Figure 1, a LOC (i.e., Location) entity “western Canadian” is nested in another GPE (i.e., Geo-Political Entity) entity “the western Canadian province of British Columbia”. + +Some studies seek to reconcile sequential labeling with nested NER (Alex et al., 2007; Ju et al., 2018). However, sequential labeling is naturally unsuitable for assigning multiple labels to a single token. Considering that, some studies turn to adopt the two-stage framework, including transition-based approaches (Wang et al., 2018a; Lin et al., 2019), hypergraph-based approaches (Wang and Lu, 2018; Katiyar and Cardie, 2018; Luo and Zhao, 2020) and span-based approaches (Sohrab and Miwa, 2018; Shen et al., 2021; Zhong and Chen, 2021). Among them, span-based approaches handle nested NER by extracting possible spans and classifying their categories. Although these approaches have the innate ability to cope with this task, they have the following problems: (1) Span-based approaches follow the two-stage framework, which inevitably has the problem of error propagation; (2) These approaches usually rely on span content for classification. However, span boundary information is not fully utilized, which is important for precise entity span extraction; (3) It is difficult for span-based approaches to recognize long entities because the span length in the span extraction phase is limited; (4) These approaches usually rely heavily on large size of training data for obtaining competitive results. + +In this paper, we propose a novel nested NER approach, named Extract-Select, which is able to cope with the above shortcomings. Specifically, the proposed Extract-Select works as follows. Firstly, an extractor is proposed to extract all possible entity spans specific to a particular typed entity marker, with a novel hybrid selection strategy. Then, a discriminator is introduced to evaluate and score entity span candidates predicted by the extractor. The extractor and the discriminator are iteratively trained with generative adversarial training (GAT). In the inference phase, the iteratively trained extractor selects final entity spans of the given entity marker from the contexts. + +Extract-Select solves the above shortcomings from the following three aspects: + +- To address Problem (1), we adopt a span selection framework in Extract-Select, which aims to separately train the extractor for each entity category. Motivated by Zhong and Chen (2021), we design entity markers that encodes category knowledge and use it to clarify the extractor what to extract. For example in Figure 1, the nested entities "PEBP2" (type PROTEIN) and "PEBP2 site" (type DNA) would be separately extracted. As two nested entities with different categories are separately selected by the extractor in one step, the problems of error propagation in two-stage approaches can be naturally solved. +- To solve Problems (2) and (3), we design a hybrid selection strategy in our extractor. This strategy makes full use of boundary information by detecting the start and end positions of entity span, followed with span content matching. Then, the span boundary as well as content information are fully used in the training of the extractor. As this strategy detects entity spans with boundary extraction, it does not require the setting of maximum span length, thus overcoming the difficulty in long entity recognition. +- To solve Problem (4), we design a discriminator to evaluate the extractor and train the extractor and discriminator with GAT. Through min-max training, the extractor can additionally learn from the discriminator to get higher scores, meanwhile greatly reducing the demand on training data size. What is more, the well designed entity markers provide informative prior knowledge for the extractor, which also contributes to better performance with less labeled data. + +To evaluate our Extract-Select, we conduct experiments on four standard nested NER benchmarks, including ACE04, ACE05, KBP17 and + +GENIA datasets. Experimental results show that our model can effectively detect nested entities and achieve state-of-the-art results on the above four datasets. The ablation study on entity marker, GAT and hybrid selection strategy reveals that these components are indispensable and all of them contribute to our model. Moreover, our model only requires half amount of labeled data to achieve the same performance as baselines, inducting the effectiveness of our approach with less training data. + +# 2 Related Work + +Sequential labeling-based approaches solve the nested NER by designing suitable labeling schema. Shibuya and Hovy (2020) provide a second-best path decoding method to iteratively find nested entities. Straková et al. (2019) propose a linearized encoding scheme to model multiple named entity labels. Wang et al. (2020) design a pyramid framework to identify nested entities. Sequential labeling approaches is naturally unsuitable for nested NER. + +Transition-based approaches model nested structure through state transition and construct nested entities through actions. Wang et al. (2018a) introduce a scalable transition-based model. Lin et al. (2019) propose an AnchorRegion architecture which models the head-driven phrase structures. However, these approaches rely heavily on hand-crafted features. + +Hypergraph-based approaches construct hypergraphs by the structure of nested NER and decode results on hypergraphs. Muis and Lu (2017) introduce a mention hypergraph for nested NER. Wang and Lu (2018) propose a hypergraph representation, which is free from structural ambiguity. Luo and Zhao (2020) propose to capture bidirectional information interactions between hypergraph layers. However, these hypergraphs should be well designed to prevent ambiguous structure. + +Span-based approaches extract entity spans and then classify their categories. Luan et al. (2019) select the most confident entity spans for classification. Fisher and Vlachos (2019) propose to merge entities and tokens into entities, and then assign labels. Shen et al. (2021) regards this task as an object detection task, locating and then labeling spans. Nevertheless, these two-stage approaches have the problem of ignorance of span boundary, difficulty in long entity recognition and error propagation. + +Li et al. (2020b) formalizes NER as a machine reading comprehension (MRC) task, which uses + +![](images/19d12f68f1d75abd02367fcfa5271b624c2c2b32f6633fdb67739601959e0c4a.jpg) +Figure 2: Overview of Extract-Select. It follows a span selection framework and contains an extractor which adopts a hybrid selection strategy to extract entity span candidates and a discriminator which aims to score the extractor. The extractor and discriminator are trained with multi-task learning including span boundary extraction and generative adversarial training. + +BERT as backbone and extracts spans of given queries. However, this work relies heavily on training data size. Besides, it extracts entity spans based on boundary information but ignores content information. In contrast to their work, we use GAT to iteratively train extractor to get better results, and adopt hybrid selection strategy to make full use of both boundary and content information. + +Generative adversarial training (GAT) gives a way to learn deep representations without extensively labeled data. It is proposed by Goodfellow et al. (2014) and is characterized by training a generator and a discriminator in competition with each other. GAT has been applied in different NLP subtasks, including dialogue generation (Li et al., 2017) and relation extraction (Qin et al., 2018). In these studies, GAT proves to be effective in reducing the usage of training data. Motivated by these work, we propose to apply GAT in NER task to reduce the demand on labeled data. + +# 3 Problem Definition + +The input of the span selection framework is a sequence $X = \{x_{1}, x_{2}, \ldots, x_{|X|}\}$ , where $|X|$ denotes the length of the sequence. The possible entity span $x_{s,e} = \{x_{s}, x_{s+1}, \ldots, x_{e-1}, x_{e}\}$ is a continuous sub-string of $X$ satisfying $s \leq e$ . Let $Y$ denote the predefined list of all entity categories and $y^{*}$ be the entity marker specific to type $y \in Y$ (e.g., "LOC" has an entity marker "location"). The aim of span selection framework is to find all entities in $X$ for each category $y$ . + +# 4 Extract-Select: Nested NER with GAT + +# 4.1 Overview + +In this section, we introduce Extract-Select in detail. As shown in Figure 2, Extract-Select consists of two main components: an extractor and a discriminator. In particular, given the input sequence $X$ and the entity marker $y^{*}$ , the extractor adopts a hybrid selection strategy to extract the entity span candidate set $C$ and calculates its representation $p_{C}$ , i.e., $(C, r_{C}) = f_{E}(y^{*}, X)$ . Afterwards, the discriminator is fed with $r_{C}$ to evaluate the correctness of $C$ , i.e., $score = f_{D}(y^{*}, X, r_{C})$ . After iterative training of both extractor and discriminator, the extractor selects the final result (a set of entity spans), i.e., final result $= f_{E_{final}}(y^{*}, X)$ . + +# 4.2 Extractor + +Given the entity type $y$ and the input sequence $X = \{x_{j}\}_{j = 1}^{|X|}$ , the extractor aims to extract the entity span candidate set $C = \{C_1,C_2,\dots C_i\}$ specific to $y^{*}$ from $X$ . Then, the extractor needs to compute a continuous latent variable $p_C$ to represent $C$ . + +1) Sequence representation: We first represent all tokens $\{x_{i}\}_{i = 1}^{|X|}$ in the input sentence $X$ as a sequence of embeddings $\{w_i\}_{i = 1}^{|X|}$ . Each embedding $w_{i}$ is the concatenation of character embedding, word embedding, contextualized word embedding and part-of-speech (POS) embedding. The character embedding is generated by a bi-directional + +LSTM (BiLSTM) module with the same setting as Ju et al. (2018). For the contextualized word embedding, we obtain the context-dependent embedding for a target token with one surrounding sentence on one side. Then, the concatenation is fed into another BiLSTM to obtain the final token representation: + +$$ +\left\{h _ {i} \right\} _ {i = 1} ^ {| X |} = \operatorname {B i L S T M} \left(\left\{w _ {i} \right\} _ {i = 1} ^ {| X |}\right), \tag {1} +$$ + +where $h_i$ is the hidden state. + +2) Entity marker representation: Entity category is an important prior knowledge as it makes the extractor know what to extract, and its effectiveness has been demonstrated in prior work (Li et al., 2020b). Besides, the usage of entity marker can avoid the error propagation issue in two-stage framework. Therefore, we propose to design an entity marker for each category, where the entity marker is its fine-grained explanation and would be used as the input of the extractor. We experiment on different types of entity marker and finally choose the combination of Keywords and Synonyms. Specifically, Keywords mean that entity markers are keywords describing entity type, e.g., the entity marker for type ORG is "organization", and Synonyms mean that entity markers are words or phrases which mean nearly the same as terms extracted from the Oxford Dictionary, e.g., the entity marker for type ORG is "institution body group company firm business corporation". + +We concatenate word embeddings of Keywords and Synonyms, and feed embeddings $\{w_{i}\}_{i = 1}^{|y^{*}|}$ into a BiLSTM to obtain $\{u_i\}_{i = 1}^{|y^*|} =$ Bi-LSTM $(\{w_{i}\}_{i = 1}^{|y^{*}|})$ , where $|y^{*}|$ is the length of entity marker. Then, we use self attention to integrate the entity marker information: + +$$ +\alpha_ {i} = \frac {\exp \left(W _ {a} u _ {i}\right)}{\sum_ {k} \exp \left(W _ {a} u _ {k}\right)}, \tag {2} +$$ + +$$ +m = \sum_ {i = 1} ^ {y ^ {*}} \alpha_ {i} u _ {i}, \tag {3} +$$ + +where $\alpha_{i}$ is the attention weight of $u_{i}$ and $W_{a} \in \mathbb{R}^{d}$ is a learned weight vector. + +3) Hybrid selection: Prior span-based approaches extract spans by predicting whether each token is within the entity span with n two-class classifier, which only considers the span content. These methods need to set maximum span length parameter to avoid high computational costs. As a result, it is hard for them to identify long entities. What is more, they ignore the span boundary which is also important for entity recognition. + +In view of this, we propose a hybrid selection strategy, which makes full use of both boundary + +and content of span. It first predicts the probability of tokens being the boundary of entity spans, and produce the entity span candidate set. Later, it uses the content of span candidates, i.e., calculates content representation of candidates, to enable the training of extractor and the golden entity spans could be selected eventually. + +Given the representations of sequence and entity marker, the extractor first predicts the probabilities of token $i$ being the boundary (i.e., start and end index) of entity spans: + +$$ +p _ {s} (i \mid y, X) = \frac {\exp \left(h _ {i} W _ {s} m\right)}{\sum_ {k} \exp \left(h _ {k} W _ {s} m\right)}, \tag {4} +$$ + +$$ +p _ {e} (i | y, X) = \frac {\exp (h _ {i} W _ {e} m)}{\sum_ {k} \exp (h _ {k} W _ {e} m)}, +$$ + +where $W_{s}, W_{e} \in \mathbb{R}^{d \times d}$ are learnable parameters. + +In the input sequence $X$ , there may be multiple entities of a particular category. This means that multiple start and end indexes could be predicted. To match them, we first get the indexes that might be the starting or ending positions: + +$$ +I _ {s} = \{i | \arg \max \left(p _ {s} (i \mid y, X)\right) = 1, i = 1,.., n \}, +$$ + +$$ +I _ {e} = \{j | \arg \max \left(p _ {e} (j \mid y, X)\right) = 1, j = 1,.., n \}. \tag {5} +$$ + +For any given start index $i_s \in I_s$ and end index $j_e \in I_e$ ( $i_s \leq j_e$ ), we calculate the probability of entity span candidate: + +$$ +p _ {s, e} \left(i _ {s}, j _ {e} \mid y, X\right) = \text {s i g m o i d} \left(W _ {C} \text {c o n c a t} \left(h _ {i _ {s}}, h _ {j _ {e}}\right)\right), \tag {6} +$$ + +where $W_{C}\in \mathbb{R}^{1\times 2d}$ is a learned parameter. The entity span candidate $C_i$ is added into the candidate set $C$ if its span probability $p_{s,e}$ is larger than a pre-defined threshold. + +Then the content of candidate set $C$ is utilized. We calculate $p_C(i|y,X)$ as the probability of the ith token appearing in $C$ , which can be considered as the probability of the ith token within the span candidates. Specifically, $p_C(i|y,X)$ can be calculated through $p_s$ and $p_e$ : + +$$ +p _ {C} (i | y, X) = \sum_ {s = 1} ^ {i} \sum_ {e = i} ^ {| X |} p _ {s} (s | y, X) p _ {e} (e | y, X), \tag {7} +$$ + +where $p_C(i|y, X)$ also means the frequency of the $i$ th token appearing in $C$ . In other words, the more frequent the $i$ th token appears in $C$ , the higher $p_C(i|y, X)$ would be. In this way, the content information $p_C$ can be used in candidate set scoring process to enable the training of extractor. + +Finally, with both the boundary and content information, the extractor could be well trained to select the final golden entity span. This strategy does not set the maximum span length. As a result, long entity span can also be recognized. + +# 4.3 Discriminator + +After the extractor has obtained the entity span candidate set $C$ , the discriminator aims to evaluate and score $C$ , so as to train the extractor with GAT. This process consists of two steps as follows. + +1) Candidate set representation: To represent the entity span candidate set $C$ , we propose to encode the information of both entity type $y$ and sequence $X$ into $p_C$ . Specifically, we build entity-aware sequence representation with MatchLSTM (Wang et al., 2018b), by matching the entity marker up with the sequence: + +$$ +\left\{r _ {i} \right\} _ {i = 1} ^ {| X |} = \operatorname {M a t c h - L S T M} \left(\left\{h _ {i} \right\} _ {i = 1} ^ {| X |}, \left\{u _ {i} \right\} _ {i = 1} ^ {\left| y ^ {*} \right|}\right). \tag {8} +$$ + +Then the representation of entity span candidate set $r_C$ is calculated with $r_i$ and the probability $p_C(i|y, X)$ through weighted sum: + +$$ +\begin{array}{l} \beta_ {i} = \frac {p _ {C} (i | y , X)}{\Sigma_ {k = 1} ^ {| X |} p _ {C} (k | y , X)}, \tag {9} \\ r _ {C} = \Sigma_ {k = 1} ^ {| X |} \beta_ {k} r _ {k}. \\ \end{array} +$$ + +2) Candidate set scoring: The score $f_{D}$ of entity span candidate set $C$ can be calculated: + +$$ +f _ {D} (C) = \operatorname {s i g m o i d} \left(W _ {D} r _ {C}\right), \tag {10} +$$ + +where $W_{D}\in \mathbb{R}^{d}$ is a learned weight vector and the score $f_{D}\in [0,1]$ would be used to iteratively train the extractor to get higher span candidate set score from the discriminator through min-max training in the GAT process. + +# 4.4 Multi-task Learning with GAT + +In the training process, we train the extractor by multi-task learning, and train the extractor and discriminator together with GAT. + +The first task is to train the extractor by minimizing the negative log probabilities of the true start and end indexes of the golden entity span: + +$$ +\ell_ {E} ^ {\text {b o u n d a r y}} = - \log p _ {s} (s | y, X) - \log p _ {e} (e | y, X), \tag {11} +$$ + +where $s$ and $e$ denote the start and end indexes of the golden entity in the sequence $X$ . + +The second is to train the extractor by minimizing the start-end index matching loss: + +$$ +\ell_ {E} ^ {\text {s p a n}} = - \log p _ {s, e}. \tag {12} +$$ + +The third is to train the extractor and discriminator together with GAT. We train the extractor to obtain a higher score from the discriminator: + +$$ +\ell_ {E} ^ {G A T} = \log \left(1 - f _ {D} (y, X, p _ {C})\right). \tag {13} +$$ + +Meanwhile, we train the discriminator to maximize $\log f_{D}(y,X,p_{C})$ and minimize $\log (1 - f_{D}(y,X,p_{C}))$ : + +$$ +\ell_ {D} ^ {G A T} = z \log f _ {D} (C) + (1 - z) \log (1 - f _ {D} (C)), \tag {14} +$$ + +where $z\in \{1,0\}$ denotes whether the golden entity appears in the entity span candidate set or not. + +The overall training objective $\ell_{E}$ of the extractor is defined as follows: + +$$ +\ell_ {E} = \gamma_ {1} \ell_ {E} ^ {\text {b o u n d a r y}} + \gamma_ {2} \ell_ {E} ^ {\text {s p a n}} + (1 - \gamma_ {1} - \gamma_ {2}) \ell_ {E} ^ {G A T}, \tag {15} +$$ + +where $\gamma_1, \gamma_2 \in [0,1]$ are learnable hyper-parameters to control the contributions towards the overall training objective. + +In each training iteration, we use the extractor to select the new entity span candidate set through Eq.(4)-(6). The new entity span candidate set would then be scored by the discriminator. Such training procedure will be conducted iteratively so that the extractor can select spans having high score from discriminator. In the inference phase, the trained extractor would first select the start and end indexes and then match the start indexes with end indexes, getting the final results. The pseudo-code of the training procedure is given in Appendix A. + +Our model differs from BERT-MRC in the following ways: (1) Different from BERT-MRC which uses bert-based machine reading comprehension model as the backbone, we design an Extract-Select model which iteratively trains the extractor to select the golden entity spans specific to the entity marker. (2) We propose a hybrid selection strategy for better entity span selection. This strategy makes full use of both boundary and content information of the span. However, BERT-MRC only conducts entity decoding based on the span boundary. (3) We propose to incorporate GAT in our model to train the extractor to learn additional information from the discriminator, meanwhile greatly reducing the demand on training data size. (4) We use easily-obtained entity markers to achieve competitive performance, avoiding complex query designing. + +# 5 Experimental Setup + +# 5.1 Benchmarks and Evaluations + +We evaluate Extract-Select on four NER benchmarks — ACE2004 $^{1}$ , ACE2005 $^{2}$ , GENIA $^{3}$ , and KBP2017 $^{4}$ . Please refer to Appendix B.1 for the statistics and the detailed processing of the datasets, and refer to Appendix B.2 for implementation details. + +$^{1}$ https://catalog.ldc.upenn.edu/LDC2005T09 +$^{2}$ https://catalog.ldc.upenn.edu/LDC2006T06 +3http://www.geniaproject.org/genia-corpus +4https://catalog.ldc.upenn.edu/LDC2017D55 + +
ModelACE2004ACE2005GENIAKBP2017
PRF1PRF1PRF1PRF1
Transition574.971.873.374.571.573.078.070.273.974.767.070.1
Seg-Graph78.072.475.176.872.374.577.073.375.179.266.572.3
Merge-Label---75.174.174.6------
ARN---76.273.674.975.873.974.877.771.874.6
Second-Path83.7381.9182.8182.9882.4282.7078.0776.4577.25---
Seq2seq6--84.3382.5884.2983.4279.9276.5578.20---
BiFlat-Graph---75.075.275.177.474.676.077.174.375.6
Pyramid86.0886.4886.2883.9585.3984.6679.4578.9479.19---
BERT-MRC85.0586.3285.9887.1686.5986.8885.1881.1283.7582.3377.6180.97
Locate-Label87.4487.3887.4186.0987.2786.6780.1980.8980.5485.4682.6784.05
Extract-Select88.2688.5388.3987.1588.3787.7683.6484.4184.0283.7685.8784.80
+ +Table 1: Results for nested NER tasks. Bold indicates the best scores + +As for the evaluation metrics, we use strict evaluation that an entity is considered correct when both span and category are correctly predicted. We use span-level micro-averaged Precision (P), Recall (R) and F1 scores (F1) for evaluation. + +# 5.2 Baselines + +We choose the following models as baselines. + +Sequential labeling-based models. Second-Path (Shibuya and Hovy, 2020) regards the tag sequence as a path and searches for results with the second-best path decoding. Seq2seq (Straková et al., 2019) views the nested NER as a sequence-to-sequence problem. Pyramid (Wang et al., 2020) is based on BERT and decodes nested mentions by its length in a bottom-up manner. + +Transition-based models. Transition (Wang et al., 2018a) constructs forests for nested mentions through an action sequence. ARN (Lin et al., 2019) builds the Anchor-Region networks by using the head-driven structures of nested entities. + +Hypergraph-based models. Seg-Graph (Wang and Lu, 2018) utilizes a segmental hypergraph representation for the modeling of nested mentions. BiFlat-Graph (Luo and Zhao, 2020) constructs a hypergraph module and uses the representation of it to improve inner entity predictions. + +Span-based models. Merge-Label (Fisher and Vlachos, 2019) first merges tokens and entities to form nested structures and then labels them. Locate-Label (Shen et al., 2021) is based on BERT and generates span proposals by filtering and doing regression on seed spans. BERT-MRC Li et al. (2020b) formulates NER as a MRC task. + +# 6 Results and Discussions + +# 6.1 Overall Evaluation + +Table 1 presents the performance of Extract-Select as well as the above baselines on four datasets. From the table, we observe that: (1) Extract-Select can effectively deal with nested NER, achieving the state-of-the-art performance. Specifically, + +Extract-Select gains at least $0.98\%$ , $0.88\%$ , $0.27\%$ , $0.75\%$ F1 scores improvements on ACE2004, ACE2005, GENIA and KBP2017, respectively. This verifies the effectiveness of our span selection architecture. (2) Extract-Select brings much higher recall value improvements than other methods, especially on KBP2017 and GENIA datasets. We notice that KBP2017 and GENIA contain much more entities than the other two datasets and the number of entities on test set of KBP2017 is over four times more than that of ACE2005. Extract-Select has significant advantages on such dataset, proving the effectiveness of GAT. (3) Compared with most of the baselines, Extract-Select can well balance precision and recall, maintaining precision value with high recall improvement. The reason may be that entity markers highlight the category information, clarifying which to extract. (4) With conventional word embeddings, Extract-Select method performs better that those BERT-based models (e.g., Locate-Label and Pyramid), which further proves the advantage of span selection framework. We also evaluate our model on two flat NER datasets, as shown in Appendix C. + +# 6.2 Ablation Study + +We then conduct ablation study to elucidate the effectiveness of main components of our Extract-Select method. Likewise, we only present the results on ACE2005. We compare Extract-Select with the following three internal baselines: + +w/o EntityMarker: To verify the effectiveness of entity marker, this variation removes entity marker representations and only uses the index (i.e., "one", "two", et al.) of entity category for span selection. + +w/o GAT: To evaluate the effectiveness of GAT, this variation only retains the extractor. Extractor + +
ModelACE2005
PRF1
w/o EntityMarker85.8286.0385.92
w/o GAT85.7585.1285.43
w/o HybridSelect84.9687.2186.07
Extract-Select87.1588.3787.76
+ +is trained by Eq.(11) and Eq.(12): + +$$ +\ell_ {E} = \lambda \ell_ {E} ^ {\text {b o u n d a r y}} + (1 - \lambda) \ell_ {E} ^ {\text {s p a n}}, \tag {16} +$$ + +where $\lambda \in [0,1]$ is a hyper-parameter that controls the weights of two tasks. + +w/o HybridSelect: To verify the effectiveness of hybrid selection strategy, this variation only considers the boundary information and leaves out the content. Specifically, we still calculate the probabilities of tokens being start and end indexes of entity spans, but use the boundaries of entity candidates to represent the candidate set. Thus, Eq.(9) can be rewritten as follows: $r_{C_j} = r_{j_s} + r_{j_e}$ , where $j_s$ and $j_e$ are the start and end indexes of the $j^{th}$ entity span candidate $C_j$ , obtained through Eq.(5). And $r_{j_{s(e)}}$ is obtained through Eq.(8). + +In the training process, the extractor is trained with the policy gradient method. Thus, the training objective of the extractor in Eq.(13) can be modified as follows: + +$$ +\begin{array}{l} \nabla \ell_ {E} ^ {G A T} \approx - \sum_ {j = 1} ^ {k} \left[ f _ {D} (y, X, C _ {j}) \nabla \left(\operatorname {l o g p} _ {s} \left(j _ {s} \mid y, X\right)\right) \right. \tag {17} \\ \left. + \log p _ {e} \left(j _ {e} | y, X\right)\right), \\ \end{array} +$$ + +Results are shown in Table 2. From the table, we find that: (1) Extract-Select outperforms three internal baselines on the test set of ACE2005. Compared with w/o GAT, the F1 scores of full model improve by up to $2.33\%$ , which means it is useful to introduce the discriminator to train the extractor through min-max training. (2) w/o HybridSelect suffers from much more precision decrease than recall compared to full model. The reason may be that the policy gradient adopted in w/o HybridSelect produces noise when sampling the span candidates, whereas ours can avoid such noise by training the extractor using backpropagation. Such intuition reveals the effectiveness of our hybrid selection strategy in enabling the extractor to be trained by back-propagation from the discriminator. (3) Experimental results also demonstrate that entity markers are effective. This allows the model to take advantage of the prior knowledge of categories, improving the F1 score by $1.84\%$ on ACE2005. (4) w/o Entity-Marker shows significant or comparable performance improvements compared to the baselines + +Table 2: Results of internal baselines on the test set of ACE2005. + +
SettingACE2005 (F1)
Keywords87.12
Synonyms87.34
Wikipedia86.71
w/o EntityMarker85.92
Extract-Select87.76
+ +Table 3: Results of the model with different entity markers on ACE2005 dataset. + +presented in Table 1. This validates the effectiveness of our span selection framework. + +# 6.3 Analysis of Entity Marker + +To explore the influence of using different types of entity marker in Extract-Select, we investigate the performance of our model with different entity marker settings. Three experimental settings are considered: Keywords, Synonyms, Wikipedia. Keywords means the entity marker is the keyword describing the category, whereas Synonyms represents entity markers as synonymous words of keywords that are extracted from the Oxford Dictionary. Wikipedia means entity markers are constructed using the Wikipedia definition. For example, the entity marker for type ORG is "an entity comprising multiple people, such as an institution or an association". Besides, we also include w/o EntityMarker, for which entity markers are replaced with the position index of the category. + +The results of our model with different input entity markers on ACE2005 are presented in Table 3. From the table, we find that our Extract-Select (with Keywords+Synonyms as entity marker) achieves the highest F1 scores. In all settings, w/o EntityMarker that do not contain any entity information underperforms the others, indicating that meaningful prior knowledge contributes to superior performance. We also observe that Wikipedia underperforms Keywords and Synonyms. The reason may be that descriptive words from Wikipedia may not precisely describe entity categories compared to other settings. + +# 6.4 Analysis of Training Data + +Since entity markers encode useful prior knowledge and the min-max training also learns from unlabeled data, we expect that the proposed model works better with less training data. We test our model, w/o EntityMarker and w/o GAT on randomly sub-sampled labeled data of ACE2005 training set. As shown in Figure 3, the performance of three models drops with the decline of training sample size. However, our full model only requires half amount of training data to achieve comparable performance with two internal base + +
Sentence 1The US Supreme Court will hear arguments from both sides on Friday and Florida's Leon County Circuit Court will consider the arguments on disputed state ballots on Saturday.
Gold LabelORG:{The US Supreme Court, both sides, Florida's Leon County Circuit Court};GPE:{Florida, Leon County, state}
Locate-LabelORG:{The US Supreme Court, Florida's Leon County Circuit Court};GPE:{US, Florida, Leon County, state};PER:{both sides}
Extract-SelectORG:{The US Supreme Court, both sides, Florida's Leon County Circuit Court};GPE:{US, Florida, Leon County, state}
Sentence 2Separatists have fought since 1975 for independence in Aceh, which is rich in oil and gas and has a population of about 4.1 million people.
Gold LabelPER:{Separatists, a population of about 4.1 million people}; GEP:{which, Aceh, which is rich in oil and gas and has a population of about 4.1 million people}
Locate-LabelPER:{Separatists, about 4.1 million people, a population of about 4.1 million people}; GEP:{which, Aceh, which is rich in oil and gas and has a population of about 4.1 million peoople}
Extract-SelectPER:{Separatists, a population of about 4.1 million people}; GEP:{which, Aceh, which is rich in oil and gas and has a population of about 4.1 million people}
Sentence 3united nations secretary general kofi annan today discussed plans for the summit with the host, egyptian president hosni mubarak.
Gold LabelORG:{united nations}; PER:{united nations secretary general, united nations secretary general kofi annan, the host, egyptian president, egyptian president hosni mubarak}; GPE:{egyptian}
Locate-LabelORG:{united nations}; PER:{united nations secretary general, united nations secretary general kofi annan, the host, egyptian president, egyptian president hosni mubarak}; GPE:{egyptian}
Extract-SelectORG:{united nations}; PER:{united nations secretary general, united nations secretary general kofi annan, secretary general kofi annan, the host, egyptian president, egyptian president hosni mubarak}; GPE:{egyptian}
+ +![](images/05805e5d4ec58a057e5bf32166a20d859614f4597596d4c456464f6744e543e0.jpg) +Figure 3: Effect of varying training sample size on ACE2005. + +lines (removing the entity marker and the GAT, respectively). Besides, the observation from the vertical line reviews that the degree of performance decrease of the full model is much less than that of other two internal baselines. In sum, the above observations indicate that both the entity marker and the GAT contributes to the better performance when less training data is given. + +# 6.5 Analysis of Long Entity Recognition + +To illustrate the performance of model on entities of different lengths, we divide the entities into three groups according to their lengths. We compare Extract-Select with two-stage models: Locate-Label (Shen et al., 2021) which adopts boundary regressors to enable long entity recognition and Locate-Label-reg which is a two-stage baseline. The results are shown in Table 5. We + +Table 4: Examples of predicted results of our model and Locate-Label. Blue highlights indicate wrong predictions by Locate-Label, red highlights indicate wrong predictions by our model, colored words indicate wrongly predicted entity references. + +
ModelACE2004 (F1)
1 ≤ L ≤ 55 < L ≤ 10L > 10ALL
support2719219973035
Locate-Label-reg88.4366.1237.1185.18
Locate-Label88.5582.7861.7287.41
Extract-Select89.5284.0666.2088.39
+ +Table 5: A comparison of recognition F1 score on entities of different lengths, we divide the entities into three groups: $1 \leq L \leq 5$ , $5 < L \leq 10$ , and $L > 10$ , where $L$ denotes entity length. Support denotes the number of entities in each length group on the test set of ACE2004. + +notice that the F1 score of Locate-Label-reg has a sharp decrease for long entities $(L > 10)$ by $29.09\%$ compared to our model. This may because Locate-Label-reg set maximum span length in span extraction, limiting the ability of recognizing long entities. Locate-Label faces a large F1 score decrease (5.77% and 21.06%) when the entity length increases from $1 \leq L \leq 5$ to $5 < L \leq 10$ and from $5 < L \leq 10$ to $L > 10$ , respectively. Compared with them, Extract-Select maintains a good performance when the entity length increases, with only $5.46\%$ and $17.86\%$ F1 score decrease. This verifies that our model is more effective in recognizing long entities. + +# 6.6 Case Study + +Examples of predictions are shown in Table 4. The first part illustrates that Extract-Select has the ability of resolving ambiguous entity references, as + +span selection framework separately extracts entities for each category rather than conducts multiclassification for every entity. As shown in the fourth line, Extract-Select accurately recognizes the reference phrase "both sides" as ORG category, whereas Locate-Label incorrectly classifies it into PER category due to the ambiguity. The second part reveals that Extract-Select can recognize long entities well. As shown in the second part, the long entities "Aceh, which is rich in oil and gas and has a population of about 4 . 1 million people" of GEP category can be extracted. However, this framework may also incorrectly recall some entities, especially for entities with multi-level nested structures. For example in the third part, the multi-level nested entities "secretary general kofi annan" is incorrectly recognized. The reason may be that the extracted multi-level nested entities confuses the discriminator. + +# 7 Conclusion + +This paper proposes Extract-Select, a span selection framework to solve nested NER. It contains an extractor which aims to extract entities specific to a particular entity category with a hybrid selection strategy, and a discriminator scoring the extractor. The extractor and discriminator are trained with GAT to reduce the demand on labeled data. Comprehensive experiments performed on four widely used nested NER datasets demonstrate the superiority of Extract-Select. In future, we will (1) attempt to overcome the deficiency issue and (2) investigate in discontinuous and joint NER. + +# Acknowledgements + +This work was partially supported by NSFC under grants Nos. 61872446, 62002373 and 62006243, and the Science and Technology Innovation Program of Hunan Province under grant No. 2020RC4046. + +# References + +Beatrice Alex, Barry Haddow, and Claire Grover. 2007. Recognising nested named entities in biomedical text. In Biological, translational, and clinical language processing, BioNLP@ACL 2007, Prague, Czech Republic, June 29, 2007, pages 65-72. Association for Computational Linguistics. +Billy Chiu, Gamal K. O. Crichton, Anna Korhonen, and Sampo Pyysalo. 2016. How to train good word embeddings for biomedical NLP. In Proceedings of the 15th Workshop on Biomedical Natural Language Processing, BioNLP@ACL 2016, Berlin, Germany, + +August 12, 2016, pages 166-174. Association for Computational Linguistics. +Jason P. C. Chiu and Eric Nichols. 2016. Named entity recognition with bidirectional LSTM. Trans. Assoc. Comput. Linguistics, 4:357-370. +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, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171-4186. Association for Computational Linguistics. +George R. Doddington, Alexis Mitchell, Mark A. Przybocki, Lance A. Ramshaw, Stephanie M. Strassel, and Ralph M. Weischedel. 2004. The automatic content extraction (ACE) program - tasks, data, and evaluation. In Proceedings of the Fourth International Conference on Language Resources and Evaluation, LREC 2004, May 26-28, 2004, Lisbon, Portugal. European Language Resources Association. +Joseph Fisher and Andreas Vlachos. 2019. Merge and label: A novel neural network architecture for nested NER. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28-August 2, 2019, Volume 1: Long Papers, pages 5840-5850. Association for Computational Linguistics. +Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. 2014. Generative adversarial nets. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 2672-2680. +Dou Hu and Lingwei Wei. 2020. SLK-NER: exploiting second-order lexicon knowledge for chinese NER. In The 32nd International Conference on Software Engineering and Knowledge Engineering, SEKE 2020, KSIR Virtual Conference Center, USA, July 9-19, 2020, pages 413-417. KSI Research Inc. +Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional LSTM-CRF models for sequence tagging. CoRR, abs/1508.01991. +Meizhi Ju, Makoto Miwa, and Sophia Ananiadou. 2018. A neural layered model for nested named entity recognition. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pages 1446-1459. Association for Computational Linguistics. + +Arzoo Katiyar and Claire Cardie. 2018. Nested named entity recognition revisited. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pages 861-871. Association for Computational Linguistics. +Jiwei Li, Will Monroe, Tianlin Shi, Sebastien Jean, Alan Ritter, and Dan Jurafsky. 2017. Adversarial learning for neural dialogue generation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, EMNLP 2017, Copenhagen, Denmark, September 9-11, 2017, pages 2157-2169. Association for Computational Linguistics. +Xiaonan Li, Hang Yan, Xipeng Qiu, and Xuanjing Huang. 2020a. FLAT: chinese NER using flat-lattice transformer. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 6836-6842. Association for Computational Linguistics. +Xiaoya Li, Jingrong Feng, Yuxian Meng, Qinghong Han, Fei Wu, and Jiwei Li. 2020b. A unified MRC framework for named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 5849-5859. Association for Computational Linguistics. +Hongyu Lin, Yaojie Lu, Xianpei Han, and Le Sun. 2019. Sequence-to-nuggets: Nested entity mention detection via anchor-region networks. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28- August 2, 2019, Volume 1: Long Papers, pages 5182-5192. Association for Computational Linguistics. +Yi Luan, Dave Wadden, Luheng He, Amy Shah, Mari Ostendorf, and Hannaneh Hajishirzi. 2019. A general framework for information extraction using dynamic span graphs. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 3036-3046. Association for Computational Linguistics. +Ying Luo and Hai Zhao. 2020. Bipartite flat-graph network for nested named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 6408-6418. Association for Computational Linguistics. +Xuezhe Ma and Eduard H. Hovy. 2016. End-to-end sequence labeling via bi-directional LSTM-cnns-crf. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, + +August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers. The Association for Computer Linguistics. +Yuxian Meng, Wei Wu, Fei Wang, Xiaoya Li, Ping Nie, Fan Yin, Muyu Li, Qinghong Han, Xiaofei Sun, and Jiwei Li. 2019. Glyce: Glyph-vectors for chinese character representations. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 2742-2753. +Aldrian Obaja Muis and Wei Lu. 2017. Labeling gaps between words: Recognizing overlapping mentions with mention separators. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, EMNLP 2017, Copenhagen, Denmark, September 9-11, 2017, pages 2608-2618. Association for Computational Linguistics. +Ohta, Tomoko, Tateisi, Yuka, Kim, and JinDong. 2002. The genia corpus: an annotated research abstract corpus in molecular biology domain. +Nanyun Peng and Mark Dredze. 2015. Named entity recognition for chinese social media with jointly trained embeddings. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP 2015, Lisbon, Portugal, September 17-21, 2015, pages 548-554. The Association for Computational Linguistics. +Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pages 2227-2237. Association for Computational Linguistics. +Pengda Qin, Weiran Xu, and William Yang Wang. 2018. DSGAN: generative adversarial training for distant supervision relation extraction. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 496-505. Association for Computational Linguistics. +Erik F. Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the conll-2003 shared task: Language-independent named entity recognition. In Proceedings of the Seventh Conference on Natural Language Learning, CoNLL 2003, Held in cooperation with HLT-NAACL 2003, Edmonton, Canada, May 31 - June 1, 2003, pages 142-147. ACL. +Yongliang Shen, Xinyin Ma, Zeqi Tan, Shuai Zhang, Wen Wang, and Weiming Lu. 2021. Locate and label: A two-stage identifier for nested named entity recognition. In Proceedings of the 59th Annual + +Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 2782-2794. Association for Computational Linguistics. +Takashi Shibuya and Eduard H. Hovy. 2020. Nested named entity recognition via second-best sequence learning and decoding. Trans. Assoc. Comput. Linguistics, 8:605-620. +Mohammad Golam Sohrab and Makoto Miwa. 2018. Deep exhaustive model for nested named entity recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 2843-2849. Association for Computational Linguistics. +Jana Straková, Milan Straka, and Jan Hajic. 2019. Neural architectures for nested NER through linearization. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28-August 2, 2019, Volume 1: Long Papers, pages 5326-5331. Association for Computational Linguistics. +Christopher Walker, Stephanie Strassel, Julie Medero, and Kazuaki Maeda. 2006. Ace 2005 multilingual training corpus ldc2006t06. Web Download. Philadelphia: Linguistic Data Consortium, 110(110):261-276. +Bailin Wang and Wei Lu. 2018. Neural segmental hypergraphs for overlapping mention recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 204-214. Association for Computational Linguistics. +Bailin Wang, Wei Lu, Yu Wang, and Hongxia Jin. 2018a. A neural transition-based model for nested mention recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 1011-1017. Association for Computational Linguistics. +Jue Wang, Lidan Shou, Ke Chen, and Gang Chen. 2020. Pyramid: A layered model for nested named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 5918-5928. Association for Computational Linguistics. +Shuohang Wang, Mo Yu, Xiaoxiao Guo, Zhiguo Wang, Tim Klinger, Wei Zhang, Shiyu Chang, Gerry Tesauro, Bowen Zhou, and Jing Jiang. 2018b. $\mathbf{R}^3$ : Reinforced ranker-reader for open-domain question answering. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium + +on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 5981-5988. AAAI Press. +Zexuan Zhong and Danqi Chen. 2021. A frustratingly easy approach for entity and relation extraction. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2021, Online, June 6-11, 2021, pages 50-61. Association for Computational Linguistics. + +# A The Training Procedure of Extract-Select + +The full pseudo-code for the learning procedure of Extract-Select is given in Algorithm 1. + +Algorithm 1 The learning procedure of ExtractSelect. + +Require: An extractor E; A discriminator G; the input sequence $S$ ; an entity type $y \in Y$ + +Output: Trained extractor with multi-task leaning + +1: Initialize E, D parameters; +2: Generate entity span candidate set $C$ using E for training D; +3: Pre-train D via min-max training by Eq.(14); +4: repeat +5: for E-step do +6: Extract a set and its representation $(C, r_C) = f_E(y, S)$ using Eq.(1)-(9); +7: Compute the score of $C$ using Eq.(10); +8: Compute joint objective $\ell_{E}$ using Eq.(11)-(13); +9: Update Extractor parameters via policy gradient; +10: end for +11: for D-step do +12: Use current E to generate entity span candidate set $C$ ; +13: Represent $C$ and calculate its score $f_{D}(y,S)$ using Eq.(10); +14: Train discriminator for k epochs by Eq.(14); +15: end for +16: until Extract-Select converges + +# B Experiments on Nested NER + +# B.1 Datasets Processing + +Dataset statistics are listed in Table 6. For ACE2004 (Doddington et al., 2004) and ACE2005 (Walker et al., 2006), we follow the same settings as Lin et al. (2019), and splitting files into training, development and test sets + +
ModelACE2004ACE2005GENIAKBP2017
TrainDevTestTrainDevTestTraindevTestTrainDevTest
NO. sentences6200745812719496910471502216691855105465454267
NO. sent. nested entities27122943882691338320322232844828091821223
NO. total entities22204251430352444132002993470064461559631236187912601
NO. nested entities10149109214179389111211188382818121287736053707
nested percentage (%)45.7146.6945.6138.4134.7537.3517.8318.3421.6628.0932.2029.42
+ +Table 6: Statistics of the datasets used in the experiments. + +
ModelCoNLL2003
PRF1
BiLSTM-CRF--91.03
ELMo-Tagger--92.22
Bert-Tagger--92.8
Extract-Select92.1094.0393.05
ModelWeibo
PRF1
SLK-NER61.8066.3064.00
Glyce67.6067.6867.71
FLAT--68.55
Extract-Select69.2070.0869.64
+ +Table 7: Results for flat NER tasks. + +by 8:1:1. For GENIA (Ohta et al., 2002), we use GENIA v3.0.2 corpus, and follow the split of Wang et al. (2020), i.e., first collapse all subtypes into five types, and then split files into training, development, and test sets by 8.1:0.9:1. For KBP2017, we follow Lin et al. (2019) and evaluate the model on the 2017 English evaluation dataset, using previous RichERE annotated datasets as the training set except 20 randomly sampled documents reserved as development set. Finally, there are 866/20/167 files for training, development and test set. + +# B.2 Implementation Details + +We initialize word embeddings of the input sequence and entity marker with 100-dimensional GLoVE vectors for extractor and discriminator. The dimensions of contextualized word embedding, POS embedding, and character embedding are 1024, 50, and 50, respectively. The hidden size is set to 1024. For GENIA dataset, we replace GLoVE vectors with word vectors pre-trained on biomedical corpus (Chiu et al., 2016), which are + +in 200 dimensions. During the training process, we employ the Adam Optimizer with the initial learning rate as 0.002 and the minibatch size as 64. We use a dropout rate of 0.35 in each training process. We set the threshold in Line 325 through grid search among $(0.2, 0.5, 0.8)$ , and it is set to 0.5 for having the best performance. + +# C Experiments on Flat NER + +We also choose two flat NER datasets, i.e., CoNLL2003 and Weibo, to evaluate ExtractSelect. CoNLL2003 is an English dataset (Sang and Meulder, 2003) with four types of flat entities. We follow the data processing in Lin et al. (2019). Weibo is a Chinese dataset (Peng and Dredze, 2015) sampled from Weibo web pages. We use the same settings in Li et al. (2020a) to evaluate our model. + +For English flat NER, we use several taggers as baselines: BiLSTM-CRF (Ma and Hovy, 2016), ELMo-Tagger (Peters et al., 2018), and BertTagger (Devlin et al., 2019). For Chinese flat NER, we use the following models as baselines: SLK-NER (Hu and Wei, 2020) which incorporates second-order lexicon knowledge, Glyce (Meng et al., 2019) which combines glyph information, and FLAT (Li et al., 2020a) which uses phrases. + +Table 7 presents comparisons between Extract-Select and the baselines on two flat NER datasets. On Weibo dataset, our model outperforms the baselines, improving the F1 score by $1.09\%$ . On CoNLL2003, our model also gains comparable results, with $0.25\%$ performance improvement compared to Bert-Tagger. In general, Extract-Select achieves good performance on not only nested NER but also flat NER. \ No newline at end of file diff --git a/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/images.zip b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..afbbc14b6ff1b1c6e3c4f47524129ec1ceaa4ce8 --- /dev/null +++ b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9677ae958273fafa8bf78abbc3cea64600149a3669a04e19cfabd2a073a67489 +size 595901 diff --git a/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/layout.json b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9cde5fd05e54a9ef70daf370dbc1292b72655dc5 --- /dev/null +++ b/extractselectaspanselectionframeworkfornestednamedentityrecognitionwithgenerativeadversarialtraining/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54b7943ea92361fca3de8642a98af187ee74b32d8b21f6cff3cb3959f1aefd1b +size 480881 diff --git a/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_content_list.json b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..864423d4b8534d35fa0483135e6b8cb8818373ee --- /dev/null +++ b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1ff2483c88ed19c4ef1ab18efcf130661e4927721adebaec6fa96ebe1528c92 +size 91012 diff --git a/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_model.json b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..346e7c22e5d8b906c42781c2eef9451f06f2c574 --- /dev/null +++ b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:daaa6fd7b31755d588c9d1e14ce2c554c00a809def30b425822d397e7077324a +size 115255 diff --git a/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_origin.pdf b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2ffbedf46656e4c88e9782b92d73784f44112050 --- /dev/null +++ b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/35d883a0-61a8-497c-a14f-8876aef62fa0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19cef07fc369d12027f0c6f97bad2aa12c0809bd9ec9d5e585e681ce4269a8ff +size 1900647 diff --git a/facttreereasoningfornaryquestionansweringoverknowledgegraphs/full.md b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d2f7c2500f87ffa3c96be8803db370073d13d7b1 --- /dev/null +++ b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/full.md @@ -0,0 +1,404 @@ +# Fact-Tree Reasoning for N-ary Question Answering over Knowledge Graphs + +Yao Zhang1 Peiyao Li1 Hongru Liang2 Adam Jatowt3 Zhenglu Yang1* + +$^{1}$ TKLNDST, CS, Nankai University, China, $^{2}$ Sichuan University, China, + +3University of Innsbruck, Austria + +{yaozhang, peiyao_li}@mail.nankai.edu.cn, lianghongru@scu.edu.cn,adam.jatowt@uibk.ac.at, yangzl@nankai.edu.cn + +# Abstract + +Current Question Answering over Knowledge Graphs (KGQA) task mainly focuses on performing answer reasoning upon KGs with binary facts. However, it neglects the $n$ -ary facts, which contain more than two entities. In this work, we highlight a more challenging but under-explored task: $n$ -ary KGQA, i.e., answering $n$ -ary facts questions upon $n$ -ary KGs. Nevertheless, the multi-hop reasoning framework popular in binary KGQA task is not directly applicable on $n$ -ary KGQA. We propose two feasible improvements: 1) upgrade the basic reasoning unit from entity or relation to fact, and 2) upgrade the reasoning structure from chain to tree. Therefore, we propose a novel fact-tree reasoning framework, FacTree, which integrates the above two upgrades. FacTree transforms the question into a fact tree and performs iterative fact reasoning on the fact tree to infer the correct answer. Experimental results on the $n$ -ary KGQA dataset we constructed and two binary KGQA benchmarks demonstrate the effectiveness of FacTree compared with state-of-the-art methods. + +# 1 Introduction + +The task of Question Answering over Knowledge Graphs (KGQA) has provided new avenues to the recent development of QA systems by utilizing the advantages of KGs (Yu et al., 2017; Dubey et al., 2019; Huang et al., 2019; Zhang et al., 2021). Current KGQA studies mainly consider performing answer reasoning upon KGs with binary facts, which encode binary relations between pairs of entities, e.g., Golden State Warriors' arena is Chase Center1. However, $n$ -ary facts that involve more than two entities are also ubiquitous in reality (Guan et al., 2019; Abboud et al., 2020; Wang et al., 2021), e.g., the ternary fact Golden State Warriors won + +the NBA championship in 2018. Compared to binary facts, $n$ -ary facts have more information content. This makes the answer reasoning for questions involving $n$ -ary facts more intractable, exposing open challenges in KGQA. In this work, we aim to study the under-explored $n$ -ary KGQA task, i.e., answering $n$ -ary facts questions upon $n$ -ary KGs. + +The multi-hop reasoning KGQA method (Das et al., 2018; Qiu et al., 2020; Saxena et al., 2020; Ren et al., 2021) has become popular for its high efficiency and interpretability. Specifically, the reasoning process can be expressed as a chain, starting from an entity extracted from the question and then walking on the KG by connected relations and entities until arriving at the answer entity. See Figure 1 (b) for an example, to answer the question, what is the address of the arena of the Golden State Warriors, the reasoning chain starts from Golden State Warriors, to walk through "arena $\rightarrow$ Chase Center $\rightarrow$ address", and it ends at 1 Warriors Way, i.e., the answer. Multi-hop reasoning has been studied widely on the binary KGQA task. Here, we first try to execute it on the $n$ -ary KGQA task. + +However, we find that multi-hop reasoning is not directly applicable on $n$ -ary KGQA. We take the $n$ -ary facts question in Figure 1 (c) as an example to explain. First, the essence of multi-hop reasoning is to construct a reasoning chain by treating the relation as the translation between two entities (Bordes et al., 2013; Ren and Leskovec, 2020), naturally in a linear structure. However, the transition from binary to $n$ -ary facts is similar to the transition from a line to a plane. For a single $n$ -ary fact (e.g., Golden State Warriors won the NBA championship in 2018), the reasoning chain could only include two entities Golden State Warriors and NBA championship and a relation win involving them, leading to the possible loss of important information 2018. To overcome + +![](images/4de050b6be9b5d8a6c9d005d186614f8327885fb6a96d85e0c7fa16a81a3de6b.jpg) +Q1: What is the address of the arena of the Golden State Warriors? +Chain: Golden State Warriors $\rightarrow$ arena $\rightarrow$ Chase Center $\rightarrow$ address $\rightarrow$ ★ 1 Warriors Way + +![](images/cf422f218c64d53a822c095a384662e6e6ad3a13da87f204e3fa7f5b212174b3.jpg) +(b) +Q2: Who joined an NBA team in Los Angeles in the year the Warriors won the NBA championship? +Figure 1: (a) A KG fragment, where entities are represented by round rectangles. Win and join are two ternary relations. (b) and (c) are two QA examples, where the correct answer is marked by a star. The multi-hop reasoning method can be used to answer Q1, and the reasoning process can be visualized as a chain (b). However, for the more complex Q2, the multi-hop reasoning method is not applicable. We use fact as the basic reasoning unit to construct the reasoning process. As shown in (c), the reasoning process can be visualized as a fact tree: fact 2 and fact 3 are leaf nodes need to be inferred first, and then the two inferred entities (Los Angeles Lakers and 2018) are transmitted to the root node (fact 1). Finally the root node infers the answer entity (LeBron James). + +this weakness, we propose that upgrading the basic reasoning unit from an entity or relation to the fact to expand the coverage of information during reasoning. + +Nevertheless, multi-hop reasoning would still be less capable in more complex reasoning scenarios where a question involves multiple $n$ -ary facts. For example, the question in Figure 1 (c) is composed of three facts. When using fact as the basic reasoning unit, the whole reasoning process can be represented as a tree structure, where nodes represent facts and edges reflect the reasoning order. Specifically, in the fact tree, the entities (Los Angeles Lakers and 2018) which are missing in the two leaf nodes (fact 2 and fact 3) are first inferred and then passed to the root node (fact 1). The root node can then finally infer the correct answer entity LeBron James. Obviously, the chain structure used in the multi-hop reasoning framework is evidently insufficient to cope with the tree structure. Therefore, to improve the ability to cope with more complex reasoning scenarios, we propose that upgrading the reasoning structure from chian to tree. + +In this work, we propose a novel fact-tree reasoning framework, namely, FacTree, which integrates the above two upgrades and pipelines the answer reasoning process into three steps: 1) fact tree construction, which transforms an input natural language (NL) question into an NL fact tree; 2) fact location, which locates the NL fact onto the KG; and 3) fact reasoning, which iterates intra-fact + +and inter-fact reasoning to infer the answer. During the intra-fact reasoning, the $n$ -ary KG embedding model (Guan et al., 2020) is plugged in to alleviate the deficiency of KG incompleteness. The explicit tree reasoning structure makes the results strongly interpretable. Furthermore, we develop a new dataset called WikiPeopleQA to foster research on $n$ -ary KGQA. We then conduct comprehensive experiments on WikiPeopleQA dataset to show that FacTree has the desired ability to perform effective reasoning on $n$ -ary fact questions. Besides, on two binary KGQA datasets, FacTree also indicates a strong ability to infer answers compared with state-of-the-art methods accurately. + +Our study fundamentally contributes to bridging the gap between binary KGQA and $n$ -ary KGQA. The proposed FacTree can serve as a preliminary foundation for the $n$ -ary KGQA. To summarize, our contributions are: + +- We highlight a more challenging task: $n$ -ary KGQA than a standard binary KGQA task setting. We further observe that the multi-hop reasoning framework popular in binary KGQA is no longer applicable to $n$ -ary KGQA. +- We propose a novel fact-tree reasoning framework, FacTree, which can serve as a preliminary foundation for $n$ -ary KGQA study. And we develop a new dataset: WikiPeopleQA to foster research on $n$ -ary KGQA. +- We conduct comprehensive experiments to show that our framework has the desired reasoning ability for both $n$ -ary and binary KGQA tasks. + +![](images/e9bdadd1c6b90f391243b049922383b98a6ebf71fe54d102b61433560fd60bbe.jpg) +Figure 2: Overview of FacTree. It takes the question (Q) as an input, passes through a three-stage pipeline processing: 1) fact tree construction (Sec. 3.1), 2) fact location (Sec. 3.2) and 3) fact reasoning (Sec. 3.3), and finally gets the answer entity (A). Placeholders $\square$ in the NL and KG fact trees indicate the entities to be inferred. + +# 2 Related Work + +The previous series of KGQA models (Liang et al., 2011; Berant et al., 2013; Yih et al., 2014; Lan and Jiang, 2020; Sun et al., 2020; Wolfson et al., 2020) synthesize a structured query graph from the question and then match the query with KG to get the answer. This type of model has high interpretability but is challenged by the incomplete nature of KGs. Then another series models compute the semantic similarity of the question and each candidate answer directly in the latent space (Bordes et al., 2015; Dong et al., 2015; Hamilton et al., 2018; Zhang et al., 2018b). This type of model overcomes the limitation of incomplete KG, but lacks sufficient interpretability. FacTree uses facts as the basic reasoning unit to alleviate the deficiency of KG incompleteness and the explicit tree reasoning structure to realize strongly interpretable. + +Multi-hop reasoning framework has attracted widespread attention due to its high flexibility and high interpretability in recent years (Fu et al., 2020). Current efforts build an explicit reasoning chain through training a reinforcement learning agent to walk on the KG (Das et al., 2018; Qiu et al., 2020; Kaiser et al., 2021), or construct implicit reasoning chains through memory network (Sukhbaatar et al., 2015; Miller et al., 2016; Chen et al., 2019) or in the latent space (Bordes et al., 2014; Saxena et al., 2020; Ren and Leskovec, 2020; He et al., 2021; Ren et al., 2021). This kind of method performs well on binary fact questions but has difficulties in dealing with $n$ -ary fact questions. Of course, one could construct and synthesize multiple reasoning chains to tackle $n$ -ary KGQA. But this would inevitably lead to an exponential increase in the reasoning difficulty and computational complexity, which in turn affects the reasoning performance. + +Our work first highlights the $n$ -ary KGQA task. + +The research of $n$ -ary KG provides a feasible research foundation for $n$ -ary KGQA. KG embedding learning on $n$ -ary facts (Wen et al., 2016; Zhang et al., 2018a; Fatemi et al., 2019; Guan et al., 2019, 2020; Abboud et al., 2020) has grown considerably in recent years. The $n$ -ary KG embedding model (Guan et al., 2020) is plugged in FacTree to alleviate the reasoning difficulties caused by the KG incompleteness. + +# 3 Fact-tree Reasoning + +We illustrate the fact-tree reasoning framework for $n$ -ary KGQA in Figure 2. It takes the question (Q) as an input, passes through a three-stage pipeline processing, and finally gets the answer entity (A). In the first fact tree construction stage, we construct the NL fact tree from the NL question (Sec. 3.1). In the second fact location stage, we locate the NL fact onto the KG to obtain the KG fact tree (Sec. 3.2). This helps to bridge the semantic and structure gap between the unstructured NL and the structured KG. In the last fact reasoning stage, we perform intra-fact and inter-fact reasoning iteratively on the KG fact tree to infer the answer entity (Sec. 3.3). + +We use fact as the basic reasoning unit in the fact-tree reasoning framework. In the NL fact tree, the fact is represented as a sequence of words and placeholders, where the words are taken from the NL question, and the placeholders refer to the missing entities to be inferred, e.g., the fact (□ joined □ in the year □). In the KG fact tree, following (Guan et al., 2020), we represent the $n$ -ary fact as + +$$ +f a c t = (s, p, o), \left\{a _ {1}: v _ {1}, a _ {2}: v _ {2}, \dots , a _ {m}: v _ {m} \right\}, \tag {1} +$$ + +where $(s,p,o)$ denotes the subject-predicate-object information in the fact, named primary triple; each $a_{i}:v_{i}$ $(i\in \{1,2,\dots,m\})$ is an attribute value pair, a.k.a., the auxiliary description to + +![](images/d03f9391d59d1216d07c484cc9b75d27504e71129785acd24bb540e44c08fee5.jpg) +Figure 3: An example of NL fact tree construction (partial steps). The eliminations of nodes in the order of $\mathbf{1} \rightarrow \mathbf{2} \rightarrow \mathbf{3} \rightarrow \mathbf{4} \rightarrow \cdots$ . Best viewed in color. + +the primary triple. For example, the ternary fact LeBron James joined Los Angeles Lakers in 2018 is formalized as (LeBron James, join, Los Angeles Lakers),{time: 2018}. Note that the binary fact only contains the primary triple. + +# 3.1 Fact tree construction + +In FacTree, we use fact as the basic reasoning unit and use the tree structure to represent the associations among facts. Here, we design an automatic NL fact tree construction algorithm to transfer the NL question to the NL fact tree. Since the syntax tree naturally expresses the hierarchical relation of the elements of the sentence and in order to facilitate the subsequent locating of the NL facts into KG, we use the syntax tree $^2$ of Q as the initial structure. We expect the constructed NL fact tree to satisfy the following characteristics: 1) the leaf nodes are words or phrases of Q; and 2) if the leaf nodes share the same parent node, they belong to the same fact. Therefore, the NL fact tree construction algorithm can be viewed as an iterative eliminating of nodes in the syntax tree to achieve clustering of nodes within facts and differentiation between facts. + +The node elimination process starts from the antepenult level of the syntax tree and proceeds from bottom to top. We observe that two semantically different questions may be parsed into the same syntax structure except for the leaf nodes. Therefore, disregarding leaf nodes makes our algorithm more adaptable. Also, the parent node of a leaf node needs to be reserved for identifying the leaf node. Figure 3 shows a specific example3. As shown in + +Algorithm 1: NL Fact Tree Construction +Input: The question Q, empty node stacks V, V'; Output: The NL fact tree FT; +1 Initialization +2 FT = Parse(Q), +3 V = BFS(FT); +4 while V do +5 v = V.pop(); +6 if v.isLeaf() or v.children.isLeaf() then +7 continue; +8 else +9 $\mathbb{V}^{\prime}$ .push(v); +10 end +11 end +12 while $v\neq$ FT.root do +13 v = V'.pop(); +14 $T_{v} = \{v\} \cup \{v.$ parent\} $\cup \{v$ children\}; +15 if $f(T_v) ==$ eliminate then +16 update +17 for each child in v.children do +18 | child.set_parent(v.parent,FT) +19 end +20 FT(delete(v)) +21 end +22 end + +(a), the pruning starts from the node VP (0, colored in red). To decide whether to eliminate this node or not, we extract a subtree that contains the node and its neighbor nodes (colored in blue). This subtree is fed into a classifier $f(\cdot)$ , which is composed of a Graph Convolutional Network (GCN) as embedding layer and a fully-connected layer. If $f(\cdot)$ outputs "eliminate", the node will be eliminated and its children will be directly connected to its parent, as shown in (b). Otherwise, this node will be retained. This process continues until the iteration meets the root node. Finally, we remove non-leaf nodes and keep the hierarchical structure of leaf nodes. The nodes in the upper-layer facts that are connected to the lower-layer facts are replaced with placeholders, as shown in (c). We summarize the construction of NL fact tree in Algorithm 1. + +Specifically, for the GCN, we use the propagation rule for calculating the node embedding update + +![](images/8b64a8e161d5589a9a665dd5b8b0e0429d7c0a2af8771ea360c5ab5705863091.jpg) +Figure 4: Example of a structure matching process. + +for each layer as follows: + +$$ +\boldsymbol {h} _ {v} ^ {(i + 1)} = \sigma_ {i} \left(\boldsymbol {h} _ {v} ^ {(i)} \boldsymbol {W} _ {0} ^ {(i)} + \sum_ {u \in T _ {v} \backslash v} \boldsymbol {h} _ {u} ^ {(i)} \boldsymbol {W} _ {1} ^ {(i)}\right), \tag {2} +$$ + +where $v$ and $T_{v}$ follow the definitions in Algorithm 1, $u$ is one of the neighbors of $v$ , $\pmb{h}_{*}^{(i)}$ represents the hidden layer activations of nodes in the $i^{th}$ layer, $\sigma_{i}(\cdot)$ is the activation function, and $\pmb{W}_{0,1}^{(i)}$ are the $i$ -layer weight matrices. + +# 3.2 Fact Location + +This stage aims to transfer the NL fact tree to the KG fact tree, specifically, to locate each NL fact in the tree to a KG fact. It is divided into three specific steps: 1) entity linking, 2) structure matching, and 3) relation extraction. + +During entity linking, following the standard setting in KGQA (Saxena et al., 2020), we assume that the entities of the question are given and linked to nodes on the KG. Note that the placeholders are directly reserved and they indicate the entities that need to be inferred. + +The key of structure matching is to locate the subject $s$ , predicate $p$ , object $o$ , attribute $a$ and value $v$ in the NL fact. We view this process as a sequence labelling task, as shown in Figure 4. We believe that location labels are more strongly associated with syntax labels, compared to word sequences. Therefore, the input is the sequence formed by the syntax labels of each node in the NL fact. The output is the sequence of location labels, and the label set is $\{s, p, o, a, v\}$ . Here, we adopt the BiLSTM-CRF model (Huang et al., 2015) to perform sequence labelling. + +After entity matching, we conduct relation extraction, i.e., transferring the word sequences labelled $p$ or $a$ to the corresponding relations (predicates or attributes) in KG. Specifically, we adopt pre-trained SBERT model (Reimers and Gurevych, 2019) to get the embeddings of the relation in KG (i.e., $r$ ) and the word sequences (i.e., $w$ ). Then we use cosine similarity as a scoring function $s(\cdot)$ to assign scores to the two embeddings and select + +![](images/f2c9c043af283d6d49dbe2061345599ee1c5be7b0e3698ce037fee974e2b820c.jpg) +Figure 5: Example of an iterative reasoning process. The order of reasoning is $\mathbf{1} \rightarrow \mathbf{2} \rightarrow \mathbf{3} \rightarrow \mathbf{4} \rightarrow \mathbf{5}$ . + +the relation with the highest score: + +$$ +s (r, w) = \frac {r \cdot w}{\| r \| \| w \|} = \frac {\sum_ {i = 1} ^ {n} r _ {i} w _ {i}}{\sqrt {\sum_ {i = 1} ^ {n} r _ {i} ^ {2}} \sqrt {\sum_ {i = 1} ^ {n} w _ {i} ^ {2}}}. \tag {3} +$$ + +Finally, combining the predicted location labels, and linked entities and extracted relations, NL facts can be transformed into KG facts (cf. Figure 2). Placeholders are the bridge between upper-layer and lower-layer facts. Interestingly, due to the variability of NL organization, there may be no placeholder in the lower-layer fact. It is because when constructing the NL fact tree, the placeholder (usually value) is assigned to upper-layer fact according to the syntax structure. Therefore, we directly copy the upper-layer placeholder directly to the lower-layer fact. For example, in Figure 2, the fact the Warriors won the NBA championship will be transformed to (Golden State Warriors, win, NBA championship), {time:2018}, where the attribute time is copied from the upper-layer fact. + +# 3.3 Fact Reasoning + +In this stage, we perform the inter-fact and intra-fact reasoning iteratively based on the KG fact tree to find the answer entity. One example of iterative reasoning process is shown in Figure 5. + +Inter-fact Reasoning The whole process of inter-fact reasoning is carried out in a bottom-up manner. Specifically, the entity inferred from the lower-layer fact will be transferred to the upper-layer fact. For example, the entity 2018 inferred from fact 3 will be transferred to fact 1, i.e., the second step in Figure 5. + +Intra-fact reasoning This module aims to infer the missing entity of each incomplete fact. We formulate this process as the KG completion task. KG embedding models (Bordes et al., 2013; Dettmers et al., 2018; Guan et al., 2019, 2020) are studied to deal with this task, by learning entity and relation embeddings and designing a scoring function to infer the missing entity. In this work, we use + +Table 1: Statistics of WikiPeopleQA, WC2014 and PathQuestion, as well as their subsets. Note that the $n$ -ary here means that $n$ is greater than 2. + +
Dataset# Question-Answer PairBackground KG
TotalSubset# Fact# Entity# Relation(binary)# Relation(n-ary)
WikiPeopleQA (1F/2F/3F)4,4912,365 / 1,497 / 62956,42628,043150557
WC2014 (1H/2H/C)10,1626,482 / 1,472 / 2,2086,4821,12760
PathQuestion (2H/3H)7,1061,908 / 5,1984,0492,215140
+ +NeuInfer (Guan et al., 2020), a KG embedding model that can perform on binary and $n$ -ary facts, to implement intra-fact reasoning. + +However, comparing with the traditional KG completion task, the missing entity needs not only to complete the current fact, but also to satisfy the upper-layer fact. For example, in fact 2, Sunset Boulevard and Los Angeles Lakers are all located in Los Angeles. While, considering the upper-layer fact 1, the missing entity needs to satisfy the fact that the predicate is join. Therefore, we introduce a score amplification mechanism: if an alternative entity can satisfy the upper-layer fact, its corresponding score will be magnified $\lambda$ times. + +# 3.4 Training + +The classifier $f(\cdot)$ and BiLSTM-CRF model are trained in a supervised manner, where the training signals are obtained from manually labeled (syntax tree, NL fact tree) and (syntax label sequence, location label sequence) pairs, respectively. We observe the syntax structure of different questions may be similar or even consistent. Therefore, we reduce the input space by using syntax-related information rather than NL, to relieve the manual annotation pressure and also the learning difficult. + +# 4 Experiments + +# 4.1 Dataset + +In this work, we target at studying the $n$ -ary KGQA task. Considering the popular KGQA datasets involve almost exclusively binary facts, we develop an $n$ -ary KGQA dataset: WikiPeopleQA (abbr. WP), in which questions involve multiple $n$ -ary facts and the background KG is also composed of $n$ -ary facts. We also conduct evaluation on two binary KGQA benchmarks: WC2014 (abbr. WC) (Zhang et al., 2016) and PathQuestion (abbr. PQ) (Zhou et al., 2018). Depending on the number of Facts or + +Hops involved in the question4, WikiPeopleQA is divided into WP-1F, WP-2F and WP-3F. WC2014 is divided into WC-1H and WC-2H, as well as a conjunctive question set WC-C. PathQuestion is divided into PQ-2H and PQ-3H. We partition the three datasets into train-valid/test subsets with a proportion of $8:1:1$ . The detailed statistics are shown in Table 1. + +# 4.2 Experimental Setup + +# 4.2.1 Training Details + +During training the classifier, the embedding size of node is 50, the learning rate is $1e - 5$ , and the number of GCN layers is 3. During training the BiLSTM-CRF model, the embedding size of node is 100, the learning rate is $2e - 5$ . We use Adam optimizer for optimization for above training process. The hyper-parameter $\lambda$ is set to 1.5. The training process of the KG embedding model used in the fact reasoning stage is following (Guan et al., 2020). The experimental results are all averaged across three training repetitions. + +# 4.2.2 Baselines + +We compare our framework with a series of popular multi-hop reasoning baseline approaches. According to the form of the reasoning chain, these baselines can be divided into two categories. The first category baseline builds an explicit reasoning chain through training an agent to walk on the KG: IRN-weak (Zhou et al., 2018), MINERVA (Das et al., 2018) and SRN (Qiu et al., 2020); the second category baseline builds an implicit reasoning chain through memory network or in the latent space: MemNN (Sukhbaatar et al., 2015), KV-MemNN (Miller et al., 2016) and EmbedKGQA (Saxena et al., 2020). We also compare with QGG (Lan and Jiang, 2020), which synthesizes a query graph from the question and then match the query with KG to get the answer. When + +
ModelWPWP-1FWP-2FWP-3FWCWC-1HWC-2HWC-CPQPQ-2HPQ-3H
MemNN (Sukhbaatar et al., 2015)32.934.239.612.552.471.655.573.386.889.579.2
KV-MemNN (Miller et al., 2016)24.515.040.016.076.787.087.078.885.291.579.4
EmbedKGQA (Saxena et al., 2020)26.435.422.33.552.559.679.052.036.751.030.6
IRN-weak (Zhou et al., 2018)----78.683.492.183.785.891.983.3
MINERVA (Das et al., 2018)10.920.50.30.289.687.293.182.473.175.971.2
SRN (Qiu et al., 2020)13.324.90.30.896.598.997.887.389.396.389.2
QGG (Lan and Jiang, 2020)24.941.81.10.094.094.992.999.940.467.828.9
FacTree54.463.147.040.199.599.996.399.992.898.490.8
+ +Table 2: Model Performance on $n$ -ary KGQA task (WikiPeopleQA dataset) and binary KGQA task (WC2014 and PathQuestion datasets) under the accuracy(\%) metric (pairwise t-test at 5% significance level). The best performance results are shown in **bold**, and the second best results are shown in **underlined**. + +evaluating explicit multi-hop reasoning methods and QGG, we use the dummy entity to divide $n$ -ary facts in the KG of WikiPeopleQA into binary facts. + +# 4.3 Main Results + +Performance of FacTree Table 2 presents the statistics of model's performances both on the $n$ -ary and binary KGQA tasks. We can see that FacTree achieves significantly higher accuracy than state-of-the-art baselines on the $n$ -ary KGQA task. Specifically, compared with the best performing multi-hop reasoning baseline MemNN, FacTree improves accuracy by $21.5\%$ (w.r.t., WP). We have following discoveries: + +- FacTree shows large advantages on coping with complex questions with multiple facts. On the WP-3F sub-dataset, comparing with baselines, FacTree has made a qualitative leap on accuracy (16.0→40.1). This confirms that multi-hop reasoning methods are inapplicable to more complex reasoning scenarios. +- Interestingly, the explicit multi-hop reasoning methods (e.g., SRN) are obviously weaker than implicit methods (e.g., EmbedKGQA). This is because the $n$ -ary facts are split by dummy entities, adding difficulty to build explicit reasoning chains. Implicit methods weaken the distinction between binary and $n$ -ary facts, which makes it more flexible in dealing with $n$ -ary facts. +- The QGG method directly matches the generated query graph to the KG, resulting in performing well on questions with less facts, but clearly lacking flexibility for question with more facts. + +Besides, fact-tree reasoning also achieves a good performance on binary KGQA. We observe a large performance gap between multi-hop reasoning + +![](images/d100972d0ee0a2db693a0fbea977d8b111731a6e74a61649a8638d05bbc60415.jpg) +Figure 6: Staged evaluation of FacTree. $\mathrm{FL^{*}}$ and intraFR\* denote turning off the FL and intraFR components respectively. Note that the accuracy of FacTree $(\mathrm{FL^{*} + intraFR^{*} + interFR^{*}})$ is $100\%$ . + +methods on binary and $n$ -ary KGQA tasks. Therefore, it would be valuable to pay more attention to the study of $n$ -ary KGQA. + +Staged Evaluation We test the capability of each stage of FacTree. Because the fact-tree reasoning framework is a pipeline structure, the reasoning error always occurs in cascade. We turn off the components on the pipeline from the beginning to see the impact on the overall effect. "Turn off a component" means to replace the real output with the ground truth, that is, the component is perfect by default. We test three components of FacTree: fact location (FL), intra-fact reasoning (intraFR) and inter-fact reasoning (interFR). The error caused by the fact tree construction stage is negligible here because of the relatively small number of NL fact tree types in the datasets. Figure 6 shows turning off the components in turn will lead to an accuracy increase of $22.3\%$ (FL), $18.2\%$ (intraFR) and $5.1\%$ (interFR) respectively (w.r.t., WP). Impressively, transferring the NL fact tree to KG fact tree and inferring missing entities of incomplete facts are + +![](images/30a5036236d468aa00069f72eaa0d464f9a9b07ee4058a03b315218adbf59fc1.jpg) +Figure 7: Error instances in the fact location, intra-fact and inter-fact reasoning stages, respectively. + +the two keys that affect the reasoning accuracy. Moreover, the influence of the inter-fact reasoning module becomes apparent as the number of facts increases. This is because it may happen that an entity satisfying the lower-layer fact may not be able to satisfy the upper-layer fact. For instances of errors in each module, please see Section 4.4. + +# 4.4 Analysis of FacTree + +Performance w.r.t. Incomplete KGs As the capacity of the KG continues to expand, current KGs are typically incomplete with many facts missing. Incomplete KGs put forward higher requirements on the capabilities of KGQA models. Therefore, we conduct an experiment on FacTree and two popular baselines to test their reasoning capability for incomplete KGs. As shown in Table 3, when the KG is reduced by half, the effect of our model decreases the least. This is because we adopt KG embedding models to perform intra-fact reasoning in FacTree. This design relaxes the requirements for KG completeness. SRN requires the construction of query graph or explicit reasoning chain on KG, so it is more sensitive to the incompleteness of KG. EmbedKGQA also uses KG embedding models. The performance gap between it and our FacTree corroborates the superiority of the fact-tree reasoning framework. + +Zero-shot Learning w.r.t. Classifier $f(\cdot)$ We conduct a zero-shot learning experiment to test the capability of our proposed classifier $f(\cdot)$ in the fact construction stage though a 5-fold cross validation. We evaluate the accuracy of the constructed NL fact tree on the mixed dataset combined with three datasets (WikiPeopleQA, WC2014 and PathQuestion). The mixed dataset is divided into five parts according to the NL fact tree classes. For each + +
ModelWPWP-50%WCWC-50%
SRN13.30.1 (↓99%)96.50.0 (↓100%)
EmbedKGQA26.46.5 (↓75%)52.511.0 (↓79%)
FacTree54.417.8 (↓67%)99.537.2 (↓63%)
+ +Table 3: Performance on incomplete KGs. $\downarrow$ indicates the decrease in accuracy when the KG is halved. + +
SizeOO+FO+CO+F+CO+F+C+S
Acc.52.953.963.191.491.0
+ +Table 4: Performance of different subtree range w.r.t. fact tree construction stage. "F", "C" and "S" denote the father, child and sibling nodes of the central node "O", respectively. + +fold, the fact tree classes in the testing set do not appear in the training set. Based on this setting, our classifier can reach $81.2\%$ accuracy with a standard deviation of 0.098. This indicates our classifier has the scalable ability to construct unseen fact trees. + +Effectiveness of GCN We also test the effect of the execution range of the GCN on the accuracy of the fact tree construction. The range of GCN execution is a subtree of the syntax tree containing the central node to be eliminated and its neighbor nodes. A total of five range types are tested depending on whether the father, siblings and child of the central node were included. As shown in Table 4, the optimal subtree range includes the central node and its father and child nodes. Interestingly, the addition of sibling nodes did not bring significant effect improvement. + +Error Analysis We conduct a qualitative study on error instances, as shown in Figure 7, and analysis the directions for future work. In the fact location + +stage, introducing more effective relation extraction techniques can contribute to reduce relation extraction error. In the intra-fact reasoning stage, it is necessary to improve KG embedding model's capability. There is a false negative error case. For example, the fact (Liu Cang, sibling, Liu Yan) is true, but is not included by KG, resulting in the inferred answer being judged as wrong. So, adopting broader KGs is suggested in future studies. In the inter-fact reasoning stage, entities can be incompatible when transferred between facts. Therefore, intra- and inter-factual reasoning needs to act more closely together to reduce the incompatibility. + +# 5 Conclusion + +This work highlights a more challenging task: $n$ -ary KGQA, and it advocates that the multi-hop reasoning framework popular in binary KGQA is no longer applicable to $n$ -ary KGQA. A novel fact-tree reasoning framework FacTree is proposed, which pipelines the $n$ -ary KGQA into three steps: fact tree construction, fact location, and fact reasoning to infer the correct answer. The quantitative and qualitative experimental results have demonstrated that FacTree has superior reasoning ability on $n$ -ary and binary fact questions. + +# 6 Acknowledgements + +This work was supported in part by National Natural Science Foundation of China under Grant No.62006101, and in part by the China Postdoctoral Science Foundation under Grant No.2021TQ0222 and No.2021M700094. + +# References + +Ralph Abboud, Ismail Ilkan Ceylan, Thomas Lukasiewicz, and Tommaso Salvatori. 2020. Box: A box embedding model for knowledge base completion. In Proceedings of NeurIPS. +Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic parsing on freebase from question-answer pairs. In Proceedings of EMNLP, pages 1533-1544. +Antoine Bordes, Sumit Chopra, and Jason Weston. 2014. Question answering with subgraph embeddings. In Proceedings of EMNLP, pages 615-620. +Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. 2015. Large-scale simple question + +answering with memory networks. In arXiv preprint arXiv:1506.02075. +Antoine Bordes, Nicolas Usunier, Alberto Garcia-Durán, Jason Weston, and Oksana Yakhnenko. 2013. Translating embeddings for modeling multi-relational data. In Proceedings of NeurIPS, pages 2787-2795. +Yu Chen, Lingfei Wu, and Mohammed J. Zaki. 2019. Bidirectional attentive memory networks for question answering over knowledge bases. In Proceedings of NAACL-HLT, pages 2913-2923. +Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, Luke Vilnis, Ishan Durugkar, Akshay Krishnamurthy, Alex Smola, and Andrew McCallum. 2018. Go for a walk and arrive at the answer: Reasoning over paths in knowledge bases using reinforcement learning. In Proceedings of ICLR. +Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. 2018. Convolutional 2d knowledge graph embeddings. In Proceedings of AAAI, pages 1811-1818. +Li Dong, Furu Wei, Ming Zhou, and Ke Xu. 2015. Question answering over Freebase with multi-column convolutional neural networks. In Proceedings of ACL-IJCNLP, pages 260-269. +Mohnish Dubey, Debayan Banerjee, Abdelrahman Abdelkawi, and Jens Lehmann. 2019. Lc-quad 2.0: A large dataset for complex question answering over wikidata and dbpedia. In Proceedings of ISWC, pages 69-78. +Bahare Fatemi, Perouz Taslakian, David Vazquez, and David Poole. 2019. Knowledge hypergraphs: Prediction beyond binary relations. In arXiv preprint arXiv:1906.00137. +Bin Fu, Yunqi Qiu, Chengguang Tang, Yang Li, Haiyang Yu, and Jian Sun. 2020. A survey on complex question answering over knowledge base: Recent advances and challenges. In arXiv preprint arXiv:2007.13069. +Saiping Guan, Xiaolong Jin, Jiafeng Guo, Yuanzhuo Wang, and Xueqi Cheng. 2020. NeuInfer: Knowledge inference on N-ary facts. In Proceedings of ACL, pages 6141-6151. +Saiping Guan, Xiaolong Jin, Yuanzhuo Wang, and Xueqi Cheng. 2019. Link prediction on n-ary relational data. In Proceedings of WWW, pages 583-593. +William L. Hamilton, Payal Bajaj, Marinka Zitnik, Dan Jurafsky, and Jure Leskovec. 2018. Embedding logical queries on knowledge graphs. In Proceedings of NeurIPS, pages 2030-2041. +Gaole He, Yunshi Lan, Jing Jiang, Wayne Xin Zhao, and Ji-Rong Wen. 2021. Improving multi-hop knowledge base question answering by learning intermediate supervision signals. In Proceedings of WSDM, pages 553-561. + +Xiao Huang, Jingyuan Zhang, Dingcheng Li, and Ping Li. 2019. Knowledge graph embedding based question answering. In Proceedings of WSDM, pages 105-113. +Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional lstm-crf models for sequence tagging. In arXiv preprint arXiv:1508.01991. +Magdalena Kaiser, Rishiraj Saha Roy, and Gerhard Weikum. 2021. Reinforcement learning from reformulations in conversational question answering over knowledge graphs. In Proceedings of SIGIR. +Yunshi Lan and Jing Jiang. 2020. Query graph generation for answering multi-hop complex questions from knowledge bases. In Proceedings of ACL, pages 969-974. +Percy Liang, Michael Jordan, and Dan Klein. 2011. Learning dependency-based compositional semantics. In Proceedings of ACL, pages 590-599. +Alexander Miller, Adam Fisch, Jesse Dodge, Amir Hossein Karimi, Antoine Bordes, and Jason Weston. 2016. Key-value memory networks for directly reading documents. In Proceedings of EMNLP, pages 1400-1409. +Yunqi Qiu, Yuanzhuo Wang, Xiaolong Jin, and Kun Zhang. 2020. Stepwise reasoning for multi-relation question answering over knowledge graph with weak supervision. In Proceedings of WSDM, pages 474-482. +Nils Reimers and Iryna Gurevych. 2019. Sentence-bert: Sentence embeddings using siamese bert-networks. In Proceedings of EMNLP, pages 3982-3992. +Hongyu Ren, Hanjun Dai, Bo Dai, Xinyun Chen, Michihiro Yasunaga, Haitian Sun, Dale Schuurmans, Jure Leskovec, and Denny Zhou. 2021. Lego: Latent execution-guided reasoning for multi-hop question answering on knowledge graphs. In Proceedings of ICML, pages 8959-8970. +Hongyu Ren and Jure Leskovec. 2020. Beta embeddings for multi-hop logical reasoning in knowledge graphs. In Proceedings of NeurIPS. +Apoory Saxena, Aditay Tripathi, and Partha Talukdar. 2020. Improving multi-hop question answering over knowledge graphs using knowledge base embeddings. In Proceedings of ACL, pages 4498-4507. +Sainbayar Sukhbaatar, arthur szlam, Jason Weston, and Rob Fergus. 2015. End-to-end memory networks. In Proceedings of NeurIPS, pages 2440-2448. +Yawei Sun, Lingling Zhang, Gong Cheng, and Yuzhong Qu. 2020. Sparqa: Skeleton-based semantic parsing for complex questions over knowledge bases. In Proceedings of AAAI, pages 8952-8959. + +Quan Wang, Haifeng Wang, Yajuan Lyu, and Yong Zhu. 2021. Link prediction on n-ary relational facts: A graph-based approach. In Proceedings of Findings of ACL-IJCNLP, pages 396-407. +Jianfeng Wen, Jianxin Li, Yongyi Mao, Shini Chen, and Richong Zhang. 2016. On the representation and embedding of knowledge bases beyond binary relations. In Proceedings of IJCAI, pages 1300-1307. +Tomer Wolfson, Mor Geva, Ankit Gupta, Matt Gardner, Yoav Goldberg, Daniel Deutch, and Jonathan Berant. 2020. Break It Down: A Question Understanding Benchmark. In TACL Journal, volume 8, pages 183-198. +Wen-tau Yih, Xiaodong He, and Christopher Meek. 2014. Semantic parsing for single-relation question answering. In Proceedings of ACL, pages 643-648. +Mo Yu, Wenpeng Yin, Kazi Saidul Hasan, Cicero dos Santos, Bing Xiang, and Bowen Zhou. 2017. Improved neural relation detection for knowledge base question answering. In Proceedings of ACL, pages 571-581. +Jing Zhang, Bo Chen, Lingxi Zhang, Xirui Ke, and Haipeng Ding. 2021. Neural-symbolic reasoning on knowledge graphs. In AI Open Journal. +Liwen Zhang, John Winn, and Ryota Tomioka. 2016. Gaussian attention model and its application to knowledge base embedding and question answering. In arXiv preprint arXiv:1611.02266. +Richong Zhang, Junpeng Li, Jiajie Mei, and Yongyi Mao. 2018a. Scalable instance reconstruction in knowledge bases via relatedness affiliated embedding. In Proceedings of WWW, pages 1185-1194. +Yuyu Zhang, Hanjun Dai, Zornitsa Kozareva, Alexander Smola, and Le Song. 2018b. Variational reasoning for question answering with knowledge graph. In Proceedings of AAAI, pages 6069-6076. +Mantong Zhou, Minlie Huang, and Xiaoyan Zhu. 2018. An interpretable reasoning network for multi-relation question answering. In Proceedings of ACL, pages 2010-2022. + +# A Methodology Details + +# A.1 NL Fact Tree Construction Algorithm + +The construction of NL fact tree is summarized in Algorithm 1. The input is the NL question and two empty node stacks. The output is the NL fact tree. We initialize the NL fact tree as a syntax tree, which is parsed from Q (Line 2). One of the empty node stack $\mathbb{V}$ stores the nodes of FT in the order of breadth first searching (Line 3). The other stack $\mathbb{V}'$ reverse this order in Line 4-10, so that the pruning (Line 12-22) is from the the bottom to the top as well as from the right to the left. The entire + +![](images/4db81556be0b9b674eed5396119166719bac0c5afc933017c21f42710271084d.jpg) +Figure 8: The fact combination modes. + +elimination process does not involve the leaf nodes and their parents nodes (Line 6-10). + +# A.2 Score Amplification Mechanism + +We devise a simple method to evaluate whether an entity is able to satisfy the upper-layer fact. For an entity $e$ , the related predicate or attribute in the upper-layer fact is $p$ or $a$ . We retrieve in KG, whether there is an fact of entity $e$ associated with $p$ or $a$ . If there is, then we consider that entity $e$ is satisfying the upper-layer fact, and vice versa. + +# B Experimental Details + +# B.1 Dataset Construction + +In this work, we develop an $n$ -ary KGQA dataset: WikiPeopleQA, in which questions involve multiple $n$ -ary facts and the background KG is also composed of $n$ -ary facts. The specific construction process is as follows: + +i) We selected WikiPeople (Guan et al., 2019) as the background KG. This $n$ -ary KG is constructed based on Wikidata5 and consists of character facts, e.g., Marie Curie received Nobel Prize in Chemistry in 1911. +ii) To build complex questions involving multiple facts, we set the maximum number of facts in a question to three, and set four fact combinations modes in advance, as shown in Figure 8. As the number of facts increases, the fact combination mode becomes more complicated. +iii) Based on the fact combination modes, we sampled a large number of fact combinations from KG. We masked off the entities in the fact combinations, and extracted the frequently occurring fact combinations. We transformed the frequent fact combinations to question templates. Here we have constructed a total of 33 question templates, listed in Table 5. + +iv) We populated the entities into the question templates according to KG. Inspired by the construction process of PathQuestion (Zhou et al., 2018), in order to enrich the problematic syntactic structure and surface wording, we replaced the phrases and words in the question with synonyms. + +Due to the limitation of fact diversity in WikiPeople, we only considered three facts at most. In order to contribute to the progress of $n$ -ary KGQA research, it is necessary to increase the richness of the facts to improve the question complexity. Therefore, developing more complex $n$ -ary KGQA datasets and evaluating FacTree on more datasets are our future research directions. + +# B.2 Baselines + +We compare our framework with a series of baselines. The following is a detail description of the baselines: + +- MemNN (Sukhbaatar et al., 2015): This model adopts an memory network to store all KG facts or related Wikipedia documents in the memory units. Three embedding matrices are employed to convert the memory information and questions into vectors for similarity calculation. +- KV-MemNN (Miller et al., 2016): This model is based on MemNN. Instead of considering the whole KG facts like MemNN, it firstly stores facts in a key-value structured memory. The key-value structure is suitable for binary facts, but not for $n$ -ary facts. +- EmbedKGQA (Saxena et al., 2020): This model follows the basic multi-hop reasoning framework and utilizes KG embedding methods to alleviate the negative impact of KG incompleteness. +- IRN-weak (Zhou et al., 2018): This model considers the whole path from the topic entity to the answer entity. It focuses on finding a path to the answer, so IRN needs a pre-labelled path record during training process. +MINERVA (Das et al., 2018): This model uses reinforcement learning technique to perform multi-hop reasoning on KG. Taking the input natural language question, this model averages the word embeddings as the question embedding, and then walks on KG under the supervision of the question embedding, and finally arrives at the answer entity. + +- SRN (Qiu et al., 2020): This model uses RL method to perform multi-hop reasoning on KG. It proposes a potential-based reward shaping strategy to alleviate the delayed and sparse reward problem caused by weak supervision. +- QGG (Lan and Jiang, 2020): This model generates a modified staged query graph to deal with complex questions with both multi-hop relations and constraints. + +Here we explain the source of the results in Table 2. On the WikiPeopleQA dataset, for each baseline, we run the source code of each baseline that is open source or reproduced by developers. + +- MemNN: https://github.com/berlin no/MemNN (reproduced) +KV-MemNN: https://github.com/lc2 22/ key-value-MemNN (reproduced) +- EmbedKGQA: https://github.com/mallabiisc/EmbedKGQA (open source) +MINERVA: https://github.com/shehzaadzd/MINERVA (open source) +- SRN: https://github.com/DanSeb1295/multi-relation-QA-over-KG(reproduced) +- QGG: https://github.com/lanyunshi/Multi-hopComplexKBQA (open source) + +IRN-weak needs the pre-labelled path records for training, which is not applicable to the $n$ -ary KGQA task. So we do not evaluate IRN-weak. + +For two binary KGQA datasets WC2014 and PathQuestion, the results of EmbedKGQA and QGG are obtained by our own tests. Other baseline results all cited from (Qiu et al., 2020). + +# B.3 Training Details + +Note that in the NL fact tree, there is overlap between facts. When we construct the (syntax tree, NL fact tree) training samples, the overlap will be maintained in the lower-layer fact if it belongs to the primary triple, and in the upper-layer fact if the overlap belongs to the auxiliary description. For example, in Figure 2, the overlapping part of fact 1 and fact 2 "an NBA team" belongs to the primary triple, so it is maintained in fact 2. Conversely, "in the year" is the auxiliary description and is maintained in fact 3. + +# C Example of NL Fact Tree Construction + +Here we display a visual example of the NL fact tree construction with the question Who joined an NBA team in Los Angeles in the year the Warriors won the NBA championship. + +Firstly, we use the Stanford Parser to generate the syntax tree (cf. Figure 9). Then we preprocess the syntax tree (cf. Figure 10) to reduce the subsequent elimination operations according to the following rules: + +- Pruning the punctuation node and its parent node, e.g., node “?” and “.” + +- If all the grandchildren of a NP node are leaf nodes (more than one), we prune the parents, and combine the grandchildren to a unified leaf node, whose parent is changed to the NP node. For example, the NBA and championship in Figure 9 are combined as the NBA championship, whose parent is "NP". + +- If a node has only one child and only one grandchild, which is a leaf node, we remove the child node and let the leaf node be the only child of this node. For example, who in Figure 9 will be connected directly to its grandfather node WHNP. + +Next we start eliminating nodes from the the bottom to the top as well as from the right to the left. Note that we start the elimination operation from the third-to-last layer of the tree. For each selected node, we extract a subtree that contains this node (colored in red) and its neighbor nodes (colored in blue). This subtree is fed into a classifier. The output of the classifier determines whether to eliminate this node. Figure 12 shows the specific elimination process. The previously selected node will no longer be selected, e.g., the node "SBAR" in Figure 12 (f). + +After the elimination process, we delete non-leaf nodes and retain the hierarchical structure of leaf nodes. For the continuous nodes in the lower-layer, set a common placeholder node in the upper-layer. For example, the continuous nodes a team, in and Los Angeles in Figure 12 (j) will be connected to a common placeholder node (i.e., the blue node in Figure 11). The interrogative pronouns, e.g., who are also replaced directly with placeholders. Now, the NL fact tree is constructed (see Figure 11). It satisfies 1) the leaf nodes are words or phrases of the question; and 2) if the leaf nodes share the same parent, they belong to the same fact. + +![](images/15a94016a222764239ddef533aab04e05eb4a2d66956dcfc577bb8e2c2073517.jpg) +Figure 9: Syntax tree. + +![](images/104737db8b62563441dabf02eae854a0a3184350efa626dae8606c99bcad54dc.jpg) +Figure 10: Syntax tree after preprocessing. + +![](images/4d3579d7ad2612c95f381cce0a2a11ca3fda7adde9966bbd1d8f5fc1eb2c9c8d.jpg) +Figure 11: NL fact tree. The red, blue and purple blank nodes are placeholder nodes. + +![](images/e9235a2b0f6721acec42cc79d5d5bd4865f295905207e2c55975b65fd47dd91e.jpg) +(a) VP is eliminated. + +![](images/4291d56a897a5e256792769a72909b9477113cbf6238ae871845d061d495320c.jpg) +(b) SBAR is retained. + +![](images/d69fc09983eaa309362eb3ebb73b093722cf9992129d24da7528dc87003857fa.jpg) +(c) NP is eliminated. + +![](images/b0879b4a7787d920de8b69e328a841928fc28f831da6cc1958fc862098501ece.jpg) +(d) PP is eliminated. + +![](images/bd6cf93232aef2bbc19b21c33c16ecbb293c5762155edbf225912cd520ba49fe.jpg) +(e) PP is eliminated. + +![](images/8e9dbab961dea2cfdfed671b8f140339cb114151fcddb91a48d6e9870ecafa36.jpg) +(f) NP is retained. + +![](images/26997144893bd28d0cffbb249e4f4ba1ac19f58cec59422cce53f0d3c0667a0b.jpg) +(g) VP is eliminated. + +![](images/a02cd333dceade008ddc4f543e17002078f13d6d5989bc118b65005864f94faa.jpg) +(h) SQ is eliminated. + +![](images/2ebde60814390fceaf59671096da6f17123288d501b063766605fdb1e7c560d4.jpg) +(i) SBARQ is eliminated. +Figure 12: Node elimination process. + +![](images/d4d7ee8bdd4dcef3096ea32006a4581aedf141dee3e838be6c31634b07504a68.jpg) +(j) Elimination ends. + +
IDTemplateMode
1who win {} award in the time {}.1
2who is sibling of {}.1
3what is the profession of {}.1
4what is the country of {}.1
5what political party did {}. join1
6who is the spouse of {}.1
7what is the gener of {}.1
8who was educated at {}. until {}.1
9when did {}. die1
10where was {}. born in1
11who work at the place {}.1
12who was nominated for the prize {}. in the time {}.1
13who is the mother of whose father is {}.2
14who is the father of whose mother is {}.2
15who win award {}. in the time when {}. win the {}.2
16who is the father of who has ever won {}.2
17who is the child of who has ever won {}.2
18who was nominated for {}. in the time when {}. win the {}.2
19what political party did the father of {}. join2
20what is the profession of the person who has ever won the {}.2
21who died in the place where {}. born in2
22who born in the place where {}. died in2
23which field did the person who has ever educated at {}. work for2
24who is the spouse of the person who born in {}.2
25who is the father of the person who born in {}.2
26what is the country of the person whose father is the one has ever won the prize {}.3
27who born in the place where the father of {}. died in3
28who died in the place where the mother of {}. born in3
29who was educated at the school where the person who won the prize {}. was also educated at3
30who is the child of the person whose father is the one who is the sibling of {}.3
31who work in the field that the person from the country {}. work for3
32who join the political party that the person from the country {}. has erver joined3
33when did the person from {}. won the prize that {}. has ever won4
34who joined a team in {}. in the year {}. won the NBA championship4
+ +Table 5: List of question templates and their fact combination mode. The curly braces \{\} indicate the entities to be filled. \ No newline at end of file diff --git a/facttreereasoningfornaryquestionansweringoverknowledgegraphs/images.zip b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ffbd913c5a5ec40643d0712b2bc50ea7efda88d7 --- /dev/null +++ b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efbfb7837d6bd700a06d299058416ea50048a2d6fc16e697cc57ffd070d143a6 +size 915075 diff --git a/facttreereasoningfornaryquestionansweringoverknowledgegraphs/layout.json b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7b1a8e7e9e1e8aa003ce621250f5244b601cc8e9 --- /dev/null +++ b/facttreereasoningfornaryquestionansweringoverknowledgegraphs/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:938ef3515b2f97d7e35a1133ec1b3ff7742ce9baed4450bbcc8c0e647646d4eb +size 509756 diff --git a/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_content_list.json b/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cf3a9c97838e8ca2b11f61c550227471906402fb --- /dev/null +++ b/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49ab8191bc0919b62ce6777ef2ce58b8ca5e8ad77385977791dfd6a5e9a283c2 +size 40300 diff --git a/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_model.json b/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..efb79f0680c2d7b70a2ec13a6589045bf105da4f --- /dev/null +++ b/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4bb90d74ab6e7dd4302be2c19b812fb1ccf6c72b0f3d765ee5e23b09757ecc8 +size 50755 diff --git a/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_origin.pdf b/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cc26eb3b58f3fde26e47c47ee06177ac04819ef0 --- /dev/null +++ b/factualconsistencyofmultilingualpretrainedlanguagemodels/3b728385-8718-412a-93fa-79694c8784e2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:957ca29c18ccb8a7ee91024a0cb30984b6325a856f2564a60e7fc4ca00d813fa +size 3033671 diff --git a/factualconsistencyofmultilingualpretrainedlanguagemodels/full.md b/factualconsistencyofmultilingualpretrainedlanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b590789e54b03826f5bd273027737ed90b9ea1a5 --- /dev/null +++ b/factualconsistencyofmultilingualpretrainedlanguagemodels/full.md @@ -0,0 +1,137 @@ +# Factual Consistency of Multilingual Pretrained Language Models + +Constanza Fierro Anders Søgaard + +University of Copenhagen + +{c.fierro,soegaard}@di.ku.dk, + +# Abstract + +Pretrained language models can be queried for factual knowledge, with potential applications in knowledge base acquisition and tasks that require inference. However, for that, we need to know how reliable this knowledge is, and recent work has shown that monolingual English language models lack consistency when predicting factual knowledge, that is, they fill-in-the-blank differently for paraphrases describing the same fact. In this paper, we extend the analysis of consistency to a multilingual setting. We introduce a resource, MPARAREL1, and investigate (i) whether multilingual language models such as mBERT and XLM-R are more consistent than their monolingual counterparts; and (ii) if such models are equally consistent across languages. We find that mBERT is as inconsistent as English BERT in English paraphrases, but that both mBERT and XLM-R exhibit a high degree of inconsistency in English and even more so for all the other 45 languages. + +# 1 Introduction + +Pretrained Language Models (PLMs) enable high-quality sentence and document representations (Peters et al., 2018; Devlin et al., 2019; Yang et al., 2019; Raffel et al., 2020) and encode world knowledge that can be useful for downstream tasks, e.g. closed-book QA (Roberts et al., 2020), and commonsense reasoning (Zellers et al., 2019; Talmor et al., 2019), to name a few. Recent work has used language models as knowledge bases (Petroni et al., 2019; Kassner et al., 2021a; Roberts et al., 2020) and as the basis of neural databases (Thorne et al., 2021). Such usage of PLMs relies on the assumption that we can generally trust the world knowledge that is induced from these models. + +Consistency is a core quality that we would like models to have when we use their stored factual knowledge. We want models to behave consistently + +on semantically equivalent inputs (Elazar et al., 2021), and to be consistent in their believes (Kassner et al., 2021b). Moreover we want them to be fair across languages or in other words to exhibit a consistent behaviour across languages (Choudhury and Deshpande, 2021). Nonetheless, recent work on consistency in PLMs has shown that models are brittle in their predictions when faced to irrelevant changes in the input (Gan and Ng, 2019; Ribeiro et al., 2020; Elazar et al., 2021; Ravichander et al., 2020). These works only considered English PLMs, while Jang et al. (2021) studied the consistency of Korean PLMs. There are, to the best of our knowledge, no resources available to measure the consistency of multilingual PLMs. + +Contributions In this paper, we present MPARALREL, a multilingual version of the PARAREL dataset (Elazar et al., 2021), which we construct by automatically translating the English data to 45 languages and performing a human review of 11 of these. We then evaluate how consistent mBERT is in comparison to its monolingual counterpart, and we study how the consistency of mBERT and XLM-R varies across different languages. Following previous work, we do this by querying the model with cloze-style paraphrases, e.g. "Albert Einstein was born in [MASK]" and "Albert Einstein is originally from [MASK]". We find that mBERT and XLM-R exhibit competitive consistency to English BERT, but consistency numbers are considerably lower for other languages. In other words, while consistency is a serious problem in PLMs for English (Elazar et al., 2021), it is a much bigger problem for other languages. + +# 2 Probing Consistency + +We use the same probing framework as defined by Petroni et al. (2019) and refined by Elazar et al. (2021), and query PLMs with cloze-test statements created from subject-relation-object Wiki + +data triples (Elsahar et al., 2018). That is, we have a set of different relations $\{r\}$ , and each $r$ has a set of templates or patterns $\{t\}$ and a set of subject-object tuples $\{(s,o)\}$ . Each template $t$ describes its corresponding relation $r$ between the pairs $(s,o)$ . E.g. a relation $r$ can be born-in, and two patterns could be $\{t_1 = {}^{\prime \prime}[\mathrm{X}]$ was born in [Y]' $t_2 = {}^{\prime \prime}[\mathrm{X}]$ is originally from [Y]''\} (where [X] is the subject and [Y] the object to be replaced). Then the corresponding subject-object tuples $\{(s,o)\}$ are used to query and evaluate the model by replacing the subject and masking the object. We study the consistency of a PLM by querying it with cloze-test paraphrases and measuring how many of the predictions of the paraphrases are the same (details in §4). + +# 3 MPARAREL + +We used the paraphrases in the PARAREL dataset (Elazar et al., 2021), which has 38 relations in total and an average of 8.6 English templates per relation. We translated these using the procedure below, obtaining paraphrases for 46 languages. + +Translations We relied on five different machine translation models: Google Translate $^2$ , Microsoft Translator $^3$ , a pretrained mBART model that translates between 50 languages (Tang et al., 2020), a pretrained mixture of Transformers that translates between 100 languages (Fan et al., 2021), and OPUS-MT (Tiedemann and Thottingal, 2020). We fed models with templates, e.g., "[X] died in [Y]" $^4$ , automatically checking if the translation contained [X] and [Y]. We considered as valid: (1) translated paraphrases that were agreed upon by two or more different models, and (2) the translations from the Microsoft translator, as they were found to be of good quality in several languages as per manual inspection by native speakers. So for languages that Microsoft supports, we will have a template $t$ from the Microsoft translator, as well as any other translation agreed upon by two or more other translators $^5$ . Finally, we also include the templates in the mLAMA dataset (Kassner et al., 2021a). Translations of subject-object entities were obtained from WikiData, using the entity identifiers. We kept only the languages that (i) covered at least $60\%$ of the + +
MPARAREL
Average #relations37.13
Average total #patterns343
Min. patterns in a relation2
Max. patterns in a relation33
Average patterns in a relation9.2
Average string distance13.9
+ +Table 1: MPARREL statistics across languages. + +![](images/55ec8636630fb4c2726f1c575b8a47dfdc1d1df03a0db84723a88dd4ae8f86ef.jpg) +Figure 1: Number of examples per language. Manually reviewed languages are underlined. The order is given by the consistency results (see Figure 2). + +total 38 relations, $^{6}$ , and (ii) covered at least $20\%$ of the total original phrases in English. $^{7}$ + +Human Evaluation For assessing the quality of the translated paraphrases we carried out a human review. We had 14 native speakers review 11 different languages8. Each person reviewed a $50\%$ random sample of the total templates of the language9. We asked whether the template was a correct paraphrase of the given relation, we requested corrections and optionally asked for new template suggestions. On average, $16\% \pm 8\%$ of the reviewed templates were considered wrong, $20\% \pm 10\%$ were amended, and the rest were considered correct. The statistics of the dataset after removing the wrong templates and including the corrections and suggestions can be found in Table 1. The total number of different phrases (templates with the subject and object replaced) per language is shown in Figure 1. + +# 4 Experiments + +We ran experiments with mBERT (Devlin et al., 2019), a multilingual BERT model of 110M parameters trained on 104 languages using Wikipedia, and XLM-RoBERTa (Conneau et al., 2020), a multilingual RoBERTa model of 560M parameters trained on 100 languages using 2.5TB of Common-Crawl data. + +Querying Language Models The prediction of a PLM for a cloze statement $t$ is normally $\arg \max_{w\in V}(w|t)$ (Petroni et al., 2019; Ravichander et al., 2020), that is, the top-1 token prediction over the vocabulary. However, Kassner et al. (2021a); Elazar et al. (2021) used typed queries, where the prediction is $\arg \max_{w\in C}(w|t)$ , with $C$ a set of candidates that meets the type criteria of the pattern (e.g. cities, professions). In our case, $C$ is all the possible objects in the relation. The motivation is that by restricting the output we can reduce the errors due to surface fluency, as when populating the template with different tuples small grammatical errors can occur (Kassner et al., 2021a). + +It is common to only consider tuples (subject-object) for which the to-be-masked object is a single token in the models vocabulary (Petroni et al., 2019; Elazar et al., 2021). However, this reduces the number of valid tuples severely, and even more so when dealing with multilingual vocabularies. Therefore, we follow the multi-token prediction approach in Kassner et al. (2021a) and query the model with multiple masked tokens. The probability of an object instantiation is then the average probability of its tokens, i.e., for a given object $o = w_{1}w_{2}\dots w_{l}$ , $p(o|t) = \frac{1}{l}\sum_{i=1}^{l}p(m_{i} = w_{i}|t_{l})$ , where $w_{i}$ is the $i$ -th token of the word $o$ , $m_{i}$ is the $i$ -th mask token, and $t_{l}$ is the template with $l$ mask tokens. + +Evaluation For a given relation $r$ the consistency is the percentage of pairs of templates that have the same prediction for every subject-object tuple (Elazar et al., 2021), i.e. the consistency of a given relation $r$ is: + +$$ +\frac {1}{| D |} \sum_ {d \in D} \frac {2}{| T | (| T | - 1)} \sum_ {i = 0} ^ {| T |} \sum_ {j = i + 1} ^ {| T |} \mathbb {1} _ {f \left(t _ {i} ^ {d}\right) = f \left(t _ {j} ^ {d}\right)} \tag {1} +$$ + +where $t$ is a template, $T$ the set of templates in the relation, $d$ is a subject-object tuple, $D$ the set of all tuples, so $t_i^d$ is the $i$ -th template populated with the subject-object data $d$ , and $f(\cdot)$ is the prediction of the model. Next, accuracy measures the factual correctness of the predictions and is defined as the percentage of correct predictions over all the templates and data, i.e. $\sum_{d \in D} \sum_{t \in T} \mathbb{1}_{f(t^d) = o}$ , where $o$ is the object of the tuple $d$ . Finally, consistency-accuracy is the subset of the accurate predictions that is also consistent. Thus, it is computed similarly to Equation 1 but in the indicator's condition we also add the condition imposed in the accuracy. + +
MetricBERTmBERT
enenjazh-hans
Consistencyw/.0.570.540.550.46
w/o .0.530.530.520.51
Accuracyw/.0.390.370.130.22
w/o .0.320.350.150.27
Consistency-accw/.0.320.30.090.15
w/o .0.240.280.10.2
+ +Table 2: Performance comparison of BERT to mBERT, as well as of removing sentence-final punctuation in our input examples, with mBERT results on English, Japanese, and Chinese Simplified. + +This metric is useful to account for trivial cases of consistency: A model can be really bad in a language and predict the same token despite the input, and thus be perfectly consistent. For all metrics, we report the macro average across relations. $^{10}$ + +# 5 Results and Discussion + +Table 2 compares the consistency of BERT and mBERT on English data, showing little to no difference, depending on whether we use sentence-final punctuation or not. Sentence-final punctuation is not fully consistent in the machine translation output, so we ran experiments comparing the performance of including sentence-final punctuation or removing it. Since languages vary in how they use punctuation, and sentence-final punctuation causes variance in consistency (e.g., Japanese +3%, but Chinese Simplified -5%), we decided to remove all sentence-final punctuation for the cross-lingual consistency results. + +Consistency across languages The consistency results in the MPARAREL dataset are presented in Figure 2. First of all, we can see that the manual corrections don't change the results much (as also experienced by Kassner et al. (2021a)). Nevertheless, they do improve the consistency and accuracy by $1\% - 2\%$ in a couple of languages, probably because some noise was reduced when correcting and adding new templates. Consistency numbers remain very low, however, especially for other languages than English and Vietnamese. XLM-R is much more consistent than mBERT in some languages (e.g. Greek ('el')), yet their average consistency is the same (0.43). The standard deviation of XLM-R's consistency is $8\%$ lower than that of mBERT, i.e., XLM-R has a more fairly + +![](images/56f14f5c51b3bca8ef74a775f75a4cf8af252cba79001fec04593d6b3e02864f.jpg) +Figure 2: mBERT and XLM-R results on MPARAREL after and before the human review (§3). The order of the languages follows the consistency results in mBERT, and the languages underlined were manually reviewed. + +distributed consistency. Somewhat surprisingly, the accuracy of mBERT is superior to XLM-R's, nevertheless, this aligns to the findings of Elazar et al. (2021) where English base BERT obtained higher accuracy than a large English RoBERTa model. We note the importance of controlling for accuracy in our consistency results (reported as consistency-accuracy): Japanese, for example, has high consistency, but in part, because it wrongly predicts the same (frequent) token across paraphrases; consistency-accuracy reranks Japanese as one of the most inconsistently encoded languages in both mBERT and XLM-R. + +# 6 Related Work + +Petroni et al. (2019); Davison et al. (2019) first studied to what extent PLMs store factual and commonsense knowledge, proposing the LAMA probe and dataset. Then further analysis followed it, Kassner and Schütze (2020) studied probing PLMs factual knowledge on negated sentences, Shin et al. (2020); Reynolds and McDonell (2021); Jiang et al. (2020b) optimized the prompts so to improve the knowledge retrieval, and Bouraoui et al. (2020); Heinzerling and Inui (2021) explored other + +approaches different than the cloze-test probing. Then, Kassner et al. (2021a); Jiang et al. (2020a) studied the knowledge memorized in multilingual PLMs, presenting the mLAMA dataset which is a translated version of LAMA. + +Consistency in PLMs has been studied in English. Gan and Ng (2019) created a paraphrased version of SQuAD and showed that the state-of-the-art models had a significant decrease in performance, Ribeiro et al. (2020) proposed a framework to test the robustness in the predictions when faced with irrelevant changes in the input. Elazar et al. (2021); Ravichander et al. (2020) showed that monolingual English PLMs are inconsistent in fill-in-the-blank phrases. Then, Newman et al. (2021) proposed using adapters to better handle this inconsistency. + +There are paraphrase datasets available in English (Dolan and Brockett, 2005; Quora, 2012) and in multiple languages (Ganitkevitch and Callison-Burch, 2014), but they cannot be easily linked to subject-object tuples in order to measure consistency. + +# 7 Conclusion + +In this work, we measured the consistency of multilingual Pretrained Language Models when queried to extract factual knowledge. We constructed a high-quality multilingual dataset containing 46 different languages, to assess the consistency of models predictions in the face of language variability. Finally, we experimented with mBERT and XLM-R and concluded that their consistency is poor in English, but even worse in other languages. + +# Acknowledgements + +We thank Laura Cabello, Stephanie Brandl, Yova Kementchedjhieva, Daniel Hershcovich, Emanuele Bugliarello, Katerina Margatina, Karolina Stanczak, Ilias Chalkidis, Ruixiang Cui, Rita Ramos, Stella Frank, and Stephanie Brandl for their time and effort invested in reviewing the translations, and the members of the CoAStaL NLP group and the anonymous reviewers for their helpful suggestions. + +# References + +Zied Bouraoui, Jose Camacho-Collados, and Steven Schockaert. 2020. Inducing relational knowledge from bert. Proceedings of the AAAI Conference on Artificial Intelligence, 34(05):7456-7463. +Monojit Choudhury and Amit Deshpande. 2021. How linguistically fair are multilingual pre-trained language models? Proceedings of the AAAI Conference on Artificial Intelligence, 35(14):12710-12718. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. 2020. Unsupervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8440-8451, Online. Association for Computational Linguistics. +Joe Davison, Joshua Feldman, and Alexander Rush. 2019. Commonsense knowledge mining from pretrained 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 1173-1178, Hong Kong, China. Association for Computational Linguistics. +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. +William B. Dolan and Chris Brockett. 2005. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005). +Yanai Elazar, Nora Kassner, Shauli Ravfogel, Abhilasha Ravichander, Ed Hovy, Hinrich Schutze, and Yoav Goldberg. 2021. Measuring and improving consistency in pretrained language models. *ArXiv*, abs/2102.01017. +Hady Elsahar, Pavlos Vougiouklis, Arslen Remaci, Christophe Gravier, Jonathon Hare, Frederique Laforest, and Elena Simperl. 2018. T-REx: A large scale alignment of natural language with knowledge base triples. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA). +Angela Fan, Shruti Bhosale, Holger Schwenk, Zhiyi Ma, Ahmed El-Kishky, Siddharth Goyal, Mandeep Baines, Onur Celebi, Guillaume Wenzek, Vishrav Chaudhary, et al. 2021. Beyond english-centric multilingual machine translation. Journal of Machine Learning Research, 22(107):1-48. +Wee Chung Gan and Hwee Tou Ng. 2019. Improving the robustness of question answering systems to question paraphrasing. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6065-6075, Florence, Italy. Association for Computational Linguistics. +Juri Ganitkevitch and Chris Callison-Burch. 2014. The multilingual paraphrase database. In *The 9th edition of the Language Resources and Evaluation Conference*, Reykjavik, Iceland. European Language Resources Association. +Benjamin Heinzerling and Kentaro Inui. 2021. Language models as knowledge bases: On entity representations, storage capacity, and paraphrased queries. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 1772-1791, Online. Association for Computational Linguistics. +Myeongjun Jang, Deuk Sin Kwon, and Thomas Lukasiewicz. 2021. Accurate, yet inconsistent? consistency analysis on language understanding models. arXiv preprint arXiv:2108.06665. +Zhengbao Jiang, Antonios Anastasopoulos, Jun Araki, Haibo Ding, and Graham Neubig. 2020a. X-FACTR: Multilingual factual knowledge retrieval from pretrained language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5943-5959, Online. Association for Computational Linguistics. + +Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. 2020b. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423-438. +Nora Kassner, Philipp Dufter, and Hinrich Schütze. 2021a. Multilingual LAMA: Investigating knowledge in multilingual pretrained language models. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 3250-3258, Online. Association for Computational Linguistics. +Nora Kassner and Hinrich Schütze. 2020. Negated and misprimed probes for pretrained language models: Birds can talk, but cannot fly. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7811-7818, Online. Association for Computational Linguistics. +Nora Kassner, Oyvind Tafjord, Hinrich Schütze, and Peter Clark. 2021b. BeliefBank: Adding memory to a pre-trained language model for a systematic notion of belief. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8849-8861, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Benjamin Newman, Prafulla Kumar Choubey, and Nazneen Rajani. 2021. P-adapters: Robustly extracting factual information from language models with diverse prompts. arXiv preprint arXiv:2110.07280. +Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. 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 2227-2237, New Orleans, Louisiana. Association for Computational Linguistics. +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. +Quora. 2012. Quora question pairs dataset. https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs. [Online; accessed 10-November-2021]. +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. + +Abhilasha Ravichander, Eduard Hovy, Kaheer Suleman, Adam Trischler, and Jackie Chi Kit Cheung. 2020. On the systematicity of probing contextualized word representations: The case of hypernymy in BERT. In Proceedings of the Ninth Joint Conference on Lexical and Computational Semantics, pages 88-102, Barcelona, Spain (Online). Association for Computational Linguistics. +Laria Reynolds and Kyle McDonell. 2021. Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigm. Association for Computing Machinery, New York, NY, USA. +Marco Tulio Ribeiro, Tongshuang Wu, Carlos Guestrin, and Sameer Singh. 2020. Beyond accuracy: Behavioral testing of NLP models with CheckList. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4902-4912, Online. Association for Computational Linguistics. +Adam Roberts, Colin Raffel, and Noam Shazeer. 2020. How much knowledge can you pack into the parameters of a language model? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5418-5426, Online. Association for Computational Linguistics. +Taylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace, and Sameer Singh. 2020. *AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts*. In *Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)*, pages 4222-4235, Online. Association for Computational Linguistics. +Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. 2019. CommonsenseQA: A question answering challenge targeting commonsense knowledge. 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 4149-4158, Minneapolis, Minnesota. Association for Computational Linguistics. +Yuqing Tang, Chau Tran, Xian Li, Peng-Jen Chen, Naman Goyal, Vishrav Chaudhary, Jiatao Gu, and Angela Fan. 2020. Multilingual translation with extensible multilingual pretraining and finetuning. arXiv preprint arXiv:2008.00401. +James Thorne, Majid Yazdani, Marzieh Saeidi, Fabrizio Silvestri, Sebastian Riedel, and Alon Halevy. 2021. From natural language processing to neural databases. Proc. VLDB Endow., 14(6):1033-1039. +Jörg Tiedemann and Santhosh Thottingal. 2020. OPUSMT - building open translation services for the world. In Proceedings of the 22nd Annual Conference of the European Association for Machine Translation, pages 479-480, Lisboa, Portugal. European Association for Machine Translation. + +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. +Rowan Zellers, Yonatan Bisk, Ali Farhadi, and Yejin Choi. 2019. From recognition to cognition: Visual commonsense reasoning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6720-6731. \ No newline at end of file diff --git a/factualconsistencyofmultilingualpretrainedlanguagemodels/images.zip b/factualconsistencyofmultilingualpretrainedlanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ce7d40639ed4178ac9d8c0908746d5f3e3255692 --- /dev/null +++ b/factualconsistencyofmultilingualpretrainedlanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8e97d8069e53b62babd8c4e074cf7bf67ffefc57af9250f5049fee92365f3fa +size 180144 diff --git a/factualconsistencyofmultilingualpretrainedlanguagemodels/layout.json b/factualconsistencyofmultilingualpretrainedlanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f92689ac2b226cb8fcfee4aa62e7b92fb9b997b0 --- /dev/null +++ b/factualconsistencyofmultilingualpretrainedlanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:543ca1550ec4804ad3b0d11d11ea501cba704cf781653a59e8f74fedf0e05f50 +size 205559 diff --git a/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_content_list.json b/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6421d27f36d0656aa9f855e68cdae1f1d325fc5a --- /dev/null +++ b/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79dde92ba019f965c7e9308e1f3de570fa879e36af8415329a9a609aab7d3de0 +size 75014 diff --git a/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_model.json b/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5b2cae284f83604c0f6d4eb25959a55a06a5436c --- /dev/null +++ b/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a748ec4ec5dd3f7a6f372b50c23b38046d654d48a3f5659dbc1187c3b9e0809a +size 92663 diff --git a/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_origin.pdf b/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e52fb9a122ff972a5dd9d23d4a2ab6eb5296bfc1 --- /dev/null +++ b/fastnearestneighbormachinetranslation/dcbbec7a-4c78-4d14-ad81-6648846acfc3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:714f802fb9dce050bd422a915742d8e0f8ca1af0e91b84e95b9cdb8653fc3555 +size 456953 diff --git a/fastnearestneighbormachinetranslation/full.md b/fastnearestneighbormachinetranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0a2b0098c4bfc57e5a1066682339384b244dc26e --- /dev/null +++ b/fastnearestneighbormachinetranslation/full.md @@ -0,0 +1,297 @@ +# Fast Nearest Neighbor Machine Translation + +Yuxian Meng*, Xiaoya Li*, Xiayu Zheng*, Fei Wu* Xiaofei Sun*, Tianwei Zhang*, Jiwei Li* + +$\spadesuit$ College of Computer Science and Technology, Zhejiang University, $\spadesuit$ Shannon.AI + +$\spadesuit$ Peking University, $\spadesuit$ Nanyang Technological University + +$\checkmark$ Shanghai Institute for Advanced Study of Zhejiang University, $\checkmark$ Shanghai AI Laboratory + +{yuxian_meng, xiaoya_li, xiaofei_sun, jiwei_li} @ shannonai.com + +xiayu_zheng@pku.edu.cn, tianwei.zhang@ntu.edu.sg, wufei@zju.edu.cn + +# Abstract + +Though nearest neighbor Machine Translation ( $k\mathrm{NN}$ -MT) (Khandelwal et al., 2020) has proved to introduce significant performance boosts over standard neural MT systems, it is prohibitively slow since it uses the entire reference corpus as the datastore for the nearest neighbor search. This means each step for each beam in the beam search has to search over the entire reference corpus. $k\mathrm{NN}$ -MT is thus two-orders slower than vanilla MT models, making it hard to be applied to real-world applications, especially online services. In this work, we propose Fast $k\mathrm{NN}$ -MT to address this issue. Fast $k\mathrm{NN}$ -MT constructs a significantly smaller datastore for the nearest neighbor search: for each word in a source sentence, Fast $k\mathrm{NN}$ -MT first selects its nearest token-level neighbors, which is limited to tokens that are the same as the query token. Then at each decoding step, in contrast to using the entire corpus as the datastore, the search space is limited to target tokens corresponding to the previously selected reference source tokens. This strategy avoids search through the whole datastore for nearest neighbors and drastically improves decoding efficiency. Without loss of performance, Fast $k\mathrm{NN}$ -MT is two-orders faster than $k\mathrm{NN}$ -MT, and is only two times slower than the standard NMT model. Fast $k\mathrm{NN}$ -MT enables the practical use of $k\mathrm{NN}$ -MT systems in real-world MT applications. + +# 1 Introduction + +Machine translation (MT) is a fundamental task in natural language processing (Brown et al., 1993; Och and Ney, 2003), and the prevalence of deep neural networks has spurred a diverse array of neural machine translation (NMT) models to improve translation quality (Sutskever et al., 2014; Bahdanau et al., 2014; Vaswani et al., 2017). The recently proposed $k$ nearest neighbor ( $k\mathbf{NN}$ ) MT + +model (Khandelwal et al., 2020) has proved to introduce significant performance boosts over standard neural MT systems. The basic idea behind kNN-MT is that at each decoding step, the model is allowed to refer to reference target tokens with similar translation contexts in a large datastore of cached examples. The corresponding reference target tokens provide important insights on the translation token likely to appear next. + +One notable limitation of $k$ NN-MT is that it is prohibitively slow: it uses the entire reference corpus as the datastore for the nearest neighbor search. This means each step for each beam in the beam search has to search over the entire reference corpus. $k$ NN-MT is thus two-orders slower than vanilla MT models. The original paper of $k$ NNMT (Khandelwal et al., 2020) suggests using fewer searching clusters, smaller beams and smaller datastores for generation speedup, but to achieve satisfactory results, carefully tuning on these factors under different tasks and datasets is still required according to analyses in (Khandelwal et al., 2020). The computational overhead introduced by $k$ NNMT makes it hard to be deployed on real-world online services, which usually require both model performance and runtime efficiency. + +In this work, we propose a fast version of $k$ NN-MT - Fast $k$ NN-MT, to tackle the aforementioned issues. Fast $k$ NN-MT constructs a significantly smaller datastore for the nearest neighbor search: for each word in a source sentence, Fast $k$ NN-MT first selects its nearest token-level neighbors, which is limited to tokens of the same token type. Then at each decoding step, in contrast to consulting the entire corpus for nearest neighbor search, the datastore for the currently decoding token is limited within the tokens of reference targets corresponding to the previously selected reference source tokens, as shown in Figure 1. The chain of mappings from the target token to the source token, then to its nearest source reference tokens, and last to cor + +responding target reference tokens, can be obtained using FastAlign (Dyer et al., 2013). + +Fast kNN-MT provides several important advantages against vanilla kNN-MT in terms of speedup: (1) the datastore in the KNN search is limited to target tokens corresponding to previously selected reference source tokens, instead of the entire corpus. This significantly improves decoding efficiency; (2) for source nearest neighbor retrieval, we propose to restrict the reference sources tokens that are the same as the query token, which further improves nearest-neighbor search efficiency. Without loss of performance, Fast kNN-MT is two-orders faster than kNN-MT, and is only two times slower than standard MT model. Under the settings of bilingual translation and domain adaptation, Fast kNN-MT achieves comparable results to kNN-MT, leading to a SacreBLEU score of 39.3 on WMT'19 De-En, 41.7 on WMT'14 En-Fr, and an average score of 41.4 on the domain adaptation task. + +# 2 Related Work + +# Neural Machine Translation + +Neural machine translation systems (Vaswani et al., 2017; Gehring et al., 2017; Meng et al., 2019) are often implemented by the sequence-to-sequence framework (Sutskever et al., 2014) and enhanced with the attention mechanism (Bahdanau et al., 2014; Luong et al., 2015) which associates the current decoding token to the most semantically related part in the source side. At decoding time, beam search and its variants are used to find the optimal sequence (Sutskever et al., 2014; Li and Jurafsky, 2016). The development of self-attention (Vaswani et al., 2017) and pretraining (Devlin et al., 2018; Lewis et al., 2019) has greatly motivated a line of works for more expressive MT systems. These works include incorporating pretrained models (Zhu et al., 2020; Guo et al., 2020), designing lightweight model structures (Kasai et al., 2020; Lioutas and Guo, 2020; Tay et al., 2020; Kasai et al., 2021; Peng et al., 2021), handling multiple languages (Aharoni et al., 2019; Arivazhagan et al., 2019; Liu et al., 2020b) and mitigating structural issues in Transformers (Wang et al., 2019; Nguyen and Salazar, 2019; Liu et al., 2020a; Li et al., 2020; Xiong et al., 2020b) for more robust and efficient NMT systems. + +# Retrieval-Augmented Models + +Retrieving and integrating auxiliary sentences has shown effectiveness in improving robustness and + +expressiveness for NMT systems. (Zhang et al., 2018) up-weighted the output tokens by collecting from the retrieved target sentences $n$ -grams that align with the words in the source sentence, and (Bapna and First, 2019) similarly retrieved $n$ -grams but incorporated the information using gated attention (Cao and Xiong, 2018). (Tu et al., 2018) updated and stored the hidden representations of recent translation history in cache for access when new tokens are generated, so that the model can dynamically adapt to different contexts. (Gu et al., 2018) leveraged an off-the-shelf search engine to retrieve a small subset of sentence pairs from the training set and then perform translation given the source sentence along with the retrieved pairs. (Li et al., 2016; Farajian et al., 2017) proposed to retrieve similar sentences from the training set for the purpose of adapting the model to different input sentences. (Bulté and Tezcan, 2019; Jitao et al., 2020) used fuzzy matches to retrieve similar sentence pairs from translation memories and augmented the source sentence with the retrieved pairs. Our work is motivated by kNN-MT (Khandelwal et al., 2020) and target improving the efficiency of kNN retrieval while achieving comparable translation performances. + +Apart from machine translation, other NLP tasks have also benefited from retrieval-augmented models, such as language modeling (Khandelwal et al., 2019), question answering (Guu et al., 2020; Lewis et al., 2020b,a; Xiong et al., 2020a) and dialog generation (Weston et al., 2018; Fan et al., 2020; Thulke et al., 2021). Most of these works perform retrieval at the sentence level and treat the extracted sentences as additional input for model generation, whereas fast kNN-MT retrieves the most relevant tokens in the source side and fixes the probability distribution using the aligned target tokens at each decoding step. + +# 3 Background: kNN-MT + +Given an input sequence of tokens $\pmb{x} = \{x_{1},\dots ,x_{n}\}$ of length $n$ , an MT model translates it into a target sentence in another language $\pmb{y} = \{y_{1},\dots ,y_{m}\}$ of length $m$ . A common practice to produce each token $y_{i}$ on the target side is to obtain a probability distribution over the vocabulary $p_{\mathrm{MT}}(y_i|x,\pmb{y}_{1:i - 1})$ from the decoder and use beam search for generation. The combination of the complete source sentence and prefix of the target sentence $(\pmb {x},\pmb{y}_{1:i - 1})$ is called trans + +lation context. $k\mathrm{NN}$ MT interpolates this probability distribution with a multinomial distribution $p_{\mathrm{kNN}}(y_i|\boldsymbol {x},\boldsymbol{y}_{1:i - 1})$ derived from the $k$ nearest neighbors of the current translation context $(\boldsymbol {x},\boldsymbol{y}_{1:i - 1})$ from a large scale datastore $S$ .. + +$$ +\begin{array}{l} p \left(y _ {i} \mid \boldsymbol {x}, \boldsymbol {y} _ {1: i - 1}\right) = \lambda p _ {\mathrm {k N N}} \left(y _ {i} \mid \boldsymbol {x}, \boldsymbol {y} _ {1: i - 1}\right) \tag {1} \\ + (1 - \lambda) p _ {\mathrm {M T}} \left(y _ {i} \mid \boldsymbol {x}, \boldsymbol {y} _ {1: i - 1}\right) \\ \end{array} +$$ + +More specifically, $k\mathrm{NN}$ -MT first constructs the datastore $\mathcal{S}$ using key-value pairs, where the key is the high-dimensional vector of the translation context produced by a trained MT model $f(\pmb{x},\pmb{y}_{1:i - 1})$ and the value is the corresponding gold target token $y_{i}$ , forming $\mathcal{S} = \{(k,v)\} = \{(f(\pmb{x},\pmb{y}_{1:i - 1}),y_i)\}$ . The context-target pairs may come from any parallel corpus. Then, using the dense representation of the current translation context as query $\pmb{q} = f(\pmb{x}^{\mathrm{in}},\pmb{y}_{1:i - 1})$ and $L_{2}$ distance as measure, $k\mathrm{NN}$ -MT searches through the entire datastore $\mathcal{S}$ to retrieve $k$ nearest translation contexts along with the corresponding target tokens $\mathcal{N} = \{\pmb{k}_j,\upsilon_j\}_{j = 1}^k$ . Last, the retrieved set is transformed to a probability distribution by normalizing and aggregating the negative $L_{2}$ distances, $-d$ , using the softmax operator with temperature $T$ , which can be expressed as follows: + +$$ +\begin{array}{l} p _ {\mathrm {k N N}} \left(y _ {i} \mid \boldsymbol {x} ^ {\text {i n}}, \boldsymbol {y} _ {1: i - 1}\right) \\ = \frac {\sum_ {\left(\boldsymbol {k} _ {j} , v _ {j}\right) \in \mathcal {N}} \mathbb {1} _ {y _ {i} = v _ {j}} \exp (- d (\boldsymbol {q} , \boldsymbol {k} _ {j}) / T)}{Z} \tag {2} \\ \end{array} +$$ + +$$ +Z = \sum_ {\left(\boldsymbol {k} _ {j}, v _ {j}\right) \in \mathcal {N}} \exp \left(- d \left(\boldsymbol {q}, \boldsymbol {k} _ {j}\right) / T\right) +$$ + +Integrating Eq.(2) into Eq.(1) gives the final probability of generating token $y_{i}$ for time step $i$ . Note that the above kNN search-interpolating process is applied to each decoding step of each beam, and each iteration needs to run on the full datastore $S$ . This gives a total time complexity of $O(|S|Bm)$ , where $B$ is the beam size and $m$ is the target length. In order for faster nearest neighbor search, kNN-MT leverages FAISS (Johnson et al., 2019), an toolkit for efficient similarity search and clustering of dense vectors. + +# 4 Method: Fast kNN-MT + +The time complexity of $k\mathrm{NN}$ -MT before search optimization is $\mathcal{O}(|S|Bm)^2$ , which is prohibitively + +slow when the size of the datastore $S$ or the beam size $B$ is large. We propose strategies to address this issue. The same as vanilla kNN-MT, fast kNN-MT system is built upon a separately trained MT encoder-decoder model. To get a better illustration of how Fast kNN-MT works, we give a toy illustration in Figure 1. We use the capitalized characters to denote source tokens and lower-cased letters to denote target tokens. Given the training set, which is: + +$$ +\left(\boldsymbol {x} ^ {(1)}, \boldsymbol {y} ^ {(1)}\right) = \left(\left\{\mathrm {A}, \mathrm {B}, \mathrm {C}, \mathrm {D} \right\}, \left\{\mathrm {b}, \mathrm {c}, \mathrm {d}, \mathrm {a} \right\}\right) +$$ + +$$ +\left(\boldsymbol {x} ^ {(2)}, \boldsymbol {y} ^ {(2)}\right) = \left(\left\{\mathrm {B}, \mathrm {C}, \mathrm {D} \right\}, \left\{\mathrm {c}, \mathrm {d}, \mathrm {e}, \mathrm {b} \right\}\right) +$$ + +$$ +\left(\boldsymbol {x} ^ {(3)}, \boldsymbol {y} ^ {(3)}\right) = \left(\left\{\mathrm {A}, \mathrm {B}, \mathrm {D}, \mathrm {E} \right\}, \left\{\mathrm {a}, \mathrm {b}, \mathrm {c}, \mathrm {d}, \mathrm {e} \right\}\right) \tag {3} +$$ + +$$ +\left(\boldsymbol {x} ^ {(4)}, \boldsymbol {y} ^ {(4)}\right) = \left(\left\{\mathrm {B}, \mathrm {D}, \mathrm {E} \right\}, \left\{\mathrm {b}, \mathrm {d}, \mathrm {e} \right\}\right) +$$ + +$$ +\left(\boldsymbol {x} ^ {(5)}, \boldsymbol {y} ^ {(5)}\right) = \left(\left\{\mathrm {D}, \mathrm {E}, \mathrm {F} \right\}, \left\{\mathrm {d}, \mathrm {e}, \mathrm {f} \right\}\right) +$$ + +in the toy example, an encoder-decoder model is trained. Next, we wish to translate a source string $\{\mathrm{B},\mathrm{C},\mathrm{E}\}$ at test time. + +# 4.1 Datastore Creation On the Source Side + +Given a pretrained encoder-decoder model, and the training corpus, we first obtain representations for all source tokens and target tokens of the training set, which are the last layer outputs from the encoder-decoder model. In the toy example, representations for source tokens $\{\mathrm{A,B,C,D}\}$ in the first training example ( $\{\mathrm{A,B,C,D}\}, \{\mathrm{b,c,d,a}\}$ ) are respectively $h_{11}, h_{12}, h_{13}, h_{14}$ , and for target tokens $\{\mathrm{b,c,d,a}\}$ are respectively $z_{11}, z_{12}, z_{13}, z_{14}$ . Given a test example to translate, which is $\{\mathrm{B,C,E}\}$ in the example, we also obtain the representation for each of its constituent token, denoted by $h_{\mathrm{B}}, h_{\mathrm{C}}, h_{\mathrm{E}}$ . Next, we select nearest neighbor tokens for each source token, i.e., $\{\mathrm{B}, \mathrm{C}, \mathrm{E}\}$ . The nearest neighbor tokens are first limited to source tokens of the same token type as the query token. For token B, tokens of the same token type are $x_{12}, x_{21}, x_{32}, x_{41}$ . Similarly, for the token C in the test example, tokens of the same type are $\{x_{13}, x_{22}\}$ ; for the token E, tokens of the same type are $\{x_{34}, x_{43}, x_{52}\}$ . One issue that stands out is that, for common words such as "the", there can be tens of millions of the same type tokens in the training corpus. We thus need to further limit the number of nearest neighbors. Let $c$ denote the hyper-parameter that controls the number of nearest neighbors for each token on the source side, which is set to 2 in the toy example. We rank all candidates based on the distance between the + +![](images/3c68d6318ca00a941bed47b5261fb77abfad28dcd9a733929851d128e692d49c.jpg) +Figure 1: Caching source and target tokens (left, blue): Given a trained NMT model $f$ and the training corpus $\mathcal{D}_{\text{train}}$ , we obtain representations for all source tokens $h$ and target tokens $z$ in the training set, which are the last layer outputs from $f$ . Datastore construction (right, green): Given a test example to translate, which is {B,C,E} in the example, we first navigate each source token to the tokens of the same type in the cache, e.g., $x_{12}, x_{21}, x_{32}$ and $x_{41}$ are identified for token B. Then, the top $c$ nearest neighbors for each source token are preserved according to the distance between the source token representation and candidate token representations, e.g., $x_{12}, x_{21}$ are selected for token B. Last, the selected source tokens are aligned to their target tokens using FastAlign (Dyer et al., 2013). For token B, the aligned target tokens are $y_{11}, y_{24}$ . The collection of all aligned target tokens (along with their representations) constitutes the datastore for the current input {B,C,E}. + +![](images/d40863aa3a812f2bd2a1217460916e40c815dbf014e94a041ee9ac4bd0cc5d76.jpg) + +source token representation (e.g., $h_{\mathrm{B}}, h_{\mathrm{C}}, h_{\mathrm{E}}$ ) and candidate token representations, and select the top $c$ . Suppose that in the toy example, $x_{12}, x_{21}$ are selected for token B, $x_{13}, x_{23}$ are selected for token C, $x_{34}, x_{52}$ are selected for token E. The concatenation of selected candidates for all source tokens constitute the datastore on the source side, which is $\mathcal{D}_{\mathrm{source}} = \{x_{12}, x_{21}, x_{13}, x_{23}, x_{34}, x_{52}\}$ in the toy example. The datastore creation for source tokens (e.g., {B, C, E}) can be run in parallel. + +# 4.2 Datastore Creation On the Target Side + +For decoding, the model needs to refer to reference target tokens rather than source tokens. We thus need to transform $\mathcal{D}_{\mathrm{source}}$ to a list of target tokens. We use FastAlign (Dyer et al., 2013) toolkit to achieve this goal. FastAlign maps source tokens to target tokens based on the IBM model (Och and Ney, 2003). Source tokens in $\mathcal{D}_{\mathrm{source}}$ that do not have correspondence on the target side are abandoned. Output target tokens from FastAlign form the datastore on the target side, denoted by $\mathcal{D}_{\mathrm{target}}$ . In the toy example, $x_{12}, x_{21}, x_{13}, x_{23}, x_{34}, x_{52}$ are respectively mapped to $\mathcal{D}_{\mathrm{target}} = \{y_{11}, y_{24}, y_{12}, y_{21}, y_{35}, y_{52}\}$ . The size of $\mathcal{D}_{\mathrm{target}}$ is $c \times n$ , where $n$ is the source length. + +In practice, we first iterate over all examples in the training set, extracting all the source token representations and all the target token representations. Then, we build a separate token-specific cache $\mathcal{D}_v$ for each $v$ in vocabulary, which consists of (key, + +value) pairs where the key is the high-dimensional representation $\pmb{h}$ and the value is a binary tuple containing the corresponding aligned target token along with its representation $\pmb{z}$ . Then we could map each source token of a given input sentence to its corresponding cache $\mathcal{D}_v$ , and build the target-side datastore following the steps in Section 4.1 and Section 4.2. The process of caching source and target tokens is present in Algorithm 1. + +# 4.3 Decoding + +At the decoding time, the datastore for each decoding step is all limited to $\mathcal{D}_{\mathrm{target}}$ , within which kNN search is performed. Since tokens in $\mathcal{D}_{\mathrm{target}}$ are not all related to the current decoding, nearest neighbor search is performed to select the top $k$ candidates from $\mathcal{D}_{\mathrm{target}}$ for each decoding step. For the nearest neighbor search here, we use the current representation $h$ at the decoding time to query target representation $z$ for target tokens in $\mathcal{D}_{\mathrm{target}}$ . The selected nearest neighbors and their representations are used to compute the final word generation probability based on Eq.(1) and Eq.(2). + +# 4.4 Quantization + +Although the prohibitive computational cost issue of kNN-MT has been addressed, the intensive memory for datastore remains a problem, as we wish to cache all source and target representations of the entire training set. Additionally, frequently accessing Terabytes of data is also extremely time-intensive. To address this issue, we propose to use product quantization (PQ) (Jegou et al., 2010) to + +Algorithm 1: Constructing Datastore for a Test Input $x$ . +Input :All sentence-pairs in training set: $(\pmb{x}^{(1)},\pmb{y}^{(1)}),\dots,(\pmb{x}^{(N)},\pmb{y}^{(N)})$ , vocabulary V NMT encoder $f_{e}$ , NMT decoder $f_{d}$ , word +alignment for each sentence-pair $(A^{(1)},\ldots ,A^{(N)})$ Input for test: $\pmb{x}$ +Output:Target datastore $\mathcal{D}_{\mathrm{target}}(\pmb {x})$ for $\pmb{x}$ $\mathcal{D}_{\mathrm{target}}(\pmb {x})\gets \emptyset$ initialize the +datastore $\mathcal{D}_{\mathrm{source}}(\pmb {x})$ for $\pmb{x}$ +for $v\gets 1$ to $\nu$ do + $\mathcal{D}_v\gets \emptyset$ initialize the (key, value) datastore for each word in the vocabulary +end +% Caching Source and Target Tokens: +for $i\gets 1$ to $N$ do + $n_i\gets$ length of $\pmb{x}^{(i)}$ $m_i\gets$ length of $\pmb{y}^{(i)}$ $[h_1,\dots,h_{n_i}]\gets f_e(\pmb{x}^{(i)})$ computing representations for each source word + $[z_1,\dots,z_{m_i}]\gets f_d(\pmb{x}^{(i)},\pmb{y}^{(i)})$ computing representations for each target word +for $j\gets 0$ to $n_i$ do for $k\gets 0$ to $m_i$ do if $(j,k)\in A^{(i)}$ then add $(h_i,(z_k,y_k^{(i)}))$ to $\mathcal{D}_{x_j^{(i)}}$ $\%$ key of $\mathcal{D}_{x_j^{(i)}}$ are all hidden representations $\pmb{h}_i$ for tokens of the same token type as $x_j^{(i)}$ end end +end +% Generate Datastore for the test input $\pmb{x}$ . + $n_x\gets$ length of $\pmb{x}$ +for $k\gets 1$ to $N$ do obtain hidden representation for the $k$ -th token $\pmb{h}_k$ $\{\pmb {z},\pmb {y}\} \leftarrow$ top $c$ items from $\mathcal{D}_{x_k}$ using $\pmb{h}_k$ as the query add $\{\pmb {z},\pmb {y}\}$ to $\mathcal{D}_{\mathrm{target}}(\pmb {x})$ + +compress the high-dimensional representations of each token. Formally, given a vector $\pmb{x} \in \mathbb{R}^D$ , we represent it as the concatenation of $M$ subvectors: $\pmb{x} = [x^{1}, x^{2}, \dots, x^{M}]$ , where all subvectors have the same dimension $d = D / M$ . The product quantizer $q$ consists of $M$ sub-quantizers $q_{1}, \dots, q_{M}$ , each maps a subvec $\pmb{x}^{m} \in \mathbb{R}^{d}$ to a codeword $\pmb{c}$ in a subspace codebook with $n$ codewords: $\mathcal{C}^{m} = \{\pmb{c}_{1}^{m}, \pmb{c}_{2}^{m}, \dots, \pmb{c}_{n}^{m}\}$ . The objective function of PQ is: + +$$ +\min _ {q ^ {1}, \dots , q ^ {M}} \sum_ {\boldsymbol {x}} \sum_ {m = 1} ^ {M} \| \boldsymbol {x} ^ {m} - q _ {m} \left(\boldsymbol {x} ^ {m}\right) \| ^ {2} \tag {4} +$$ + +Therefore each $\pmb{x}$ is mapped to its nearest codeword in the Cartesian product space $\mathcal{C} = \mathcal{C}^1 \times \dots \times \mathcal{C}^M$ . + +If each subspace codebook $\mathcal{C}^m$ has $n$ codewords, then the Cartetian product space $\mathcal{C}$ could represent $n^m$ $D$ -dimensional codewords with only $n\times m$ $d$ -dimensional vectors, thus significantly eased the memory issue. With the quantization technique, we are able to compress each token representation to 128-bytes. For example, for the WMT19 En-De dataset, the memory size is reduced from 3.5TB to 108GB. + +# 4.5 kNN Retrieval Details + +In practice, executing exact nearest neighbor search over millions or even billions of tokens could be time-consuming. Hence we use FAISS (Johnson et al., 2019) for fast approximate nearest neighbor search. All token representations are quantized to 128-bytes. Recall that we build a token-specific datastore $\mathcal{D}_v$ for each $v$ in vocabulary. We do brute force search for tokens whose frequency $n_v$ is lower than 30000. For those tokens whose frequency is larger than 30000, the keys are stored in clusters to speed up search. The number of clusters for token $v$ is set to $\min(4 \times \sqrt{n_v}, n_v/30)$ . To learn the cluster centroids, we use at most 5M keys for each token $v$ . During inference, we query the datastore for $k = 512$ neighbors through searching 32 nearest clusters. + +# 4.6 Discussions on Comparisons to Vanilla kNN-MT + +The speedup of Fast kNN-MT lies in the following three aspects: + +(1) For nearest neighbor retrieval on the source side, we first restrict the reference tokens that are the same as the query token. This strategy significantly narrows down the search space to roughly $|S| / \mathrm{mid}(F)$ times, where $|S|$ denotes the number of tokens in the corpus, and $\mathrm{mid}(F)$ denotes the medium word frequency in the corpus. +(2) The nearest neighbor search for all source tokens on the source side can be run in parallel, which is also a key speedup over kNN-MT. For vanilla kNN-MT, kNN search is performed on the target side and has to be auto-regressive: the representation for the current decoding step, which is used for the kNN search over the entire corpus, relies on previously generated tokens. Therefore, the kNN search for the current step has to wait for the finish of kNN searches for all previous generation steps. (3) On the target side, the datastore in the kNN search is limited to target representations corresponding to selected reference source tokens. + +Though the nearest neighbor search in the decoding process is auto-regressive and thus cannot be run in parallel, the running cost is fairly low: recall that the size of $\mathcal{D}_{\mathrm{target}}$ is $c\times n$ . Across all settings, the largest value of $c$ is set to 512. The size of $\mathcal{D}_{\mathrm{target}}$ is roughly 15k. Performing nearest neighbor searches among 15k candidates is relatively cheap for NMT, and is actually cheaper than the softmax operation for word prediction, where the vocabulary size is usually around 50k. + +The combination of all these aspects leads to Fast kNN-MT two orders of magnitude faster than vanilla kNN-MT. + +# 5 Experiments + +# 5.1 Bilingual Machine Translation + +We conduct experiments on two bilingual machine translation datasets: WMT'14 English-French and WMT'19 German-English. To create the data-tore, we follow (Ng et al., 2019) to apply language identification filtering, keeping only sentence pairs with correct languages on both sides. We also remove sentences longer than 250 tokens and sentence pairs with a source/target ratio exceeding 1.5. For all datasets, we use the standard Transformer-base model provided by FairSeq (Ott et al., 2019) library. $^3$ The model has 6 encoder layers and 6 decoder layers. The dimensionality of word representations is 1024, the number of multi-attention heads is 16, and the inner dimensionality of feedforward layers is 8192. Particularly, following (Khandelwal et al., 2020), the model for WMT'19 German-English has also been trained on over 10 billion tokens of extra backtranslation data as well as fine-tuned on newstest test sets from previous years. We report the SacreBLEU scores (Post, 2018) for comparison. $^4$ Table 1 shows our results on the two NMT datasets. The proposed Fast kNN-MT model is able to achieve slightly better results to the vanilla kNN-MT model on WMT'19 German-English, and competitive results on WMT'14 English-French, with less kNN search cost. + +# 5.2 Domain Adaptation + +We also measure the effectiveness of the proposed Fast kNN-MT model on the domain adaptation task. We use the multi-domain datasets which are + +
ModelDe-EnEn-Fr
base MT37.641.1
+kNN-MT39.1(+)1.5)41.8(+0.7)
+fast kNN-MT39.3(+)1.7)41.7(+0.6)
+ +Table 1: SacreBLEU scores on WMT'19 De-En and WMT'14 En-Fr. + +originally provided in (Koehn and Knowles, 2017) and further cleaned by (Aharoni and Goldberg, 2020). These datasets include German-English parallel data for train/validation/test sets in five domains: Medical, Law, IT, Koran and Subtitles. We use the trained German-English model introduced in Section 5.1 as our base model, and further build domain-specific datastores to evaluate the performance of Fast kNN-MT on each domain. Table 2 shows that Fast kNN-MT achieves comparable results to vanilla kNN-MT on domains of Medical (54.6 vs. 54.4), IT (45.9 vs. 45.8) and Subtitles (31.9 vs. 31.7), and outperforms vanilla kNN-MT on the domain of Koran (21.2 vs. 19.4). The average score of Fast kNN-MT (41.7) is on par with the result of (Aharoni and Goldberg, 2020) (41.3), which trains domain-specific models and reports in-domain results. + +Following (Khandelwal et al., 2020), we also carry out experiments under the out-of-domain and multi-domain settings and report the results on Table 2. “+ WMT19’ datastore” shows the results for retrieving neighbors from 770M tokens of WMT'19 data that the model has been trained on, and “+ all-domain datastore” shows the results where the model is trained on the multi-domain datastore from all six settings. The BLEU improvement is much smaller on the out-of-domain setup compared to the in-domain setup, illustrating that the proposed framework relies on in-domain data to retrieve valuable contexts. For the multi-domain setup, the performance for all six domains generally remains the same and only a small drop of the average score is witnessed. This shows that the Fast kNN-MT framework is robust to a massive amount of out-of-domain data and is able to retrieve the context-related information from in-domain data. + +# 5.3 Analysis + +Examples To visualize the effectiveness of the proposed Fast kNN-MT model, we randomly choose an example from the test set of the Law domain. Table 3 shows the test sentence, the retrieved + +
ModelMedicalLawITKoranSubtitlesAvg.
(Aharoni and Goldberg, 2020)54.858.843.521.827.441.3
base MT39.945.738.016.329.233.8
+in-domain datastore:
kNN-MT54.4(+14.5)61.8(+16.1)45.8(+7.8)19.4(+3.1)31.7(+2.5)42.6(+8.8)
fast kNN-MT53.6(+13.7)56.0(+10.3)45.5(+7.5)21.2(+4.9)30.5(+1.3)41.4(+7.6)
+WMT19' datastore
kNN-MT40.2(+0.3)46.7(+1.0)40.3(+2.3)18.0(+1.7)29.2(+0.0)34.9(+1.1)
fast kNN-MT41.5(+1.6)45.9(+0.2)41.0(+3.0)17.6(+1.3)29.2(+0.0)35.0(+1.2)
+all-domains datastore
kNN-MT54.5(+14.6)61.1(+15.4)48.6(+10.6)19.2(+2.9)31.7(+2.5)43.0(+9.2)
fast kNN-MT53.2(+13.3)54.6(+8.9)46.4(+8.4)19.5(+3.2)29.7(+0.5)40.7(+6.9)
+ +Table 2: SacreBLEU results for domain adaptation. + +
SourceTarget
original sentence pairZwei Fisch@@ betriebe haben ihre Tätigkeit eingestellt.Two fish establi@@ sh@@ments have ce@@ ased their activities.
reference of "Zwei"Zwei Gemein@@ schäft@@sher@@ steller in Griechenland, die bei der vor@@ ausge@@ gangenen Untersuchung mit@@ gearbeitet hatten, gaben ihre Tätigkeit auf.Fur@@ther@@ more , two Community producers in Greece who took part in the previous investiga-tion ce@@ ased their activity.
reference of "Fisch@@"- fünf auf die Fisch@@ industriie,- five to representatives of the fi@@sh@@ ery industries,
reference of "betriebe"(4) Drei Fleisch@@ betriebe mit Übergangs@@ regulung haben er-hebliche Anstrengungen unter@@ nommen, neue Betriebs@@ anla-gen zu bauen.(4) Three meat establi@@ sh@@ments on the list of establi@@ sh@@ments in transition have made considerable efforts to build new facilities.
reference of "haben", "ihre", "Tätigkeit", "eingestellt" and ". ."Einige Betriebe haben ihre Tätigkeit eingestellt.Cer@@ tain establi@@ sh@@ments have ce@@ ased their activi-ties.
+ +Table 3: A test sentence pair from the Law domain. We show the original sentence pair for test (the first row), the nearest-neighbor tokens on the source side along with the sentences that retrieved tokens reside in (the second column), and the aligned target tokens extracted from FastAlign, along with sentences in which target tokens reside in (the third column). The retrieved tokens are in red. + +nearest neighbor tokens on the source side, and the corresponding target tokens. The first figure in Figure 2 demonstrates the similarity heatmap between the gold target tokens and the selected target neighbors. We can see that the retrieved target nearest tokens are highly correlated with the ground-truth target tokens, exhibiting the ability of Fast kNN-MT to accurately extract nearest reference tokens at each decoding step. + +The Effect of the Number of neighbors per token on the source side We queried the datastore for nearest $c$ neighbors for each source token. Intu + +itively, the larger the $c$ is, the more likely the model could recall the nearest neighbors on the target side. The second figure in Figure2 verifies this point: the model performance increases drastically when $c$ increases from 8 to 64, and then continues increasing as $c$ is up to 512. + +The Effect of the Number of neighbors per token on the target side Fast kNN-MT selects top $k$ nearest neighbors at each decoding step for computing the probability $p_{\mathrm{kNN}}$ in Eq.(2). The third figure in Figure 2 shows that the model performance first increases and then decreases when we continue + +![](images/c5197198bf253e19243987848db05340ba2d94dcfa6eb75ec2e3aae4a79f1c89.jpg) +Figure 2: First figure: the similarity heatmap between the gold target tokens and the retrieved target neighbors. Second figure: BLEU scores with respect to different $c$ , the number of nearest neighbors on the source side for each source token. Third figure: BLEU scores with respect to different $k$ , the number of nearest neighbors on the target side for each target token. Forth figure: Speed comparison between base MT, kNN-MT and fast kNN-MT. + +![](images/28ea73d9aec9bfbef070bd972ef579b8324dda741ad3c9b7b562b67795b77063.jpg) + +![](images/cddefd4c931b99ccd6658010e7dce458f051de19de6f8f1532cf12187c27e64f.jpg) + +![](images/b673c217989cbf892a5162a7268e51e8eecf8572dcfba2bcec7e1ef651be96f2.jpg) + +enlarging the value of $k$ , with $c$ fixed at 512, which is consistent with the observation in (Khandelwal et al., 2020). This is because that using neighbors that are too far away from the ground-truth target token adds noise to the model prediction, and thus hurts the performance. + +Speed comparison When the beam size is fixed, the time complexity of Fast kNN-MT is mainly controlled by the number of retrieved neighbors $c$ for each source token. The last figure in Figure 2 shows the speed comparison between base MT, kNN-MT and fast kNN-MT when we vary the value of $c$ . Fast kNN-MT decoded nearly as fast as the vanilla MT model when $c$ is small. When $c$ reaches 512, kNN-MT is about two times slower than the vanilla MT model. By contrast, vanilla kNN-MT is two orders of magnitude slower than base MT and Fast kNN-MT regarding the decoding speed. This is because Fast kNN-MT substantially restricts the search space during decoding, whereas vanilla kNN-MT has to execute kNN search over the entire datastore at each decoding step. + +Similarity function We have tried different similarity functions when retrieving $c$ nearest neighbors on source side and computing the $k$ -NN distribution. These functions include cosine similarity, inner product and $L_{2}$ distance, the SacreBLEU scores for which are respectively 39.2, 39.1 and 38.8 on WMT'19 German-English, showing that cosine similarity is a better measure for representation distance than $L_{2}$ distance and inner product. + +Effect of quantization Due to the memory issue, we applied quantization to compress the high- + +
ModelMedicalLawITKoranSubtitlesAvg.
fast kNN-MT53.661.045.521.231.941.7
+full-precision53.861.145.821.330.741.5
+ +Table 4: SacreBLEU scores on domain adaptation when using full precision. + +dimensional representation of each token in the training set. We investigate how quantization would affect model performances. As shown in Table 4, quantization has minor side effects in terms of BLEU scores, and when we use full precision instead of quantization, the average BLEU score only increases 0.1, which suggests that computing similarity using compressed vectors is a viable trade-off between memory usage and model performance. + +# 6 Conclusion + +In this work, we propose a fast version of $k$ NN-MT - Fast $k$ NN-MT - to address the runtime complexity issue of the vanilla $k$ NN-MT. During decoding, Fast $k$ NN-MT constructs a significantly smaller datastore for the nearest neighbor search: for each word in a source sentence, Fast $k$ NN-MT selects its nearest tokens from a large-scale cache. The selected tokens are the same as the query token. Then at each decoding step, in contrast to using the entire datastore, the search space is limited to target tokens corresponding to the previously selected reference source tokens. Experiments demonstrate that this strategy drastically improves decoding efficiency while maintaining model performances compared to vanilla $k$ NN-MT under different settings including bilingual machine translation and domain adaptation. Comprehensive ablation studies are performed to understand the behavior of each component in Fast $k$ NN-MT. In future work, we plan to further improve the efficiency of Fast $k$ NN-MT + +by applying clustering techniques to build the datastore. + +# Acknowledgement + +This work is supported by the Science and Technology Innovation 2030 - "New Generation Artificial Intelligence" Major Project (No. 2021ZD0110201) and the Key R & D Projects of the Ministry of Science and Technology (2020YFC0832500). We would like to thank anonymous reviewers for their comments and suggestions. + +# References + +Roee Aharoni and Yoav Goldberg. 2020. Unsupervised domain clusters in pretrained language models. arXiv preprint arXiv:2004.02105. +Roee Aharoni, Melvin Johnson, and Orhan First. 2019. Massively multilingual neural machine translation. arXiv preprint arXiv:1903.00089. +Naveen Arivazhagan, Ankur Bapna, Orhan First, Dmitry Lepikhin, Melvin Johnson, Maxim Krikun, Mia Xu Chen, Yuan Cao, George Foster, Colin Cherry, et al. 2019. Massively multilingual neural machine translation in the wild: Findings and challenges. arXiv preprint arXiv:1907.05019. +Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2014. Neural machine translation by jointly learning to align and translate. +Ankur Bapna and Orhan First. 2019. Non-parametric adaptation for neural machine translation. arXiv preprint arXiv:1903.00058. +Peter F Brown, Stephen A Della Pietra, Vincent J Della Pietra, and Robert L Mercer. 1993. The mathematics of statistical machine translation: Parameter estimation. Computational linguistics, 19(2):263-311. +Bram Bulté and Arda Tezcan. 2019. Neural fuzzy repair: Integrating fuzzy matches into neural machine translation. In 57th Annual Meeting of the Association-for-Computational-Linguistics (ACL), pages 1800–1809. +Qian Cao and Deyi Xiong. 2018. Encoding gated translation memory into neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3042-3047. +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. + +Chris Dyer, Victor Chahuneau, and Noah A Smith. 2013. A simple, fast, and effective reparameterization of ibm model 2. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 644-648. +Angela Fan, Claire Gardent, Chloe Braud, and Antoine Bordes. 2020. Augmenting transformers with knn-based composite memory for dialogue. arXiv preprint arXiv:2004.12744. +M Amin Farajian, Marco Turchi, Matteo Negri, and Marcello Federico. 2017. Multi-domain neural machine translation through unsupervised adaptation. In Proceedings of the Second Conference on Machine Translation, pages 127-137. +Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. 2017. Convolutional sequence to sequence learning. In International Conference on Machine Learning, pages 1243-1252. PMLR. +Jiatao Gu, Yong Wang, Kyunghyun Cho, and Victor OK Li. 2018. Search engine guided neural machine translation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32. +Junliang Guo, Zhirui Zhang, Linli Xu, Hao-Ran Wei, Boxing Chen, and Enhong Chen. 2020. Incorporating bert into parallel sequence decoding with adapters. arXiv preprint arXiv:2010.06138. +Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. 2020. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909. +Herve Jegou, Matthijs Douze, and Cordelia Schmid. 2010. Product quantization for nearest neighbor search. IEEE transactions on pattern analysis and machine intelligence, 33(1):117-128. +XU Jitao, Josep M Crego, and Jean Senellart. 2020. Boosting neural machine translation with similar translations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1580-1590. +Jeff Johnson, Matthijs Douze, and Hervé Jégou. 2019. Billion-scale similarity search with gpus. IEEE Transactions on Big Data. +Jungo Kasai, Nikolaos Pappas, Hao Peng, James Cross, and Noah A Smith. 2020. Deep encoder, shallow decoder: Reevaluating the speed-quality tradeoff in machine translation. arXiv preprint arXiv:2006.10369. +Jungo Kasai, Hao Peng, Yizhe Zhang, Dani Yogatama, Gabriel Ilharco, Nikolaos Pappas, Yi Mao, Weizhu Chen, and Noah A Smith. 2021. Finetuning pretrained transformers into rnns. arXiv preprint arXiv:2103.13076. + +Urvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. 2020. Nearest neighbor machine translation. arXiv preprint arXiv:2010.00710. +Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. 2019. Generalization through memorization: Nearest neighbor language models. arXiv preprint arXiv:1911.00172. +Philipp Koehn and Rebecca Knowles. 2017. Six challenges for neural machine translation. arXiv preprint arXiv:1706.03872. +Mike Lewis, Marjan Ghazvininejad, Gargi Ghosh, Armen Aghajanyan, Sida Wang, and Luke Zettle-moyer. 2020a. Pre-training via paraphrasing. arXiv preprint arXiv:2006.15020. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. 2019. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461. +Patrick Lewis, Ethan Perez, Aleksandara Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Kuttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. 2020b. Retrieval-augmented generation for knowledge-intensive nlp tasks. arXiv preprint arXiv:2005.11401. +Jiwei Li and Dan Jurafsky. 2016. Mutual information and diverse decoding improve neural machine translation. arXiv preprint arXiv:1601.00372. +Xiaoqing Li, Jiajun Zhang, and Chengqing Zong. 2016. One sentence one model for neural machine translation. arXiv preprint arXiv:1609.06490. +Xiaoya Li, Yuxian Meng, Mingxin Zhou, Qinghong Han, Fei Wu, and Jiwei Li. 2020. Sac: Accelerating and structuring self-attention via sparse adaptive connection. arXiv preprint arXiv:2003.09833. +Vasileios Lioutas and Yuhong Guo. 2020. Time-aware large kernel convolutions. In International Conference on Machine Learning, pages 6172-6183. PMLR. +Liyuan Liu, Xiaodong Liu, Jianfeng Gao, Weizhu Chen, and Jiawei Han. 2020a. Understanding the difficulty of training transformers. arXiv preprint arXiv:2004.08249. +Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. 2020b. Multilingual denoising pre-training for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726-742. +Thang Luong, Hieu Pham, and Christopher D. Manning. 2015. Effective approaches to attention-based neural machine translation. In Proceedings of the + +2015 Conference on Empirical Methods in Natural Language Processing, pages 1412-1421, Lisbon, Portugal. Association for Computational Linguistics. +Yuxian Meng, Xiangyuan Ren, Zijun Sun, Xiaoya Li, Arianna Yuan, Fei Wu, and Jiwei Li. 2019. Large-scale pretraining for neural machine translation with tens of billions of sentence pairs. arXiv preprint arXiv:1909.11861. +Nathan Ng, Kyra Yee, Alexei Baevski, Myle Ott, Michael Auli, and Sergey Edunov. 2019. Facebook fair's wmt19 news translation task submission. arXiv preprint arXiv:1907.06616. +Toan Q Nguyen and Julian Salazar. 2019. Transformers without tears: Improving the normalization of self-attention. arXiv preprint arXiv:1910.05895. +Franz Josef Och and Hermann Ney. 2003. A systematic comparison of various statistical alignment models. Computational linguistics, 29(1):19-51. +Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. fairseq: A fast, extensible toolkit for sequence modeling. arXiv preprint arXiv:1904.01038. +Hao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz, Noah A Smith, and Lingpeng Kong. 2021. Random feature attention. arXiv preprint arXiv:2103.02143. +Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186-191, Brussels, Belgium. Association for Computational Linguistics. +Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104-3112. +Yi Tay, Dara Bahri, Donald Metzler, Da-Cheng Juan, Zhe Zhao, and Che Zheng. 2020. Synthesizer: Rethinking self-attention in transformer models. arXiv preprint arXiv:2005.00743. +David Thulke, Nico Daheim, Christian Dugast, and Hermann Ney. 2021. Efficient retrieval augmented generation from unstructured knowledge for task-oriented dialog. arXiv preprint arXiv:2102.04643. +Zhaopeng Tu, Yang Liu, Shuming Shi, and Tong Zhang. 2018. Learning to remember translation history with a continuous cache. Transactions of the Association for Computational Linguistics, 6:407-420. +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 I. Guyon, U. V. Luxburg, S. Bengio, + +H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 5998-6008. Curran Associates, Inc. +Qiang Wang, Bei Li, Tong Xiao, Jingbo Zhu, Changliang Li, Derek F Wong, and Lidia S Chao. 2019. Learning deep transformer models for machine translation. arXiv preprint arXiv:1906.01787. +Jason Weston, Emily Dinan, and Alexander H Miller. 2018. Retrieve and refine: Improved sequence generation models for dialogue. arXiv preprint arXiv:1808.04776. +Lee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang, Jialin Liu, Paul Bennett, Junaid Ahmed, and Arnold Overwijk. 2020a. Approximate nearest neighbor negative contrastive learning for dense text retrieval. arXiv preprint arXiv:2007.00808. +Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tieyan Liu. 2020b. On layer normalization in the transformer architecture. In International Conference on Machine Learning, pages 10524-10533. PMLR. +Jingyi Zhang, Masao Utiyama, Eiichro Sumita, Graham Neubig, and Satoshi Nakamura. 2018. Guiding neural machine translation with retrieved translation pieces. arXiv preprint arXiv:1804.02559. +Jinhua Zhu, Yingce Xia, Lijun Wu, Di He, Tao Qin, Wengang Zhou, Houqiang Li, and Tie-Yan Liu. 2020. Incorporating bert into neural machine translation. arXiv preprint arXiv:2002.06823. \ No newline at end of file diff --git a/fastnearestneighbormachinetranslation/images.zip b/fastnearestneighbormachinetranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..992a3997d46d3e65d83fa7127d089909e7b56e5c --- /dev/null +++ b/fastnearestneighbormachinetranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1c27e49d69a8092b71b062f1e62e271baf383666556fbbcef22d9f634234b01 +size 375732 diff --git a/fastnearestneighbormachinetranslation/layout.json b/fastnearestneighbormachinetranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ff4b8f04ffe35f49062886596c5acd7d53ac3c1a --- /dev/null +++ b/fastnearestneighbormachinetranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8ca182cbb91ae9bf206f590e87178efc1724de6d6abb2d32dd1b56162d2506f +size 478534 diff --git a/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_content_list.json b/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..50426389f1461115d1e743ae694c9d4fe773d0bc --- /dev/null +++ b/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffacc5380a1046d847a3d12acc08e26e719f5e402a13daa49b4bf3fec617ce3a +size 282203 diff --git a/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_model.json b/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d7dd70844eb06d153aaba86391d2e00e7d9727be --- /dev/null +++ b/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c49fe471f5380c1dc999cbbb82e7bfd39d7bd0e1fcfb47b96cd6827b40a6a69 +size 357924 diff --git a/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_origin.pdf b/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fd403a346371ecca8a81eab4d17070b2fb33f7f5 --- /dev/null +++ b/findingsoftheassociationforcomputationallinguisticsacl2022/87c8510f-a30a-45eb-b97e-adff7f557e08_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cff99833c54588dc7372f46879321d9b01f340cb3dea3286392c4a677a01db69 +size 1550137 diff --git a/findingsoftheassociationforcomputationallinguisticsacl2022/full.md b/findingsoftheassociationforcomputationallinguisticsacl2022/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a725084aa2c4e29e5682330f0e04b8b29c673ed8 --- /dev/null +++ b/findingsoftheassociationforcomputationallinguisticsacl2022/full.md @@ -0,0 +1,1781 @@ +# The 60th Annual Meeting of the Association for Computational Linguistics + +Findings of ACL 2022 + +The ACL organizers gratefully acknowledge the support from the following sponsors. + +# Diamond + +amazon + +science + +Bloomberg + +Engineering + +Google Research + +![](images/4c6a84c5c5618fb3d1f531abe448d1a2808ce93adc7cf6d37e624043c57cf078.jpg) + +LIVEPERSON + +![](images/d911dce88a5a4bd48f6335a8a1d5cc0bbe6801b3a112b744ece02b753bb0c713.jpg) + +Meta + +# Platinum + +Bai + +![](images/a1bdf326e7e490f5f4e8e68153ecd81aaed7befae22e41cac2272cf360edbfe5.jpg) + +度 + +![](images/972bd63cf4a599f713c06676197481bf6a13816c5e7ed91a10514ebef15e8388.jpg) + +ByteDance + +![](images/a6b3d9b745b19711b710dfb13dea5c9ffa2a099e4600d883b2698efd0d7898dc.jpg) + +DeepMind + +![](images/d6c61a99413336bf24c78b6777944d085ba49695379d4d98805ea9e84ef8d729.jpg) + +grammarly + +![](images/0172de8fa7747bf0c750d37cd3172d5dbb262dd6ac5cc5157eedda1a75fb83ee.jpg) + +GTCOM + +![](images/674d79f0517f92e5ac0db3f37a48087f529928ca58b2b3eea571528af72930bc.jpg) + +![](images/da4cbb93f41f8aba2a02c4eda78e80fb923620c89c628d5bac15a36d2a90e220.jpg) + +![](images/b4cb0b464fe36aad2d71ea444ddab4f7dd209d21e5734092094234f111f504cc.jpg) + +Microsoft + +Megagon Labs + +# Gold + +![](images/394c3dea9c25171d703508d11a87f0431a45aeeb88001fe75772a65a1774cf10.jpg) + +Alibaba Group + +阿里巴巴集团 + +![](images/153720575f06bd7aebc2b143f51c04b654be436a915c1abe49b1bf4f546b8944.jpg) + +BOSCH + +Invented for life + +co:here + +![](images/8df7fa428cd5996aac59c23d74eac0bf761a8506d0f682c5a9be886b4fa3bc1d.jpg) + +Relativity + +servicenow + +Silver + +![](images/ea7222ec7924b7913cb9c764fd0d4d262a6a4aa1704a066070a5d3b89cbf2988.jpg) + +ASAPP + +![](images/0999489bca8cb2038d2479e8094eec8f16ac6f06e2b2cc98c0214dfebafccd67.jpg) + +NAVER + +Bronze + +![](images/9c4885372b68623523d4a38ce4a4b2a65e24d760eac91a6fe4a9b23f4785ec5d.jpg) + +Adobe + +Babelscape + +![](images/be2b082cbbc6e0bbdcc6936ef97b049986aeb4ce879a635f644988902e0a08b5.jpg) + +Spotify® + +$\langle \widehat{\mathbb{C}}\rangle$ 2022 Association for Computational Linguistics + +Order copies of this and other ACL proceedings from: + +Association for Computational Linguistics (ACL) + +209 N. Eighth Street + +Stroudsburg, PA 18360 + +USA + +Tel: +1-570-476-8006 + +Fax: +1-570-476-0860 + +acl@aclweb.org + +ISBN 978-1-955917-25-4 + +# Message from the General Chair + +Welcome to ACL 2022, the 60th Annual Meeting of the Association for Computational Linguistics! The conference will be held in Dublin, the capital of Ireland, on May 22-27, 2022. + +ACL 2022 will be a hybrid conference. After two fully virtual editions, ACL 2020 and ACL 2021, due to the pandemic, this year we are gradually coming back to normality, estimating, at the moment of writing this message, that about $50\%$ of the registered participants will be able to attend the conference in-person, enjoying the atmosphere of the CCD congress center, the social events of the conference, and the many opportunities in Dublin. On the other side, virtual attendees will have the possibility to interact almost like they were in Dublin, thanks to a sophisticated virtual conference platform. + +There are few important innovations this year. The most relevant is that ACL 2022 adopted a new reviewing process, based on "rolling review" (ARR), with the goal of coordinating and making more efficient the paper reviews of the ACL conferences. This initiative was shared with NAACL 2022, resulting in a coordinated effort. As a side effect of moving to ARR, we have been working on a new version of the software, called ACLPUB2, used to produce both the conference proceedings and the conference schedule. I would like to thank all the people who contributed to those achievements. Finally, this year we celebrate the 60th anniversary of the ACL conference. Thanks to the enthusiastic contributions of many organizations, coordinated by the Diversity and Inclusion co-chairs, we are preparing a very special initiative for our community, which, at the time of writing this message, is still secret and that will be disclosed during the opening of the conference. + +I was very lucky to work together with three fantastic Program Chairs: Preslav Nakov, Smaranda Muresan and Aline Villaviciencio. I could not thank you more for the dedication and the capacity with which you have organized a very exciting scientific program and for the help in all the phases of the conference organization. + +Thanks to the local organizers in Dublin, Andy Way and John Kelleher, and to the PCO, who managed the local organization in a period in which we have had very few certainties, and many more uncertainties. + +We are extremely grateful to all sponsors for their continuing and generous support to help our conterences be very successful. Thank you to Chris Callison-Burch, the ACL Sponsorship Director, for managing the relations between the sponsors and ACL 2022. + +I am also very grateful to the chairs of the previous years' conferences, who were always ready to help and to provide advice, contributing to the transmission, from year to year, of all the know-how and collective memory. Thanks to all the members of The ACL Executive Committee, they were always supportive, particularly when feedback on delicate issues was needed. + +Many thanks to the senior area chairs, the area chairs, the reviewers, our workshop organizers, our tutorial instructors, the authors and presenters of papers, and the invited speakers. + +ACL requires a long process, involving a large team of committed people. It is an honor for me to have coordinated such a team of talented people, who kindly volunteered their time to make this conference possible. I would like to thank the members of the organizing committee for their dedication and hard work, often under a tight schedule: + +Workshop Co-Chairs: Elena Cabrio, Sujian Li, Mausam; +- Tutorial Co-Chairs: Naoaki Okazaki, Yves Scherrer, Marcos Zampieri; +- Demo Co-Chairs: Valerio Basile, Zornitsa Kozareva, Sanja Štajner; +- Student Research Workshop Co-Chairs: Samuel Louvan, Brielen Madureira, Andrea Madotto; + +- SRW Faculty Advisors: Cecile Paris, Siva Reddy, German Rigau; +- Publication Co-Chairs (also publication co-chairs for NAACL 2022): Danilo Croce, Ryan Cotterell, Jordan Zhang; +- Conference Handbook Chair: Marco Polignano; +- Diversity & Inclusion Co-chairs: Mona Diab, Martha Yifiru Tachbelie; +- Ethic advisor committee: Su Lin Blodgett, Christiane Fellbaum; +- Technical OpenReview Chair: Rodrigo Wilkens; +- Publicity and Social Media Co-chairs: Isabelle Augenstein, Emmanuele Chersoni, Diana Maynard, Soujanya Poria, Joel Tetreault; +- Local Arrangement Committee: Fiona McGillivray, Greg Carew, Laird Smith; +- Student Volunteer Coordinators: Filip Klubicka, Vasudevan Nedumpozhimana, Guodong Xie, Pintu Lohar; +- Internal Communications Chair: Marcely Boito Zanon. + +Let me deserve a special thanks to Priscilla Rasmussen. She has been the pillar not only of this year's ACL, but of the ACL conferences for many years. She has offered her invaluable experience to the organizing committee, and her presence has always given us a pleasant sense of security. + +Finally, I would like to thank all the participants, both in-person and virtual, who will be the main actors from May 22 to May 27, 2022. I am convinced that we will experience a fantastic conference, scientifically exciting and full of fond memories. + +Welcome and hope you all enjoy the conference! + +Bernardo Magnini (FBK, Italy) + +ACL 2022 General Chair + +# Message from the Program Chairs + +Welcome to the 60th Annual Meeting of the Association for Computational Linguistics (ACL 2022). ACL 2022 has a special historical significance, as this is the 60th Anniversary edition. It is also the first hybrid ACL conference after two years of a fully virtual format for ACL in 2020 and 2021 due to the COVID-19 pandemic. Finally, it is the first *ACL conference to fully embrace the ACL Rolling Review (ARR) as a reviewing process. Below, we discuss some of these changes and we highlight the exciting program that we have put together with the help from our community. + +# Using ARR for Reviewing + +In coordination with the NAACL 2022 team and the ACL executive committee, we decided to fully adopt the ACL Rolling Review (ARR) as the only reviewing platform for ACL 2022. ARR is a new review system for *ACL conferences, where reviewing and acceptance of papers to publication venues is done in a two-step process: (i) centralized rolling review via ARR, and (ii) commitment to a publication venue, e.g., ACL 2022. The purpose of the ACL Rolling Review is to improve the efficiency and the turnaround of reviewing in *ACL conferences while keeping diversity (geographic and otherwise) and editorial freedom. + +As ACL 2022 is the first conference to fully adopt the ARR review process, we worked very closely with ARR and we coordinated our efforts with the NAACL 2022 PC chairs. In particular, given the short distance between ACL 2022 and NAACL 2022, we allowed authors to commit their papers to ACL 2022 and simultaneously to submit a revision to ARR in January, which were eligible for NAACL 2022. We also joined ARR as Guest Editors-in-Chief (EiCs) to help with the September-November submissions to ARR, which primarily targeted ACL 2022. We worked together to integrate ARR and some of the conference workflows to ensure scaling up, and to maintain the quality and the timely processing of the submissions for November, and thus to guarantee that all papers submitted by the November 15, 2021 ARR deadline could be considered for ACL 2022 if the authors decided to commit them. This required making sure we had all reviews and meta-reviews ready in time, which we managed to achieve thanks to the combined efforts of the ARR and the ACL 2022 teams. We would also like to note that this is a community effort, and we are grateful for the support of the authors, the reviewers, the Action Editors (AEs), and the Senior Area Chairs (SACs), who have been constructively engaging and helping with ARR and ACL 2022. + +# Committing to ACL 2022 + +The commitment form for ACL 2022 asked the authors to provide a link to their paper in ARR: we asked for a link to the latest version of the paper that had reviews and a meta-review. The authors also needed to select an area (including the Special Theme area) they were submitting their paper to (this was needed as ACL 2022 had areas, while ARR did not). Finally, the authors were allowed to submit optional comments to the ACL 2022 Senior Area Chairs (SACs). Note that these comments were only visible to the SACs, and they were not sent to the reviewers or to the Action Editors: the rationale was that responding to reviewers and Action Editors should be handled in a response letter if the authors decided to do a resubmission in ARR, which is a completely different process than committing a paper to ACL 2022. These comments to the SACs were designed mainly to raise concerns about objective misunderstandings by the reviewers and/or by the Action Editor about the technical aspect of the paper that the authors believed might help the SACs in their decision-making process. + +Areas While ARR did not have areas, ACL 2022 did: it had 23 areas, including the 22 areas from ACL 2021 plus our Special Theme. Our special theme was on "Language Diversity: from Low-Resource to Endangered Languages," to commemorate the 60th anniversary of ACL with the goal of reflecting and + +stimulating a discussion about how advances in computational linguistics and natural language processing can be used to promote language diversity from low-resource to endangered languages. We invited papers that discuss and reflect on the "role of the speech and language technologies in sustaining language use" (Bird, 2020) for the large variety of world languages with focus on under-resourced, indigenous, and/or endangered languages. We were interested in the challenges for developing and scaling up the current NLP technologies for the rich diversity of human languages and in the ethical, cultural, and policy implications of such technologies for local communities. We also have a best Theme paper award category. + +# Acceptance to ACL 2022 + +As ACL 2022 submissions in ARR, we count all papers from September, October, and November, which we advertised as ACL 2022 months, after removing all re-submissions and also nine papers that selected NAACL 2022 as a preferred venue (a total of 3,360 papers) + the papers from the May–August period that were actually committed to ACL 2022 and that were not resubmissions (a total of 18 papers), for a total of 3,378 papers. + +This number is on par with the number of submissions to ACL 2021, which received 3,350 submissions. Subsequently, 1,918 papers were committed to ACL 2022 (i.e., $57\%$ ). After the review process, 701 papers (604 long and 97 short) were accepted into the main conference. + +# Acceptance Rates for the Main Conference + +The quality of a conference is often perceived based on the acceptance rate of the papers submitted there, and thus it is important to have an acceptance rate that adequately represents the difficulty of publishing a paper in the conference. Given the adoption of ARR, it is also important to allow for consistency across various conferences. Thus, ACL 2022 (and NAACL 2022) adopted the following two ways of calculating the acceptance rates: + +(a) (Number of accepted papers at ACL 2022) / (Number of papers that selected ACL 2022 as the preferred venue in ARR or were committed to ACL 2022). For ACL 2022, for the denominator we consider the 3,378 papers as explained above. Thus, the acceptance rate is $\frac{701}{3,378} = 20.75\%$ for the Main conference. +(b) (Number of accepted papers at ACL 2022) / (Number of papers committed to ACL 2022). For the denominator, we had 1,918 papers committed to ACL 2022, and thus, the acceptance rate is $701 / 1,918 = 36.54\%$ for the Main conference. + +Note that option (a) is closer to the way the acceptance rate was computed at previous *ACL conferences, where submitting and committing a paper was done in one step and papers were rarely withdrawn after the reviews, the meta-reviews, and the corresponding scores were released. However, one issue with this option for ACL 2022 was that indicating a preferred venue was only enabled starting with the October ARR submissions, and it was not available for earlier months. As mentioned above, we removed a small number of papers from our denominator that selected NAACL 2022 as a preferred venue in October and November (a total of 9 papers) and we considered the ARR submissions only for the months of September, October, and November, as these months were advertised in our CFP, plus any papers that were committed to ACL 2022 from earlier months (May-July) and which were also not resubmissions. Option (b) yields a higher "acceptance rate", as many authors with low reviewing scores chose not to commit their paper to ACL 2022. + +# Best Paper Awards + +From the committed ACL 2022 papers, we selected 32 papers as candidates for the following Best Paper awards, based on nominations by the Senior Area Chairs: Best Research Paper, Best Special Theme + +Paper, Best Resource Paper, and Best Linguistic Insight Paper. These papers were assessed by the Best Paper Award Committee. The selected best papers will be presented in a dedicated plenary session for Best Paper Awards on May 24, 2022. + +# Findings of ACL 2022 + +Given the success of the Findings at EMNLP 2020 and 2021 and ACL-IJCNLP 2021, we also have Findings of ACL 2022 papers, which are papers that were not accepted for publication in the main conference, but nonetheless were assessed by the Program Committee as solid work with sufficient substance, quality, and novelty. A total of 361 papers were offered to be included in the Findings of ACL 2022. Given the two ways of computing acceptance rates described above, this results in a $10.68\%$ acceptance rate in option (a), and $19.82\%$ in option (b). Out of the 361 papers, 30 papers declined the offer, leading to 331 papers to be published in the Findings of ACL 2022. In order to increase the visibility of the Finding of ACL 2022 papers, we offered the authors of these 331 papers the possibility to present their work as a poster at ACL 2022, in addition to making a 6-minute or a 3-minute video to be included in the virtual conference site (for long and for short papers, respectively). The authors of 305 of the 331 papers accepted our invitation to present their work as a poster at ACL 2022. + +# TACL and Computational Linguistics + +Continuing the tradition from previous years, ACL 2022 also features 43 articles that were published at the Transactions of the Association for Computational Linguistics (TACL) and 8 papers from the Computational Linguistics journal. + +# Keynote and Invited Speakers + +Another highlight of our program are the keynotes, which we run in three different formats: + +- a keynote talk by Angela Friederici (Max Planck Institute for Human Cognitive and Brain Sciences) on "Language in the Human Brain"; +- a keynote fire-side chat on "The Trajectory of ACL and the Next 60 years" with Barbara Grosz (Harvard University) and Yejin Choi (University of Washington and Allen Institute for Artificial Intelligence), moderated by Rada Mihalcea (University of Michigan); +- a keynote panel on "How can we support linguistic diversity?" led by Steven Bird (Charles Darwin University), with panelists representing a variety of world languages, including (currently confirmed) Teresa Lynn (Irish), Robbie Jimerson (Seneca), Heather Long (Creole languages), and Manuel Mager (Wixaritari). + +We further had two additional invited talk initiatives: + +- Spotlight Talks by Young Research Stars (STIRS) by Eunsol Choi (University of Texas at Austin), Ryan Cotterell (ETH Zurich), Sebastian Ruder (Google, London), Swabha Swayamdipta (Allen Institute for AI), and Divi Yang (Georgia Tech); +- Next Big Ideas Talks by Marco Baroni (Pompeu Fabra University), Eduard Hovy (The University of Melbourne and Carnegie Mellon University), Heng Ji (UIUC), Mirella Lapata (University of Edinburgh), Hang Li (Bytedance Technology), Dan Roth (University of Pennsylvania and Amazon), and Thamar Solorio (University of Houston). + +# Thank You + +ACL 2022 is the result of a collaborative effort and a supportive community, and we want to acknowledge the efforts of so many people who have made significant efforts into the organization of ACL 2022! First of all, we would like to thank our Program Committee (the full list of names is quite long and it is included in the Program Committee pages of the Proceedings): + +- Our awesome 82 Senior Area Chairs who were instrumental in every aspect of the review process, from liaising with ARR, to supporting the implementation of a two-stage reviewing system, recommending Action Editors and reviewers, working on paper acceptance, and nomination of best papers and outstanding reviewers. For all of them, this involved familiarizing themselves with a new protocol to accommodate the integration of ARR reviews and a new system, and for many of them, the scope of their responsibilities was equivalent to chairing a small conference. +- The 363 ARR Action Editors (from the June-November ARR cycles), who had the role of ACL 2022 Area Chairs interacting with reviewers, leading paper review discussions, and writing meta-reviews. +- The 2,323 ARR reviewers (from the June-November ARR cycles), who contributed for the ACL 2022 reviewing cycles, providing valuable feedback to the authors. +- The emergency ARR Action Editors and reviewers, who provided their support at the last minute to ensure a timely reviewing process. +- The amazing ARR team, who collaborated in the challenge of managing and implementing the ARR reviewing needed for the scale of ACL 2022. In particular, we acknowledge Amanda Stent and Goran Glavaš as Guest ARR Editors-in-Chief for ACL 2022, Graham Neubig as Guest ARR Chief Technical Officer for ACL 2022, and Sara Goggi as Guest ARR Editorial Manager for ACL 2022. + +ACL 2022 counted on the contributions of many wonderful committees, including: + +- Our Best Paper Selection Committee, who selected the best papers and the outstanding papers: Tim Baldwin, Kathleen McKeown, David Chiang, Min-Yen Kan, and Taro Watanabe. +- Our Ethics Advisory Committee, chaired by Christiane Fellbaum and Su Lin Blodgett, for their hard work to ensure that all the accepted papers addressed the ethical issues appropriately, under a very tight schedule and on a new platform. +- Our amazing Publication Chair Danilo Croce, our Handbook Chair Marco Polignano, the Technical OpenReview Chair Rodrigo Wilkens, and the Scheduler Chair Jordan Zhang, who jointly with the NAACL 2022 Publication Chair, Ryan Cotterell, made an enormous contribution to the community by implementing the integration scripts for generating the proceedings, the handbook and the schedule from the OpenReview platform. +- Our Publicity Chairs Isabelle Augenstein, Emmanuele Chersoni, Diana Maynard, Soujanya Poria, and Joel Tetreault, for their work on managing the communications on social media platforms. +- The Internal Communications Chair Marcely Boito Zanon for streamlining the processes. +- The wonderful Technical OpenReview Chair Rodrigo Wilkens, who went above and beyond to ensure that the typical ACL conference functionalities were translated to a new environment. + +We would also like to thank many people who helped us with various software used for the conference: + +- The ARR Tech team, in particular Sebastin Santy and Yoshitomo Matsubara, who served as Guest ARR Tech Team for ACL 2022. + +- The OpenReview team, in particular Nadia L'Bahy, Celeste Martinez Gomez, and Melisa Bok, who helped to implement the integration of ARR as a reviewing platform for ACL 2022. +- The whole Underline team, in particular Sol Rosenberg, Jernej Masnec, Damira Mršić, and Mateo Antonic, who created a virtual site for the conference. + +As Program chairs, we had to deal with many tasks, including handling new protocols and situations and a new conference management environment. We would not be able to complete these tasks without the advice from our colleagues, including + +- Our fantastic General Chair Bernardo Magnini, who provided invaluable support and feedback throughout the whole process, including collaborating on the efforts to take on the challenge of reengineering the conference reviewing processes and pipeline. +- The Program Co-Chairs of NAACL 2022 Marine Carpuat, Marie-Catherine de Marneffe, and Ivan Vladimir Meza Ruiz, and the NAACL 2022 General Chair, Dan Roth, for collaborating in the challenge of coordinated adoption of ARR reviewing in a full scale for ACL 2022 and NAACL 2022. +- The Program Co-Chairs of previous editions of *ACL conferences, in particular the ACL-IJCNLP 2021 PC chairs Roberto Navigli, Fei Xia, and Wenjie Li, as well as the EMNLP 2021 PC chairs Lucia Specia, Scott Wen-tau Yih, and Xuanjing Huang for providing amazing guidance and support, and sharing their experience and answering our many questions, often on short notice. +- The ACL Executive Committee, especially Tim Baldwin (the ACL President), Rada Mihalcea (the ACL Past President), Shiqi Zhao (Secretary), Priscilla Rasmussen (Business Manager), and the members of the ACL executive committee for providing invaluable feedback and for helping us sort through various issues. +- The Computational Linguistics Editor-in-Chief Hwee Tou Ng, the TACL Editors-in-Chief Ani Nenkova and Brian Roark, and the TACL Editorial Assistant Cindy Robinson, for coordinating the Computational Linguistics and the TACL presentations at ACL 2022. + +We would also like to thank all the authors who submitted/committed their work to ACL 2022. Although we were only able to accept a small percentage of the submissions, your hard work makes this conference exciting and our community strong. Our huge thanks goes to the *ACL communities for the kind and patient support during a year of major changes in our submission and reviewing processes. + +Last, but not least, we thank our students, interns, postdocs, colleagues, and families for being so understanding and supportive during this intense year, and especially when we were swamped by countless conference deadlines and meetings. Our deepest gratitude is to all of you. We hope you will enjoy this 60th Anniversary edition of ACL. + +Smaranda Muresan (Columbia University and Amazon AWS AI Labs, USA) + +Preslav Nakov (Qatar Computing Research Institute, HBKU) + +Aline Villavicencio (University of Sheffield, UK) + +ACL 2022 Program Committee Co-Chairs + +# Message from the Local Chairs + +Back in March 2020, just after the first COVID-19 lockdown, we submitted our bid for Dublin to host ACL 2022, conference that you are currently attending. In November 2020, we learned that our bid had been successful, which we were of course delighted to hear. Of course, at that stage – and at many points in between – we have wondered whether we would be able to meet face-to-face at all, and it is great that we are able to host you in the wonderful city of Dublin where we are privileged to live, as well as accommodating many of you online. + +ACL is an opportunity to welcome not just our European friends and colleagues, but also those from farther afield. Ireland punches above its weight in the areas of NLP and Machine Learning, principally through the SFI-funded €100 million ADAPT Centre for Digital Content Technology, which comprises experts from 4 local Dublin universities as well as 4 further universities from across the country in a range of disciplines in AI. We have internationally renowned groups in machine translation, information retrieval, speech technology, parsing and grammar Induction, among others, so we believe it is appropriate that ACL is being held in our country for the first time. We are of course grateful to everyone who submitted a paper; whether your work was selected for presentation or not, if no-one had submitted, we wouldn't have had a conference. For those of you whose work was selected for presentation, many thanks for coming to Dublin, or for presenting online. + +Along the way, we have been helped greatly by the General Chair Bernardo Magnini, and by Priscilla Rasmussen and others from the ACL executive team, to whom we are extremely thankful. However, by far the biggest thanks are due to Greg Carew and his team in Abbey Conference and Events for their professional support of the conference. You will have met them at registration, and they are available throughout the event to ensure your needs are met. We have been engaging with them for 2 years now on ACL, and for longer as they helped Andy host the MT Summit in 2019. We could not have made a better choice of PCO to assist us with all the requirements involved in hosting the best-regarded conference in our area. This has been a true partnership that has made this journey an enjoyable one. + +We are also extremely grateful to Fáilte Ireland for their extremely generous support of this conference, and to our PostDocs Guodong Xie & Pintu Lohar (with Andy at DCU), and Vasudevan Nedumpozhimana & Filip Klubička (with John at TUD) for their huge efforts to recruit and manage the small army of student volunteers. Finally, we really hope that you all enjoy the conference, that you benefit from the excellent programme that has been assembled, and that you go away from here having made new friends. We are fortunate indeed that many of our very best friends are in the computational linguistics community, and we will try our very best to meet as many of you as possible during the event. + +Andy Way (Dublin City University, Ireland) +John Kelleher (TU Dublin, Ireland) + +Local Chairs, ACL 2022 + +# Organizing Committee + +# General Chair + +Bernardo Magnini, FBK, Italy + +# Program Chairs + +Smaranda Muresan, Columbia University and Amazon AWS AI Labs, USA +Preslav Nakov, Qatar Computing Research Institute, HBKU, Qatar +Aline Villavicencio, University of Sheffield, UK + +# Local Organization Chairs + +John Kelleher, TU Dublin, Ireland +Andy Way, Dublin City University, Ireland + +# Workshop Chairs + +Elena Cabrio, Université Côte d'Azur, France +Sujian Li, Pekin University, China +Mausam, IIT Delhi, India + +# Tutorial Chairs + +Luciana Benotti, National University of Cordoba, Argentina +Naoaki Okazaki, Tokyo Institute of Technology, Japan +Yves Scherrer, University of Helsinki, Finland +Marcos Zampieri, Rochester Institute of Technology, USA + +# Demo Chairs + +Valerio Basile, University of Turin, Italy +Zornitsa Kozareva, Facebook AI Research, USA +Sanja Štajner, Symanto Research, Germany + +# Student Research Workshop Chairs + +Samuel Louvan, FBK, Italy +Andrea Madotto, HKUST, Hong Kong +Brielen Madureira, University of Potsdam, Germany + +# Student Research Workshop: Faculty Advisors + +Cecile Paris, CSIRO, Australia +Siva Reddy, McGill University, Canada +German Rigau, Basque Country University, Spain + +# Publicity and Social Media Chairs + +Isabelle Augenstein, University of Copenhagen, Denmark +Emmanuele Chersoni, The Hong Kong Polytechnic University, Hong Kong +Diana Maynard, University of Sheffield, UK +Soujanya Poria, Singapore University of Technology, Singapore +Joel Tetreault, Dataminr, USA + +# Publication Chairs + +Danilo Croce, University of Rome Tor Vergata, Italy +Ryan Cotterell, ETH Zürich, Switzerland +Jordan Zhang + +# Handbook Chair + +Marco Polignano, University of Bari Aldo Moro, Italy + +# Technical OpenReview Chair + +Rodrigo Wilkens, Université catholique de Louvain, Belgium + +# Conference App Chair + +Pierluigi Cassotti, University of Bari Aldo Moro, Italy + +# Diversity and Inclusion Chairs + +Mona Diab, Facebook AI Research & GWU, USA +Martha Yifiru Tachbelie, Addis Abada University, Ethiopia + +# Ethic Advisor Committee + +Su Lin Blodgett, Microsoft Research Montréal, Canada +Christiane Fellbaum, Princeton University, USA + +# Student Volunteer Coordinators + +Filip Klubicka, ADAPT Centre, Ireland +Pintu Lohar, ADAPT Centre, Ireland +Vasudevan Nedumpozhimana, ADAPT Centre, Ireland +Guodong Xie, ADAPT Centre, Ireland + +# Internal Communications Chair + +Marcely Boito Zanon, University of Avignon, France + +# Best Paper Selection Committee + +Tim Baldwin, MBZUAI and The University of Melbourne, Australia +Kathleen McKeown, Columbia University, USA and Amazon AWS AI Labs +David Chiang, University of Notre Dame, USA + +Min-Yen Kan, National University of Singapore, Singapore +Taro Watanabe, Nara Institute of Science and Technology, Japan + +# Guest ARR Editors-in-Chief for ACL 2022 + +Amanda Stent, Colby College, USA +Goran Glavaš, University of Mannheim, USA + +# Guest ARR Chief Technical Officer for ACL 2022 + +Graham Neubig, Carnegie Mellon University, USA + +# Guest ARR Editorial Manager for ACL 2022 + +Sara Goggi, CNR-ILC, Italy + +# Guest ARR Tech Team for ACL 2022 + +Yoshitomo Matsubara, UC Irvine, USA +Sebastin Santy, University of Washington, USA + +# Guest OpenReview Team for ACL 2022 + +Nadia L'Bahy, OpenReview +Celeste Martinez Gomez, OpenReview +Melisa Bok, OpenReview + +# Underline + +Sol Rosenberg, Underline +Jernej Masnec, Underline +Damira Mršić, Underline +Mateo Antonic, Underline +Luka Šimić, Underline + +# Conference Advisor + +Priscilla Rasmussen, ACL + +# Conference Registration + +Nicole Ballard, Yes Events +Terah Shaffer, Yes Events + +# Local PCO + +Greg Carew, Abbey Fiona McGillivray, Abbey Laird Smith, Abbey + +# Program Committee + +# Program Chairs + +Smaranda Muresan, Columbia University and Amazon AWS AI Labs + +Preslav Nakov, Qatar Computing Research Institute, HBKU + +Aline Villavicencio, University of Sheffield + +# Computational Social Science and Cultural Analytics + +Tanmoy Chakraborty, Indraprastha Institute of Information Technology Delhi + +David Jurgens, University of Michigan + +Diyi Yang, Georgia Institute of Technology + +# Dialogue and Interactive Systems + +Srinivas Bangalore, Interactions LLC + +Yun-Nung Chen, National Taiwan University + +David Traum, University of Southern California + +Dilek Hakkani-Tur, Amazon Alexa AI + +Zhou Yu, Columbia University + +# Discourse and Pragmatics + +Manfred Stede, Universität Potsdam + +Junyi Jessy Li, University of Texas, Austin + +# Ethics and NLP + +Saif M. Mohammad, National Research Council Canada + +Malvina Nissim, University of Groningen + +# Generation + +Claire Gardent, CNRS + +Asli Celikyilmaz, Facebook AI Research + +Chenghua Lin, University of Sheffield + +Michael Elhadad, Ben Gurion University of the Negev + +# Information Extraction + +Heng Ji, University of Illinois, Urbana-Champaign and Amazon Alexa AI + +Marius Pasca, Google Research + +Alan Ritter, Georgia Institute of Technology + +Veselin Stoyanov, Facebook + +Satoshi Sekine, RIKEN + +# Information Retrieval and Text Mining + +Hang Li, Bytedance Technology + +Marti Hearst, University of California Berkeley + +Jing Jiang, Singapore Management University + +# Interpretability and Analysis of Models for NLP + +Yonatan Belinkov, Technion, Technion + +Anders Søgaard, Copenhagen University + +Anna Rogers, University of Copenhagen + +Hassan Sajjad, Qatar Computing Research Institute, HBKU + +# Language Grounding to Vision, Robotics and Beyond + +William Yang Wang, UC Santa Barbara + +Marie-Francine Moens, KU Leuven + +# Linguistic theories, Cognitive Modeling and Psycholinguistics + +Frank Keller, The University of Edinburgh + +Afra Alishahi, Tilburg University + +# Machine Learning for NLP + +Mohit Bansal, University of North Carolina at Chapel Hill and Amazon Alexa AI + +Nikolaos Aletras, University of Sheffield, University of Sheffield and Amazon + +Andre Martins, Instituto Superior Técnico and Unbabel + +Andreas Vlachos, Facebook and University of Cambridge + +Kristina Toutanova, Google + +Shafiq Joty, SalesForce and Nanyang Technological University + +# Machine Translation and Multilinguality + +Taro Watanabe, Nara Institute of Science and Technology + +Rico Sennrich, University of Zurich and University of Edinburgh + +Francisco Guzmán, Facebook + +Philipp Koehn, Facebook and Johns Hopkins University + +Kenneth Heafield, The University of Edinburgh + +Thamar Solorio, University of Houston + +# NLP Applications + +Joel R. Tetreault, Dataminr + +Karin Verspoor, Royal Melbourne Institute of Technology + +Jimmy Lin, University of Waterloo + +Horacio Saggion, Universitat Pompeu Fabra + +Wei Gao, Singapore Management University + +Beata Beigman Klebanov, Educational Testing Service + +# Phonology, Morphology and Word Segmentation + +Ryan D Cotterell, ETH Zürich + +Alexis Palmer, University of Colorado, Boulder + +# Question Answering + +Mohit Iyyer, University of Massachusetts Amherst + +Sanda Harabagiu, University of Texas at Dallas + +Alessandro Moschitti, Amazon Alexa AI + +# Resources and Evaluation + +Torsten Zesch, University of Duisburg-Essen + +Agata Savary, Université Paris-Saclay + +Katrin Erk, University of Texas, Austin + +Pablo Gamallo, Universidad de Santiago de Compostela + +Bonnie L. Webber, The University of Edinburgh + +# Semantics: Lexical + +Carlos Ramisch, Aix Marseille University + +Ekaterina Shutova, University of Amsterdam + +Ivan Vulic, University of Cambridge and PolyAI Limited + +# Semantics: Sentence-level Semantics, Textual Inference and Other areas + +Samuel R. Bowman, New York University + +Goran Glavas, University of Mannheim + +Valeria de Paiva, Topos Institute + +Renata Vieira, Universidade de Evora + +Wei Lu, Singapore University of Technology and Design + +# Sentiment Analysis, Stylistic Analysis, and Argument Mining + +Yulan He, The university of Warwick + +Iryna Gurevych, TU Darmstadt + +Roman Klinger, University of Stuttgart + +Bing Liu, University of Illinois at Chicago + +# Special Theme + +Emily M. Bender, University of Washington + +Laurent Besacier, Naver Labs Europe + +Steven Bird, Charles Darwin University and International Computer Science Institute + +# Speech and Multimodality + +Grzegorz Chrupa, Tilburg University + +Yang Liu, Amazon Alexa AI + +# Summarization + +Kathleen McKeown, Columbia University and Amazon AWS AI Labs + +Annie Louis, Google Research Dragomir Radev, Yale University + +# Syntax: Tagging, Chunking and Parsing + +Barbara Plank, IT University of Copenhagen +Joakim Nivre, Uppsala University + +# Action Editors + +Zeljko Agic, Alan Akbik, Md Shad Akhtar, Firoj Alam, Nikolaos Aletras, Malihe Alikhani, Tanel Alumäe, Sophia Ananiadou, Antonios Anastasopoulos, Mark Anderson, Jacob Andreas, Xiang Ao, Marianna Apidianaki, Yuki Arase, Mikel Artetxe, Ehsaneddin Asgari, Giuseppe Attardi + +Niranjan Balasubramanian, Timothy Baldwin, Miguel Ballesteros, David Bamman, Mohamad Hardyman Barawi, Jeremy Barnes, Loic Barrault, Roberto Basili, Ali Basirat, Jasmijn Bastings, Daniel Beck, Iz Beltagy, Luciana Benotti, Steven Bethard, Chandra Bhagavatula, Lidong Bing, Alexandra Birch, Steven Bird, Yonatan Bisk, Eduardo Blanco, Danushka Bollegala, Antoine Bosselet, Florian Boudin, Leonid Boytsov, Chloe Braud, Chris Brew, Wray Buntine + +Elena Cabrio, Aoife Cahill, Andrew Caines, Rumen Cakici, Marie Candito, Yanan Cao, Ziqiang Cao, Cornelia Caragea, Xavier Carreras, Paula Carvalho, Andrew Cattle, Daniel Cer, Alessandra Cervone, Tanmoy Chakraborty, Muthu Kumar Chandrasekaran, Angel X Chang, Kai-Wei Chang, Snigdha Chaturvedi, Boxing Chen, Danqi Chen, Kehai Chen, Kuan-Yu Chen, Lei Chen, Yun-Nung Chen, Colin Cherry, Jackie CK Cheung, Hai Leong Chieu, Luis Chiruzzo, Jinho D. Choi, Monojit Choudhury, Khalid Choukri, Grzegorz Chrupała, Oana Cocarascu, Trevor Cohn, John M Conroy, Mathieu Constant, Caio Filippo Corro, Marta Ruiz Costa-jussà, Stefano Cresci, Aron Culotta + +Giovanni Da San Martino, Raj Dabre, Walter Daelemans, Daniel Dakota, Dipanjan Das, Johannes Daxenberger, Gael De Chalendar, Miryam De Lhoneux, Pascal Denis, Leon Derczynski, Barry Devereux, Mona T. Diab, Liang Ding, Georgiana Dinu, Jesse Dodge, Li Dong, Ruihai Dong, Yue Dong, Eduard Dragut, Kevin Duh, Nadir Durrani, Greg Durrett + +Liat Ein-Dor, Michael Elhadad, Katrin Erk, Allyson Ettinger + +Angela Fan, Anna Feldman, Naomi Feldman, Yang Feng, Yansong Feng, Raquel Fernández, Francis Ferraro, Elisabetta Fersini, Simone Filice, Mark Fishel, Annemarie Friedrich, Pascale Fung + +Michel Galley, Matthias Galle, Zhe Gan, Yang Gao, Marcos Garcia, Sebastian Gehrmann, Alborz Geramifard, Debanjan Ghosh, Goran Glavas, Kyle Gorman, Jiatao Gu, Qing Gu, Honglei Guo, Qipeng Guo, Francisco Guzmán + +Ivan Habernal, Christian Hardmeier, David Harwath, Luheng He, Yulan He, Zhongjun He, Daniel Hershcovich, Julia Hockenmaier, Enamul Hoque, Baotian Hu, Junjie Hu, Shujian Huang, Xuanjing Huang + +Dmitry Ilvovsky, Kentaro Inui, Ozan Irsoy, Srini Iyer, Mohit Iyyer + +Cassandra L Jacobs, Alon Jacovi, Kokil Jaidka, Hyeju Jang, Yangfeng Ji, Antonio Jimeno Yepes, Shafiq Joty, Preethi Jyothi + +Sarvnaz Karimi, Shubhra Kanti Karmaker, Daisuke Kawahara, Daniel Khashabi, Jin-Dong Kim, + +Seokhwan Kim, Taeuk Kim, Judith Lynn Klavans, Roman Klinger, Hayato Kobayashi, Ekaterina Kochmar, Mamoru Komachi, Grzegorz Kondrak, Parisa Kordjamshidi, Amrith Krishna, Udo Kruschwitz, Marco Kuhlmann, Sumeet Kumar, Jonathan K Kummerfeld + +Wai Lam, Zhenzhong Lan, Mark Last, Hady W. Lauw, Carolin Lawrence, John Lawrence, Alessandro Lenci, Lori Levin, Omer Levy, Mike Lewis, Jing Li, Junhui Li, Juntao Li, Junyi Jessy Li, Liangyou Li, Piji Li, Sujian Li, Tianrui Li, Wenjie Li, Zongxi Li, Constantine Lignos, Chenghua Lin, Dekang Lin, Marco Lippi, Pengfei Liu, Qun Liu, Wu Liu, Xuebo Liu, Yang Liu, Yang Liu, Zhiyuan Liu, Kyle Lo, Wei Lu, Thang Luong, Anh Tuan Luu + +Wilson Ma, Craig MacDonald, Nitin Madnani, Andrea Madotto, Navonil Majumder, Prodromos Malakasiotis, Igor Malioutov, Thomas Mandl, Vukosi Marivate, Eugenio Martinez-Camara, Bruno Martins, Yuji Matsumoto, Mausam, David McClosky, Mahnoosh Mehrabani, Ivan Vladimir Meza Ruiz, Margot Mieskes, Makoto Miwa, Daichi Mochihashi, Saif M. Mohammad, Mohamed Morchid, David R Mortensen, Alessandro Moschitti, Lili Mou, Philippe Muller, Kenton Murray + +Nona Naderi, Courtney Napoles, Shashi Narayan, Franco Maria Nardini, Tristan Naumann, Mark-Jan Nederhof, Vincent Ng, Dat Quoc Nguyen, Thien Huu Nguyen, Jan Niehues, Qiang Ning + +Diarmuid O Seaghdha, Brendan O'Connor, Jose Ochoa-Luna, Kemal Oflazer, Maciej Ogrodniczuk, Alice Oh, Naoaki Okazaki, Manabu Okumura, Matan Orbach, Miles Osborne, Jessica Ouyang + +Hamid Palangi, Ankur P Parikh, Joonsuk Park, Seong-Bae Park, Yannick Parmentier, Tommaso Pasini, Rebecca J. Passonneau, Viviana Patti, Haoruo Peng, Nanyun Peng, Gabriele Pergola, Fabio Petroni, Maxime Peyrard, Juan Pino, Emily Pitler, Edoardo Ponti, Simone Paolo Ponzetto, Kashyap Popat, Maja Popovic, Soujanya Poria, Vinodkumar Prabhakaran, Daniel Preotiac-Pietro, Emily Prud'hommeaux + +Tieyun Qian, Xipeng Qiu, Xiaojun Quan + +Colin Raffel, Ganesh Ramakrishnan, Siva Reddy, Ines Rehbein, Roi Reichart, Xiang Ren, Yafeng Ren, Sebastian Riedel, Sara Rosenthal, Joseph Le Roux, Alla Rozovskaya, Attapol Rutherford + +Mrinmaya Sachan, Benoit Sagot, Hassan Sajjad, Chinnadhurai Sankar, Maarten Sap, Nathan Schneider, Hinrich Schuetze, H. Schwartz, Lane Schwartz, Rico Sennrich, Minjoon Seo, Bei Shi, Tianze Shi, Lei Shu, Melanie Siegel, Kevin Small, Noah Smith, Luca Soldaini, Vivek Srikumar, Shashank Srivastava, Efstathios Stamatatos, Gabriel Stanovsky, Pontus Stenetorp, Amanda Stent, Veselin Stoyanov, Karl Stratos, Emma Strubell, Sara Stymne, Jinsong Su, Yu Su, Saku Sugawara, Jun Suzuki + +Dima Taji, Zeerak Talat, Duyu Tang, Amalia Todirascu, Antonio Toral, Paolo Torroni, Kristina Toutanova, Amine Trabelsi, Trang Tran, Chen-Tse Tsai, Junichi Tsujii, Kewei Tu + +Stefan Ultes + +Olga Vechtomova, Giulia Venturi, Suzan Verberne, Yannick Versley, David Vilares, Serena Villata, Thuy Vu, Ivan Vulić, Yogarshi Vyas + +Byron C Wallace, Xiaojun Wan, Jingjing Wang, Longyue Wang, Shuai Wang, Xin Eric Wang, Zhiguang Wang, Leo Wanner, Shinji Watanabe, Taro Watanabe, Bonnie L. Webber, Zhongyu Wei, Michael White, Alina Wróblewska, Lijun Wu + +Tong Xiao, Deyi Xiong, Hainan Xu, Wei Xu + +Rui Yan, Min Yang, Jin-Ge Yao, Wenpeng Yin, Koichiro Yoshino, Dian Yu, Jianfei Yu, Kai Yu, Mo Yu, Tao Yu, François Yvon + +Marcos Zampieri, Fabio Massimo Zanzotto, Luke Zettlemoyer, Justine Zhang, Weinan Zhang, Xiangliang Zhang, Xingxing Zhang, Yi Zhang, Yue Zhang, Zhe Zhang, Xiaqing Zheng, Michael Zock + +# ARR reviewers + +Micheal Abaho, Ahmed Abdelali, Mostafa Abdou, Muhammad Abdul-Mageed, Omri Abend, Abdelghani Abujabal, Lasha Abzianidze, Manoj Acharya, Heike Adel, David Ifeoluwa Adelani, Somak Aditya, Vaibhav Adlakha, Stergos D. Afantenos, Sachin Agarwal, Vibhav Agarwal, Rodrigo Agerri, Manex Agirrezabal, Ameeta Agrawal, Priyanka Agrawal, Sweta Agrawal, Gustavo Aguiar, Roee Aharoni, Wasi Uddin Ahmad, Benyamin Ahmadnia, Aman Ahuja, Chaitanya Ahuja, Kabir Ahuja, Xi Ai, Laura Aina, Akiko Aizawa, Alan Akbik, Md Shad Akhtar, Nader Akoury, Ekin Akyurek, Ozge Alacam, Firoj Alam, Mehwish Alam, Chris Alberti, Georgios Alexandridis, David Alfter, Bashar Alhafni, Raquel G. Alhama, Tariq Alhindi, Hamed Alhoori, Hassan Alhuzali, Mohammad Aliannejadi, Afra Alishahi, Tamer Alkhouli, Emily Allaway, Miguel A. Alonso, Sawsan Alqahtani, Emily Alsentzer, Milad Alshomary, Christoph Alt, Tanel Alumae, Fernando Alva-Manchego, Rami Aly, Maxime Amblard, Prithviraj Ammanabrolu, Reinald Kim Amplayo, Chantal Amrhein, Aixiu An, Guozhen An, Ashish Anand, Sophia Ananiadou, Raviteja Anantha, Antonios Anastasopoulos, Carolyn Jane Anderson, Nicholas Andrews, Ion Androutsopoulos, Gabor Angeli, Diego Antognini, Kaveri Anuranjana, Emilia Apostolova, Jun Araki, Rahul Aralikatte, Eiji Aramaki, Yuki Arase, Arturo Argueta, Mozhdeh Arianezhad, Ignacio Arroyo-Fernandez, Katya Artemova, Yoav Artzi, Masayuki Asahara, Akari Asai, Meysam Asgari, Elliott Ash, Zhenisbek Assylbekov, Duygu Ataman, Dennis Aumiller, Eleftherios Avramidis, Parul Awasthy, Hosein Azarbonyad, Wilker Aziz + +Rohit Babbar, Sanghwan Bae, Ebrahim Bagheri, Dzmitry Bahdanau, Ashutosh Baheti, Fan Bai, He Bai, Yu Bai, JinYeong Bak, Vidhisha Balachandran, Mithun Balakrishna, Anusha Balakrishnan, Niranjan Balasubramanian, Ioana Baldini, Livio Baldini Soares, Kalika Bali, Nicolae Banari, Juan M Banda, Pratyay Banerjee, Sameer Bansal, Trapit Bansal, Forrest Sheng Bao, Hangbo Bao, Jianzhu Bao, Junwei Bao, Siqi Bao, Yu Bao, Zuyi Bao, Ankur Bapna, Roy Bar-Haim, Edoardo Barba, Francesco Barbieri, Denilson Barbosa, M Saiful Bari, Ken Barker, Gianni Barlacchi, Jeremy Barnes, Maria Barrett, Valentin Barriere, James Barry, Max Bartolo, Pierpaolo Basile, Valerio Basile, Somnath Basu Roy Chowdhury, John A. Bateman, Riza Batista-Navarro, Anil Batra, Khuyagbaatar Batsuren, Daniel Bauer, Timo Baumann, Rachel Bawden, Kathy Baxter, Tilman Beck, Lee Becker, Lisa Beinborn, Ahmad Beirami, Giannis Bekoulis, Nuria Bel, Eric Bell, Gabor Bella, Meriem Beloucif, Iz Beltagy, Eyal Ben-David, Emily M. Bender, Michael Bendersky, Luisa Bentivogli, Adrian Benton, Jonathan Berant, Alexandre Berard, Gabor Berend, Taylor Berg-Kirkpatrick, Toms Bergmanis, Rafael Berlanga, Delphine Bernhard, Dario Bertero, Laurent Besacier, Chandra Bhagavatula, Rishabh Bhardwaj, Aditya Bhargava, Suma Bhat, Parminder Bhatia, Sumit Bhatia, Kasturi Bhattacharjee, Pushpak Bhattacharyya, Satwik Bhattamishra, Shruti Bhosale, Rajarshi Bhowmik, Bin Bi, Wei Bi, Federico Bianchi, Laura Biester, Yi Bin, Lidong Bing, Philippe Blache, Fred Blain, Eduardo Blanco, Terra Blevins, Rexhina Blloshmi, Jelke Bloem, Michael Bloodgood, Valts Blukis, Ben Bogin, Nikolay Bogoychev, Ondrej Bojar, Gemma Boleda, Danushka Bollegala Marcel Bollmann, Valeriia Bolotova,Daniele BonadimanFrancis BondClaudia Borg,Mihae + +la Bornea, Aurélien Bossard, Antoine Bosselut, Robert Bossy, Nadjet Bouayad-Agha, Florian Boudin, Zied Bouraoui, Samuel R. Bowman, Jordan Lee Boyd-Graber, Johan Boye, Kristy Elizabeth Boyer, Faeze Brahman, Arthur Brazinskas, Thomas Brochhagen, Samuel Broscheit, Thomas Brovelli, Christopher Bryant, Paweł Budzianowski, Emanuele Bugliarello, Wray Buntine, Joan Byamugisha, Bill Byrne + +Sky CH-Wang, Subalitha CN, Elena Cabrio, Avi Caciularu, Samuel Cahyawijaya, Deng Cai, Han Cai, Hengyi Cai, Jon Cai, Pengshan Cai, Yi Cai, Andrew Caines, Agostina Calabrese, Iacer Calixto, Jose Camacho-Collados, Erik Cambria, Oana-Maria Camburu, Giovanni Campagna, Leonardo Campillos-Llanos, Daniel F Campos, Jon Ander Campos, Marie Candito, Jie Cao, Juan Cao, Kris Cao, Meng Cao, Qingqing Cao, Qingxing Cao, Ruisheng Cao, Steven Cao, Yixin Cao, Yu Cao, Yuan Cao, Yue Cao, Yunbo Cao, Annalina Caputo, Doina Caragea, Dallas Card, Ronald Cardenas, Remi Cardon, Danilo Carvalho, Tommaso Caselli, Justine Cassell, Vittorio Castelli, Giuseppe Castellucci, Thiago Castro Ferreira, Paulo Cavalin, Christophe Cerisara, Alessandra Cervone, Arun Tejasvi Chaganty, Soumen Chakrabarti, Abhisek Chakrabarty, Tuhin Chakrabarty, Tanmoy Chakraborty, Bharathi Raja Chakravarthi, Ilias Chalkidis, Jon Chamberlain, Nathanael Chambers, Angel X Chang, Baobao Chang, Haw-Shiuan Chang, Jonathan P. Chang, Serina Chang, Xuankai Chang, Lidia S. Chao, WenHan Chao, Akshay Chaturvedi, Aditi Chaudhary, Vishrav Chaudhary, Wanxiang Che, Bei Chen, Bo Chen, Chenhua Chen, Chung-Chi Chen, Danqi Chen, Daoyuan Chen, Guanhua Chen, Guanyi Chen, Hanjie Chen, Hongshen Chen, Howard Chen, Huimin Chen, Jiaze Chen, Jifan Chen, John Chen, Kehai Chen, Lei Chen, Lin Chen, Long Chen, Lu Chen, Luoxin Chen, Maximillian Chen, Mei-Hua Chen, Meng Chen, Mingda Chen, Minhua Chen, Mu-hao Chen, Pei Chen, Pinzhen Chen, Qian Chen, Qianglong Chen, Qingcai Chen, Sanxing Chen, Shizhan Chen, Tao Chen, Wang Chen, Wei-Fan Chen, Wenhu Chen, Wenliang Chen, Wenqing Chen, Xilun Chen, Xinchi Chen, Xiusi Chen, Xiuying Chen, Yen-Chun Chen, Yubo Chen, Yue Chen, Yufeng Chen, Yulong Chen, Yun Chen, Yun-Nung Chen, Yunmo Chen, Zhi Chen, Zhihong Chen, Zhuang Chen, Zhumin Chen, Zhuohao Chen, Fei Cheng, Hao Cheng, Jianpeng Cheng Liying Cheng Lu Cheng Minhao Cheng Pengxiang Cheng Pengyu Cheng Weiwei Cheng Yong Cheng Yu Cheng Emmanuele Chersoni Ethan A Chi Ta-Chung Chi Zewen Chi Yew Ken Chia David Chiang Ting-Rui Chiang Patricia Chiral Francisco Javier Chiyah-Garcia Jaemin Cho Sangwoo Cho Won Ik Cho Eleanor Chodroff Eunsol Choi Jaesik Choi Jinho D. Choi Seungtaek Choi Shamil Chollampatt Jaegul Choo Leshem Choshen Prafulla Kumar Choubey Monojit Choudhury Jishnu Ray Chowdhury Md Faisal Mahbub Chowdhury Shammur Absar Chowdhury Christos Christodoulopoulos Fenia Christopoulou Alexandra ChronopoulouChenhui Chu Christopher Chu Zewei Chu Tat-Seng Chua Jin-Woo Chung Yi-Ling Chung Kenneth Church Abu Nowshed Chy Mark Cieliebak Manuel Rafael Ciosici Volkan Cirik Christopher Clark Elizabeth Clark Kevin Clark Miruna Clinciu Louis Clouatre,Trevor Cohen Jeremy R.Cole Marcus D. Collins Simone Conia Mathieu Constant,Danish Contractor Robin Cooper Anna Corazza Luciano Del Corro Ryan D Cotterell Josep Crego Danilo Croce Paul A. Crook James Cross Fermin L. Cruz Heriberto Cuayahuitl Lei Cui Leyang Cui Shaobo Cui Yiming Cui Washington Cunha Anna CurreyTonya Custis Erion Cano + +Luis Fernando D'Haro, Jennifer D'Souza, Giovanni Da San Martino, Raj Dabre, Deborah A. Dahl, Damai Dai, Falcon Z Dai, Hongliang Dai, Wenliang Dai, Xiang Dai, Xinyu Dai, Yinpei Dai, Siddharth Dalmia, Sandipan Dandapat, Ankit Dangi, Marina Danilevsky, Verna Dankers, Anubrata Das, Rajarshi Das, Sarthak Dash, Pradeep Dasigi, Debajyoti Datta, Hal Daumé Iii, Sam Davidson, Brian Davis, Ernest Davis, Gaël De Chalendar, Christine De Kock, Kordula De Kuthy, Miryam De Lhoneux, Marie-Catherine De Marneffe, Gerard De Melo, José G. C. De Souza, Iria De-Dios-Flores, Steve DeNeefe, Alok Debnath, Mathieu Dehouck, Flor Miriam Plaza Del Arco, Marco Del Tredici, Agustín D. Delgado, Louise Deléger, David Demeter, Căgatay Demiralp, Yang Deng, Yuntian Deng, Zhongfen Deng, Tejaswini Deoskar, Jan Milan Deriu, Franck Dernoncourt, + +Tim Dettmers, Daniel Deutsch, Sunipa Dev, Joseph Dexter, Kuntal Dey, Bhuwan Dhingra, Luigi Di Caro, Barbara Di Eugenio, Shizhe Diao, Gael Dias, Chenchen Ding, Haibo Ding, Kaize Ding, Liang Ding, Ning Ding, Shuoyang Ding, Xiao Ding, Stefanie Dipper, Nemanja Djuric, Ngoc Bich Do, Simon Dobnik, Jesse Dodge, Charles Dognin, Miguel Domingo, Lucia Donatelli, Domenic Donato, Li Dong, MeiXing Dong, Qian Qian Dong, Yue Dong, Bonaventure F. P. Dossou, Longxu Dou, Zi-Yi Dou, Doug Downey, A. Seza Dogruoz, Mark Dras, Markus Dreyer, Rotem Dror, Andrew Drozdov, Jingfei Du, Jinhua Du, Lan Du, Li Du, Mengnan Du, Pan Du, Wanyu Du, Xinya Du, Yupei Du, Junwen Duan, Xiangyu Duan, Kumar Avinava Dubey, Pablo Duboue, Philipp Dufter, Jonathan Dunn, Gerard M Dupont, Ondrej Dusek, Ritam Dutt, Subhabrata Dutta, Chris Dyer, Nouha Dziri, Hervé Déjean + +Abteen Ebrahimi, Aleksandra Edwards, Steffen Eger, Markus Egg, Koji Eguchi, Yo Ehara, Vladimir Eidelman, Bryan Eikema, Jacob Eisenstein, Asif Ekbal, Wassim El-Hajj, Aparna Elangovan, Yanai Elazar, Heba Elfardy, Michael Elhadad, AbdelRahim A. Elmaday, Micha Elsner, Denis Emelin, Guy Emerson, Akiko Eriguchi, Liana Ermakova, Patrick Ernst, Carlos Escolano, Arash Eshghi, Ramy Eskander, Cristina España-Bonet, Luis Espinosa-Anke, Kawin Ethayarajh, Allyson Ettinger, Kilian Evang, Ben Eyal + +Alexander Fabbri, Marzieh Fadaee, Tiziano Fagni, Farzane Fakhrian, Neele Falk, Tobias Falke, Chuang Fan, Feifan Fan, Kai Fan, Lu Fan, Wei Fang, Yimai Fang, Yuwei Fang, Adam Faulkner, Maryam Fazel-Zarandi, Amir Feder, Hao Fei, Nils Feldhus, Naomi Feldman, Mariano Felice, Jiazhan Feng, Shaoxiong Feng, Shi Feng, Shi Feng, Xiachong Feng, Zhangyin Feng, Manos Fergadiotis, James Ferguson, Patrick Fernandes, Raquel Fernandez, Daniel Fernandez-Gonzalez, Elisa Ferracane, Francis Ferraro, Besnik Fetahu, Oluwaseyi Feyisetan, Alejandro Figueroa, Simone Filice, Catherine Finegan-Dollak, Orhan Firat, Nicholas FitzGerald, Margaret M. Fleck, Lucie Flek, Antske Fokkens, Marina Fomicheva, Jose A.r. Fonollosa, Marco Fonseca, Tommaso Fornaciari, Paula Fortuna, Eric Fosler-Lussier, George Foster, Jennifer Foster, Mary Ellen Foster, Anette Frank, Stella Frank, Thomas François, Alexander Fraser, Kathleen C. Fraser, Marjorie Freedman, Dayne Freitag, Markus Freitag, Lea Frermann, Daniel Fried, Guohong Fu, Jie Fu, Peng Fu, Qiankun Fu, Tsu-Jui Fu, Zuohui Fu, Yoshinari Fujinuma, Atsushi Fujita, Kotaro Funakoshi, Adam Funk, Richard Futrell, Michael Farber + +Devi G, Matteo Gabburo, Saadia Gabriel, David Gaddy, Marco Gaido, Andrea Galassi, Mark Gales, Boris Alexandrovich Galitsky, Ygor Gallina, Diana Galvan, Bjorn Gambäck, Leilei Gan, Yujuan Gan, Zhe Gan, Kuzman Ganchev, Sudeep Gandhe, Balaji Ganesan, Rashmi Gangadharaiah, Varun Gangal, Revanth Gangi Reddy, Debasis Ganguly, Ge Gao, Jun Gao, Shen Gao, Tianyu Gao, Wei Gao, Yang Gao, Yanjun Gao, Yifan Gao, Yingbo Gao, Utpal Garain, Cristina Garbacea, Diego Garcia-Olano, Matt Gardner, Sarthak Garg, Siddhant Garg, Dan Garrette, Aina Garí Soler, Kiril Gashteovski, Albert Gatt, Manas Gaur, Eric Gaussier, Dipesh Gautam, Yubin Ge, Sebastian Gehrmann, Michaela Geierhos, Ruiying Geng, Shijie Geng, Xinwei Geng, Xiubo Geng, Ariel Gera, Mor Geva, Hamidreza Ghader, Demian Gholipour Ghalandari, Sarik Ghazarian, Mozhdeh Gheini, Deepanway Ghosal, Deepanway Ghosal, Debanjan Ghosh, Sayan Ghosh, Soumitra Ghosh, Sourav Ghosh, Daniel Gildea, Salvatore Giorgi, Voula Giouli, Adrià de Gispert, Mario Giulianelli, Michael Glass, Goran Glavaš, Alfio Gliozzo, Pranav Goel, Vaibhava Goel, Nazli Goharian, Tejas Gokhale, Elizaveta Goncharova, Heng Gong, Hongyu Gong, Karthik Gopalakrishnan, Philip John Gorinski, Matthew R. Gormley, Koustava Goswami, Akhilesh Deepak Gotmare, Isao Goto, Cyril Goutte, Edward Gow-Smith, Kartik Goyal, Naman Goyal, Pawan Goyal, Tanya Goyal, Mario Graff, Christophe Gravier, Yulia Grishina, Milan Gritta, Loïc Grobol, Dagmar Gromann, Roman Grundkiewicz, Jia-Chen Gu, Jing Gu, Yue Gu, Jian Guan, Saiping Guan, Yi Guan, Marco Guerini, Lin Gui, Tao Gui, Vincent Guigue, Liane Guillou, Camille Guinaudeau, Kalpa Gunaratna, Chulaka Gunasekara, Tunga Gungor, Jiang Guo, Jiaqi Guo, Junliang Guo, Ruocheng Guo, Yinpeng Guo + +Yuhang Guo, Zhijiang Guo, Arpit Gupta, Arshit Gupta, Nitish Gupta, Prakhar Gupta, Shashank Gupta, Sonal Gupta, Vivek Gupta, Izzeddin Gur, Suchin Gururangan, Joakim Gustafson, Ximena Gutierrez-Vasques, Carlos Gomez-Rodriguez + +Jung-Woo Ha, Nizar Habash, Ivan Habernal, Kais Haddar, Christian Hadiwinoto, Reza Haf, Michael Hahn, Zhen Hai, Huda Hakami, Dilek Hakkani-Tur, Kishaloy Halder, Jiale Han, Jiawei Han, Namgi Han, Rujun Han, Ting Han, Wenjuan Han, Xianpei Han, Xiaochuang Han, Abram Handler, Viktor Hangya, Greg Hanneman, Jie Hao, Yaru Hao, Momchil Hardalov, Mareike Hartmann, Thomas Hartvigsen, Sadid A. Hasan, Peter Hase, Chikara Hashimoto, Nabil Hathout, Robert D. Hawkins, Hiroaki Hayashi, Katsuhiko Hayashi, Yoshihiko Hayashi, Shirley Anugrah Hayati, Devamanyu Hazarika, Hangfeng He, Jiangen He, Junxian He, Keqing He, Liang He, Luheng He, Shizhu He, Tianxing He, Wanwei He, Xuanli He, Zhongjun He, Marti Hearst, Michael Heck, Behnam Hedayatnia, Benjamin Heinzerling, Matthew Henderson, Iris Hendrickx, Leonhard Henning, Sophie Henning, Daniel Hershcovich, Jonathan Herzig, Jack Hessel, John Hewitt, Ryuichiro Higashinaka, Swapnil Hingmire, Tsutomu Hirao, Tatsuya Hiraoka, Cuong Hoang, Hieu Hoang, Johannes Hoffart, Valentin Hofmann, Chris Hokamp, Eben Holderness, Nora Hollenstein, Ari Holtzman, Takeshi Homma, Ukyo Honda, Pengfei Hong, Mark Hopkins, Helmut Horacek, Md Mosharaf Hossain, Nabil Hossain, Mohammad Javad Hosseini, Feng Hou, Lei Hou, Yufang Hou, Yutai Hou, Dirk Hovy, David M Howcroft, Estevam Hruschka, Shu-Kai Hsieh, Chao-Chun Hsu, Chun-Nan Hsu, I-Hung Hsu, Wei-Ning Hsu, Phu Mon Htut, Baotian Hu, Chi Hu, Guangneng Hu, Huang Hu, Jennifer Hu, Jinyi Hu, Junjie Hu, Linmei Hu, Minghao Hu, Pengwei Hu, Po Hu Renfen Hu, Wei Hu, Yue Hu, Zhe Hu, Ziniu Hu, Xinyu Hua, Yiqing Hua, Chao-Wei Huang Chenyang Huang, Chieh-Yang Huang, Danqing Huang, Fei Huang, Haoran Huang, He Huang Hen-Hsen Huang Heyan Huang Jiaji Huang Jie Huang Jimmy Huang Jing Huang Kuan-Hao Huang Kung-Hsiang Huang Lifu Huang Minlie Huang Quzhe Huang Ruihong Huang Shujian Huang Siyu Huang Xiaolei Huang Xinting Huang Xuancheng Huang Zhen Huang Zhongqiang Huang Ziming Huang Patrick Huber Binyuan Hui Kai Hui Dieuwke Hupkes Ben Hutchinson Jena D. Hwang Sung Ju Hwang Ali Hurriyetoglu + +Ignacio Iacobacci, Georgiana Ifrim, Oana Ignat, Ryu Iida, Gabriel Ilharco, Filip Ilievski, Nikolai Ilinykh, Irina Illina, Dmitry Ilvovsky, Kenji Imamura, Oana Inel, Naoya Inoue, Radu Tudor Ionescu, Daphne Ippolito, Hitoshi Isahara, Tatsuya Ishigaki, Etsuko Ishii, Tunazzina Islam, Hayate Iso, Dan Iter, Itay Itzhak, Julia Ive, Tomoya Iwakura, Kenichi Iwatsuki, Rishabh K Iyer, Srini Iyer, Gautier Izacard + +Aaron Jaech, Sarthak Jain, Masoud Jalili Sabet, Abhik Jana, Hyeju Jang, Tommi Jauhiainen, Sébastien Jean, Sungho Jeon, Minwoo Jeong, Yacine Jernite, Kevin Jesse, Rahul Jha, Harsh Jhamtani, Feng Ji, Zongcheng Ji, Chen Jia, Renee Jia, Robin Jia, Ruipeng Jia, Yuxiang Jia, Ping Jian, Daxin Jiang, Haoming Jiang, Hongfei Jiang, Meng Jiang, Ming Jiang, Nan Jiang, Nanjiang Jiang, Wenbin Jiang, Xin Jiang, Yong Jiang, Zhengbao Jiang, Zhuolin Jiang, Zhuoren Jiang, Zhuoxuan Jiang, Wenxiang Jiao, Zhanming Jie, Antonio Jimeno Yepes, Di Jin, Hailong Jin, Hanqi Jin, Lisa Jin, Peng Jin, Xiaolong Jin, Zhijing Jin, Baoyu Jing, Yohan Jo, Richard Johansson, Melvin Johnson, Erik Jones, Gareth J. F. Jones, Siddhartha Jonnalagadda, Aditya Joshi, Dhanya Jothimani, Shafiq Joty, Xincheng Ju, Jaap Jumelet, Heewoo Jun, David Jurgens, Prathyusha Jwalapuram + +Jad Kabbara, Indika Kahanda, Sylvain Kahane, Ivana Kajic, Mihir Kale, Oren Kalinsky, Aikaterini-Lida Kalouli, Ehsan Kamalloo, Hidetaka Kamigaito, Jaap Kamps, Min-Yen Kan, Hiroshi Kanayama, Nikhil Kandpal, Masahiro Kaneko, Dongyeop Kang, Minki Kang, Diptesh Kanojia, Evangelos Kanoulas, Jiun-Yu Kao, Pavan Kapanipathi, Georgi Karadzhov, Alina Karakanta, Giannis Karamanolakis, Siddharth Karamcheti, Mladen Karan, Borje F. Karlsson, Sanjeev Kumar Karn, Jungo Kasai, Omid Kashefi, Yosuke Kashiwagi, Zdenek Kasner, Nora Kassner, Denys Kateren- + +chuk, Divyansh Kaushik, Pride Kavumba, Anna Kazantseva, Hideto Kazawa, Ashkan Kazemi, Abe Kazemzadeh, Pei Ke, Zixuan Ke, Chris Kedzie, Katherine A. Keith, Yova Kementchedjhieva, Brendan Kennedy, Casey Kennington, Tom Kenter, Daniel J Kershaw, Santosh Kesiraju, Salam Khalifa, Dinesh Khandelwal, Urvashi Khandelwal, Simran Khanuja, Mitesh M Khapra, Eugene Kharitonov, Daniel Khashabi, Mikhail Khodak, Tushar Khot, Johannes Kiesel, Halil Kilicoglu, Byeongchang Kim, Dong-Jin Kim, Dongkwan Kim, Doo Soon Kim, Gene Louis Kim, Geonmin Kim, Gunhee Kim, Gyuwan Kim, Hyoungun Kim, Hyunwoo Kim, Jihyuk Kim, Jin-Dong Kim, Joo-Kyung Kim, Jooyeon Kim, Jung-jae Kim, Juyong Kim, Kang-Min Kim, Seokhwan Kim, Yeachan Kim, Yoon Kim, Yunsu Kim, Milton King, Tracy Holloway King, Christo Kirov, Nikita Kitaev, Hirokazu Kiyomaru, Shun Kiyono, Judith Lynn Klavans, Ayal Klein, Bennett Kleinberg, Jan-Christoph Klie, Mateusz Klimaszewski, Miyoung Ko, Hideo Kobayashi, Sosuke Kobayashi, Thomas H Kober, Jordan Kodner, Svetla Peneva Koeva, Mare Koit, Noriyuki Kojima, Alexander Koller, Keshav Kolluru, Mamoru Komachi, Rik Koncel-Kedziorski, Lingkai Kong, Luyang Kong, Valia Kordoni, Yuta Koreeda, Mandy Barrett Korpusik, Katsunori Kotani, Lili Kotlerman, Fajri Koto, Venelin Kovatchev, Josip Krapac, Sebastian Krause, Elisa Kreiss, Ralf Krestel, Julia Kreutzer, Florian L. Kreyssig, Kalpesh Krishna, Nikhil Krishnaswamy, Reno Kriz, Canasai Kruengkrai, Udo Kruschwitz, German Kruszewski, Alexander Ku, Lun-Wei Ku, Marco Kuhlmann, Mayank Kulkarni, Sayali Kulkarni, Vivek Kulkarni, Artur Kulmizev, Devang Kulshreshtha, Ashutosh Kumar, Dhruv Kumar, Sachin Kumar, Sawan Kumar, Shankar Kumar, Varun Kumar, Vishwajeet Kumar, Anoop Kunchukuttan, Souvik Kundu, Shuhei Kurita, Kemal Kurniawan, Sadao Kurohashi, Robin Kurtz, Andrey Kutuzov + +Peifeng LI, Matthieu Labeau, Faisal Ladhak, Nikolaos Lagos, Cheng-I Lai, Viet Dac Lai, Yuxuan Lai, Yash Kumar Lal, Divesh Lala, John P. Lalor, Tsz Kin Lam, Wai Lam, Matthew Lamm, Vasileios Lampos, Gerasimos Lampouras, Man Lan, Yanyan Lan, Yunshi Lan, Lukas Lange, Ni Lao, Guy Lapalme, Egoitz Laparra, Mirella Lapata, Gabriella Lapesa, Ekaterina Lapshinova-Koltunski, Stefan Larson, Joy Han Lau, Anne Lauscher, Alberto Lavelli, John Lawrence, Dawn Lawrie, Hung Le, Phong Le, Andrew Lee, Dongkyu Lee, Fei-Tzin Lee, Hung-yi Lee, Hwanhee Lee, Hwaran Lee, Hyunj Lee, I-Ta Lee, Ji-Ung Lee, Jinhyuk Lee, Katherine Lee, Kenton Lee, Kyungjae Lee, Mina Lee, Moontae Lee, Nayeon Lee, Roy Ka-Wei Lee, Sang-Woo Lee, Seolhwa Lee, Taesung Lee, Young-Suk Lee, Artuur Leeuwenberg, Els Lefever, Jie Lei, Tao Lei, Wenqiang Lei, Zeyang Lei, Jochen L. Leidner, Alessandro Lenci, Yichong Leng, Haley Lepp, Piyawat Lertvittayakumjorn, Guy Lev, Lori Levin, Gina-Anne Levow, Bai Li, Baoli Li, Bei Li, Binyang Li, Bo Li, Bowen Li, Chen Li, Chen Li, Chenliang Li, Chenliang Li, Chunyuan Li, Dianqi Li, Dingcheng Li, Dongfang Li, Fei Li, Haizhou Li, Haoran Li, Hongyu Li, Huayang Li, Irene Li, Jialu Li, Jicheng Li, Jinchao Li, Jing Li, Jingye Li, Juanzi Li, Juncheng B Li, Junyi Jessy Li, Lei Li Lin Li Lucy Li Manling Li Miao Li Minglei Li Peng Li Piji Li Qi Li Quanzhi Li Ruizhe Li ShangWen Li Shaohua Li Sheng Li Shuangyin Li Si Li Tao Li Wei Li Xiang Lisa Li Xiang Li Xiang Lorraine Li Xiangci Li Xiaonan Li Xin Li Xinjian Li Xintong Li Xiujun Li Yaliang Li Yanran Li Yanzeng Li Yaoyiran Li Yingjie Li Yingya Li Yinqiao Li Yitong Li Yitong Li Yiyuan Li Yuan-Fang Li Zhenghua Li Zhongli Li Zhongyang Li Zhoujun Li Zichao Li Zongxi Li Zuchao Li Bin Liang Chao-Chun Liang Chen Liang Paul Pu Liang Xiaobo Liang Yunlong Liang Lizi Liao Jindrich Libovicky Chaya Liebeskind Wang Lijie Gilbert Lim Kwan Hui Lim Bill Yuchen Lin Chih-Jen Lin Chu-Cheng Lin Hongfei Lin Junyang Lin Lucy H. Lin Peiqin Lin Ting-En Lin Weizhe Lin Xi Victoria Lin Xiang Lin Yankai Lin Ying Lin Zehao Lin Zhaojiang Lin Zheng Lin Zhouhan Lin Zi Lin Zhen-Hua Ling Tal Linzen Pierre Lison Johann-Mattis List Robert Litschko Patrick William Littell Marina Litvak Bin Liu Bing Liu Chen Cecilia Liu Chi-Liang Liu Dairui Liu Danni Liu Dexi Liu Fangyu Liu Fei Liu Feifan Liu Han Liu Haochen Liu Haokun Liu Haoyan Liu Hui Liu Jiachang Liu Jian Liu Jiangming Liu Jing Liu Junhao Liu Kang Liu Lemao Liu Ling Liu Linqing Liu Liyuan Liu Maofu Liu Ming Liu Nelson F. Liu Peng Liu Qian Liu Qianchu Liu Shujie Liu Shulin Liu Siyang Liu + +Tianyu Liu, Weijie Liu, Xianggen Liu, Xiao Liu, Xiao Liu, Xin Liu, Xinchen Liu, Xudong Liu, Xuebo Liu, Xueqing Liu, Yang Janet Liu, Yijia Liu, Yijin Liu, Yingchi Liu, Yong Liu, Zemin Liu, Zhengyuan Liu, Zhiyuan Liu, Zhun Liu, Zihan Liu, Zoey Liu, Farhana Ferdousi Liza, Nikola Ljubesic, Kyle Lo, Guodong Long, Yunfei Long, Jose David Lopes, Lucelene Lopes, Natalia Loukachevitch, Ismini Lourentzou, Sharid Loaiciga, Di Lu, Wei Lu, Weiming Lu, Yao Lu, Yaojie Lu, Yichao Lu, Nurul Lubis, Stephanie M. Lukin, Hongyin Luo, Huaishao Luo, Ling Luo, Ping Luo, Renqian Luo, Ruotian Luo, Tianyi Luo, Anh Tuan Luu, Kelvin Luu, Shangwen Lv, Xin Lv, Teresa Lynn, Chenyang Lyu, Michael Lyu, Samuel Läubli + +Ji Ma, Jianqiang Ma, Kaixin Ma, Mingyu Derek Ma, Qianli Ma, Xiaofei Ma, Xinyin Ma, Xuezhe Ma, Xutai Ma, Sean MacAvaney, Aman Madaan, Avinash Madasu, Mounica Maddela, Pranava Madhyastha, Andrea Madotto, Walid Magdy, Manuel Mager, Suchismit Mahapatra, Adyasha Maharana, Debanjan Mahata, Rahmad Mahendra, Ayush Maheshwari, Gaurav Maheshwari, Kyle Mahowald, Wolfgang Maier, Jean Maillard, Olga Majewska, Bodhisattwa Prasad Majumder, Marton Makrai, Prodromos Malakasiotis, Chaitanya Malaviya, Andreas Maletti, Ankur Mali, Eric Malmi, Christopher Malon, Radhika Mamidi, Saab Mansour, Ramesh Manuvinakurike, Emaad Manzoor, Jiaxin Mao, Wenji Mao, Xian-Ling Mao, Xin Mao, Yuren Mao, Vladislav Maraev, Ana Marasovic, Diego Marcheggiani, Daniel Marcu, Piotr Mardziel, Andreas Marfurt, Katerina Margatina, Benjamin Marie, Zita Marinho, Antonis Maronikolakis, Edison Marrese-Taylor, Hector Martinez Alonso, Pedro Henrique Martins, Yuval Marton, Sameen Maruf, Claudia Marzi, Sandeep Mathias, Prashant Mathur, Puneet Mathur, David Martins De Matos, Sérgio Matos, Yuichiroh Matsubayashi, Takuya Matsuzaki, Yevgen Matusevych, Evgeny Matusov, Kaushal Kumar Maurya, Nickil Maveli, Jonathan May, Stephen Mayhew, Karen Mazidi, Sahisnu Mazumder, Arya D. McCarthy, John Philip McCrae, Matthew B.a. McDermott, Denis Jered McInerney, Alexander Mehler, Shikib Mehri, Nikhil Mehta, Hongyuan Mei, Hardik Meisheri, Clara Isabel Meister, Dheeraj Mekala, Telmo Menezes, Fandong Meng, Rui Meng, Tao Meng, Yu Meng, Yuanliang Meng, Zaiqiao Meng, Zhao Meng, Rakesh R Menon, Samuel Mensah, Wolfgang Menzel, Paola Merlo, William Merrill Mohsen Mesgar, Florian Metze, Donald Metzler, Marie-Jean Meurs, Haitao Mi, Yisong Miao Julian Michael Paul Michel Lesly Miculicich Sabrina J Mielke Margot Mieskes,Todor Mihaylov Tsvetomila Mihaylova Elena Mikhalkova,Simon Mille Timothy A MillerTristan Miller Eleni Miltsakaki David Mimno Bonan Min Sewon Min Pasquale Minervini Xu Mingzhou Hideya Mino Shachar Mirkin Seyedabolghasem Mirroshandel Paramita Mirza Abhijit Mishra Swaroop Mishra Kanishka Misra Masato Mita Prasenjit Mitra Jelena Mitrovic Arpit Mittal Vibhu O.Mittal,Makoto Miwa,Yusuke Miyao,Takashi Miyazaki,Daichi Mochihashi,Ashutosh Modi Hans Moen Aditya Mogadala,Nikita Moghe Alireza Mohammadshahi Muqeeth Mohammed Hosein Mohebbi Diego Molla Natawat Monaikul Nicholas Monath Ishani Mondal Joel Ruben Antony Moniz Syrielle Montariol Manuel Montes Seungwhan Moon Ray MooneyNafise Sadat Moosavi,Mehrad Moradshahi,Vlad I Morariu Erwan Moreau Jose G Moreno Mathieu Morey Gaku Morio,Makoto Morishita John Xavier Morris David R Mortensen Ahmadreza Mosallanezhad,Marius Mosbach,Lili Mou,Xiangyang MouSayed Mahed Mousavi Maximilian Mozes Yassine Mrabet Frank Martin Mtumbuka Hamdy Mubarak Pramod Kaushik Mudrakarta Aaron Mueller David Mueller Matteo Muffo Animesh Mukherjee Phoebe Mulcaire Matthew Mulholland Deepak Muralidharan Masayasu Muraoka Elena Musi Sheshera Mysore Mark-Christoph Muller Mathias Muller Thomas Muller + +Seung-Hoon Na, Nona Naderi, Masaaki Nagata, Ajay Nagesh, Saeed Najafi, Tetsuji Nakagawa, Diane Napolitano, Jason Naradowsky, Karthik R Narasimhan, Tahira Naseem, Sudip Kumar Naskar, Alexis Nasr, Vivi Nastase, Anandhavelu Natarajan, Tristan Naumann, Roberto Navigli, Matteo Negri, Graham Neubig, Günter Neumann, Mariana Neves, Denis Newman-Griffis, Dai Quoc Nguyen, Hoang Van Nguyen, Huyen Nguyen, Thanh V Nguyen, Thanh-Tung Nguyen, Thien Huu Nguyen, Truc-Vien T. Nguyen, Hoang-Quoc Nguyen-Son, Jianmo Ni, Garrett Nicolai, Massimo + +Nicosia, Vlad Niculae, Feng Nie, Yixin Nie, Jan Niehues, Christina Niklaus, Fedor Nikolaev, Giannis Nikolentzos, Vassilina Nikoulina, Qiang Ning, Takashi Ninomiya, Nobal B. Niraula, Kosuke Nishida, Kyosuke Nishida, Noriki Nishida, Masaaki Nishino, Sergiu Nisioi, Guanglin Niu, Tong Niu, Xing Niu, Hiroshi Noji, Tadashi Nomoto, Damien Nouvel, Michal Novák, Pierre Nugues, Claire Nédellec, Aurélie Néveol + +Alexander O'Connor, Yusuke Oda, Stephan Oepen, Maciej Ogrodniczuk, Barlas Oguz, Alice Oh, Yoo Rhee Oh, Kiyonori Ohtake, Naoaki Okazaki, Tsuyoshi Okita, Manabu Okumura, Hugo Gonçalo Oliveira, Antoni Oliver, Arturo Oncevay, Yasumasa Onoe, Juri Opitz, Shereen Oraby, John Ortega, Pedro Ortiz Suarez, Yohei Oseki, Malte Ostendorff, Naoki Otani, Myle Ott, Zhijian Ou, Zijing Ou, Hiroki Ouchi, Nedjma Ousidhoum, Robert Östling, Lilja Øvrelid + +Maria Leonor Pacheco, Inkit Padhi, Aishwarya Padmakumar, Santanu Pal, Sukomal Pal, Chester Palen-Michel, Alexis Palmer, Endang Wahyu Pamungkas, Boyuan Pan, Liangming Pan, Liang Pang, Richard Yuanzhe Pang, Sheena Panthaplackel, Alexandros Papangelis, Nikolaos Pappas, Emerson Cabrera Paraiso, Letitia Parcalabescu, Natalie Parde, Antonio Pareja-Lora, Cecile Parris, ChaeHun Park, Chanjun Park, Hyunj Hayley Park, Jungsoo Park, Kunwoo Park, Lucy Park, Youngja Park, Ioannis Partalias, Niko Tapio Partanen, Prasanna Parthasarathi, Md Rizwan Parvez, Gabriella Pasi, Tommaso Pasini, Ramakanth Pasunuru, Or Patashnik, Arkil Patel, Kevin Patel, Raj Patel, Roma Patel, Sangameshwar Patil, Barun Patra, Braja Patra, Jasabanta Patro, Manasi Patwardhan, Siddharth Patwardhan, Debjit Paul, Silviu Paun, John Pavlopoulos, Pavel Pecina, Jiaxin Pei, Stephan Peitz, Viktor Pekar, Baolin Peng, Hao Peng, Haoruo Peng, Siyao Peng, Wei Peng, Xi Peng, Xutan Peng, Yifan Peng, Lis Pereira, Martin Pereira, Julien Perez, Gabriele Pergola, Jan-Thorsten Peter, Ben Peters, Matthew E Peters, Pavel Petrushkov, Sandro Pezzelle, Jonas Pfeiffer, Minh-Quang Pham, Quan Pham, Van-Thuy Phi, Maciej Piasecki, Massimo Piccardi, Karl Pichotta, Mohammad Taher Pilehvar, Tiago Pimentel, Aidan Pine, Juan Pino, Yuval Pinter, Flammie A Pirinen, Benjamin Piwowarski, Lonneke Van Der Plas, Bryan A. Plummer, Brian Pluss, Sylvain Pogodalla, Martin Popel, Octavian Popescu, Andrei Popescu-Belis, Fred Popowich, François Portet, Matt Post, Martin Potthast, Christopher Potts, Amir Pouran Ben Veyseh, Sandhya Prabhakaran, Vinodkumar Prabhakaran, Shrimai Prabhumoye, Aniket Pramanick, Jakob Prange, Animesh Prasad, Archiki Prasad, Judita Preiss, Audi Primadhanty, Victor Prokhorov, Prokopis Prokopidis, Haritz Puerto, Rajkumar Pujari, Matthew Purver, Valentina Pyatkin, Juan Antonio Pérez-Ortiz + +Fanchao Qi, Jianzhong Qi, Peng Qi, Tao Qi, Dong Qian, Kun Qian, Yujie Qian, Libo Qin, Yu-jia Qin, Liang Qiu, Long Qiu, Xipeng Qiu, Chen Qu, Lizhen Qu, Xiaoye Qu + +Ella Rabinovich, Gorjan Radevski, Alessandro Raganato, Dinesh Raghu, Vipul Raheja, Afshin Rahimi, Hossein Rajaby Faghihi, Sara Rajaee, Dheeraj Rajagopal, Sanguthevar Rajasekaran, Pavithra Rajendran, Geetanjali Rakshit, Dhananjay Ram, Ori Ram, Taraka Rama, Deepak Ramachandran, Anil Ramakrishna, Ganesh Ramakrishnan, Owen Rambow, Alan Ramponi, Gabriela Ramirez De La Rosa, Tharindu Ranasinghe, Surangika Ranathunga, Priya Rani, Peter A. Rankel, Jinfeng Rao, Yanghui Rao, Ahmad Rashid, Hannah Rashkin, Abhinav Rastogi, Vipul Kumar Rathore, Vikas Raunak, Shauli Ravfogel, Abhilasha Ravichander, Vinit Ravishankar, Anirudh Ravula, Avik Ray, Soumya Ray, Manny Rayner, Julia Rayz, Traian Rebedea, Sravana Reddy, Hanumant Harichandra Redkar, Georg Rehm, Marek Rei, Nils Reimers, Nvid Rekabsaz, Da Ren, Feiliang Ren, Feiliang Ren, Pengjie Ren, Ruiyang Ren, Shuhuai Ren, Shuo Ren, Xiang Ren, Xuancheng Ren, Zhaochun Ren, Adi Renduchintala, Mehdi Rezagholizadeh, Saed Rezayi, Leonardo F. R. Ribeiro, Caitlin Laura Richter, Sebastian Riedel, Stefan Riezler, German Rigau, Shruti Rijhwani, Matiss Rikters, Darcey Riley, Laura Rimell, Eric Ringger, Annette Rios, Anthony Rios, Miguel Rios, Brian Roark, Kirk Roberts, Christophe Rodrigues, Pedro Rodriguez, Melissa Roemmele, Lina Maria Rojas-Barahona, Roland Roller, Stephen Roller, Alexey Romanov, Salvatore Romeo, Srikanth Ronanki + +Subendhu Rongali, Rudolf Rosa, Aiala Rosá, Michael Roth, Sascha Rothe, Salim Roukos, Dmitri Roussinov, Bryan R. Routledge, Aurko Roy, Subhro Roy, Jos Rozen, Alla Rozovskaya, Dongyu Ru, Raphael Rubino, Sebastian Ruder, Koustav Rudra, Frank Rudzicz, Federico Ruggeri, Thomas Ruprecht, Alexander M Rush, Irene Russo, Phillip Rust, Attapol Rutherford, Max Ryabinin, Maria Ryskina, Andreas Rücklé + +C S, Ashish Sabharwal, Mrinmaya Sachan, Fatiha Sadat, Arka Sadhu, Marzieh Saeidi, Niloofar Safi Samghabadi, Kenji Sage, Horacio Saggion, Monjoy Saha, Swarnadeep Saha, Tulika Saha, Saurav Sahay, Gaurav Sahu, Sunil Kumar Sahu, Hassan Sajjad, Keisuke Sakaguchi, Sakriani Sa kti, Elizabeth Salesky, Alexandre Salle, Avneesh Saluja, Tanja Samardzic, Younes Samih, Danae Sanchez Villegas, Chinnadhurai Sankar, Malaikannan Sankarasubbu, Sashank Santhanam, Marina Santini, Bishal Santra, Sebastin Santy, Maarten Sap, Naomi Saphra, Maya Sappelli, Zahra Sarabi, Sheikh Muhammad Sarwar, Felix Sasaki, Shota Sasaki, Ryohei Sasano, Giorgio Satta, Danielle Saunders, Agata Savary, Aleksandar Savkov, Beatrice Savoldi, Apoorv Umang Saxena, Asad B. Sayeed, Thomas Schaaf, Shigehiko Schamoni, Tatjana Scheffler, Christian Scheible, Yves Scherrer, Timo Schick, Marten Van Schijndel, Frank Schilder, Viktor Schlegel, Jonathan Schler Helmut Schmid, Tyler Schnoebelen Steven Schockaert, Alexandra Schofield, Sabine Schulte Im Walde, Claudia Schulz, Hannes Schulz, Elliot Schumacher, Anne-Kathrin Schumann, Sebastian Schuster, Tal Schuster, Roy Schwartz, Robert Schwarzenberg, Stefan Schweter, Johannes Schäfer Djamé Seddah, João Sedoc, Satoshi Sekine, David Semedo, Nasredine Semmar, Sina Semnani Lutfi Kerem Senel Rico Sennrich Minjoon Seo, Yeon Seonwoo Christophe Servan Lei Sha Izhak Shafran, Darsh Jaidip Shah Kashif Shah,Samira Shaikh Cory Shain Chao Shang Guokan Shang Jingbo Shang Mingyue Shang Chenze Shao Nan Shao Yutong Shao Zhihong Shao Ori Shapira, Naomi Tachikawa Shapiro Amr Sharaf Arpit Sharma Ashish Sharma Vasu Sharma Serge Sharoff Rebecca Sharp Hassan Shavarani Peter Shaw Qiaoqiao She Zaid Sheikh Artem Shelmanov Hua Shen Jiaming Shen Lei Shen Qinlan Shen Sheng Shen Shiqi Shen Tao Shen Xiaoyu Shen Yikang Shen Yilin Shen Yongliang Shen Emily Sheng Qiang Sheng Tom Sherborne Chuan Shi Freda Shi Jiatong Shi Jiaxin Shi Ning Shi Peng Shi Shuming Shi Tianze Shi Weijia Shi Weiyan Shi Xing Shi Yangyang Shi Zhouxing Shi Tomohide Shibata Nobuyuki Shimizu Anastasia Shimorina Jamin Shin Yow-Ting Shiue Boaz Shmueli Eyal Shnarch Linjun Shou Mohit Shridhar Akshit Shrivastava Manish Shrivastava Kai Shu Lei Shu Raphael Shu Kurt Shuster Vered Shwartz Chenglei Si Mei Si Aditya Siddhant A.b. Siddique Carina Silberer Miikka Silfverberg Khalil Sima'an Patrick Simianer Kathleen Siminyu Arabella Jane Sinclair Sameer Singh Karan Singla Koustuv Sinha Kairit Sirts Amy Siu Milena Slavcheva Noam Slonim David A. Smith Felipe Soares Christine Soh Haoyu Song Hyun-Je Song KaiSong Kaiqiang Song Linfeng Song Mingyang Song Ruihua Song Wei Song Xingyi Song Yiping Song Sandeep Soni Rishi Sonthalia Claudia Soria Alexey Sorokin Daniil Sorokin William Eduardo Soto Martinez Sajad Sotudeh Marlo Souza Lucia Specia Matthias Sperber Vivek Srikumar Balaji Vasan Srinivasan Tejas Srinivasan Shashank Srivastava Edward P. Stabler Felix Stahlberg Ieva Staliunaite Marija Stanojevic Gabriel Stanovsky David Stap Katherine Stasaski Manfred Stede Mark Steedman Benno Stein Shane Steinert-Threlkeld Elias Stengel-Eskin Amanda Stent Mark Stevenson Ian Stewart Matthew Stone Kevin Stowe Karl Stratos Kristina Striegnitz Heiner Stuckenschmidt Nikolaos Stylianou Sara Stymne Dan Su Hui Su Jinsong Su Keh-Yih Su Shang-Yu Su Weifeng Su Yu Su Yusheng Su Nishant Subramani Lakshmi Subramanian Sanjay Subramanian Katsuhito Sudoh Saku Sugawara Hiroaki Sugiyama Alessandro Suglia Yoshihiko Suhara Dianbo Sui Zhifang Sui Elior Sulem Md Arafat Sultan Changzhi Sun Chengjie Sun Fei Sun Haipeng Sun Haitian Sun Huan Sun Jian Sun Jingyi Sun Kai Sun Kai Sun Ming Sun Mingming Sun Si Sun Simeng Sun Siqi Sun Tianxiang Sun Yawei Sun Yibo Sun Yifan Sun Yu Sun Zequn Sun Zhiqing Sun Dhanasekar Sundararaman Mujeen Sung Hanna Suominen Mihai Surdeanu Anshuman Suri Shiv Surya Simon Suster Mirac Suzgun Jun Suzuki Masatoshi Suzuki Swabha Swayamdipta Benjamin Sznajder Stan Szpakowicz Felipe + +Ryuki Tachibana, Oyvind Tafjord, Shabnam Tafreshi, Hiroya Takamura, Ryuichi Takanobu, Sho Takase, Ece Takmaz, Aarne Talman, Derek Tam, George Tambouratzis, Fabio Tamburini, Akihiro Tamura, Chuanqi Tan, Fei Tan, Liling Tan, Samson Tan, Xu Tan, Zeqi Tan, Kumiko Tanaka-Ishii, Buzhou Tang, Gongbo Tang, Hao Tang, Qingming Tang, Raphael Tang, Shuai Tang, Siliang Tang, Yi-Kun Tang, Zhiwen Tang, Ludovic Tanguy, Xavier Tannier, Chongyang Tao, Shiva Taslimipoor, Sandeep Tata, Yuka Tateisi, Michiaki Tatsubori, Marta Tatu, Hillel Taub-Tabib, Yi Tay, Andon Tchechmedjiev, Christoph Teichmann, Selma Tekir, Serra Sinem Tekiroglu, Eric S. Tellez, Irina Temnikova, Zhiyang Teng, Ian Tenney, Hiroki Teranishi, Silvia Terragni, Alberto Testoni, Nithum Thain, Khushboo Thaker, Urmish Thakker, Nandan Thakur, Kilian Theil, Jesse Thomason, Laure Thompson, Sam Thomson, Camilo Thorne, James Thorne, Junfeng Tian, Ran Tian, Yingtao Tian, Zhiliang Tian, Jorg Tiedemann, Tiago Timponi Torrent, Erik Tjong Kim Sang, Gaurav Singh Tomar, Nadi Tomeh, Nicholas Tomlin, Sara Tonelli, Mariya Toneva, MeiHan Tong, Antonio Toral, Kentaro Torisawa, Samia Touileb, Julien Tourille, Quan Hung Tran, Dietrich Trautmann, Marcos Vinicius Treviso, Hai-Long Trieu, Alina Trifan, Enrica Troiano, Tuan Quoc Truong, Chen-Tse Tsai, Bo-Hsiang Tseng, Masaaki Tsuchida, Yoshimasa Tsuruoka, Kewei Tu, Lifu Tu, Mei Tu, Zhaopeng Tu, Iulia Raluca Turc, Martin Tutek, Francis M. Tyers, Andre Tattar + +Rutuja Ubale, Ana Sabina Uban, Takuma Udagawa, Umair Ul Hassan, Stefan Ultes, Shyam Upadhyay, L. Alfonso Ureña, Ricardo Usbeck + +Keyon Vafa, Sowmya Vajjala, Jannis Vamvas, Tim Van De Cruys, Benjamin Van Durme, Emiel Van Miltenburg, Rik Van Noord, Keith N VanderLinden, Lucy Vanderwende, David Vandyke, Natalia Vanetik, Daniel Varab, Siddharth Varia, Lucy Vasserman, Julien Velcin, Alakananda Vempala, Sriram Venkatapathy, Giulia Venturi, Suzan Verberne, Gaurav Verma, Rakesh M Verma, Giorgos Vernikos, Yannick Versley, Karin Verspoor, Anvesh Rao Vijjini, David Vilar, Jesus Vilares, Serena Villata, Aline Villavicencio, Éric Villemonte De La Clergerie, Veronika Vincze, Krishnapriya Vishnubhotla, Ngoc Phuoc An Vo, Rob Voigt, Elena Voita, Soroush Vosoughi, Thang Vu, Thuy Vu, Thuy-Trang Vu, Tu Vu, Xuan-Son Vu, Yogarshi Vyas, Ekaterina Vylomova + +Henning Wachsmuth, Takashi Wada, Joachim Wagner, Byron C Wallace, Mengting Wan, Mingyu Wan, Stephen Wan, Yao Wan, Yu Wan, Alex Wang, Bailin Wang, Baoxin Wang, Baoxun Wang, Bin Wang, Bingqing Wang, Boxin Wang, Changhan Wang, Chao Wang, Chenguang Wang, Chengyu Wang, Cunxiang Wang, Daling Wang, Dingmin Wang, Fei Wang, Guangrun Wang, Guoyin Wang, Hai Wang, Han Wang, Hanrui Wang, Hao Wang, Hao Wang, Haohan Wang, Haoyu Wang, Hong Wang, Hongfei Wang, Hua Wang, Jin Wang, Jin Wang, Jingang Wang, Jingkang Wang, Jue Wang, Ke Wang, Liang Wang, Lidan Wang, Lingzhi Wang, Liwen Wang, Lucy Lu Wang, Ping Wang, Pinghui Wang, Qiang Wang, Qifan Wang, Qingyun Wang, Quan Wang, Rui Wang, Rui Wang, Runze Wang, Shaonan Wang, Shi Wang, Shuo Wang, Shuohang Wang, Sinong Wang, Tong Wang, Tong Wang, Wei Wang, Wei Wang, Weiyue Wang, Wen Wang, Wenbo Wang, Wenhui Wang, Wenya Wang, Xiaojie Wang, Xiaolin Wang, Xiaozhi Wang, Xin Wang, Xing Wang, Xi-nyi Wang, Xuezhi Wang, Yan Wang, Yaqing Wang, Yequan Wang, Yifei Wang, Yijue Wang, Yile Wang, Yingyao Wang, Yiran Wang, Yizhong Wang, Yong Wang, Yue Wang, Yue Wang, Yujing Wang, Zhen Wang, Zhichun Wang, Zhongqing Wang, Zijian Wang, Ziqi Wang, Zirui Wang, Leo Wanner, Nigel G. Ward, Alex Warstadt, Christian Wartena, Koki Washio, Ingmar Weber, Leon Weber, Noah Weber, Kellie Webster, Julie Weeds, Jason Wei, Johnny Wei, Junqiu Wei, Penghui Wei, Wei Wei, Xiangpeng Wei, Xiaochi Wei, Shira Wein, David Weir, Ralph M. Weischedel, Charles Welch, Orion Weller, Haoyang Wen, Lijie Wen, Rongxiang Weng, Peter West, Taesun Whang, Michael White, Michael Wiegand, Sarah Wiegrefe, Adam Wiemerslage, Derry Wijaya, Gijs Wijnholds, Ethan Wilcox, Rodrigo Wilkens, Jake Ryland Williams, Jennifer Williams, Shomir Wilson + +Steven R. Wilson, Genta Indra Winata, Shuly Wintner, Sam Wiseman, Guillaume Wisniewski, Magdalena Wolska, Derek F. Wong, Tak-Lam Wong, Dina Wonsever, Zach Wood-Doughty, Bo Wu, Bowen Wu, Chien-Sheng Wu, Chuhan Wu, Chun-Kai Wu, Dayong Wu, Di Wu, Fangzhao Wu, Jian Wu, Junshuang Wu, Lianwei Wu, Lijun Wu, Lingfei Wu, Qianhui Wu, Qingyang Wu, Shijie Wu, Shuangzhi Wu, Sixing Wu, Stephen Wu, Tongshuang Wu, Wei Wu, Xianchao Wu, Xiaobao Wu, Yanan Wu, Youzheng Wu, Yu Wu, Yuanbin Wu, Yufang Wu, Yuting Wu, Zeqiu Wu, Zhen Wu, Zhiyong Wu, Zhonghai Wu, Joern Wuebker + +Congying Xia, Jingbo Xia, Mengzhou Xia, Patrick Xia, Qingrong Xia, Rui Xia, Yikun Xian, Jiannan Xiang, Rong Xiang, Chaojun Xiao, Chunyang Xiao, Huiru Xiao, Jinghui Xiao, Lin Xiao, Liqiang Xiao, Min Xiao, Tong Xiao, Wen Xiao, Yanghua Xiao, Boyi Xie, Jun Xie, Qianqian Xie, Ruobing Xie, Tianbao Xie, Yuqiang Xie, Ji Xin, Frank Xing, Deyi Xiong, Wenhan Xiong, Benfeng Xu, Boyan Xu, Can Xu, Canwen Xu, Chen Xu, Dongkuan Xu, Frank F. Xu, Hongfei Xu, Hu Xu, Jia Xu, Jiacheng Xu, Jinan Xu, Jing Xu, Jingjing Xu, Jitao Xu, Jun Xu, Kun Xu, Lu Xu, Peng Xu, Peng Xu, Qiantong Xu, Qiongkai Xu, Ruifeng Xu, Runxin Xu, Ruochen Xu, Shusheng Xu, Wang Xu, Weijia Xu, Weiran Xu, Weiwen Xu, Wenduan Xu, Xinnuo Xu, Yan Xu, Yang Xu, Yumo Xu, Zenglin Xu, Zhen Xu, Zhiyang Xu + +Shuntaro Yada, Vikas Yadav, Yadollah Yaghoobzadeh, Ikuya Yamada, Ivan P. Yamshchikov, Hanqi Yan, Jun Yan, Lingyong Yan, Yu Yan, Yuanmeng Yan, Baosong Yang, Changbing Yang, Cheng-hao Yang, Fan Yang, Haiqin Yang, Jie Yang, Jun Yang, Linyi Yang, Min Yang, Mingming Yang, Muyun Yang, Ruosong Yang, Sen Yang, Sen Yang, Songlin Yang, Tsung-Yen Yang, Wei Yang, Wenmian Yang, Yilin Yang, Yinfei Yang, Yujiu Yang, Zhao Yang, Zhen Yang, Zhichao Yang, Zhilin Yang, Ziqing Yang, Ziyi Yang, Jianmin Yao, Liang Yao, Shunyu Yao, Wenlin Yao, Ziyu Yao, Mark Yatskar, Deming Ye, Qinyuan Ye, Reyyan Yeniterzi, Jinyoung Yeo, Xiaoyuan Yi, Seid Muhie Yimam, Da Yin, Pengcheng Yin, Qingyu Yin, Xuwang Yin, Yichun Yin, Sho Yokoi, Zheng Xin Yong, Kang Min Yoo, Seunghyun Yoon, Masashi Yoshikawa, Steve Young, Safoora Yousefi, Bei Yu, Bowen Yu, Changlong Yu, Chen Yu, Dian Yu, Dian Yu, Dong Yu, Heng Yu, Hong Yu, Jifan Yu, Juntao Yu, Kai Yu, Mo Yu, Tao Yu, Tiezheng Yu, Wenhao Yu, Xiaodong Yu, Yue Yu, Caixia Yuan, Jianhua Yuan, Nicholas Jing Yuan, Yu Yuan, Zheng Yuan, Xiang Yue, Hyokun Yun + +Annie Zaenen, Wajdi Zaghouani, Marcos Zampieri, Marcely Zanon Boito, Alessandra Zarcone, Sina Zarrieß, Vicky Zayats, Rabih Zbib, Albin Zehe, Rowan Zellers, Yury Zemlyanskiy, Daojian Zeng, Fengzhu Zeng, Jiali Zeng, Jichuan Zeng, Qi Zeng, Shuang Zeng, Weixin Zeng, Xingshan Zeng, Zhiyuan Zeng, Thomas Zenkel, Deniz Zeyrek, Hanwen Zha, Fangzhou Zhai, Haolan Zhan, Li-Ming Zhan, Runzhe Zhan, Biao Zhang, Bowen Zhang, Bowen Zhang, Chen Zhang, Chen Zhang, Chiyu Zhang, Chuheng Zhang, Danqing Zhang, Dawei Zhang, Delvin Ce Zhang, Denghui Zhang, Dong Zhang, Dongdong Zhang, Dongxu Zhang, Dongyu Zhang, Guanhua Zhang, Haibo Zhang, Hainan Zhang, Haisong Zhang, Hao Zhang, Hao Zhang, Haoyu Zhang, Hongming Zhang, Hu Zhang, Jiajun Zhang, Jianguo Zhang, Jieyu Zhang, Jinchao Zhang, Jingqing Zhang, Ke Zhang, Kun Zhang, Lei Zhang, Lei Zhang, Li Zhang, Licheng Zhang, Longyin Zhang, Meishan Zhang, Meng Zhang, Michael JQ Zhang, Mike Zhang, Min Zhang, Ningyu Zhang, Peng Zhang, Qi Zhang, Richong Zhang, Rui Zhang, Ruixiang Zhang, Sheng Zhang, Shiyue Zhang, Shujian Zhang, Shuo Zhang, Tianlin Zhang, Tong Zhang, Tongtao Zhang, Wei Zhang, Wei Emma Zhang, Weinan Zhang, Wen Zhang, Wen Zhang, Xiang Zhang, Xiao Zhang, Xiaotong Zhang, Xingxing Zhang, Xinliang Frederick Zhang, Xinsong Zhang, Xinyuan Zhang, Xuanwei Zhang, Xuanyu Zhang, Xu-chao Zhang, Yan Zhang, Yan Zhang, Yao Zhang, Yichi Zhang, Yu Zhang, Yu Zhang, Yuan Zhang, Yuanzhe Zhang, Yue Zhang, Yuhao Zhang, Yuhui Zhang, Yunyi Zhang, Yusen Zhang, Zeyu Zhang, Zheng Zhang, Zhengyan Zhang, Zhihao Zhang, Zhirui Zhang, Zhisong Zhang, Zhuosheng Zhang, Ziqi Zhang, Chao Zhao, Chen Zhao, Dongyan Zhao, Guangxiang Zhao, Jieyu Zhao, Kai Zhao, Mengjie Zhao, Sanqiang Zhao, Tiancheng Zhao, Tianyu Zhao, Tiejun Zhao, Yang Zhao, Yanpeng + +Zhao, Yao Zhao, Yilun Zhao, Zhenjie Zhao, Zhou Zhao, Bo Zheng, Changmeng Zheng, Chujie Zheng, Renjie Zheng, Xiaqing Zheng, Yinhe Zheng, Zaixiang Zheng, Ming Zhong, Peixiang Zhong, Victor Zhong, Wanjun Zhong, Zexuan Zhong, Ben Zhou, Chunting Zhou, Deyu Zhou, Dong Zhou, Giulio Zhou, Guangyou Zhou, Jiawei Zhou, Jie Zhou, Jie Zhou, Jingbo Zhou, Junpei Zhou, Junsheng Zhou, Li Zhou, Long Zhou, Meng Zhou, Pei Zhou, Qingyu Zhou, Shuyan Zhou, Wangchunshu Zhou, Wenxuan Zhou, Xiang Zhou, Xiangyang Zhou, Yaqian Zhou, Yi Zhou, Yichao Zhou, Yichu Zhou, Yilun Zhou, Yucheng Zhou, Zhengyu Zhou, Zhihan Zhou, Conghui Zhu, Hao Zhu, Jian Zhu, Jun Zhu, Junnan Zhu, Kenny Q. Zhu, Lixing Zhu, Muhua Zhu, Qi Zhu, Qingfu Zhu, Qinglin Zhu, Su Zhu, Wei Zhu, Xiaoyan Zhu, Yilun Zhu, Yong Zhu, Zining Zhu, Fuzhen Zhuang, Yimeng Zhuang, Caleb Ziems, Roger Zimmermann, Heike Zinsmeister, Ayah Zirikly, Shi Zong, Bowei Zou, Yanyan Zou, Amal Zouaq, Arkaitz Zubiaga, Pierre Zweigenbaum + +# Outstanding Action Editors + +Antonios Anastasopoulos, David Bamman, Steven Bethard, Leonid Boytsov, Paula Carvalho, Snigdha Chaturvedi, Raj Dabre, Daniel Dakota, Johannes Daxenberger, Leon Derczynski, Greg Durrett, Michael Elhadad, Allyson Ettinger, Goran Glavaš, David Harwath, Shubhra Kanti Karmaker, Daniel Khashabi, Mamoru Komachi, Carolin Lawrence, John Lawrence, Constantine Lignos, Saif M. Mohammad, Philippe Muller, Rebecca J. Passonneau, Emily Prud'hommeaux, Mrinmaya Sachan, Lane Schwartz, Kevin Small, Efstathios Stamatos, Amanda Stent, Amalia Todirascu, Junichi Tsujii, Suzan Verberne, Antonio Jimeno Yepes, François Yvon, Luke Zettlemoyer, Justine Zhang + +# Outstanding Reviewers + +Nader Akoury, Gianni Barlacchi, Rachel Bawden, Gábor Bella, Delphine Bernhard, Shruti Bhosale, Michael Bloodgood, Ondrej Bojar, Iacer Calixto, Rémi Cardon, Thiago Castro Ferreira, Tuhin Chakrabarty, Verna Dankers, Yupei Du, Micha Elsner, Antske Fokkens, Stella Frank, Alexander Fraser, Dayne Freitag, Daniel Fried, Dan Garrette, Philip John Gorinski, Dagmar Gromann, Liane Guillou, Jack Hessel, Nanjiang Jiang, Gareth J. F. Jones, Min-Yen Kan, Anna Kazantseva, Fajri Koto, Julia Kreutzer, Kalpesh Krishna, Dawn Lawrie, Andrew Lee, Jordan Lee Boyd-Graber, Gina-Anne Levow, Xiang Lisa Li, Patrick William Littell, Kaixin Ma, Vladislav Maraev, Alexander Mehler, Florian Metze, Julian Michael, Paul Michel, Elena Musi, Sheshera Mysore, Denis Newman-Griffis, Tong Niu, Michal Novák, Siddharth Patwardhan, Karl Pichotta, Yuval Pinter, Peng Qi, Surangika Ranathunga, Vikas Raunak, Pedro Rodriguez, Sebastian Ruder, Alexander M. Rush, Elizabeth Salesky, Thomas SchAAF, Yves Scherrer, Viktor Schlegel, Elliot Schumacher, Ian Stewart, Naomi Tachikawa Shapiro, Emiel van Miltenburg, Peter West, Adam Wiemerslage, Jitao Xu, Yue Yu, Yury Zemlyanskiy + +# Table of Contents + +Is Whole Word Masking Always Better for Chinese BERT?: Probing on Chinese Grammatical Error Correction + +Yong Dai, Linyang Li, Cong Zhou, Zhangyin Feng, Enbo Zhao, Xipeng Qiu, Piji Li and Duyu Tang 1 + +Compilable Neural Code Generation with Compiler Feedback + +Xin Wang, Yasheng Wang, Yao Wan, Fei Mi, Yitong Li, Pingyi Zhou, Jin Liu, Hao Wu, Xin Jiang and Qun Liu 9 + +Towards Unifying the Label Space for Aspect- and Sentence-based Sentiment Analysis + +Yiming Zhang, Min Zhang, Sai Wu and Junbo Zhao 20 + +Input-specific Attention Subnetworks for Adversarial Detection + +Emil Biju, Anirudh Sriram, Pratyush Kumar and Mitesh M Khapra. 31 + +RelationPrompt: Leveraging Prompts to Generate Synthetic Data for Zero-Shot Relation Triplet Extraction + +Yew Ken Chia, Lidong Bing, Soujanya Poria and Luo Si 45 + +Pre-Trained Multilingual Sequence-to-Sequence Models: A Hope for Low-Resource Language Translation? + +En-Shiun Annie Lee, Sarubi Thillainathan, Shravan Nayak, Surangika Ranathunga, David Ifeoluwa Adelani, Ruisi Su and Arya D. McCarthy 58 + +Multi-Scale Distribution Deep Variational Autoencoder for Explanation Generation + +ZeFeng Cai, Linlin Wang, Gerard de Melo, Fei Sun and Liang He. 68 + +Dual Context-Guided Continuous Prompt Tuning for Few-Shot Learning + +Jie Zhou, Le Tian, Houjin Yu, Zhou Xiao, Hui Su and Jie Zhou 79 + +Extract-Select: A Span Selection Framework for Nested Named Entity Recognition with Generative Adversarial Training + +Peixin Huang, Xiang Zhao, Minghao Hu, Yang Fang, Xinyi Li and Weidong Xiao 85 + +Controlled Text Generation Using Dictionary Prior in Variational Autoencoders + +Xianghong Fang, Jian Li, Lifeng Shang, Xin Jiang, Qun Liu and Dit-Yan Yeung 97 + +Challenges to Open-Domain Constituency Parsing + +Sen Yang, Leyang Cui, Ruoxi Ning, Di Wu and Yue Zhang 112 + +Going Deeper: Structured Sememe Prediction via Transformer with Tree Attention + +Yining Ye, Fanchao Qi, Zhiyuan Liu and Maosong Sun 128 + +Table-based Fact Verification with Self-adaptive Mixture of Experts + +Yuxuan Zhou, Xien Liu, Kaiyin Zhou and Ji Wu 139 + +Investigating Data Variance in Evaluations of Automatic Machine Translation Metrics + +Jiannan Xiang, Huayang Li, Yahui Liu, Lemao Liu, Guoping Huang, Defu Lian and Shuming Shi + +Sememe Prediction for BabelNet Synsets using Multilingual and Multimodal Information + +Fanchao Qi, Chuancheng Lv, Zhiyuan Liu, Xiaojun Meng, Maosong Sun and Hai-Tao Zheng 158 + +Query and Extract: Refining Event Extraction as Type-oriented Binary Decoding + +Sijia Wang, Mo Yu, Shiyu Chang, Lichao Sun and Lifu Huang 169 + +LEVEN: A Large-Scale Chinese Legal Event Detection Dataset + +Feng Yao, Chaojun Xiao, Xiaozhi Wang, Zhiyuan Liu, Lei Hou, Cunchao Tu, Juanzi Li, Yun Liu, Weixing Shen and Maosong Sun 183 + +Analyzing Dynamic Adversarial Training Data in the Limit + +Eric Wallace, Adina Williams, Robin Jia and Douwe Kiela 202 + +AbductionRules: Training Transformers to Explain Unexpected Inputs + +Nathan Young, Qiming Bao, Joshua Bensemann and Michael J. Witbrock 218 + +On the Importance of Data Size in Probing Fine-tuned Models + +Houman Mehrafarin, Sara Rajaee and Mohammad Taher Pilehvar. 228 + +RuCCoN: Clinical Concept Normalization in Russian + +Alexander Nesterov, Galina Zubkova, Zulfat Miftahutdinov, Vladimir Kokh, Elena Tutubalina, Artem Shelmanov, Anton M. Alekseev, Manvel Avetisian, Andrey Chertok and Sergey Nikolenko. 239 + +A Sentence is Worth 128 Pseudo Tokens: A Semantic-Aware Contrastive Learning Framework for Sentence Embeddings + +Haochen Tan, Wei Shao, Han Wu, Ke Yang and Linqi Song 246 + +Eider: Empowering Document-level Relation Extraction with Efficient Evidence Extraction and Inference-stage Fusion + +Yiqing Xie, Jiaming Shen, Sha Li, Yuning Mao and Jiawei Han 257 + +Meta-X_NLG: A Meta-Learning Approach Based on Language Clustering for Zero-Shot Cross-Linguual Transfer and Generation + +Kaushal Kumar Maurya and Maunendra Sankar Desarkar 269 + +MR-P: A Parallel Decoding Algorithm for Iterative Refinement Non-Autoregressive Translation + +Hao Cheng and Zhihua Zhang 285 + +Open Relation Modeling: Learning to Define Relations between Entities + +Jie Huang, Kevin Chang, Jinjun Xiong and Wen-mei Hwu 297 + +A Slot Is Not Built in One Utterance: Spoken Language Dialogs with Sub-Slots + +Sai Zhang, Yuwei Hu, Yuchuan Wu, Jiaman Wu, Yongbin Li, Jian Sun, Caixia Yuan and Xiaojie Wang 309 + +Towards Transparent Interactive Semantic Parsing via Step-by-Step Correction + +Lingbo Mo, Ashley Lewis, Huan Sun and Michael White 322 + +MINER: Multi-Interest Matching Network for News Recommendation + +Jian Li, Jieming Zhu, Qiwei Bi, Guohao Cai, Lifeng Shang, Zhenhua Dong, Xin Jiang and Qun Liu 343 + +KSAM: Infusing Multi-Source Knowledge into Dialogue Generation via Knowledge Source Aware Multi-Head Decoding + +Sixing Wu, Ying Li, Dawei Zhang and Zhonghai Wu 353 + +Towards Responsible Natural Language Annotation for the Varieties of Arabic + +A. Stevie Bergman and Mona T. Diab 364 + +Dynamically Refined Regularization for Improving Cross-corpora Hate Speech Detection + +Tulika Bose, Nikolaos Aletras, Irina Illina and Dominique Fohr 372 + +Towards Large-Scale Interpretable Knowledge Graph Reasoning for Dialogue Systems + +Yi-Lin Tuan, Sajjad Beygi, Maryam Fazel-Zarandi, Qiaozi Gao, Alessandra Cervone and William Yang Wang 383 + +MDERank: A Masked Document Embedding Rank Approach for Unsupervised Keyphrase Extraction + +Linhan Zhang, Qian Chen, Wen Wang, Chong Deng, ShiLiang Zhang, Bing Li, Wei Wang and Xin Cao 396 + +Visualizing the Relationship Between Encoded Linguistic Information and Task Performance + +Jiannan Xiang, Huayang Li, Defu Lian, Guoping Huang, Taro Watanabe and Lemao Liu.... 410 + +Efficient Argument Structure Extraction with Transfer Learning and Active Learning + +Xinyu Hua and Lu Wang. 423 + +Plug-and-Play Adaptation for Continuously-updated QA + +Kyungjae Lee, Wookje Han, Seung-won Hwang, Hwaran Lee, Joonsuk Park and Sang-Woo Lee 438 + +Reinforced Cross-modal Alignment for Radiology Report Generation + +Han Qin and Yan Song 448 + +What Works and Doesn't Work, A Deep Decoder for Neural Machine Translation + +Zuchao Li, Yiran Wang, Masao Utiyama, Eiichiro Sumita, Hai Zhao and Taro Watanabe . . . 459 + +SyMCoM - Syntactic Measure of Code Mixing A Study Of English-Hindi Code-Mixing + +Prashant Kodali, Anmol Goel, Monjit Choudhury, Manish Srivastava and Ponnurangam Kumaraguru 472 + +HybridDialogue: An Information-Seeking Dialogue Dataset Grounded on Tabular and Textual Data + +Kai Nakamura, Sharon Levy, Yi-Lin Tuan, Wenhu Chen and William Yang Wang 481 + +NEWTS: A Corpus for News Topic-Focused Summarization + +Seyed Ali Bahrainian, Sheridan Feucht and Carsten Eickhoff 493 + +Classification without (Proper) Representation: Political Heterogeneity in Social Media and Its Implications for Classification and Behavioral Analysis + +Kenan Alkiek, Bohan Zhang and David Jurgens 504 + +Toward More Meaningful Resources for Lower-resourced Languages + +Constantine Lignos, Nolan Holley, Chester Palen-Michel and Jonne Säleva 523 + +Better Quality Estimation for Low Resource Corpus Mining + +Muhammed Yusuf Kocyigit, Jiho Lee and Derry Wijaya 533 + +End-to-End Segmentation-based News Summarization + +Yang Liu,Chenguang Zhu and Michael Zeng 544 + +Fast Nearest Neighbor Machine Translation + +Yuxian Meng, Xiaoya Li, Xiayu Zheng, Fei Wu, Xiaofei Sun, Tianwei Zhang and Jiwei Li . . 555 + +Extracting Latent Steering Vectors from Pretrained Language Models + +Nishant Subramani, Nivedita Suresh and Matthew E Peters 566 + +Domain Generalisation of NMT: Fusing Adapters with Leave-One-Domain-Out Training + +Thuy-Trang Vu, Shahram Khadivi, Dinh Phung and Gholamreza Haffari 582 + +Reframing Instructional Prompts to GPTk's Language + +Daniel Khashabi, Chitta Baral, Yejin Choi and Hannaneh Hajishirzi 589 + +Read Top News First: A Document Reordering Approach for Multi-Document News Summarization + +Chao Zhao, Tenghao Huang, Somnath Basu Roy Chowdhury, Muthu Kumar Chandrasekaran, Kathleen McKeown and Snigdha Chaturvedi 613 + +Human Language Modeling + +Nikita Soni, Matthew Matero, Niranjan Balasubramanian and H. Schwartz 622 + +Inverse is Better! Fast and Accurate Prompt for Few-shot Slot Tagging + +Yutai Hou, Cheng Chen, Xianzhen Luo, Bohan Li and Wanxiang Che 637 + +Cross-Modal Cloze Task: A New Task to Brain-to-Word Decoding + +Shuxian Zou, Shaonan Wang, Jiajun Zhang and Chengqing Zong 648 + +Mitigating Gender Bias in Distilled Language Models via Counterfactual Role Reversal + +Umang Gupta, Jwala Dhamala, Varun Kumar, Apurv Verma, Yada Pruksachatkun, Satyapriya Krishna, Rahul Gupta, Kai-Wei Chang, Greg Ver Steeg and Aram Galstyan 658 + +Domain Representative Keywords Selection: A Probabilistic Approach + +Pritom Saha Akash, Jie Huang, Kevin Chang, Yunyao Li, Lucian Popa and ChengXiang Zhai679 + +Hierarchical Inductive Transfer for Continual Dialogue Learning + +Shaoxiong Feng, Xuancheng Ren, Kan Li and Xu Sun 693 + +Why Exposure Bias Matters: An Imitation Learning Perspective of Error Accumulation in Language Generation + +Kushal Arora, Layla El Asri, Hareesh Bahuleyan and Jackie CK Cheung 700 + +Question Answering Infused Pre-training of General-Purpose Contextualized Representations + +Robin Jia, Mike Lewis and Luke Zettlemoyer 711 + +Automatic Song Translation for Tonal Languages + +Fenfei Guo, Chen Zhang, Zhirui Zhang, Qixin He, Kejun Zhang, Jun Xie and Jordan Lee Boyd-Graber 729 + +Read before Generate! Faithful Long Form Question Answering with Machine Reading + +Dan SU, Xiaoguang Li, Jindi Zhang, Lifeng Shang, Xin Jiang, Qun Liu and Pascale Fung . . . 744 + +A Simple yet Effective Relation Information Guided Approach for Few-Shot Relation Extraction + +Yang Liu, Jinpeng Hu, Xiang Wan and Tsung-Hui Chang 757 + +MIMICause: Representation and automatic extraction of causal relation types from clinical notes + +Vivek Khetan, Md Imbesat Hassan Rizvi, Jessica Huber, Paige Bartusiak, Bogdan Eugen Sacaleanu and Andrew Fano 764 + +Compressing Sentence Representation for Semantic Retrieval via Homomorphic Projective Distillation + +Xuandong Zhao, Zhiguo Yu, Ming Wu and Lei Li 774 + +Debiasing Event Understanding for Visual Commonsense Tasks + +Minji Seo, YeonJoon Jung, Seungtaek Choi, Seung-won Hwang and Bei Liu 782 + +Fact-Tree Reasoning for N-ary Question Answering over Knowledge Graphs + +Yao Zhang, Peiyao Li, Hongru Liang, Adam Jatowt and Zhenglu Yang 788 + +DeepStruct: Pretraining of Language Models for Structure Prediction + +Chenguang Wang, Xiao Liu, Zui Chen, Haoyun Hong, Jie Tang and Dawn Song. 803 + +The Change that Matters in Discourse Parsing: Estimating the Impact of Domain Shift on Parser Error + +Katherine Atwell, Anthony Sicilia, Seong Jae Hwang and Malihe Alikhani 824 + +Mukayese: Turkish NLP Strikes Back + +Ali Safaya, Emirhan Kurtuluş, Arda Goktogan and Deniz Yuret. 846 + +Virtual Augmentation Supported Contrastive Learning of Sentence Representations + +Dejiao Zhang, Wei Xiao, Henghui Zhu, Xiaofei Ma and Andrew Arnold 864 + +MoErection: Transformer Feed-forward Layers are Mixtures of Experts + +Zhengyan Zhang, Yankai Lin, Zhiyuan Liu, Peng Li, Maosong Sun and Jie Zhou 877 + +DS-TOD: Efficient Domain Specialization for Task-Oriented Dialog + +Chia-Chien Hung, Anne Lauscher, Simone Paolo Ponzetto and Goran Glavaš 891 + +Distinguishing Non-natural from Natural Adversarial Samples for More Robust Pre-trained Language Model + +Jiayi Wang, Rongzhou Bao, Zhuosheng Zhang and Hai Zhao 905 + +Learning Adaptive Axis Attentions in Fine-tuning: Beyond Fixed Sparse Attention Patterns + +Zihan Wang, Jiuxiang Gu, Jason Kuen, Handong Zhao, Vlad I Morariu, Ruiyi Zhang, Ani Nenkova, Tong Sun and Jingbo Shang 916 + +Using Interactive Feedback to Improve the Accuracy and Explainability of Question Answering Systems Post-Deployment + +Zichao Li, Prakhar Sharma, Xing Han Lu, Jackie CK Cheung and Siva Reddy 926 + +To be or not to be an Integer? Encoding Variables for Mathematical Text + +Deborah Ferreira, Mokanarangan Thayaparan, Marco Valentino, Julia Rozanova and Andre Freitas 938 + +GRS: Combining Generation and Revision in Unsupervised Sentence Simplification + +Mohammad Dehghan, Dhruv Kumar and Lukasz Golab 949 + +BPE vs. Morphological Segmentation: A Case Study on Machine Translation of Four Polysynthetic Languages + +Manuel Mager, Arturo Oncevay, Elisabeth Mager, Katharina Kann and Thang Vu 961 + +Distributed NLI: Learning to Predict Human Opinion Distributions for Language Reasoning + +Xiang Zhou, Yixin Nie and Mohit Bansal 972 + +Morphological Processing of Low-Resource Languages: Where We Are and What's Next + +Adam Wiemerslage, Miikka Silfverberg, Changbing Yang, Arya D. McCarthy, Garrett Nicolai, Eliana Colunga and Katharina Kann 988 + +Learning and Evaluating Character Representations in Novels + +Naoya Inoue, Charuta Pethe, Allen Kim and Steven Skiena 1008 + +Answer Uncertainty and Unanswerability in Multiple-Choice Machine Reading Comprehension + +Vatsal Raina and Mark Gales 1020 + +Measuring the Language of Self-Disclosure across Corpora + +Ann-Katrin Reuel, Sebastian Peralta, João Sedoc, Garrick Sherman and Lyle Ungar 1035 + +When Chosen Wisely, More Data Is What You Need: A Universal Sample-Efficient Strategy For Data Augmentation + +Ehsan Kamalloo, Mehdi Rezagholizadeh and Ali Ghodsi 1048 + +Explaining Classes through Stable Word Attributions + +Samuel Rönnqvist, Aki-Juhani Kyröläinen, Amanda Myntti, Filip Ginter and Veronika Laippala 1063 + +What to Learn, and How: Toward Effective Learning from Rationales Samuel Carton, Surya Kanoria and Chenhao Tan 1075 +Listening to Affected Communities to Define Extreme Speech: Dataset and Experiments +Antonis Maronikolakis, Axel Wisiorek, Leah Nann, Haris Jabbar, Sahana Udupa and Hinrich Schuetze 1089 +Entropy-based Attention Regularization Frees Unintended Bias Mitigation from Lists Giuseppe Attanasio, Debora Nozza, Dirk Hovy and Elena Baralis 1105 +From BERT's Point of View: Revealing the Prevailing Contextual Differences +Carolin M. Schuster and Simon Hegelich 1120 +Learning Bias-reduced Word Embeddings Using Dictionary Definitions Haozhe An, Xiaojiang Liu and Donald Zhang 1139 +Knowledge Graph Embedding by Adaptive Limit Scoring Loss Using Dynamic Weighting Strategy +Jinfa Yang, Xianghua Ying, Yongjie Shi, Xin Tong, Ruibin Wang, Taiyan Chen and Bowei Xing 1153 +OCR Improves Machine Translation for Low-Resource Languages +Oana Ignat, Jean Maillard, Vishrav Chaudhary and Francisco Guzmán 1164 +CoCoLM: Complex Commonsense Enhanced Language Model with Discourse Relations +Changlong Yu, Hongming Zhang, Yangqiu Song and Wilfred Ng 1175 +Learning to Robustly Aggregate Labeling Functions for Semi-supervised Data Programming +Ayush Maheshwari, Krishnateja Killamsetty, Ganesh Ramakrishnan, Rishabh K Iyer, Marina Danilevsky and Lucian Popa 1188 +Multi-Granularity Semantic Aware Graph Model for Reducing Position Bias in Emotion Cause Pair Extraction +Yinan Bao, Qianwen Ma, Lingwei Wei, Wei Zhou and Songlin Hu 1203 +Cross-lingual Inference with A Chinese Entailment Graph +Tianyi Li, Sabine Weber, Mohammad Javad Hosseini, Liane Guillou and Mark Steedman . 1214 +Multi-task Learning for Paraphrase Generation With Keyword and Part-of-Speech Reconstruction +Xuhang Xie, Xuesong Lu and Bei Chen 1234 +MDCSpell: A Multi-task Detector-Corrector Framework for Chinese Spelling Correction +Chenxi Zhu, Ziqiang Ying, Boyu Zhang and Feng Mao 1244 +$S^2 SQL$ : Injecting Syntax to Question-Schema Interaction Graph Encoder for Text-to-SQL Parsers Binyuan Hui, Ruiying Geng, Lihan Wang, Bowen Qin, Yanyang Li, Bowen Li, Jian Sun and Yongbin Li 1254 +Constructing Open Cloze Tests Using Generation and Discrimination Capabilities of Transformers Mariano Felice, Shiva Taslimipoor and Paula Buttery 1263 +Co-training an Unsupervised Constituency Parser with Weak Supervision Nickil Maveli and Shay B Cohen 1274 +HiStruct+: Improving Extractive Text Summarization with Hierarchical Structure Information +Qian Ruan, Malte Ostendorff and Georg Rehm. 1292 +An Isotropy Analysis in the Multilingual BERT Embedding Space Sara Rajaee and Mohammad Taher Pilehvar 1309 + +Multi-Stage Prompting for Knowledgeable Dialogue Generation + +Zihan Liu, Mostofa Patwary, Ryan Prenger, Shrimai Prabhumoye, Wei Ping, Mohammad Shoeybi and Bryan Catanzaro 1317 + +DuReader.vis: A Chinese Dataset for Open-domain Document Visual Question Answering + +Le Qi, Shangwen Lv, Hongyu Li, Jing Liu, Yu Zhang, Qiaoqiao She, Hua Wu, Haifeng Wang and Ting Liu 1338 + +Coloring the Blank Slate: Pre-training Imparts a Hierarchical Inductive Bias to Sequence-to-sequence Models + +Aaron Mueller, Robert Frank, Tal Linzen, Luheng Wang and Sebastian Schuster 1352 + +$C^3 KG$ : A Chinese Commonsense Conversation Knowledge Graph + +Dawei Li, Yanran Li, Jiayi Zhang, Ke Li, Chen Wei, Jianwei Cui and Bin Wang 1369 + +Graph Neural Networks for Multiparallel Word Alignment + +Ayyoob Imani, Lutfi Kerem Senel, Masoud Jalili Sabet, François Yvon and Hinrich Schuetze 1384 + +Sentiment Word Aware Multimodal Refinement for Multimodal Sentiment Analysis with ASR Errors + +Yang Wu, Yanyan Zhao, Hao Yang, Song Chen, Bing Qin, Xiaohuan Cao and Wenting Zhao1397 + +A Novel Framework Based on Medical Concept Driven Attention for Explanable Medical Code Prediction via External Knowledge + +Tao Wang, Linhai Zhang, Chenchen Ye, Junxi Liu and Deyu Zhou 1407 + +Effective Unsupervised Constrained Text Generation based on Perturbed Masking + +Yingwen Fu, Wenjie Ou, Zhou Yu and Yue Lin 1417 + +Combining (Second-Order) Graph-Based and Headed-Span-Based Projective Dependency Parsing + +Songlin Yang and Kewei Tu 1428 + +End-to-End Speech Translation for Code Switched Speech + +Orion Weller, Matthias Sperber, Telmo Pires, Hendra Setiawan, Christian Gollan, Dominic C Telaar and Matthias Paulik 1435 + +A Transformational Biencoder with In-Domain Negative Sampling for Zero-Shot Entity Linking + +Kai Sun, Richong Zhang, Samuel Mensah, Yongyi Mao and Xudong Liu 1449 + +Finding the Dominant Winning Ticket in Pre-Trained Language Models + +Zhuocheng Gong, Di He, Yelong Shen, Tie-Yan Liu, Weizhu Chen, Dongyan Zhao, Ji-Rong Wen and Rui Yan 1459 + +Thai Nested Named Entity Recognition Corpus + +Weerayut Buaphet, Can Udomcharoenchaikit, Peerat Limkonchotiwat, Attapol Rutherford and Sarana Nutanong. 1473 + +Two-Step Question Retrieval for Open-Domain QA + +Yeon Seonwoo, Juhee Son, Jiho Jin, Sang-Woo Lee, Ji-Hoon Kim, Jung-Woo Ha and Alice Oh 1487 + +Semantically Distributed Robust Optimization for Vision-and-Language Inference + +Tejas Gokhale, Abhishek Chaudhary, Pratyay Banerjee, Chitta Baral and Yezhou Yang .... 1493 + +Learning from Missing Relations: Contrastive Learning with Commonsense Knowledge Graphs for Commonsense Inference + +Yong-Ho Jung, Jun-Hyung Park, Joon-Young Choi, Mingyu Lee, Junho Kim, Kang-Min Kim and SangKeun Lee 1514 + +Capture Human Disagreement Distributions by Calibrated Networks for Natural Language Inference + +Yuxia Wang, Minghan Wang, Yimeng Chen, Shimin Tao, Jiaxin Guo, Chang Su, Min Zhang and Hao Yang 1524 + +Efficient, Uncertainty-based Moderation of Neural Networks Text Classifiers + +Jakob Smedegaard Andersen and Walid Maalej 1536 + +Revisiting Automatic Evaluation of Extractive Summarization Task: Can We Do Better than ROUGE? + +Mousumi Akter, Naman Bansal and Shubhra Kanti Karmaker 1547 + +Open Vocabulary Extreme Classification Using Generative Models + +Daniel Simig, Fabio Petroni, Pouya Yanki, Kashyap Popat, Christina Du, Sebastian Riedel and Majid Yazdani 1561 + +Decomposed Meta-Learning for Few-Shot Named Entity Recognition + +Tingting Ma, Huiqiang Jiang, Qianhui Wu, Tiejun Zhao and Chin-Yew Lin 1584 + +TegTok: Augmenting Text Generation via Task-specific and Open-world Knowledge + +Chao-Hong Tan, Jia-Chen Gu, Chongyang Tao, Zhen-Hua Ling, Can Xu, Huang Hu, Xiubo Geng and Daxin Jiang. 1597 + +EmoCaps: Emotion Capsule based Model for Conversational Emotion Recognition + +Zaijing Li, Fengxiao Tang, Ming Zhao and Yusen Zhu 1610 + +Logic-Driven Context Extension and Data Augmentation for Logical Reasoning of Text + +Siyuan Wang, Wanjun Zhong, Duyu Tang, Zhongyu Wei, Zhihao Fan, Daxin Jiang, Ming Zhou and Nan Duan 1619 + +Transfer Learning and Prediction Consistency for Detecting Offensive Spans of Text + +Amir Pouran Ben Veyseh, Ning Xu, Quan Hung Tran, Varun Manjunatha, Franck Dernoncourt and Thien Huu Nguyen 1630 + +Learning Reasoning Patterns for Relational Triple Extraction with Mutual Generation of Text and Graph + +Yubo Chen, Yunqi Zhang and Yongfeng Huang 1638 + +Document-Level Event Argument Extraction via Optimal Transport + +Amir Pouran Ben Veyseh, Minh Van Nguyen, Franck Dernoncourt, Bonan Min and Thien Huu Nguyen 1648 + +N-Shot Learning for Augmenting Task-Oriented Dialogue State Tracking + +Ibrahim Taha Aksu, Zhengyuan Liu, Min-Yen Kan and Nancy F. Chen 1659 + +Document-Level Relation Extraction with Adaptive Focal Loss and Knowledge Distillation + +Qingyu Tan, Ruidan He, Lidong Bing and Hwee Tou Ng 1672 + +Calibration of Machine Reading Systems at Scale + +Shehzaad Zuzar Dhuliawala, Leonard Adolphs, Rajarshi Das and Mrinmaya Sachan 1682 + +Towards Adversarily Robust Text Classifiers by Learning to Reweight Clean Examples + +Jianhan Xu, Cenyuan Zhang, Xiaqing Zheng, Linyang Li, Cho-Jui Hsieh, Kai-Wei Chang and Xuanjing Huang 1694 + +Morphosyntactic Tagging with Pre-trained Language Models for Arabic and its Dialects + +Go Inoue, Salam Khalifa and Nizar Habash 1708 + +How Pre-trained Language Models Capture Factual Knowledge? A Causal-Inspired Analysis +Shaobo Li, Xiaoguang Li, Lifeng Shang, Zhenhua Dong, Chengjie Sun, Bingquan Liu, Zhenzhou Ji, Xin Jiang and Qun Liu 1720 +Metadata Shaping: A Simple Approach for Knowledge-Enhanced Language Models +Simran Arora, Sen Wu, Enci Liu and Christopher Re 1733 +Enhancing Natural Language Representation with Large-Scale Out-of-Domain Commonsense Wanyun Cui and Xingran Chen. 1746 +Weighted self Distillation for Chinese word segmentation +Rian He, Shubin Cai, Zhong Ming and Jialei Zhang 1757 +Sibylvariant Transformations for Robust Text Classification +Fabrice Y Harel-Canada, Muhammad Ali Gulzar, Nanyun Peng and Miryung Kim 1771 +DaLC: Domain Adaptation Learning Curve Prediction for Neural Machine Translation +Cheonbok Park, Hantae Kim, Ioan Calapodescu, Hyun Chang Cho and Vassilina Nikoulina 1789 +Hey AI, Can You Solve Complex Tasks by Talking to Agents? Tushar Khot, Kyle Richardson, Daniel Khashabi and Ashish Sabharwal 1808 +Modality-specific Learning Rates for Effective Multimodal Additive Late-fusion Yiqun Yao and Rada Mihalcea 1824 +BiSyn-GAT+: Bi-Syntax Aware Graph Attention Network for Aspect-based Sentiment Analysis Shuo Liang, Wei Wei, Xian-Ling Mao, Fei Wang and Zhiyong He 1835 +IndicBART: A Pre-trained Model for Indic Natural Language Generation Raj Dabre, Himani Shrotriya, Anoop Kunchukuttan, Ratish Puduppully, Mitesh M Khapra and Pratyush Kumar. 1849 +Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Models +Jianmo Ni, Gustavo Hernandez Abrego, Noah Constant, Ji Ma, Keith Hall, Daniel Cer and Yinfei Yang. 1864 +Improving Relation Extraction through Syntax-induced Pre-training with Dependency Masking +Yuanhe Tian, Yan Song and Fei Xia. 1875 +Striking a Balance: Alleviating Inconsistency in Pre-trained Models for Symmetric Classification Tasks Ashutosh Kumar and Aditya Joshi 1887 +Diversifying Content Generation for Commonsense Reasoning with Mixture of Knowledge Graph Experts +Wenhao Yu, Chenguang Zhu, Lianhui Qin, Zhihan Zhang, Tong Zhao and Meng Jiang. 1896 +Dict-BERT: Enhancing Language Model Pre-training with Dictionary +Wenhao Yu, Chenguang Zhu, Yuwei Fang, Donghan Yu, Shuohang Wang, Yichong Xu, Michael Zeng and Meng Jiang. 1907 +A Feasibility Study of Answer-Unaware Question Generation for Education Liam Dugan, Eleni Miltsakaki, Shriyash Kaustubh Upadhyay, Etan Jacob Ginsberg, Hannah Gonzalez, DaHyeon Choi, Chuning Yuan and Chris Callison-Burch 1919 +Relevant CommonSense Subgraphs for What if... Procedural Reasoning +Chen Zheng and Parisa Kordjamshidi 1927 + +Combining Feature and Instance Attribution to Detect Artifacts +Pouya Pezeshkpour, Sarthak Jain, Sameer Singh and Byron C Wallace 1934 +Leveraging Expert Guided Adversarial Augmentation For Improving Generalization in Named Entity Recognition Aaron Reich, Jiaao Chen, Aastha Agrawal, Yanzhe Zhang and Diyi Yang. 1947 +Label Semantics for Few Shot Named Entity Recognition +Jie Ma, Miguel Ballesteros, Srikanth Doss, Rishita Anubhai, Sunil Mallya, Yaser Al-Onaizan and Dan Roth. 1956 +Detection, Disambiguation, Re-ranking: Autoregressive Entity Linking as a Multi-Task Problem +Khalil Mrini, Shaoliang Nie, Jiatao Gu, Sinong Wang, Maziar Sanjabi and Hamed Firooz . . 1972 +VISITRON: Visual Semantics-Aligned Interactively Trained Object-Navigator +Ayush Shrivastava, Karthik Gopalakrishnan, Yang Liu, Robinson Piramuthu, Gokhan Tur, Devi Parikh and Dilek Hakkani-Tur. 1984 +Investigating Selective Prediction Approaches Across Several Tasks in IID, OOD, and Adversarial Settings Neeraj Varshney, Swaroop Mishra and Chitta Baral. 1995 +Unsupervised Natural Language Inference Using PHL Triplet Generation Neeraj Varshney, Pratyay Banerjee, Tejas Gokhale and Chitta Baral 2003 +Data Augmentation and Learned Layer Aggregation for Improved Multilingual Language Understanding in Dialogue +Evgeniia Razumovskaia, Ivan Vulić and Anna Korhonen 2017 +Ranking-Constrained Learning with Rationales for Text Classification +Juanyan Wang, Manali Sharma and Mustafa Bilgic 2034 +CaM-Gen: Causally Aware Metric-Guided Text Generation +Navita Goyal, Roodram Paneri, Ayush Agarwal, Udit Kalani, Abhilasha Sancheti and Niyati Chhaya 2047 +Training Dynamics for Text Summarization Models Tanya Goyal, Jiacheng Xu, Junyi Jessy Li and Greg Durrett 2061 +Richer Countries and Richer Representations +Kaitlyn Zhou, Kawin Ethayarajh and Dan Jurafsky 2074 +BBQ: A hand-built bias benchmark for question answering +Alicia Parrish, Angelica Chen, Nikita Nangia, Vishakh Padmakumar, Jason Phang, Jana Thompson, Phu Mon Htut and Samuel R. Bowman 2086 +Zero-shot Learning for Grapheme to Phoneme Conversion with Language Ensemble +Xinjian Li, Florian Metze, David R Mortensen, Shinji Watanabe and Alan Black 2106 +Dim Wihl Gat Tun: The Case for Linguistic Expertise in NLP for Under-Documented Languages +Clarissa Forbes, Farhan Samir, Bruce Harold Oliver, Changbing Yang, Edith Coates, Garrett Nicolai and Miikka Silfverberg 2116 +Question Generation for Reading Comprehension Assessment by Modeling How and What to Ask +Bilal Ghanem, Lauren Lutz Coleman, Julia Rivard Dexter, Spencer McIntosh von der Ohe and Alona Fyshe. 2131 + +TABi: Type-Aware Bi-Encoders for Open-Domain Entity Retrieval +Megan Leszczynski, Daniel Y Fu, Mayee F Chen and Christopher Re 2147 +Hierarchical Recurrent Aggregative Generation for Few-Shot NLG Giulio Zhou, Gerasimos Lampouras and Ignacio Iacobacci 2167 +Training Text-to-Text Transformers with Privacy Guarantees Natalia Ponomareva, Jasmijn Bastings and Sergei Vassilvitskii 2182 +Revisiting Uncertainty-based Query Strategies for Active Learning with Transformers Christopher Schröder, Andreas Niekler and Martin Potthast 2194 +The impact of lexical and grammatical processing on generating code from natural language +Nathanaël Beau and Benoit Crabbé 2204 +Seq2Path: Generating Sentiment Tuples as Paths of a Tree Yue Mao, Yi Shen, Jingchao Yang, Xiaoying Zhu and Longjun Cai 2215 +Mitigating the Inconsistency Between Word Saliency and Model Confidence with Pathological Contrastive Training +Pengwei Zhan, Yang Wu, Shaolei Zhou, Yunjian Zhang and Liming Wang 2226 +Your fairness may vary: Pretrained language model fairness in toxic text classification +Ioana Baldini, Dennis Wei, Karthikeyan Natesan Ramamurthy, Moninder Singh and Mikhail Yurochkin 2245 +ChartQA: A Benchmark for Question Answering about Charts with Visual and Logical Reasoning +Ahmed Masry, Do Xuan Long, Jia Qing Tan, Shafiq Joty and Enamul Hoque 2263 +A Novel Perspective to Look At Attention: Bi-level Attention-based Explainable Topic Modeling for News Classification +Dairui Liu, Derek Greene and Ruihai Dong 2280 +Learn and Review: Enhancing Continual Named Entity Recognition via Reviewing Synthetic Samples Yu Xia, Quan Wang, Yajuan Lyu, Yong Zhu, Wenhao Wu, Sujian Li and Dai Dai 2291 +Phoneme transcription of endangered languages: an evaluation of recent ASR architectures in the single speaker scenario Gilles Boulianne 2301 +Does BERT really agree? Fine-grained Analysis of Lexical Dependence on a Syntactic Task +Karim Lasri, Alessandro Lenci and Thierry Poibeau 2309 +Combining Static and Contextualised Multilingual Embeddings +Katharina Hammerl, Jindrich Libovický and Alexander Fraser 2316 +An Accurate Unsupervised Method for Joint Entity Alignment and Dangling Entity Detection Shengxuan Luo and Sheng Yu 2330 +Square One Bias in NLP: Towards a Multi-Dimensional Exploration of the Research Manifold Sebastian Ruder, Ivan Vulic and Anders Søgaard 2340 +Systematicity, Compositionality and Transitivity of Deep NLP Models: a Metamorphic Testing Perspective +Edoardo Manino, Julia Rozanova, Danilo Carvalho, Andre Freitas and Lucas Carvalho Cordeiro 2355 + +Improving Neural Political Statement Classification with Class Hierarchical Information + +Erenay Dayanik, Andre Blessing, Nico Blokker, Sebastian Haunss, Jonas Kuhn, Gabriella Lapesa and Sebastian Pado 2367 + +Enabling Multimodal Generation on CLIP via Vision-Language Knowledge Distillation + +Wenliang Dai, Lu Hou, Lifeng Shang, Xin Jiang, Qun Liu and Pascale Fung 2383 + +Co-VQA : Answering by Interactive Sub Question Sequence + +Ruonan Wang, Yuxi Qian, Fangxiang Feng, Xiaojie Wang and Huixing Jiang 2396 + +A Simple Hash-Based Early Exiting Approach For Language Understanding and Generation + +Tianxiang Sun, Xiangyang Liu, Wei Zhu, Zhichao Geng, Lingling Wu, Yilong He, Yuan Ni, Guotong Xie, Xuanjing Huang and Xipeng Qiu 2409 + +Auxiliary tasks to boost Biaffine Semantic Dependency Parsing + +Marie Candito 2422 + +Syntax-guided Contrastive Learning for Pre-trained Language Model + +Shuai Zhang, Wang Lijie, Xinyan Xiao and Hua Wu 2430 + +Improved Multi-label Classification under Temporal Concept Drift: Rethinking Group-Robust Algorithms in a Label-Wise Setting + +Ilias Chalkidis and Anders Søgaard 2441 + +ASCM: An Answer Space Clustered Prompting Method without Answer Engineering + +Zhen Wang, Yating Yang, Zhou Xi, Bo Ma, Lei Wang, Rui Dong and Azmat Anwar 2455 + +Why don't people use character-level machine translation? + +Jindrich Libovicky, Helmut Schmid and Alexander Fraser 2470 + +Seeking Patterns, Not just Memorizing Procedures: Contrastive Learning for Solving Math Word Problems + +Zhongli Li, Wenxuan Zhang, Chao Yan, Qingyu Zhou, Chao Li, Hongzhi Liu and Yunbo Cao 2486 + +xGQA: Cross-Linguual Visual Question Answering + +Jonas Pfeiffer, Gregor Geigle, Aishwarya Kamath, Jan-Martin O. Steitz, Stefan Roth, Ivan Vulić and Iryna Gurevych 2497 + +Automatic Speech Recognition and Query By Example for Creole Languages Documentation + +Cécile Macaire, Didier Schwab, Benjamin Lecouteux and Emmanuel Schang 2512 + +MReD: A Meta-Review Dataset for Structure-Controlable Text Generation + +Chenhui Shen, Liying Cheng, Ran Zhou, Lidong Bing, Yang You and Luo Si 2521 + +Single Model Ensemble for Subword Regularized Models in Low-Resource Machine Translation + +Sho Takase, Tatsuya Hiraoka and Naoaki Okazaki 2536 + +Detecting Various Types of Noise for Neural Machine Translation + +Christian Herold, Jan Rosendahl, Joris Vanvinckenroye and Hermann Ney 2542 + +DU-VLG: Unifying Vision-and-Language Generation via Dual Sequence-to-Sequence Pre-training + +Luyang Huang, Guocheng Niu, Jiachen Liu, Xinyan Xiao and Hua Wu 2552 + +HiCLRE: A Hierarchical Contrastive Learning Framework for Distantly Supervised Relation Extraction + +Dongyang Li, Taolin Zhang, Nan Hu, Chengyu Wang and Xiaofeng He 2567 + +Prompt-Driven Neural Machine Translation + +Yafu Li, Yongjing Yin, Jing Li and Yue Zhang 2579 + +On Controlling Fallback Responses for Grounded Dialogue Generation + +Hongyuan Lu, Wai Lam, Hong Cheng and Helen M. Meng 2591 + +CRAFT: A Benchmark for Causal Reasoning About Forces and inTeractions + +Tayfun Ates, M. Şamil Ateşoglu, Çağatay Yüz, Ilker Kesen, Mert Kobas, Erkut Erdem, Aykut Erdem, Tilbe Goksun and Deniz Yuret 2602 + +A Graph Enhanced BERT Model for Event Prediction + +Li Du, Xiao Ding, Yue Zhang, Ting Liu and Bing Qin 2628 + +Long Time No See! Open-Domain Conversation with Long-Term Persona Memory + +Xinchao Xu, Zhibin Gou, Wenquan Wu, Zheng-Yu Niu, Hua Wu, Haifeng Wang and Shihang Wang 2639 + +Lacking the Embedding of a Word? Look it up into a Traditional Dictionary + +Elena Sofia Ruzzetti, Leonardo Ranaldi, Michele Mastromattei, Francesca Fallucchi, Noemi Scarpato and Fabio Massimo Zanzotto 2651 + +MTRec: Multi-Task Learning over BERT for News Recommendation + +Qiwei Bi, Jian Li, Lifeng Shang, Xin Jiang, Qun Liu and Hanfang Yang 2663 + +Cross-domain Named Entity Recognition via Graph Matching + +Junhao Zheng, Haibin Chen and Qianli Ma 2670 + +Assessing Multilingual Fairness in Pre-trained Multimodal Representations + +Jialu Wang, Yang Liu and Xin Eric Wang 2681 + +More Than Words: Collocation Retokenization for Latent Dirichlet Allocation Models + +Jin Cheevaprawatdomrong, Alexandra Schofield and Attapol Rutherford 2696 + +Generalized but not Robust? Comparing the Effects of Data Modification Methods on Out-of-Domain Generalization and Adversarial Robustness + +Tejas Gokhale, Swaroop Mishra, Man Luo, Bhavdeep Singh Sachdeva and Chitta Baral . . . 2705 + +ASSIST: Towards Label Noise-Robust Dialogue State Tracking + +Fanghua Ye, Yue Feng and Emine Yilmaz 2719 + +Graph Refinement for Coreference Resolution + +Lesly Miculicich and James Henderson 2732 + +ECO v1: Towards Event-Centric Opinion Mining + +Ruoxi Xu, Hongyu Lin, Meng Liao, Xianpei Han, Jin Xu, Wei Tan, Yingfei Sun and Le Sun2743 + +Deep Reinforcement Learning for Entity Alignment + +Lingbing Guo, Yuqiang Han, Qiang Zhang and Huajun Chen 2754 + +Breaking Down Multilingual Machine Translation + +Ting-Rui Chiang, Yi-Pei Chen, Yi-Ting Yeh and Graham Neubig 2766 + +Mitigating Contradictions in Dialogue Based on Contrastive Learning + +Weizhao Li, Junsheng Kong, Ben Liao and Yi Cai 2781 + +ELLE: Efficient Lifelong Pre-training for Emerging Data + +Yujia Qin, Jiajie Zhang, Yankai Lin, Zhiyuan Liu, Peng Li, Maosong Sun and Jie Zhou ..... 2789 + +EnCBP: A New Benchmark Dataset for Finer-Grained Cultural Background Prediction in English Weicheng Ma, Samiha Datta, Lili Wang and Soroush Vosoughi 2811 +Cutting Down on Prompts and Parameters: Simple Few-Shot Learning with Language Models Robert L. Logan IV, Ivana Balazevic, Eric Wallace, Fabio Petroni, Sameer Singh and Sebastian Riedel 2824 +uFACT: Unfaithful Alien-Corpora Training for Semantically Consistent Data-to-Text Generation Tisha Anders, Alexandru Coca and Bill Byrne 2836 +Good Night at 4 pm?! Time Expressions in Different Cultures +Vered Shwartz 2842 +Extracting Person Names from User Generated Text: Named-Entity Recognition for Combating Human Trafficking Yifei Li, Pratheeksha Nair, Kellin Pelrine and Reihaneh Rabbany 2854 +OneAligner: Zero-shot Cross-lingual Transfer with One Rich-Resource Language Pair for Low-Resource Sentence Retrieval +Tong Niu, Kazuma Hashimoto, Yingbo Zhou and Caiming Xiong 2869 +Suum Cuique: Studying Bias in Taboo Detection with a Community Perspective +Osama Khalid, Jonathan Rusert and Padmini Srinivasan 2883 +Modeling Intensification for Sign Language Generation: A Computational Approach +Mert Inan, Yang Zhong, Sabit Hassan, Lorna Quandt and Malihe Alikhani 2897 +Controllable Natural Language Generation with Contrastive Prefixes Jing Qian, Li Dong, Yelong Shen, Furu Wei and Weizhu Chen 2912 +Revisiting the Effects of Leakage on Dependency Parsing +Nathaniel Krasner, Miriam Wanner and Antonios Anastasopoulos 2925 +Learning to Describe Solutions for Bug Reports Based on Developer Discussions +Sheena Panthaplackel, Junyi Jessy Li, Milos Gligoric and Ray Mooney 2935 +Perturbations in the Wild: Leveraging Human-Written Text Perturbations for Realistic Adversarial Attack and Defense +Thai Le, Jooyoung Lee, Kevin Yen, Yifan Hu and Dongwon Lee. 2953 +Improving Chinese Grammatical Error Detection via Data augmentation by Conditional Error Generation +Tianchi Yue, Shulin Liu, Huihui Cai, Tao Yang, Shengkang Song and TingHao YU. 2966 +Modular and Parameter-Efficient Multimodal Fusion with Prompting Sheng Liang, Mengjie Zhao and Hinrich Schuetze 2976 +Synchronous Refinement for Neural Machine Translation +Kehai Chen, Masao Utiyama, Eiichiro Sumita, Rui Wang and Min Zhang. 2986 +HIE-SQL: History Information Enhanced Network for Context-Dependent Text-to-SQL Semantic Parsing +Yanzhao Zheng, Haibin Wang, Baohua Dong, Xingjun Wang and Changshan Li. 2997 +CRASpell: A Contextual Tipo Robust Approach to Improve Chinese Spelling Correction Shulin Liu, Shengkang Song, Tianchi Yue, Tao Yang, Huihui Cai, TingHao YU and Shengli Sun 3008 + +Gaussian Multi-head Attention for Simultaneous Machine Translation +Shaolei Zhang and Yang Feng 3019 +Composing Structure-Aware Batches for Pairwise Sentence Classification Andreas Waldis, Tilman Beck and Iryna Gurevych 3031 +Factual Consistency of Multilingual Pretrained Language Models +Constanza Fierro and Anders Søgaard 3046 +Selecting Stickers in Open-Domain Dialogue through Multitask Learning +Zhexin Zhang, Yeshuang Zhu, Zhengcong Fei, Jinchao Zhang and Jie Zhou 3053 +ZiNet: Linking Chinese Characters Spanning Three Thousand Years Yang Chi, Fausto Giunchiglia, Daqian Shi, Xiaolei Diao, Chuntao Li and Hao Xu 3061 +How Can Cross-lingual Knowledge Contribute Better to Fine-Grained Entity Typing? Hailong Jin, Tiansi Dong, Lei Hou, Juanzi Li, Hui Chen, Zelin Dai and Qu Yincen 3071 +AMR-DA: Data Augmentation by Abstract Meaning Representation Ziyi Shou, Yuxin Jiang and Fangzhen Lin 3082 +Using Pre-Trained Language Models for Producing Counter Narratives Against Hate Speech: a Comparative Study +Serra Sinem Tekiroglu, Helena Bonaldi, Margherita Fanton and Marco Guerini 3099 +Improving Robustness of Language Models from a Geometry-aware Perspective +Bin Zhu, Zhaoquan Gu, Le Wang, Jinyin Chen and Qi Xuan. 3115 +Task-guided Disentangled Tuning for Pretrained Language Models +Jiali Zeng, Yufan Jiang, Shuangzhi Wu, Yongjing Yin and Mu Li 3126 +Exploring the Impact of Negative Samples of Contrastive Learning: A Case Study of Sentence Embedding +Rui Cao, Yihao Wang, Yuxin Liang, Ling Gao, Jie Zheng, Jie Ren and Zheng Wang 3138 +The Inefficiency of Language Models in Scholarly Retrieval: An Experimental Walk-through Shruti Singh and Mayank Singh 3153 +Fusing Heterogeneous Factors with Triaffine Mechanism for Nested Named Entity Recognition Zheng Yuan, Chuanqi Tan, Songfang Huang and Fei Huang 3174 +UNIMO-2: End-to-End Unified Vision-Language Grounded Learning Wei Li, Can Gao, Guocheng Niu, Xinyan Xiao, Hao Liu, Jiachen Liu, Hua Wu and Haifeng Wang 3187 +The Past Mistake is the Future Wisdom: Error-driven Contrastive Probability Optimization for Chinese Spell Checking +Yinghui Li, Qingyu Zhou, Yangning Li, Zhongli Li, Ruiyang Liu, Rongyi Sun, Zizhen Wang, Chao Li, Yunbo Cao and Hai-Tao Zheng 3202 +XFUND: A Benchmark Dataset for Multilingual Visually Rich Form Understanding +Yiheng Xu, Tengchao Lv, Lei Cui, Guoxin Wang, Yijuan Lu, Dinei Florencio, Cha Zhang and Furu Wei. 3214 +Type-Driven Multi-Turn Corrections for Grammatical Error Correction +Shaopeng Lai, Qingyu Zhou, Jiali Zeng, Zhongli Li, Chao Li, Yunbo Cao and Jinsong Su ... 3225 + +Leveraging Knowledge in Multilingual Commonsense Reasoning + +Yuwei Fang, Shuohang Wang, Yichong Xu, Ruochen Xu, Siqi Sun, Chenguang Zhu and Michael Zeng. 3237 + +Encoding and Fusing Semantic Connection and Linguistic Evidence for Implicit Discourse Relation Recognition + +Wei Xiang, Bang Wang, Lu Dai and Yijun Mo 3247 + +One Agent To Rule Them All: Towards Multi-agent Conversational AI + +Christopher Clarke, Joseph J Peper, Karthik Krishnamurthy, Walter Talamonti, Kevin Leach, Walter Lasecki, Yiping Kang, Lingjia Tang and Jason Mars 3258 + +Word-level Perturbation Considering Word Length and Compositional Subwords + +Tatsuya Hiraoka, Sho Takase, Kei Uchiumi, Atsushi Keyaki and Naoaki Okazaki. 3268 + +Bridging Pre-trained Language Models and Hand-crafted Features for Unsupervised POS Tagging + +Houquan Zhou, Yang Li, Zhenghua Li and Min Zhang 3276 + +Controlling the Focus of Pretrained Language Generation Models + +Jiabao Ji, Yoon Kim, James R. Glass and Tianxing He 3291 + +Comparative Opinion Summarization via Collaborative Decoding + +HayateIso,Xiaolan Wang,StefanosAngelidis and Yoshihiko Suhara 3307 + +IsoScore: Measuring the Uniformity of Embedding Space Utilization + +William Rudman, Nate Gillman, Taylor Rayne and Carsten Eickhoff 3325 + +A Natural Diet: Towards Improving Naturalness of Machine Translation Output + +Markus Freitag, David Vilar, David Grangier, Colin Cherry and George Foster 3340 + +From Stance to Concern: Adaptation of Propositional Analysis to New Tasks and Domains + +Brodie Mather, Bonnie J Dorr, Adam Dalton, William de Beaumont, Owen Rambow and Sonja M. Schmer-Galunder 3354 + +CUE Vectors: Modular Training of Language Models Conditioned on Diverse Contextual Signals + +Scott Novotney, Sreeparna Mukherjee, Zeeshan Ahmed and Andreas Stolcke 3368 + +Cross-Linguual UMLS Named Entity Linking using UMLS Dictionary Fine-Tuning + +Rina Galperin, Shachar Schnapp and Michael Elhadad 3380 + +Aligned Weight Regularizers for Pruning Pretrained Neural Networks + +James O'Neil, Sourav Dutta and Haytham Assem 3391 + +Consistent Representation Learning for Continual Relation Extraction + +Kang Zhao, Hua Xu, Jiangong Yang and Kai Gao 3402 + +Event Transition Planning for Open-ended Text Generation + +Qintong Li, Piji Li, Wei Bi, Zhaochun Ren, Yuxuan Lai and Lingpeng Kong 3412 + +Comprehensive Multi-Modal Interactions for Referring Image Segmentation + +Kanishk Jain and Vineet Gandhi 3427 + +MetaWeighting: Learning to Weight Tasks in Multi-Task Learning + +Yuren Mao, Zekai Wang, Weiwei Liu, Xuemin Lin and Pengtao Xie 3436 + +Improving Controllable Text Generation with Position-Aware Weighted Decoding + +Yuxuan Gu, Xiaocheng Feng, Sicheng Ma, Jiaming Wu, Heng Gong and Bing Qin 3449 + +Prompt Tuning for Discriminative Pre-trained Language Models + +Yuan Yao, Bowen Dong, Ao Zhang, Zhengyan Zhang, Ruobing Xie, Zhiyuan Liu, Leyu Lin, Maosong Sun and Jianyong Wang 3468 + +Two Birds with One Stone: Unified Model Learning for Both Recall and Ranking in News Recommendation + +Chuhan Wu, Fangzhao Wu, Tao Qi and Yongfeng Huang 3474 + +What does it take to bake a cake? The RecipeRef corpus and anaphora resolution in procedural text + +Biaoyan Fang, Timothy Baldwin and Karin Verspoor 3481 + +MERIt: Meta-Path Guided Contrastive Learning for Logical Reasoning + +Fangkai Jiao, Yangyang Guo, Xuemeng Song and Liqiang Nie 3496 + +THE-X: Privacy-Preserving Transformer Inference with Homomorphic Encryption + +Tianyu Chen, Hangbo Bao, Shaohan Huang, Li Dong, Binxing Jiao, Daxin Jiang, Haoyi Zhou, Jianxin Li and Furu Wei 3510 + +HLDC: Hindi Legal Documents Corpus + +Arnav Kapoor, Mudit Dhawan, Anmol Goel, Arjun T H, Akshala Bhatnagar, Vibhu Agrawal, Amul Agrawal, Arnab Bhattacharya, Ponnurangam Kumaraguru and Ashutosh Modi 3521 + +Rethinking Document-level Neural Machine Translation + +Zewei Sun, Mingxuan Wang, Hao Zhou, Chengqi Zhao, Shujian Huang, Jiajun Chen and Lei Li 3537 + +Incremental Intent Detection for Medical Domain with Contrast Replay Networks + +Guirong Bai, Shizhu He, Kang Liu and Jun Zhao 3549 + +LaPraDoR: Unsupervised Pretrained Dense Retriever for Zero-Shot Text Retrieval + +Canwen Xu, Daya Guo, Nan Duan and Julian McAuley 3557 + +Do Pre-trained Models Benefit Knowledge Graph Completion? A Reliable Evaluation and a Reasonable Approach + +Xin Lv, Yankai Lin, Yixin Cao, Lei Hou, Juanzi Li, Zhiyuan Liu, Peng Li and Jie Zhou . 3570 + +EICO: Improving Few-Shot Text Classification via Explicit and Implicit Consistenc + +Lei Zhao and Cheng Yao 3582 + +Improving the Adversarial Robustness of NLP Models by Information Bottleneck + +Cenyuan Zhang, Xiang Zhou, Yixin Wan, Xiaoqing Zheng, Kai-Wei Chang and Cho-Jui Hsieh 3588 + +Incorporating Dynamic Semantics into Pre-Trained Language Model for Aspect-based Sentiment Analysis + +Kai Zhang, Kun Zhang, Mengdi Zhang, Hongke Zhao, Qi Liu, Wei Wu and Enhong Chen. 3599 + +DARER: Dual-task Temporal Relational Recurrent Reasoning Network for Joint Dialog Sentiment Classification and Act Recognition + +Bowen Xing and Ivor Tsang 3611 + +Divide and Conquer: Text Semantic Matching with Disentangled Keywords and Intent + +Yicheng Zou, Hongwei Liu, Tao Gui, Junzhe Wang, Qi Zhang, Meng Tang, Haixiang Li and Daniell Wang 3622 + +Modular Domain Adaptation + +Junshen K Chen, Dallas Card and Dan Jurafsky 3633 + +Detection of Adversarial Examples in Text Classification: Benchmark and Baseline via Robust Density Estimation +KiYoon Yoo, Jangho Kim, Jiho Jang and Nojun Kwak 3656 +Platt-Bin: Efficient Posterior Calibrated Training for NLP Classifiers +Rishabh Singh and Shirin Goshtasbpour 3673 +Addressing Resource and Privacy Constraints in Semantic Parsing Through Data Augmentation +Kevin Yang, Olivia Deng, Charles Chen, Richard Shin, Subhro Roy and Benjamin Van Durme 3685 +Improving Candidate Retrieval with Entity Profile Generation for Wikidata Entity Linking +Tuan Lai, Heng Ji and ChengXiang Zhai 3696 +Local Structure Matters Most: Perturbation Study in NLU +Louis Clouatre, Prasanna Parthasarathi, Amal Zouaq and Sarath Chandar 3712 +Probing Factually Grounded Content Transfer with Factual Ablation +Peter West, Chris Quirk, Michel Galley and Yejin Choi 3732 +ED2LM: Encoder-Decoder to Language Model for Faster Document Re-ranking Inference +Kai Hui, Honglei Zhuang, Tao Chen, Zhen Qin, Jing Lu, Dara Bahri, Ji Ma, Jai Gupta, Cicero Nogueira dos Santos, Yi Tay and Donald Metzler. 3747 +Benchmarking Answer Verification Methods for Question Answering-Based Summarization Evaluation Metrics Daniel Deutsch and Dan Roth 3759 +Prior Knowledge and Memory Enriched Transformer for Sign Language Translation +Tao Jin, Zhou Zhao, Meng Zhang and Xingshan Zeng 3766 +Discontinuous Constituency and BERT: A Case Study of Dutch Konstantinos Kogkalidis and Gijs Wijnholds 3776 +Probing Multilingual Cognate Prediction Models Clémentine Fourier and Benoit Sagot. 3786 +A Neural Pairwise Ranking Model for Readability Assessment Justin Lee and Sowmya Vajjala 3802 +First the Worst: Finding Better Gender Translations During Beam Search Danielle Saunders, Rosie Sallis and Bill Byrne 3814 +Dialogue Summaries as Dialogue States (DS2), Template-Guided Summarization for Few-shot Dialogue State Tracking +Jamin Shin, Hangyeol Yu, Hyeongdon Moon, Andrea Madotto and Juneyoung Park 3824 +Unsupervised Preference-Aware Language Identification +Xingzhang Ren, Baosong Yang, Dayiheng Liu, Haibo Zhang, Xiaoyu Lv, Liang Yao and Jun Xie 3847 +Using NLP to quantify the environmental cost and diversity benefits of in-person NLP conferences Piotr Przybyla and Matthew Shardlow 3853 +Interpretable Research Replication Prediction via Variational Contextual Consistency Sentence Masking Tianyi Luo, Rui Meng, Xin Eric Wang and Yang Liu 3864 + +Chinese Synesthesia Detection: New Dataset and Models +Xiaotong Jiang, Qingqing Zhao, Yunfei Long and Zhongqing Wang 3877 +Rethinking Offensive Text Detection as a Multi-Hop Reasoning Problem +Qiang Zhang, Jason Naradowsky and Yusuke Miyao. 3888 +On the Safety of Conversational Models: Taxonomy, Dataset, and Benchmark Hao Sun, Guangxuan Xu, Jiawen Deng, Jiale Cheng, Chujie Zheng, Hao Zhou, Nanyun Peng, Xiaoyan Zhu and Minlie Huang 3906 +Word Segmentation by Separation Inference for East Asian Languages Yu Tong, Jingzhi Guo, Jizhe Zhou, Ge Chen and Guokai Zheng 3924 +Unsupervised Chinese Word Segmentation with BERT Oriented Probing and Transformation Wei Li, Yuhan Song, Qi Su and Yanqiu Shao 3935 +E-KAR: A Benchmark for Rationalizing Natural Language Analogical Reasoning +Jiangjie Chen, Rui Xu, Ziquan Fu, Wei Shi, Zhongqiao Li, Xinbo Zhang, Changzhi Sun, Lei Li, Yanghua Xiao and Hao Zhou 3941 +Implicit Relation Linking for Question Answering over Knowledge Graph +Yao Zhao, Jiacheng Huang, Wei Hu, Qijin Chen, XiaoXia Qiu, Chengfu Huo and Weijun Ren 3956 +Attention Mechanism with Energy-Friendly Operations Yu Wan, Baosong Yang, Dayiheng Liu, Rong Xiao, Derek F. Wong, Haibo Zhang, Boxing Chen and Lidia S. Chao 3969 +Probing BERT's priors with serial reproduction chains Takateru Yamakoshi, Thomas L. Griffiths and Robert D. Hawkins 3977 +Interpreting the Robustness of Neural NLP Models to Textual Perturbations +Yunxiang Zhang, Liangming Pan, Samson Tan and Min-Yen Kan 3993 +Zero-Shot Dense Retrieval with Momentum Adversarial Domain Invariant Representations +Ji Xin, Chenyan Xiong, Ashwin Srinivasan, Ankita Sharma, Damien Jose and Paul N. Bennett +4008 +A Few-Shot Semantic Parser for Wizard-of-Oz Dialogues with the Precise ThingTalk Representation +Giovanni Campagna, Sina Semnani, Ryan Othniel Kearns, Lucas Jun Koba Sato, Silei Xu and Monica Lam. 4021 +GCPG: A General Framework for Controllable Paraphrase Generation +Kexin Yang, Dayiheng Liu, Wenqiang Lei, Baosong Yang, Haibo Zhang, Xue Zhao, Wenqing Yao and Boxing Chen 4035 +CrossAligner & Co: Zero-Shot Transfer Methods for Task-Oriented Cross-lingual Natural Language Understanding +Milan Gritta, Ruoyu Hu and Ignacio Iacobacci 4048 +Attention as Grounding: Exploring Textual and Cross-Modal Attention on Entities and Relations in Language-and-Vision Transformer +Nikolai Ilinykh and Simon Dobnik 4062 +Improving Zero-Shot Cross-lingual Transfer Between Closely Related Languages by Injecting Character-Level Noise +Noëmi Aepli and Rico Senrich 4074 + +Structural Supervision for Word Alignment and Machine Translation Lei Li, Kai Fan, Hongjia Li and Chun Yuan 4084 +Focus on the Action: Learning to Highlight and Summarize Jointly for Email To-Do Items Summarization +Kexun Zhang, Jiaao Chen and Diyi Yang 4095 +Exploring the Capacity of a Large-scale Masked Language Model to Recognize Grammatical Errors Ryo Nagata, Manabu Kimura and Kazuaki Hanawa 4107 +Should We Trust This Summary? Bayesian Abstractive Summarization to The Rescue Alexios Gidiotis and Grigorios Tsoumakas 4119 +On the data requirements of probing Zining Zhu, Jixuan Wang, Bai Li and Frank Rudzicz 4132 +Translation Error Detection as Rationale Extraction Marina Fomicheva, Lucia Specia and Nikolaos Aletras 4148 +Towards Collaborative Neural-Symbolic Graph Semantic Parsing via Uncertainty +Zi Lin, Jeremiah Zhe Liu and Jingbo Shang 4160 +Towards Few-shot Entity Recognition in Document Images: A Label-aware Sequence-to-Sequence Framework +Zilong Wang and Jingbo Shang 4174 +On Length Divergence Bias in Textual Matching Models +Lan Jiang, Tianshu Lyu, Yankai Lin, Meng Chong, Xiaoyong Lyu and Dawei Yin 4187 +What is wrong with you?: Leveraging User Sentiment for Automatic Dialog Evaluation +Sarik Ghazarian, Behnam Hedayatnia, Alexandros Papangelis, Yang Liu and Dilek Hakkani-Tur 4194 \ No newline at end of file diff --git a/findingsoftheassociationforcomputationallinguisticsacl2022/images.zip b/findingsoftheassociationforcomputationallinguisticsacl2022/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b637ece20b629977b5af38a8eb8fbebdc0cde28d --- /dev/null +++ b/findingsoftheassociationforcomputationallinguisticsacl2022/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af2180f3c5ff59c28a00677dc0e46ac4a1da6df315a4f43bfbe34039294d6250 +size 52584 diff --git a/findingsoftheassociationforcomputationallinguisticsacl2022/layout.json b/findingsoftheassociationforcomputationallinguisticsacl2022/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fdb6f3b03a5bbf2350c76a7c9202b9a9f17aea02 --- /dev/null +++ b/findingsoftheassociationforcomputationallinguisticsacl2022/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4dfa577f42a0b8315488258321aef32a447ae88a9418191533fdb9c23c44da6c +size 1306552 diff --git a/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_content_list.json b/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bb6178c33512d0a47a0cdd2ab97e7391157a2991 --- /dev/null +++ b/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d82e6fb7e04b970fc105848359f0f79bc7d3c0334cae72536f3bf3d5a32af307 +size 97846 diff --git a/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_model.json b/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..58315a6f62bec2ab90a427d9f6d4b73c6930b241 --- /dev/null +++ b/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:641b93d2a871ed2815ec0d1646a0690f5207ac378bc720da8e17460d12d67098 +size 110968 diff --git a/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_origin.pdf b/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..864b615042e808ba16031811f5ccfac2d3111219 --- /dev/null +++ b/findingthedominantwinningticketinpretrainedlanguagemodels/0be47a57-e9f2-49b9-aeba-a6cf9d2e238d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75ea9e8e33c3ae6767f5baa94d25538649551cd002850af08f35255869c9b44a +size 701898 diff --git a/findingthedominantwinningticketinpretrainedlanguagemodels/full.md b/findingthedominantwinningticketinpretrainedlanguagemodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e78c80a4e70268b38c55467bd207e7f04e63cf9f --- /dev/null +++ b/findingthedominantwinningticketinpretrainedlanguagemodels/full.md @@ -0,0 +1,305 @@ +# Finding the Dominant Winning Ticket in Pre-Trained Language Models + +Zhuocheng Gong $^{1}$ , Di He $^{2}$ , Yelong Shen $^{3}$ , Tie-yan Liu $^{2}$ , Weizhu Chen $^{3}$ , Dongyan Zhao $^{1,4,5*}$ , Ji-rong Wen $^{6}$ and Rui Yan $^{6*}$ + +$^{1}$ Wangxuan Institute of Computer Technology, Peking University, China + +$^{2}$ Microsoft Research, Beijing, China, $^{3}$ Microsoft Azure AI + +$^{4}$ Artificial Intelligence Institute of Peking University + +${}^{5}$ State Key Laboratory of Media Convergence Production + +$^{6}$ Gaoling School of Artificial Intelligence, Renmin University of China + +{gzhch, zhaody}@pku.edu.cn,{jrwen, ruiyan}@ruc.edu.cn + +{dihe, yelong.shen, tyliu, wzchen}@microsoft.com + +# Abstract + +The Lottery Ticket Hypothesis suggests that for any over-parameterized model, a small subnetwork exists to achieve competitive performance compared to the backbone architecture. In this paper, we study whether there is a winning lottery ticket for pre-trained language models, which allow the practitioners to fine-tune the parameters in the ticket but achieve good downstream performance. To achieve this, we regularize the fine-tuning process with L1 distance and explore the subnetwork structure (what we refer to as the "dominant winning ticket"). Empirically, we show that (a) the dominant winning ticket can achieve performance that is comparable with that of the full-parameter model, (b) the dominant winning ticket is transferable across different tasks, (c) and the dominant winning ticket has a natural structure within each parameter matrix. Strikingly, we find that a dominant winning ticket that takes up $0.05\%$ of the parameters can already achieve satisfactory performance, indicating that the PLM is significantly reducible during fine-tuning. + +# 1 Introduction + +Pre-trained Language Models (PLMs) have shown significant performance on various natural language processing (NLP) tasks (Devlin et al., 2018; Liu et al., 2019). However, as the number of model parameters gets huge, fine-tuning such models becomes inefficient. Many previous works target parameter-efficient fine-tuning approaches by freezing the PLM parameters. One can either freeze a subset of the parameters (Zaken et al., 2021) and + +![](images/181669d8e8e74f85a1589696efab67aed37c212e7cf0968b4ebdb00cb997e2ef.jpg) +Figure 1: An illustration of the structure of the dominant winning ticket. + +fine-tune the remainings or freeze all of them and plug in light modules with new learnable parameters (Houlsby et al., 2019; Mahabadi et al., 2021; Hu et al., 2021). + +In parallel to this line of study, an emerging subfield has explored the possibility of training smaller subnetworks in place of the full models without hurting performance (Lee et al., 2018; Wang et al., 2020). Among them, the lottery ticket hypothesis (LTH) (Frankle and Carbin, 2018) has attracted much attention. LTH demonstrates that an overparameterized network contains "winning tickets" (small-scale subnetworks) that can 1) match the performance of the full model; and 2) outperform randomly sampled subnetworks of the same size. Winning tickets have been verified to exist in PLMs (Prasanna et al., 2020). + +In this paper, we provide an interesting result by showing that a subnetwork, which we refer to as the dominant winning ticket, exists in the PLM. It can make us to freeze all other parameters but only train the parameters of the subnetwork and obtain competitive performance for any downstream tasks. To achieve this, we fine-tune the PLM on one task + +(e.g., MNLI) and enforce the parameter weights close to their initial weights (pre-trained weights) by using the L1-distance penalty. This allows us to identify which parts of the model parameters change greater from the pre-trained weights during fine-tuning. We observe this ticket has some novel properties: + +- The dominant winning ticket (i.e., the subnetwork) is extremely sparse, which only takes up to $0.05\%$ of the total parameters on RoBERTa-large. But fine-tuning the subnetwork can achieve comparable performance with fine-tuning the whole model. +- Compared with randomly sampled subnetworks of the same size, the dominant winning ticket can achieve better performance with a faster convergence rate. +- The dominant winning ticket is insensitive to random seed and transferable across different downstream tasks. In other words, it is intrinsically determined by the pre-trained weights and can adapt to various downstream tasks. +- The dominant winning ticket is highly structured. It is like the "skeleton" of the network, which may give us some insights into the mechanism of PLMs. + +We organize the paper as follows. After a brief overview of related works in section 2, we introduce how we are aware of the existence of the dominant winning ticket in PLMs and how we identify and extract it in section 3. Then we experiment on the dominant winning ticket in section 4. In section 5, we do further discussions about the dominant winning ticket. Section 6 is about some implications and future directions of the work. + +# 2 Related Work + +# 2.1 Pruning + +Multiple studies of BERT concluded that it is considerably overparametrized (Kovaleva et al., 2019; Michel et al., 2019). In particular, it is possible to ablate elements of its architecture without loss in performance or even with slight gains (Voita et al., 2019; Li et al., 2021). There has been much recent work on compressing PLM. See overviews by Ganesh et al. (2021). Pruning is a promising line of work for model compression which involves obtaining smaller subnetworks with minimal performance loss (Gordon et al., 2020; Sajjad et al., 2020). + +A common approach is selecting the weights to be pruned by magnitude (Han et al., 2015). + +Previous work has found that there exist subnetworks inside the neural network, which is called the lottery ticket hypothesis (Frankle and Carbin, 2018). Some of the recent findings are that the lottery ticket hypothesis holds for PLMs: inside largescale pre-trained model there exist subnetworks that can be retrained alone to reach the performance close to that of the full model (Chen et al., 2020; Prasanna et al., 2020; Liang et al., 2021). Prasanna et al. (2020) claimed that "When BERT plays the lottery, all tickets are winning". Liang et al. (2021) shows that there exist super tickets inside PLMs that can improve generalization. + +# 2.2 Parameter-efficient Fine-tune + +Parameter-efficient fine-tuning aims at reducing the number of trainable parameters when fine-tuning the models across different downstream domains. Various approaches are invented to achieve the goal. Some inserted and only trained adapters, which have much lesser trainable parameters, between existing layers (Houlsby et al., 2019; Mahabadi et al., 2021; Rebuffi et al., 2017). Another line of the study proposed to update only a subset of parameters when fine-tuning. For example, Gordon et al. (2020) leveraged L0 regularization to limit the nonzero elements in the update vectors. Zaken et al. (2021) proposed that only tune bias terms can reach a decent performance. Zhao et al. (2020) applied the sparse binary mask to the pre-trained weights to reduce the trainable parameter size. Besides, some proposed that the PLM has a low intrinsic dimensionality (Aghajanyan et al., 2020). Hu et al. (2021) proposed a low-rank decomposition-based method that can also significantly reduce the number of trainable parameters. Chen et al. (2021) combined low-rank decomposition and sparse mask during fine-tuning. + +# 3 The Dominant Winning Ticket in PLMs + +We start with a question: which parts of the model parameters are more important when adapting PLMs to downstream tasks? To answer this question, we design the L1-regularized fine-tuning approach and then analyze the L1-regularized weights and reveal the existence of the dominant winning ticket. + +![](images/e0dd1b8ecf568e122ffaaf0dbe39d53e00c8f46f723c514bcbb8b87d33f4ad97.jpg) +Figure 2: Visualization of out weighted parameters in RoBERTa-large. Each row is a model fine-tuned on different downstream tasks. Each column is the parameter matrix of different layers. For example, the top left block represents the value projection matrix of the 5th transformer layer from the model fine-tuned with the MNLI dataset. ("K", "Q", "V", "O" stand for the key, query, value, and output projection metrics of the self-attention module, "FC1" and "FC2" stand for the successive two fully-connected transformation metrics in each layer.) + +# 3.1 L1-regularized Fine-tuning + +To identify the subnetwork, we apply L1 regularization to all the transformer parameters. Specifically, we modify the original training objective, which results in the following minimization problem, + +$$ +\underset {\boldsymbol {\theta}} {\min } L (\mathcal {D}, f, \boldsymbol {\theta}) + \lambda | | \boldsymbol {\theta} - \boldsymbol {\theta} _ {0} | | _ {1}, \tag {1} +$$ + +where $\mathcal{D}$ represents for the task-specific data, $\theta$ is the model configuration(i.e., parameters), and $\theta_0$ is the pre-trained model, which is fixed. $\lambda$ is a hyper-parameter to control the weight of the regularization term, i.e., the strength of the sparsity. This training objective can make a large part of the parameters being close to their initial weights. + +# 3.2 Regularized Weights Analysis + +We use L1-regularized fine-tuning to answer the previous proposed question: which parts of the model parameters are more important when adapting PLMs to downstream tasks? We compute the difference between the post-fine-tune weights and the pre-trained weights to see how the weights change. Specifically, we get $\Delta \theta = \theta -\theta_0$ . Inspired by magnitude weight pruning (Han et al., 2015), we hypothesize that the magnitude of $\Delta \theta$ can be an indicator. We observe that the magnitude of $\Delta \theta$ is very small for most of the parameters (smaller than 1e-5 for $99\%$ parameters), indicating that the L1 regularization does take effect. However, while most of the parameters remain close to + +their initial weights during fine-tuning, a very small fraction of parameters have much greater change. We define these parameters as out weighted parameters. Intuitively, we can choose a threshold $\sigma$ to select out weighted parameters. Formally, we define $\sigma$ -bounded out weighted parameters: + +$$ +\boldsymbol {\theta} _ {\sigma} = \boldsymbol {m} _ {\sigma} \odot \boldsymbol {\theta}, \quad \boldsymbol {m} _ {\sigma} \in \{0, 1 \} ^ {| \boldsymbol {\theta} |} \tag {2} +$$ + +where $m_{\sigma}$ is a binary mask vector, $m_{\sigma ,i} = \mathbb{1}\{\left|\Delta \theta_{i}\right| > \sigma \}$ . + +We try to understand the mechanism of finetuning by analyzing the distribution of $\sigma$ -bounded out weighted parameters. We visualize the distributions of the out weighted parameters on several different tasks (MNLI, QNLI, SST-2, QQP) as seen in Figure 2, where the parameter matrices are + +$$ +W ^ {Q}, W ^ {K}, W ^ {V}, W ^ {O} \in \mathbb {R} ^ {d _ {\text {m o d e l}} \times d _ {\text {m o d e l}}} +$$ + +$$ +W ^ {F C 1} \in \mathbb {R} ^ {d _ {\text {m o d e l}} \times d _ {f c}}, W ^ {F C 2} \in \mathbb {R} ^ {d _ {f c} \times d _ {\text {m o d e l}}} \tag {3} +$$ + +For RoBERTa-large, $d_{model}$ is 1024 and $d_{fc}$ is 4096. + +Observations 1. The locations of the out weighted parameters have strong correlations among different tasks. Each column in Figure 2 shows the out weighted parameters of the same matrix on different tasks, which has a very similar phenomenon. This high similarity indicates that the location of the out weighted parameters may be downstream task-agnostic. That is to say, the PLM + +Table 1: The structure of the dominated ticket. For each matrix, we select the top 3 dominated dimensions. We highlight several "popular" dimensions across different layers with colors. Dimension 4096 in $W^{FC2}$ and 1024 in $W^K$ , $W^Q$ , $W^V$ , $W^O$ , $W^{FC1}$ are the symbol for the bias term. + +
Layer\( W^Q \)\( W^K \)\( W^V \)\( W^O \)\( W^{FC1} \)\( W^{FC2} \)
0981673304101978110867398147264776698667398110194875843291
1981673106106981673673981106593929587673106981155936461995
26739811069811066736731069811024579237673106981370830582753
36731069819811066736731069818108197846731069811591480609
4673106981981673106106673981101102476673106981344519062828
567310698167310698167310698110245791896731069816822123841
66731069816731069816731069811024430498673106981126729202686
7673106981673474106673106412692670699673106412205834851660
8673106412474673547673412474102453469673106412278023871015
9673412247467325667347441211102460867324123892448616
106734124744746732566734744122545341024673412210285921462
116732934742566236734744123307581024673474547101437302157
1267354793474256673673474547151909102467347454714524362338
136735472474256673673474547113102415167354747490225031700
146735476314742566736734745471411024307673631547121913181535
156736315476316734746736314741024523724673631547241360815
166736315476736312566316735471024657819631673547345440961288
17631673547673631256631673547254640209631673547343323962
1863167354767363125663167354798699996663167354762826174096
19631673547673631256631673399657184563167339912218274096
206316735476736312566316733999754531006631673914144240961669
21631673None673631None6316735471024975400631673914329040962850
22631NoneNoneNoneNoneNone631673547559102446631673914334131761078
23631673None631673None631673914167871891631673422249825961565
+ +itself determines which parameters tend to be out weighted. + +Observations 2. If looking into each block in Figure 2, we can see that the out weighted parameters are distributed along with the output dimension. The out weighted parameters in the matrix tend to be dominated by a few output dimensions, what we refer to as dominated dimensions. We identify dominated dimensions by counting the number of out weighted parameters in each dimension and observe that this phenomenon exists in most of the parameter matrices in the PLM. We list all the dominated dimensions of the model to further analyze. Details can be found in Table 2. An interesting finding is that some dimensions consistently dominate several successive layers. For example, dimension $673^{1}$ and 631 dominate $W^{Q}, W^{K}, W^{V}$ , and $W^{FC1}$ for more than 10 successive transformer layers. These dimensions are like the skeleton of the PLM that exists from bottom to top. + +With the above observations, now we can propose our hypothesis about the dominant winning ticket of PLMs. + +Hypothesis. There exists a dominant winning ticket inside a PLM that is intrinsically determined by the pre-trained weights. When fine-tuned in isolation, we can only finetune the parameters of this ticket which can match the performance of full + +parameter fine-tuning while converging faster than other methods. + +# 3.3 Extracting the Dominant Winning Ticket + +When it comes to extracting the dominant winning ticket, the first question is to decide the sparsity of the subnetwork (the number of trainable parameters). Generally, we extract the dominant winning ticket with algorithm 1. + +# Algorithm 1 Extracting the dominant winning ticket + +1: Fine-tune a PLM $f(x; \theta_0)$ with L1 regularization on any downstream task dataset $\mathcal{D}$ , get $f(x; \theta)$ . +2: Calculate $\Delta \theta = \theta -\theta_0$ , then select out out weighted parameters $\theta_{\sigma}$ with threshold $\sigma$ +3: Select the $k$ most dominated dimensions each matrix, which forms the dominant winning ticket. + +We use hyperparameter $k$ to control the sparsity of the subnetwork. We empirically find that the scale of the subnetwork is extremely small. $k$ equals 1 (at most one dominated dimension for each matrix) is enough to achieve comparable results to full-parameter fine-tuning for most of the tasks. + +It is worth noticing that our extracted dominant winning ticket excludes embedding and layer nor + +malization. Besides, as bias terms are vital to some extend (Zaken et al., 2021), we include bias terms when identifying the dominated dimensions, so the bias term in each matrix also has a chance to be selected. + +# 4 Testing the Dominant Winning Ticket for Fine-tuning + +The previous section is about how we identify and extract the dominant winning ticket. In this section, we discuss the properties of the dominant winning ticket by conducting systematic experiments. + +To extract the dominant winning tickets, we perform L1-regularized fine-tuning on MNLI, QNLI, SST-2, and QQP respectively. We find that the dominant winning tickets corresponding to different downstream tasks look very close to each other (detailed statistics can be found in Appendix A.1), which matches the observation in Section 3.2. So, for simplicity, we regard the subnetwork extracted from MNLI as the standard dominant winning ticket. Our evaluation experiments are conducted upon it. + +We compare the dominant winning ticket with the subnetwork that has the same size as the dominant winning ticket, denoted as Dominant-k and Random-k respectively. The dimensions of Random-k are chosen from uniform distribution. As the scale of the extracted subnetwork is adjustable by choosing different $k$ , we consider two different compression ratios, i.e., $k = 1$ (one dimension per matrix at most) and $k = 3$ (three dimension per matrix at most). + +# 4.1 Experimental Setup + +Datasets and models. We conduct experiments on the GLUE benchmark (Wang et al., 2018). The evaluation is performed on the GLUE dev sets. We use the publicly available RoBERTa-large $^2$ (Liu et al., 2019) as pre-trained language models in all our experiments. + +Implementation details. Our implementation is based on the faireq toolkit $^3$ (Ott et al., 2019). We fine-tune on the GLUE tasks following the standard procedures. We optimize using AdamW (Loshchilov and Hutter, 2018), with batch size of 16. For L1-regularized finetuning, we empirically set the weight of L1 reg + +ularizer $\lambda$ to 0.001, and the threshold $\sigma$ to 5e-5. For dominant winning ticket fine-tuning, we perform a hyperparameter search over initial learning rate in $\{5\mathrm{e} - 5,1\mathrm{e} - 4,2\mathrm{e} - 4,4\mathrm{e} - 4\}$ . For full-parameter fine-tuning, we search initial learning rate in $\{1\mathrm{e} - 5,2\mathrm{e} - 5,3\mathrm{e} - 5,5\mathrm{e} - 5\}$ . + +# 4.2 Performance + +Our main results on the GLUE benchmark are shown in Table 2. Fine-tuning the dominant winning ticket can match the performance of fine-tuning the whole model while only requiring less than $0.2\%$ trainable parameters per task. Performance of Dominant-3 and Dominant-1 has no significant difference for most of the tasks. For small datasets like MRPC and RTE, the smaller subnetwork even performs slightly better because less trainable parameters means free from overfitting. This phenomenon also indicates that the scale of the dominant winning ticket inside the PLMs can be extremely small. When comparing the dominant winning ticket with random tickets that has the same size, we can see that Random-3 performs pretty well. We think this benefits from the strong reducibility of PLMs. However, when the sparsity grows, the performance of Random-1 is much worse than Dominant-1, indicating that randomly sampled subnetworks unavoidable deletes useful information and become less expressive at such a level of sparsity. + +Figure 3 shows the training and evaluation curves of different methods. We can clearly see that the dominant winning ticket has advantages over random subnetworks in terms of convergence rate. For large datasets like QNLI, Dominant-1 and Dominant-3 reach the best validation accuracy in the first several epochs, while random subnetworks require much more training steps to warm up. The dominant winning ticket also gets lower training losses in all tasks, indicating it fits the data better. Another observation is that, though Dominant-3 and Random-3 have no significant performance gaps in most of the tasks as seen in Table 2, their learning behaviors vary quite a lot. Random-3 gets satisfactory results eventually, but it requires much more efforts to train. Meanwhile, there is no obvious difference between Dominant-1 and Dominant-3 from Figure 3, which is a good sign. This phenomenon suggests that when shrinking the parameter size from $0.19\%$ to $0.05\%$ , the capacity of the model almost keeps unchanged. + +![](images/8f9fb5d1fb8db833d67cfa11c2dfe33a151687c4d5712825e1061aa28af67e20.jpg) + +![](images/8c3ad344a5ee7df208a9a9f21620a3c150146763f266101f136ba0b26d27e806.jpg) + +![](images/fb75b7db14fb517ca7dd0498194ece18960a59bc59f7fdb41ea3de42c3b65e53.jpg) + +![](images/c8e426853f47d662e3b94a15e3e2a962707b1406ae67a88a0739266203f950f2.jpg) + +![](images/e3e39e6ec703eb6977c84aa892be3a7a6a9a3fe97be242cd0689a32d9514f3e7.jpg) + +![](images/29a266db42fdf8ca01fe44ba8f77fc86a70a83b513b8c3609d847874ef3ec991.jpg) + +![](images/da28d52dc2bb23d0d8756d4c1c1c32dd1f460dc8d935468c0d3bbaac62a165da.jpg) + +![](images/b1658090e33f31d999baf12dcd681de6846d304504ee0dd3331a088526a959f5.jpg) + +![](images/71614d9f3ee9ae45eb83d5779fb43bd973beab72576d178d6fd3594532182d25.jpg) + +![](images/24962b3a40150ca1b14c3528f2d9673d62220b10718ba0f84fc47e9c3da7954a.jpg) +Figure 3: (Left) The training loss curves. (Middle) The training accuracy curves. (Right) The validation accuracy curve. We visualize the training process for QNLI, MRPC, and RTE. For MPRC and RTE, early stopping is triggered if the validation accuracy does not increase for 8 successive epochs. + +![](images/13e32602660b77518b21f17e1b27f1648993e5c4ee6862a74f288ed117e3fd5b.jpg) + +![](images/3293771f8fdcf8c9d42013761a86d867d54cd899625d24a669cf98f04deb23d3.jpg) + +Table 2: The dominant winning ticket vs random ticket. We report the overall (matched and mismatched) accuracy for MNLI, Matthew's correlation for CoLA, Pearson correlation for STS-B, and accuracy for other tasks. All results are the average of 5 trials. + +
SparsityQNLI 105kSST-2 67kMNLI 393kCoLA 8.6kMRPC 3.7kSTS-B 5.8kRTE 2.5kQQP 364k
Full-ft100%94.796.490.46890.992.486.492.2
Random-30.19%94.196.289.868.689.491.872.291.1
Dominant-30.19%94.396.390.56990.292.286.691.7
BitFit (Zaken et al., 2021)0.06%94.59686.766.389.79286.388.9
Random-10.05%91.794.485.451.474.888.768.588.3
Dominant-10.05%94.696.190.469.790.992.287.791
+ +Table 3: Performance comparison of full-parameter fine-tuning and $5\%$ -parameter fine-tuning. + +
Params100%5%
QNLI94.794.8
SST-296.496.6
MNLI90.490.6
CoLA6869.7
MRPC90.991.7
STS-B92.492.2
RTE86.488
QQP91.991.6
+ +# 4.3 Stability of the Dominant Winning Ticket + +We expect that subnetworks extracted from different L1-regularized fine-tuning runs (with different random seeds and different tasks) have similar structures. We use Jaccard similarity to measure the similarity between different tickets. Specifically, the Jaccard similarity between two sets is defined as: + +$$ +J (A, B) = \frac {| A \cap B |}{| A \cup B |}. \tag {4} +$$ + +We test four random seeds and four tasks (MNLI, QNLI, QQP, and SST-2). The average Jaccard similarity is 0.69 across seeds and 0.67 across tasks while the similarity between random tickets is nearly 0. This means that the dominant ticket has a stable structure that utilize a certain portion of pre-trained weights. This structure is task-agnostic and irrelevant to random seeds as observed in Section 3.2. Details about the structures of subnetworks can be found in Appendix A.1. + +# 5 Discussions + +# 5.1 When BERT Plays the Lottery, Are All Tickets Winning? + +The lottery ticket hypothesis (LTH) states that dense, randomly-initialized networks contain subnetworks (winning tickets) that—when trained in + +Table 4: Dominated dimensions of $W^{O}$ and $W^{FC2}$ . Bias terms are highlighted with blue color. + +
LayerWOWFC2
06477669864875843291
1593929587155936461995
21024579237370830582753
38108197841591480609
4101102476344519062828
510245791896822123841
61024430498126729202686
7692670699205834851660
8102453469278023871015
91110246083892448616
10254534102410285921462
113307581024101437302157
12151909102414524362338
13113102415190225031700
141411024307121913181535
151024523724241360815
161024657819345440961288
17254640209343323962
1898699996662826174096
19657184512218274096
209754531006144240961669
211024975400329040962850
22559102446334131761078
23167871891249825961565
+ +isolation-reach performance comparable to the original network. + +Initialization is an important factor in LTH as the winning ticket extracted from a specific initialization generally behaviors poorly on other random reinitialized networks (Frankle and Carbin, 2018). This phenomenon is often ignored when discussing LTH in PLMs as the initialization of PLMs is deterministic. PLMs initialize via pre-training weights, which contain rich information and are potentially useful. As a result, many subnetworks inside PLMs are potential winning tickets + +Indeed, Prasanna et al. (2020) claimed that even the "bad" subnetworks in BERT ("good" and "bad") have acceptable performance. We further argue that any randomly sampled subnetwork with the sparsity of $95\%$ can serve as the winning ticket. We randomly select $5\%$ of the parameters in each + +matrix and freeze the rest of the model, surprisingly finding that the performance is comparable with full-parameter fine-tuning. As seen in Table 3, a simple random subnetwork requiring no sophisticated pruning techniques can already match with fine-tuning. + +However, we still argue that not all tickets are winning. The smaller the ticket is, the rarer the winning ticket is. When the sparsity of the subnetwork increases, the performance of subnetworks begins to vary. For RoBERTa-large, at the sparsity of $99.95\%$ , most of the "ticket" fail to win while a well-selected subnetwork (the dominant winning ticket) can suffer little performance drops. In this sense, the dominant winning ticket we found can be regarded as the smallest winning ticket. + +# 5.2 Structured Winning Ticket + +One astonishing fact about the dominant winning ticket is that it is naturally structured. When we perform L1-regularized fine-tuning, the L1 regularization is equally applied to all parameters. But weights in some dimensions tend to deviate from the pre-trained weights more than others. These dimensions, which we refer to as dominated dimensions, are shared among different layers (like the 673, 631, 474, and 106 dimensions in Table 1). It seems like there is a "skeleton" inside the PLM that can serve as the dominant winning ticket. + +The structure of the dominant winning ticket is different from other structured pruning studies in two ways. First, while their structures usually refer to certain parts of the model (e.g., channels in convolutional layers and attention heads in Transformers), the structure of the dominant winning ticket is micro within each parameter matrix. Second, while most of the structured subnetworks rely on structured pruning methods (Liang et al., 2021), we do not apply structure-aware regularization techniques. In other words, the structure of the dominant winning ticket is naturally formed, waiting to be found. + +# 5.3 Connections with Bias-terms Fine-tuning + +The dominant winning ticket has some connections with bias-terms fine-tuning (BitFit) (Zaken et al., 2021). The idea of BitFit is to fine-tune only the bias terms in the transformer, which only requires updating a very small subset of parameters. If we treat the bias term of an extended dimension of the weight matrix, then the subnetwork forms by the bias terms have a similar structure with the + +dominant winning ticket when $k$ equals one (one trainable dimension per matrix). And the trainable parameter size is close too. + +As can be seen in Table 2, BitFit is quite promising with small-to-medium training data. When the size of the training data is large, it still has acceptable performance. The overall performance of BitFit is much better than Random-1, indicating that the bias terms indeed catch some additional semantics. We find that the subnetwork of bias terms overlaps the dominant winning ticket. As shown in Table 4, the bias term serves as one of the dominated dimensions in $W^{O}$ and $W^{FC2}$ a lot. We think this might be an explanation of why only tuning the bias terms works well. + +# 6 Implications and Future Work + +The dominant winning ticket can be utilized for parameter-efficient fine-tuning. As the dominant winning ticket is stable across different tasks, when deploying PLMs on different scenarios, we only need to record the same small group of parameters. Besides, benefiting from the structure of the ticket, we only need to store the optimizer states for certain dimensions of each parameter matrix. With decent code implementation, we can promisingly reduce memory usage and speed up the training process. In future work, we would examine the memory reduction and speedup abilities of the dominant winning ticket. + +Besides the practical value, the dominant winning ticket raises some interesting questions about PLMs. Now that the dominant winning ticket is intrinsically determined by the pre-trained weights, then how does the subnetwork emerge during pretraining? Another worth investigating point lies in the natural structure of the ticket. Why certain dimensions of parameter matrices behave so differently from others? We still know little about the mechanism behind these phenomenons. We aim to study these questions in future work. + +# 7 Conclusion + +In this paper, we reveal the existence of the dominant winning ticket inside pre-trained models and introduce the L1-regularized fine-tuning to extract it. The dominant ticket is an extremely sparse subnetwork that can reach comparable performance with fine-tuning the whole model. We observe that the ticket has some novel properties. First, it is stable across different random seeds and tasks, + +which means once identified on one task, it can be transferred to other tasks with no performance loss. Second, the ticket has a natural structure within each parameter matrix, and this structure is shared across layers. Our study not only has practical values for parameter-efficient fine-tuning but also raises some questions about the pre-trained models. + +# Acknowledgments + +This work is supported in part by the National Hi-Tech RD Program of China (No.2020AAA0106600). + +# References + +Armen Aghajanyan, Luke Zettlemoyer, and Sonal Gupta. 2020. Intrinsic dimensionality explains the effectiveness of language model fine-tuning. arXiv preprint arXiv:2012.13255. +Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Zhangyang Wang, and Michael Carbin. 2020. The lottery ticket hypothesis for pre-trained bert networks. arXiv preprint arXiv:2007.12223. +Xuxi Chen, Tianlong Chen, Yu Cheng, Weizhu Chen, Zhangyang Wang, and Ahmed Hassan Awadallah. 2021. Dsee: Dually sparsity-embedded efficient tuning of pre-trained language models. arXiv preprint arXiv:2111.00160. +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. +Jonathan Frankle and Michael Carbin. 2018. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations. +Prakhar Ganesh, Yao Chen, Xin Lou, Mohammad Ali Khan, Yin Yang, Hassan Sajjad, Preslav Nakov, Deming Chen, and Marianne Winslett. 2021. Compressing large-scale transformer-based models: A case study on bert. Transactions of the Association for Computational Linguistics, 9:1061-1080. +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 NLP, pages 143-155. +Song Han, Jeff Pool, John Tran, and William Dally. 2015. Learning both weights and connections for efficient neural network. Advances in Neural Information Processing Systems, 28. + +Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-efficient transfer learning for nlp. In International Conference on Machine Learning, pages 2790-2799. PMLR. +Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, and Weizhu Chen. 2021. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685. +Olga Kovaleva, Alexey Romanov, Anna Rogers, and Anna Rumshisky. 2019. Revealing the dark secrets of bert. 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 4365-4374. +Namhoon Lee, Thalaiyasingam Ajanthan, and Philip Torr. 2018. Snip: Single-shot network pruning based on connection sensitivity. In International Conference on Learning Representations. +Jiaoda Li, Ryan Cotterell, and Mrinmaya Sachan. 2021. Differentiable subset pruning of transformer heads. arXiv preprint arXiv:2108.04657. +Chen Liang, Simiao Zuo, Minshuo Chen, Haoming Jiang, Xiaodong Liu, Pengcheng He, Tuo Zhao, and Weizhu Chen. 2021. Super tickets in pre-trained language models: From model compression to improving generalization. arXiv preprint arXiv:2105.12002. +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. +Ilya Loshchilov and Frank Hutter. 2018. Fixing weight decay regularization in adam. +Rabeeh Karimi Mahabadi, James Henderson, and Sebastian Ruder. 2021. Compacter: Efficient low-rank hypercomplex adapter layers. arXiv preprint arXiv:2106.04647. +Paul Michel, Omer Levy, and Graham Neubig. 2019. Are sixteen heads really better than one? Advances in Neural Information Processing Systems, 32:14014-14024. +Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. *fairoseq: A fast, extensible toolkit for sequence modeling*. In *Proceedings of NAACL-HLT* 2019: Demonstrations. +Sai Prasanna, Anna Rogers, and Anna Rumshisky. 2020. When bert plays the lottery, all tickets are winning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3208-3229. + +Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. 2017. Learning multiple visual domains with residual adapters. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 506-516. +Hassan Sajjad, Fahim Dalvi, Nadir Durrani, and Preslav Nakov. 2020. Poor man's bert: Smaller and faster transformer models. arXiv e-prints, pages arXiv-2004. +Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. 2019. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5797-5808. +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. +Chaoqi Wang, Guodong Zhang, and Roger Grosse. 2020. Picking winning tickets before training by preserving gradient flow. arXiv preprint arXiv:2002.07376. +Elad Ben Zaken, Shauli Ravfogel, and Yoav Goldberg. 2021. Bitfit: Simple parameter-efficient fine-tuning for transformer-based masked language-models. arXiv preprint arXiv:2106.10199. +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. + +A Appendix + +A.1 Structure Comparison of Dominant Winning Tickets + +Table 5: Structure comparison of ${W}^{Q}$ . + +
LayerMNLIQNLISSTQQP
0304673981673981101986739816739811019
1106673981106673981106673981106673981
2106673981106673981106673981106673981
3106673981106673981106673981106673981
4106673981106673981106673981106673981
5106673981106673981106673981106673981
6106673981106673981106673981106673981
7106673981106673981106412673106412673
8106412673106412673106412673106412673
9241267324126731064126732412673
10412474673241267324126732412673
1129367325476734746236732412673
129354767325476734745476732547673
1325476732547673515476732547673
1454763167325476732547673547631673
15547631673547631673547631673547631673
165476316735476316735476316732631673
17547631673547631673547631673547631673
18547631673547631673547631673547631673
19547631673256631673547631673547631673
+ +Table 6: Structure comparison of ${W}^{K}$ . + +
LayerMNLIQNLISSTQQP
0108781101967398110199378110193289811019
1106673981106673981106673981106673981
2106673981106673981106673981106673981
3106673981106673981106673981106673981
4106673981106673981106673981106673981
5106673981106673981106673981106673981
6106673981106673981106673981106673981
7106474673106673981106547673106547673
8474547673474547673474547673474547673
925647467324746732564746732474673
10256474673256474673256474673474547673
1125647462325647467324746732256474
122564746732564746732474673256474673
132564746732564746732474673256474673
14256474673256474673256474673256474673
15474631673256631673474631673474631673
16256631673256631673547631673256631673
17256631673256631673256631673256631673
18256631673256631673534631673256631673
19256631673256631673631673842631673914
+ +Table 7: Structure comparison of $W^{V}$ . + +
LayerMNLIQNLISSTQQP
047267398186739813286739818673981
1106673981106673981106673981106673981
2106673981106673981106673981106673981
3106673981106673981106673981106673981
4106673981106673981106673981106673981
5106673981106673981106673981106673981
6106673981106673981106673981106412673
7106412673106412673106412673106412673
8412474673412474673106474673412474673
9412474673412474673412474673412474673
10412474673412474673412474673412474673
114124746732474673412474673412474673
124745476732474673140474673474547673
134745476732474673474547673474547673
14474547673474547673474547673474547673
15474631673474631673474631673474631673
16547631673547631673547631673547631673
17547631673547631673547631673547631673
18547631673547631673547631673547631673
19399631673547631673631673842547631673
20399631673547631673547631673547631673
21547631673547631673547631673547631673
22547631673547631673547631673547631673
2363167391454763167354763167341631673
+ +Table 8: Structure comparison of $W^{O}$ . + +
LayerMNLIQNLISSTQQP
0647766986647725766304647725647725766
1587593929593622929586616622587593929
223757910242375796124485791024488556579
3784810819784824102458978410247848141014
47610110241042110243674947306486961024
5189579102422557910241336321024203204232
64304981024430498102443049810244305001024
767069269966569210243863994221336921024
8695341024675341024442512574674641024
91160810241160810246089531024118301024
102545341024254534102425453410242545341024
11330758102433075810243307581024330758843
121519091024739091024736691024731511024
131131511024113151102411394110241139411024
14141307102414130710241413071024141489506
155237241024523722102452364310244885231024
16657819102413218351911151910241451831024
17209254640567640657741071258719841024
1896698699963376310247638898912079861024
1916578451457165710241405657
2045397510062933634534531007102045310021024
2140097510244375199039019751024320597986
224655910243315597904835591024180195626
231678718911666088687130147101238606
+ +Table 9: Structure comparison of ${W}^{FC1}$ . + +
LayerMNLIQNLISSTQQP
06739811019106673981106673981106673981
1106673981106673981106673981106673981
2106673981106673981106673981106673981
3106673981106673981106673981106673981
4106673981106673981106673981106673981
5106673981106673981106673981106673981
6106673981106673981106412673106673981
71064126732106673106412673106412673
810641267321066731064126732412673
9241267324126734124746732412673
10241267324746734124746732412673
11474547673247467324746732474673
12474547673474547673474547673474547673
13474547673474547673474547673474547673
145476316735476316735476316732631673
155476316735476316735476316732631673
16547631673547631673547631673547631673
17547631673547631673547631673547631673
18547631673547631673547631673547631673
19399631673547631673547631673547631673
20631673914256631673547631673547631673
21631673914256631673547631673547631673
2263167391425663167354763167341631673
23422631673631673841265563631631651715
+ +Table 10: Structure comparison of ${W}^{FC2}$ . + +
LayerMNLIQNLISSTQQP
0487584329148758423904875843660458487584
1155919953646111415594060155936463912111415594060
2275330583708445305637088703636370844530563708
3480609159160911771591441591184660911771591
4190628283445139328283445177334453940190628283445
5682841212368284135821298142736246828412475
6126726862920425107222009091946302742526862920
716602058348516602058348531716602058166020583485
81015238727801832278029982171247298293323872780
94486163892341692389234191038923419663892
1059210281462592102840965921028206359210284096
11101421573730101428773730101428773730101428773730
1214523382436145243627541451534233814523382436
1390217002503902103425039021700250390210342503
1412191318153512191535278715352963372086615353443
1515608241315642413151997241360824133212
16128834544096100928273454263928273454153128274096
1723433396270389532356992834347570310702588
18628261740961429309140968343130391348429824096
1982712214096879240934383412074096255633334096
20144216694096129921773491144233294096188025273894
21285032904096491591116269832904096142631233290
221078317633418716693798236524044096144425763745
23156524982596169525443289607201021422677042084
\ No newline at end of file diff --git a/findingthedominantwinningticketinpretrainedlanguagemodels/images.zip b/findingthedominantwinningticketinpretrainedlanguagemodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..389fe1a8b0ad3347617a8432607c549aa28189a6 --- /dev/null +++ b/findingthedominantwinningticketinpretrainedlanguagemodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29c01787f3ef7fd343b1efe8bd0d260491e64b5bb3b7b5aab2b2ba4947e34bef +size 1398416 diff --git a/findingthedominantwinningticketinpretrainedlanguagemodels/layout.json b/findingthedominantwinningticketinpretrainedlanguagemodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..691819f9bd058fc84d3e3e943de271c818af540c --- /dev/null +++ b/findingthedominantwinningticketinpretrainedlanguagemodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3465f31ef4f10e23fb84750855256a03da62706939fcd0e69e2036ee5cf4f02a +size 375444 diff --git a/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_content_list.json b/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..37c6a9b82f36844a72c59ffe2f10e8ef40eb80b8 --- /dev/null +++ b/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2890f50d153ac89b4922a927ed8f03deb873ff7bd8041608393f4c8cac188533 +size 72345 diff --git a/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_model.json b/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8ce0be30fecc994a4e9554c191b20f64a803b347 --- /dev/null +++ b/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bfb5b18b26b5a433d5026750ff6b2aeeaedf2c2e73f6987079247c6d623cdf5 +size 88477 diff --git a/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_origin.pdf b/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..352e3f01d52b3c4ffed72eadad8cbbcd140d1ead --- /dev/null +++ b/firsttheworstfindingbettergendertranslationsduringbeamsearch/904cec98-9d58-4303-971f-3326e80a1550_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb8aaf7672ca730f18c2688ddb6bd29e6449deda0cb6a64640a980b4c0cbf5f2 +size 416247 diff --git a/firsttheworstfindingbettergendertranslationsduringbeamsearch/full.md b/firsttheworstfindingbettergendertranslationsduringbeamsearch/full.md new file mode 100644 index 0000000000000000000000000000000000000000..66cb2d72bedeed51743a8edc0bb8dd1afbecaed6 --- /dev/null +++ b/firsttheworstfindingbettergendertranslationsduringbeamsearch/full.md @@ -0,0 +1,308 @@ +# First the Worst: Finding Better Gender Translations During Beam Search + +Danielle Saunders* and Rosie Sallis and Bill Byrne + +Department of Engineering, University of Cambridge, UK + +{ds636, rs965}@cantab.ac.uk, wjb31@cam.ac.uk + +# Abstract + +Generating machine translations via beam search seeks the most likely output under a model. However, beam search has been shown to amplify demographic biases exhibited by a model. We aim to address this, focusing on gender bias resulting from systematic errors in grammatical gender translation. Almost all prior work on this problem adjusts the training data or the model itself. By contrast, our approach changes only the inference procedure. + +We constrain beam search to improve gender diversity in n-best lists, and rerank n-best lists using gender features obtained from the source sentence. Combining these strongly improves WinoMT gender translation accuracy for three language pairs without additional bilingual data or retraining. We also demonstrate our approach's utility for consistently gendering named entities, and its flexibility to handle new gendered language beyond the binary. + +# 1 Introduction + +Neural language generation models optimized by likelihood have a tendency towards 'safe' word choice. This lack of output diversity has been noted in NMT (Vanmassenhove et al., 2019) and throughout NLP (Li et al., 2016; Sultan et al., 2020). Model-generated language may be repetitive or stilted. More insidiously, generating the most likely output based only on corpus statistics can amplify any existing biases in the corpus (Zhao et al., 2017). + +Potential harms arise when biases around word choice or grammatical gender inflections reflect demographic or social biases (Sun et al., 2019). The resulting gender mistranslations could involve implicit misgendering of a user or other referent, or perpetuation of social stereotypes about the 'typical' gender of a referent in a given context. + +Past approaches to the problem almost exclusively involve retraining (Vanmassenhove et al., + +2018; Escudé Font and Costa-jussa, 2019; Stefanovičs et al., 2020) or tuning (Saunders and Byrne, 2020; Basta et al., 2020) on gender-adjusted data. Such approaches are often computationally expensive and risk introducing new biases (Shah et al., 2020). Instead, we seek to improve translations from existing models. Roberts et al. (2020) highlight beam search's tendency to amplify gender bias and Renduchintala et al. (2021) show that very shallow beams degrade gender translation accuracy; we instead guide beam search towards better gender translations further down the n-best list. + +Our contributions are as follows: we rerank NMT n-best lists, demonstrating that we can extract better gender translations from the original model's beam. We also generate new n-best lists subject to gendered inflection constraints, and show this makes correctly gendered entities more common in n-best lists. We make no changes to the NMT model or training data, and require only monolingual resources for the source and target languages. + +# 1.1 Related work + +Prior work mitigating gender bias in NLP often involves adjusting training data, directly (Zhao et al., 2018) or via embeddings (Bolukbasi et al., 2016). Our inference-only approach is closer to work on controlling or 'correcting' gendered output. + +Controlling gender translation generally involves introducing external information into the model. Miculicich Werlen and Popescu-Belis (2017) integrate cross-sentence coreference links into reranking to improve pronoun translation. Vanmassenhove et al. (2018) and Moryossef et al. (2019) incorporate sentence-level gender features into training data and during inference respectively. Token-level source gender tags are used by Stefanovičs et al. (2020) and Saunders et al. (2020). As in this prior work, our focus is applying linguistic gender-consistency information, rather than obtaining it. + +A separate line of work treats gender-related + +inconsistencies as a search and correction problem. Roberts et al. (2020) find that beam search amplifies gender bias compared to sampling search. Saunders and Byrne (2020) rescore translations with a model fine-tuned for additional gender sensitivity, constraining outputs to gendered-reinflections of the original. Related approaches for monolingual tasks reinfect whole-sentence gender (Habash et al., 2019; Alhafni et al., 2020; Sun et al., 2021). An important difference in our work is use of the same model for initial translation and reinfection, reducing computation and complexity. + +# 2 Finding consistent gender in the beam + +There are two elements to our proposed approach. First, we produce an $n$ -best list of translations using our single model per language pair. We use either standard beam search or a two-pass approach where the second pass searches for differently-gendered versions of the highest likelihood initial translation. We then select a translation from the list, either by log likelihood or by how far the target language gender features correspond to the source sentence. + +# 2.1 Gender-constrained n-best lists + +![](images/6b963483d262268d0cd27a33808d89e122205fbbe4976dcdabe229218ed34773.jpg) +Figure 1: Constraints for a toy initial hypothesis. + +We produce n-best lists in two ways. One option is standard beam search. Alternatively, we synthesize n-best lists using the gendered constraint scheme of Saunders and Byrne (2020), illustrated in Figure 1. This involves a second gender-constrained beam search pass to reinfect an initial hypothesis, producing a synthesized n-best list containing gendered alternatives of that hypothesis. + +The second reinflation pass uses a target language gender inflection transducer which defines grammatically gendered reinfections. For example, Spanish definite article el could be unchanged or reinflected to la, and profession noun medico could be reinflected to medica (and vice versa). Composing the reinfections with the original hypothesis generates a constrained hypothesis lattice. + +We can now perform constrained beam search, which can encourage NMT to output specific vocabulary (Stahlberg et al., 2016; Khayrallah et al., 2017). The only difference from standard beam search is that gender-constrained search only expands translations forming paths in the constrained hypothesis lattice. In the Figure 1 example, beam $n$ search would produce the $n$ most likely translations, while the gender-constrained pass would only produce the 4 translations in the lattice. + +Importantly, for each language pair we use just one NMT model to produce gendered variations of its own hypotheses. Unlike Saunders and Byrne (2020) we do not reinfect translations with a separate gender-sensitive model. This removes the complexity, potential bias amplification and computational load of developing the gender-translation-specific models central to their approach. + +While we perform two full inference passes to simplify implementation, further efficiency improvements are possible. For example, the source sentence encoding could be reused for the reinfection pass. In principle, some beam search constraints could be applied in the first inference pass, negating the need for two passes. These potential efficiency gains would not be possible if using a separate NMT model to reinfect the translations. + +# 2.2 Reranking gendered translations + +# Algorithm 1 Gender-eranking an n-best list + +Input: $x$ : Source sentence; $Y$ : set of translation hypotheses for $x$ ; $L$ : Log likelihoods for all $y \in Y$ ; $A$ : word alignments between $x$ and all $y$ + +$p, p_{g} \gets$ pronoun_and_gender(x) $\triangleright$ Or oracle + +$e\gets$ get_entity $(x,p)$ Or oracle + +for all $y\in Y$ do + +$y_{score}\gets 0$ + +for all $t\in A_y(e)$ do Translated entity + +$t_g\gets$ get_gender(t) + +if $t_g = p_g$ then + +$$ +y _ {s c o r e} + = 1 +$$ + +end if + +end for + +end for + +$$ +\hat {Y} = \left\{\operatorname {a r g m a x} _ {y} \left(y _ {\text {s c o r e}}, y \in Y\right) \right\} +$$ + +$$ +\hat {y} = \operatorname {a r g m a x} _ {y} (L (y), y \in \hat {Y}) +$$ + +$$ +\mathrm {r e t u r n} \hat {y} +$$ + +We select an output translation from an n-best list in two ways, regardless of whether the list + +![](images/05b5917894dbe81d3e0eda1d2e0079666e5ea687ecef588bfb63189c2e7c8747.jpg) +Figure 2: Complete workflow for a toy en-es example. We have two options for producing an n-best list - standard or gender-constrained search - and can then either take the highest likelihood output from the list, or rerank it. + +was produced by beam search or the two-pass approach. One option selects the highest-likelihood translation under the NMT model. Alternatively, we rerank for gender consistency with the source sentence. We focus on either oracle or inferred entities coreferent with a source pronoun. + +The oracle case occurs in several scenarios. Oracle entity labels could be provided as for the WinoMT challenge set (Stanovsky et al., 2019). They could also be user-defined for known entities (Vanmassenhove et al., 2018), or if translating the same sentence with different entity genders to produce multiple outputs (Moryossef et al., 2019). + +The inferred case determines entities automatically given a source pronoun1 and its grammatical gender. We find coreferent entities using a target language coreference resolution tool in get_entity. For brevity Algorithm 1 is written for one entity per sentence: in practice there is no such limit. + +For each entity we find the aligned translated entity, similar to Stefanovičs et al. (2020). We determine the translated entity's grammatical gender by target language morphological analysis in get_gender. Finally we rerank, first by source gender agreement, tie-breaking with log likelihood2. + +# 3 Experimental setup + +We translate English into German, Spanish and Hebrew using Transformers (Vaswani et al., 2017). We train the en-de model on WMT19 newtask data including filtered Paracrawl (Barrault et al., 2019), en-es on UNCorpus data (Ziemski et al., 2016), and en-he on the IWSLT corpus (Cettolo et al., 2014). For further training details see Appendix A. + +Some proposed steps require tools or resources: + +1) For gender-constrained search, creating gender inflection transducers; 2) For inferred-eranking, finding source gendered entities 3) For all reranking, finding translated gendered entities; 4) For all reranking, getting translated entity genders. + +For 1) we use Spacy (Honnibal and Montani, 2017) and DEMorphy (Altinok, 2018) morphological analysis for Spanish and German, and fixed rules for Hebrew, on large vocabulary lists to produce gender transducers, following Saunders and Byrne $(2020)^{3}$ . The highest likelihood outputs from beam-4 search form the original hypothesis lattices. For 2) we use a RoBERTa model (Liu et al., 2019) tuned for coreference on Winograd challenge data. For 3) we use fast_align (Dyer et al., 2013). For 4) we use the same morphological analysis as in 1, now on translated entities. + +We evaluate gender translation on WinoMT (Stanovsky et al., 2019) via accuracy and $\Delta G$ (F1 score difference between masculine and feminine labelled sentences, closer to 0 is better). As WinoMT lacks references we assess cased BLEU on WMT18 (en-de), WMT13 (en-es) and IWSLT14 (en-he) using SacreBLEU (Post, 2018). + +# 4 Results and discussion + +# 4.1 Oracle entities + +We first describe oracle-eranking n-best lists in Table 1, before proceeding to the more general scenario of inferred-eranking. Comparing lines 1 vs 2, gender-constrained beam-4 search taking the highest likelihood output scores similarly to standard beam-4 search for all metrics and language pairs. For beam-20 (5 vs 6) en-de and en-es, constraints + +
BeamGender constrainOracle reranken-deen-esen-he
BLEUAccΔGBLEUAccΔGBLEUAccΔG
4××42.760.118.627.547.838.423.847.521.1
×42.759.120.127.848.336.223.847.421.5
×-66.510.1-53.925.9-52.016.8
-77.9-0.6-55.722.3-54.513.7
20××42.359.020.127.346.440.724.046.822.5
×42.759.020.327.848.336.223.847.321.7
×-74.32.4-63.511.0-59.311.2
-84.2-3.6-66.38.1-65.34.9
+ +Table 1: Accuracy (%) and masculine/feminine F1 difference $\Delta \mathrm{G}$ ,oracle-eranking WinoMT. BLEU scores are for en-de WMT18,en-es WMT13,and en-he IWSLT14,which lack gender labels so cannot be oracle-eranked. + +
BeamGender constrainInferred reranken-deen-esen-he
BLEUAccΔGBLEUAccΔGBLEUAccΔG
1×42.765.910.727.552.628.123.851.317.0
242.776.40.527.853.924.623.853.614.4
3×42.272.93.327.360.215.324.057.811.9
442.681.8-2.627.863.510.923.862.86.2
+ +do mitigate the BLEU degradation common with larger beams (Stahlberg and Byrne, 2019). + +In lines 1 vs 3, 5 vs 7, we oracle-erank beam search outputs instead of choosing by highest likelihood. We see about $10\%$ accuracy improvement relative to non-eranked beam-4 across languages, and over $25\%$ relative improvement for beam-20. Combining oracle-eranking and constraints further boosts accuracy. This suggests constraints encourage presence of better gender translations in n-best lists, but that reranking is needed to extract them. + +Using beam-20 significantly improves the performance of reranking. With constraints, beam-20 oracle-eranking gives absolute accuracy gains of about $20\%$ over the highest likelihood beam search output. However, beam-4 shows most of the improvement over that baseline. We find diminishing returns as beam size increases (Appendix B), suggesting large, expensive beams are not necessary. + +# 4.2 Inferred entities + +We have shown accuracy improvements with oracle reranking, indicating that the synthesized n-best lists often contain a gender-accurate hypothesis. In Table 2, we explore inferred-eranking using a RoBERTa model, investigating whether that hypothesis can be found automatically. We find very little degradation in WinoMT accuracy when inferring entities compared to the oracle (Table 1). We hypothesise that difficult sentences are hard for both coreference resolution and NMT, so cases where RoBERTa disambiguates wrongly are also + +Table 2: Accuracy (%) and masculine/feminine F1 difference $\Delta \mathrm{G}$ . Inferred-eranking with genders and entities for WinoMT and generic test sets determined by a RoBERTa model. Non-eranked results unchanged from Table 1. + +
BeamSystemen-deen-esen-he
4S&B79.462.253.1
S&B + rerank81.968.956.6
20S&B79.662.152.8
S&B + rerank83.673.962.9
+ +Table 3: WinoMT accuracy inferred-eranking the adaptation scheme of Saunders and Byrne (2020). + +mistranslated with oracle information. + +We are unable to oracle-erank the generic test sets, since they have no oracle gender labels. However, we can tag them using RoBERTA for inferred-eranking. In Table 2 we find this has little or no impact on BLEU score, unsurprising for sets not designed to highlight potentially subtle gender translation effects. This suggests positively that our scheme does not impact general translation quality. + +So far we have not changed the NMT model at all. In Table 3, for comparison, we investigate the approach of Saunders and Byrne (2020): tuning a model on a dataset of gendered profession sentences, then constrained-rescoring the original model's hypotheses. We do indeed see strong gender accuracy improvements with this approach, but inferred-eranking the resulting models' n-best lists further improves scores. We also note that inferred reranking the baseline with beam size 20 (Table 2 line 4) outperforms non-eranked S&B, without requiring specialized profession-domain tuning data or any change to the model. + +
Vallejo appears to have only narrowly edged out Calderon, who had led polls before election day
-12.3Vallejo scheint nur knapp ausgewgrenzt Calderon, der vor dem Wahtlag Wahlen geführt hatte.
-14.6* Vallejo scheint nur knapp ausgewgrenzt Calderon, die vor dem Wahtlag Wahlen geführt hatte.
-24.3Vallejo scheint nur knapp ausgewgrenzt Calderon, der vor dem Wahtlag Wahlern geführt hatte.
-26.5Vallejo scheint nur knapp ausgewgrenzt Calderon, die vor dem Wahtlag Wahlern geführt hatte.
+ +Table 4: Sentence from WMT newstest12 with gender-constrained n-best list and NLL scores. Words like 'who' coreferent with 'Calderon' become entities for Algorithm 1, which finds a better gendered translation $(\ast)$ . + +# 4.3 Reranking with named entities + +At time of writing, published gender translation test sets focus on profession nouns, a domain we evaluate with WinoMT. However, our approach can also improve other aspects of gender translation. One of these is consistently gendering named entities. Sentences may contain gendered terminology with no pronouns, only named entities. Generic name-gender mappings are unreliable: many names are not gendered, and a name with a 'typical' gender may not correspond to an individual's gender. However, we may know the appropriate gendered terms to use for a specific named entity, for example from other sentences, a knowledge base, or user preference. With this information we can gender-erank. + +An example is given in Table 4. The English sentence contains no gendered pronoun, so is not covered by our default reranking algorithm. We know from previous sentences that Calderon should be referred to with the linguistic feminine, so we can rerank with known $p_g$ . The 'entities' $e$ are the words referring to Calderon, including 'who', 'had' and 'led'.6 Algorithm 1 proceeds over these entities, of which only 'who' is gendered in German, to extract a better gendered translation. + +# 4.4 Reranking with new gendered language + +Another benefit of our approach is flexibility to introducing new gendered vocabulary, e.g. as used by non-binary people. Developing a system to correctly produce new terms like neopronouns is itself an open research problem (Saunders et al., 2020). However, we can simulate such a system by editing existing WinoMT translations to contain gendered-term placeholders instead of binary gendered terms, and shuffling these translations into n-best lists. For example, where a German translation includes der Mitarbeiter, the employee (masculine), we substitute DEFNOM MitarbeiterNEND. This allows later replacement of DEFNOM by e.g. dier or NEND by in (Heger, 2020), but remains flexible to prefer + +ences for new gendered language. We then define the new patterns for identification by the reranker. + +To evaluate reranking with new gendered language, we use 1826 neutral WinoMT sentences with them pronouns on the English side. We initialise the corresponding n-best lists with the masculine WinoMT German 20-best lists, and shuffle one 'placeholder' translation into each, giving them the average log likelihood of the whole list. We find that the reranker successfully extracts the correct placeholder-style sentences in $92\%$ of cases. This demonstrates that if a system can generate some new gendered term, reranking can extract it from an n-best list with minimal adjustments. + +# 5 Conclusions + +This paper attempts to improve gender translation without a single change to the NMT model. We demonstrate that gender-constraining the target language during inference can encourage models to produce n-best lists with correct hypotheses. Moreover, we show that simple reranking heuristics can extract more accurate gender translations from the n-best lists using oracle or inferred information. + +Unlike other approaches to this problem we do not attempt to counter unidentified and potentially intractable sources of bias in the training data, or produce new models. However, our approach does significantly boost the accuracy of a prior data-centric bias mitigation technique. In general we view our scheme as orthogonal to such approaches: if a model ranks diverse gender translations higher in the beam initially, finding better gender translations during beam search becomes simpler. + +# Acknowledgments + +This work was supported by EPSRC grants EP/M508007/1 and EP/N509620/1 and performed using resources from the Cambridge Tier-2 system operated by the University of Cambridge Research Computing Service7 funded by EPSRC Tier-2 capital grant EP/P020259/1. + +# Impact statement + +Where machine translation is used in people's lives, mistranslations have the potential to misrepresent people. This is the case when personal characteristics like social gender conflict with model biases towards certain forms of grammatical gender. As mentioned in the introduction, the result can involve implicit misgendering of a user or other human referent, or perpetuation of social biases about gender roles as represented in the translation. A user whose words are translated with gender defaults that imply they hold such biased views will also be misrepresented. + +We attempt to avoid these failure modes by identifying translations which are at least consistent within the translation and consistent with the source sentence. This is dependent on identifying grammatically gendered terms in the target language - however, this element is very flexible and can be updated for new gendered terminology. We note that models which do not account for variety in gender expression such as neopronoun use may not be capable of generating appropriate gender translations. However, we demonstrate that, if definable, a variety of gender translations can be extracted from the beam. + +By avoiding the data augmentation, tuning and retraining elements in previously proposed approaches to gender translation, we simplify the process and remove additional stages where bias could be introduced or amplified (Shah et al., 2020). + +In terms of compute time and power, we minimize impact by using a single GPU only for training the initial NMT models exactly once for the iterations listed in Appendix A. All other experiments involve inference or rescoring the outputs of those models and run in parallel on CPUs in under an hour, except the experiments following Saunders and Byrne (2020), an approach itself involving only minutes of GPU fine-tuning. + +# References + +Bashar Alhafni, Nizar Habash, and Houda Bouamor. 2020. Gender-aware reinflection using linguistically enhanced neural models. In Proceedings of the Second Workshop on Gender Bias in Natural Language Processing, pages 139-150, Barcelona, Spain (Online). Association for Computational Linguistics. +Duygu Altinok. 2018. DEMorphy, German language morphological analyzer. arXiv preprint arXiv:1803.00902. + +Loic Barrault, Ondrej Bojar, Marta R. Costa-jussa, Christian Federmann, Mark Fishel, Yvette Graham, Barry Haddow, Matthias Huck, Philipp Koehn, Shervin Malmasi, Christof Monz, Mathias Muller, Santanu Pal, Matt Post, and Marcos Zampieri. 2019. Findings of the 2019 conference on machine translation (WMT19). In Proceedings of the Fourth Conference on Machine Translation (Volume 2: Shared Task Papers, Day 1), pages 1-61, Florence, Italy. Association for Computational Linguistics. +Christine Basta, Marta R. Costa-jussà, and José A. R. Fonollosa. 2020. Towards mitigating gender bias in a decoder-based neural machine translation model by adding contextual information. In Proceedings of the The Fourth Widening Natural Language Processing Workshop, pages 99-102, Seattle, USA. Association for Computational Linguistics. +Tolga Bolukbasi, Kai-Wei Chang, James Y Zou, Venkatesh Saligram, and Adam T Kalai. 2016. Man is to computer programmer as woman is to homemaker? Debiasing word embeddings. In Advances in neural information processing systems, pages 4349-4357. +Mauro Cettolo, Jan Niehues, Sebastian Stüker, Luisa Bentivogli, and Marcello Federico. 2014. Report on the 11th IWSLT evaluation campaign, IWSLT 2014. In Proceedings of the International Workshop on Spoken Language Translation, Hanoi, Vietnam, page 57. +Chris Dyer, Victor Chahuneau, and Noah A. Smith. 2013. A simple, fast, and effective reparameterization of IBM model 2. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 644-648, Atlanta, Georgia. Association for Computational Linguistics. +Joel Escudé Font and Marta R. Costa-jussa. 2019. Equalizing gender bias in neural machine translation with word embeddings techniques. In Proceedings of the First Workshop on Gender Bias in Natural Language Processing, pages 147-154, Florence, Italy. Association for Computational Linguistics. +Nizar Habash, Houda Bouamor, and Christine Chung. 2019. Automatic gender identification and reinflection in Arabic. In Proceedings of the First Workshop on Gender Bias in Natural Language Processing, pages 155-165, Florence, Italy. Association for Computational Linguistics. +Illi Anna Heger. 2020. Version 3.3: xier pronomen ohne geschlecht. (accessed: Mar 2022). +Matthew Honnibal and Ines Montani. 2017. spaCy 2: Natural language understanding with bloom embeddings. Convolutional Neural Networks and Incremental Parsing. +Marcin Junczys-Dowmunt, Tomasz Dwojak, and Hieu Hoang. 2016. Is neural machine translation ready + +for deployment? a case study on 30 translation directions. In Proceedings of the International Workshop on Spoken Language Translation 2016, volume 1. 13th International Workshop on Spoken Language Translation 2016, IWSLT 2016. +Huda Khayrallah, Gaurav Kumar, Kevin Duh, Matt Post, and Philipp Koehn. 2017. Neural lattice search for domain adaptation in machine translation. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 20-25, Taipei, Taiwan. Asian Federation of Natural Language Processing. +Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondrej Bojar, Alexandra Constantin, and Evan Herbst. 2007. Moses: Open source toolkit for statistical machine translation. In Proceedings of the 45th Annual Meeting of the Association for Computational Linguistics Companion Volume Proceedings of the Demo and Poster Sessions, pages 177-180, Prague, Czech Republic. Association for Computational Linguistics. +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016. A diversity-promoting objective function for neural conversation models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 110-119, San Diego, California. Association for Computational Linguistics. +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. +Lesly Miculicich Werlen and Andrei Popescu-Belis. 2017. Using coreference links to improve Spanish-to-English machine translation. In Proceedings of the 2nd Workshop on Coreference Resolution Beyond OntoNotes (CORBON 2017), pages 30–40, Valencia, Spain. Association for Computational Linguistics. +Amit Moryossef, Roee Aharoni, and Yoav Goldberg. 2019. Filling gender & number gaps in neural machine translation with black-box context injection. In Proceedings of the First Workshop on Gender Bias in Natural Language Processing, pages 49-54, Florence, Italy. Association for Computational Linguistics. +Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186-191, Belgium, Brussels. Association for Computational Linguistics. +Adithya Renduchintala, Denise Diaz, Kenneth Heafield, Xian Li, and Mona Diab. 2021. Gender bias amplification during speed-quality optimization in neural + +machine translation. 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 99-109, Online. Association for Computational Linguistics. +Nicholas Roberts, Davis Liang, Graham Neubig, and Zachary C Lipton. 2020. Decoding and diversity in machine translation. arXiv preprint arXiv:2011.13477. +Danielle Saunders and Bill Byrne. 2020. Reducing gender bias in neural machine translation as a domain adaptation problem. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7724-7736, Online. Association for Computational Linguistics. +Danielle Saunders, Rosie Sallis, and Bill Byrne. 2020. Neural machine translation doesn't translate gender coreference right unless you make it. In Proceedings of the Second Workshop on Gender Bias in Natural Language Processing, pages 35-43, Barcelona, Spain (Online). Association for Computational Linguistics. +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. +Deven Santosh Shah, H. Andrew Schwartz, and Dirk Hovy. 2020. Predictive biases in natural language processing models: A conceptual framework and overview. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5248-5264, Online. Association for Computational Linguistics. +Artūrs Stefanovičs, Toms Bergmanis, and Mārcis Pinnis. 2020. Mitigating gender bias in machine translation with target gender annotations. In Proceedings of the Fifth Conference on Machine Translation (WMT). +Felix Stahlberg and Bill Byrne. 2019. On NMT search errors and model errors: Cat got your tongue? 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 3356-3362, Hong Kong, China. Association for Computational Linguistics. +Felix Stahlberg, Eva Hasler, Aurelien Waite, and Bill Byrne. 2016. Syntactically guided neural machine translation. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 299-305, Berlin, Germany. Association for Computational Linguistics. + +Gabriel Stanovsky, Noah A. Smith, and Luke Zettlemoyer. 2019. Evaluating gender bias in machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1679-1684, Florence, Italy. Association for Computational Linguistics. +Md Arafat Sultan, Shubham Chandel, Ramón Fernández Astudillo, and Vittorio Castelli. 2020. On the importance of diversity in question generation for QA. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5651-5656, Online. Association for Computational Linguistics. +Tony Sun, Andrew Gaut, Shirlyn Tang, Yuxin Huang, Mai ElSherief, Jieyu Zhao, Diba Mirza, Elizabeth Belding, Kai-Wei Chang, and William Yang Wang. 2019. Mitigating gender bias in natural language processing: Literature review. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1630–1640, Florence, Italy. Association for Computational Linguistics. +Tony Sun, Kellie Webster, Apu Shah, William Yang Wang, and Melvin Johnson. 2021. They, them, theirs: Rewriting with gender-neutral english. arXiv preprint arXiv:2102.06788. +Eva Vanmassenhove, Christian Hardmeier, and Andy Way. 2018. Getting gender right in neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3003-3008, Brussels, Belgium. Association for Computational Linguistics. +Eva Vanmassenhove, Dimitar Shterionov, and Andy Way. 2019. Lost in translation: Loss and decay of linguistic richness in machine translation. In Proceedings of Machine Translation Summit XVII Volume 1: Research Track, pages 222-232, Dublin, Ireland. European Association for Machine Translation. +Ashish Vaswani, Samy Bengio, Eugene Brevdo, Francois Chollet, Aidan Gomez, Stephan Gouws, Llion Jones, Lukasz Kaiser, Nal Kalchbrenner, Niki Parmar, Ryan Sepassi, Noam Shazeer, and Jakob Uszkoreit. 2018. Tensor2Tensor for neural machine translation. In Proceedings of the 13th Conference of the Association for Machine Translation in the Americas (Volume 1: Research Papers), pages 193-199, Boston, MA. Association for Machine Translation in the Americas. +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 6000-6010. +Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. 2017. Men also like shopping: Reducing gender bias amplification using corpus-level constraints. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2979–2989, Copenhagen, + +Denmark. Association for Computational Linguistics. +Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. 2018. Gender bias in coreference resolution: Evaluation and debiasing methods. 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 15–20, New Orleans, Louisiana. Association for Computational Linguistics. +Michal Ziemski, Marcin Junczys-Dowmunt, and Bruno Pouliquen. 2016. The united nations parallel corpus v1.0. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC 2016), pages 3530-3534, Portož, Slovenia. European Language Resources Association (ELRA). + +# A Model training details + +All NMT models are 6-layer Transformers with 30K BPE vocabularies (Sennrich et al., 2016), trained using Tensor2Tensor with batch size 4K (Vaswani et al., 2018). All data except Hebrew is truecased and tokenized using (Koehn et al., 2007). The en-de model is trained for 300K batches, enes for 150K batches, and en-he for 15K batches, transfer learning from the en-de model. We filter subworded data for max (80) and min (3) length, and length ratio 3. We evaluate cased BLEU on WMT18 (en-de, 3K sentences), WMT13 (en-es, 3K sentences) and IWSLT14 (en-he, 962 sentences). For validation during NMT model training we use earlier test sets from the same tasks. + +# B Beam size for constrained reranking + +In this paper we present results with beam sizes 4 and 20. Beam-4 search is commonly used and meets a speed-quality trade-off for NMT (see e.g. Junczys-Dowmunt et al. (2016)). Beam-20 is still practical, but approaches diminishing returns for quality without search error mitigation (Stahlberg and Byrne, 2019). These sizes therefore illustrate contrasting levels of practical reranking. However, it is instructive to explore what beam size is necessary to benefit from gender-constrained reranking. + +In Figure 3 we report WinoMT accuracy under gender-constrained oracle reranking with beam width increasing by intervals of 4. For all systems, the largest jump in improvement is between beam sizes 4 and 8, with diminishing returns after beam-12. The en-de curve is relatively shallow, possibly due to strong scores before reranking, or even a performance ceiling determined by the WinoMT framework itself. Curves for en-he and en-es are very close, suggesting a similarity between the gender distribution in the n-best lists for those models. + +# C Constrained vs unconstrained beams + +We can observe the difference between standard and constrained beam search by examining the n-best lists. Table 5 (next page) gives 5 examples of 4-best lists for WinoMT sentences translated into German. Examples are not cherry-picked but selected from throughout WinoMT with a random number generator. Lists are ordered by NMT model likelihood and produced with standard unconstrained beam search, and with constrained beam search. + +With standard beam search, translations vary words unrelated to the entities, such as synonyms + +![](images/2273c900df825a47b65767179cf310753dbdb27869e06685e5e596b28c92ea17.jpg) +Figure 3: WinoMT accuracy after oracle-eranking gender-constrained n-best lists, varying n. + +or verb tenses. However, entity grammatical genders are generally unchanged throughout the unconstrained n-best lists, except for 1 where the secondary entity changes. Reranking cannot always find a gender-consistent translation in the unconstrained lists, defaulting to the 1best for all except 2 (which seems to have a poorly aligned hypothesis). + +By contrast, constrained beam search ensures the n-best list contains gendered inflections of the initial best-scoring translation. The changes vary the grammatical genders of articles and entities, resulting in more gender-diverse hypotheses, and allowing reranking to find a better translation for 1. + +We note that in 3, 4 and 5 both the pronoun and the default gender convention for unknown gender entities are masculine. Reranking is not strictly necessary to find a better translation for these sentences, since the highest likelihood output is gender-consistent. However, we note that some outputs with gender constraints do in fact vary the gender of the secondary entity – the entity with unspecified gender. This illustrates our approach's ability to improve n-best list diversity even when it does not necessarily impact translation consistency. + +We observe occasional grammatical inconsistencies in n-best hypotheses (e.g. "die Fahrer" in 3). When constraining beam search to grammatical variations of a sentence with an imperfect NMT model, we expect some hypotheses with grammatical degradation. However, our priority, and the purpose of our reranking scheme, is consistency with the source in the output translation, not inconsistencies elsewhere in the n-best list. + +
1. The broker called the client because she had new stocks to recommend.
Unconstrained* Der Makler rief den Kunden an, weil sie neue Aktien zu empfehlen hatte. +Der Makler rief die Klient in, weil sie neue Aktien zu empfehlen hatte. +Der Makler rief den Kunden an, weil sie neue Aktien zu empfehlen hatte. +Der Makler rief den Kunden an, weil er neue Aktien zu empfehlen hatte.
ConstrainedDer Makler rief den Kunden an, weil sie neue Aktien zu empfehlen hatte. +Der Makler rief den Kunden an, weil er neue Aktien zu empfehlen hatte. +* Die Maklerin rief den Kunden an, weil sie neue Aktien zu empfehlen hatte. +Der Makler rief die Kunden an, weil sie neue Aktien zu empfehlen hatte.
2. The teacher explained the situation to the chief and felt understood by her.
UnconstrainedDie Lehrerin erkläre die Situation dem Chef und führte sich von ihr verstanden. +* Die Lehrerin erkläre dem Obersten die Situation und führte sich von ihr verstanden. +Die Lehrerin erkläre die Situation dem Obersten und führte sich von ihr verstanden. +Die Lehrerin erlauterte die Situation dem Obersten und führte sich von ihr verstanden.
Constrained*Die Lehrerin erkläre die Situation dem Chef und führte sich von ihr verstanden. +Der Lehrer erkläre die Situation dem Chef und führte sich von ihr verstanden. +Der Lehrer erkläre die Situation dem Chef und führte sich von ihm verstanden. +Die Lehrerin erkläre die Situation dem Chef und führte sich von ihm verstanden.
3. The assistant hired the driver as he offered an excellent service.
Unconstrained* Der Assistant stellte den Fahrer ein, da er einen ausgezeichneten Service bot. +Der Assistant stellte den Fahrer ein, da er einen exzellenten Service bot. +Der Assistant stellte den Fahrer ein, da er einen hervorragenden Service bot. +Der Assistant stellte den Fahrer ein, als er einen ausgezeichneten Service bot.
Constrained* Der Assistant stellte den Fahrer ein, da er einen ausgezeichneten Service bot. +Die Assistant stellte den Fahrer ein, da er einen ausgezeichneten Service bot. +Der Assistant stellte den Fahrer ein, da er einen ausgezeichneten Service bot. +Der Assistant stellte den Fahrer ein, da er eine ausgezeichnete Service bot.
4. The laborer handed the application to the editor because he wants the job.
Unconstrained* Der Arbeiter übergab den Antrag an den Herausgeber, weil er den Job will. +Der Arbeiter übergab die Bewerbung an den Herausgeber, weil er die Arbeit will. +Der Arbeiter übergab die Bewerbung an den Herausgeber, weil er den Job will. +Der Arbeiter überrechte die Bewerbung an den Herausgeber, weil er die Arbeit will.
Constrained* Der Arbeiter übergab den Antrag an den Herausgeber, weil er den Job will. +Der Arbeiter übergab den Antrag an den Herausgeber, weil er diesen Job will. +Der Arbeiter übergab den Antrag an den Herausgeber, weil er die Job will. +Der Arbeiter übergab die Antrag an den Herausgeber, weil er die Job will.
5. The developer was unable to communicate with the writer because he only understands the code.
Unconstrained* Der Entwickler konnte nicht mit dem SchriftstellerCOMMUNIZIEREN, weil er nur den Code verstellt. +Der Entwickler konnte nicht mit dem Autor COMMUNIZIEREN, weil er nur den Code verstellt. +Der Entwickler war nicht in der Lage, mit dem Schriftsteller zu COMMUNIZIEREN, weil er nur den Code verstellt. +Der Entwickler war nicht in der Lage, mit dem Autor zu COMMUNIZIEREN, weil er nur den Code verstellt.
Constrained* Der Entwickler konnte nicht mit dem SchriftstellerCOMMUNIZIEREN, weil er nur den Code verstellt. +Der Entwickler konnte nicht mit der Schriftstellerz COMMUNIZIEREN, weil er nur den Code verstellt. +Der Entwickler konnte nicht mit dem Schriftsteller COMMUNIZIEREN, weil er nur die Code verstellt. +Der Entwickler konnte nicht mit dem Schriftsteller COMMUNIZIEREN, weil er nur diesen Code verstellt.
+ +Table 5: English-German 4-best lists for 5 randomly-selected WinoMT sentences, translated with normal beam search and gender-constrained beam search. Grammatically feminine human entities are underlined. Grammatically masculine human entities are emphasised. Lists are ordered by NMT model likelihood (first is 1best) - lines marked with * are those selected under oracle-eranking. + +1: Constrained reranking finds a better gender translation that is not present in the unconstrained beam. +2: A better gendered translation is not found in either width-4 beam. Constraints still maintain semantic meaning throughout the beam while allowing syntactic variation, including a differently gendered secondary entity. +3, 4, 5: The highest likelihood output is acceptable. For 3 and 5 constraining the n-best list results in more gender variation. \ No newline at end of file diff --git a/firsttheworstfindingbettergendertranslationsduringbeamsearch/images.zip b/firsttheworstfindingbettergendertranslationsduringbeamsearch/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d278d3d3aa3e03a9b0754677e87256773b3f68ae --- /dev/null +++ b/firsttheworstfindingbettergendertranslationsduringbeamsearch/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcf48da1891144b3058f63b075b8e7e81f673f1bc3ba4a449e51b620a1355ce4 +size 620734 diff --git a/firsttheworstfindingbettergendertranslationsduringbeamsearch/layout.json b/firsttheworstfindingbettergendertranslationsduringbeamsearch/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e17ca9d5026fd49b965c7ee10a00f31c4b4b691f --- /dev/null +++ b/firsttheworstfindingbettergendertranslationsduringbeamsearch/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e9ed061cdc7cc3dd0661893fd473e3f65ab3ead842ec7d49ee888e13fa52623 +size 295919 diff --git a/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_content_list.json b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0da3e311214587bfcb6f7f7b8c654f67cd7f57de --- /dev/null +++ b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e60ff083bbbcc7f220acfa1d22421e62f3aa766bfa31e48bcf2201900c26fa5c +size 76472 diff --git a/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_model.json b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bd9f43da7f2d4acd4db2d2dfcb0afe069959390c --- /dev/null +++ b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6916f22b1524f61880c411dae6a86f85ec8e4212c04704cc8b97c42fe9b1002 +size 95942 diff --git a/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_origin.pdf b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..47e4b02deed0d2b410c9100116b508d56fe22774 --- /dev/null +++ b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/57a91efc-07f9-47d1-9391-20cd7e8d0c11_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:325ddb8d102b98da3f5bbaf3817baab8c2a42585f7601d96b24219832a9a689a +size 516320 diff --git a/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/full.md b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4167425928812eb3eb7903b87b5c05912ef2bdb5 --- /dev/null +++ b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/full.md @@ -0,0 +1,342 @@ +# Focus on the Action: Learning to Highlight and Summarize Jointly for Email To-Do Items Summarization + +Kexun Zhang $^{1}$ , Jiaao Chen $^{2}$ , Diyi Yang $^{2}$ + +$^{1}$ Zhejiang University + +2Georgia Institute of Technology + +kexunz@zju.edu.cn + +jiaaochen@gatech.edu + +diyi.yang@cc.gatech.edu + +# Abstract + +Automatic email to-do item generation is the task of generating to-do items from a given email to help people overview emails and schedule daily work. Different from prior research on email summarization, to-do item generation focuses on generating action mentions to provide more structured summaries of email text. Prior work either requires large amount of annotation for key sentences with potential actions or fails to pay attention to nuanced actions from these unstructured emails, and thus often lead to unfaithful summaries. To fill these gaps, we propose a simple and effective learning to highlight and summarize framework (LHS) to learn to identify the most salient text and actions, and incorporate these structured representations to generate more faithful to-do items. Experiments show that our LHS model outperforms the baselines and achieves the state-of-the-art performance in terms of both quantitative evaluation and human judgement. We also discussed specific challenges that current models faced with email to-do summarization. + +# 1 Introduction + +Automatic email to-do generation is the task of summarizing to-do items from given emails (Mukherjee et al., 2020) to help people overview overwhelming numbers of emails they receive every day (Radicati and Hoang, 2011) and schedule their daily work. Unlike prior research on emails such as generating email conversation summarization (Muresan et al., 2001; Nenkova and Bagga, 2003; Rambow et al., 2004), keyword extraction (Turney, 2000; Lahiri et al., 2016; Lin et al., 2017) and subject line generation (Zhang and Tetreault, 2019; Xue et al., 2020), to-do items generation focuses more on action mentions to provide more structured summaries from email communications, which requires identifying important tasks to be performed among all the action items and aligning them with the right users (Mukherjee et al., 2020). + +To tackle these challenges in to-do item generation, a two-stage framework (Zhang and Tetreault, 2019; Mukherjee et al., 2020) is generally utilized to first extract the commitment sentence which is the most related to the to-do item and then generate to-do items based on those selected sentences. Despite the effectiveness, several limitations exist: (1) extra annotations are usually needed for the first stage (Mukherjee et al., 2020) to learn the classifiers which require extra cost/expertise and are often hard to obtain in low-resourced settings; (2) any information loss in the identification stage might lead to bigger noises in the to-do generation stage; (3) directly extracting actions from less-structured text usually leads to unfaithful summaries (Chen and Yang, 2021) that mismatch the relations between users and actions. + +To fill in these gaps, in this work, we propose a learning to highlight and summarize model, where we learn the important sentence identification module and to-do summarization module concurrently in an end-to-end manner to focus on the most salient actions, as well as to incorporate structured action representations to generate more faithful to-dos. One example is shown in Figure 1. Specifically, we use an unsupervised approach to extract the salient sentences and actions by comparing them to the ground truth to-do. We extract action triplets from the text and construct an action graph to encode the structural information in the unstructured text. During training, the model learns to generate to-do items and identify highlights jointly. During prediction, the model utilizes the predicted highlights by modifying the attention distribution accordingly. Furthermore, as extrinsic hallucinations involving named entities are common in automatic summarization tasks (Maynez et al., 2020; Chen et al., 2021), we propose a perturbation technique based on person names to reduce the extrinsic hallucinations. + +We conduct experiments on the SmartToDo cor + +![](images/91585cc5ed9c77942b3beb72500c40980861167ba4e7eaedc7811e9bb36dc0f1.jpg) +Figure 1: Example pipeline of our method to generate to-do items from email. Highlight sentences are extracted from the email text. Highlight action nodes are extracted from the constructed action graph. The highlight actions and sentences are then utilized to generate the to-do item. + +pus(Mukherjee et al., 2020) and show that our LHS model outperforms strong baselines on to-do item generation, demonstrating the effectiveness of this joint model on learning to highlight and summarize. By evaluating our LHS model on a different email corpus, we demonstrate that it generalizes well on a zero-shot condition. + +# 2 Related Work + +Document summarization. Recent works on document summarization are usually extractive (Gupta and Lehal, 2010; Narayan et al., 2018; Liu and Lapata, 2019) and abstractive. Methods for abstractive document summarization include sequence-to-sequence models (Rush et al., 2015), pointer generators (See et al., 2017), reinforcement learning (Paulus et al., 2018; Huang et al., 2020) and methods based on pre-trained language models (Lewis et al., 2020; Zhang et al., 2019). To generate faithful abstractive document summaries (Maynez et al., 2020), recent works on abstractive summarization have incorporated different types of guidance signals extracted including key tokens (Gehrmann et al., 2018; Chen and Bansal, 2018; Li et al., 2018; Saito et al., 2020; Dou et al., 2021), highlight sentences (Liu et al., 2018; Dou et al., 2021; Saito et al., 2020) and relational triplets (Jin et al., 2020; Zhu et al., 2020a; Dou et al., 2021). However, these models are mainly designed to find important information from all parts of the document, while todo items are often associated with only several sentences in emails. + +Conversation summarization Automatic to-do generation is also similar to the task of conversation summarization in the way that the input data contains both the current email in which the user promises to take an action and the previous email to + +which the user is replying. For extractive conversation summarization (Murray et al., 2005), statistical machine learning methods such as skip-chain CRFs (Galley, 2006), SVM with LDA models (Wang and Cardie, 2013), and multi-sentence compression algorithms (Shang et al., 2018) have been used. When key information is scattered in multiple sentences, such methods had trouble in succinctness, fluency and naturalness (Song et al., 2020). Abstractive conversation summarization methods are more effective in these circumstances. These methods design hierarchical models (Zhao et al., 2019; Zhu et al., 2020b), incorporate commonsense knowledge (Feng et al., 2020), or leverage conversational structures like dialogue acts (Goo and Chen, 2018), key point sequences (Liu et al., 2019a), topic segments (Liu et al., 2019b; Li et al., 2019) and stage developments (Chen and Yang, 2020). Some recent research has also utilized structural information to detect important content in conversations (Murray et al., 2006; Bui et al., 2009; Qin et al., 2017). However, recent methods that explicitly identify salient content has not been used jointly with conversation summarization models. + +Summarization tasks on email Several summarization-like tasks have been proposed such as email text summarization (Muresan et al., 2001; Nenkova and Bagga, 2003; Rambow et al., 2004), keyword and action extraction (Turney, 2000; Lahiri et al., 2016; Lin et al., 2017; Corston-Oliver et al., 2004), subject line generation (Zhang and Tetreault, 2019; Xue et al., 2020) and to-do generation task (Mukherjee et al., 2020). These previous works often deploy a two-stage framework that first extracts salient sentences from the email and then generates summary based on extracted sentences. However, any information loss in the first stage might lead to bigger noises in the to-do + +![](images/8c0a09d64e0631042c01230ebc56f3142410afdfcab79d7c75bcdb7390ef638b.jpg) +(a) Encoder + +![](images/92fa01d4f17615c91fdd3df9cd2cd5eb6c64ee60259a2af2b43b0b7ecef4244e.jpg) +(b) Decoder +Figure 2: Model Architecture. The sentences and actions are first encoded and then fed to the highlight classifiers. The hidden representations of sentences and actions, along with their probability of being highlights are then used in the cross-attention layer in the decoder. The email encoder has the same structure as BART encoder. The graph encoder utilizes graph attention networks to encode the action graph. + +generation stage, and directly extracting actions from less-structured text might lead to unfaithful summaries (Chen and Yang, 2021). To fill these gaps, we propose to explicitly model actions within sentences in the email in a structured way, by using action graphs to model the actions, introducing an auxiliary classifier to identify the highlights, and further combining these with a decoder that attends to both the encoding of input tokens and extracted actions for to-do generation. + +# 3 Methods + +To generate faithful to-do items that correlate actions with correct users from emails1, we propose to encode both text-level and action-level information as guidance signals. The architecture of LHS model is shown in Figure 2. We first extract the action mention ("WHO-DOING-WHAT" triples (Chen and Yang, 2021)) from the emails and construct an action graph (Section 3.1), then we encode text and actions separately (Section 3.2) and use + +a multi-scale decoder that attends to both email and action graphs to generate the to-do item (Section 3.4). Besides directly incorporating different levels of information, we further design an end-to-end framework to utilize guidance signals such as important sentences and actions to help summarization models focusing more on the key to-dos by jointly learning a highlight classifier (Section 3.3) with the summarization model and view the predicted results as priors to attention distributions in the decoder (Section 3.4). + +# 3.1 Action Graph Construction + +Unlike general summarization over emails, to-do item summarization is more action-focused, requiring identification of specific tasks to be performed (Mukherjee et al., 2020). As a result, we propose to explicitly inject structured action information into the to-do summarization model. To do so, we first extract actions triples from the emails in the form of subject-predicate-object triplets and then construct the action graphs to aid the to-do summarization. + +Action extraction Following Chen and Yang (2021), we first pre-process the emails to a third-person point-of-view via (1) replacing first-person pronouns with the name of the sender of the email, + +(2) replacing second-person pronouns with the each of the names of the recipients of the email, (3) replacing the third-person pronouns with the coreference resolution algorithm provided by Stanford CoreNLP (Manning et al., 2014). Then we utilize OpenIE (Angeli et al., 2015) to extract subject-predicate-object triplets from the processed email. + +Action graph construction With the extracted triples, we construct the action graph $G = (\mathbf{V}, \mathbf{E})$ , where the nodes in $\mathbf{V}$ represent the subjects, predicates and objects in the action triplets, and $\mathbf{E}_{ij} = 1$ if nodes $i$ and $j$ appear in one same triplet. Note that we construct one action graph per email. One example is shown in Figure 1, where the subjects and objects of the actions triplets are 'John', 'Jane', 'developers' and 'price info', and the predicates of the actions include 'talked', 'talked with', 'will keep posted' and 'collected'. + +# 3.2 Encoder + +Our LHS model includes two encoders that encode the email text and the action graphs separately. + +# 3.2.1 Email Encoder + +We initialize the email text encoder $E_{T}$ with a pretrained transformer-based encoder (BART (Lewis et al., 2020)). For an input email with $n$ sentences, $\{x_{1}, x_{2}, \ldots, x_{n}\}$ , we concatenate and encode them together into hidden representations $h_{i}$ : $\{h_{1}, h_{2}, \ldots, h_{n}\} = E_{T}(\{x_{1}, x_{2}, \ldots, x_{n}\})$ + +We truncate the email text if it exceeds the length limit of BART. + +# 3.2.2 Action Graph Encoder + +Inspired by Huang et al. (2020); Chen and Yang (2021), we utilize Graph Attention Network (Velicković et al., 2018) to encode the constructed action graph $G = (\mathbf{V}, \mathbf{E})$ . Each node $v$ with text $\{x_1^v, x_2^v, \ldots, x_k^v\}$ is initialized with the average of the hidden states from the text encoder $E_T$ using the text of the node: $h_v = \frac{1}{k} \sum_{i=1}^{k} E_T(x_k)$ . + +In each layer of the graph attention network, the hidden state of every node $v_{i}$ is represented by a weighted average of its neighbors' previous hidden states (W is a trainable parameter, $\mathcal{N}_i$ is the set of neighbors of $i$ , and $\sigma$ is the activation function): + +$$ +\begin{array}{l} \alpha_ {i j} = \mathrm {s o f t m a x} ((\mathbf {W} v _ {i}) ^ {T} (\mathbf {W} v _ {j})) \\ h _ {i} ^ {a} = \sigma (\sum_ {j \in \mathcal {N} _ {i}} \alpha_ {i j} \mathbf {W} v _ {j}) \\ \end{array} +$$ + +# 3.3 Highlight Identification + +Guiding an abstractive summarization model with extracted salient sentences has been used in previous works on document summarization (Gehrmann et al., 2018; Chen and Bansal, 2018). Compared to typical document summarization task which needs to consider information from all parts of the document, to-do generation usually needs to focus only on a few important sentences of the email. Thus, we jointly learn an auxiliary highlight classifier to indicate whether a sentence/action is important or not. The predicted probabilities are incorporated during the decoding stage to guide the decoder paying higher attentions to the important sentences/actions in the email. + +Highlight label extraction For an email $X = \{x_{1},\ldots ,x_{n}\}$ with $n$ sentence, and its ground truth to-do item $y$ , we automatically extract the $k$ most important sentences for classifier learning through oracle extraction using a greedy search algorithm: (1) Rank the sentences $\{x_{1},\dots ,x_{n}\}$ based on ROUGE scores with the ground truth $y$ . (2) For the sentences with the $k$ largest ROUGE scores, we label the tokens in them as highlight tokens. + +Similarly, we extract the highlight actions by concatenating the triplets and calculating ROUGE scores with regard to the ground truth action, which is extracted from the concatenation of the name of the sender and the to-do item (e.g. if the sender is 'John' and the to-do item is 'Keep Jane posted about price info', the ground truth actions are extracted from the sentence 'John keep Jane posted about price info'). The extracted actions and sentences are used only as labels to train the highlight classifiers. During inference, the LHS model directly utilizes the predictions from highlight classifiers as guidance signal. + +Highlight classifier There are two highlight classifiers in the model, one for highlighting sentences and the other for highlighting actions. We utilize the hidden representation of sentences and actions given by the encoder as the input for highlight classifiers. The hidden representations are fed to a multi-layer perceptron to be classified. The classification loss is calculated with respect to the labeled highlights using cross entropy loss, where $h$ are the real highlights and $\hat{h}$ are the predictions: + +$$ +L _ {c l a s s i f i c a t i o n} (h, \hat {h}) = - \sum_ {i} h _ {i} \log (\hat {h} _ {i}) +$$ + +We train LHS model in a joint fashion. Here $L_{\text{classification}}$ is the sum of losses for both high-light classifiers, and $L_{\text{generation}}$ is the cross entropy loss for finetuning BART for generation tasks. We use $\alpha$ and $\beta$ as the weights to control the learning speed for two modules: + +$$ +L _ {t o t a l} = \alpha \cdot L _ {g e n e r a t i o n} + \beta \cdot L _ {c l a s s i f i c a t i o n} +$$ + +# 3.4 Decoder + +We improve the decoder of BART (Lewis et al., 2020) with additional layers of cross attention on graphs and incorporating the guidance of highlights. Each decoder layer is composed of 3 attention layers: the self-attention layer that attends to the previously generated tokens, the cross-attention layer that attends to the hidden representation of each input token, and the cross-attention layer that attends to the hidden representation of each node in the action graph. When calculating encoder-decoder attention, we modify every attention distribution with the predictions from the highlight classifiers. + +Specifically, for a sequence of length $l$ , given the original attention weights of an attention head $\alpha_{1,\dots,l}$ and the probability sequence $p_1,\ldots ,l$ where $p_i$ denotes the predicted probability for the $i$ -th token being highlighted (we use the probability of one sentence being highlighted as the probability for all the tokens in that sentence being highlighted). We use the L1-normalization of the predictions as the weights of modification: + +$$ +w _ {i} = \frac {p _ {i}}{\sum_ {j = 1} ^ {l} p _ {j}} +$$ + +We then modify the attention weights from cross attention to obtain the new distribution: $\alpha_{i}^{\prime} = w_{i}\alpha_{i}$ . The re-weighting of attention probabilities puts more weight on the highlighted sentences and actions, which makes it easier for the model to focus on the text snippets related to the to-do item. + +# 3.5 Perturbation + +According to previous studies on hallucinations (Maynez et al., 2020), about $70\%$ of hallucinations that happen in summarization tasks, regardless of the model used, are extrinsic (model generations that ignore the input document). Among these extrinsic hallucinations, a large fraction $(35\%)$ happen on named entities (Chen et al., 2021). Such finding is consistent with our observations on this email to-do item generation task. + +To address the hallucinations on named entities and prevent the model from sampling a random name from the dataset, we use a simple yet effective perturbation approach by replacing the persons' names. For each data point, we first cluster the names so that the different forms of a same name are put in the same cluster. Since the email text is preprocessed with coreference resolution as mentioned in (Section 3.1), we do the clustering by assuming two names with at least one word in common are the same. + +For each cluster of names, we replace the occurrences in the cluster with a new name taken from common American names for both email text and the labeled to-do item. During training, we use original data for the first 4 epochs of fine-tuning and we use perturbed data for the last 3 epochs. + +# 4 Experiments + +# 4.1 Datasets + +We train our LHS model on the dataset SmartToDo (Mukherjee et al., 2020). The dataset consists of around 10,000 emails and their corresponding annotated todo items. The SmartToDo dataset is constructed based on the Avocado Email corpus ${}^{2}$ . We also randomly sample 50 emails from the Enron Email corpus ${}^{3}$ and annotate them manually,in order to examine the model's performances on out-of-domain generalization. + +# 4.2 Baselines + +We compare our methods with several baselines: + +- SmartToDo (Mukherjee et al., 2020) is the first model to address the todo generation task. We take the evaluation metrics directly from SmartToDo (Mukherjee et al., 2020) since the setting of our experiments is similar to it. +- Transformer (Vaswani et al., 2017): We trained transformer using OpenNMT (Klein et al., 2017) with its default setting on summarization tasks. +- BART (Lewis et al., 2020) is a pre-trained model that shows great performance when being fine-tuned on summarization tasks. + +
DatasetModelROUGE-1ROUGE-2ROUGE-L
SmartToDoTransformer0.3730.1560.387
SmartToDo‡0.6000.4100.630
BART0.6350.4310.669
SmartToDoLHS without highlight actions and perturbation†0.6730.4690.685
LHS without perturbation†0.6810.4720.692
LHS†0.6860.4700.692
EnronEmailBART0.5170.3570.536
LHS without perturbation†0.5730.4120.589
LHS without highlight actions and perturbation†0.5350.4020.571
LHS†0.5920.4180.614
+ +Table 1: ROUGE scores for different models on the SmartToDo test set and a manually annotated Enron Email dataset. $\ddagger$ indicates the current state-of-the-art method. Models with $\dagger$ are our proposed models. + +
TypeFac.Succ.Inf.
Ground Truth4.134.254.14
BART3.873.954.02
LHS †3.934.084.10
+ +Table 2: LHS † is our learning to highlight and summarize model that incorporates highlight sentences, highlight actions and perturbation. Average human evaluation of ground truth, baselines and LHS in terms of Factualness, Succintness and Informativeness. + +# 4.3 In-Domain Results + +Quantitative evaluation We evaluate all the models with the commonly used metric for text generation, ROUGE scores (Lin and Och, 2004). We report the F1 scores of all the models in Table 1. We found that: given the large corpus used for pretraining, finetuned BART (Lewis et al., 2020) is a strong baseline that already outperforms the original SmartToDo (Mukherjee et al., 2020) model. Generally, our method that incorporates highlight sentences, action graph and perturbation outperforms the baselines greatly. Compared to the baseline model, BART, the quantitative evaluation of our method is increased by $5.1\%$ in ROUGE-1, $3.9\%$ on ROUGE-2 and $6.2\%$ on ROUGE-L. The model that utilizes both highlight sentences and structured information in the action graph outperforms the model with the highlight sentences only by $1.2\%$ in ROUGE-1, $0.3\%$ in ROUGE-2 and $0.7\%$ in ROUGE-L, indicating that the effective + +ness of action graph and highlight action classifier. We describe some randomly picked generation examples in the Appendix. + +Human evaluation We also conducted human evaluation to further assess the generation results. We randomly sampled 50 emails from the test set of the models and asked human evaluators (undergraduate research assistants who are familiar with the task) to rate the ground truth, the predictions of BART and the predictions of the proposed LHS model using a scale from 1 to 5 in three aspects: factualness (e.g. selecting the correct objects of the to-do action), succinctness (e.g. does not contain redundant information) and informativeness (e.g. contains the necessary information in a todo item for the sender of the email). The Fleiss' Kappa for the raters was 0.42, showing moderate agreement (Landis and Koch, 1977). We report the results of human evaluation in Table 2. The results show that our method outperforms the baseline BART in all aspects of qualitative measures. However, our method is still weaker than human, especially in terms of factualness and succinctness, suggesting that current models still struggle with to-do item generation. + +# 4.4 Out-of-Domain Results + +To evaluate the generalizability of the proposed LHS model, we train the models on the SmartToDo dataset and evaluate them on a small batch of the Enron Email corpus which we annotated manually. The results are shown in Table 1. Given that the Enron Corpus is constructed using the emails of an energy company while the Avocado Corpus is + +
ExtractionROUGE-1ROUGE-2ROUGE-L
Random0.6290.4240.653
Highlight0.6730.4690.685
+ +Table 3: ROUGE scores of our method with randomly sampled sentences instead of highlight sentences. + +
GraphROUGE-1ROUGE-2ROUGE-L
Random0.6340.4290.651
Action0.6860.4700.692
+ +from a technology company, the frequently mentioned entities and terms are different. Still, the LHS model achieves 0.592 in ROUGE-1, 0.418 in ROUGE-2 and 0.614 in ROUGE-L, indicating that LHS model generalizes well on a zero-shot condition. Furthermore, we observed that incorporating highlight sentences and actions increase ROUGE scores significantly by $7.5\%$ in ROUGE-1, $6.1\%$ in ROUGE-2 and $7.8\%$ in ROUGE-L, indicating that learning to highlight and summarize jointly is also effective when generalized. + +# 4.5 Ablation Studies + +To verify the effectiveness of our proposed approaches comprehensively, we conducted a set of ablation studies as follows. + +Effectiveness of highlight sentences We first examine the quality of the extracted highlight sentences and their influences on the LHS model for the to-do generation task in Table 3. We compared the ROUGE scores of the LHS model using the highlight sentences extracted by the algorithm in Section 3.3 and randomly sampled sentences. For each data point, we sample a score for each sentence from a normal distribution and select the sentences with the largest $k$ scores as the substitute for highlight sentences, where $k$ is the number of actual highlight sentences in that data point. The results showed that randomly sampled sentences did not improve the model's performance, and our extracted highlights were effective in guiding the model to focus on the to-do item related sentences. + +Number of highlighted Sentences We also conducted experiments to show how the number of extracted highlight sentences effected the perfor + +Table 4: ROUGE scores of our method with action graphs and randomly constructed graphs. + +
GraphR-2 DOINGsR-2 WHATs
LHS w/o perturbation0.3780.562
LHS0.3700.593
+ +Table 5: ROUGE-2 scores of LHS with and without perturbation on actions extracted from the subset of the test set that contains person names. DOINGs and WHATs are the second and third part of an action triplet. WHATs in this case contain the person names. + +![](images/c5f989049438a7bbc07481369209f66788aed7e16deed6d89bcc1051241d1139.jpg) +Figure 3: ROUGE scores when varying the value of $k$ in the top $k$ sentences extracted as highlights. + +mance of the model. The results shown in Figure 3 indicates that increasing the number of highlighted sentences does not necessarily improve the model's performance. Specifically, when $k$ increases from 1 to 3, ROUGE scores also increase; after $k = 3$ , adding more highlighted sentences seems to be associated with decreased performances. This trend makes a lot of sense as the to-do items are usually related to only 2 to 3 important sentences in the email. This pattern can also be observed in the samples shown in Table 6. + +Effectiveness of action graph To show that the constructed action graph was giving guidance to the model, we conducted experiments with random graphs whose nodes are the same as action graphs but whose edges are randomly sampled. Table 4 indicates that random graphs without structural information did not guide the model to achieve better performance. When LHS uses random graphs instead of action graphs, the ROUGE scores are even lower than the BART baseline. This indicates that the structural information of the action graph, rather than the node entities is essential to the extraction of to-do items. + +Effectiveness of perturbation The perturbation is intended to improve the model's performance in extracting the correct person names. To show + +
TypePercentageROUGE-2Ground TruthWrong PredictionEmail Text
multiple todos26%0Check out the action.Try to create a new account.I'll check out the action. +... I'll also try to create a new account
incorrect action with correct objects14%0.36Send the second item to Lewis.Get the second item updated for Lewis.To: Lewis, +... +We have sent the second item to you. And we'll update it next week.
correct action with incorrect objects8%0.5Look into the application of creating a new account.Look into the new account.You applied to create a new account. +We'll look into it.
missing objects26%0.4Get Darshan some mockups asap for intuit status.Get some mockups asap.As for intuit status, I'll get some mockups asap.
hallucination12%0.4Keep Dan updated on the meeting.Keep Darshan† updated on the schedule.To Dan: +... +I will keep you updated.
+ +Table 6: Statistics for 50 samples with lowest ROUGE-2 scores in the validation set. † is a name in the corpus but not mentioned in the email. + +its effectiveness, we evaluate its performance on person names independently from other parts of a to-do item by comparing the names in generated to-dos and reference to-dos. Such comparison can be done by extracting the action triplet from the prediction and the reference. + +For a to-do item, the names in it correspond to the third part of the corresponding action triplet (the WHAT in WHO-DOING-WHAT), so we extract the mentioned names of a to-do item similarly to the method in Section 3.1. For a pair of action triplets WHO1-DOING1-WHAT1, WHO2-DOING2-WHAT2 extracted from the prediction and the reference, we compute ROUGE-2 score for DOING1, DOING2 and WHAT1, WHAT2 separately. The ROUGE-2 score for WHAT1 and WHAT2 indicates how well the model is able to capture the correct person names. The results are reported in Table 5. When perturbation is applied during training, the ROUGE-2 score for person names increase by 0.03, which indicates that our perturbation trick is effective in alleviating hallucinations about names. + +# 4.6 Challenges and Error Analyses + +To examine the challenges our models were faced with, we analyzed the errors made by our method on the test set. We manually examine 50 data points with the least ROUGE-2 scores and put them into different categories of challenges, as shown in Table 6. For each type of challenge we manually picked a sample that shows how the prediction is problematic. The major types include: + +- Multiple todos: Instead of being a major challenge for models, this is more like a dataset annotation issue. Some data points in the SmartToDo (Mukherjee et al., 2020) dataset actually contain more than one todo items, but the ground-truth has only one item. The annotator and the model selected two different todo items to generate, though both belong to the actual ground-truths. +- Missing objects: The correct action related to the to-do item is extracted, but the information is not sufficient as the objects of such action are missing. +- Correct action with incorrect objects: The correct action has been extracted, but the objects of the action have been assigned to incorrect objects. This kind of error usually happens when the object of the action is not in the same sentence of the action. +- Incorrect action with correct objects: The correct objects are extracted, but they are associated with incorrect actions. This kind of error is usually related to multiple sentences or events expressed in the future tense. +- Extrinsic hallucination: The incorrect action problem and the incorrect object problem mentioned before belong to intrinsic hallucinations which extract information from the email but matches it in a wrong way. While in extrinsic hallucinations, the objects of the todo item are not extracted from the email, but generated from similar entities in the corpus. + +# 5 Conclusion + +In this work, we propose a simple yet effective learning to highlight and summarize framework (LHS) to learn to identify salient text and actions from both email text and the constructed action graph, and generate faithful to-do items jointly. Experiments show that the proposed model outperforms the baselines significantly and achieves state-of-the-art performance in both quantitative evaluation and human judgement. We further demonstrated that our LHS framework generalized well to out-of-domain conditions. In the future, we plan to extend the email to-do item generations to other domains such as generating multiple to-do action items from conversation or meeting threads. + +# Acknowledgement + +The authors would like to thank the reviewers for their feedback. This work is funded in part by an Amazon Research Award and a grant from Cisco. + +# Ethical Discussion + +The dataset used in this work is released by Smart-ToDo (Mukherjee et al., 2020), based on the Avocado dataset from the Linguistic Data Consortium, which mainly contains emails from an anonymous defunct technology company referred to as Avocado. The Avocado email dataset entered the public domain via the cooperation and consent of the legal owner of the corpus. Although we do not encounter any major ethical issues in training these models, we anticipate there might be key challenges when it comes to the deployment of email to-do item generation systems, given the highly sensitive and personal nature of emails. We strongly recommend any future use of email to-do generation models only do it in a secure and private manner, and call for a code of AI ethics that lays out how various issues will be handled around deploying these systems for real world uses. + +# References + +Gabor Angeli, Melvin Jose Johnson Premkumar, and Christopher D. Manning. 2015. Leveraging linguistic structure for open domain information extraction. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 344-354, Beijing, China. Association for Computational Linguistics. + +Trung Bui, Matthew Frampton, John Dowding, and Stanley Peters. 2009. Extracting decisions from multi-party dialogue using directed graphical models and semantic similarity. In Proceedings of the SIGDIAL 2009 Conference, pages 235-243, London, UK. Association for Computational Linguistics. +Jiaao Chen and Diyi Yang. 2020. Multi-view sequence-to-sequence models with conversational structure for abstractive dialogue summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4106-4118, Online. Association for Computational Linguistics. +Jiaao Chen and Diyi Yang. 2021. Structure-aware abstractive conversation summarization via discourse and action graphs. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1380-1391, Online. Association for Computational Linguistics. +Sihao Chen, Fan Zhang, Kazoo Sone, and D. Roth. 2021. Improving faithfulness in abstractive summarization with contrast candidate generation and selection. In NAACL. +Yen-Chun Chen and Mohit Bansal. 2018. Fast abstractive summarization with reinforce-selected sentence rewriting. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 675-686, Melbourne, Australia. Association for Computational Linguistics. +Simon Corston-Oliver, Eric Ringger, Michael Gamon, and Richard Campbell. 2004. Task-focused summarization of email. +Zi-Yi Dou, Pengfei Liu, Hiroaki Hayashi, Zhengbao Jiang, and Graham Neubig. 2021. Word alignment by fine-tuning embeddings on parallel corpora. In Conference of the North American Chapter of the Association for Computational Linguistics (NAACL). +Xiachong Feng, Xiaocheng Feng, Bing Qin, and Ting Liu. 2020. Incorporating commonsense knowledge into abstractive dialogue summarization via heterogeneous graph networks. arXiv preprint arXiv:2010.10044. +Michel Galley. 2006. A skip-chain conditional random field for ranking meeting utterances by importance. In Proceedings of the 2006 Conference on Empirical Methods in Natural Language Processing, pages 364-372. +Sebastian Gehrmann, Yuntian Deng, and Alexander M Rush. 2018. Bottom-up abstractive summarization. arXiv preprint arXiv:1808.10792. +Chih-Wen Goo and Yun-Nung Chen. 2018. Abstractive dialogue summarization with sentence-gated modeling optimized by dialogue acts. 2018 IEEE Spoken Language Technology Workshop (SLT). + +Vishal Gupta and Gurpreet Singh Lehal. 2010. A survey of text summarization extractive techniques. Journal of emerging technologies in web intelligence, 2(3):258-268. +Luyang Huang, Lingfei Wu, and Lu Wang. 2020. Knowledge graph-augmented abstractive summarization with semantic-driven cloze reward. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5094-5107, Online. Association for Computational Linguistics. +Hanqi Jin, Tianming Wang, and Xiaojun Wan. 2020. Semsum: Semantic dependency guided neural abstractive summarization. Proceedings of the AAAI Conference on Artificial Intelligence, 34:8026-8033. +Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M. Rush. 2017. Opennmt: Open-source toolkit for neural machine translation. +S. Lahiri, R. MIHALCEA, and Po-Hsiang Lai. 2016. Keyword extraction from emails. Natural Language Engineering, 23:1-23. +J. Richard Landis and Gary G. Koch. 1977. The measurement of observer agreement for categorical data. Biometrics, 33(1):159-174. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. 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. +Chenliang Li, Weiran Xu, Si Li, and Sheng Gao. 2018. Guiding generation for abstractive text summarization based on key information guide network. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics (NAACL). +Manling Li, Lingyu Zhang, Heng Ji, and Richard J. Radke. 2019. Keep meeting summaries on topic: Abstractive multi-modal meeting summarization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2190-2196, Florence, Italy. Association for Computational Linguistics. +Chin-Yew Lin and Franz Josef Och. 2004. Automatic evaluation of machine translation quality using longest common subsequence and skip-bigram statistics. In Proceedings of the 42nd Annual Meeting on Association for Computational Linguistics, page 605. Association for Computational Linguistics. +Chu-Cheng Lin, Dongyeop Kang, Michael Gamon, Madian Khabsa, Ahmed Hassan, and Patrick Pantel. 2017. Actionable email intent modeling with reparametrized rnns. + +Chunyi Liu, Peng Wang, Jiang Xu, Zang Li, and Jieping Ye. 2019a. Automatic dialogue summary generation for customer service. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD19, page 1957-1965, New York, NY, USA. Association for Computing Machinery. +Peter J Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. 2018. Generating wikipedia by summarizing long sequences. In Proceedings of the Intertional Conference on Learning Representatinos (ICLR). +Yang Liu and Mirella Lapata. 2019. Text summarization with pretrained encoders. 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 3721-3731. +Zhengyuan Liu, Angela Ng, Sheldon Lee, Ai Ti Aw, and Nancy F. Chen. 2019b. Topic-aware pointer-generator networks for summarizing spoken conversations. 2019 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU). +Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. 2014. The Stanford CoreNLP natural language processing toolkit. In Proceedings of 52nd Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 55-60, Baltimore, Maryland. Association for Computational Linguistics. +Joshua Maynez, Shashi Narayan, Bernd Bohnet, and Ryan McDonald. 2020. On faithfulness and factuality in abstractive summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1906-1919, Online. Association for Computational Linguistics. +Sudipto Mukherjee, Subhabrata Mukherjee, Marcello Hasegawa, Ahmed Hassan Awadallah, and Ryen White. 2020. Smart to-do: Automatic generation of to-do items from emails. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8680-8689, Online. Association for Computational Linguistics. +Smaranda Muresan, Evelyne Tzoukermann, and Judith L. Klavans. 2001. Combining linguistic and machine learning techniques for email summarization. In Proceedings of the ACL 2001 Workshop on Computational Natural Language Learning (ConLL). +Gabriel Murray, S. Renals, and J. Carletta. 2005. Extractive summarization of meeting recordings. In INTERSPEECH. +Gabriel Murray, Steve Renals, Jean Carletta, and Johanna Moore. 2006. Incorporating speaker and discourse features into speech summarization. In Proceedings of the Human Language Technology Con- + +ference of the NAACL, Main Conference, pages 367-374, New York City, USA. Association for Computational Linguistics. +Shashi Narayan, Shay B Cohen, and Mirella Lapata. 2018. Ranking sentences for extractive summarization with reinforcement learning. 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 1747-1759. +A. Nenkova and A. Bagga. 2003. Facilitating email thread access by extractive summary generation. In RANLP. +Romain Paulus, Caiming Xiong, and Richard Socher. 2018. A deep reinforced model for abstractive summarization. In International Conference on Learning Representations. +Kochen Qin, Lu Wang, and Joseph Kim. 2017. Joint modeling of content and discourse relations in dialogues. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 974-984. +S. Radicati and Q. Hoang. 2011. Email statistics report, 2011-2015. +Owen Rambow, Lokesh Shrestha, John Chen, and Kirsty Lauridsen. 2004. Summarizing email threads. +Alexander M. Rush, Sumit Chopra, and Jason Weston. 2015. A neural attention model for abstractive sentence summarization. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 379-389, Lisbon, Portugal. Association for Computational Linguistics. +Itsumi Saito, Kyosuke Nishida, Kosuke Nishida, and Junji Tomita. 2020. Abstractive summarization with combination of pre-trained sequence-to-sequence and saliency models. arXiv preprint. +Abigail See, Peter J Liu, and Christopher D Manning. 2017. Get to the point: Summarization with pointer-generator networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1073-1083. +Guokan Shang, Wensi Ding, Zekun Zhang, Antoine Tixier, Polykarpos Meladianos, Michalis Vazirgiannis, and Jean-Pierre Lorre. 2018. Unsupervised abstractive meeting summarization with multi-sentence compression and budgeted submodular maximization. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 664-674, Melbourne, Australia. Association for Computational Linguistics. +Kaiqiang Song, Chen Li, Xiaoyang Wang, Dong Yu, and Fei Liu. 2020. The ucf podcast summarization system at trec 2020. arXiv preprint arXiv:2011.04132. + +Peter Turney. 2000. Learning algorithms for keyphrase extraction. Inf. Retr., 2:303-336. +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. +Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. 2018. Graph attention networks. In International Conference on Learning Representations. +Lu Wang and Claire Cardie. 2013. Domain-independent abstract generation for focused meeting summarization. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1395-1405. +Mingfeng Xue, Hang Zhang, and Jiancheng Lv. 2020. Key Factors of Email Subject Generation, pages 668-675. +Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter J Liu. 2019. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization. arXiv preprint arXiv:1912.08777. +Rui Zhang and Joel Tetreault. 2019. This email could save your life: Introducing the task of email subject line generation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 446-456, Florence, Italy. Association for Computational Linguistics. +Zhou Zhao, Haojie Pan, Changjie Fan, Yan Liu, Linlin Li, Min Yang, and Deng Cai. 2019. Abstractive meeting summarization via hierarchical adaptive segmental network learning. In The World Wide Web Conference, WWW '19, page 3455-3461, New York, NY, USA. Association for Computing Machinery. +Chenguang Zhu, William Hinthorn, Ruochen Xu, Qingkai Zeng, Michael Zeng, Xuedong Huang, and Meng Jiang. 2020a. Boosting factual correctness of abstractive summarization with knowledge graph. arXiv preprint. +Chenguang Zhu, Ruochen Xu, Michael Zeng, and Xuedong Huang. 2020b. A hierarchical network for abstractive meeting summarization with cross-domain pretraining. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online. Association for Computational Linguistics. + +# A Prediction Samples + +
Email TextGround TruthPrediction
Divarkar: +Are we able to proceed with development without +submitting applications? Attached is a copy of the +updated Palm DDS. The customer has approved it. +I will let you know if any changes are needed.Let Divakar know +if any changes in palm +DDS are neededLet Divakar know if +any changes are needed +in palm DDS .
While the customer was testing the Quicken +Palm app using the stored cookies, he +discovered a few places wrong. +This is excellent. Actually I prepared a check list. +Certainly we will test in all aspects and try +to finish by Friday afternoon PST. But we better +not to commit the time to customer I believe. +Please let me know if someone is testing on +real devices. I will directly co-ordinate with them.Test Palm app in all +aspects and try to finish +by Friday afternoon PST .Test in all aspects of +real devices and try to +finish by Friday +afternoon PST.
Due to a variety of circumstances, we did not +migrate employees to the UBSWE environment +tonight (Monday, February 4, 2002). +We will communicate further details of the +migration plan on Tuesday, February 5, 2002. +Thank you for your cooperation in advance, +please contact the Resolution Center at x 3-1411 +should you have any questions. +UBSW Energy Global InfrastructureCommunicate further +details of the migration to +the UBSWE environmentCommunicate further +details of the UBSW +environment.
May, +I need a number where you can be reached on +Friday evening. I will be getting the schedule +after work on Friday and will call and let you know +when and where our games will be. +DLet May know about when +and where games will beLet May know about +the schedule for the game +D
+ +Table 7: Four samples randomly picked from the predictions of the model, where the first two are from SmartToDo (the same corpus as the training set), and the second two are from Enron Email (a different email corpus). + +# B Implementation Details + +Following the setting of SmartToDo (Mukherjee et al., 2020), we used 1000 email instances each for validation and testing. We initialize the token-level encoder and the decoder layer that attends to input tokens with pre-trained BART-base (Lewis et al., 2020) parameters and randomly initialize the newly added components. For the components initialized with BART, we employ an initial learning rate of 5e-5. For the newly added components, we employ an initial learning rate of 5e-4. We set the number of warm-up steps to 100. We set the $\alpha$ , the coefficient of $L_{\text{classification}}$ to be 1.7 and $\beta$ , the coefficient of $L_{\text{generation}}$ to be 0.3. We fine-tune each model for 7 epochs on the training set. \ No newline at end of file diff --git a/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/images.zip b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fc456159b75727d15a8be99b2de9fa92a9106891 --- /dev/null +++ b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5f01f166eeaa1c4be00c537663774184b3a1f5c6e2f10c53f2159acb69df394 +size 556073 diff --git a/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/layout.json b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..19a5d84f4751dce485825cdafe6eab1dd5760c38 --- /dev/null +++ b/focusontheactionlearningtohighlightandsummarizejointlyforemailtodoitemssummarization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f8333a7361c276f2264496391a6f257379e48cff4ff58e1002d0036b8fd4488 +size 356531 diff --git a/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_content_list.json b/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b6660be4354228a632de44afe4e0b113dd11b5b3 --- /dev/null +++ b/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a574a10969cc7f4f5a65f49fd92d79e221797ba789720ac37240bda38b5f1af +size 103135 diff --git a/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_model.json b/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1442c0d24e59a218c04e5cf3473a6db686b9e3a4 --- /dev/null +++ b/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10b265639514fdf1d412cbb47e230e97e42c467c4bf27a3d051fb84105d8dbd6 +size 115876 diff --git a/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_origin.pdf b/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4dcf02291de5673ac21786ed7e9fcf1be411b938 --- /dev/null +++ b/frombertspointofviewrevealingtheprevailingcontextualdifferences/291487f6-1b6e-461b-9ca1-262f2505c831_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18a8e95a719828642514d9bca3118a3306e767cee4e8826904fc047bceb63d0e +size 2839389 diff --git a/frombertspointofviewrevealingtheprevailingcontextualdifferences/full.md b/frombertspointofviewrevealingtheprevailingcontextualdifferences/full.md new file mode 100644 index 0000000000000000000000000000000000000000..da1f6a372f6475a8f86707a338dfcdff07db08f8 --- /dev/null +++ b/frombertspointofviewrevealingtheprevailingcontextualdifferences/full.md @@ -0,0 +1,428 @@ +# From BERT's Point of View: Revealing the Prevailing Contextual Differences + +Carolin M. Schuster +Technical University of Munich +carolin.schuster@tum.de + +Simon Hegelich +Technical University of Munich + +# Abstract + +Though successfully applied in research and industry large pretrained language models of the BERT family are not yet fully understood. While much research in the field of BERTology has tested whether specific knowledge can be extracted from layer activations, we invert the popular probing design to analyze the prevailing differences and clusters in BERT's high dimensional space. By extracting coarse features from masked token representations and predicting them by probing models with access to only partial information we can apprehend the variation from 'BERT's point of view'. By applying our new methodology to different datasets we show how much the differences can be described by syntax but further how they are to a great extent shaped by the most simple positional information. + +# 1 Introduction + +By taking on the perspective of BERT and presenting the methodology to explore this point of view we contribute a new approach to BERTology research, a field that has emerged for a number of good reasons. + +Ever since the original BERT paper (Devlin et al., 2019) combined masked language modeling (MLM) with massive pretraining and the transformer architecture (Vaswani et al., 2017), models of the BERT family have achieved a variety of new Natural Language Processing (NLP) benchmarks. While their success is driven by the contextualization of words it is clear that these models do not yet have a real understanding of language (Bender and Koller, 2020). Still, researchers are struggling to find out what it is exactly that they learn and how they perform so well. Challenges are the high number of parameters over which the model knowledge is distributed, and the innumerable different patterns the models can potentially gather from text. + +BERTology takes on this quest of understanding the inner workings of these large pretrained models to drive further improvements and identify the next steps towards general AI. Though the training of ever greater models with ever more data has been criticized because of the societal costs and risks these models bring with, including bias and discrimination (Bender et al., 2021). Nevertheless, because of their high performance they are already employed in research but also industry-applications, which exacerbates the need for their explainability. + +The black box of Bidirectional Encoder Representations from Transformers (BERT) and its relatives commonly consists of 6-24 identical transformer encoder layers. Each layer comprises a multi-head-attention block followed by a fully connected block, with both being bypassed by residual connections (Vaswani et al., 2017). This stack of layers is primarily pretrained with MLM, the task of predicting a randomly masked (or replaced) word in an input text, and can afterwards be finetuned to specific tasks. Next to attention scores, layer activations are a popular choice for analysis, as they conflate the information from attention heads and skip-connections and represent the stages of the contextualization process. + +BERT layer activations are most prominently scrutinized by the so-called edge probing design, in which they are treated as the fixed input to another neural network trained on specific NLP tasks (Tenney et al., 2019). Previous research has employed this method to test them for information on word senses or grammatical properties, but this does not reveal how much the information shapes the space. + +By inverting the probing design we present a new way to analyze layer activations, specifically their prevailing patterns, complementing the existing methodology. In contrast to the regular process, we do not use them as input but as the output of + +a model. We reduce their dimensionality by clustering and principal component extraction to capture the predominating differences within a dataset. By declaring these differences as our ground truth and explaining them in a second step, we can render visible the salient patterns and groupings from 'BERT's point of view'. We chose this term to signal the shift of the perspective, from any contextual information a human might deem important to the information that actually predominates the representative space of the models. + +For different datasets we extract the layer activations of masked tokens, meaning that all analyzed tokens start out with identical representations. With this setup we can be sure that the differences we analyze are derived from context and are not caused by different pretrained embeddings. As masked language modeling continues to be a popular and successful pretraining objective, it is of particular interest which patterns are exploited when a model is determining the identity of a masked token. + +For the prediction of the representative features we train three types of probing models that receive as input a simplified version of the token context: bag-of-words, ordered part-of-speech tags and simply the position of the token in a sentence. By the disentanglement of these information types, the probing results provide indications about their importance for shaping the representative space. + +Social science shows that contrastive explanations are more relevant to humans than complete explanations (Miller, 2019), which affirms the necessity of methods that focus on the contrasts perceived by black box models. For a specific dataset of masked tokens our methodology reveals the most salient differences between their contexts. + +Contributions With our methodology we offer a new perspective on the contextual representations inside masked language models: The contrasts within a dataset from BERT's point of view. + +By its application we render visible how well syntax describes the coarse patterns of the space but further how much of this description is possible by mere simplistic positional information. + +Finally we demonstrate the danger of misinterpreting the learned patterns of the models due to the correlational nature of separated information types which may also lead to an overestimation of the models' sophistication. + +# 2 Related Work + +In the field of BERTology (see Rogers et al., 2020 for a general overview) much research has focused on three components; the self-attention mechanism, a key component of the transformer architecture that provides intuitive explanations (see e.g. Kovaleva et al., 2019, Manning et al., 2020, Clark et al., 2019), individual neurons (e.g. Luo et al., 2021) and the layer activations that are scrutinized in our work. Frequently the edge probing design (Tenney et al., 2019) has been deployed to analyze the contents of these activations, in different settings such as after finetuning (Merchant et al., 2020) and with various modifications. Amnesic probing measures what information gets used in the probing tasks by removing selected properties (e.g. part-of-speech) from the activations (Elazar et al., 2021). Similarly O'Connor and Andreas (2021) measured usable information when increasing context size and ablating features of this additional context, e.g. by shuffling. In a parameter-free approach Wu et al. (2020) analyzed the output representation of a masked token by additionally masking other tokens in its proximity to determine their impact. + +Another stream of research explores the geometrical space of layer activations. A common approach is the direct measurement of similarities, e.g. between instances of the same token and tokens of the same sentences (Ethayarajh, 2019; Peters et al., 2018) or between instances of homonyms and synonyms (Garcia, 2021). Further work analyzes the separability of predefined categories (e.g. word senses) by manifold analysis (Mamou et al., 2020), by measuring categorical cohesion with silhouette scores (Mickus et al., 2020) or a nearest-neighbor classifier (Coenen et al., 2019), or by searching for clustering solutions that correspond to the categories (Yenicelik et al., 2020). The similarities to our work are the focus on word level representations and the search for categories, though our clusters are not predefined by us but are the groupings inherent to our datasets from BERT's point of view. + +Much of the described work concerns only representations of unmasked tokens, except for e.g. Wu et al. (2020) and Mamou et al. (2020), but as masked language modeling continues to be a popular training objective the study of contextual information of masked tokens is highly relevant. + +# 3 Experimental Setup + +Because of the various components of probing classifiers and their respective interactions, the design of such is non-trivial (Belinkov, 2021). This is also true for this new, inverted type of probing process that we present here. + +# 3.1 Data + +For this analysis of salient differences between large numbers of datapoints the composition of the dataset determines what can potentially be found. Differences may be related to semantics, syntax but also to artifacts that humans are unaware of. Which of the existing distinctions shape the representations in turn depends on if and how these patterns are utilized by the studied model. + +The prevailing differences thus depend on: + +- The availability of different patterns +The frequency of available patterns +- BERT's attention to available patterns +- BERT's integration of available patterns + +The choice of data is contingent on the objective; it thus can be a specific NLP dataset to understand a model's task performance or a new dataset that we wish to interpret. For an explorative analysis of BERT's view the data can be used as is, but for an analysis of the relevance of specific patterns it is necessary to control their availability and frequency within the dataset. Patterns that are the same across all examples do not influence the feature extraction process. + +The tokens to be masked can be one or more frequent words, word senses or syntactical functions, e.g. Part-of-Speech, depending on the selected dataset and the contexts of interest. The diversity of contexts and contextual representations may differ much depending on the token, especially as contextual information not only gives clues about the word behind the mask but also about its interpretation - additional meaning that is attached to it. This is especially true for tokens that signify entities as they are subject to opinions, e.g. "person". This is also reflected by the great amount of sensible candidate words, e.g. named entities, professions or even insults, compared to a masked determinator token "the" or other stopwords. + +We selected four datasets from two sources and with different masked tokens to demonstrate the + +varying patterns that are salient in different kinds of datasets. Data collection and preprocessing steps are listed in Appendix C. + +SemCor&OMSTI noun-synsets Our first dataset stems from the combined word-sense annotated corpus (Raganato et al., 2017) of SemCor (Sense-tagged Semantic Corpus) (Miller et al., 1991) and OMSTI (One Million Sense-Tagged Instances) (Taghipour and Ng, 2015). We selected three frequent noun synsets for masking: person.n.01, manner.n.01 and line.n.16, and stratified according to synset, which resulted in a dataset of 6048 masked tokens. While these words are all nouns, they are still used in different syntactic settings. + +SemCor&OMSTI person.n.01 From the same combined, sense-annotated corpus we masked all 7702 instances of the synset person.n.01. This includes instances of the word "person" but also named entities. + +cctweets-random Our cctweets data consists of tweets about climate change activism that were collected during and after the UN Climate Change Conference in 2019. Ethical considerations of data privacy are elucidated in Appendix A. The discourse was highly polarized, containing diverging representations of the same issues, posing the question of what differences would be salient in the presence of such polarization. We masked random tokens for explorative analysis and as comparison to the cctweets-activist dataset. This dataset comprises 155952 instances. + +cctweets-activist Our last dataset consists of climate change related tweets with 132710 masked mentions of a prominent climate change activist, as this person was the center of attention of the discourse. Therefore we could extract thousands of lexically identical instances with different depictions. This dataset represents the use case of searching for semantic groupings based on interpretations from context. + +# 3.2 Feature Extraction + +For the investigation of salient differences between the masked token representations we chose k-means clustering and principal component analysis to produce both categorical and continuous features. The appropriateness of either method depends on the properties of the data and we show the results for both, for all of our datasets. + +
input typeexample tokenizationexample tensor
Bag-of-Wordswho is mask[0 1 0 0 1 0 1 0 0]
Part-of-Speech[PAD] [PAD] WP VBZ [MASK] [PAD] [PAD] [PAD] [PAD][0 0 4 6 1 0 0 0 0]
Position[PAD] [PAD] [MASK] [MASK] [MASK] [PAD] [PAD] [PAD] [PAD][0 0 1 1 1 0 0 0 0]
+ +Table 1: Input Format: Bag-of-Words, Part-of-Speech and position. + +However it is achieved the dimensionality reduction helps humans to grasp the coarse patterns of the space, which is not possible with the raw distributions of meaning over 768 dimensions (bert-base-uncased). Categorizing and aligning datapoints along a single dimension, e.g. ranking them according to some quality, are furthermore tasks that humans not only understand but perform themselves on a daily basis, which underlines the importance of representing the data accordingly. + +It has been shown that none of the layer representations of BERT are uniformly distributed with respect to direction (Ethayarajh, 2019) and it is thus important to note that the methods applied here are susceptible to this anisotropy. This does not contradict our design, as we want to describe distances as they are, also showing possible causes for anisotropy. The goal is not to tune our feature extraction methods but to understand how we may want to change the language models themselves. + +K-Means Clustering The purpose of clustering is finding distinct groups of similar contexts and it is performed directly on the raw, extracted layer representations. We chose a robust, widely-used algorithm to capture obvious clusters, namely k-means, which we ran with the default configuration of the scikit-learn library. This means 10 runs with different centroid initializations, returning the best solution. We leave the experimentation with different clustering algorithms for future work, but it should be noted that feature extraction methods should remain simple, as complex features will take away from the explainability power of the method. + +As we do not know the correct numbers of clusters we cluster for different values of $k$ (2-30) and also utilize silhouette scores to identify the optimal value, thus showing what might be a useful granularity from BERT's point of view. Silhouette scores are a measure of how similar datapoints are to points within their cluster as opposed to points of neighboring clusters (Rousseeuw, 1987). We select common values 2 and 5 to perform the probing for better comparability between settings. + +Principal Component Analysis By rotating our axes with principal component analysis (PCA) we obtain the uncorrelated dimensions along which there is the most variation. Thus they are continuous representations of the biggest divergences that are perceived by the BERT models. This is a useful, straightforward alternative to the categorization by clustering when the clusterability of the representative space is low. We choose to analyze the first two principal components with our probing method. + +# 3.3 Pretrained Models + +For the extraction of the masked representations we chose two models of the BERT family. First bert-base-uncased (Devlin et al., 2019), which is the standard sized original BERT model and second, deberta-base (He et al., 2020), a modification that has recently been a prominent name on NLP benchmark leaderboards, e.g. SuperGLUE (Wang et al., 2019). The models were retrieved from the Huggingface Transformers library (Wolf et al., 2020). + +# 3.4 Probing + +Our reversed probing methodology predicts the features we extracted from BERT representations and takes as inputs simpler features that we obtain from the texts. These inputs are chosen to provide different kinds of contextual information to our probing models. By optimizing these models we can then find out how well our coarse BERT features are described by this information. + +To find out how much co-occurrences — unordered meaning — and how much syntax shape our coarse BERT features, we disentangle these types of information from our context sentences by creating two input types. The first is a bag-of-words vector that considers all context words of a masked token, while the second input type is a part-of-speech embedding that retains the original order of the context tokens. Because a preliminary qualitative analysis of clusters showed that much of the performance of the syntax classifier may be due to the positional information it receives, we added a third position-only input type. This list of + +classifiers is not conclusive, but rather a starting point and may also be expanded depending on what additional information is available. Table 1 shows the overview of the selected information and input formats. + +For better comparability and similar optimization, we chose to build the architecture of these classifiers identically except for the input layer. While the first layer of the BOW model is fully-connected and accepts a multi-hot vocabulary vector, the POS architecture requires an actual embedding layer. Position is retained simply by centering the masked token and padding on both sides until maximum sequence length. A linear layer aggregates the information over the sequence dimension, arriving at a fixed-length syntax embedding. The position classifier functions similarly, without the additional embedding dimension. For all probing models we append one hidden and one output layer with ReLU activations in-between. + +Implementation The probing classifiers were implemented with the Huggingface Transformers Trainer Loop (Wolf et al., 2020) with AdamW optimizer (Loshchilov and Hutter, 2019) and a linear learning rate schedule. Hyperparameter search was realized with Optuna (Akiba et al., 2019) and is described in Appendix D. For the cluster prediction models the cross-entropy loss was calculated with balanced class weights and the best model was selected by Macro-F1 score, as we care equally about all identified clusters. The best models for the regression of principal components were determined by MSE-loss. + +# 4 Results + +For the investigation of prevailing differences discerned by the models, we are starting with a manual inspection of the PCA plots for bert-base-uncased in Figure 1 and deberta-base in Figure 3, observing that the contextual space for some combinations of datasets and layers exhibits quite distinct clusters. The presence of further clusters is indicated by their optimal number as determined by silhouette scores, shown in the lower right corner of the individual plots. The datapoints are colored according to positional information, here simply defined as the first character of the masked token divided by the number of characters in the sentence. From these visuals alone we can already learn that positional information greatly shapes the principal components and visible clusters. Some clusters + +are completely defined by a specific position while others are internally arranged by this feature. + +The probing results for the test datasets are shown in Figure 2 for bert-base-uncased and Figure 4 for deberta-base (evaluation results can be found in Appendix E). For almost all studied representations the Part-of-Speech models perform best or are on par to the Bag-Of-Words models. The performance gap is more distinct for the explained variance of the principal components with an 0.21 average difference in $\mathbb{R}^2$ but only 0.1 for the Macro-F1 scores of the cluster predictions. Notably, while the position models can never outperform the POS models, as they receive only the position-related subset of their contextual inputs, they achieve a large percentage of their performance for many settings, corroborating the finding of the visibly prevailing positional information. Here the performance gaps are 0.40 for $\mathbb{R}^2$ and 0.26 for the Macro-F1 scores, averaged over all studied settings, showing how much the part-of-speech tags add to the explanations. + +For some datasets the plots of BERT and deBERTa closely resemble one another, especially for the noun-synsets. Strikingly, though the data consists of three equally-sized groups of synsets, there are exactly two clusters visible in 2D. The cluster assignment plots for best values of k in Appendix F show that for some layers of BERT and deBERTa the k-means algorithm does manage to differentiate all three of the synsets. Since the probing results are similar as well, we can conclude that BERT's and DeBERTa's point of view do correspond for this dataset. Qualitative inspection found that the synsets person.n.01 and manner.n.01 adjoin while line.n.16 is spatially far removed. While positional information visibly permeates the clusters the distance between them is described almost perfectly by the POS models, thus by syntactic contextual differences. However, the almost equal performance of the BOW models shows the correlation of part-of-speech with bag-of-words patterns that can be exploited. + +For the dataset of masked person.n.01 synsets the BERT and deBERTa 2D-projections appear less alike, especially for layer 6. In this setting the POS model's performance for the regression of BERT's principal components greatly exceeds all others with $88\%$ of their variances explained. Further analysis showed that the cluster in the upper half of the plot contains only instances of masked to + +![](images/1501b13463656cf0cecf1c665710dfa87f4621386b9d302ac04108d3de012e5a.jpg) +Figure 1: BERT-base-uncased 2D Principal Components. Datapoints are colored by positional information, calculated by the first character of the masked token divided by the number of characters of the sentence. K indicates the number of clusters with the best silhouette score. Extended plot with additional layers: Appendix 5. + +![](images/5428ab313e8bab4278afce68f06dc684bd2dc03df44b22e261f842a5ee4fa70a.jpg) +Figure 2: BERT-base-uncased Probing Test Results. Reported scores are Macro-F1 for k-means prediction and $\mathbb{R}^2$ for the regression of principal components. + +kens that were followed by an apostrophe, showing that his specific syntactic pattern is perceived as significantly different. Because of the very low performance of the BOW regression model, we can be sure that this difference is indeed caused by syntax and not by co-occurrences. The diverg + +ing results for the k-means-2 model expose that the clustering algorithm found a different one than the visible grouping solution (see also plots with cluster assignments for $k = 2$ in Appendix 6). + +For both the twitter datasets of random masks and masked activist tokens the final layer of BERT + +![](images/7a01e4d2da3304dfe29a8da2dd1331ec523b673f1c57d563d2a58b77c91d29c1.jpg) +Figure 3: DeBERTa-base 2D Principal Components. Datapoints are colored by positional information, calculated by the first character of the masked token divided by the number of characters of the sentence. K indicates the number of clusters with the best silhouette score. Extended plot with additional layers: Appendix 8. + +![](images/cfa09abeb3c617ffc1d8de8d5a06746573a3727a8e3103d9db337dbb39c3d5ab.jpg) +Figure 4: DeBERTa-base Probing Test Results. Reported scores are Macro-F1 for k-means prediction and $R^2$ for the regression of principal components. + +singles out those that appeared at the end of the sentence. Qualitative investigation showed that this is the case regardless if the token was the final one or followed by a punctuation character. For DeBERTa the space of cctweets-activist is characterized by position to a greater extent than that of cctweets + +random, as evident from the visuals and the performances of the position models. The numbers of clusters as suggested by silhouette scores are much higher for the random masks. While the BERT and DeBERTa perspectives on the dataset with equally sized groups of synsets seem quite identical, the + +cases of one synset or random masks reveal rather different perceived contextual differences. + +# 5 Discussion & Conclusion + +In contrast to much recent BERTology work of predicting specific syntactic and semantic information from layer activations, we invert the probing design to instead predict features of the representative space itself. From masked token representations we extract clusters and principal components of contextual information and explore their nature by probing models that receive as input detached types of information. We thus paint a picture of the dissimilarities and groupings within a dataset from BERT's point of view, thereby expanding existing probing methodology by a crucial perspective. + +Our analysis shows that the representative space of contextual information does exhibit clusters. Most clusters and principal components of our datasets are best described by the Part-of-Speech models, however, for many settings the positional probing models can achieve $50\%$ or more of the POS performance. This shows how the representative space of both BERT and DeBERTa is greatly shaped by the most simple positional information, even though these models handle positional embeddings differently. As demonstrated by Geirhos et al. (2020), neural networks are prone to shortcut learning, and thus position may be one such shortcut. On the other hand, for the standard BERT it was shown that the representative space is anisotropic due to outlier neurons capturing positional information, which was attributed to Layer Normalization (Luo et al., 2021). + +The usual probing classifier architecture that receives representations as input and predicts a specified linguistic property cannot clarify, if the representations are actually informed by the linguistic property of interest or by other, correlating properties of the training data (Belinkov, 2021). In our analysis the for some cases equal performance of detangled semantics (Bag-of-Words) and syntax (ordered Part-of-Speech tags) shows as well their correlational nature and the difficulty of pinpointing which features are actually utilized by large masked language models. When simplistic and meaningful features correlate this provides the danger of assuming that the models are much more sophisticated than they actually are. + +We do not attempt to answer the question of what information should predominate the represent- + +tational space, but it is likely that the optimum is not reached with features as simple as the position of a token in a sentence. We expect the best solutions to be defined by more sophisticated features that are not obtainable with simple string analysis, and which might even be utilizable for data analysis and hence other fields of research. + +Concluding, our methodology delivers clues about the shortcomings of language models and the shortcuts that they are exploiting, to highlight directions of further adjustments of training objectives and processes in the future. + +We hope that this work inspires more researchers to look at the world from BERT's point of view, to understand how it differs from ours. By recognizing the nature of their current primitivity we can generate new ideas on how to improve these large language models, gradually moving in the direction of a more general AI. + +Limitations The prevailing contextual patterns that are revealed by this method are not universal but are always contingent on the analyzed datasets. Accordingly these have to be chosen and controlled depending on the research objective. + +For the extraction of categories by clustering, selecting the appropriate number of clusters is nontrivial. Here the number of clusters was set to equal numbers to allow for a comparison between datasets and layers, but these may not reflect the inherent number of groupings. + +Lastly this method, as with any method that analyzes individual parts of a network in isolation, does not explain how the identified prevailing information is utilized during task performance. + +Future Work A promising extension of this work will be to enlarge the set of probing models to even better partition the different types of information, to better understand their contributions. Examples of further relevant input types are a windowed Bag-of-Words or Bag-of-Words filtered by word types. Furthermore it would be highly interesting to compare the POS model to other embedding models (e.g. simply word embeddings) with identical structures. + +The settings that may be analyzed by this method are various, such as the finetuning process, to explore how the prevailing patterns shift when models adapt to particular tasks. A comparison between models of different languages may reveal different focuses and varying correlations of information + +types. + +The described method is applicable also for the analysis of unmasked tokens though then the process of contextualization will differ from the very first layer depending on the token. The masked and unmasked contextualizations are moreover shaped by different objectives, predicting masked tokens and predicting potentially perturbed tokens, which may result in attention to different contextual patterns. + +Finally it may be fruitful to utilize gradient-based attribution methods to pinpoint not just the relevance of input types but the relevance of specific inputs and positions from BERT's point of view. + +# Acknowledgements + +This work was supported by the Heinrich Böll Foundation through a doctoral scholarship. We would like to thank the anonymous reviewers for their valuable feedback. + +# References + +Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. 2019. Optuna: A Next-generation Hyperparameter Optimization Framework. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pages 2623-2631. +Yonatan Belinkov. 2021. Probing classifiers: Promises, shortcomings, and alternatives. arXiv preprint arXiv:2102.12452. +Emily M. Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. 2021. On the Dangers of Stochastic Parrots: Can Language Models Be Too Big? In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, pages 610-623. Association for Computing Machinery. +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. +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, Florence, Italy. Association for Computational Linguistics. + +Andy Coenen, Emily Reif, Ann Yuan, Been Kim, Adam Pearce, Fernanda Viégas, and Martin Wattenberg. 2019. Visualizing and Measuring the Geometry of BERT. In Advances in Neural Information Processing Systems, volume 32, pages 8594-8603. +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. +Yanai Elazar, Shauli Ravfogel, Alon Jacovi, and Yoav Goldberg. 2021. Amnesic Probing: Behavioral Explanation with Amnesic Counterfactuals. In Transactions of the Association for Computational Linguistics, volume 9, pages 160-175. +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. +Marcos Garcia. 2021. Exploring the representation of word meanings in context: A case study on homonymy and synonymy. 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 3625-3640, Online. Association for Computational Linguistics. +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. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2020. DeBERTa: Decoding-enhanced BERT with Disentangled Attention. arXiv:2006.03654 [cs]. +Olga Kovaleva, Alexey Romanov, Anna Rogers, and Anna Rumshisky. 2019. Revealing the dark secrets of BERT. 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 4365-4374, Hong Kong, China. Association for Computational Linguistics. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled Weight Decay Regularization. In International Conference on Learning Representations. + +Ziyang Luo, Artur Kulmizev, and Xiaoxi Mao. 2021. Positional artefacts propagate through masked language model embeddings. 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 5312-5327, Online. Association for Computational Linguistics. +Jonathan Mamou, Hang Le, Miguel Del Rio, Cory Stephenson, Hanlin Tang, Yoon Kim, and SueYeon Chung. 2020. Emergence of Separable Manifolds in Deep Language Representations. In International Conference on Machine Learning, pages 6713-6723. +Christopher D. Manning, Kevin Clark, John Hewitt, Urvashi Khandelwal, and Omer Levy. 2020. Emergent linguistic structure in artificial neural networks trained by self-supervision. Proceedings of the National Academy of Sciences, 117(48):30046-30054. +Amil Merchant, Elahe Rahimtoroghi, Ellie Pavlick, and Ian Tenney. 2020. What happens to BERT embeddings during fine-tuning? In Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 33-44, Online. Association for Computational Linguistics. +Timothee Mickus, Denis Paperno, Mathieu Constant, and Kees van Deemter. 2020. What do you mean, BERT? In Proceedings of the Society for Computation in Linguistics 2020, pages 279-290, New York, New York. Association for Computational Linguistics. +George Miller, R. Beckwith, Christiane Fellbaum, Derek Gross, and Katherine Miller. 1991. Introduction to WordNet: An On-line Lexical Database*. International journal of lexicography, 3(4):235-244. +Tim Miller. 2019. Explanation in artificial intelligence: Insights from the social sciences. Artificial intelligence, 267:1-38. +Joe O'Connor and Jacob Andreas. 2021. What context features can transformer language models use? 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 851-864, Online. Association for Computational Linguistics. +Matthew E. Peters, Mark Neumann, Luke Zettlemoyer, and Wen-tau Yih. 2018. Dissecting contextual word embeddings: Architecture and representation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1499-1509, Brussels, Belgium. Association for Computational Linguistics. +Alessandro Raganato, Jose Camacho-Collados, and Roberto Navigli. 2017. Word sense disambiguation: A unified evaluation framework and empirical comparison. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages + +99-110, Valencia, Spain. Association for Computational Linguistics. +Anna Rogers, Olga Kovaleva, and Anna Rumshisky. 2020. A primer in BERTology: What we know about how BERT works. Transactions of the Association for Computational Linguistics, 8:842-866. +Peter J. Rousseeuw. 1987. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of computational and applied mathematics, 20:53-65. +Kaveh Taghipour and Hwee Tou Ng. 2015. One million sense-tagged instances for word sense disambiguation and induction. In Proceedings of the Nineteenth Conference on Computational Natural Language Learning, pages 338-344, Beijing, China. Association for Computational Linguistics. +Ian Tenney, Patrick Xia, Berlin Chen, Alex Wang, Adam Poliak, R. Thomas McCoy, Najoung Kim, Benjamin Van Durme, Samuel R. Bowman, Dipanjan Das, and Ellie Pavlick. 2019. What do you learn from context? probing for sentence structure in contextualized word representations. In International Conference on Learning Representations. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Proceedings of the Conference on Neural Information Processing Systems (NeurIPS 2017). +Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systems. Advances in Neural Information Processing Systems, 32. ArXiv: 1905.00537. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric 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. +Zhiyong Wu, Yun Chen, Ben Kao, and Qun Liu. 2020. Perturbed masking: Parameter-free probing for analyzing and interpreting BERT. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4166-4176, Online. Association for Computational Linguistics. +David Yenicelik, Florian Schmidt, and Yannic Kilcher. 2020. How does BERT capture semantics? a closer look at polysemous words. In Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 156-162, Online. Association for Computational Linguistics. + +# A Ethical Considerations + +This work utilizes public discussions by private individuals on Twitter. The tweets were collected with the Twitter streaming API and all information of the tweeting users, including user names and ids, was discarded. However, sensitive information is also found within the analyzed texts, none of which are made public. The tweets are stored with restricted access and will be deleted upon research conclusion. Afterwards only the tweet ids will be available, which can be hydrated through the Twitter API only for tweets that still are public. + +# B Computing Infrastructure & Runtimes + +A Nvidia GeForce RTX 2080 Ti graphics card was used for the training and evaluation of the probing models. The hyperparameter search with 50 runs lasted 28 minutes on average and the final models were optimized with an average of 6 minutes training time. + +# C Data Collection & Preprocessing + +The unified sense-tagged corpus of SemCor and OMSTI was obtained from http://lcl.uniromal.it/wsdeval/training-data (Raganato et al., 2017). + +The Part-of-Speech tags for the POS probing models were obtained by the nltk python package. Specialized taggers for Twitter data are available but were not deemed necessary as most of the twitter-specific artefacts were removed during preprocessing. + +For probing the datasets were split randomly into training, evaluation and test sets by the ratio 70:15:15. + +Twitter datasets Tweets were collected through the Twitter Streaming API with keywords related to climate change and activism. The timeframe of collection was during and after the United Nations Climate Change Conference in 2019 (COP25): 2.-19.12.2019 As per Twitter policy only the ids of tweets are made available, which can be rehydrated with the Twitter API. + +- Filters: + +- only English tweets +- no replies +- at least three words +- only sentences / sentence-like phrases + +- duplicates removed + +- Preprocessing: + +- removing URLs +- removing hashtag and mention sequences if $n > 1$ +- pruning repeating characters and words if $n > 3$ +- random masking /masking first token that matches activist pattern +- obtaining sentences / sentence-like phrases containing the mask token + +# D Hyperparameter Search + +Hyperparameter search was performed for a sample of the analyzed probing settings: For each combination of the 4 datasets, 3 input types (bag-of-words, part-of-speech and position) and 2 output types (k-means, principal component), 3 settings were sampled and hyperparameter search was conducted with Optuna for 50 runs. The search results were then pooled for each combination. + +The search space and pooling strategy are shown in Table 2. Preliminary experiments had shown that one hidden layer was a generally good choice for network depth, but network width was included as a search parameter. The determined values for the hyperparameters stayed within the search boundaries, except for two cases where n Hidden was equal to the maximum value. Thus additional trials were run to find out if representational capacity had to be increased further with the maximum value found to be 2060. + +
hyperparametersearch spacepooling
hidden_layer_size128 - 2048max
batch_size8 - 64mean
learning_rate1e-5 - 1e-1mean
n_steps5000 - 50000max + 5000
+ +Table 2: Hyperparameter Search Space and Pooling Strategy. + +For batch_size and learning_rate the values were aggregated by averaging, but to ensure a sufficient capacity of the network layer_size was set to the maximum. The number of training steps was set to the maximum plus additional 5000 steps to ascertain sufficient training for any configuration. As the best checkpoint is selected for testing, this does not hurt the performance of faster converging models. + +
datasetinput_typeoutput_typen Hiddenbatch_sizelearning_ratemax_steps
cctweets-activistBOWkmeans1882140.0007553988
cctweets-activistBOWpc1617330.0007631841
cctweets-activistpos.kmeans2060110.0002645684
cctweets-activistpos.pc1715340.0005736678
cctweets-activistPOSkmeans1654300.0031738124
cctweets-activistPOSpc1970470.0024724824
cctweets-randomBOWkmeans1308260.0007937955
cctweets-randomBOWpc1721230.0011248627
cctweets-randompos.kmeans1187120.0003547055
cctweets-randompos.pc1674470.0004154746
cctweets-randomPOSkmeans1482250.0041247735
cctweets-randomPOSpc2048480.0025238101
S&O noun-synsetsBOWkmeans1726215e-0514053
S&O noun-synsetsBOWpc698160.0271726494
S&O noun-synsetspos.kmeans1098110.0002934690
S&O noun-synsetspos.pc597100.0033215622
S&O noun-synsetsPOSkmeans736170.0402345072
S&O noun-synsetsPOSpc299240.0094713580
S&O person.n.01BOWkmeans1983210.0002232521
S&O person.n.01BOWpc518290.0078640901
S&O person.n.01pos.kmeans945200.0022237165
S&O person.n.01pos.pc1047190.0022917568
S&O person.n.01POSkmeans923180.0010224021
S&O person.n.01POSpc1075190.0293418444
+ +Table 3: Hyperparameter Settings. + +The resulting hyperparameter settings are listed in Table 3. + +E Extended Results + +F Extended Plots + +
noun-synsetsperson.n.01cctweets-randomcctweets-activist
k2k5pc1pc2k2k5pc1pc2k2k5pc1pc2k2k5pc1pc2
BOW eval0.960.690.840.590.70.520.190.20.640.370.110.190.830.570.560.45
BOW test0.950.690.860.620.70.510.150.080.630.370.10.190.830.560.580.43
POS eval0.980.830.930.850.920.90.890.90.880.690.690.670.90.740.880.56
POS test0.980.840.950.870.910.880.880.890.870.680.680.670.90.730.880.55
pos. eval0.620.440.170.450.730.480.540.030.610.410.340.410.690.430.60.16
pos. test0.610.410.180.470.690.470.480.040.610.40.350.40.690.430.60.15
+ +Table 4: BERT-base-uncased Layer 6 Probing Evaluation and Test Results. + +
noun-synsetsperson.n.01cctweets-randomcctweets-activist
k2k5pc1pc2k2k5pc1pc2k2k5pc1pc2k2k5pc1pc2
BOW eval0.960.770.870.680.750.590.610.540.580.480.120.640.760.620.450.21
BOW test0.960.830.880.660.70.590.540.550.580.480.130.660.760.590.450.19
POS eval0.980.810.90.740.810.60.660.360.770.590.370.530.740.60.440.28
POS test0.980.80.930.780.80.580.660.360.760.580.350.540.740.590.440.25
pos. eval0.630.370.160.290.660.380.320.140.730.350.260.070.60.40.190.14
pos. test0.610.380.170.320.640.360.290.170.710.340.230.070.60.390.180.13
+ +Table 5: BERT-base-uncased Layer 12 Probing Evaluation and Test Results. + +
noun-synsetsperson.n.01cctweets-randomcctweets-activist
k2k5pc1pc2k2k5pc1pc2k2k5pc1pc2k2k5pc1pc2
BOW eval0.960.780.860.630.670.490.290.430.730.50.430.150.80.570.570.53
BOW test0.950.820.870.640.660.460.210.450.720.50.440.160.80.560.560.53
POS eval0.980.820.910.820.90.810.820.70.80.630.590.680.860.680.660.81
POS test0.990.80.930.830.880.790.830.70.80.630.580.680.860.680.670.81
pos. eval0.630.370.180.370.80.490.610.240.730.390.360.350.780.510.420.64
pos. test0.620.360.20.380.760.470.580.250.730.380.350.350.790.520.430.65
+ +Table 6: DeBERTa-base Layer 6 Probing Evaluation and Test Results. + +
noun-synsetsperson.n.01cctweets-randomcctweets-activist
k2k5pc1pc2k2k5pc1pc2k2k5pc1pc2k2k5pc1pc2
BOW eval0.960.810.880.680.910.570.620.40.650.480.470.190.80.690.620.65
BOW test0.950.820.890.680.880.550.550.390.650.480.460.190.80.680.620.66
POS eval0.980.810.910.760.880.760.680.690.780.630.470.540.860.710.650.75
POS test0.980.790.920.780.850.730.70.70.770.620.470.520.860.710.650.75
pos. eval0.630.370.180.260.670.520.330.170.590.330.10.110.770.450.40.47
pos. test0.620.360.20.280.620.490.290.20.590.320.10.110.770.450.410.48
+ +Table 7: DeBERTa-base Layer 12 Probing Evaluation and Test Results. + +![](images/e72db71cc0ca4efe63534aa28bd631ad54d88c1d98db2ce2659f90e22b3d1742.jpg) +Figure 5: BERT-base-uncased 2D Principal Components. Datapoints are colored by positional information, calculated by the first character of the masked token divided by the number of characters of the sentence. K indicates the number of clusters with the best silhouette score. + +![](images/fee9f60e9e300c9e14c0a3784fd7f60dfcd9a9036b618f59e84a257b7a8e1f61.jpg) + +![](images/ff562171db7304e54efe26dee0ced4eb1627836ec1f954c571d1a60a3332c2ef.jpg) + +![](images/6170508b4f241a86a2657b9af339994fa2e86a61acfe2a467fb2ade14c742f98.jpg) + +![](images/70b365a0e6c4ba1bcbbca84c28802143e03df132e621cf63b4181620ad9da072.jpg) + +![](images/19d1e0ed2257574215339b6f18ac13d25f8b3e6390e8e3578ef4b0b10eac37d5.jpg) + +![](images/8598beb652c4cc3ce7dc6c4b7c58fdc04badba7699e079f264aad629aa13841e.jpg) + +![](images/ed64f77c88725f57ca05b2ea340afdeaf6e888d7279a57f5569e37d533703dda.jpg) + +![](images/42396e20459fc35e6da138e8438f195343fba89df3892dbc8948ae7b4ca29bc1.jpg) + +![](images/bdc22345b023c799eb64bb902ac950eb76b0e04481f99f276d1cc8a829b41128.jpg) +Figure 6: BERT-base-uncased 2D Principal Components and Cluster Assignments for $k = 2$ . K (lower right corners) indicates the number of clusters with the best silhouette score. + +![](images/206da49e46cefbb45936c7433c7056235cc270fd1272e03b370f1b2b181e7083.jpg) + +![](images/6de6fa802be8294b8a785ff5bd7fa2df4eb86384c42b5c6dc2547f48de8a039a.jpg) + +![](images/31bc067a127f36fa5d5da17288712b5f5219825bed246fe02773c1b90bf70c1a.jpg) + +![](images/f72acd27523b30098d9e0f08f483e6dcff53b820e890e58779b62d7a0a634285.jpg) + +![](images/e1e2e604feb46b6846de6b9d30b9923748bc815a83ecdae8fd15bf9b9b9e18e9.jpg) + +![](images/07b78f770a598ed9ae4ed1d0b5ade7b8cc42d39b718f0eb8a2b784b724498866.jpg) + +![](images/79d81dc416ef0d0e7a70f8daf46784132422c78fa67e1ff77309057f58a1c2a3.jpg) + +![](images/44fb3c73986b969ec3202051a84631ba4932924b1e82b929b946cd0c2d7490b0.jpg) + +![](images/33e6e77132751438f061ea5f4b13f8f77e604f79cb968279179e641996669e7e.jpg) + +![](images/c7a2286b5f6932ea509a0ce58f2df6f7df8718a47319769526043357634064bc.jpg) +Figure 7: BERT-base-uncased 2D Principal Components and Cluster Assignments for best Values of K as determined by Silhouette Scores. + +![](images/4a73b5d37e6e1b89a6c6f383c654b9bd80d90770b5f9e5f11bd8a770be594510.jpg) + +![](images/2d337684bf339c346478371752395b686dd0c74f59318813c5c813b0c0bda0ba.jpg) +Figure 8: DeBERTa-base 2D Principal Components. Datapoints are colored by positional information, calculated by the first character of the masked token divided by the number of characters of the sentence. K indicates the number of clusters with the best silhouette score. + +![](images/bd669f8ec96433fa882659a2f407e2d01c0af2e31fd5092d482015675351c5a0.jpg) + +![](images/9cf5b97d7a1e927c1a760e7ba467e3e2d47381abb28fddf3f9d302e8a4fa7683.jpg) + +![](images/223427823ef63ad0618ab423be20e41e94b613ed671c8b7f3dbcf035df12b952.jpg) + +![](images/fadb6f6d1d7c3117c7be72665a857f347c45f0286d87f89000e9899c317c26de.jpg) + +![](images/a8c92ca06725e9326b3b58c00027aea1f23cd70d50046848435cf2a8d6b978e0.jpg) + +![](images/fb2b64f9ad8a831d46fd906b47a8e585e0ce0eb82d6064c1daa7646ce461ca42.jpg) + +![](images/5898e6e553310b80a88f51dcc086a1cb560d15e6100f27a976e77ece702544eb.jpg) + +![](images/ef8ec9f1a2757090029d9b5f18b08567afa9a5f190896e2f5f6c95b29f491212.jpg) + +![](images/f935f8f44e5ce6330039cae214828e42e45fc7daf85c3ce06acc1e2338d16b9b.jpg) + +![](images/9e5bc810a26498a5e543a58bec5de1c69db0265eaaf1b31007b73c2342cf2ca6.jpg) + +![](images/a2356af71ae73baa5591c0fd5e9123caaccdd3f7d97bef8943eb5c8d8635a4ef.jpg) + +![](images/7faae49d7e6d8ffc7381cd04b3b82cbdd288d1058af9c9a8a9841ed1e558e50b.jpg) + +![](images/f18d3b32d41dbd393a0e85895862a68835d300b53d114eb4f7e0ab32968cb286.jpg) + +![](images/760563fd638e01f85b9915362b5a5339ae6f46d46f156fde0400a21c8ba9ca3c.jpg) + +![](images/96fc44bd85fe4c0b9d403e48fc258380977a44f05001d21c03548173220eace2.jpg) + +![](images/e5ad56fa92635814aad8ba134dbe9910ed8e4a10dcf802021c45679a16977078.jpg) + +![](images/e6491d5514fb51d793546d6d7e2fb1deb0c1995e65170a11ce71f9bd3469c1fc.jpg) +Figure 9: DeBERTa-base 2D Principal Components and Cluster Assignments for $k = 2$ . K (lower right corners) indicates the number of clusters with the best silhouette score. + +![](images/153aee96c61e6eedcae9205ffd272466f8ac990835ddf5e5a9fb11b0bbdca453.jpg) + +![](images/581628a7201cd7ab032ae687990c30ffd91a620dd2ee422b6fd25a464cd76d48.jpg) + +![](images/f0d635b149cf258a5fe43c8be149a1433eeb6ea09812aee8c93ac00d0c522ede.jpg) + +![](images/9035431b165efe46d0f4469aaf66bb15e7009f2475f17b85435e65284ac71a98.jpg) + +![](images/708110f95f39cce04d057009a53a86d7236f2b929f63944a3ee6aadbaae00901.jpg) + +![](images/b0cfc2380a920d599197e04dac7081c04714097009f2d96536897805552fe15f.jpg) + +![](images/d6ea9da33c02247c9e12b5d67e6a6f7392be030a940e3f828e64fc51361a60c5.jpg) + +![](images/62bc6f2b968c50cc19efdefa837929dc611c2832fa17645fb8f912ff9f1d0475.jpg) + +![](images/bba3623c0847c415400824a5532f946fcbafd4f842c033b074020d8d25add35e.jpg) + +![](images/0e471d4ed24fb6570562b29a0bd638c962603253e12d179587d3c03f235b8d1e.jpg) + +![](images/65dc8cffd094a0e99aed226a3e0cdf69a19b2218b5750018a0135d0ecbda1ae9.jpg) + +![](images/d6aba1672ec56e57b1a14976b4ad398617e8218c4a2150c0663fffbf0cecec4f.jpg) + +![](images/4505808c78964f12d182fb638ae6df809e92e85ce7ecf95e3918975e0264d2f3.jpg) + +![](images/b974c21eef7ea56deb164001c7cfa19600d9d47e307761b665e6461422929b2b.jpg) + +![](images/e1c20081e7d5b48ce38eb19e703bc15533cbb155f7383734b965f3b6a8bcf64d.jpg) + +![](images/bf1a706b6f7d6e155e18740d048006760528c76eeaa14c6085ebc94c6c435369.jpg) + +![](images/30daaab907b998806c0dc697c524fcad8600500eb41b357e342a6c7a1ba83c75.jpg) + +![](images/7f8b9447ba76b338b29337dfed833b5b5b34db61bc1e0cc92f7bc9fc61ac82e5.jpg) + +![](images/a1ae5f146d2463aa10f90461cb76dc8b3e263522c093f2622b7e994155c10664.jpg) + +![](images/0e1dfee2173133ac4fe46eb4e32594307fa8815a820544e6ff8f4f1a51302a30.jpg) +Figure 10: DeBERTa-base-uncased 2D Principal Components and Cluster Assignments for best Values of K as determined by Silhouette Scores. + +![](images/91e87196a469ba3dacab4422fe9d3f77847e56a1a20ba2959724a5f8d9f9bb6a.jpg) + +![](images/ef9c05dcae9d3bda43d0875528c112447a5f7f7d4b750215a3a9beebb1e34e10.jpg) + +![](images/f88f6a868c26381b5d7a2655824b85c8a68520cadd222f2e2ae02a6477bd98fa.jpg) \ No newline at end of file diff --git a/frombertspointofviewrevealingtheprevailingcontextualdifferences/images.zip b/frombertspointofviewrevealingtheprevailingcontextualdifferences/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..15f531e55bd0c5fe00fbfd434b025cd0cc52b0fd --- /dev/null +++ b/frombertspointofviewrevealingtheprevailingcontextualdifferences/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33f7f158bed7d1ad5e238e353f32bf31a1eb4d9704a1e6ad40c4846e82784c56 +size 1719294 diff --git a/frombertspointofviewrevealingtheprevailingcontextualdifferences/layout.json b/frombertspointofviewrevealingtheprevailingcontextualdifferences/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c5d6365a38c74aa31bddb05fb338501b2e86967f --- /dev/null +++ b/frombertspointofviewrevealingtheprevailingcontextualdifferences/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c219900c3836b8a3ead0e1c3b01932e915cc60c18f90bbdec4312513b34eeade +size 428843 diff --git a/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_content_list.json b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..44e702263e6647661d6391720b4c8cf5adce8e19 --- /dev/null +++ b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3397a3cc79ef83188ce0bc5e18c3e44ab97c11371bdc4ae8d957bc8264a000d0 +size 99747 diff --git a/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_model.json b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dfa033069a3c80e6a64b08366c251cc8038df657 --- /dev/null +++ b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e482836b436562dc93970a98024bbdece807a67f4122a683d7bfbe8ae1379930 +size 122142 diff --git a/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_origin.pdf b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a6b777e59ba87f025216f91179b13019ba93fed7 --- /dev/null +++ b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/82b962b3-2187-405f-aef3-bc258b002457_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eedd991e8d8c6016c360b131b1eb73e9015c3157c017fc63f2c094941401acc9 +size 331076 diff --git a/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/full.md b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/full.md new file mode 100644 index 0000000000000000000000000000000000000000..406c5cd719842e7b0c94b963b1db048f25a70e39 --- /dev/null +++ b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/full.md @@ -0,0 +1,388 @@ +# From Stance to Concern: Adaptation of Propositional Analysis to New Tasks and Domains + +Brodie Mather and Bonnie Dorr and Adam Dalton and William de Beaumont Institute for Human & Machine Cognition + +Owen Rambow + +Stony Brook University + +Sonja Schmer-Galunder + +Smart Information Flow Technologies + +# Abstract + +We present a generalized paradigm for adaptation of propositional analysis (predicateargument pairs) to new tasks and domains. We leverage an analogy between stances (belief-driven sentiment) and concerns (topical issues with moral dimensions/endorsements) to produce an explanatory representation. A key contribution is the combination of semi-automatic resource building for extraction of domain-dependent concern types (with 2-4 hours of human labor per domain) and an entirely automatic procedure for extraction of domain-independent moral dimensions and endorsement values. Prudent (automatic) selection of terms from propositional structures for lexical expansion (via semantic similarity) produces new moral dimension lexicons at three levels of granularity beyond a strong baseline lexicon. We develop a ground truth (GT) based on expert annotators and compare our concern detection output to GT, to yield $231\%$ improvement in recall over baseline, with only a $10\%$ loss in precision. F1 yields $66\%$ improvement over baseline and $97.8\%$ of human performance. Our lexically based approach yields large savings over approaches that employ costly human labor and model building. We provide to the community a newly expanded moral dimension/value lexicon, annotation guidelines, and GT. + +# 1 Introduction + +This paper presents a generalized paradigm for adaptation of tasks involving predicate-argument pairs, i.e., combinations of actions and their participants, to new tasks and domains. Predicate-argument analysis has been a longstanding area of research for many tasks: event detection (Du and Cardie, 2020; Zhang et al., 2020), opinion extraction (Yang and Cardie, 2013), textual entailment (Stern and Dagan, 2014), and coreference (Shibata and Kurohashi, 2018). We refer to the induction of such representations as propositional analysis. We induce a proposition $\mathrm{PREDICATE}(\mathrm{x}_1,\mathrm{x}_2,\dots)$ to + +represent sentences such as John wears a mask: wear(John,mask). We pivot off this explanatory representation to answer questions such as What is John's stance towards mask wearing? or What concerns does John have about mask wearing? + +Stance detection has recently (re-)emerged as a very active research area, yet many approaches generally equate stance to raw (bag-of-word) sentiment and often employ machine-learning based models requiring large amounts of (labeled or unlabeled) training data. Within such approaches, the notion of stance varies, but generally falls into one of a handful of "sentiment-like" categories for stance holder X regarding topic Y, i.e., X agrees/disagrees with Y (Umer et al., 2020), X favors/disfavors Y (Krejzl et al., 2017), X is pro/anti Y (Samih and Darwish, 2021), X has a positive/negative opinion about Y (AlDayel and Magdy, 2021), or X is in favor/against/neither Y (Küçük and Can, 2020). + +We adopt the stance definition of Mather et al. (2021), originally formulated for Covid-19. There, a stance is a belief-driven sentiment, derived via propositional analysis (i.e., I believe masks do not help [and if that belief were true, I would be anti-mask]), instead of a bag-of-words lexical matching or embedding approach that produces a basic pro/anti label. This variant of stance detection uses a proposition to identify a domain-relevant belief in the Covid-19 domain; the belief is leveraged to compute a belief-driven sentiment and attitude toward a topic in that domain (e.g., masks). For example, I believe masks do not protect me is rendered as a belief type PROTECT with an underlying proposition protect(masks) and a negative overall stance toward the propositional content: masks. + +We implement and evaluate an analogous propositional framework for a new task, concern detection. Table 1 shows stance and concern detection output on a tweet from an English subset of a Kaggle Twitter dataset (1.9M tweets) for a new domain, the 2017 French Elections (Daignan, 2017). The + +proposition common to both is ruin(jean-luc me- lenchon, economy). For stance, a belief type, DEsTROY, is coupled with values: (1) Belief strength ranges from certainty that the belief is not true (- 3) to certainty that the belief is true $(+3)$ ,with 0 as "uncommitted"; and (2) Belief-driven sentiment strength ranges from extremely negative (-1) to extremely positive $(+1)$ ,with 0 as "neutral". + +We define a concern to be a topical type (e.g., ECONOMIC) coupled with a set of values: (1) moral dimensions from Moral Foundations Theory (MFT) (Haidt and Joseph, 2004; Graham et al., 2009, 2011, 2012), represented as vice/virtue pairings (authority/subversion, care/harm, fairness/cheating, loyalty/betrayal, and purity/degradation); and (2) corresponding endorsement values, where "vice" is between 1 to 5 and "virtue" is $>5$ to 9 (1 is strong vice and 9 is strong virtue). Dimensions and endorsements shown in Table 1 are derived from a state-of-the-art baseline (Moral 1), see §3. + +Propositional representation is the centerpiece of both stance detection and concern detection, distinguishing our lexical-based approach from model-based approaches trained on word-level annotations. Predicate-argument structure captures relationships between multi-word constituents that need not be contiguous, thus inducing explainability. That is, Jean-Luc Melenchon is not adjacent to economy, yet these terms are crucially related via the intermediate term ruin. This enables answers to questions such as What does the author believe Jean-Luc Melenchon did to the economy? + +Moreover, domain adaptation is streamlined through predicate-argument annotation, reducing effort needed for human annotation. Annotation at the level of predicate-argument pairs factors out commonalities, reducing redundancy in the resource building process. During resource building each verb is visited only once rather than the multiple times required for word-level corpora annotation (see §3). For example, annotation of the word lead is done all in one shot with a handful of automatically presented de-duplicated cases, whereas corpus-based annotation requires repeated annotations of lead, substantially increasing human labor. + +We demonstrate that the key to reduced adaptation time is the coupling of semi-automatic resource building for concern types with automated expansion of domain-independent concern values using semantic similarity. We develop a ground truth (GT) based on expert annotators and compare + +
Stance Proposition: +ruin(jean-luc melenchon, economy)
Belief Type +DESTROYBelief/Sent Values +belief strength: 2.5, +sentiment strength: -1
Concern Proposition: +ruin(jean-luc melenchon, economy)
Concern Type +ECONOMICMoral Dims/Values +care: 1.4, purity: 2.75
+ +Table 1: Representative Stance and Concern system output for a given tweet in the 2017 French Election Domain: Marine Le Pen LEADS in French poll as far left Jean-Luc Melenchon 'could ruin economy'. Belief ranges from -3 to 3, sentiment from -1 to 1, and the moral dimensions from 1 to 9. + +concern detection output to GT. We also demonstrate that, with each lexicon expansion, the performance of concern detection improves significantly over a state-of-the-art baseline moral dimension lexicon. We obtain a $231\%$ improvement in recall over a strong baseline for our best performing system, with only a $10\%$ loss in precision. + +# 2 Background and Motivation + +This section provides background and motivation for task and domain adaptability applied to concern detection in the 2017 French Election domain (§2.1, §2.2), including concern values induced from Moral Foundations Theory (MFT) (§2.3). + +# 2.1 Task and Domain Adaptability + +Task adaptability and domain adaptability are two supporting areas of research for this work. Prior domain adaptation approaches, surveyed by Ramponi and Plank (2020), have been applied to tasks such as sentiment analysis (Ben-David et al., 2020; Ghosal et al., 2020), stance detection (Xu et al., 2019), and event trigger identification (Naik and Rose, 2020). Task adaptation approaches (Gururangan et al., 2020; Garg et al., 2020; Ziser and Reichart, 2019) have been applied to tasks such as answer selection for question answering. + +To date, both types of adaptation rely heavily on machine learning (ML) techniques, many of which require a large amount (e.g., 1M+, Gururangan et al. (2020)) of training data (whether labelled or not). Some approaches employ smaller datasets, e.g., 10K+ Amazon reviews, fake news articles (Ben-David et al., 2020; Xu et al., 2019). Additionally, while explainability has recently been brought to + +the fore in deep learning approaches, as surveyed by Xie et al. (2020), such systems have not focused on task and domain adaptability. + +We develop a general framework for resource building techniques that features task adaptability and retains the ability to adapt quickly to new domains. Our dataset requirements are much more minimal than prior approaches (2500 tweets per domain), there is no human labeling of corpora, and no model training is required. Moreover, explainability is achieved by virtue of inclusion of propositional information (who did what to whom) that serves as a window into the process of detecting concern types and moral dimensions. + +# 2.2 Stance and Concerns + +Pirolli et al. (2021) apply a belief-based formulation of stance in the Covid-19 domain, with topics such as mask wearing and social distancing. For example, a stance assigned to Wear a mask! includes a PROTECT belief type, where the predicate wear is considered a "trigger" and a mask is considered the "content" of the belief. The values associated with this stance include a belief strength of +3 and a sentiment strength of +1. The final stance is thus a belief-oriented sentiment with this interpretation: the person posting the tweet is positive toward "masks," assuming the belief that masks are protective is true. In the 2017 French Election domain, a stance representation (e.g., for the example in Table 1) would be: . + +While this prior framework lays the groundwork for domain adaptability, it has not been shown to be generalizable to new tasks (within or across domains), which is the focus of this paper. We leverage the propositional underpinnings of the framework of Mather et al. (2021) to enable a straightforward adaptation from stance detection to a new task, concern detection, while also retaining domain adaptability. This task involves extraction of a concern type (e.g., immigration, taxation) associated with a given domain (e.g., 2017 French Elections), analogous to the extraction of a belief type for a given stance detection domain. + +In this paper, we demonstrate that it is straightforward to port belief-targeted stance both to a new domain (French elections) and, through an analogous proposition-based extraction, to a new task: Concern detection. An example of a formal Concern representation in the 2017 French Elec + +tion domain for the example in Table 1 would be: $ + +The approach described herein focuses on lexicon expansion obtained automatically through semantic similarity to map key terms in propositional statements to moral foundation lexicon words, using WordNet (Fellbaum, 1998).1 Three different variants of lexicon expansion (described in §3.3) improve on results obtained using the current state-of-the-art moral lexicon of Araque et al. (2020), which we take to be a strong baseline (henceforth referred to as 'Moral 1'). The advance beyond this prior work lies in the prudent (automatic) selection of terms designated for expansion, based on propositional structure, and the combination of moral dimensions with concern types. + +# 2.3 The MFT Framework and Influence + +We focus on concern detection because identifying critical issues discussed online within a particular domain is important and useful, as is identifying the moral justifications or deliberate appeals to moral identity in these discussions. We use the Moral Foundations Theory (MFT) framework (Haidt and Joseph, 2004; Graham et al., 2009, 2011, 2012) to encode the moral dimensions of social media contributions. These moral dimensions may serve as potential indicators of influence attempts, as in When it comes to immigration it's not about children, it's about damaging our country!, where the Concern type is IMMIGRATION_REFUGEE and there is an appeal to the vice side (harm) of the care/harm moral dimension. + +An emphasis on highly controversial and/or polarizing topics in online posts/messages may be indicative of an attempt to sway others. More importantly, if these posts/messages are interwoven with language that reflects (and speaks to) the moral values of the target audience it can increase in-group cohesion, and that may further contribute to polarization. Additionally, deliberate use of morality to justify harmful intentions towards others may foster online outrage disguised as ethical conduct (Bandura et al., 1996; Friedman et al., 2021). + +Several studies show that social groups provide a framework in which moral values are endorsed, and when these values are threatened by e.g., opposing political ideology, existing beliefs of the group are + +strengthened (Van Bavel and Pereira, 2018). Thus, when presented with information that is incongruent with our identity and in-group, we tend to override accuracy motives in favor of social identity goals (partisan bias). When accuracy and identity goals are in conflict, moral values determine which belief to endorse and thus how to engage with information. This makes moral values an ideal breeding ground for influence campaigns, but also very useful for our stance and concern detection tasks. + +We note that most studies of cross-cultural values, beliefs, and morality have been conducted by WEIRD (western, educated, industrialized, rich, and democratic) countries (Goodwin et al., 2020; Henrich et al., 2010). Inglehart's model of World Values (Inglehart and Welzel, 2010) has surveyed 60 countries over the last 40 years, taking into account that many nations are more concerned with economic and physical security (e.g. survival), while self-expression values are more reflective of Western countries. For example, in Pakistan or Nigeria $90\%$ of the population say that God is extremely important in their lives, while in Japan only $6\%$ take this position. Similarly, Schwartz' Theory of Basic Values (Schwartz, 2012) uses a different set of organizing principles, e.g., values that relate to anxiety (e.g., tradition, security, control of threat) which may lead to an increased belief in misinformation (Jost et al., 2003). Thus, moral dimensions combined with concern types are a potential indicator of a common actor (possibly an outside influencer) if several individuals or accounts (potentially purporting to be individuals) invoke the same moral dimensions across their messages. + +# 3 Task and Domain Adaptation + +Adaptation of stance detection to concern detection gives rise to a new framework for rapid development of a task-adapted system that retains domain adaptability and uses relatively low amounts of data, with only 2-4 hours of human categorization. + +# 3.1 Resource Building Generalizations + +We generalize to a new task while retaining domain adaptability by leveraging the stance-concern analogy, through: (a) semi-automatic domain-dependent extraction of types from propositional analysis, i.e., moving from belief types for stances to concern types for concerns; and (b) fully automatic domain-independent induction of associated values from a combination of propositional argu + +ments and lexical and semantic resources, i.e., belief/sentiment strengths (cf. (Baker et al., 2012)) for stances and moral dimensions and endorsements (cf. (Graham et al., 2012)) for concerns. + +Resource building for domain-dependent stance types involves propositional analysis using semantic role labeling (SRL) (Gardner et al., 2018)2 to detect positions with the most highly relevant content terms, e.g., masks. The work of Mather et al. (2021) indicates that these positions are ARG0 and ARG1. To port this approach over to the induction of domain-specific concern types, we conducted a similar analysis and found that the same positions (ARG0 and ARG1) contain the most highly relevant terms for concerns, e.g., economy. Semi-automatic induction of concern types thus leverages these positions, as described in §3.2. + +Just as stance resource building induces domain-independent stance values (belief / sentiment strengths), concern resource building induces domain-independent concern values (moral dimensions / endorsements). A deeper propositional analysis reveals that additional SRL positions have a high likelihood of association with moral dimension terms, e.g., ruin: V, ARG2, ARGM-ADV, ARGM-MNR, ARGM-PRD. This discovery further generalizes the original stance resource-building approach and enables rapid task adaptation to concerns through entirely automatic means. We leverage these additional SRL positions to extract candidate terms for expansion of moral dimensions. Associated endorsements are then inherited from semantically similar terms from baseline Moral 1. Further details about the expansion of moral dimensions are provided in §3.3. + +Domain adaptability is retained—on analogy with stance detection—by separating and independently addressing two aspects of concern detection: (a) induction of domain-specific concern types; (b) induction of domain-independent moral dimensions. Lexicon expansion using this approach can thus be applied to domains beyond the French Elections presented herein. + +# 3.2 Concern Type Induction + +We adopt a generalized semi-automatic process for lexically based concern type induction that retains domain adaptability (later referred to as 'Concern 1'). A small set (approximately 15) of domain- + +relevant key terms (e.g., health, taxation, immigration), is provided by a domain expert as input to a semi-automatic resource building tool. These terms are used to filter the domain-relevant dataset. The filtered tweet subset (214k) is then divided into training (2500),3 and development (211,500) subsets, and propositional analysis is applied to the training set in a 3-step process. + +First, the top 25 most frequent terms are extracted (e.g., economy),4 ignoring functional elements such as stop words. Second, the verbs whose relevant SRL positions (defined in §3.1) contain any of these top 25 terms are extracted, and the top 40 most frequent verbs e.g., ruin, restrict are selected for further processing. Lastly, the top 10 most frequent terms associated with relevant SRL positions (for each of the 40 verbs) are extracted automatically from domain-relevant data, e.g., economy and business, yielding 400 propositions, e.g., ruin(economy), restrict/business).5 + +These, coupled with terms from the original domain-relevant key terms, are presented to the domain expert who constructs a small set of concern types—10 in the case of French Election: textscimmigration/refugee, ELECTORAL_PROCESS_VOTING_LAWS, ENVIRONMENTCLIMATE_CHANGES, HEALTH CARE, TAXATION, ECONOMIC, SOCIAL SERVICES, INTERNATIONAL TRADE, MILITARY_ENGAGEMENT, CRIMINAL.justICE. Terms left uncategorized by the expert are dropped. This semi-automated concern-type induction takes 2–4 hours owing to the automatic extraction of high frequency domain relevant propositions. + +# 3.3 Concern Value Induction + +Concern values leverage MFT (Haidt and Joseph, 2004; Graham et al., 2009, 2011, 2012) and particularly the moralstrength library (Araque et al., 2020), which serves as a strong baseline (referred to as 'Moral 1'). This baseline lexicon includes manually developed moral dimensions (e.g. care/harm, loyalty/betrayal) and endorsement values (1-9). Our approach transcends this earlier paradigm in its + +application of propositional analysis with semantic-role labeling (SRL Gardner et al. (2018)), coupled with a more in-depth WordNet (WN Fellbaum (1998)) expansion to enrich the lexicon. This results in higher recall while retaining linguistically relevant constraints to achieve acceptable precision. + +Expansion of moral dimensions relies on propositional analysis, SRL, and WordNet expansion. We select candidates for moral dimension expansion through extraction from propositional statements, and then induce three lexicon variants (in addition to the Moral 1 baseline, and a Moral 0 random chooser described in §6) using a progression of finer-grained WordNet-based semantic-similarity functions. This expansion supports the goal of task adaptability, as required in the transition from stance detection to concern detection. + +The end result is a general approach to induction of values for specific tasks, rendered in the form of domain-independent lexicons. That is, analogous to belief/sentiment terms of stance detection (might, probably, hate, love), we induce vice/virtue moral dimensions and their corresponding endorsement values for concern detection. + +This expansion results in three different system variations for moral dimension/values (referred to as Moral 2, Moral 3, Moral 4) beyond the Moral 1 baseline. We note that moral dimensions are assigned automatically to each lexical entry via semantic similarity to Moral 1 terms; the endorsement values are then inherited from the most semantically similar term from the Moral 1 lexicon. An excerpt of lexicon output is shown below, from the best performing lexicon (Moral 4): + +hypocrite - dim: betrayal; endorse: 1.0 (strong) +appreciation - dim: care; endorse: 8.57 (strong) + +Lexicon Expansion Details: Moral 2-4 rely on automatic propositional analysis for prudent selection of words from the training data (via SRL, see §3.1) to be considered candidates for lexicon expansion. The highest similarity match is recorded to inherit the corresponding moral endorsement value from Moral 1. A brief description of all lexicon expansions used for induction of moral dimensions and values for concern detection is provided below. (See detailed description in Appendix A and links to Moral 2-4 lexicons in Appendix B.) + +Note: The term "lemma-matched" below refers to a match between a word in a training tweet and a synset's first lemma. + +Moral 1: This initial moral dimension lexicon developed by Araque et al. (2020) serves as a strong baseline, with $2800+$ terms across five moral dimensions. This was derived by expanding an initial crowd sourced lexicon of about $480+$ terms, annotated for moral dimensions and endorsements. Expansion to $2800+$ terms was via WordNet synset matching, without regard to propositional analysis. + +Moral 2: (Added 214 terms, for total of 3064) This lexicon expansion yields a set of terms whose lemma-matched synsets are semantically similar (above a threshold) to lemma-matched synsets of the words in the strong baseline (Moral 1) lexicon. + +Moral 3: (Added 995 terms, for total of 3845) This lexicon expansion yields a set of terms whose lemma-matched synsets and their descendants are semantically similar (above a threshold) to lemmamatched synsets and their descendants of the words in the strong baseline (Moral 1) lexicon. + +Moral 4: (Added 5623 terms, for total of 8473) This lexicon expansion yields a set of terms drawn from all synsets and their descendants that are semantically similar (above a threshold) to all synsets and their descendants of words in the strong baseline (Moral 1) lexicon, without lemma matching. + +# 4 Annotation for Ground Truth + +We conduct an annotation task to develop Ground Truth (GT), against which to compare our concern detection system variants, based on 50 held-out tweets from the held-out development portion of the English subset of the Kaggle Twitter dataset on 2017 French elections (Daignan, 2017). Ground truth was produced for concern types and vice/virtue pairs for any of five moral dimensions, in accordance with guidelines in Appendix C. Annotation was completed by two non-algorithm developers (one with expertise in linguistics, the other with expertise in psychosocial moral indicators). For concern types the inter-rater reliability (IRR) is calculated through macroaveraging of kappa scores (Carletta, 1996) which produces a $66\%$ agreement, considered Strong according to (McHugh, 2012). By contrast, the macroaveraged IRR for moral dimensions is low $(16\%)$ , which is considered Weak. + +Given the high annotator reliability for concern types, system output is compared against the union of both annotators, yielding the concern type scores in Table 3. However, the lower IRR for moral dimensions is an indication that research in this realm is still in nascent stages and significant training + +Example 1: Vatican's completely surrounded by a wall w/an entrance that's guarded 24/7 & refugees r not allowed + +Concern type: IMMIGRATION_REFUGEE + +Proposition: surrounded(vatican, by a wall ...guarded 24/7 & refugees r not allowed)) + +Dimensions & Endorsements: Harm: 3.46, Authority: 6.02, Degradation: 2.71 + +Example 2: Where is the justice? + +Concern type: CRIMINAL.justICE + +Proposition: is(where, the justice) + +Dimensions & Endorsements: Fairness: 7.6 + +Example 3: Most Melanchon voters care more about their country than their ideological purity. + +Concern type: ELECTORAL_PROCESS_VOTING_LAWS + +Proposition: care(most melanchon voters, more about their country) + +Dimensions & Endorsements: Care: 8.80, Loyalty: 7.14, Authority: 5.57, Degradation: 3.69 + +Table 2: Sample Output from Concern Detection on Kaggle 2017 French Elections; SRL output is reproduced including any errors + +for the task is required to achieve a reliable GT. We note that "ground truth" is inherently problematic with moral indicators given the complex way in which dimensions vary with socio-cultural factors. Thus, for moral dimensions, system output is compared only against the single annotator with expertise in psychosocial moral indicators. + +Appendix D presents the Ground Truth resulting from these annotations. Kaggle data (Daignan, 2017) are open and publicly available, intended for research on text analytics. The data carry no privacy or copyright restrictions. Furthermore, IRB designates our work as non human subject research. Annotators spent two hours apiece on the task. + +# 5 Sample Runs + +We have implemented/validated a system to detect concerns based on induced lexical resources, using spaCy and SRL. We derive a proposition coupled with a concern type and values (moral dimensions/endorsements). Systems produce pairs, with an average runtime of 0.6s per tweet on Mac, with no GPUs required. + +Representative outputs on a 1K-tweet held-out portion of the development dataset from Kag- + +gle 2017 French Elections are shown in Table 2. These are taken from our best performing variant described in §6. In Example 1, IMMIGRATION_REFUGEE (triggered by refugees) is coupled with moral dimension/endorsement values, Harm (wall, entrance, guard), Authority (wall, guard), and Degradation (entrance). In Example 2, CRIMINAL.justICE (triggered by justice) is coupled with moral dimension/endorsement values: Fairness (justice). Both are reasonable outputs. + +In example 3, ELECTORAL_PROCESS_VOTING_LAWS (triggered by voters) is coupled with moral dimension/endorsement values, Care (care), Loyalty (country), Authority (care, country), and Degradation (care, voters). This example overgenerates, assigning Degradation based on the terms care and voters. A further lexicon enhancement is needed (as alluded to in §7) for elimination of spurious lexical entries that lead to false positives (i.e., a reduction in Precision). + +# 6 Results and Analysis + +We explore the performance of each of our four moral dimension lexicons by comparing outputs against GT for each lexicon. Concerns types are evaluated for an exact match against the GT concern (e.g., CRIMINALJUSTICE) and moral values are evaluated for an exact match against the binary choice in the GT (vice or virtue). Concern 1 represents the lexicon-based chooser described in §3.2. Our (strong) baseline for moral values is "Moral 1" (Araque et al., 2020). Subsequent variants (Moral 2-4) are the expanded moral dimension lexicons using the techniques described in §3.3. We also compare against random chooser for Concern Types (Concern 0) and Values (Moral 0). Table 3 shows the results of each system output compared to GT. + +System performance is measured by weighted macro-averaged precision (P), recall (R), and F1 scores. Domain-dependent Concern Type is not affected by moral lexicon variants and independently has its own P/R/F1 scores. Concern Values (i.e., moral Dimensions) are impacted by lexicon variants and therefore have a row corresponding to each variant. We note the importance of applying a weighted macro average to these scores due an imbalance in the distribution of classes (Delgado and Tibau, 2019), where the probability of one class can be substantially higher or lower from others. For example, we observed that the num + +
SystemTPFPFNPRF1
Concern 0352332512.6953.8820.54
Concern 14012091.6066.6777.17
Moral 0332253312.7443.0119.65
Moral 113285332.9919.6924.67
Moral 217584931.2025.7628.22
Moral 3241224231.3836.3633.69
Moral 4431812329.7565.1540.85
+ +Table 3: Evaluation of (Domain-Dependent) Concern Types and (Domain-Independent) Moral Dimensions: Unweighted sum of true positives (TP), false positives (FP), and false negatives (FN) across all labels. Precision (P), recall (R), and F1 numbers for all systems are weighted macro-averages except for the random choosers (Concern 0 and Moral 0). Lexicon variants affect only the moral dimensions. + +ber of ELECTORAL_PROCESS_VOTING_LAWS annotations is 2.3 times higher than the number of INTERNATIONAL-trade annotations. + +One might expect random choosers (Concern 0 and Moral 0) to have a decent likelihood of getting many hits, with an expected rate of about $50\%$ that each Concern type and Moral value will be selected. If so, this would result in an expected 250 positive selections for concern types (whereas the two annotators together only made 60 positive selections) and an expected 250 positive selections for moral values (whereas the expert annotator only made 66 positive selections). However, the results in Table 3 indicate that, while the increased number of hits leads to a reasonably high recall, the number of false positives (233) swamps out the hit rate, leading to a low F1 score (20.54). Accordingly, Concern 1 easily beats the random choice baseline by a healthy margin, with an F1 score of 77.17. + +In contrast, Moral 0 achieves $79.65\%$ of the performance of the Moral 1 baseline, with an F1 score of 19.65—not too far off from the 24.67 baseline F1 score. Moreover, the F1 scores for Moral 2-4 surpass this baseline, with statistically significant improvements indicated between all system pairs at the $3.5\%$ level or better, according to the McNemar statistical test (McNemar, 1947).7 That is, all lexicon expansion improvements are statistically significant. Notably, a $231\%$ improvement in Recall is achieved for Moral 4 over the strong baseline (Moral 1): 65.15 vs. 19.69. This is achieved with only a $10\%$ loss of precision, ultimately yielding an F1 score of 40.85 which is a $66\%$ improvement. + +We observe that the precision-recall gap increases as the notion of similarity is loosened: (1) lead is similar to strip in Moral 4, but not in Moral 3 (reducing Moral 4 precision); (2) price is similar to value in Moral 4 but not in Moral 3 (increasing Moral 4 recall). We further assess system performance by comparing Concern 1 performance to human performance. Average F1 score for the two annotators is 78.88, and Concern 1 performance is 77.17 F1. Concern detection thus yields $97.8\%$ of human performance on concern type detection. + +Error analysis of FP/FN's for concern types reveals that concern detection fails to assign any concern type (FN) to Infighting among left-wing could hand Front National VICTORY, which is annotated as ELECTORAL_PROCESS_VOTING_LAWS, because terms like Front and left-wing are not present in the concern type lexicon. + +For concern values, the annotator does not assign a moral dimension to Macron is center right, yet Moral 4 inaccurately detects (FP) Care, Authority, and Betrayal due to the existence of the word center and also detects Purity from the word right. For this same sentence Moral 1 also inaccurately detects Fairness from the word right. Many cases similar to these impact precision values for each Moral 1-4, potentially requiring lexicon tuning (see §7). + +We conduct further analysis to determine whether performance is impacted by potential overfitting of concern value detection to the domain of interest during development. We compare Araque's original concern value detection tools (Araque, 2021), a unigram model trained on Hurricane Sandy data from the Moral Foundations Twitter Corpus (MFTC) (Hoover et al., 2020), to our proposition-based concern value detection that uses semantically expanded lexicons based on the Kaggle French elections data. We level the playing field by applying both approaches to both datasets, measuring each against their respective GTs. + +Araque (2021)'s Unigram Model performs best on Hurricane Sandy test data (Table 4), with weighted macroaverage F1, using both Moral 1 and Moral 4 lexicons (60.55), but does not perform as well on Kaggle test data (30.38 and 22.43). This is a potential indicator of overfitting to the Hurricane Sandy data during training. Similarly, proposition-based concern value detection (\$3.3) performs better on Kaggle test data (40.85) than on Hurricane Sandy Data (29.99)—a sign of overfitting in the opposite direction during lexicon expansion. + +
Kaggle 2017 French ElectionsPRF1
Moral 1Proposition (§3.3)32.9919.6924.67
Unigram Model (Araque, 2021)29.0731.8230.38
Moral 4Proposition (§3.3)29.7565.1540.85
Unigram Model (Araque, 2021)20.8824.2422.43
+ +
MFTC Hurricane SandyPRF1
Moral 1Proposition (§3.2)65.5817.5627.68
Unigram Model (Araque, 2021)56.0265.8960.55
Moral 4Proposition (§3.3)26.1035.2929.99
Unigram Model (Araque, 2021)56.0265.8960.55
+ +Table 4: Comparison of two Concern Value (Moral Dimensions) detection algorithms across two domains (Kaggle 2017 French Elections and MFTC Hurricane Sandy) using Moral 1 and Moral 4 lexicons. + +
Kaggle 2017 French ElectionsPRF1
Moral 1Full Input Text34.0521.2126.14
Moral 4Full Input Text32.4262.1242.61
+ +
MFTC Hurricane SandyPRF1
Moral 1Full Input Text67.2322.9134.13
Moral 4Full Input Text36.7949.0842.03
+ +Table 5: Test for Domain Stability of Concern Value (Moral Dimensions) detection across two domains (Kaggle 2017 French Elections and MFTC Hurricane Sandy), using Moral 1 and Moral 4 lexicons on full text input. + +Testing our moral lexicon expansion for stability retention across domains, we level the playing field by relaxing the constraint that only a propositional sub-partion of the text is considered as input. We apply our algorithm to the entire text (full tweet) to induce a fairer comparison with Araque et al's Unigram model. Table 5 shows comparable or better macroaveraged F1 scores than those shown for "Proposition" in Table 4. + +More importantly, our expanded Moral 4 lexicon demonstrates stability across domains: 42.61 for 2017 French Elections and 42.03 for Hurricane Sandy (vs. 26.14 and 34.13, respectively, for Araque et al's Moral 1 lexicon). This illustrates the potential for proposition-based domain adaptability but highlights the need for hybridized detection to ensure both task adaptability and explainability (discussed further below). + +# 7 Conclusions, Limitations, Future Work + +We implement and validate a generalized paradigm for adaptation of tasks involving propositions to a new task (concern detection) and domain (French elections). Our primary contribution is the provi + +sion of a framework for rapid adaptability, based on: (a) semi-automatic domain-dependent extraction of types from propositional analysis; and (b) fully automatic domain-independent induction of values from propositional arguments and semantic resources. We demonstrate that the coupling of (a) and (b) leads to rapid ramp-up resource construction for a new task and domain (2-4 hours). + +We demonstrate that a deeper propositional analysis is key to generalizing domain-adaptable resource-building for new tasks. We develop an automatic procedure for expanding moral dimensions that incorporates propositional analysis, semantic-role labeling, and in-depth WordNet (WN) expansion, to produce three increasingly expanded moral dimension/endorsement lexicons. We develop a ground truth (GT) based on expert annotators and compare our concern detection output to GT, to yield $231\%$ improvement in recall over baseline, with only a $10\%$ loss in precision. F1 yields $66\%$ improvement over baseline and $97.8\%$ of human performance. Our approach yields large savings over those that employ costly human labor and model building. Work produced herein provides the community with a newly expanded moral dimension/value lexicon, annotation guidelines, and GT for 50 tweets, intended for research purposes. + +We show that our proposition-based moral lexicon expansion provides stability across domains. However, the results of concern value detection using the full text of an input (a tweet) highlight the importance of adopting a hybrid approach that captures fine-grained distinctions and produces an explainable representation that is not otherwise available (e.g., in the unigram language model of Araque (2021)). An avenue of future research is to explore a hybridized approach that makes fine-grained concern value distinctions for domain adaptability, while leveraging an explainable propositional representation for task adaptability. As a first step, we will apply our propositional analysis iteratively on full-text inputs to detect answers to questions not otherwise extractable from raw textual strings (see related discussion in §1). + +Our results do not require any tuning of the lexicons to remove terms that result in a high number of false positives (FP) and false negatives (FN). Future work will explore fine tuning of the lexicons to address cases seen in §6 with an eye toward improving the precision without a large drop in recall, to yield an even higher F1-score. + +A current limitation (for future study) is the omission of additional moral dimensions, e.g., liberty/oppression (Haidt, 2012). This reflects political equality related to dislike of oppression and concern for victims, not a desire for reciprocity. In political discourse, this is apparent in anti-authoritarianism and anti-government anger, which makes it an important dimension for the topic of the French election (Iyer et al., 2012) and widens the range of potentially relevant information that could indicate influence attempts. + +Future work also includes exploration of other cultural frameworks, in addition to or in place of Moral Foundations Theory, e.g., Inglehart's Cultural Map model (Inglehart and Welzel, 2010) and Schwartz Value Theory (Schwartz, 2012). Cultural models that allow more room for non-Western values (e.g. survival needs) are important for reducing bias, and a feasible avenue for improving the performance and applicability of concern detection. + +Another limitation is that GT development for a given cultural context is difficult, especially with diverse annotators. Prabhakaran et al. (2021) show that systematic disagreements between annotators with differing socio-cultural backgrounds are obfuscated through aggregating crowd-sourced annotations. Future work will explore vector-based approaches to assign weights based on their representativeness in a given culture. + +Cultural values are also reflected in language (e.g., gendered vs. non-gendered languages, culturally intrinsic concepts). Accordingly, our future work involves processing concerns for other languages through adaption of SRL (Gardner et al., 2018) to multilingual input, starting with French, employing multilingual preprocessing via spaCy (Honnibal et al., 2020) and EuroWordNet and related multilingual WordNets (Bond and Paik, 2012; Bond and Foster, 2013), to expand moral dimensions to other languages. + +# Ethical Considerations + +Annotation was completed by two non-algorithm developers (one with expertise in linguistics, the other with expertise in psychosocial moral indicators), compensated appropriately for their work. A two-level institutional review board (at both the sponsored site and at the sponsoring site) deemed this work as "research not involving human subjects," as it does not involve a living individual about whom an investigator conducting research + +obtains information through intervention or interaction with the individual, or obtains, uses, studies, analyzes, or generates identifiable private information. + +The data used for the software development is provided from Kaggle's existing public research Twitter dataset, focusing on an English subset for the 2017 French Elections of 1.9 million tweets (Daignan, 2017) at https://www.kaggle.com/jeannmidef/french-presidential-election. Kaggle data contain user names, but the dataset is open and publicly available. + +Potential risks may emerge from language biases in standard resources on which some of our work is built. For example, cultural idioms like fluctuat nec mergitur may be translated from Latin into the correct literal meaning of tossed [by the waves], but not sunk, but the culturally distinct values (Paris' coat of arms and motto with a deep affective history) will get lost in translations into English, and with it, its cultural meaning. Similarly, while English WordNet provides one of the most comprehensive semantic ontology of words in English, embedded biases are still present today, e.g., offensive, racist, and misogynistic slurs (Crawford and Paglen, 2021). These issues need to be addressed within the language resource community. + +Risk of misuse of this technology is mitigated by the transparent nature of concern detection, owing to the propositional representations that underlie and inform algorithmic decisions. In contrast to ML approaches, misuse within the technology would be easily discoverable. The technology further serves as a framework within which cultural distinctions may be studied and better understood, thus mitigating the potential for cross-culturally undetected misuse. + +# Acknowledgments + +This material is based upon work supported by the Defense Advanced Research Projects Agency (DARPA) under Contracts No. HR001121C0186, No HR001120C0037, and PR No. HR0011154158. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the Defense Advanced Research Projects Agency (DARPA). + +# References + +Abeer AlDayel and Walid Magdy. 2021. Stance detection on social media: State of the art and trends. Information Processing & Management, 58(4):102597. +Oscar Araque. 2021. moral-foundations. https://github.com/oaraque/ moral-foundations. [Online; accessed 04-November-2021]. +Oscar Araque, Lorenzo Gatti, and Kyriaki Kalimeri. 2020. Moralstrength: Exploiting a moral lexicon and embedding similarity for moral foundations prediction. Knowledge-Based Systems, 191:105184. +Kathryn Baker, Michael Bloodgood, Bonnie Dorr, Chris Callison-Burch, Nathaniel Filardo, Christine Piatko, Lori Levin, and Scott Miller. 2012. Use of modality and negation in SIMT. CL, 38. +Albert Bandura, Claudio Barbaranielli, Gian Vittorio Caprara, and Concetta Pastorelli. 1996. Mechanisms of moral disengagement in the exercise of moral agency. Journal of personality and social psychology, 71(2):364. +Eyal Ben-David, Carmel Rabinovitz, and Roi Reichart. 2020. PERL: Pivot-based domain adaptation for pre-trained deep contextualized embedding models. Transactions of the Association for Computational Linguistics, 8:504-521. +Francis Bond and Ryan Foster. 2013. Linking and extending an open multilingual Wordnet. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1352-1362, Sofia, Bulgaria. Association for Computational Linguistics. +Francis Bond and Kyonghee Paik. 2012. A survey of wordnets and their licenses. In Proceedings of the 6th Global WordNet Conference (GWC 2012), pages 64-71, Matsue. +Jean Carletta. 1996. Assessing agreement on classification tasks: The kappa statistic. Computational Linguistics, 22(2):249-254. +Kate Crawford and Trevor Paglen. 2021. Excavating ai: The politics of images in machine learning training sets. AI & SOCIETY, pages 1-12. +Jean-Michel Daignan. 2017. French presidential election: Extract from twitter about the french election, kaggle data set. +Rosario Delgado and Xavier-Andoni Tibau. 2019. Why cohen's kappa should be avoided as performance measure in classification. PLOS ONE, 14(9):1-26. +Xinya Du and Claire Cardie. 2020. Event extraction by answering (almost) natural questions. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 671-683, Online. Association for Computational Linguistics. + +Christiane Fellbaum. 1998. WordNet: An Electronic Lexical Database. Language, Speech, and Communication. MIT Press. +Scott E Friedman, Ian Magnusson, Sonja Schmer-Galunder, Ruta Wheelock, Jeremy Gottlieb, Christopher Miller, et al. 2021. Toward transformer-based nlp for extracting psychosocial indicators of moral disengagement. In Proceedings of the Annual Meeting of the Cognitive Science Society, volume 43. +Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Peters, Michael Schmitz, and Luke Zettlemoyer. 2018. AllenNLP: A deep semantic natural language processing platform. In Proceedings of Workshop for NLP Open Source Software (NLP-OSS), pages 1-6, Melbourne, Australia. Association for Computational Linguistics. +Siddhant Garg, Thuy Vu, and Alessandro Moschitti. 2020. Tanda: Transfer and adapt pre-trained transformer models for answer sentence selection. Proceedings of the AAAI Conference on Artificial Intelligence, 34(05):7780-7788. +Deepanway Ghosal, Devamanyu Hazarika, Abhinaba Roy, Navonil Majumder, Rada Mihalcea, and Soujanya Poria. 2020. KinGDOM: Knowledge-Guided DOMain Adaptation for Sentiment Analysis. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3198-3210, Online. Association for Computational Linguistics. +Jamie Lynn Goodwin, Andrew Lloyd Williams, and Patricia Snell Herzog. 2020. Cross-cultural values: a meta-analysis of major quantitative studies in the last decade (2010-2020). *Religions*, 11(8):396. +Jesse Graham, Jonathan Haidt, Sena Koleva, Matt Motyl, Ravi Iyer, Sean Philip Wojcik, and Peter H. Ditto. 2012. Moral foundations theory: The pragmatic validity of moral pluralism. In Advances in Experimental Social Psychology, volume 47, pages 55-130. +Jesse Graham, Jonathan Haidt, and Brian A. Nosek. 2009. Liberals and conservatives rely on different sets of moral foundations. Journal of personality and social psychology, 96 5:1029-46. +Jesse Graham, Brian A. Nosek, Jonathan Haidt, Ravi Iyer, Spassena P. Koleva, and Peter H. Ditto. 2011. Mapping the moral domain. Journal of personality and social psychology, 101 2:366-85. +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. + +Jonathan Haidt. 2012. The righteous mind: Why good people are divided by politics and religion. Vintage. +Jonathan Haidt and Craig Joseph. 2004. Intuitive ethics: how innately prepared intuitions generate culturally variable virtues. Daedalus, 133(4):55-66. +Joseph Henrich, Steven J Heine, and Ara Norenzayan. 2010. Most people are not weird. Nature, 466(7302):29-29. +Matthew Honnibal, Ines Montani, Sofie Van Landeghem, and Adriane Boyd. 2020. spaCy: Industrialstrength NLP in Python. +Joe Hoover, Gwenyth Portillo-Wightman, Leigh Yeh, Shreya Havaldar, Aida Mostafazadeh Davani, Ying Lin, Brendan Kennedy, Mohammad Atari, Zahra Kamel, Madelyn Mendlen, Gabriela Moreno, Christina Park, Tingyee E. Chang, Jenna Chin, Christian Leong, Jun Yen Leung, Arineh Mirinjian, and Morteza Dehghani. 2020. Moral foundations twitter corpus: A collection of 35k tweets annotated for moral sentiment. Social Psychological and Personality Science, 11(8):1057-1071. +Ronald Inglehart and Chris Welzel. 2010. The wvs cultural map of the world. World Values Survey. +Ravi Iyer, Spassena Koleva, Jesse Graham, Peter Ditto, and Jonathan Haidt. 2012. Understanding libertarian morality: The psychological dispositions of self-identified libertarians. PLOS ONE, 7(8):1-23. +John T Jost, Jack Glaser, Arie W Kruglanski, and Frank J Sulloway. 2003. Political conservatism as motivated social cognition. Psychological bulletin, 129(3):339. +Peter Krejzl, Barbora Hourova, and Josef Steinberger. 2017. Stance detection in online discussions. ArXiv, abs/1701.00504. +Dilek Kucuk and Fazli Can. 2020. Stance detection: A survey. ACM Comput. Surv., 53(1). +Brodie Mather, Bonnie J. Dorr, Owen Rambow, and Tomek Strzalkowski. 2021. A general framework for domain-specialization of stance detection A COVID-19 response use case. In Proceedings of the Thirty-Fourth International Florida Artificial Intelligence Research Society Conference, North Miami Beach, Florida, USA, May 17-19, 2021. +Mary McHugh. 2012. Interrater reliability: The kappa statistic. Biochemia medica : Časopis Hrvatskogá društva medicinskih biokemičara / HDMB, 22:276-82. +Quinn McNemar. 1947. Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika, 12(2):153-157. +Aakanksha Naik and Carolyn Rose. 2020. Towards open domain event trigger identification using adversarial domain adaptation. In Proceedings of the 58th + +Annual Meeting of the Association for Computational Linguistics, pages 7618-7624, Online. Association for Computational Linguistics. +Peter Pirolli, Kathleen Carley, Adam Dalton, Bonnie Dorr, Christian Lebiere, Michael Martin, Brodie Mather, Konstantinos Mitsopoulos, Mark Orr, and Tomek Strzalkowski. 2021. Mining Online Social Media to Drive Psychologically Valid Agent Models of Regional Covid-19 Mask Wearing, pages 46-56. 2021 International Conference on Social Computing, Behavioral-Cultural Modeling & Prediction and Behavior Representation in Modeling and Simulation (SPB-BRIMS 2021). +Vinodkumar Prabhakaran, Aida Mostafazadeh Davani, and Mark Diaz. 2021. On releasing annotator-level labels and information in datasets. arXiv preprint arXiv:2110.05699. +Alan Ramponi and Barbara Plank. 2020. Neural unsupervised domain adaptation in NLP—A survey. In Proceedings of the 28th International Conference on Computational Linguistics, pages 6838-6855, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Younes Samih and Kareem Darwish. 2021. A few topical tweets are enough for effective user stance detection. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2637-2646, Online. Association for Computational Linguistics. +Shalom H. Schwartz. 2012. An overview of the schwartz theory of basic values. Online Readings in Psychology and Culture, 2:11. +Tomohide Shibata and Sadao Kurohashi. 2018. Entity-centric joint modeling of Japanese coreference resolution and predicate argument structure analysis. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 579-589, Melbourne, Australia. Association for Computational Linguistics. +Asher Stern and Ido Dagan. 2014. Recognizing implied predicate-argument relationships in textual inference. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 739-744, Baltimore, Maryland. Association for Computational Linguistics. +Muhammad Umer, Zainab Imtiaz, Saleem Ullah, Arif Mehmood, Gyu Sang Choi, and Byung-Won On. 2020. Fake news stance detection using deep learning architecture (cnn-lstm). IEEE Access, 8:156695-156706. +Jay J Van Bavel and Andrea Pereira. 2018. The partisan brain: An identity-based model of political belief. Trends in cognitive sciences, 22(3):213-224. +Ning Xie, Gabrielle Ras, Marcel van Gerven, and Derek Doran. 2020. Explainable deep learning: A field guide for the uninitiated. ArXiv, abs/2004.14545. + +Brian Xu, Mitra Mohtarami, and James R. Glass. 2019. Adversarial domain adaptation for stance detection. CoRR, abs/1902.02401. +Bishan Yang and Claire Cardie. 2013. Joint inference for fine-grained opinion extraction. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1640-1649, Sofia, Bulgaria. Association for Computational Linguistics. +Zhisong Zhang, Xiang Kong, Zhengzhong Liu, Xuezhe Ma, and Eduard Hovy. 2020. A two-step approach for implicit event argument detection. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7479-7485, Online. Association for Computational Linguistics. +Yftah Ziser and Roi Reichart. 2019. Task refinement learning for improved accuracy and stability of unsupervised domain adaptation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5895-5906, Florence, Italy. Association for Computational Linguistics. + +# A Lexicon Expansion Detailed Descriptions + +Below is the detailed description of each expansion algorithm. Basic definitions: + +$w =$ word in training tweet (e.g., 'concerned') + +$m =$ moral foundations word (e.g., 'concern') $wn =$ wordnet package + +$S_{w} = \mathrm{wn}$ .synsets(w) (set of synsets for word w) $s_{w,1} = \mathrm{wn}$ .synsets(w)[0] (1st synset for word w) + +$L_{i} =$ lemmas associated with $S_{i}$ + +$l_{i,k} = \mathrm{s.}$ lemmas() (lemmas for synset $s_i$ ) + +$l_{i,1} = \mathrm{s.}$ lemmas()[0].name() (1st lemma synset $s_i$ ) + +Note: Use of the term "lemma-matched" below refers to a match between a word in a training tweet and a synset's first lemma. + +Lexicon Expansion: All lexicon expansions (Moral 2-4 below) beyond a strong baseline (Moral 1) rely on propositional guidance to select words from the training data to be considered candidates for lexicon expansion. The highest similarity match is recorded for future selection of the moral endorsement value. All moral lexicon expansions (Moral 2-4 below) beyond a strong baseline (Moral 1) apply to each pair $(w, m)$ for each word of interest $w$ and each moral foundations word $m$ ( $w \times m$ iterations): + +Moral 1: This initial moral dimension lexicon developed by Araque et al. (2020)8 serves as a strong baseline, with $2800+$ terms across five moral dimensions. This was derived by expanding an initial + +crowd sourced lexicon of about $480+$ terms, annotated for moral dimensions and endorsements. Expansion to $2800+$ terms was via WordNet synset matching, without regard to propositional analysis. + +Moral 2: (Added 214 terms) This lexicon expansion yields a set of terms whose lemma-matched synsets are semantically similar (above a threshold) to lemma-matched synsets of the words in the strong baseline (Moral 1) lexicon, using the following steps: (a) Extract all synsets $s_{w,i}$ in $S_w$ (for word $w$ ) whose first lemma $l_{i,1}$ exactly matches $w$ , producing $S_x$ . (b) Extract all $s_{m,j}$ in $S_m$ (for word $m$ ) whose first lemma $l_{j,1}$ exactly matches $m$ , producing $S_y$ . (c) Return all lemmas $l_{k,1}$ of any $s_{x,k}$ in $S_x$ that matches any $s_{y,h}$ in $S_y$ using wordnet wup_similarity w/ threshold 0.9 (if any). Example: concerned → concerned.a.01. + +Moral 3: (Added 995 terms) This lexicon expansion yields a set of terms whose lemma-matched synsets and their descendants are semantically similar (above a threshold) to lemma-matched synsets and their descendants of the words in the strong baseline (Moral 1) lexicon, using the following steps: (a) Extract all synsets $s_{w,i}$ , in $S_w$ (for word $w$ ) whose first lemma $l_{i,1}$ matches exactly $w$ , producing $S_x$ . Extract all synsets $s_{m,j}$ in $S_m$ (for word $m$ ) whose first lemma $l_{j,1}$ matches exactly $m$ , producing $S_y$ . (First part of 2 up to this point.) (b) Expand lemmas from both sets: (i) collect all lemmas for all synsets in $S_x$ , producing $L_x$ ; (ii) collect all lemmas for all synsets in $S_y$ , producing $L_y$ . (c) Extract synsets for these lemma expansions: (i) collect all synsets for all lemmas in $L_x$ , producing $S_a$ ; (ii) collect all synsets for all lemmas in $L_y$ , producing $S_b$ . (d) Return all unique lemmas $l_{c,1}$ of any synset $s_{a,c}$ in $S_a$ that matches a synset $s_{b,d}$ in $S_b$ using wup_similarity w/ threshold 0.9 (if any). Example: concerned → concerned.a.01 → implicated → implicated.s.01 + +Moral 4: (Added 5623 terms) This lexicon expansion yields a set of terms drawn from all synsets and their descendants that are semantically similar (above a threshold) to synsets and their descendants of words in the strong baseline (Moral 1) lexicon—without lemma matching—using the following steps: (a) Extract all synsets $s_{w,i}$ in $S_w$ (for word $w$ ), producing $S_x$ . Extract all $s_{m,j}$ in $S_m$ (for word $m$ ), producing $S_y$ . (b) Expand lemmas from both sets: (i) collect all lemmas for all synsets in $S_x$ , producing $L_x$ ; (ii) collect all lemmas for all synsets in $S_y$ , producing $L_y$ . (c) Extract synsets for these + +lemma expansions: (i) collect all synsets for all lemmas in $L_{x}$ , producing $S_{a}$ ; (ii) collect all synsets for all lemmas in $L_{y}$ , producing $S_{b}$ . (d) Return all unique lemmas $l_{c,1}$ of any synset $s_{a,c}$ in $S_{a}$ that matches a synset $s_{b,d}$ in $S_{b}$ using wup_similarity w/ threshold 0.9 (if any) Example: concerned → refer.v.02 → refer → pertain.v.02 + +# B Moral Dimension/Value Lexicons: Moral 2-4 + +Three moral lexicons are induced automatically via propositional analysis, SRL, and semantic lexicon expansion: + +- Moral 2: Moral 2 Lexicon +- Moral 3: Moral 3 Lexicon +- Moral 4: Moral 4 Lexicon + +# C Annotation Guidelines + +Steps below refer to column labels in the Blank Annotation Sheet found here. + +1. For each tweet excerpt in the "Text" column A, apply steps 2-8 below. +2. Columns B through K are the potential Concern types. Put a "1" in a single column corresponding to the applicable Concern type. Leave empty if none appears to apply. +3. Columns L through W are moral dimensions. Put a "1" in any column that has an applicable moral dimension, in either the vice subcolumn or the virtue subcolumn. Leave the vice/virtue cells empty for any moral dimension that is not applicable. Refer to the moral dimensions described in the Graham and Haidt tables for this task (see links in 4a and 4b below). +4. Provide annotations only for explicitly represented material. Do not infer context that is not stated and do not apply any subject-matter background knowledge. The only background knowledge to be used for this task is the moral dimensions description in tables below from: + +(a) [Graham and Haidt, 2012] (see page 16) +(b) [Graham et al., 2013] (see page 68) + +5. Do not try to force the Text into a particular moral dimension. If a moral dimension appears to be applicable, but it is unclear + +whether the vice or virtue is active, put "DK" in either the vice cell or virtue cell, instead of leaving it blank. + +6. Consider only the content of the Text without regard to grammaticality or punctuation. +7. Assume no sarcasm is present. Annotate the literal sense. +8. Use the last column (optionally) for any annotation notes, eg, the reasoning behind the chosen annotations. + +# D Ground Truth + +We conduct an annotation task to develop Ground Truth (GT), against which to compare our concern detection system variants, based on 50 held-out tweets from the held-out development portion of the Kaggle English Twitter dataset on 2017 French elections (Daignan, 2017). Annotation was completed by two non-algorithm developers (one with expertise in linguistics, the other with expertise in psychosocial moral indicators). Annotators were provided guidelines (Appendix C) for both concern types and moral dimensions. For concern types the interrater reliability (IRR) is calculated through macroaveraging of kappa scores (Carletta, 1996) which produced a $66\%$ agreement, considered Strong according to (McHugh, 2012). By contrast, the macroaveraged IRR for moral dimensions is considered none to slight $(16\%)$ , which is deemed Weak. [Link to GT] \ No newline at end of file diff --git a/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/images.zip b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..619af6e0a26740f869635e720408d16089fad6ac --- /dev/null +++ b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac56d424355b81e20293d1b0c08bbf454274bb437312cc9321ce1d42ea92e3f7 +size 162337 diff --git a/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/layout.json b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1e2a11783ca617e90e9ef3c420541bf8cf64d4d6 --- /dev/null +++ b/fromstancetoconcernadaptationofpropositionalanalysistonewtasksanddomains/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba6f20aa02af215fc2b1da0c08e023a6b1163aa221c22e8f9a5cf118045f83de +size 461582 diff --git a/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_content_list.json b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..797a877ff48d1254076c49948f768f8a148090cb --- /dev/null +++ b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa42acaca3cad8ba12a53157e7917162ef69620d9b840dc386b29e95183c8f06 +size 98896 diff --git a/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_model.json b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5bd5055819a73e8081f5d9c9066ebfe58798ebf6 --- /dev/null +++ b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c931aa0013057fe01f77ce4d70b52bcc14eb1fe091fd85232ed8eb3aa57439f +size 115838 diff --git a/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_origin.pdf b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..dec83be4228ae1d189bc8f497d9e77622f1ae720 --- /dev/null +++ b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/9d85ee51-507b-4f81-b62b-0c83cd07f430_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3c413accb3b7a2071d9f2e5bb05335c223e8d4ab43b42512caddc10c16b4b0d +size 717520 diff --git a/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/full.md b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a72f05db41837d41bbc6cb44caeb3fb4cfe4c12b --- /dev/null +++ b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/full.md @@ -0,0 +1,440 @@ +# Fusing Heterogeneous Factors with Triaffine Mechanism for Nested Named Entity Recognition + +Zheng Yuan $^{12*}$ Chuanqi Tan $^{2}$ Songfang Huang $^{2}$ Fei Huang $^{2}$ + +$^{1}$ Tsinghua University $^{2}$ Alibaba Group + +yuanz17@mails.tsinghua.edu.cn + +{chuanqi.tcq, songfang.hsf, f.huang}@alibaba-inc.com + +# Abstract + +Nested entities are observed in many domains due to their compositionality, which cannot be easily recognized by the widely-used sequence labeling framework. A natural solution is to treat the task as a span classification problem. To learn better span representation and increase classification performance, it is crucial to effectively integrate heterogeneous factors including inside tokens, boundaries, labels, and related spans which could be contributing to nested entities recognition. To fuse these heterogeneous factors, we propose a novel tri-affine mechanism including triaffine attention and scoring. Triaffine attention uses boundaries and labels as queries and uses inside tokens and related spans as keys and values for span representations. Triaffine scoring interacts with boundaries and span representations for classification. Experiments show that our proposed method outperforms previous span-based methods, achieves the state-of-the-art $F_{1}$ scores on nested NER datasets GENIA and KBP2017, and shows comparable results on ACE2004 and ACE2005. + +# 1 Introduction + +Named entity recognition (NER) is a fundamental natural language processing task that extracts entities from texts. Flat NER has been well studied and is usually viewed as a sequence labeling problem (Lample et al., 2016). However, nested entities also widely exist in real-world applications due to their multi-granularity semantic meaning (Alex et al., 2007; Yuan et al., 2020), which cannot be solved by the sequence labeling framework since tokens have multiple labels (Finkel and Manning, 2009). + +Various paradigms for nested NER have been proposed in recent years. A representative direction is the span-based approach that learns deep representation for every possible span and then classifies it to the corresponding type (Zheng et al., + +protein DNA + +a defective NF - chi B site was completely inactive in EBV - transformed B cells, ... + +cell line cell type + +Figure 1: An example sentence with nested entities from the GENIA dataset. + +2019; Xia et al., 2019; Wadden et al., 2019; Tan et al., 2020; Wang et al., 2020; Yu et al., 2020). By leveraging the large-scale pretrained language model, several works show that the simple model structure for span representation and classification can achieve satisfactory results (Luan et al., 2019; Zhong and Chen, 2021). However, we still believe that explicit modeling of some relevant features will further benefit the span representation and classification under the complex nested setting. Taking Figure 1 as an example, we claim that the following factors are critical for recognizing whether a span is an entity. (1) Tokens: It is obvious that tokens of the given span contribute to the recognition. (2) Boundaries: We emphasize boundaries (or boundary tokens) because they are special tokens with rich semantics. Works with simple structure may just produce the span representation based on the concatenation or biaffine transformation of boundary representation (Yu et al., 2020; Fu et al., 2021). Some other works take boundary detection as additional supervision for better representation learning (Zheng et al., 2019; Tan et al., 2020). More importantly, a unilateral boundary cannot determine the entity type since it can exist in multiple entities with different labels (e.g., “ $NF$ ”, “ $B$ ”, and “ $cells$ ”) under the nested setting. (3) Labels: As mentioned above, tokens could belong to entities with different labels. Therefore, we propose that the model should learn label-aware span representation to take into consideration of the different + +token contributions at the label level. For example, "NF" may contribute more to "protein" type when classifying the span "NF - chi B", as well as "chi B" and "site" contribute more to "DNA" type when classifying the span "NF - chi B site". (4) Related spans: Interactions among spans are important in nested entities (Luo and Zhao, 2020; Wang et al., 2020; Fu et al., 2021). The insider and outsider entities may hint at each other's types. For example, entities inside "EBV-transformed B cells" have more possibilities to be cell-related entities. Interactions can also help the non-entity span like "transformed B cells" to validate its partialness by looking at outer entity "EBV - transformed B cells". + +Although some of the factors may have been explored in previous works, to the best of our knowledge, it is the first work to fuse all these heterogeneous factors into a unified network. As the traditional additive, multiplicative attention, or biaffine transformation cannot interact with such multiple heterogeneous factors simultaneously, we propose a novel triaffine mechanism as the tensor multiplication with three rank-1 tensors (vectors) and a rank-3 tensor, which makes it possible to jointly consider high-order interactions among multiple factors. Specifically, our method follows the pipeline of span representation learning and classification. At the stage of span representation learning, we apply the triaffine attention to aggregate the label-wise span representations by considering boundaries and labels as queries as well as inside tokens as keys and values. Then, a similar triaffine attention is applied to produce the label-wise cross-span representations by querying boundaries and labels with related spans. At the stage of span classification, we fuse the span representations and boundaries for label-wise classification with a triaffine score function. In practice, we add an auxiliary object function to classify spans without the cross-span interaction, which benefits learning robust span representation and can be used as a span filter to speed up both training and inference without performance degradation. + +We conduct experiments on four nested NER datasets: ACE2004, ACE2005, GENIA, and KBP2017. Our model achieves 88.56, 88.83, 81.23, and 87.27 scores in terms of $F_{1}$ , respectively. Using the BERT encoder, our model outperforms state-of-the-art methods on GENIA and KBP2017 and + +shows comparable performances on ACE2004 and ACE2005 with the latest generative methods. Ablation studies show the effectiveness of each factor and the superiority of the triaffine mechanism. + +Our contributions are summarized as ${}^{2}$ : + +- We propose that heterogeneous factors (i.e., tokens, boundaries, labels, related spans) should be taken into consideration in the span-based methods for nested NER. +- We propose a span-based method with a novel triaffine mechanism including triaffine attention and scoring to fuse the above-mentioned heterogeneous factors for span representations and classification. +- Experiments show that our proposed method performs better than existing span-based methods and achieves state-of-the-arts performances on GENIA and KBP17. + +# 2 Related Work + +# 2.1 Nested NER + +Nested NER approaches do not have a unified paradigm. Here we mainly focus on span-based methods since they are close to our work. + +The span-based methods are one of the most mainstream ways for the nested NER. With the development of pre-training, it is easy to obtain the span representation by the concatenation of boundary representation (Luan et al., 2019; Zhong and Chen, 2021) or the aggregated representation of tokens (Zheng et al., 2019; Wadden et al., 2019), and then follow a linear layer (Xia et al., 2019) or biaffine transformation (Yu et al., 2020) for classification. Several works improve the span-based methods with additional features or supervision. Zheng et al. (2019); Tan et al. (2020) point out the importance of boundaries and therefore introduce the boundary detection task. Wang et al. (2020) propose Pyramid to allow interactions between spans from different layers. Fu et al. (2021) adopt TreeCRF to model interactions between nested spans. Compared with previous methods, our method can jointly fuse multiple heterogeneous factors with the proposed triaffine mechanism. + +Other methods for nested NER vary greatly. Earlier research on nested NER is rule-based (Zhang et al., 2004). Lu and Roth (2015); Katiyar and + +Cardie (2018); Wang and Lu (2018) leverage the hypergraph to represent all possible nested structures, which needs to be carefully designed to avoid spurious structures and structural ambiguities. Wang et al. (2018); Fisher and Vlachos (2019) predict the transition actions to construct nested entities. Lin et al. (2019) propose an anchor-based method to recognize entities. There are other works that recognize entities in a generative fashion (Yan et al., 2021; Shen et al., 2021; Tan et al., 2021). Generally, it is not a unified framework for nested NER, and we model it with a span-based method since it is most straightforward. + +# 2.2 Affine Transformations in NLP + +Dozat and Manning (2017) introduce the biaffine transformation in the dependency parsing task for arc classification. Later, it is widely used in many tasks that need to model bilateral representations (Li et al., 2019; Yu et al., 2020). The triaffine transformation is further introduced to extend biaffine transformation for high-order interaction in the field of dependency parsing (Wang et al., 2019; Zhang et al., 2020) and semantic role labeling (Li et al., 2020b). Except for the similar formula of vectors' interactions, the motivation and the use of triaffine are different in our paper. Firstly, they only model the homogeneous features such as three tokens, but our triaffine transformation can model heterogeneous factors including labels, boundaries, and related spans. Secondly, they usually leverage triaffine transformation to obtain log potentials for CRFs, but we apply it for span representation and classification. + +# 3 Approach + +Figure 2 shows an overview of our method. We will first introduce the triaffine transformations, which lie in the heart of our model to fuse heterogeneous factors. Then, we will introduce our model including triaffine attention and triaffine scoring based on the proposed triaffine transformations. + +# 3.1 Deep Triaffine Transformation + +We define the deep triaffine transformation with vectors $\mathbf{u},\mathbf{v},\mathbf{w}\in \mathbb{R}^d$ and a tensor $\mathcal{W}\in \mathbb{R}^{d + 1}\times$ $\mathbb{R}^d\times \mathbb{R}^{d + 1}$ which outputs a scalar by applying distinct MLP (multi-layer perceptron) transformations on input vectors and calculating tensor vector multiplications. A constant 1 is concatenated with inputs + +to retain the biaffine transformation. + +$$ +\mathbf {u} ^ {\prime} = \left[ \begin{array}{c} \mathrm {M L P} _ {\mathrm {a}} (\mathbf {u}) \\ 1 \end{array} \right], \mathbf {v} ^ {\prime} = \left[ \begin{array}{c} \mathrm {M L P} _ {\mathrm {c}} (\mathbf {v}) \\ 1 \end{array} \right] \tag {1} +$$ + +$$ +\mathbf {w} ^ {\prime} = \mathrm {M L P} _ {\mathrm {b}} (\mathbf {w}) \tag {2} +$$ + +$$ +\operatorname {T r i A f f} (\mathbf {u}, \mathbf {v}, \mathbf {w}, \mathcal {W}) = \mathcal {W} \times_ {1} \mathbf {u} ^ {\prime} \times_ {2} \mathbf {w} ^ {\prime} \times_ {3} \mathbf {v} ^ {\prime} \tag {3} +$$ + +where $\times_{n}$ is the mode- $n$ tensor vector multiplication and $\mathrm{MLP}_{\mathrm{t}}$ is a $t$ -layer MLP (0-layer MLP is equal to identify function). The tensor $\mathcal{W}$ is initialized using $\mathcal{N}(0,\sigma^2)$ . In our approach, we use boundary representations as $\mathbf{u}$ and $\mathbf{v}$ . Inside tokens or span representations are used as $\mathbf{w}$ . We denote the tensors in the triaffine attention as $\{\mathcal{W}_r\}$ and triaffine scoring as $\{\mathcal{V}_r\}$ , which decouples attention weights and scores for different labels. + +# 3.2 Text Encoding + +We follow Ju et al. (2018); Shen et al. (2021); Tan et al. (2021) to encode the text. For text $X = [x_{1}, x_{2}, \ldots, x_{N}]$ with $N$ tokens, we first generate the contextual embedding $\mathbf{x}_i^c$ with the pre-trained language model, + +$$ +\mathbf {x} _ {1} ^ {c}, \mathbf {x} _ {2} ^ {c}, \dots , \mathbf {x} _ {N} ^ {c} = \operatorname {P L M} \left(x _ {1}, x _ {2}, \dots , x _ {N}\right) \tag {4} +$$ + +Then, we concatenate $\mathbf{x}_i^c$ with word embedding $\mathbf{x}_i^w$ , part-of-speech embedding $\mathbf{x}_i^p$ and character embedding $\mathbf{x}_i^{ch}$ , and feed the concatenated embedding $\mathbf{x}_i$ into a BiLSTM (Hochreiter and Schmidhuber, 1997) to obtain the token representations $\{\mathbf{h}_i\}$ . + +# 3.3 Triaffine Attention for Span Representations + +To fuse heterogeneous factors for better span representation, we propose a triaffine attention mechanism shown in Figure 3a. To interact tokens with labels and boundaries, we learn the label-wise span representation $\mathbf{h}_{i,j,r}$ with the triaffine attention $\alpha_{i,j,k,r}$ for the span $(i,j)$ : + +$$ +s _ {i, j, k, r} = \operatorname {T r i A f f} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {k}, \mathcal {W} _ {r}\right) \tag {5} +$$ + +$$ +\alpha_ {i, j, k, r} = \frac {\exp \left(s _ {i , j , k , r}\right)}{\sum_ {k ^ {\prime} = i} ^ {j} \exp \left(s _ {i , j , k ^ {\prime} , r}\right)} \tag {6} +$$ + +$$ +\mathbf {h} _ {i, j, r} = \sum_ {k = i} ^ {j} \alpha_ {i, j, k, r} \operatorname {M L P} \left(\mathbf {h} _ {k}\right) \tag {7} +$$ + +Boundary representations $(\mathbf{h}_i,\mathbf{h}_j)$ and the labelwise parameters $(\mathcal{W}_r)$ can be viewed as attention queries, and tokens $(\mathbf{h}_k)$ can be viewed as keys + +![](images/73ddceeed8f78b87a0448c426e18468c7546a8a95056877de45a949391ae906b.jpg) + +![](images/60b2edc09c7342b86295895c7714b2b7a0841336b8fc37e2e39aa16293e34aa9.jpg) +Figure 2: The architecture of our method. Green cubes indicate triaffine attention. Blue cubes indicate triaffine scoring. Orange arrows mean boundary information. Blue arrows mean inside tokens or related spans information. For each span, we have head and tail representations in yellow and label-wise span representations in different colors. The grey color indicates None class. +Figure 3: Visualization of triaffine attention, triaffine scoring, and the decomposition of triaffine scoring. + +and values. Compared with the general attention framework (additive or multiplicative attention), our triaffine attention permits all high-order interactions between heterogeneous queries and keys. + +# 3.4 Triaffine Attention for Cross-span Representations + +Motivated by the span-level interactions in the nested setting, we fuse related spans information into cross-span representations. We view the boundaries of the span and labels as attention queries, related spans (containing the span itself) as attention keys and values to obtain cross-span representations. Similar to the Equation 7, we obtain label-wise cross-span representations $\mathbf{h}_{i,j,r}^{c}$ for the span $(i,j)$ based on triaffine attention $\beta_{i,j,g,r}$ . + +$$ +q _ {i, j, g, r} = \operatorname {T r i A f f} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {i _ {g}, j _ {g}, r}, \mathcal {W} _ {r}\right) \tag {8} +$$ + +$$ +\beta_ {i, j, g, r} = \frac {\exp \left(q _ {i , j , g , r}\right)}{\sum_ {g ^ {\prime}} \exp \left(q _ {i , j , g ^ {\prime} , r}\right)} \tag {9} +$$ + +$$ +\mathbf {h} _ {i, j, r} ^ {c} = \sum_ {g} \beta_ {i, j, g, r} \operatorname {M L P} \left(\mathbf {h} _ {i _ {g}, j _ {g}, r}\right) \tag {10} +$$ + +where $\{(i_g,j_g)\}$ are the related spans. One can treat all enumerated spans as related spans, and we + +will introduce how we select them in Section 3.6. + +# 3.5 Triaffine Scoring for Span Classification + +To classify the entity type of the span, we calculate label-wise scores based on cross-span representations. Since boundary information has been proved effective in previous works (Yu et al., 2020; Fu et al., 2021), we leverage the boundaries information and cross-span representations for span classification via triaffine scoring. Specifically, we estimate the log probabilities $p_{i,j,r}^{c}$ of the span $(i,j)$ for label $r$ using boundaries $\mathbf{h}_i, \mathbf{h}_j$ and cross-span representations $\mathbf{h}_{i,j,r}^{c}$ . + +$$ +p _ {i, j, r} ^ {c} = \operatorname {T r i A f f} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {i, j, r} ^ {c}, \mathcal {V} _ {r}\right) \tag {11} +$$ + +Since $\mathbf{h}_{i,j,r}^c$ are composed by $\mathbf{h}_{i_g,j_g,r}$ , we can decompose Equation 11 into following if and only if the layer of MLP transformation on $\mathbf{h}_{i,j,r}^c$ is 0: + +$$ +t _ {i, j, g, r} = \operatorname {T r i A f f} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {i _ {g}, j _ {g}, r}, \mathcal {V} _ {r}\right) \tag {12} +$$ + +$$ +p _ {i, j, r} ^ {c} = \sum_ {g} \beta_ {i, j, g, r} t _ {i, j, g, r} \tag {13} +$$ + +Figure 3b and 3c show the mechanism of triaffine scoring and the decomposition. We also apply the + +similar decomposition functions in the auxiliary span classification task, which applies the triaffine scoring on boundary representations and intermediate span representations $\mathbf{h}_{i,j,r}$ to estimate log probabilities $p_{i,j,r}$ as intermediate predictions. + +# 3.6 Training and Inference + +In practice, it is expensive and non-informative to consider interactions between all spans. Therefore, we propose an auxiliary task to classify spans with intermediate span representations. Then, we can rank all spans based on the maximum of log probabilities (except None) from the intermediate predictions $p_{i,j} = \max_{r=1}^{R} p_{i,j,r}$ , and retain top- $m$ spans $\{(i_l, j_l)\}_{l=1}^m$ as candidates. We calculate cross-span representations $\mathbf{h}_{i_l, j_l,r}^c$ for retained spans by considering the full interactions among them, and estimate the classification logits $p_{i_l, j_l,r}^c$ . Thus, we have two groups of predictions in our model $\{p_{i,j,r}\}_{1 \leq i \leq j \leq N}$ and $\{p_{i_l, j_l,r}^c\}_{1 \leq l \leq m}$ . $\{p_{i,j,r}\}$ are calculated for every possible span, and $\{p_{i_l, j_l,r}^c\}$ are calculated only on top- $m$ spans. + +In the training phase, we jointly minimize two groups of cross-entropy losses: + +$$ +\mathcal {L} _ {a u x} = - \frac {2}{N (N + 1)} \sum_ {i, j} \log \frac {\exp \left(p _ {i , j , r _ {i j}}\right)}{\sum_ {r} \exp \left(p _ {i , j , r}\right)} \tag {14} +$$ + +$$ +\begin{array}{l} \mathcal {L} _ {\text {m a i n}} = - \frac {1}{m} \sum_ {1 \leq l \leq m} \log \frac {\exp \left(p _ {i _ {l} , j _ {l} , r _ {i _ {l} , j _ {l}}}\right)}{\sum_ {r} \exp \left(p _ {i _ {l} , j _ {l} , r} ^ {c}\right)} (15) \\ \mathcal {L} = \mu_ {a u x} \mathcal {L} _ {a u x} + \mathcal {L} _ {m a i n} (16) \\ \end{array} +$$ + +where $r_{ij}$ is the label of span $(i,j)$ . + +In both the training and inference phase, $\{p_{i,j,r}\}$ are used to select spans with high possibilities based on the supervision from $\mathcal{L}_{aux}$ . We inference the labels of selected spans using $\{p_{i_l,j_l,r}^c\}$ by assigning label $\tilde{r}_{i_l,j_l} = \arg_r\max p_{i_l,j_l,r}^c$ , and we assign None class for others. + +# 4 Experiments + +# 4.1 Datasets + +We conduct our experiments on the $\mathrm{ACE2004^3}$ , $\mathrm{ACE2005^4}$ (Doddington et al., 2004), GENIA (Kim et al., 2003) and KBP2017 $^5$ (Ji et al., 2017) datasets. + +To fairly compare with previous works, we follow the same dataset split with Lu and Roth (2015) for ACE2004 and ACE2005 and use the split from Lin et al. (2019) for GENIA and KBP2017 datasets. The statistics of all datasets are listed in Table 1. Following previous work, we measure the results using span-level precision, recall, and $F_{1}$ scores. + +# 4.2 Implementation Details + +We use BERT-large-cased (Devlin et al., 2019) and albert-xxlarge-v2 (Lan et al., 2020) as the contextual embedding, fastText (Bojanowski et al., 2017) as the word embedding in ACE2004, ACE2005 and KBP2017 dataset. We use BioBERT-v1.1 (Lee et al., 2020) and BioWordVec (Zhang et al., 2019) as the contextual and word embedding in the GENIA dataset respectively. We truncate the input texts with context at length 192. The part-of-speech embeddings are initialized with dimension 50. The char embeddings are generated by a one-layer BiLSTM with hidden size 50. The two-layers BiLSTM with a hidden size of 1,024 is used for the token representations. For triaffine transformations, we use $d = 256$ for the ACE2004, ACE2005, and KBP2017 dataset, and $d = 320$ for the GENIA dataset, respectively. We set $\mu_{aux}$ to 1.0, and select $m = 30$ in both training and inference. We use AdamW (Loshchilov and Hutter, 2019) to optimize our models with a linear learning rate decay. Detailed training parameters are presented in Appendix A. + +# 4.3 Baselines + +DYGIE (Luan et al., 2019) uses multi-task learning to extract entities, relations, and coreferences. + +MGNER (Xia et al., 2019) uses a detector to find span candidates and a classifier for categorization. + +BENSC (Tan et al., 2020) trains the boundary detection and span classification tasks jointly. + +TreeCRF (Fu et al., 2021) views entities as nodes in a constituency tree and decodes them with a Masked Inside algorithm. + +Biaffine (Yu et al., 2020) classifies spans by a bi-affine function between boundary representations. + +Pyramid (Wang et al., 2020) designs pyramid layer and inverse pyramid layer to decode nested entities. + +We also report the results of models with other paradigms, including hypergraph-based methods (Wang and Lu, 2018), transition-based methods (Fisher and Vlachos, 2019), generative methods (Yan et al., 2021; Tan et al., 2021; Shen et al., 2021), and so on. We do not compare to BERT-MRC (Li + +
ACE2004ACE2005GENIAKBP2017
TrainDevTestTrainDevTestTrainTestTrainDevTest
# sentences6,2007458127,1949691,04716,6921,85410,5465454,267
# entities22,2042,5143,03524,4113,2002,99350,5095,50631,2361,87912,601
# nested entities10,1491,0921,4179,3891,1121,1189,0641,1998,7736053,707
max entity count2822202723172514581521
+ +Table 1: Statistics of nested NER datasets ACE2004, ACE2005, GENIA, and KBP2017. + +
Model + EncoderACE2004ACE2005GENIA
PRF1PRF1PRF1
Span-based Methods
DYGIE (Luan et al., 2019) + LSTM--84.7--82.9--76.2
MGNER (Xia et al., 2019) + ELMo81.777.479.579.077.378.2---
BENSC (Tan et al., 2020)85.884.885.383.883.983.979.277.478.3
TreeCRF (Fu et al., 2021)86.786.586.684.586.485.478.278.278.2
Biaffine (Yu et al., 2020)87.386.086.785.285.685.481.879.380.5
Pyramid (Wang et al., 2020)86.0886.4886.2883.9585.3984.6679.4578.9479.19
Pyramid (Wang et al., 2020) + ALBERT87.7187.7887.7485.3087.4086.3480.3378.3179.31
Others
SH (Wang and Lu, 2018) + LSTM78.072.475.176.872.374.577.073.375.1
ARN (Lin et al., 2019) + LSTM76.273.674.975.873.974.8---
BiFlag (Luo and Zhao, 2020) + LSTM---75.075.275.177.474.676.0
Merge Label (Fisher and Vlachos, 2019)---82.782.182.4---
Seq2seq (Straková et al., 2019)--84.40--84.33--78.31
Second-best (Shibuya and Hovy, 2020)85.9485.6985.8283.8384.8784.3477.8176.9477.36
BartNER (Yan et al., 2021) + BART87.2786.4186.8483.1686.3884.7478.8779.6079.23
Sequence to Set (Tan et al., 2021)88.4686.1087.2687.4886.6387.0582.3178.6680.44
Locate and Label (Shen et al., 2021)87.4487.3887.4186.0987.2786.6780.1980.8980.54
Triaffine (Ours)87.1387.6887.4086.7086.9486.8280.4282.0681.23
Triaffine (Ours) + ALBERT88.8888.2488.5687.3990.3188.83---
+ +Table 2: Results on the ACE2004, ACE2005, and GENIA datasets. BERT is the default encoder if not specified. + +
Model + EncoderKBP2017
PRF1
ARN + LSTM77.771.874.6
BiFlag + LSTM77.174.375.6
Sequence to Set84.9183.0483.96
Locate and Label85.4682.6784.05
Triaffine (Ours)86.5083.6585.05
Triaffine (Ours) + ALBERT89.4285.2287.27
+ +Table 3: Results on the KBP2017 dataset. BERT is the default encoder if not specified. + +et al., 2020a) since they use additional resources as queries. DYGIE++ (Wadden et al., 2019) and PURE (Zhong and Chen, 2021) use different splits of the ACE datasets which are not comparable. + +# 4.4 Results + +We compare our method with baseline methods in Table 2 for the ACE2004, ACE2005, and GENIA datasets and Table 3 for the KBP2017 dataset, respectively. With BERT as the encoder, our model achieves 87.40, 86.82, 81.23, and 85.05 scores in terms of $F_{1}$ , outperforming all other span-based + +methods such as BENSC, Pyramid, TreeCRF, and Biaffine (+0.70 on ACE2004, +1.42 on ACE2005, +0.73 on GENIA). Compared with methods in other paradigms, our model also achieves the state-of-the-art results on the GENIA (+0.69 vs. Locate and Label) and KBP2017 dataset (+1.00 vs. Locate and Label) and shows comparable performances on ACE2004 (-0.01 vs. Locate and Label) and ACE2005 (-0.23 vs. Sequence to Set). With a stronger encoder ALBERT, our model achieves 88.56, 88.83, and 87.27 scores in terms of $F_{1}$ on ACE2004, ACE2005, and KBP2017 respectively, which exceeds all existing baselines including the Pyramid model with ALBERT (+0.82 on ACE2004, +2.49 on ACE2005) and the previous state-of-the-art method on KBP2017 dataset (+3.22 vs. Locate and Label). + +# 4.5 Ablation Study + +Considering we leverage multiple factors in multiple parts of the model, we design the following ablation settings to validate the effectiveness of each factor and the proposed triaffine mechanism. + +
SettingSpan RepresentationSpan ClassificationDatasets
LabelBoundaryFunctionBoundaryAttentionCrossFunctionACE2004F1GENIA
(a)×××××bi.86.7178.97
(b)tri.××lin.87.3680.50
(c)×tri.×tri.87.1780.49
(d)×lin.×tri.87.1480.50
(e)lin.×tri.87.3580.63
(f)tri.×lin.87.4980.70
(g)tri.×tri.87.5480.84
(h)tri.tri.87.8281.23
+ +Table 4: Ablation tests on ACE2004 development set and GENIA test set. Cross means using cross attention for span classification. Lin. means linear transformation, bi. means biaffine transformation, and tri. means triaffine transformation. + +(a) To show the effectiveness of triaffine mechanism, we use a baseline biaffine model with the combination of boundary representations: + +$$ +p _ {i, j, r} = \left[ \begin{array}{l} \mathbf {h} _ {i} \\ 1 \end{array} \right] ^ {T} \mathbf {V} _ {r} \left[ \begin{array}{l} \mathbf {h} _ {j} \\ 1 \end{array} \right] \tag {17} +$$ + +(b) To show the effectiveness of boundaries in scoring, we remove boundaries factor from scoring: + +$$ +p _ {i, j, r} = \mathbf {V} _ {r} \mathbf {h} _ {i, j, r} + \mathbf {b} _ {r} \tag {18} +$$ + +(c) To show the effectiveness of labels in representation, we remove label factor in attention: + +$$ +s _ {i, j, k, r} = \operatorname {T r i A f f} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {k}, \mathcal {W}\right) \tag {19} +$$ + +(d) To show the effectiveness of boundaries in representation, we remove boundaries factor in attention: + +$$ +s _ {i, j, k, r} = s _ {k, r} = \mathbf {q} _ {r} \cdot \mathbf {h} _ {k} \tag {20} +$$ + +(e) To show the effectiveness of the triaffine mechanism in representations, we replace triaffine attention with linear attention: + +$$ +s _ {i, j, k, r} = \mathbf {W} _ {r} \left(\mathbf {h} _ {i} \| \mathbf {h} _ {j} \| \mathbf {h} _ {k}\right) + \mathbf {c} _ {r} \tag {21} +$$ + +(f) To show the effectiveness of triaffine scoring, we replace triaffine scoring to linear scoring: + +$$ +p _ {i, j, r} = \mathbf {V} _ {r} \left(\mathbf {h} _ {i} \| \mathbf {h} _ {j} \| \mathbf {h} _ {i, j, r}\right) + \mathbf {b} _ {r} \tag {22} +$$ + +(g) To show the effectiveness of cross-span interactions, we use our partial model with intermediate predictions (model (a)-(g) use $p_{i,j,r}$ ). +(h) Our full model (i.e., use $p_{i_l,j_l,r}^c$ as predictions). + +Table 4 shows the results of ablation studies on ACE2004 and GENIA datasets. We use BERT-large-cased as the backbone encoder + +on ACE2004 and BioBERT-v1.1 on GENIA, respectively. By comparing (a) with (g), we observe significant performances drop (-0.87 on ACE2004, -1.87 on GENIA), which indicates that our proposed triaffine mechanism with multiple heterogeneous factors performs better than the biaffine baseline. Comparing (b) with (g), we find that the boundary information contributes to span classification. Comparing (c) and (d) with (g) supports that either label or boundary in the triaffine attention improves the performance. The setting (g) performs better than (e) and (f), which shows the superiority of the triaffine transformation over the linear function. We observe that (h) performs better than (g) (+0.28 on ACE2004, +0.39 on GENIA), proving the strength of triaffine attention with interactions among related spans. The above studies support that our proposed triaffine mechanism with associated heterogeneous factors is effective for span representation and classification. + +# 4.6 Discussion + +We compare the $F_{1}$ scores of GENIA between tri-affine model (g) and biaffine model (a) grouped by entity lengths in Figure 4. In all columns, the $F_{1}$ score of our method is better than the baseline. Furthermore, the right columns show that the $F_{1}$ score of the baseline gradually decreases with the incremental entity lengths. However, our method based on the triaffine mechanism with heterogeneous factors takes advantage of the interaction from boundaries and related spans, which keeps consistent results and outperforms the baseline. + +The results grouped by flat or nested entities are shown in Table 6. Our method has consistent improvements than the baseline, especially for the nested setting. Based on the above observations, our method is good at solving long entities that are + +
SpanTypepi,j,r ProbabilityRankTypepci,j,r Probability
... [Cisco]ORG's been slammed, but once [they]ORG're exposed to [the rest of [the trading population]PER]PER ...
CiscoORG1.001ORG1.00
theyORG1.002ORG1.00
the rest of the trading populationPER1.003PER1.00
the trading populationGPE0.504PER0.68
populationNone1.005None1.00
... simian virus 40 enhancer activity was blocked by the [MnII-AluI fragment]DNA in [HeLa cells]cl but not in [B cells]ct.
HeLa cellscell line0.991cell line0.99
B cellscell type0.972cell type0.88
MnII-AluI fragmentDNA0.963DNA0.95
simian virus 40 enhancerDNA0.904DNA0.89
MnII-AluIprotein0.435None0.41
40 enhancerNone0.996None1.00
+ +![](images/2b7ccd88d10d88329f422ace76d72478a11fd1f9e6d7ba16961737ca2a33b0db.jpg) +Figure 4: Comparison between triaffine and biaffine models on GENIA with different lengths of entities. Entity counts are in the parentheses. + +Table 5: Case study on ACE2004 and GENIA dataset. Colored brackets indicate the boundaries and semantic types of entities in true labels. "cl" and "ct" is the abbreviation of cell line and cell type, respectively. + +
ACE2004GENIA
Flat (1,422)Nested (1,092)Flat (4,307)Nested (1,199)
(a)88.5184.1980.0974.23
(h)89.5485.4582.1877.24
Δ+1.03+1.26+2.09+3.01
+ +Table 6: Comparison between triaffine and biaffine models on ACE2004 and GENIA grouped by flat or nested entities. Entity counts are in the parentheses. + +more likely to be nested, which supports our model is built upon the characteristics of nested NER. + +At the stage of cross-span interactions, we only select top- $m$ spans in practice. In Figure 5, we analyze the number $m$ in two aspects. Firstly, we check the recall of entity spans. We observe that taking top-30 spans achieves a recall of 99.89, which means it covers almost all entities. As the maximum number of entities is 25, we believe it is enough to select top-30 spans. Secondly, we check the model performance. With top-30 spans, the model achieves 81.23 scores in terms of $F_{1}$ and + +![](images/322b5c10c8170a435c1984fcc52a92bf26f907cc4ed471714e63081519ef09fd.jpg) +Figure 5: Recall for entity spans and $F_{1}$ scores with different numbers of candidate spans in GENIA dataset. + +there is no obvious performance improvement with more candidates. Based on two above observations, we choose $m = 30$ , which can well balance the performance and efficiency. + +Finally, we test the efficiency of the decomposition. Compared with the naive triaffine scoring that takes $638.1\mathrm{ms}$ (509.4ms in GPU + 128.7ms in CPU), the decomposed triaffine scoring takes $432.7\mathrm{ms}$ (330.5ms in GPU + 102.2ms in CPU) for 10 iterations, which leads to approximately $32\%$ speedup (details are shown in Appendix B). + +# 4.7 Case Study + +To analyze the effect of fusing information from related spans with the cross-span interaction, we show two examples from ACE2004 and GENIA datasets in Table 5. In the first example, the model first predicts "the trading population" as "GPE", however, it revises to "PER" correctly by considering span interactions with the outer span "the rest of the trading population". In the second example, it first predicts "MnI-AluI" as "protein". By interacting with surrounding entities "MnI-AluI fragment", the model corrects its label to None. + +# 5 Conclusion + +In this paper, we propose a span-based method for nested NER. Heterogeneous factors including tokens, boundaries, labels, and related spans are introduced to improve span classification with a novel triaffine mechanism. Experiments show our method outperforms all span-based methods and achieves state-of-the-art performance on four nested NER datasets. Ablation studies show the introduced heterogeneous factors and triaffine mechanism are helpful for nested setting. Despite that large-scale pretrained language models have shown consistent improvement over many NLP tasks, we argue that the well-designed features and model structures are still useful for complex tasks like nested NER. Furthermore, although we only verify our triaffine mechanism in nested NER, we believe it can also be useful in tasks requiring high order interactions like parsing and semantic role labeling. + +# Acknowledgements + +We would like to thank the anonymous reviewers for their helpful comments and suggestions. We thank Yao Fu, Yongliang Shen, Shengxuan Luo, Hongyi Yuan, Zhengyun Zhao, Xu Chen, and Jiayu Li for their help. This work was supported by Alibaba Group through Alibaba Research Intern Program. + +# References + +Beatrice Alex, Barry Haddow, and Claire Grover. 2007. Recognising nested named entities in biomedical text. In Biological, translational, and clinical language processing, pages 65-72. +Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135-146. +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. +George R Doddington, Alexis Mitchell, Mark A Przybocki, Lance A Ramshaw, Stephanie M Strassel, and Ralph M Weischedel. 2004. The automatic content extraction (ace) program-tasks, data, and evaluation. In Lrec, volume 2, pages 837-840. Lisbon. + +Timothy Dozat and Christopher D. Manning. 2017. Deep biaffine attention for neural dependency parsing. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. +Jenny Rose Finkel and Christopher D Manning. 2009. Nested named entity recognition. In Proceedings of the 2009 conference on empirical methods in natural language processing, pages 141-150. +Joseph Fisher and Andreas Vlachos. 2019. Merge and label: A novel neural network architecture for nested NER. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5840-5850, Florence, Italy. Association for Computational Linguistics. +Yao Fu, Chuanqi Tan, Mosha Chen, Songfang Huang, and Fei Huang. 2021. Nested named entity recognition with partially-observed treecrfs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 12839–12847. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735-1780. +Heng Ji, Xiaoman Pan, Boliang Zhang, Joel Nothman, James Mayfield, Paul McNamee, and Cash Costello. 2017. Overview of tac-kbp2017 13 languages entity discovery and linking. Theory and Applications of Categories. +Meizhi Ju, Makoto Miwa, and Sophia Ananiadou. 2018. A neural layered model for nested named entity recognition. 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 1446-1459, New Orleans, Louisiana. Association for Computational Linguistics. +Arzoo Katiyar and Claire Cardie. 2018. Nested named entity recognition revisited. 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 861-871. +J-D Kim, Tomoko Ohta, Yuka Tateisi, and Jun'ichi Tsujii. 2003. Genia corpus—a semantically annotated corpus for bio-textmining. Bioinformatics, 19(suppl_1):i180-i182. +Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 260-270, San Diego, California. Association for Computational Linguistics. + +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 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. +Jinhyuk Lee, Wonjin Yoon, Sungdong Kim, Donghyeon Kim, Sunkyu Kim, Chan Ho So, and Jaewoo Kang. 2020. Biobert: a pre-trained biomedical language representation model for biomedical text mining. Bioinformatics, 36(4):1234-1240. +Xiaoya Li, Jingrong Feng, Yuxian Meng, Qinghong Han, Fei Wu, and Jiwei Li. 2020a. A unified MRC framework for named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5849-5859, Online. Association for Computational Linguistics. +Zuchao Li, Shexia He, Hai Zhao, Yiqing Zhang, Zhuosheng Zhang, Xi Zhou, and Xiang Zhou. 2019. Dependency or span, end-to-end uniform semantic role labeling. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 6730-6737. +Zuchao Li, Hai Zhao, Rui Wang, and Kevin Parnow. 2020b. High-order semantic role labeling. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 1134–1151, Online. Association for Computational Linguistics. +Hongyu Lin, Yaojie Lu, Xianpei Han, and Le Sun. 2019. Sequence-to-nuggets: Nested entity mention detection via anchor-region networks. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5182-5192, Florence, Italy. Association for Computational Linguistics. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. +Wei Lu and Dan Roth. 2015. Joint mention extraction and classification with mention hypergraphs. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 857-867. +Yi Luan, Dave Wadden, Luheng He, Amy Shah, Mari Ostendorf, and Hannaneh Hajishirzi. 2019. A general framework for information extraction using dynamic span graphs. 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 3036-3046, Minneapolis, Minnesota. Association for Computational Linguistics. +Ying Luo and Hai Zhao. 2020. Bipartite flat-graph network for nested named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6408-6418, Online. Association for Computational Linguistics. + +Yongliang Shen, Xinyin Ma, Zeqi Tan, Shuai Zhang, Wen Wang, and Weiming Lu. 2021. Locate and label: A two-stage identifier for nested named entity recognition. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics. +Takashi Shibuya and Eduard Hovy. 2020. Nested named entity recognition via second-best sequence learning and decoding. Transactions of the Association for Computational Linguistics, 8:605-620. +Jana Straková, Milan Straka, and Jan Hajic. 2019. Neural architectures for nested NER through linearization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5326-5331, Florence, Italy. Association for Computational Linguistics. +Chuanqi Tan, Wei Qiu, Mosha Chen, Rui Wang, and Fei Huang. 2020. Boundary enhanced neural span classification for nested named entity recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9016-9023. +Zeqi Tan, Yongliang Shen, Shuai Zhang, Weiming Lu, and Yueting Zhuang. 2021. A sequence-to-set network for nested named entity recognition. In Proceedings of the 30th International Joint Conference on Artificial Intelligence, IJCAI-21. +David Wadden, Ulme Wennberg, Yi Luan, and Hannaneh Hajishirzi. 2019. Entity, relation, and event extraction with contextualized span representations. 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 5784-5789, Hong Kong, China. Association for Computational Linguistics. +Bailin Wang and Wei Lu. 2018. Neural segmental hypergraphs for overlapping mention recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 204-214, Brussels, Belgium. Association for Computational Linguistics. +Bailin Wang, Wei Lu, Yu Wang, and Hongxia Jin. 2018. A neural transition-based model for nested mention recognition. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1011-1017, Brussels, Belgium. Association for Computational Linguistics. +Jue Wang, Lidan Shou, Ke Chen, and Gang Chen. 2020. Pyramid: A layered model for nested named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5918-5928. +Xinyu Wang, Jingxian Huang, and Kewei Tu. 2019. Second-order semantic dependency parsing with end-to-end neural networks. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4609-4618, Florence, Italy. Association for Computational Linguistics. + +Congying Xia, Chenwei Zhang, Tao Yang, Yaliang Li, Nan Du, Xian Wu, Wei Fan, Fenglong Ma, and Philip Yu. 2019. Multi-grained named entity recognition. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1430-1440, Florence, Italy. Association for Computational Linguistics. + +Hang Yan, Tao Gui, Junqi Dai, Qipeng Guo, Zheng Zhang, and Xipeng Qiu. 2021. A unified generative framework for various NER subtasks. 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 5808-5822, Online. Association for Computational Linguistics. + +Juntao Yu, Bernd Bohnet, and Massimo Poesio. 2020. Named entity recognition as dependency parsing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6470-6476, Online. Association for Computational Linguistics. + +Zheng Yuan, Yuanhao Liu, Qiuyang Yin, Boyao Li, Xiaobin Feng, Guoming Zhang, and Sheng Yu. 2020. Unsupervised multi-granular Chinese word segmentation and term discovery via graph partition. Journal of Biomedical Informatics, 110:103542. + +Jie Zhang, Dan Shen, Guodong Zhou, Jian Su, and Chew-Lim Tan. 2004. Enhancing hmm-based biomedical named entity recognition by studying special phenomena. Journal of biomedical informatics, 37(6):411-422. + +Yijia Zhang, Qingyu Chen, Zhihao Yang, Hongfei Lin, and Zhiyong Lu. 2019. Biowordvec, improving biomedical word embeddings with subword information and mesh. Scientific data, 6(1):1-9. + +Yu Zhang, Zhenghua Li, and Min Zhang. 2020. Efficient second-order TreeCRF for neural dependency parsing. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3295-3305, Online. Association for Computational Linguistics. + +Changmeng Zheng, Yi Cai, Jingyun Xu, HF Leung, and Guandong Xu. 2019. A boundary-aware neural model for nested named entity recognition. 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). Association for Computational Linguistics. + +Zexuan Zhong and Danqi Chen. 2021. A frustratingly easy approach for entity and relation extraction. In North American Association for Computational Linguistics (NAACL). + +# A Reproducibility Checklist + +We set seeds of torch, torch.cuda, numpy, and random in Python to ensure reproducibility. We use + +a grid search to find the best hyperparameters depending on development set performances. We search contextual embedding learning rate among $\{1\mathrm{e} - 5,3\mathrm{e} - 5\}$ . If the contextual embedding learning rate is 1e-5, we use static embedding learning rate and task learning rate as 1e-4 and 1e-5. If the contextual embedding learning rate is 3e-5, we use static embedding learning rate and task learning rate as 5e-4 and 3e-5. We search batch size among $\{8,48,72\}$ . We search MLP dropout ratio among $\{0.1,0.2\}$ . The final hyperparameters we used for four datasets are listed in Table 7 and Table 8. + +
ParametersACE04ACE05KBP17GENIA
Epoch50505015
PLM lr1e-53e-51e-53e-5
Static emb. lr1e-45e-41e-45e-4
Task lr1e-53e-51e-53e-5
σ0.010.010.010.01
Batch size872848
d256256256320
m30303030
Adam ε1e-81e-81e-81e-8
Warmup ratio0.00.00.00.0
Emb. dropout0.20.20.20.2
MLP dropout0.10.10.10.2
Weight decay0.010.010.010.01
Clipping grad0.10.10.10.1
+ +Table 7: Hyper-parameters for using BERT encoder. + +
ParametersACE04ACE05KBP17
Epoch101010
PLM lr1e-51e-53e-5
Static emb. lr1e-41e-45e-4
Task lr1e-51e-53e-5
σ0.010.010.01
Batch size8872
d256256256
m303030
Adam ε1e-81e-81e-8
Warmup ratio0.00.00.0
Emb. dropout0.20.20.2
MLP dropout0.10.10.2
Weight decay0.010.010.01
Clipping grad0.10.10.1
+ +Table 8: Hyper-parameters for using ALBERT encoder. + +# B The Decomposition of Triaffine Scoring + +We introduce the decomposition of triaffine scoring in calculating $p_{i,j,r}$ and $p_{i,j,r}^{c}$ . + +The naive calculation procedure of $p_{i,j,r}$ is: + +$$ +s _ {i, j, k, r} = \operatorname {T r i A f f} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {k}, \mathcal {W} _ {r}\right) \tag {23} +$$ + +$$ +\alpha_ {i, j, k, r} = \frac {\exp \left(s _ {i , j , k , r}\right)}{\sum_ {k ^ {\prime} = i} ^ {j} \exp \left(s _ {i , j , k ^ {\prime} , r}\right)} \tag {24} +$$ + +$$ +\mathbf {h} _ {i, j, r} = \sum_ {k = i} ^ {j} \alpha_ {i, j, k, r} \operatorname {M L P} \left(\mathbf {h} _ {k}\right) \tag {25} +$$ + +$$ +p _ {i, j, r} = \operatorname {T r i A f f} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {i, j, r}, \mathcal {V} _ {r}\right) \tag {26} +$$ + +For our proposed decomposition of $p_{i,j,r}$ , we first calculate $\alpha_{i,j,k,r}$ as equations 23 and 24. And we calculate: + +$$ +o _ {i, j, k, r} = \operatorname {T r i A f f} \left(\mathbf {h} _ {i}, \mathbf {h} _ {j}, \mathbf {h} _ {k}, \mathcal {V} _ {r}\right) \tag {27} +$$ + +$$ +p _ {i, j, r} = \sum_ {k = i} ^ {j} \alpha_ {i, j, k, r} o _ {i, j, k, r} \tag {28} +$$ + +The main difference between naive calculation and decomposition calculation is between Equation 26 and Equation 27. + +We suppose our batch size as $B$ , sequence count as $N$ , output dimensions of MLP layers as $d$ , the count of spans for calculating cross span representations as $m$ , and label count as $R$ (including None class). The shapes of tensors $[\mathbf{h}_i]$ , $[\mathbf{h}_j]$ , $[\mathbf{h}_k]$ are $B \times N \times d$ . The shape of tensor $[\mathbf{h}_{i,j,r}]$ is $B \times N \times N \times R \times d$ . + +We benchmark the performances of Equation 26 and Equation 27 in PyTorch for 10 iterations. We use the same hyper-parameters and devices as our main experiments. We leverage opt_einsum to calculate triaffine transformations in both equations. + +Table 9 shows the time usage comparison between Equation 26 and Equation 27. Equation 26 uses $309.7\mathrm{ms}$ (300.5ms in GPU + 9.2ms in CPU) and Equation 27 uses $150.1\mathrm{ms}$ (145.6ms in GPU + 4.4ms in CPU). The larger tensor size and higher rank of $[\mathbf{h}_{i,j,r}]$ results in slower calculations of aten::bmm, aten::copy_ and aten::permute in Equation 26. The time usage differences are clearly dominated by the function aten::copy_, which is optimized by our decomposition. + +We also compare the time usage between the naive triaffine scoring and the decomposed triaffine scoring in Table 9. The naive triaffine scoring takes $638.1\mathrm{ms}$ (509.4ms in GPU + 128.7ms in CPU), and the decomposed triaffine scoring takes $432.7\mathrm{ms}$ (330.5ms in GPU + 102.2ms in CPU) + +for 10 iterations, which leads to approximately $32\%$ speedup. The GPU time usages are reasonable since they both need to calculate two triaffine transformations. The CPU time usages increase for both naive and decomposition triaffine scoring. Additional CPU time usages come from function aten::einsum, aten::permute, and aten::reshape, and the naive calculation increases more due to slower aten::einsum. Overall, the decomposition triaffine scoring uses less time on both GPU and CPU than the naive triaffine scoring. + +Furthermore, we also test the time usage of $p_{i,j,r}^{c}$ using two calculation procedures. We find using the decomposition triaffine scoring still has about 6% speed up (naive:125.8ms in GPU + 15.0ms in CPU vs. decomposition:115.5ms in GPU + 16.8ms in CPU) regardless the relatively small size of $\mathbf{h}_{i,j,r}^{c}$ (The shape of tensor $[\mathbf{h}_{i,j,r}^{c}]$ is $B \times m \times R \times d$ ). + +
MethodFunctionCPU TimeGPU Time
UsagePercentageUsagePercentage
Equation 26aten::copy_0.5ms5.9%223.7ms74.5%
aten::bmm0.5ms5.0%38.2ms12.7%
aten::mm1.5ms15.7%37.1ms12.3%
Total9.2ms100.0%300.5ms100.0%
Equation 27aten::copy_0.2ms4.7%62.5ms42.9%
aten::bmm0.4ms10.0%47.4ms32.6%
aten::mm0.3ms6.0%34.4ms23.7%
Total4.4ms100.0%145.6ms100.0%
Naiveaten::copy_7.3ms5.7%302.3ms59.3%
aten::bmm1.2ms0.9%109.3ms21.5%
aten::mm1.7ms1.4%74.4ms14.6%
aten::einsum61.8ms48.0%1.1ms0.2%
aten::permute36.7ms28.5%0.8ms0.2%
aten::reshape1.3ms3.1%0.5ms0.1%
Total128.7ms100.0%509.4ms100.0%
Decomposeaten::copy_0.7ms0.8%136.7ms41.4%
aten::bmm1.2ms1.2%102.6ms31.0%
aten::mm5.4ms5.3%69.0ms20.9%
aten::einsum32.0ms31.3%1.1ms0.3%
aten::permute15.4ms15.1%0.7ms0.2%
aten::reshape37.4ms36.6%0.5ms0.2%
Total102.2ms100.0%330.5ms100.0%
+ +Table 9: Time usage compared with naive triaffine scoring and decomposed triaffine scoring. \ No newline at end of file diff --git a/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/images.zip b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9ade3fb699db385aa8031801a8deba9427a8c709 --- /dev/null +++ b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5361c41d5dd28aed0ae9f2db64c507b8d93fa843bf149cdc54b4d9426817b0a2 +size 801534 diff --git a/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/layout.json b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..000e1c251930809195b8d05b0a9904b69795a9f5 --- /dev/null +++ b/fusingheterogeneousfactorswithtriaffinemechanismfornestednamedentityrecognition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ee8352b20da128814fe28be4dca43f7dd97bc352fafb19ce98c5dc35529f5ac +size 463422 diff --git a/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_content_list.json b/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..49768ad1891113d162f734417518b4ae9cbac272 --- /dev/null +++ b/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28af48267a720ba09ce80e13f5c4d7697eb0cbbe0a8f4ab5553c0793e3f20d39 +size 89312 diff --git a/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_model.json b/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a0b42d6274c9a6326d7d7f5d5a6f701337d56689 --- /dev/null +++ b/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c50564971f19e2b6143738a89a37f409489b65a2229edf90ee23425a74386231 +size 107192 diff --git a/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_origin.pdf b/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..937e95e666f3ca5faf189d182a1933e6e779580d --- /dev/null +++ b/gaussianmultiheadattentionforsimultaneousmachinetranslation/eaa4c92c-af96-451e-aacb-981635440c06_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d8a90d77e225bc9f836971abae36fc7b822139fe9d796347ebdb5e6b8cb7f04 +size 1749261 diff --git a/gaussianmultiheadattentionforsimultaneousmachinetranslation/full.md b/gaussianmultiheadattentionforsimultaneousmachinetranslation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..66f4e04b53622a3cd55d214b490577fc1f40d3fe --- /dev/null +++ b/gaussianmultiheadattentionforsimultaneousmachinetranslation/full.md @@ -0,0 +1,411 @@ +# Gaussian Multi-head Attention for Simultaneous Machine Translation + +Shaolei Zhang $^{1,2}$ , Yang Feng $^{1,2*}$ + +1Key Laboratory of Intelligent Information Processing + +Institute of Computing Technology, Chinese Academy of Sciences (ICT/CAS) + +$^{2}$ University of Chinese Academy of Sciences, Beijing, China + +{zhangshaolei20z, fengyang}@ict.ac.cn + +# Abstract + +Simultaneous machine translation (SiMT) outputs translation while receiving the streaming source inputs, and hence needs a policy to determine where to start translating. The alignment between target and source words often implies the most informative source word for each target word, and hence provides the unified control over translation quality and latency, but unfortunately the existing SiMT methods do not explicitly model the alignment to perform the control. In this paper, we propose Gaussian Multi-head Attention (GMA) to develop a new SiMT policy by modeling alignment and translation in a unified manner. For SiMT policy, GMA models the aligned source position of each target word, and accordingly waits until its aligned position to start translating. To integrate the learning of alignment into the translation model, a Gaussian distribution centered on predicted aligned position is introduced as an alignment-related prior, which cooperates with translation-related soft attention to determine the final attention. Experiments on $\mathrm{En} \rightarrow \mathrm{Vi}$ and $\mathrm{De} \rightarrow \mathrm{En}$ tasks show that our method outperforms strong baselines on the trade-off between translation and latency. + +# 1 Introduction + +Simultaneous machine translation (SiMT) (Gu et al., 2017; Ma et al., 2019; Arivazhagan et al., 2019), which outputs translation before receiving the complete source sentence, is mainly used for streaming translation tasks, such as simultaneous interpretation, live broadcast and online translation. Different from full-sentence machine translation which waits for the complete source sentence, SiMT requires a policy to determine where to start translating when given the streaming inputs. The SiMT policy has to trade off between translation quality and latency and an ideal one should wait + +![](images/4e34a89b1019cd35627ff10fcb1360d1efa28d3c9a867206561653470ad26f21.jpg) +(a) Predict READ/WRITE action + +![](images/03f97e0d1e48aa521a48b85fa225e3365e8c60c7da448e8fcd55ead3a0a10f3f.jpg) +(b) Predict incremental step +Figure 1: Comparison diagram of previous and proposed SiMT policy. The previous policies always predict the READ/WRITE action step by step, while our method directly predicts incremental step (i.e., number of waiting words) between two adjacent target words. + +for the right number of source words, which are sufficient but not excess, until deciding to output target words (Arivazhagan et al., 2019). + +For full-sentence translation, each target word is generated based on the attended source information, where each source word provides different amount of information for the target word. Among them, the most informative source word can be considered as an aligned word to the target word (Garg et al., 2019). Then for SiMT, the alignment can be a good guider for the policy to determine where to start translating. For high translation quality, the SiMT policy is supposed to start translating after receiving the aligned source word to ensure enough source information for the translation. To consider low latency, the SiMT policy is expected not to wait for too many words after receiving the aligned source word. Therefore, if the alignment can be modeled in the SiMT model explicitly, translation quality and latency can be controlled in a unified manner for an ideal SiMT policy. + +However, the existing SiMT methods, mostly employing fixed or adaptive policy, do not reflect + +the alignment information in the modeling, which makes them trade off between translation quality and latency in a separate way. Fixed policy, such as wait-k policy (Ma et al., 2019), waits for a fixed number of source words and then performs READ and WRITE operations one after another, so it is a rule-based policy and precludes alignment modeling. Adaptive policy, such as MILk (Arivazhagan et al., 2019) and MMA (Ma et al., 2020), determines READ/WRITE operations by sampling from a Bernoulli distribution, as shown in Figure 1(a), where the decisions are made independently and no relationship between the decision and translation is introduced, so it has to employ an additional loss to control the latency. Besides, some methods (Wilken et al., 2020; Arthur et al., 2021) apply external ground-truth alignment as an ideal position to start translating, but the performance is inferior to MMA since separating translation and alignment. + +In this paper, to explicitly involve alignments in the SiMT modeling, we propose Gaussian Multihead Attention (GMA) to develop a SiMT policy with the guidance of alignments. To determine where to start translating with alignment, GMA first models the aligned source position of the current target word via predicting the relative distance from the previous aligned source position, called incremental steps, shown in Figure 1(b). Meanwhile, a relaxation offset after the aligned position is set to allow the model to wait for some additional source inputs, thereby providing a controllable trade-off between translation quality and latency in practice. Accordingly, GMA starts translating after receiving the aligned source position and waiting for the extra relaxation offset. To jointly learn alignments (i.e., SiMT policy) and translation, a Gaussian distribution centered on predicted aligned position is introduced as a prior attention over the received source words. As a result, GMA finally uses the posterior attention for translation derived from the alignment-related Gaussian prior and translation-related soft attention. Experiments on $\mathrm{En} \rightarrow \mathrm{Vi}$ and $\mathrm{De} \rightarrow \mathrm{En}$ SiMT tasks show that GMA outperforms strong baselines on the trade-off between translation quality and latency. + +# 2 Background + +GMA is applied on the multi-head attention in Transformer (Vaswani et al., 2017), so we briefly introduce SiMT and the multi-head attention. + +# 2.1 Simultaneous Machine Translation + +In a translation task, we denote the source sentence as $\mathbf{x} = \{x_{1},\dots ,x_{J}\}$ and the corresponding source hidden states as $\mathbf{z} = \{z_1,\dots ,z_J\}$ with source length $J$ . The model generates a target sentence $\mathbf{y} = \{y_1,\dots ,y_I\}$ and the corresponding target hidden states $\mathbf{s} = \{s_1,\dots ,s_I\}$ with target length $I$ . Different from the full-sentence machine translation, the source words received by SiMT model are incremental and hence the model needs to decide where to output translation. + +Output position Define $g(i)$ (Ma et al., 2019) as a monotonic non-decreasing function of step $i$ , to denote the number of source words received by SiMT model when translating $y_i$ , i.e., $g(i)$ is the output position of $y_i$ . + +In SiMT, $g(i)$ is determined by the specific policy, and the probability of generating the target word $y_{i}$ is $p\left(y_{i} \mid \mathbf{x}_{\leq g(i)}, \mathbf{y}_{< i}\right)$ , where $\mathbf{x}_{\leq g(i)}$ is first $g(i)$ source words and $\mathbf{y}_{< i}$ is previous target words. Therefore, the decoding probability of $\mathbf{y}$ is calculated as: + +$$ +p (\mathbf {y} \mid \mathbf {x}) = \prod_ {i = 1} ^ {| \mathbf {y} |} p \left(y _ {i} \mid \mathbf {x} _ {\leq g (i)}, \mathbf {y} _ {< i}\right) \tag {1} +$$ + +# 2.2 Multi-head Attention + +Multi-head attention (Vaswani et al., 2017) contains multiple attention heads, where each attention head performs scaled dot-product attention. Our method is based on the cross-attention, where the queries are the target hidden states $\mathbf{s}$ , the keys and values both come from the source hidden states $\mathbf{z}$ . The soft attention weight $\alpha_{ij}$ is calculated as: + +$$ +\alpha_ {i j} = \operatorname {S o f t m a x} \left(\frac {Q \left(s _ {i}\right) K \left(z _ {j}\right) ^ {\top}}{\sqrt {d _ {k}}}\right) \tag {2} +$$ + +where $Q(\cdot)$ and $K(\cdot)$ are projection functions from the input space to the query and key space respectively, and $d_{k}$ is the dimension of inputs. Then the context vector $c_{i}$ is calculated as: + +$$ +c _ {i} = \sum_ {j = 1} ^ {J} \alpha_ {i j} V (z _ {j}) \tag {3} +$$ + +where $V(\cdot)$ is a projection function to value space. + +# 3 The Proposed Method + +The architecture of GMA is shown in Figure 2. For SiMT policy, GMA predicts the aligned source position of the current target word, and accordingly + +![](images/53862ab94097628ea30e7ac64a3367bac870ce035e09dad011353ab94b89a39b.jpg) +(a) Predict incremental step + +![](images/21e13c8c01b913509af5b565efc3caa7d2b966975ea93261366b79ca530a8bbb.jpg) +(b) Integrate alignment in translation +Figure 2: The architecture of GMA. (a) GMA first models the aligned source position of the current target word via predicting incremental step $\Delta p_i$ , and then waits until the aligned position to start translating. (b) To integrate the learning of alignment (which determines the latency) in translation, we introduce a Gaussian distribution centered on aligned source position as alignment-related prior probability, which is multiplied with soft attention (likelihood probability) to get final attention distribution (posterior probability). + +determines the output position. To integrate the learning of SiMT policy within the translation, we introduce a Gaussian prior centered on the predicted aligned position, which is multiplied with soft attention (Eq.(2)) to get final attention distribution. Due to the unimodality of Gaussian prior, it enables the model to learn the position that gets the highest soft attention (i.e., alignment), thereby developing a reasonable SiMT policy. Besides, since the Gaussian prior is continuous and differentiable, it can be integrated into the translation model directly and adjusted with the learning of translation. + +# 3.1 Alignment-Guided SiMT Policy + +Alignments prediction To develop a SiMT policy with alignments, GMA first predicts the aligned source position of the current target word. Due to the incrementality of streaming inputs in SiMT, it is unstable to directly predict the absolute position of the aligned source word. Instead, we predict the relative distance from the previous aligned source position, called incremental step. + +Formally, we denote the aligned source position of the $i^{th}$ target word as $p_i \in [1, J]$ and the incremental step as $\Delta p_i \in (0, +\infty)$ . Therefore, the aligned source position $p_i$ is calculated as: + +$$ +p _ {i} = \left\{ \begin{array}{c c} 1 & i = 0 \\ p _ {i - 1} + \Delta p _ {i} & i > 0 \end{array} \right. \tag {4} +$$ + +where we set the initial aligned position $p_0$ to the first source word, and the incremental step $\Delta p_i$ is predicted through a multi-layer perceptron (MLP) based on the previous target hidden state $s_{i - 1}$ : + +$$ +\Delta p _ {i} = \exp \left(\mathbf {V} _ {\mathbf {p}} ^ {\top} \tanh (\mathbf {W} _ {\mathbf {p}} Q (s _ {i - 1}))\right) \tag {5} +$$ + +where $\mathbf{W_p}$ , $\mathbf{V_p}$ are learnable parameters of MLP. + +# Algorithm 1: SiMT Policy of GMA + +Input :Streaming inputs x (incremental), Initial aligned position $p_0 = 1$ $i = 1,y_0 = \langle \mathrm{BOS}\rangle$ + +Output: Target outputs y + +1 while $y_{i - 1}\neq \langle \mathrm{EOS}\rangle$ do +2 calculate incremental step $\Delta p_i$ as Eq.(5) +3 $p_i\gets p_{i - 1} + \Delta p_i$ +4 $g(i) = \lfloor p_i + \delta \rfloor$ +5 if $g(i) > |\mathbf{x}|$ then //Wait +6 Wait Until receive $g(i)$ source words +7 continue +8 else //Translate +9 Translate $y_{i}$ with $\mathbf{x}_{\leq g(i)}$ and $\mathbf{y}_{< i}$ +10 end +11 $i\gets i + 1$ +12 end + +SiMT policy Besides the predicted aligned position $p_i$ , we also introduce a relaxation offset $\delta$ to allow the model to wait for some additional source inputs, thereby providing a controllable trade-off between translation quality and latency in practice. Specifically, the output position $g(i)$ (i.e., wait for the first $g(i)$ source words and then translate the $i^{th}$ target word) is calculated as: + +$$ +g (i) = \left\lfloor p _ {i} + \delta \right\rfloor \tag {6} +$$ + +where $\lfloor \cdot \rfloor$ is a floor operation. In our experiments, relaxation offset $\delta$ is a hyperparameter we set to obtain the translation quality under different latency. Overall, the SiMT policy is shown in Algorithm 1. + +# 3.2 Integrating Alignment in Translation + +To jointly learn the SiMT policy (i.e., aligned positions which determine latency) with translation, we + +weaken the attention of source words far away from the predicted aligned position in advance, thereby forcing the model to move the predicted aligned position to the source word that is most informative for translation (i.e., with the highest soft attention). + +To this end, for $i^{th}$ target word, we introduce a Gaussian distribution $\mathcal{G}_i$ centered on aligned position $p_i$ as the prior probability, calculated as: + +$$ +\mathcal {G} _ {i j} = \left\{ \begin{array}{c l} \frac {1}{\sqrt {2 \pi} \sigma_ {i}} \exp \left(- \frac {\left(j - p _ {i}\right) ^ {2}}{2 \sigma_ {i} ^ {2}}\right) & \text {i f} j \leq g (i) \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {7} +$$ + +where the Gaussian distribution is limited in first $g(i)$ source words. $\sigma_{i}$ is the variance used to control the attenuation degree of the prior probability as away from the aligned position. To prevent the prior probability of the furthest source word from being too small, we set $\sigma_{i} = p_{i} / 2$ according to the "two-sigma rule" (Pukelsheim, 1994). We will compare the performance of different settings of prior probability in Sec.6.1. Note that since the source position is discrete, we normalize the Gaussian distribution with $\mathcal{G}_{ij} / \sum_{k=1}^{g(i)} \mathcal{G}_{ik}$ . + +Given the prior probability $\mathcal{G}_{ij}$ and soft attention $\alpha_{ij}$ (calculated as Eq.(2)), which is considered as likelihood probability, we calculate the posterior probability $\widehat{\beta}_{ij}$ and normalize it as the final attention distribution $\beta_{ij}$ : + +$$ +\widehat {\beta} _ {i j} = \alpha_ {i j} \times \mathcal {G} _ {i j} \tag {8} +$$ + +$$ +\beta_ {i j} = \frac {\widehat {\beta} _ {i j}}{\sum_ {k = 1} ^ {g (i)} \widehat {\beta} _ {i k}} \tag {9} +$$ + +Then, the context vector $c_{i}$ is calculated as: + +$$ +c _ {i} = \sum_ {j = 1} ^ {g (i)} \beta_ {i j} V \left(z _ {j}\right) \tag {10} +$$ + +# 3.3 Adaptation to Multi-head Structure + +When GMA is integrated into the Transformer with $L$ decoder layers and $H$ attention heads per layer, if multiple heads (totally $L \times H$ heads) independently predict their alignments, some outlier1 heads will cause unnecessary latency (Ma et al., 2020; Zhang and Feng, 2022a). + +Therefore, to better adapt to multi-head attention and capture alignments, for each decoder layer, $H$ + +heads in GMA jointly predict the aligned source position and share it among $H$ heads, while the predicted alignments in each decoder layer still remain independent. Since the output position (determined by predicted alignments) in each layer may be different, the model starts translating after reaching the furthest one. We will compare the performance of different sharing settings in Sec.6.2. + +# 4 Related Work + +A reasonable policy is the key to the SiMT performance. Early policies used segmented translation (Bangalore et al., 2012; Cho and Esipova, 2016; Siahbani et al., 2018). Gu et al. (2017) used reinforcement learning to train an agent to decide read/write. Alinejad et al. (2018) added a predict operation to the agent based on Gu et al. (2017). + +Recent SiMT policies fall into fixed and adaptive. For fixed policy, Dalvi et al. (2018) proposed STATIC-RW, which alternately read and write $RW$ words after reading $S$ words. Ma et al. (2019) proposed a wait-k policy, which translates after lagging $k$ source words. Elbayad et al. (2020a) enhanced wait-k policy by sampling different $k$ . Zhang et al. (2021) proposed future-guide training for wait-k policy. Han et al. (2020) applied meta-learning in wait-k. Zhang and Feng (2021a) proposed a char-level wait-k policy. Zhang and Feng (2021c) proposed mixture-of-experts wait-k policy. + +For adaptive policy, Zheng et al. (2019a) trained an agent with golden READ/WRITE actions generated by rules. Zheng et al. (2019b) added a "delay" token to read source words. Arivazhagan et al. (2019) proposed MILk, using a Bernoulli variable to determine READ/WRITE. Ma et al. (2020) proposed MMA to implement MILK on Transformer. Bahar et al. (2020) and Wilken et al. (2020) used the external ground-truth alignments to train the policy. Zhang et al. (2020) proposed an adaptive segmentation policy MU for SiMT. Liu et al. (2021) proposed cross-attention augmented transducer for SiMT. Alinejad et al. (2021) introduced an full-sentence model to generate a ground-truth action sequence and accordingly train a SiMT policy. Miao et al. (2021) proposed a generative SiMT policy. + +Previous methods often neglected to jointly model alignments with translation, and meanwhile introduce additional loss functions to control the latency. However, GMA jointly learns alignment and translation, and thereby controls the latency through a simple Gaussian prior probability. + +![](images/fbfd7e2c84b7b8f84a6aa6c8d963ce334658e3711b560bd4ec1777cda35bbd39.jpg) +(a) $\mathrm{En}\rightarrow \mathrm{Vi}$ ,Transformer-Small + +![](images/26f5445cbe144c239d9e101cf991c8ae3cfae668e8acdce43ada2a0463de01ae.jpg) +(b) $\mathrm{De}\rightarrow \mathrm{En}$ , Transformer-Base +Figure 3: Translation quality (BLEU) against latency (AL) on the $\mathrm{En}\rightarrow \mathrm{Vi}(\mathrm{Small})$ , $\mathrm{De}\rightarrow \mathrm{En}(\mathrm{Base})$ and $\mathrm{De}\rightarrow \mathrm{En}(\mathrm{Big})$ , showing the results of GMA, Wait-k, MU, the SOTA adaptive policy MMA and offline model. + +![](images/fe4d16475f7782a7e5eec9b9126184570a2c94361dc8383fe44fb6412efbe313.jpg) +(c) $\mathrm{De}\rightarrow \mathrm{En}$ ,Transformer-Big + +# 5 Experiments + +# 5.1 Datasets + +We evaluate GMA on the following public datasets. + +IWSLT152 English → Vietnamese (En→Vi) (133K pairs) (Cettolo et al., 2015) We use TED tst2012 as validation set (1553 pairs) and TED tst2013 as test set (1268 pairs). Following the previous setting (Raffel et al., 2017; Ma et al., 2020), we replace tokens that the frequency less than 5 by ⟨unk⟩, and the vocabulary sizes are 17K and 7.7K for English and Vietnamese respectively. + +WMT153 German → English (De→En) (4.5M pairs) Following Ma et al. (2019), Arivazhagan et al. (2019) and Ma et al. (2020), we use newstest2013 as validation set (3000 pairs) and newstest2015 as test set (2169 pairs). BPE (Sennrich et al., 2016) was applied with 32K merge operations and the vocabulary is shared across languages. + +# 5.2 Systems Setting + +We conduct experiments on the following systems. + +Offline Conventional Transformer (Vaswani et al., 2017) model for full-sentence translation. + +Wait-k Wait-k policy proposed by Ma et al. (2019), the most widely used fixed policy with strong performance and simple structure, which first waits for $k$ source words and then translates a target word and waits for a source word alternately. + +MU A segmentation policy proposed by Zhang et al. (2020), which classify whether the current inputs is a complete meaning unit (MU), and then fed MU into the full-sentence MT model for translation until generating $\langle \mathrm{EOS} \rangle$ . We compare our method + +with MU on $\mathrm{De} \rightarrow \mathrm{En}(\mathrm{Big})$ since they report their results on $\mathrm{De} \rightarrow \mathrm{En}$ with Transformer-Big. + +$\mathbf{MMA}^{4}$ Monotonic multi-head attention (MMA) proposed by (Ma et al., 2020), the state-of-the-art adaptive policy. At each step, MMA predicts a Bernoulli variable to decide whether to start translating or wait for the next source token. + +# GMA Proposed method in Sec.3. + +The implementations of all systems are adapted from Fairseq Library (Ott et al., 2019) based on Transformer (Vaswani et al., 2017). The setting is the same as Ma et al. (2020). For $\mathrm{En} \rightarrow \mathrm{Vi}$ , we apply Transformer-small (6 layers, 4 heads per layer). For $\mathrm{De} \rightarrow \mathrm{En}$ , we apply Transformer-Base (6 layers, 8 heads per layer) and Transformer-Big (6 layers, 16 heads per layer). We evaluate these systems with BLEU (Papineni et al., 2002) for translation quality and Average Lagging (AL) (Ma et al., 2019) for latency. Average lagging is currently the most widely used latency metric, which evaluates the number of words lagging behind the ideal policy. Given $g(i)$ , AL is calculated as: + +$$ +\mathrm {A L} = \frac {1}{\tau} \sum_ {i = 1} ^ {\tau} g (i) - \frac {i - 1}{| \mathbf {y} | / | \mathbf {x} |} \tag {11} +$$ + +$$ +\text {w h e r e} \quad \tau = \underset {i} {\operatorname {a r g m a x}} (g (i) = | \mathbf {x} |) \tag {12} +$$ + +where $|\mathbf{x}|$ and $|\mathbf{y}|$ are the length of the source sentence and target sentence respectively. + +# 5.3 Main Results + +We compared GMA with the Wait-k, MU and MMA, the current best representative of fixed policy, segmentation policy and adaptive policy re + +spectively, and plot latency-quality curves in Figure 3, where GMA curve is drawn with various $\delta$ (in Eq.(6)), Wait-k curve is drawn with various lagging numbers $k$ , MU curve is drawn with various classification thresholds of the meaning unit, MMA curve is drawn with various latency loss weights $\lambda$ . + +Compared with Wait-k, GMA has a significant improvement, since Wait-k ignores the alignments and thus the target word may be forced to be translated before receiving its aligned source word, which seriously affects the translation quality. Compared with MMA and MU, our method achieves better performance under most latency levels. Since MU first segments the source sentence based on the meaning unit, and then translates each segment with the full-sentence MT model, MU performed particularly well under high latency, but meanwhile it is difficult to extend to lower latency. + +Compared with the SOTA adaptive policy MMA, GMA has stable performance and simpler training method. MMA introduces two additional loss functions to control the latency, and meanwhile applies the expectation training to train Bernoulli variables (Ma et al., 2020). GMA successfully balances the translation quality and latency without any additional loss function. Owing to the proposed Gaussian prior probability centered on predicted alignments, the source words far away from the aligned position get less Gaussian prior, so that the model is forced to move the aligned position close to the most informative source word, thereby capturing the alignments and controlling the latency. With GMA, the translation quality and latency are integrated into a unified manner and jointly optimized without any additional loss function. + +# 6 Analysis + +We conduct extensive analyses to study the specific improvements of GMA. Unless otherwise specified, all the results are reported on De $\rightarrow$ En(Base). + +# 6.1 Ablation Study + +We conduct sufficient ablation studies on the method of modeling aligned position and the proposed prior probability in Table 1. For modeling aligned source position, predicting incremental step performs better. Since the complete length of the streaming inputs in SiMT is unknown, predicting absolute position easily exceeds the source length, resulting in unnecessary latency. In practice, the value range of incremental step is more regular than + +
VariantsALBLEU
Aligned Source Position
Incremental step4.6628.50
Absolute position7.3325.61
Prior Probability
Gaussian (σi=pi/2)4.6628.50
- σi=pi/16.8728.96
- σi=pi/34.5527.61
-Predicted σi5.3427.12
Laplace8.1429.19
Linear12.8327.86
None1.4820.84
+ +Table 1: Ablation studies on modeling aligned position and the proposed prior probability, with $\delta = 1$ . + +absolute position and thus easier to learn. + +Among the prior probabilities of different distributions, the Gaussian distribution performs best. The Laplace distribution is more fat-tailed than the Gaussian distribution (i.e., more prior probability on the position that far away from the aligned position), resulting in learning a later aligned position and higher latency. The linear distribution performs worse since its attenuation with distance is smoother. When removing the prior probability, since the parameters to predict alignments do not get the back-propagation gradient, the model cannot learn the alignments at all, resulting in very low latency and poor translation quality. Focusing on the best performing Gaussian prior probability, when $\sigma_{i} = p_{i} / 1$ (the attenuation degree is small), the predicted aligned position is much later and the latency is higher. When $\sigma_{i} = p_{i} / 3$ , the translation quality declines since the prior of some source words far away from the aligned position is too small. When the $\sigma_{i}$ is predicted, some small predicted $\sigma_{i}$ will make the prior probability of the distant source words almost 0, resulting in poor translation quality. In comparison, the Gaussian prior $(\sigma_{i} = p_{i} / 2)$ we proposed not only guarantees a certain attenuation degree, but also assigns the furthest source word some prior probability. + +# 6.2 Effect of Sharing Alignments + +When integrated into multi-head attention, to reduce the overall latency of the model, GMA shares the predicted alignments among $H$ heads in each layer. Table 2 reports the performance of sharing alignments in different parts (all independent, among heads, among layers or among all). + +
#Predicted AlignmentsALBLEU
All independent6 × 8 = 487.8529.18
Share among heads6 × 1 = 64.6628.50
Share among layers1 × 8 = 84.4627.82
Share all1 × 1 = 13.0727.26
+ +Table 2: The performance of different alignments sharing settings with $\delta = 1$ . + +![](images/b7adec06914025a8295e16d06667c47f9a0ef923ca0075ea5537ef9726ccb35a.jpg) +Figure 4: The distribution of the waiting source number between two adjacent outputs, on Wait-k $(k = 5)$ , MMA $(\lambda = 0.4)$ and GMA $(\delta = 1)$ with similar latency. + +'All independent' achieves the best translation quality and also brings a higher latency, as the overall latency of the model is determined by the farthest one among all predicted positions. Besides, 'Share all' gets the lowest latency but loses translation quality. Comparing 'Share among heads' and 'Share among layers', sharing among heads performs better, which is in line with the previous conclusion that there are obvious differences between the alignments in each decoder layer (Garg et al., 2019; Voita et al., 2019; Li et al., 2019). + +# 6.3 Statistics of Incremental Steps + +Unlike MMA predicting the READ/WRITE action, GMA directly predicts the incremental step between adjacent target outputs. To analyze the advantages of modeling the incremental step, we show the distribution of step size (i.e., the number of waiting source words between two adjacent outputs) in Figure 4, where we select the SiMT models with the similar latency $(\mathrm{AL} \approx 4.5)$ . + +For Wait-k, the step size is blunt and there are only three cases, which occur before the start of translation (step size $= k$ : first lag $k$ words), during translation (step size $= 1$ : wait and output one word alternately.), and after the end of the source inputs (step size $= 0$ : output the translation at one time). The proposed GMA and MMA have obvi + +![](images/f0a3d7c9f7fcb3d00ba67232dcf39123b67a7d6adf0723f26448513e4d5475fa.jpg) +Figure 5: Translation quality against latency (CW), where CW reflects the streaming degree of SiMT. + +ous differences in the step size distribution. The step size distribution of GMA is more even, only distributed between $0 \sim 4$ , which shows that each source segment is shorter and thus the translating process is more streaming. The step size of MMA is more widely distributed, most of which are 0 (consecutively output target words), and there is also a large proportion of step size greater than 5, which shows that MMA tends to consecutively wait for more source words and then output more target words, resulting in longer source segments. Therefore, although GMA and MMA have similar latency (AL), their performance in real applications is different, where the translation process of GMA is more streaming, while MMA is more segmented. + +Furthermore, to more accurately evaluate the streaming degree of the translation process, we apply Consecutive Wait (CW) (Gu et al., 2017) as the latency metric to evaluate the systems. Consecutive wait evaluates the number of source words waited between two target words, which reflects the streaming degree of SiMT. Given $g(i)$ , CW is calculated as: + +$$ +\mathrm {C W} = \frac {\sum_ {i = 1} ^ {| \mathbf {y} |} (g (i) - g (i - 1))}{\sum_ {i = 1} ^ {| \mathbf {y} |} \mathbb {1} _ {g (i) - g (i - 1) > 0}} \tag {13} +$$ + +where $\mathbb{1}_{g(i) - g(i - 1) > 0} = 1$ counts the number of $g(i) - g(i - 1) > 0$ . In other words, CW measures the average source segment length (the best case is 1 for word-by-word streaming translation and the worst case is $|\mathbf{x}|$ for full-sentence MT), where the smaller the CW, the shorter the average source segment, and the translation is more streaming. + +As shown in Figure 5, GMA gets much smaller CW scores than MMA, where the average source + +![](images/f225e4d7e23f3b22415da7def4c4ee4d9d341f5217ff6f8fb96dfc1cbdbc9e37.jpg) +Figure 6: Distribution of distances between adjacent alignments (ground-truth) under monotonic and non-monotonic alignment setting. + +segment length is about 2 words, which shows that GMA achieves more streaming translation than the previous adaptive policy. + +Additionally, although the alignments between the two languages is not necessarily monotonic, we require the predicted incremental step $\Delta p_{i} \geq 0$ to guarantee the model performs READ/WRITE monotonically. This is due to two considerations. First, we don't want to waste any useful source content, i.e., to avoid the model moving $p_{i}$ to the previous position and thereby ignoring some received source information caused by $\Delta p_{i} < 0$ . Second, we argue that monotonic alignments are more friendly to SiMT learning. We use fast-align5 (Dyer et al., 2013) to generate the ground-truth aligned source position of $i^{th}$ target token, denoted as $A_{i}$ , and then show the distribution of distances between adjacent alignments under monotonic and non-monotonic alignments in Figure 6, where 'Non-Monotonic' measures $A_{i} - A_{i-1}$ and 'Monotonic' measures $\max(A_{i} - \max_{jLatencyAER% of ground-truth alignments within g(i)Low0.4981.00%Mid0.6188.27%High0.7695.58% + +Table 3: Alignment quality under different latency levels, where 'within $g(i)$ ' means that starting translating after receiving the aligned source word. + +![](images/d8f2e0b107770cfa221ce196d1e8e4e446133c9953d7ab21dccada14bafce558.jpg) +Figure 7: The learning curve of translation quality (BLEU) and latency (AL) during training, with $\delta = 1$ . + +annotated by experts (Liu et al., 2016; Zhang and Feng, 2021b). As shown in Table 3, we sample one decoder layer to calculate the alignments error rate (AER) (Vilar et al., 2006), and meanwhile count how many ground-truth aligned source words are located before the output position $g(i)$ (i.e., translate after receiving the aligned source word). + +GMA achieves good alignment accuracy, especially at low latency, since the model is required to output immediately after receiving the aligned source words ( $\delta$ in Eq.(6) is small). More importantly, most of the ground-truth alignments is within $g(i)$ , showing that GMA guarantees that in most cases, the model starts translating a target word after receiving its aligned source words, which is beneficial to translation quality. + +# 6.5 Balancing Translation and Latency + +To study how GMA learns to balance translation quality and latency without any additional loss function during training, we draw a learning curve for translation quality and latency in Figure 7. + +Initially, the high latency indicates that the model first moves the predicted aligned position to a further position, to learn the translation by seeing more source words. Then, as the number of training steps increases, the translation quality improves and the latency gradually decreases, which shows that for better translation, the model moves the predicted aligned source position to a more appropriate position due to the introduced Gaussian prior + +![](images/babb19864694414e3bda7ec6ba3b7daf51d8f4b10286fbc53d73a1c45e9353c6.jpg) + +![](images/4461dcd0f9fce5badd7ce60a4e03f699c560042b87e0e30dfb0142d9f89a3152.jpg) +(a) An easy case with more monotonic alignments + +![](images/45001789c2c696b31ac3bbab5d7809ae3ba811915857c2216228b5c9e0d7d1e5.jpg) + +![](images/73202104f54173201a79151c101470af1397f0a78bd12f7371a3b07af1a06764.jpg) + +![](images/d384426129024665d637be527d9df37639e8afc8b51c87b446229e17e8432b92.jpg) + +![](images/3cd9a9d40402cff2b62f4dea8d9f5dcf9c1b9241e969cf41e121940eec9f5434.jpg) +(b) A hard case with more complex alignments + +![](images/3919c4af87d282e522328c61d6e8911b0fc73c9ca83b1a125bb0eef78bf5788f.jpg) +Figure 8: Attention visualization of GMA on De→En SiMT with $\delta = 1$ . The shade of the color indicates the attention weight. ‘·’: the predicted aligned source position $p_i$ (mean of Gaussian distribution), note that $p_i$ is a float number. ‘■’: the ground-truth alignments. ‘→’: wait for a source word, ‘↓’: translate a target word. + +![](images/0bd2d987b2d17a949c17837ef7727796fdd5d800a5ad4d043fdcd98f2c648d61.jpg) + +probability. Overall, for better translation, GMA constantly adjusts the predicted aligned source position to a suitable position and thereby controls the latency, which is completely different from the previous method of introducing the additional latency loss to constrain the latency with translation (Ma et al., 2020; Miao et al., 2021). + +# 6.6 Characteristics of Attention in GMA + +We explore the characteristics of GMA by visualizing the attention distributions in Figure 8. We show two cases with the alignments of different difficulty levels, where the reverse orders in alignments are considered as a major challenge for SiMT (Ma et al., 2019; Zhang and Feng, 2021c). + +For more monotonic alignments, GMA can predict the aligned source position well and output the target word after receiving the aligned word. Meanwhile, due to the characteristics of Gaussian distribution, GMA can also avoid focusing too much on source words in the front position, and strengthen the attention on the newly received source words, which is proved to be beneficial to SiMT perfor + +mance (Elbayad et al., 2020b; Zhang and Feng, 2022b). For more complex alignments, the aligned position predicted by GMA is close to the ground-truth alignments, so that GMA starts translating after receiving most of aligned words. Besides, GMA learns some implicit prediction ability, e.g., before receiving "worden sein", GMA generates the correct translation "have been" based on the context. We consider this is because the predicted alignments during training are monotonic due to the incremental step, where modeling monotonic alignments forces the model to learn the correct translation from the incomplete source and previous outputs (Ma et al., 2019). + +# 7 Conclusion + +In this paper, we propose the Gaussian multi-head attention to develop a SiMT policy which starts translating a target word after receiving its aligned source word. Experiments and analyses show that our method achieves promising results on performance, alignments quality and streaming degree. + +# Acknowledgements + +We thank all the anonymous reviewers for their insightful and valuable comments. This work was supported by National Key R&D Program of China (NO. 2017YFE0192900). + +# References + +Ashkan Alinejad, Hassan S. Shavarani, and Anoop Sarkar. 2021. Translation-based supervision for policy generation in simultaneous neural machine translation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1734-1744, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Ashkan Alinejad, Maryam Siahbani, and Anoop Sarkar. 2018. Prediction improves simultaneous neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3022-3027, Brussels, Belgium. Association for Computational Linguistics. +Naveen Arivazhagan, Colin Cherry, Wolfgang Macherey, Chung-Cheng Chiu, Semih Yavuz, Ruoming Pang, Wei Li, and Colin Raffel. 2019. Monotonic infinite lookback attention for simultaneous machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1313-1323, Florence, Italy. Association for Computational Linguistics. +Philip Arthur, Trevor Cohn, and Gholamreza Haffari. 2021. Learning coupled policies for simultaneous machine translation using imitation learning. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2709-2719, Online. Association for Computational Linguistics. +Parnia Bahar, Patrick Wilken, Tamer Alkhouli, Andreas Guta, Pavel Golik, Evgeny Matusov, and Christian Herold. 2020. Start-before-end and end-to-end: Neural speech translation by AppTek and RWTH Aachen University. In Proceedings of the 17th International Conference on Spoken Language Translation, pages 44-54, Online. Association for Computational Linguistics. +Srinivas Bangalore, Vivek Kumar Rangarajan Sridhar, Prakash Kolan, Ladan Golipour, and Aura Jimenez. 2012. Real-time incremental speech-to-speech translation of dialogs. In Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 437-445, Montreal, Canada. Association for Computational Linguistics. +Mauro Cettolo, Niehues Jan, Stüker Sebastian, Luisa Bentivogli, R. Cattoni, and Marcello Federico. 2015. The iwslt 2015 evaluation campaign. + +Kyunghyun Cho and Masha Esipova. 2016. Can neural machine translation do simultaneous translation? +Fahim Dalvi, Nadir Durrani, Hassan Sajjad, and Stephan Vogel. 2018. Incremental decoding and training methods for simultaneous translation in neural machine translation. 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 493-499, New Orleans, Louisiana. Association for Computational Linguistics. +Chris Dyer, Victor Chahuneau, and Noah A. Smith. 2013. A simple, fast, and effective reparameterization of IBM model 2. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 644-648, Atlanta, Georgia. Association for Computational Linguistics. +Maha Elbayad, Laurent Besacier, and Jakob Verbeek. 2020a. Efficient Wait-k Models for Simultaneous Machine Translation. +Maha Elbayad, Michael Ustaszewski, Emmanuelle Esperança-Rodier, Francis Brunet-Manquat, Jakob Verbeek, and Laurent Besacier. 2020b. Online versus offline NMT quality: An in-depth analysis on English-German and German-English. In Proceedings of the 28th International Conference on Computational Linguistics, pages 5047-5058, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Sarthak Garg, Stephan Peitz, Udhyakumar Nallasamy, and Matthias Paulik. 2019. Jointly learning to align and translate with transformer 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 4453-4462, Hong Kong, China. Association for Computational Linguistics. +Jiatao Gu, Graham Neubig, Kyunghyun Cho, and Victor O.K. Li. 2017. Learning to translate in real-time with neural machine translation. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 1053-1062, Valencia, Spain. Association for Computational Linguistics. +Hou Jeung Han, Mohd Abbas Zaidi, Sathish Reddy Indurthi, Nikhil Kumar Lakumarapu, Beomseok Lee, and Sangha Kim. 2020. End-to-end simultaneous translation system for IWSLT2020 using modality agnostic meta-learning. In Proceedings of the 17th International Conference on Spoken Language Translation, pages 62-68, Online. Association for Computational Linguistics. +Xintong Li, Guanlin Li, Lemao Liu, Max Meng, and Shuming Shi. 2019. On the word alignment from neural machine translation. In Proceedings of the + +57th Annual Meeting of the Association for Computational Linguistics, pages 1293-1303, Florence, Italy. Association for Computational Linguistics. +Dan Liu, Mengge Du, Xiaoxi Li, Ya Li, and Enhong Chen. 2021. Cross attention augmented transducer networks for simultaneous translation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 39-55, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Lemao Liu, Masao Utiyama, Andrew Finch, and Eichiro Sumita. 2016. Neural machine translation with supervised attention. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 3093-3102, Osaka, Japan. The COLING 2016 Organizing Committee. +Mingbo Ma, Liang Huang, Hao Xiong, Renjie Zheng, Kaibo Liu, Baigong Zheng, Chuanqiang Zhang, Zhongjun He, Hairong Liu, Xing Li, Hua Wu, and Haifeng Wang. 2019. STACL: Simultaneous translation with implicit anticipation and controllable latency using prefix-to-prefix framework. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3025-3036, Florence, Italy. Association for Computational Linguistics. +Xutai Ma, Juan Miguel Pino, James Cross, Liezl Puzon, and Jiatao Gu. 2020. Monotonic multihead attention. In International Conference on Learning Representations. +Yishu Miao, Phil Blunsom, and Lucia Specia. 2021. A generative framework for simultaneous machine translation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6697-6706, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. *fairoseq: A fast, extensible toolkit for sequence modeling*. In *Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics* (Demonstrations), pages 48–53, Minneapolis, Minnesota. Association for Computational Linguistics. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pages 311-318, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics. +Friedrich Pukelsheim. 1994. The three sigma rule. The American Statistician, 48(2):88-91. + +Colin Raffel, Minh-Thang Luong, Peter J. Liu, Ron J. Weiss, and Douglas Eck. 2017. Online and linear-time attention by enforcing monotonic alignments. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 2837-2846. PMLR. +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. +Maryam Siahbani, Hassan Shavarani, Ashkan Alinejad, and Anoop Sarkar. 2018. Simultaneous translation using optimized segmentation. In Proceedings of the 13th Conference of the Association for Machine Translation in the Americas (Volume 1: Research Papers), pages 154-167, Boston, MA. Association for Machine Translation in the Americas. +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 I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 5998-6008. Curran Associates, Inc. +David Vilar, Maja Popovic, and Hermann Ney. 2006. AER: do we need to "improve" our alignments? In Proceedings of the Third International Workshop on Spoken Language Translation: Papers, Kyoto, Japan. +Elena Voita, David Talbot, Fedor Moiseev, Rico Senrich, and Ivan Titov. 2019. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5797-5808, Florence, Italy. Association for Computational Linguistics. +Patrick Wilken, Tamer Alkhouli, Evgeny Matusov, and Pavel Golik. 2020. Neural simultaneous speech translation using alignment-based chunking. In Proceedings of the 17th International Conference on Spoken Language Translation, pages 237-246, Online. Association for Computational Linguistics. +Ruiqing Zhang, Chuanqiang Zhang, Zhongjun He, Hua Wu, and Haifeng Wang. 2020. Learning adaptive segmentation policy for simultaneous translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2280-2289, Online. Association for Computational Linguistics. +Shaolei Zhang and Yang Feng. 2021a. ICT's system for AutoSimTrans 2021: Robust char-level simultaneous translation. In Proceedings of the Second Workshop on Automatic Simultaneous Translation, pages 1-11, Online. Association for Computational Linguistics. + +Shaolei Zhang and Yang Feng. 2021b. Modeling concentrated cross-attention for neural machine translation with Gaussian mixture model. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 1401–1411, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Shaolei Zhang and Yang Feng. 2021c. Universal simultaneous machine translation with mixture-of-experts wait-k policy. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7306-7317, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Shaolei Zhang and Yang Feng. 2022a. Modeling dual read/write paths for simultaneous machine translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, Dublin, Ireland. Association for Computational Linguistics. +Shaolei Zhang and Yang Feng. 2022b. Reducing position bias in simultaneous machine translation with length-aware framework. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, Dublin, Ireland. Association for Computational Linguistics. +Shaolei Zhang, Yang Feng, and Liangyou Li. 2021. Future-guided incremental transformer for simultaneous translation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 14428-14436, Online. +Baigong Zheng, Renjie Zheng, Mingbo Ma, and Liang Huang. 2019a. Simpler and faster learning of adaptive policies for simultaneous translation. 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 1349-1354, Hong Kong, China. Association for Computational Linguistics. +Baigong Zheng, Renjie Zheng, Mingbo Ma, and Liang Huang. 2019b. Simultaneous translation with flexible policy via restricted imitation learning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5816-5822, Florence, Italy. Association for Computational Linguistics. + +# A Numerical Results + +We additionally use Consecutive Wait (CW) (Gu et al., 2017), Average Proportion (AP) (Cho and Esipova, 2016), Average Lagging (AL) (Ma et al., 2019), and Differentiable Average Lagging (DAL) (Arivazhagan et al., 2019) to evaluate the latency of GMA, and the numerical results are shown in Table 4, 5 and 6. + +
IWSLT15 En→Vi (Small)
δCWAPALDALBLEU
0.91.200.653.054.0827.95
1.01.270.684.014.7728.20
2.01.490.745.476.3728.44
2.21.600.776.046.9628.56
2.51.740.786.557.5528.72
+ +Table 4: Numerical results of GMA on IWSLT15 $\mathrm{En}\rightarrow \mathrm{Vi}$ (Small). + +
WMT15 De→En (Base)
δCWAPALDALBLEU
0.91.330.643.874.6128.12
1.01.490.674.665.5628.50
2.01.850.725.797.7528.71
2.22.010.736.138.4329.23
2.45.890.9614.0525.7631.31
+ +Table 5: Numerical results of GMA on WMT15 De→En (Base). + +
WMT15 De→En (Big)
δCWAPALDALBLEU
1.01.540.684.605.8930.20
2.01.980.746.348.1830.64
2.22.130.756.868.9131.33
2.42.280.767.289.5931.62
2.53.100.8812.0620.4331.91
+ +Table 6: Numerical results of GMA on WMT15 De→En (Big). \ No newline at end of file diff --git a/gaussianmultiheadattentionforsimultaneousmachinetranslation/images.zip b/gaussianmultiheadattentionforsimultaneousmachinetranslation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1d9a1ed010a9f78edeea68e0fe4b8114ab9f2540 --- /dev/null +++ b/gaussianmultiheadattentionforsimultaneousmachinetranslation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a25a73889d0b9ae63f43d19377bec57e33c01fa473dc0990d660c80472c9c1b +size 626354 diff --git a/gaussianmultiheadattentionforsimultaneousmachinetranslation/layout.json b/gaussianmultiheadattentionforsimultaneousmachinetranslation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4ef904d25e628876904875920faaab9c63c53f95 --- /dev/null +++ b/gaussianmultiheadattentionforsimultaneousmachinetranslation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fba6f72dff5486ff017f367fbbe5ca6136e017587f9f2c1b9bc12a6a60c313c +size 484543 diff --git a/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_content_list.json b/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b9287f977b62147793e15e1a736e4f8c0e2dd81d --- /dev/null +++ b/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d8c52dfa719ad0b1d400d910e14f019b01198de30b7e5882aa10a741eb66ff4 +size 84796 diff --git a/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_model.json b/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8dc7e67e55d87732baf217589fdbb4b87a244111 --- /dev/null +++ b/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0071e89001a9169dc731151cfd95e30fd854189cb31854932ce6b83462783a37 +size 100954 diff --git a/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_origin.pdf b/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6d22ed616fa5f0ab0f28ce4616c0f9020f7a374f --- /dev/null +++ b/gcpgageneralframeworkforcontrollableparaphrasegeneration/dc8cdcb3-ed79-4e49-9990-67b597683c38_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71553ac6c076161e8d43d7e2d90035483ef76657fc3d97e8e5458925448fc768 +size 711787 diff --git a/gcpgageneralframeworkforcontrollableparaphrasegeneration/full.md b/gcpgageneralframeworkforcontrollableparaphrasegeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6ce02054423ce138373bedd6f31bc12c789679d7 --- /dev/null +++ b/gcpgageneralframeworkforcontrollableparaphrasegeneration/full.md @@ -0,0 +1,286 @@ +# GCPG: A General Framework for Controllable Paraphrase Generation + +Kexin Yang\* Dayiheng Liu\*† Wenqiang Lei\* Baosong Yang\* Haibo Zhang\* Xue Zhao\* Wenqing Yao\* Boxing Chen\* + +$\spadesuit$ Alibaba Group + $\diamond$ National University of Singapore +{kexinyang0528, losinuris}@gmail.com + +# Abstract + +Controllable paraphrase generation (CPG) incorporates various external conditions to obtain desirable paraphrases. However, existing works only highlight a special condition under two indispensable aspects of CPG (i.e., lexically and syntactically CPG) individually, lacking a unified circumstance to explore and analyze their effectiveness. In this paper, we propose a general controllable paraphrase generation framework (GCPG), which represents both lexical and syntactical conditions as text sequences and uniformly processes them in an encoder-decoder paradigm. Under GCPG, we reconstruct commonly adopted lexical condition (i.e., Keywords) and syntactical conditions (i.e., Part-Of-Speech sequence, Constituent Tree, Masked Template and Sentential Exemplar) and study the combination of the two types. In particular, for Sentential Exemplar condition, we propose a novel exemplar construction method — Syntax-Similarity based Exemplar (SSE). SSE retrieves a syntactically similar but lexically different sentence as the exemplar for each target sentence, avoiding exemplar-side words copying problem. Extensive experiments demonstrate that GCPG with SSE achieves state-of-the-art performance on two popular benchmarks. In addition, the combination of lexical and syntactical conditions shows the significant controllable ability of paraphrase generation, and these empirical results could provide novel insight to user-oriented paraphrasing. + +# 1 Introduction + +Paraphrase generation (Madnani and Dorr, 2010) refers to restating a given sentence into an alternative surface form while keeping the semantics unchanged. It is of long-standing interest (McKeown, 1983), with various applications such as ques + +![](images/5b5b029117e8804cc8514d6e5c2851c54b2d3513384579cdac1e7ee1727681bc.jpg) +Figure 1: A toy example to explain what effect lexically controlling and syntactically controlling have on paraphrasing. + +tion answering (Gan and Ng, 2019), machine translation (Mallinson et al., 2017), and sentence simplification (Martin et al., 2020). However, a sentence can be re-expressed in various surface forms. Lacking control might result in undesirable results (Gu et al., 2019). For example, a sentence that contains an intricate syntactic structure may cause difficulties for aphasic patients (Shewan, 1985). In that case, we could attempt to paraphrase it based on syntactical control. + +To obtain desirable surface forms, most recent works focus on controllable paraphrase generation (CPG) by incorporating external conditions. Existing efforts to CPG can be roughly divided into two types: lexically and syntactically CPG. Lexically CPG is concerned with what to say, which generates paraphrases that contain pre-specified keywords. As shown in Figure 1, a lexically CPG model needs to generate a paraphrase that contains the given keyword "showed up". To achieve it, a sequence-to-sequence model equipped with the copy mechanism is commonly used (Zeng et al., 2019). Different from lexically CPG, syntactically CPG concentrates on how to say it, generating a paraphrase that conforms to the syntax of a given exemplar (i.e., a sentence illustrating certain syntax patterns). Substantial efforts have been made on constructing syntactical features of the given exemplar. For example, Kumar et al. (2020) incorporate a full syntactic tree of the exemplar to + +guide paraphrasing; Bui et al. (2021) construct a masked template to direct generation by masking words with certain Part-of-Speech (POS) type of exemplar; Chen et al. (2019) directly use the sentential exemplar. Since sentential exemplars are only available for testing, they have to manufacture exemplars for training by replacing certain words from the target sentence. Despite the progress on the two types of conditions individually, what to say and how to say it are both important for CPG (Kumar et al., 2020). Furthermore, there is no unified framework to study the effectiveness of these conditions and their joint utilization. + +To fill this gap, we propose a General Controllable Paraphrase Generation framework (GCPG) to jointly include both lexically and syntactically CPG in a unified model. The key idea is to reconstruct both lexical and syntactical conditions as text sequences and process them in a text-to-text encoder-decoder paradigm. This also allows GCPG to easily utilize the strong language modeling capacity of pre-trained language models (PLMs), which have demonstrated great potential (Bui et al., 2021) yet rarely been explored under the topic of CPG. For the lexical condition, we concatenate the pre-specified keywords as a sequence while exploring different methods to pre-specify keywords from rule-based to model-based. As for syntactical conditions, we reconstruct commonly used syntactic features as sequences, such as Linearised Constituent Tree (Iyyer et al., 2018) and masked template based on word mask (Bui et al., 2021). Besides the manufactured syntax features, we hypothesize that directly using the exemplar is more effective as it can benefit from the powerful sentence modeling capability of PLMs. To construct the exemplar for training, we propose a novel exemplar construction method as Syntax-Similarity based Exemplar (SSE). Specifically, we use a sentence that is syntactically similar but lexically different from the target sentence, which is retrieved in a self-constructed exemplar dictionary based on the training set. This is different from existing methods that construct exemplar through modifying target sentences (Chen et al., 2019), alleviating exemplar-side words copying problem (Bui et al., 2021) brought by Chen et al. (2019). + +We examine GCPG on two popular benchmark datasets. Those discussions include not only performances of different conditions and their com + +binations, but also the effectiveness of GCPG instantiated by different PLMs. Experiments demonstrate that GCPG consistently shows strong performances when tested by three different methods to pre-specify keywords. For syntactical CPG, GCPG with SSE obtains 13.95/24.31/18.64 ROUGE-1/2/L and 16.38 BLEU-4 over the previous state-of-the-art (SOTA) model (Bui et al., 2021). Also, the combination of lexical and syntactical conditions show encouraging controllability of paraphrase generation in both quantitative and qualitative analysis. The main contributions are as follows: + +- We propose GCPG, a general framework to jointly include both lexically and syntactically controllable paraphrasing. It is simple but effective, enabling flexible combinations of conditions by reconstructing them into text sequences and processing them in a text-to-text encoder-decoder paradigm. Those properties allow GCPG to easily adapt to mainstream pre-trained language models and utilize powerful language modeling capacity, which is rarely explored in CPG. + +- We report a novel exemplar construction method SSE under the syntactical condition. It allows GCPG to directly model syntax information from natural sentences without any manufactured syntax features, while alleviating the exemplar-side words copying problem. + +# 2 Related Work + +In this section, we summarize existing works on syntactically and lexically CPG. Syntactically CPG generates a paraphrase constrained by a prespecified sentence of a certain syntax structure namely exemplar. However, the exemplar is only available during inference, resulting in a key challenge: obtaining manual exemplars for existing paraphrasing training datasets is prohibitively expensive. To address this, some of the previous works construct syntactical features from target sentences during training, such as POS Tagging, Constituent Tree, mask template as illustrated in Table 1. For instance, SCPN (Iyyer et al., 2018) makes the first attempt to introduce Linearised Constituent Tree (LCT) of target sentence into paraphrasing, where LCT is predicted based on predefined parse templates. Similarly, GuiG (Li et al., 2020) proposes two models to expand a partial template LCT and generate paraphrasing, respectively. SOW-REAP (Goyal and Durrett, 2020) uses + +
WorkSyntactical Condition
POS TaggingConstituent TreeMasked TemplateSentential Exemplar
SCPN (2018)✓ (In Tree)✓ (LCT Templates)
CGEN (2019)✓ (In Exemplar)✓ (Replace Words)
BCPG (2020c)✓ (Randomly)
GuiG (2020)✓ (Expanded LCT)
SGCP (2020)✓ (In Tree)✓ (Tree Structure)
SOW-REAP (2020)✓ (In Tree)✓ (Reordering)
AESOP (2021)✓ (In Tree)✓ (Sequence)
ParafraGPT (2021)✓ (In Word MT)✓ (Certain POS)
GCPG✓ (POS Sequence)✓ (LCT)✓ (Certain POS)✓ (SSE)
+ +Table 1: A comparison of different conditions under syntactically CPG. LCT: Linearised Constituent Tree. The proposed framework GCPG reconstructs them as text sequences and we have experimented with all four forms. + +LCT to reorder the source sentence then paraphrasing. AESOP (Sun et al., 2021) selects target LCT adaptively while paraphrasing. Different from using LCT, SGCP (Kumar et al., 2020) introduces a graph encoder to encode the Constituent Tree of exemplar as the condition. masked template replaces several words of the exemplar with a special token to form a template as the condition. BCPG (Liu et al., 2020c) follows BERT (Devlin et al., 2019) to randomly mask exemplar words, ParafraGPT (Bui et al., 2021) further masks exemplar words with certain POS types. However, Chen et al. (2019) advocate to directly utilize the sentential exemplar (the sentence) as the condition, because they believe "any syntactically valid sentence is a valid exemplar". Since exemplar is only available in testing, they construct exemplar by replacing words of the target sentence with others that have the same POS type. In addition, lexical constraints decoding is widely explored in text generation (Liu et al., 2020a, 2019; Hokamp and Liu, 2017a), such as neural machine translation (Hokamp and Liu, 2017b; Post and Vilar, 2018) and text summarizing. CTRLsum (He et al., 2020) uses target entity words as keywords to hint model while summarizing. However, lexically CPG constraints paraphrasing with pre-specified keywords, which is rarely explored but undoubtedly indispensable in CPG. Zeng et al. (2019) make the first attempt to integrate keywords with copy mechanism. Despite their progress, existing works only focus on a special condition under either lexically or syntactically CPG. In comparison, GCPG jointly includes lexically and syntactically CPG. + +# 3 Methodology + +# 3.1 GCPG Framework + +Before introducing GCPG, we first give the definition of controllable paraphrase generation with external conditions. Given a source sentence $\pmb{x}$ and a variety of conditions $\pmb{c}$ , the model generates paraphrase $\pmb{y} = (y_{1}, y_{2}, \dots, y_{T})$ by: + +$$ +p (\boldsymbol {y} | \boldsymbol {x}, \boldsymbol {c}) = \prod_ {t = 1} ^ {T} p \left(y _ {t} \mid y _ {< t}, \boldsymbol {x}, \boldsymbol {c}; \theta\right), \tag {1} +$$ + +where $\theta$ are the model parameters trained by maximizing the conditional likelihood of outputs in a parallel corpus. Given this definition, the forms of conditions $c$ might be varied, such as pre-defined keywords and Constituent Parse Tree. To uniformly encode these conditions and investigate their effectiveness, we propose a general framework GCPG. GCPG contains a standard encoder-decoder paradigm, which allows any mainstream PLMs to adapt to this task rapidly. Meanwhile, GCPG can flexibly use the combinations of included conditions by concatenating them as one sequence with "[SEP]". As shown in Figure 2, the source sentence "No one's home?" is concatenated with optional sequential conditions by the separator signal "[SEP]", then fed into the model. Afterward, the model auto-regressively generates "Is anyone home?" as the final result. + +# 3.2 Conditions under GCPG + +# 3.2.1 Syntactical Condition + +Syntactically CPG requests a syntax exemplar to constrain the syntax structure of paraphrase. However, exemplars are only available in the testing set + +![](images/b7ff0bb7520ad9e5f0ee5f1a892bdfc497388cd620327b3b60429ed928391a91.jpg) +Figure 2: An overview of GCPG, the source sentence and separated condition (also being concatenated with "[SEP]") are concatenated as input. + +![](images/58a42374d020d0f9467571faace8863d3abf884be250ea2e75827cf0fb1351c7.jpg) +Figure 3: An overview of SSE. We take Truncated LCT as the sequential syntax structure here. + +of existing paraphrasing datasets. To train a syntactically CPG model, we construct a syntactical condition based on the target sentences in the training set. During inference, we apply the same strategy to obtain the corresponding syntactical conditions from exemplars in the testing set. We explore four syntactical conditions in this work, as follows: + +POS Tagging is one of simplest solutions in modeling the syntax structure (Cutting et al., 1992), which could be effectively implemented and show promising performance in various NLP tasks (Yang et al., 2021). We investigate POS Tagging as an independent condition, which is rarely explored in CPG. In detail, we extract POS sequence of target sentence by CoreNLP as the condition. To learn these POS signals with PLMs, we regard these POS tokens as special ones and add them into the word vocabulary of PLMs. + +Constituent Tree is a widely used condition for syntax controlling while paraphrasing. Here, we explore two kinds of LCT, i.e., full-fledged LCT + +and Truncated LCT. For the full-fledged LCT condition, we extract the complete sequential Constituent Tree from the target sentence for training and exemplar for testing, based on the off-the-shelf tools of CoreNLP. We further explore the Truncated LCT condition, which is the sequence that removing POS-level tokens in full-fledged LCT. Compared with full-fledged LCT, Truncated LCT drastically shortens the input length. + +Masked Template is first introduced in Liu et al. (2020c), which randomly masks words of the target sentence to form a syntax template as the condition. To verify the effectiveness of this method in GCPG circumstance, we follow the current SOTA (Bui et al., 2021) to construct a masked template by substituting all nouns, adjectives, adverbs, and verbs with a special token in the exemplar. Similarly, this strategy is applied to the target sentences during training and the given exemplars during inference. + +Sentential Exemplar is the most straightforward way for syntactically CPG, which directly uses the sentential exemplar as the condition. In contrast to the above three syntactical conditions, Sentential Exemplar uses natural sentences to represent desirable syntax structure, without introducing any special token which does not appear during PLMs pretraining. We argue that this way can make better use of PLMs. However, the previous method (Chen et al., 2019) suffers from the exemplar-side words copying problem during testing, which might be caused by the noticeable words overlap with the target sentence in constructing sentential exemplar during training. To alleviate this problem, we propose Syntax-Similarity based Exemplar (SSE) to enhance sentential exemplar condition. + +An overview of our SSE method is demonstrated in Figure 3. To alleviate the exemplar-side words copying issue, the proposed SSE constructs Sentential Exemplar by retrieving a syntactically similar but lexically different sentence for each target sentence during training. To achieve that, we construct an exemplar dictionary that contains the syntactical key-value mapping from the syntax structure $\pmb{k}$ to its corresponding natural sentence $\pmb{v}$ . Each syntactical key $\pmb{k} \in \pmb{K}$ is a Truncated LCT sequence, and its value is a randomly selected natural sentence that can be assigned to this Truncated LCT sequence. During training, given a data pair $\langle x, y \rangle$ and the Truncated LCT $s$ of $\pmb{y}$ , we select a syntactical key $k^*$ by calculating the syntax edit distance $D_{syn}$ between $s$ and each syntactical key in the + +exemplar dictionary, which can be formulated as: + +$$ +\begin{array}{l} \boldsymbol {k} ^ {*} = \arg \min (D _ {\text {s y n}} (\boldsymbol {s}, \boldsymbol {k})) \\ = \arg \min _ {\boldsymbol {k} \in \boldsymbol {K}} \left(\frac {\operatorname {L e v E d i t} (\boldsymbol {s} , \boldsymbol {k})}{\operatorname* {m a x} (| \boldsymbol {s} | , | \boldsymbol {k} |)}\right), \tag {2} \\ \end{array} +$$ + +where $\mathrm{LevEdit}(\cdot)$ denotes the token-level Levenshtein edit distance between two sequences and $|\cdot|$ denotes the token-level length of the sequence. We assign the corresponding sentence $\pmb{v}^{*}$ , which is related to $\pmb{k}^{*}$ , as the training exemplar. + +Lexical Condition Lexically CPG uses prespecified keywords to constrain paraphrasing, which requires a paraphrasing dataset containing triples. Because the original dataset is formatted as , we need to pre-specified keywords for each data item. Following Zeng et al. (2019), we automatically extract keywords from the target sentence as the condition in the training stage. Besides, as also lacking manual keywords for each testing pair, we carry out two strategies for inference. On the one hand, we directly extract keywords from references as conditions following Zeng et al. (2019). On another, a standard sequence-to-sequence model is used to predict target keywords only from source sentences as conditions while testing, as described in Liu et al.(2020b). Specifically, we investigate three representative keyword extraction methods to verify the effectiveness of GCPG, including rule-based TF-IDF, TextRank (Mihalcea and Tarau, 2004), and model-based KeyBERT (Grootendorst, 2020). Each method filters out the stop words and punctuation, and guarantees the extracted keywords do not appear in the corresponding source sentence. The maximum number of keywords is set to 3. Besides, we use a special token "[NONE]" when there are no keywords extracted. + +# 4 Experiments + +Datasets Following previous works (Kumar et al., 2020; Bui et al., 2021), we evaluate GCPG on two datasets: (1) ParaNMT-small (Chen et al., 2019) is a subset of ParaNMT-50M dataset (Wieting and Gimpel, 2018), which is collected via backtranslation referring to English sentences. It contains 500K training pairs formatted as , and 1.3K manually labeled data triples formatted as (0.8K for testing and 0.5K for validation). In each + +triple, exemplar is a sentence that has the same syntax as paraphrase but is semantically different from sentence. (2) QQP-Pos (Kumar et al., 2020) is selected from Quora Question Pairs (QQP) dataset. It contains about $140\mathrm{K}$ training pairs and $3\mathrm{K} / 3\mathrm{K}$ data triples for testing/validation. The format of dataset is the same as ParaNMT-small. + +# 4.1 Syntactically Controllable Paraphrasing + +We explore four syntactical conditions reconstructed by GCPG on the ParaNMT-small dataset, then compare SSE with baselines on two datasets. + +Baselines We first choose two direct return-input baselines as dataset quality indicators: (1) Source-as-Output copies inputs as outputs. (2) Exemplar-as-Output regards exemplars as outputs. Next, we compare GCPG with mainstream competitive models as follows. (3) SCPN (Iyyer et al., 2018) has two encoders to encode source sentence and LCT separately, then constrain generation with soft attention mechanism. (4) CGEN (Chen et al., 2019) encodes exemplars into latent vector to guide paraphrasing. (5) SGCP (Kumar et al., 2020) uses a graph encoder to process the exemplar Constituent Trees as the condition. (6) ParafraGPT (Bui et al., 2021) masks words with certain POS types in the target sentence as condition, then builds a paraphrasing generator based on a pre-trained GPT2 (Radford et al., 2019). + +Syntactical Conditions We first examine conditions with manufactured syntax features, including (7) POS Sequence, (8) LCT-Truncated is the LCT sequence without POS-level information, (9) LCT is the full-fledged Linearised Constituent Tree sequence, and (10) Masked Template. Then, two implementations of SSE are evaluated: (11) SSE-POS Sequence uses POS Sequence to measure syntax similarity, and (12) SSE-LCT-Truncated uses LCT-Truncated as measurement. + +Implementation and Hyper-parameters All GCPG models are instantiated by ProphetNet-large (Qi et al., 2020)7. We employ the original hyper-parameter setting of ProphetNet-large to train GCPG. During inference, the beam size and length penalty(Wu et al., 2016) are set to 4 and 1.2 following Bui et al. (2021). As for the + +
ModeliBLEU↑B-R ↑R-1 / R-2 / R-L ↑MTR ↑BS ↑TED ↓
ParaNMT-small
(1) Source-as-Output-17.0518.5023.10 / 47.70 / 12.0028.8086.2012.00
(2) Exemplar-as-Output2.313.3024.40 / 7.50 / 29.1012.1074.205.90
(3) SCPN (2018)-6.4030.30 / 11.20 / 34.6014.6073.709.10
(4) CGEN (2019)8.1413.6044.80 / 21.00 / 48.3024.8079.506.70
(5) SGCP (2020)6.9516.4049.60 / 22.90 / 50.5027.2080.506.80
(6) ParafraGPT (2021)8.6114.5449.67 / 22.42 / 51.2927.8390.788.22
(7) GCPG (POS Sequence)11.9619.9756.20 / 32.36 / 58.9932.6892.578.45
(8) GCPG (LCT-Truncated)12.7422.5459.98 / 36.81 / 62.6137.0493.398.34
(9) GCPG (LCT)11.9219.5255.75 / 30.54 / 58.8831.3592.427.84
(10) GCPG (Masked Template)9.5216.8553.60 / 27.96 / 56.3131.8492.218.84
(11) GCPG (SSE-POS Sequence)10.0723.8260.93 / 37.36 / 61.9836.1591.558.94
(12) GCPG (SSE-LCT-Truncated)12.3226.2463.62 / 40.76 / 64.9839.7993.868.27
QQP-Pos
(13) Source-as-Output-17.9617.2051.90 / 26.20 / 52.9031.1084.9016.20
(14) Exemplar-as-Output10.6416.8038.20 / 20.50 / 43.2017.6078.204.80
(15) SCPN (2018)-15.6040.60 / 20.50 / 44.6019.6077.609.10
(16) CGEN (2019)17.6029.9458.53 / 37.42 / 61.7432.9092.826.43
(17) SGCP (2020)19.9738.0068.10 / 45.70 / 70.2041.3094.536.80
(18) ParafraGPT (2021)21.1935.8666.71 / 43.70 / 68.9440.2694.546.11
(19) GCPG (SSE-LCT-Truncated)22.6442.8872.26 / 51.34 / 74.2246.6395.865.31
+ +Table 2: Results of different syntactical conditions and comparisons with baselines on ParaNMT-small and QQP-Pos datasets. B-R: BLEU-R. R-1: ROUGE-1. R-2: ROUGE-2. R-L: ROUGE-L. MTR: METEOR. BS: BERTScore. $\uparrow$ means higher score is better where $\downarrow$ is exactly the opposite. The highest numbers are in bold. + +SSE dictionary size, the ParaNMT-small has 27530 truncated LCT (the average number of sentences for each LCT: 2.83) and QQP-Pos has 8561 (the average number of sentences for each LCT: 5.99). Metrics Following previous works (Iyyer et al., 2018; Bui et al., 2021), we evaluate generating results on six metrics, including BLEU-4 (Papineni et al., 2002), ROUGE-1 (R-1), ROUGE-2 (R-2), ROUGE-L (R-L) (Lin, 2004), Meteor (MTR) (Denkowski and Lavie, 2014), and BERTScore (BS) (Zhang et al., 2020). Besides, Source-as-Output will also get a high BLEU score and BERTScore, we introduce iBLEU (Sun and Zhou, 2012) for more precise evaluation. As a variant of BLEU, iBLEU considers both fidelity to reference and diversification from input: + +$$ +\mathrm {i B L E U} = \alpha \text {B L E U - R} - (1 - \alpha \text {B L E U - S}), +$$ + +$$ +\text {B L E U - R} = \text {B L E U - 4 (o u t p u t , r e f e r e n c e)}, \tag {3} +$$ + +$$ +\mathrm {B L E U - S} = \mathrm {B L E U - 4 (o u t p u t , i n p u t)}, +$$ + +where the constant $\alpha$ is set to 0.7, as in the original paper. Finally, for syntactical condition evaluation, we follow Kumar et al. (2020) to calculate TreeEdit Distance (TED)8 between the Constituency Parse Trees of both output and reference. + +Results As shown in Table 2, the main conclusions are: (1) SSE consistently and significantly outperforms conditions that constructed with manufactured syntax features (Rows 11-12 vs. Rows 7-10). (2) GCPG with SSE gets significant improvement over the previous SOTA (Row 12/19 vs. Row 6/18). (3) All syntactical conditions reconstructed in GCPG outperform baselines (Rows 7-12 vs. Rows 3-6), demonstrating the superiority of GCPG paradigm. However, the TED of GCPG is lower than CGEN on ParaNMT-small dataset. As the ParaNMT-small contains various noise data points, it is optimistic to assume that the corresponding constituency parse tree could be well aligned (Kumar et al., 2020), which may limit TED in evaluation. To address this issue, we also conduct a human evaluation (details in § 4.3). As shown in Table 4, GCPG with SSE (GCPG-S) performs better than CGEN on Syntax score. + +# 4.2 Lexically Controllable Paraphrasing + +As mentioned in § 3.2, we use three different keyword extraction methods to pre-specify keywords and comprehensively evaluate the GCPG: (1) TF-IDF (2) TextRank (Mihalcea and Tarau, 2004), and (3) KeyBERT (Grootendorst, 2020). Also, we compare GCPG with recent competitive method CTRL + +
ConditioniBLEU↑B-R ↑R-1 / R-2 / R-L ↑MTR ↑BS ↑TED ↓
Keywords Extraction, GCPG instantiated by ProphetNet
(1) GCPG (None)4.6718.4655.29 / 31.17 / 55.1832.4292.3211.78
(2) CTRLsum (2020)*10.0621.3858.04 / 35.63 / 58.6235.4192.6211.13
(3) GCPG (TF-IDF*)10.0723.0461.92 / 38.68 / 61.7136.9792.8610.79
(4) GCPG (TextRank*)8.1619.6356.04 / 32.08 / 56.5433.6092.4512.47
(5) GCPG (KeyBERT*)11.0324.1260.92 / 38.00 / 61.1435.4192.7910.26
(6) GCPG (KeyBERT (Upper Bound))16.0628.6467.81 / 43.99 / 66.3040.2793.449.98
Keywords (KeyBERT*) + Syntactical Condition, GCPG instantiated by ProphetNet
(7) GCPG (KeyBERT* + POS Sequence)15.1025.2262.96 / 39.04 / 65.3236.4290.968.01
(8) GCPG (KeyBERT* + LCT-Truncated)15.3826.8066.07 / 43.52 / 68.0739.5390.568.08
(9) GCPG (KeyBERT* + LCT)14.4723.5261.92 / 36.33 / 64.3834.7392.748.00
(10) GCPG (KeyBERT* + Mask Template)12.1320.9858.83 / 33.58 / 61.0135.0292.678.44
(11) GCPG (KeyBERT* + SSE-POS)15.6731.0266.85 / 45.30 / 68.4840.1290.397.95
(12) GCPG (KeyBERT* + SSE-LCT-Truncated)15.7330.9268.40 / 46.73 / 69.9341.9894.347.95
+ +Table 3: Performance of different conditions and combinations under GCPG on ParaNMT-small. For fair comparison, we use CTRLsum instantiated by ProphetNet. Result with * means that we use a vanilla ProphetNet trained on the same dataset to predict keywords for GCPG while testing. + +sum (He et al., 2020), which extracts entity words as keywords. We follow the settings in $\S 4.1$ . + +Metrics For lexical condition, it should be noted that there is a lack of the explicit request of desirable keywords in the testing set. A generated paraphrase hinted by model predicted keywords might get a low score in BLEU, although humans consider it reasonable. This is because paraphrasing models might focus on keywords that are not consistent with the single reference. Therefore, we evaluate GCPG in three settings. First, following Liu et al.(2020b), we use a keywords prediction model to generate top- $k$ groups of keywords, which are fed into GCPG to generate $k$ paraphrases. Then the sentence that has the highest BLEU with the reference is selected as the final output (marked with $*$ ). $k$ is set to 4 as well as beam size. Note that we use this setting to report the final results unless otherwise specified. Second, we further conduct human evaluations on the keyword condition based on KeyBERT (The details are in § 4.3). We denote it as "GCPG-L ( $k=1$ )". Here " $k=1$ " means GCPG only produces one paraphrase for each input, constrained by the top-1 set of keywords produced by KeyBERT. Third, following Zeng et al. (2019), we directly extract keywords from references as the condition, marked with "(Upper Bound)". + +Results As shown in the first five rows of Table 3, KeyBERT outperforms other two keyword extraction methods and CTRLsum on the iBLEU score. Also, GCPG with keyword condition significantly performs better than GCPG without it, which verifies the lexically controllable ability of GCPG. + +# 4.3 Combinations + +To facilitate the description, we define that "GCPGL" denotes GCPG with the keyword condition extracted by KeyBERT, "GCPG-S" is GCPG with the SSE-LCT-Truncated condition, and "GCPG-LS" indicates the combination of conditions in "GCPG-L" and "GCPG-S". Meanwhile, GCPG is also instantiated by ProphetNet-large. + +Metrics We follow the metrics in § 4.1, yet the automatic evaluations can not fully capture the fluency and the quality of the generation results on CPG. Therefore, we conduct human evaluation following Kumar et al.(2020). Specifically, we evaluate GCPG with different conditions on ParaNMT-small, then choose the best settings to compare GCPG with baselines on QQP-Pos. 100 test samples are randomly selected from each dataset. Then, 5 crowdsourced evaluators are shown a source sentence and the corresponding reference, then asked to rate model results in three categories: whether the paraphrase remains loyalty to the source sentence, the fluency of paraphrase, and syntax similarity with gold reference. Scores are ranged from 1 to 4, and the higher score is better. + +Results As shown in Table 3, combinations of lexical and syntactical conditions get consistently further improvements compared with employing lexical condition individually (Rows 7-12 vs. Row 5). Then, we illustrate human evaluations in Table 4. GCPG with lexical condition (GCPG-L $(k = 1)$ ) outperforms baselines in meaning and fluency, yet poor in syntax similarity. More impor + +
ModelLoyaltyFluencySyntaxAll
ParaNMT-small
CGEN (2019)1.472.131.815.41
ParafraGPT (2021)1.862.422.056.33
GCPG-L (k=1)2.943.632.298.86
GCPG-S2.873.362.578.80
GCPG-LS (k=1)3.093.512.469.06
QQP-Pos
CGEN (2019)1.722.522.226.46
ParafraGPT (2021)2.432.912.617.95
GCPG-LS (k=1)2.973.432.819.21
+ +Table 4: Results of Human evaluation. + +
ModelBLEU-Exemplar ↓
ParaNMT-smallQQP-Pos
ParafraGPT (2021)7.3224.31
GCPG-S2.6323.17
Reference3.3016.80
+ +tantly, the combination of lexical and syntactical conditions (GCPG-LS $(k = 1)$ ) shows significantly improvements on all three scores. + +# 4.4 Analyses and Discussions + +We conduct discussions to shed light on other interesting properties of GCPG. Due to space constraints, we take discussions with GCPG instantiated by ProphetNet-large. + +Exemplar-side Words Copying Problem We calculate BLEU-4 between model outputs and exemplars. As shown in Table 5, GCPG with SSE (i.e., GCPG-S) can significantly reduce BLEU-Exemplar comparing with ParafraGPT, gets 4.69 / 1.14 improvements on two datasets, demonstrating that SSE effectively alleviates this problem. + +Lexical Condition Analyze further investigate GCPG with lexical condition from two aspects: 1) Generating novel expressions; 2) How frequently and correctly do the model incorporate the lexical condition in outputs? For the first one, following Dou et al.(2021), the number of novel $n$ -grams is counted in the model output. Specifically, these $n$ -grams appear in gold references but not in source sentences. After normalized by the total number of $n$ -grams, we calculate the recall of novel $n$ -grams. As shown in Figure 4, GCPG indeed generates novel expressions. Then, we explore the lexical condition accuracy of the settings in Table 3 (Row + +2 vs Row 5), i.e., whether offered keywords appear in final outputs. Specifically, we ignore the model outputs that only use “[NONE]” as the keyword while paraphrasing for a fair comparison. As shown in Table 6, GCPG-L outperforms CTRLsum (He et al., 2020) with $9.8\%$ improvement. + +![](images/16c8b4bf23659bb346245fd9850eac59a3bda7f0242e318972bc2bfcc8e556af.jpg) +Figure 4: Recall of novel $n$ -grams results. + +Table 5: GCPG can significantly reduce BLEU-Exemplar score compared with previous SOTA. + +
MethodAccuracy (%)iBLEU ↑
CTRLsum (2020)89.4510.06
GCPG-L99.2511.03
+ +GCPG Backbone Analyze Whether the performance gain only from using strong PLMs is also of concern. As shown in Table 7, the results show that GCPG instantiated by vanilla Transformer gets comparable performance with ParafraGPT $^{10}$ . Also, we compare GCPG with ParafraGPT instantiated by the same backbone. GCPG still outperforms ParafraGPT with 2.8 iBLEU score. + +Table 6: Lexical condition accuracy on ParaNMT-small. + +
BackboneMethodiBLEU↑
Transformer (2017)-4.72
BART (2020)-6.08
ProphetNet (2020)-4.67
GPT2 (2019)ParafraGPT (2021)8.61
ProphetNet (2020)ParafraGPT‡9.52
Transformer (2017)GCPG-S8.53
BART (2020)GCPG-S10.12
ProphetNet (2020)GCPG-S12.32
+ +Table 7: Performance of GCPG-S with different backbones on ParaNMT-small. $\ddagger$ : for fair comparisons, ParafraGPT is instantiated by ProphetNet. + +# 5 Conclusions + +In this paper, we propose a general framework GCPG, enabling flexibly combine lexical and syn + +tactical conditions and exploring their mutual effectiveness. Under GCPG, we provide SSE that allows GCPG to directly model syntax information from natural sentences and better utilize PLMs. As we tentatively give a successful implementation of leveraging two types of conditions in a unified circumstance, multilingual CPG and more types of conditions are barely being discussed. In the future, we will investigate to uniformly represent these conditions in a more superior way. + +# References + +Tien-Cuong Bui, Van-Duc Le, Hai-Thien To, and Sang-Kyun Cha. 2021. Generative pre-training for paraphrase generation by representing and predicting spans in exemplars. In IEEE BigComp, pages 83-90. IEEE. +Mingda Chen, Qingming Tang, Sam Wiseman, and Kevin Gimpel. 2019. Controllable paraphrase generation with a syntactic exemplar. In ACL, pages 5972-5984. ACL. +Douglass Cutting, Julian Kupiec, Jan Pedersen, and Penelope Sibun. 1992. A practical part-of-speech tagger. In Third Conference on Applied Natural Language Processing, pages 133-140. +Michael J. Denkowski and Alon Lavie. 2014. Meteor universal: Language specific translation evaluation for any target language. In WMT-ACL, pages 376-380. ACL. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: pre-training of deep bidirectional transformers for language understanding. In *NAACL*, pages 4171–4186. ACL. +Zi-Yi Dou, Pengfei Liu, Hiroaki Hayashi, Zhengbao Jiang, and Graham Neubig. 2021. Gsum: A general framework for guided neural abstractive summarization. In NAACL, pages 4830-4842. ACL. +Joseph L Fleiss. 1971. Measuring nominal scale agreement among many raters. *Psychological bulletin*, 76(5):378. +Wee Chung Gan and Hwee Tou Ng. 2019. Improving the robustness of question answering systems to question paraphrasing. In ACL, pages 6065-6075. ACL. +Tanya Goyal and Greg Durrett. 2020. Neural syntactic preordering for controlled paraphrase generation. In ACL, pages 238-252. ACL. +Maarten Grootendorst. 2020. Keybert: Minimal keyword extraction with bert. +Yunfan Gu, Yang Yuqiao, and Zhongyu Wei. 2019. Extract, transform and filling: A pipeline model for question paraphrasing based on template. In W-NUT, pages 109-114. + +Junxian He, Wojciech Kryscinski, Bryan McCann, Nazneen Fatema Rajani, and Caiming Xiong. 2020. Ctrlsum: Towards generic controllable text summarization. CoRR, abs/2012.04281. +Chris Hokamp and Qun Liu. 2017a. Lexically constrained decoding for sequence generation using grid beam search. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1535-1546. +Chris Hokamp and Qun Liu. 2017b. Lexically constrained decoding for sequence generation using grid beam search. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pages 1535-1546. Association for Computational Linguistics. +Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. 2018. Adversarial example generation with syntactically controlled paraphrase networks. In *NAACL*, pages 1875-1885. ACL. +Ashutosh Kumar, Kabir Ahuja, Raghuram Vadapalli, and Partha P. Talukdar. 2020. Syntax-guided controlled generation of paraphrases. Trans. Assoc. Comput. Linguistics, 8:330-345. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In ACL, pages 7871-7880. ACL. +Yinghao Li, Rui Feng, Isaac Rehg, and Chao Zhang. 2020. Transformer-based neural text generation with syntactic guidance. CoRR, abs/2010.01737. +Chin-Yew Lin. 2004. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pages 74-81, Barcelona, Spain. ACL. +Dayiheng Liu, Jie Fu, Qian Qu, and Jiancheng Lv. 2019. Bfgan: backward and forward generative adversarial networks for lexically constrained sentence generation. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 27(12):2350-2361. +Dayiheng Liu, Jie Fu, Yidan Zhang, Chris Pal, and Jiancheng Lv. 2020a. Revision in continuous space: Unsupervised text style transfer without adversarial learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 8376-8383. +Dayiheng Liu, Yeyun Gong, Yu Yan, Jie Fu, Bo Shao, Daxin Jiang, Jiancheng Lv, and Nan Duan. 2020b. Diverse, controllable, and keyphrase-aware: A corpus and method for news multi-headline generation. In EMNLP, pages 6241-6250. ACL. +Dayiheng Liu, Yu Yan, Yeyun Gong, Weizhen Qi, Hang Zhang, Jian Jiao, Weizhu Chen, Jie Fu, Linjun Shou, Ming Gong, Pengcheng Wang, Jiusheng Chen, Daxin Jiang, Jiancheng Lv, Ruofei Zhang, Winnie Wu, + +Ming Zhou, and Nan Duan. 2021. GLGE: A new general language generation evaluation benchmark. In Findings of ACL, pages 408-420. ACL. +Mingtong Liu, Erguang Yang, Deyi Xiong, Yujie Zhang, Chen Sheng, Changjian Hu, Jinan Xu, and Yufeng Chen. 2020c. Exploring bilingual parallel corpora for syntactically controllable paraphrase generation. In IJCAI, pages 3955-3961. ijcai.org. +Nitin Madnani and Bonnie J. Dorr. 2010. Generating phrasal and sentential paraphrases: A survey of data-driven methods. Comput. Linguistics, 36(3):341-387. +Jonathan Mallinson, Rico Sennrich, and Mirella Lapata. 2017. Paraphrasing revisited with neural machine translation. In EACL, pages 881-893. ACL. +Louis Martin, Angela Fan, Éric de la Clergerie, Antoine Bordes, and Benoit Sagot. 2020. Muss: Multilingual unsupervised sentence simplification by mining paraphrases. arXiv preprint arXiv:2005.00352. +Kathleen R. McKeown. 1983. Paraphrasing questions using given and new information. Am. J. Comput. Linguistics, 9(1):1-10. +Rada Mihalcea and Paul Tarau. 2004. Textrank: Bringing order into text. In EMNLP, pages 404-411. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In ACL, pages 311-318. ACL. +Matt Post and David Vilar. 2018. Fast lexically constrained decoding with dynamic beam allocation for neural machine translation. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 1 (Long Papers), pages 1314-1324. Association for Computational Linguistics. +Weizhen Qi, Yu Yan, Yeyun Gong, Dayiheng Liu, Nan Duan, Jiusheng Chen, Ruofei Zhang, and Ming Zhou. 2020. Prophetnet: Predicting future n-gram for sequence-to-sequence pre-training. In EMNLP, volume EMNLP 2020 of Findings of ACL, pages 2401-2410. ACL. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Cynthia M Shewan. 1985. Auditory comprehension problems in adult aphasic individuals. Human Communication Canada, 9(5):151-155. +Hong Sun and Ming Zhou. 2012. Joint learning of a dual SMT system for paraphrase generation. In ACL, pages 38-42. ACL. + +Jiao Sun, Xuezhe Ma, and Nanyun Peng. 2021. AESOP: paraphrase generation with adaptive syntactic control. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, 2021, pages 5176-5189. Association for Computational Linguistics. +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 NeurIPS, pages 5998-6008. +John Wieting and Kevin Gimpel. 2018. *Paranmt-50m: Pushing the limits of paraphrastic sentence embeddings with millions of machine translations*. In *ACL*, pages 451–462. Association for Computational Linguistics. +Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyls, Greg Corrado, Macduff Hughes, and Jeffrey Dean. 2016. Google's neural machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144. +Kexin Yang, Wenqiang Lei, Dayiheng Liu, Weizhen Qi, and Jiancheng Lv. 2021. Pos-constrained parallel decoding for non-autoregressive generation. In ACL, pages 5990-6000. ACL. +Daojian Zeng, Haoran Zhang, Lingyun Xiang, Jin Wang, and Guoliang Ji. 2019. User-oriented paraphrase generation with keywords controlled network. IEEE Access, 7:80542-80551. +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. 2020. Bertscore: Evaluating text generation with BERT. In ICLR. OpenReview.net. + +# A GCPG Backbone Selection + +We evaluate the following text generation models to select a backbone model for our GCPG. (1) Transformer (Vaswani et al., 2017), the conventional version in the original paper. (2) BART (Lewis et al., 2020)11 has a denoising autoencoder for pre-training sequence-to-sequence models, and (3) ProphetNet-large (Qi et al., 2020)12, which has shown its effectiveness in text generation (Liu et al., 2021). The results are shown in Table 8. + +
ModeliBLEU↑B-R ↑R-1 / R-2 / R-L ↑MTR ↑BS ↑TED ↓
ParaNMT-small
Transformer4.7214.6651.05 / 26.88 / 51.3230.6791.3012.71
BART6.0817.7852.37 / 27.02 / 51.5231.5791.9911.92
ProphetNet4.6718.4655.29 / 31.17 / 55.1832.4292.3211.78
QQP-Pos
Transformer7.6323.4454.58 / 30.48 / 56.6332.6093.1811.84
BART3.1423.0756.43 / 32.12 / 57.6434.2693.5813.05
ProphetNet6.4325.7958.40 / 34.52 / 59.9835.7593.8811.74
+ +Table 8: Results of different generation models on ParaNMT-small and QQP-Pos datasets. B-R: BLEU-R. R-1: ROUGE-1. R-2: ROUGE-2. R-L: ROUGE-L. MTR: METEOR. BS: BERTScore. $\uparrow$ means higher score is better where $\downarrow$ is exactly the opposite. The highest numbers are in bold. + +# B GCPG with syntactical conditions on QQP-Pos dataset + +The experimental results can be found in Table 9. + +# C Human Evaluation Details + +For human evaluation, we first set a guideline for evaluating, which includes the task background, key points, detailed descriptions and examples of evaluation scores from 1 to 4. Then, we set an entry barrier for annotators. In detail, we organize a training program and a preliminary annotating examination (50 examples for each data set) to select appropriate annotators. + +Score Definition We define three categories in human evaluation as follows: + +Loyalty means whether the option is consistent with the meaning of the original sentence (whether the content is missing or omitted). + +Fluency means whether the sentence corresponding to the option is fluent. + +Syntax is the similarity of grammatical structure with reference answer, which means whether the sentence structure of this option similar to the reference answer. + +Inter-annotator agreement We use Fleiss' kappa (Fleiss, 1971) to measure 5 annotator's reliability13. The results are : 1) Paranmt-small dataset (loyalty: 0.56, fluency: 0.42, syntax: 0.41); 2) QQP-Pos (loyalty: 0.55, fluency: 0.40, syntax: 0.37). + +# D GCPG Backbone Analyze + +All kinds of scores in GCPG Backbone Analyze can be found in Table 10. + +# E Case Study + +The qualitative effect of the lexical and syntactical conditions on the model output is also of interest. To intuitively display the effects of conditions, we show some paraphrasing results in Figure 5. In detail, GCPG-L can generate sentence "A powerful healing energy comes out of love." that contain prespecified keywords "[healing)". However, lexical condition provides less information about syntactical controlling. In comparison, GCPG-LS shows better performances on both controllability of lexical items and syntax. + +
ModeliBLEU ↑B-R ↑R-1 / R-2 / R-L ↑MTR ↑BS ↑TED ↓
QQP-Pos
(1) GCPG (POS Sequence)17.8437.4970.10 / 47.43 / 71.4943.0595.467.04
(2) GCPG (LCT-Truncated)20.9340.5571.31 / 49.20 / 73.3145.1795.835.66
(3) GCPG (LCT)20.1738.8870.61 / 48.00 / 72.4942.9595.586.11
(4) GCPG (Masked Template)19.1633.6564.78 / 42.17 / 67.3138.9794.866.22
(5) GCPG (SSE-POS Sequence)21.5642.6372.78 / 52.92 / 74.5347.0895.885.85
(6) GCPG (SSE-LCT-Truncated)22.6442.8872.26 / 51.34 / 74.2246.6395.865.31
+ +Table 9: Results of different syntactical conditions on QQP-Pos dataset. B-R: BLEU-R. R-1: ROUGE-1. R-2: ROUGE-2. R-L: ROUGE-L. MTR: METEOR. BS:BERTScore. $\uparrow$ means higher score is better where $\downarrow$ is exactly the opposite. The highest numbers are in bold. + +
BackboneMethodiBLEU ↑B-R ↑R-1 / R-2 / R-L ↑MTR ↑BS ↑TED ↓
Transformer (2017)-4.7214.6651.05 / 26.88 / 51.3230.6791.3012.71
BART (2020)-6.0817.7852.37 / 27.02 / 51.5231.5791.9911.92
ProphetNet (2020)-4.6718.4655.29 / 31.17 / 55.1832.4292.3211.78
GPT2 (2019)ParafraGPT (2021)8.6114.5449.67 / 22.42 / 51.2927.8390.788.22
ProphetNet (2020)ParafraGPT‡9.5216.8553.60 / 27.96 / 56.3131.8492.218.84
Transformer (2017)GCPG-S8.5317.1455.89 / 30.83 / 57.1533.2992.249.67
BART (2020)GCPG-S10.1219.0857.87 / 34.65 / 59.8334.4892.5011.02
ProphetNet (2020)GCPG-S12.3226.2463.62 / 40.76 / 64.9839.7993.868.27
+ +Table 10: Performance of different Backbones under GCPG-S on ParaNMT-small. $\ddagger$ : for fair comparisons, ParafraGPT (previous SOTA) is also instantiated by ProphetNet. + +
SampleInputA powerful restorative energy emerges out of love.
ExemplarThere's one thing that makes me feel normal.
ReferenceThere is a powerful healing energy that emanates from loving.
BaselinesCGENThere's great energy and let it be powerful.
SGCPThere's one energy that helps you look out of love restor.
ParafraGPTThere is strong evidence that loveates energy.
OursGCPG-LA powerful healing energy comes out of love. [healing]
GCPG-SThere's a powerful restorative energy that makes you feel good.
GCPG-LSThere's a powerful healing energy that comes out of love. [healing]
SampleInputIn west hollywood you can get arrested for not curbing your dog!
ExemplarYou'll never do it in this world if you don't know the lie of the country!
ReferenceThey can arrest you in west hollywood if you don't have a dog on a leash!
BaselinesCGENYou won't get you in the car and you don't get back in front of you!
SGCPYou can't arrest you in the west because you don't arrest your dog.
ParafraGPTYou won be arrested in this west if you don't get the cur of dog!
OursGCPG-LThey can arrest you in west hollywood if you don't stop the dog. [arrest]
GCPG-SYou can be arrested in west hollywood if you don't keep an eye on your dog!
GCPG-LSThey can arrest you in west hollywood if you don't curb your dog! [arrest]
+ +Figure 5: Samples of paraphrases. Words in “[” are offered by our keywords prediction model based on KeyBERT. We highlight different parts for better view. \ No newline at end of file diff --git a/gcpgageneralframeworkforcontrollableparaphrasegeneration/images.zip b/gcpgageneralframeworkforcontrollableparaphrasegeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c3c9f137be0c64bf69c0d7862924e2318f7d1d07 --- /dev/null +++ b/gcpgageneralframeworkforcontrollableparaphrasegeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd5c9bf9a87f0c4b679c7dc672d29d4121cf6b1fe05cc8c122b6b890c08f0ba9 +size 915516 diff --git a/gcpgageneralframeworkforcontrollableparaphrasegeneration/layout.json b/gcpgageneralframeworkforcontrollableparaphrasegeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..579b915e62af4d836f2cc400c86fc5cd6a3a50b8 --- /dev/null +++ b/gcpgageneralframeworkforcontrollableparaphrasegeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c25a04333b33160623e9cdb664240a3da23d2734ac050ac3c7341e7eb7e3e3d +size 340724 diff --git a/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_content_list.json b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f13d4c7ba9d338833b38d9661d337ff52595ec5b --- /dev/null +++ b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d14d1d5c893266a3a37bf9bc4e3cf2a301a870a561a8f3c5fd5f3c125de2771d +size 94242 diff --git a/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_model.json b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_model.json new file mode 100644 index 0000000000000000000000000000000000000000..05087913689a5cb5236a6fdfcd35814312233fe1 --- /dev/null +++ b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb00914a5bb0cd70da949fa102ac13e324cf4e84d8228840aa0cf8443d2ada64 +size 120939 diff --git a/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_origin.pdf b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a7e8ab6d8368345ee4b15ccc178e1fb051ab6a44 --- /dev/null +++ b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/be437431-0c0c-49a5-83ea-56b140e26f39_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6457ba686ef00969b5a9ba713c81c3bf655bdac821cb3a520d5ea8c7442a2ffc +size 668051 diff --git a/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/full.md b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3e1fa2dbc1eaf37527861763208715eefef7c69b --- /dev/null +++ b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/full.md @@ -0,0 +1,347 @@ +# Generalized but not Robust? Comparing the Effects of Data Modification Methods on Out-of-Domain Generalization and Adversarial Robustness + +Tejas Gokhale* Swaroop Mishra* Man Luo* Bhavdeep Singh Sachdeva Chitta Baral + +Arizona State University + +{tgokhale, srmishrl, mluo26, bssachde, chitta}@asu.edu + +# Abstract + +Data modification, either via additional training datasets, data augmentation, debiasing, and dataset filtering, has been proposed as an effective solution for generalizing to out-of-domain (OOD) inputs, in both natural language processing and computer vision literature. However, the effect of data modification on adversarial robustness remains unclear. In this work, we conduct a comprehensive study of common data modification strategies and evaluate not only their in-domain and OOD performance, but also their adversarial robustness (AR). We also present results on a two-dimensional synthetic dataset to visualize the effect of each method on the training distribution. This work serves as an empirical study towards understanding the relationship between generalizing to unseen domains and defending against adversarial perturbations. Our findings suggest that more data (either via additional datasets or data augmentation) benefits both OOD accuracy and AR. However, data filtering (previously shown to improve OOD accuracy on natural language inference) hurts OOD accuracy on other tasks such as question answering and image classification. We provide insights from our experiments to inform future work in this direction. + +# 1 Introduction + +Deep neural networks have emerged as a widely popular architectural choice for modeling tasks in multiple domains such as (but not limited to) computer vision (Yuille and Liu, 2021), natural language processing (Hochreiter and Schmidhuber, 1997; Vaswani et al., 2017), and audio (Hannun et al., 2014). While these models are highly capable of learning from training data, recent studies show that they are quite prone to failure on new test sets or under distribution shift (Taori et al., 2020), natural corruptions (Hendrycks and Dietterich, 2019), adversarial attacks (Goodfellow et al., + +2015), spurious correlations (Beery et al., 2018), and many other types of "unseen" changes that may be encountered after training. This shortcoming stems from the i.i.d. assumption in statistical machine learning which guarantees good performance only on test samples that are drawn from an underlying distribution that is identical to the training dataset. For instance, digit recognition models trained on the black-and-white MNIST training images are almost perfect ( $>99\%$ accuracy) on the corresponding test set, yet their performance on colored digits and real-world digits from street number plates is less than $75\%$ . Similarly, state-of-the-art NLP models have been shown to fail when negation is introduced in the input (Kassner and Schütze, 2020). These findings pose a significant challenge to the practical adoption of these models and their reliability in the real-world. + +To test model performance beyond the traditional notion of in-domain (ID) generalization, two prominent ideas have emerged: out-of-domain (OOD generalization) a.k.a. domain generalization1, and adversarial robustness. The OOD generalization objective expects a model which is trained on distribution $\mathcal{D}$ to perform reliably on unseen distributions $\mathcal{D}_e$ , $e \in \{1, \dots, n\}$ , that differ from $\mathcal{D}$ . For a trained classifier $f^*$ , OOD accuracy on previously unseen distribution $\mathcal{D}_e$ is defined as: + +$$ +\operatorname {a c c} _ {\mathrm {O O D}} ^ {e} = \underset {(\mathbf {x}, \mathbf {y}) \sim \mathcal {D} _ {e}} {\mathbb {E}} [ \mathbb {I} (f ^ {*} (\mathbf {x}) = \mathbf {y}) ] \tag {1} +$$ + +To define adversarial robustness, consider an input $\mathbf{x}$ and a true label $\mathbf{y}$ . For a classifier loss function $\ell$ , a loss-maximizing perturbation $\delta^{*}$ within $\Delta_{\epsilon}$ (an $\epsilon$ -bounded neighborhood of $\mathbf{x}$ ) is defined as: + +$$ +\delta_ {\mathbf {x}} ^ {*} = \max _ {\delta \in \Delta_ {\epsilon}} \ell \left(f ^ {*} (\mathbf {x} + \delta), \mathbf {y}\right). \tag {2} +$$ + +The second idea is that of adversarial robustness. Recent work on adversarial examples has revealed + +the vulnerability of deep neural networks against small perturbations of the original data. Adversarial robustness in such under this setting is defined as the accuracy of the classifier on adversarial samples $\mathbf{x} + \delta_{\mathbf{x}}$ , where the perturbation lies within an $\ell_p$ norm bound: $||\delta_{\mathbf{x}}||_p < \epsilon$ . + +$$ +\operatorname {a c c} _ {r o b} = \underset {(\mathbf {x}, \mathbf {y}) \sim \mathcal {D}} {\mathbb {E}} \mathbb {I} \left(f ^ {*} \left(\mathbf {x} + \delta_ {\mathbf {x}}\right) = \mathbf {y}\right). \tag {3} +$$ + +In the context of text classification, the norm-bound can also be in the form of small character-level or word-level perturbations such as swapping, inserting, or deleting characters or words. In essence, adversarial robustness measures the invariance of the classifier to small perturbations of the input. + +Various methods have been developed that either improve OOD generalization or improve adversarial robustness. Notable among these are techniques that modify the distribution of the training dataset. In this paper, we focus on three major data modification techniques – the use of additional datasets (also known as multi-source training), data augmentation, and data filtering; in addition we also consider model-based debiasing techniques which do not alter the data distribution explicitly. We study the performance of these methods on three representative tasks – natural language inference (NLI), extractive question answering (QA), and image classification (IC). + +Our first aim in this paper is to understand whether the increase or decrease in OOD generalization by each method over the naive baseline (standard training on the source dataset) is consistent across tasks. To further conduct fine-grained analysis, we also analyze the effect of these methods on in-domain (ID) accuracy on the test set for each task, since in the ideal case improvement in OOD performance should not come at the cost of in-domain accuracy. + +Recent work seeks to understand the relationships between in-domain and out-of-domain performance: for instance, Miller et al. (2021) empirically show that ID and OOD performance are strongly correlated, Raghunathan et al. (2020); Yang et al. (2020) show a trade-off between robustness and accuracy for adversarially trained models. However it is not clear how methods designed for OOD generalization affect robustness. This is largely because work on domain generalization reports only IID and OOD metrics, and work on robustness reports only ID and robustness metrics. Our second aim is to understand the effect of these generalization + +methods on adversarial robustness. + +In addition to our experiments on NLP and vision tasks, we also provide an experiment on a synthetic binary classification dataset where points lie in a 2-dimensional feature space and are separated by concentric circles into class labels. This setting allows us to visualize the effect of data modification techniques on the training distribution and the resulting performance. + +Our findings can be summarized as follows: + +- More data benefits OOD generalization, +Data filtering hurts OOD generalization, and +- Data filtering significantly hurts adversarial robustness on all benchmarks. + +These findings and our additional analysis raise new questions for robustness and domain generalization research. Significant among these are the importance of both diversity and number of training samples for inductive bias and generalization guarantees, the problems associated with data filtering in terms of robustness, and the importance of a comprehensive set of evaluation metrics that could be adopted for future work. + +# 2 Categorization of Domain Generalization Methods + +In this section, we provide a categorization of methods that are typically used as baselines for domain generalization. We briefly explain the method and provide relevant related work in which these ideas are used as methods for domain generalization. Throughout this paper, we will refer to the original training distribution as the "source" and the out-of-distribution datasets as the "targets". + +Single-Source Training (SS) refers to the "vanilla" baseline which is trained only on the source dataset, without any dataset modification. SS utilizes no other information apart from the single source dataset $\mathcal{D}$ and updates parameters $\theta$ of classifier $f$ to minimize the risk on the source using approaches such as ERM (Vapnik and Chervonenkis, 1991). + +$$ +\underset {\theta} {\text {m i n i m i z e}} \underset {(\mathbf {x}, \mathbf {y}) \sim \mathcal {D}} {\mathbb {E}} \ell (f (\mathbf {x}; \theta), \mathbf {y}). \tag {4} +$$ + +Multi-Source Training (MS). This method is identical to SS except that additional training datasets $\mathcal{D}'$ are used for risk minimization. + +$$ +\underset {\theta} {\text {m i n i m i z e}} \mathbb {E} _ {(\mathbf {x}, \mathbf {y}) \sim \mathcal {D} \cup \mathcal {D} ^ {\prime}} \ell (f (\mathbf {x}; \theta), \mathbf {y}). \tag {5} +$$ + +Usually $\mathcal{D}'$ are designed for the same task as $\mathcal{D}$ but may have different styles, characteristics, or sources of collection. For instance, while both SNLI (Bowman et al., 2015) and MNLI (Williams et al., 2018) are datasets for natural language inference with identical class labels, SNLI was collected from image captions, while MNLI was collected from Open American National Corpus $^2$ . + +Gulrajani and Lopez-Paz (2020) provide an extensive comparative study of models trained for multi-source domain generalization for image classification and surprisingly find that if multiple source domains are available, ERM is empirically the best approach as compared to specially designed DG methods such as meta-learning (Li et al., 2018a), learning domain-invariant features (Ganin et al., 2016), invariant risk minimization (Arjovsky et al., 2019), etc. These findings have also been observed on text classification experiments in (Koh et al., 2021). Hendrycks et al. (2020a) show that pre-training transformer architectures on diverse data leads to higher OOD accuracies on multiple tasks such as semantic textual similarity, sentiment classification, reading comprehension and natural language inference. + +Data Augmentation (DA). When additional training distributions are not directly available, transformations of samples in $\mathcal{D}$ using pre-defined augmentation functions can be used to create $\mathcal{D}'$ and train the model. Such data augmentation functions are typically derived from existing knowledge about the invariance of the task w.r.t. certain transformations. For instance, for image classification, addition of small noise, small translations, scaling, etc. are common data augmentation functions, since they do not change the true label for the image. Similarly, for text inputs, synonyms of words are commonly used since they do not change the semantics of the sentence. NLP data augmentation techniques include UDA (Xie et al., 2020), EDA (Wei and Zou, 2019), and back-translation for question answering (Longpre et al., 2019). + +Data Filtering (DF). Dataset filtering has been previously explored for quality control, such as, removing noise and artifacts to curate and improve publicly sourced datasets. However, there has been recent interest in considering DF as a method for bias reduction and generalization. This idea can be traced back to work by Zellers et al. (2018, 2019), + +that proposed DF as an algorithmic method to avoid annotation artifacts and spurious correlations during dataset construction. AFLite (Bras et al., 2020) extended this idea to a generic filtering methodology that can work without any pre-defined rules or strategies. Instead, AFLite operates by utilizing several weak learners (such as support-vector machines) trained over small subsets to identify samples that are easy to classify. It is argued that such samples are more likely to carry biases, and as such, could be removed. AFLite suggests that reduction of a dataset to even $10\%$ of the original size can boost OOD accuracy on NLI. In the vision domain, similar ideas have been proposed concurrently, including REPAIR (Li and Vasconcelos, 2019) and RESOUND (Li et al., 2018b), in which instead of completely removing samples, biased samples are assigned smaller weights. However these methods require a prior knowledge of the bias variable. Liu et al. (2021) have recently proposed a simple approach which upweights samples which have higher loss – this is shown to improve worst-group accuracy without having access to the bias variable. + +Model De-biasing (DB). Methods under this category do not directly alter the training dataset, but instead resort to changes in the modeling technique – these changes can be in terms of the optimization function, regularization, additional auxiliary costs, etc. The main idea in DB is to utilize known biases (or identify unknown biases) in the data distribution, model these biases in the training pipeline, and use this knowledge to train robust classifiers (Clark et al., 2019; Wu et al., 2020; Bhargava et al., 2021). In the image classification literature, there is growing consensus on enforcing a consistency on different views (or augmentations) of an image in order to achieve debiasing (Hendrycks et al., 2020c; Xu et al., 2020; Chai et al., 2021; Nam et al., 2021). Unlike DF, model de-biasing does not directly alter the training distribution, but instead allows the model to learn which biases to ignore. + +# 3 Toy Example: Concentric Circles + +We begin with a simple two-dimensional example to illustrate our experimental setting and to show how each method affects the distribution of the training set. Consider the set of points shown in Figure 1 where the points belong to two class labels (either 0 or 1) and are seen to lie on concentric circles. Points with label 0 are closer to the origin, + +![](images/d1403b8488535964b4c971e8167e3db0dc17eb323fe0ba0e9311697dcb6a0123.jpg) +Figure 1: Our toy experimental setting consists of points in $\mathbb{R}^2$ belonging to two classes (0/1). This illustration shows the discrepancy between the source dataset (SS) and the out-of-domain dataset (OOD). + +while points with label 1 are closer to a distance of 1 from the origin. Our aim is to start with the single source dataset and train the model to generalize on the out-of-domain (OOD) dataset. An important thing to note here is that the source dataset contains a subset of points with label 0 (orange) clustered around $(0.4, 0.0)$ and a subset with label 1 clustered around $(-1, 0.0)$ . This implies that class-0 is biased towards $x > 0$ , while class-1 is biased towards $x < 0$ . In total, our SS dataset consists of 10000 samples, of which $20\%$ are biased. + +We apply three data modifications: additional source (MS), gaussian data augmentation (DA) $\sim \mathcal{N}(0,0.1)$ , and data filtering (AFLite) which reduces the dataset size to $10\%$ . Note that we do not show model debiasing (DB) here, since it does not alter the data distribution. Figure 2 shows the effect on the data distribution. The most striking is the effect of DF which removes all samples previously in the biased clusters near $(0.4,0.0)$ and $(-1.0,0.0)$ . + +Equipped with these resulting datasets, we train a linear SGD classifier with log-loss and evaluate the robustness of each model in terms of in-domain and OOD accuracies. We also evaluate adversarial robustness by using standard PGD attacks. Results are shown in the textboxes in Figure 2. It can be seen that data filtering significantly hurts both OOD generalization and robustness. This finding motivates our experiments to understand the effect of each method for NLP and vision tasks. + +# 4 Experiments + +In this section, we present three tasks and their corresponding experimental setup, evaluation protocol and our findings. A summary of methods belong to + +each category is provided in Table 1 and the abbreviations SS, MS, DA, DB, DF are used henceforth. + +# 4.1 Natural Language Inference (NLI) + +NLI is the task of determining whether a hypothesis is true (entailment), false (contradiction), or undetermined (neutral) given a premise. + +Methods. We use RoBERTa as the backbone model for each method and SNLI (Bowman et al., 2015) as our source training corpus. A model trained with expected risk minimization (ERM) on SNLI alone, forms our single-source (SS) baseline. A model trained with a combination of SNLI and MNLI (Williams et al., 2018) forms our multisource (MS) baseline. We apply EDA (Wei and Zou, 2019) to augment our training dataset with $100\%$ of additional data to train a DA model. The LMH debiasing method from Clark et al. (2019) represents our DB model. For data filtering, we use AFlite (Bras et al., 2020) to filter out $90\%$ of the SNLI training data, and use the remaining $10\%$ data to train our DF model – this setting is based on the experiments from (Bras et al., 2020). + +Evaluation Protocol. We report accuracy on the SNLI test set (IID), and to evaluate generalization, we report accuracy on NLI diagnostics (Wang et al., 2018), Stress test evaluation (Naik et al., 2018a) and HANS (McCoy et al., 2019a). We use two metrics for evaluating robustness: + +- model-based robustness uses BAE adversarial attack (Garg and Ramakrishnan, 2020), implemented using TextAttack (Morris et al., 2020), and reports robustness as number of queries (sequential perturbations) needed to fool the model. +- model-free robustness uses six pre-defined operations to transform SNLI test inputs into adversarial examples. These six methods are: CLARE (Li et al., 2021a), character-swap (Pruthi et al., 2019), Checklist (Ribeiro et al., 2020), EDA (Wei and Zou, 2019), counter-fitted embeddings (Emb) (Alzantot et al., 2018a). + +Results. Table 2 shows the performance of each method in terms of in-domain and out-of-domain accuracy. We observe that four methods all improve the generalization performance on average but decrease the in-domain performance. Especially, DF method is the best in terms of OOD accuracy, but is the worst in terms of in-domain performance. We also see a trend that four methods improve the generalization in all sets of NLI + +![](images/611fff2fa5e17ed3c10946f25c7a3e74c2d592b4ec3c0053a3595cad33ea8147.jpg) +Figure 2: This figure illustrates the effect of data modification techniques on the training distribution. The leftmost figure shows the training distribution in the single-source setting. The introduction of a second dataset or Data augmentation (done using small perturbations of source samples with Gaussian noise) makes the distribution more diverse in the multi-source (MS) and data augmentation (DA) setting respectively. On the other hand, data filtering, in order to remove spurious correlations from the dataset, removes points from certain sectors of the distribution. The effect of each strategy on OOD generalization and robustness is shown below each plot. + +![](images/470fa466cbc8abd667cbc763220f1210075e1111b1cf9c84720b2c11313820c5.jpg) + +![](images/4c748b1ab7c7626fbb6d4a195e67d38291ea8a13916ae93df0b5ee4706c7d124.jpg) + +![](images/f233f80f59b08b89687946141d96698554b17e005279940d8bf05e5c16a32c0f.jpg) + +
Method CategoryTasks
Natural Language InferenceQuestion AnsweringImage Classification
SS (Single-Source ERM)SNLINQ (Kwiatkowski et al., 2019)MNIST
MS (Multi-Source ERM)SNLI + MNLINQ + SQuAD+NQA+HQA+SQA+TQAMNIST + USPS
DA (Data Augmentation)EDA (Wei and Zou, 2019)QG (Chan and Fan, 2019)M-ADA (Qiao et al., 2020)
DB (Model De-biasing)LMH (Clark et al., 2019)Mb-CR(Wu et al., 2020)RandConv (Xu et al., 2020)
DF (Data Filtering)AFLite (Bras et al., 2020)AFLite (adapted for QA)AFLite
+ +Table 1: List of method categories and specific methods that we use under each task setting in nour experiments. Details for each can be found in Section 4 for the corresponding task. + +Diagnostics and HANS, while all four methods do not show improvement on generalization on Distraction and Noise sets of Stress dataset. + +Table 3 shows the robustness evaluation. We see that except for DF, all methods improve the robustness under both model-based and model-free evaluation. MS improves the robustness in all transformations except for EDA. DA achieves the best robustness by model-based evaluation but is not consistent in terms of different transformations of model-free evaluation. DB improves the robustness in terms of every transformation and achieves the best robustness in terms of average of model-free evaluation. DF significantly hampers the model-free robustness with a drop in all transformations. + +# 4.2 Question Answering (QA) + +We focus on extractive QA. Given a passage (or "context") and a question, the task is to extract the answer span from the passage. + +Methods. We use BERT (Devlin et al., 2019) as the backbone model for each method. We use MRQA (Fisch et al., 2019) which is a collection of 12 publicly available multi-domain QA datasets - + +with Natural Questions (NQ) (Kwiatkowski et al., 2019) as the source dataset. SQuAD, NewsQA, HotpotQA, SearchQA, and TriviaQA are used as additional datasets for multi-source training. Similar to NLI, we use EDA for DA by applying EDA on the question. We apply the augmentation to all samples in the training set and combine them with the original set to train a DA model. For model debiasing (DB), we use Mb-CR approach (Wu et al., 2020), where a teacher and bias models are trained $a$ priori, and are used for debiasing. + +We modify AFLite for our QA task of span prediction, since AFLite was originally designed for classification tasks. To do so, we first randomly divide the training set into 10 subsets (or folds) $S_{1:10}$ . For $k \in \{1, \dots, 10\}$ , we pick $S_k$ as the held-out test set, and train models on the rest, and obtain 10 such models. At test time, models are used for predicting an answer by only looking at the context (without access to the question) – this allows us to identify strong spurious correlations in the dataset. Based on the predictions, samples are sorted on the basis of their F1 score. A higher F1 score implies that the model is more likely to answer the question + +
MethodIn-Domain Acc. (%)NLI-DiagnosticsOOD Acc. (%) Stress TestHANSAvg
Kno.Lex.Log.PASComp.Distr.NoiseLex.Subs.Consti.
SS89.651.865.757.872.677.973.579.888.428.221.761.74
MS87.852.166.857.872.879.672.479.292.033.626.763.30
DA87.252.166.058.172.679.671.879.292.832.826.463.14
DB81.852.466.058.472.879.371.879.592.233.827.563.37
DF62.653.966.558.768.979.172.079.594.146.338.565.75
+ +Table 2: NLI Result: In-domain (IID) accuracy and out-of-domain generalization (OOD) on the NLI benchmark using SNLI as source dataset. See Table 1 for method abbreviations. + +
MethodModel Based #Num QueriesModel Free Accuracy (%)
CharSwapEasyDataEmbeddingWordNetCheckListCLAREAvg
SS53.5681.372.081.977.089.476.379.65
MS54.4481.571.682.078.289.277.580.00
DA55.0677.774.180.780.286.680.579.97
DB54.8281.572.482.378.089.277.080.07
DF51.1365.256.866.262.572.362.564.25
+ +Table 3: NLI Result: Comparison of robustness in terms of model-based evaluation (number of queries needed to fool the model) and model-free (accuracy on adversarial transformations). ${}^{2}$ See Table 1 for method abbreviations. + +without even knowing the question. We retain $10\%$ samples with the lowest F1 scores – these represent the task since the model is not likely to predict the correct answer without knowing the question. + +Evaluation Protocol. We report exact-match (EM) accuracy for MRQA. To evaluate the generalization performance, we use six OOD development sets from MRQA: DROP, RACE, BioASQ, TextbookQA, RelationExtraction, and DuoRC. For robustness, we use the "Morphues" attack (Tan et al., 2020) on the question as the model-based evaluation, the attack method is similar to NLI. Model-free methods are the same as NLI. + +Results. Table 4 shows the performance of each method in terms of in-domain and out-of-domain accuracy. We observe that two methods, MS and DB, improve the generalization performance on each out-of-domain dataset and also improve the in-domain performance. The improvement of MS is larger than DB. DA improves on some out-of-domain datasets but not all, and it also improves the in-domain performance. DF dramatically reduces both out-of-domain and in-domain datasets. + +Table 5 shows that except for DF, all methods improve over SS for both model-based and model-free robustness evaluation. MS, DA, and DB improve the robustness in all transformations of model-free evaluation as well as the model-based evaluation, where MS achieves the best perfor + +mance in model-based and model-free evaluation. DF significantly hampers the model-free robustness with drop in all transformations, meanwhile, the model-based robustness also drops. + +# 4.3 Image Classification + +We conduct our experiments on the standard domain generalization benchmark "Digits", which is a collection of handwritten digit classification datasets belonging to 10 classes (digits 0-9). Following standard practice(Volpi et al., 2018), we train models on 10000 images from MNIST (LeCun et al., 1998) as the source, and use SVHN (Netzer et al., 2011), SYN and MNIST-M (Ganin and Lempitsky, 2015) as the OOD datasets. + +Methods. We use DigitNet (Volpi et al., 2018) as our backbone image classifier architecture. Our SS baseline uses MNIST for training; MS uses MNIST and USPS (Denker et al., 1988). For data augmentation we rely on M-ADA (Qiao et al., 2020) which is a perturbation-based min-max algorithm to create augmented data. Our debiasing method is RandConv (Xu et al., 2020) which utilizes a random convolutional layer to generate novel views of each input image, and a KL-divergence based loss function that encourages the classifier to predict consistent predictions for each version of the image. This leads to the model being debiased on spurious features like background, texture, or color of digits. We use AFLite as our DF method. + +
MethodIn-Domain EM. (%)OOD EM. (%)
DROPRACEBioASQTBQAR.E.DuoRCAvg
SS63.7620.0919.2933.9128.6162.8232.7132.91
MS65.0726.8827.4545.0140.5272.8643.4442.69
DA63.8419.2319.7332.3128.5461.9732.3132.35
DB64.5820.8319.7334.6431.2063.6435.9834.34
DF49.569.2511.7220.9419.6345.2821.4521.38
+ +Table 4: QA Result: Source (IID) accuracy and domain generalization (OOD) on the Question Answering benchmark with NaturalQuestions as source dataset. EM: Exact-Match. See Table 1 for method abbreviations. + +
MethodModel Based #QueriesModel Free EM. (%)
CharSwapEasyDataEmbeddingWordNetCheckListCLAREAvg
SS19.5560.2952.1761.2158.4163.2261.9259.54
MS21.9762.2252.6563.2259.8464.4263.5560.98
DA21.9160.8854.5262.0259.8263.4262.3660.5
DB20.4061.6253.1662.3559.3264.0363.0160.58
DF19.1947.9742.4848.5547.1949.3448.7247.38
+ +Table 5: QA Result: Comparison of robustness in terms of model-based evaluation (number of queries needed to fool the model) and model-free (accuracy on adversarial transformations). ${}^{2}$ See Table 1 for method abbreviations. + +
MethodIn-Domain Acc. (%)OOD Acc. (%)
MNIST-MSVHNSYNTHAvg
SS98.4058.0933.8545.9445.96
MS98.5459.7933.8748.4247.36
DA99.3067.9442.5548.9553.15
DB98.8687.6754.9563.3768.66
DF95.2751.0422.0727.8333.65
+ +Table 6: Source (in-domain) accuracy and domain generalization (OOD accuracy) on the Digits benchmark with MNIST-10k as source dataset.2 + +Evaluation Protocol. We report IID accuracy on the MNIST test set and generalization as the accuracy on our OOD datasets. For evaluating adversarial robustness we use Foolbox (Rauber et al., 2017) and use 10 attack methods (both $\ell_2$ and $\ell_{\infty}$ versions of FGSM, PGD, BIM, AUN, and DeepFool). Robustness is calculated as the accuracy for 20 values of $\epsilon$ between [0, 2], and is plotted as robustness curves for visualization, along with the average values for area under the curve (AUC). + +Results. Table 6 shows the performance of each method in terms of in-domain and OOD accuracy. MS, DA and DB, improve the generalization performance on each OOD dataset and also improve the in-domain performance, where DB displays best generalization capacity. DF dramatically reduces the OOD performance with significant reduction across all datasets; the in-domain accuracy also decreases. Figure 3 shows robustness (accuracy) + +and area under the curve (AUC) for each plot. It can be observed that DF is worse than SS for all 10 attack variants. We observe that DA and DB are better than SS, and the drop for DF is the largest. + +# 5 Analysis + +Based on the results of three tasks, we have the following observations about the performance of each method compared to the SS baseline: + +- MS increases OOD accuracy on all three tasks and robustness on two tasks (NLI and QA). +- DA increases OOD on two tasks (NLI and IC) and robustness on all three tasks. +- DB increases OOD on three tasks and robustness on two tasks (NLI and QA). +- DF decreases OOD on two tasks (QA and IC) and robustness on all three tasks. + +Decrease in NLI in-domain accuracy is seen for all methods, even though these lead to increase in OOD accuracy. This suggests that the training dataset (SNLI) has a large shift w.r.t. OOD datasets. + +More data implies more OOD generalization: While this trend is observed for both MS and DA, there is one anomaly - DA for the QA task leads to marginal decrease compared to SS (a difference of $0.56\%$ ). This finding is aligned with Longpre et al. (2019), who report no significant effect of data augmentation (back translation) on OOD performance for question answering. This points to the need for improving data augmentation techniques in QA. + +![](images/4e5c25a9ad9ce83da158655c785316171d93ea43223d117d38a89d9c138157c9.jpg) +Figure 3: Evaluation of adversarial robustness (using 10 attack methods) for MNIST10k. + +![](images/f12a3dc6e856b9c43594899205642bb543ba49d7dd372827997b67daad50c529.jpg) +Figure 4: Comparison between SS and DF models trained with different percentages of MNIST10k. + +![](images/216fb0e1537b12da6b5c25f144219d287a3298e7559dbff8175e14dd857761f2.jpg) +Figure 5: Pearson Correlation between OOD accuracy and robustness for SS and DF models on MNIST10k. + +On the other hand, the performance drop due to DF is significantly large for QA (11.53%). + +Decrease in MNIST robustness: For MNIST, the DA method (M-ADA (Qiao et al., 2020)) is the best in terms of robustness and also improves OOD accuracy. M-ADA is an "adversarial data augmentation" method, i.e., it uses a min-max objective to find loss-maximizing perturbations and uses these perturbations as augmented data. It is therefore intuitive that such a method would do well on the adversarial robustness metric (although robustness evaluation was not reported by Qiao et al. (2020)). + +Marginal Improvement on Robustness: From the results, it is easy to see that the improvement on OOD is more noticeable than robustness, for example, MS improves OOD performance by $\sim 10\%$ , but improves only by $\sim 1\%$ under model-free evaluation. While this observation is reasonable since each method is designed to improve the generalization, new methods that improve both generalization and robustness should be encouraged. + +# 5.1 Correlation between Adversarial Robustness and OOD Generalization + +Our experiments reveal the alarming finding that across the board, DF reduces adversarial robustness. To investigate further, we conduct an analysis on the Digits benchmark and compare SS and DF when trained with equal amounts of data ( $\{10\%, 20\%, \dots, 100\% \}$ ). Note that for SS the data are sampled randomly, while for DF the data are obtained via AFLite data filtering. Results are shown in Figure 4. It can be observed that the OOD accuracy increases as the size of the dataset increases, and is greater for SS than DF. To understand how an increase in OOD accuracy affects robustness, we also compute the robustness values at each size of training data, and compute the Pearson correlation coefficient for each attack method - positive correlation implies that as OOD accuracy increases, robustness also increases. Figure 5 shows clear evidence in favor of positive correlation; interestingly, SS has higher correlation for $\ell_2$ attacks, while DF is higher for $\ell_{\infty}$ attacks. The evidence is clear: OOD generalization increases with the size of the dataset and adversarial robustness is + +positively correlated with OOD generalization. + +Our experiments show that the size of the training set directly affects both robustness and generalization. While removing $90\%$ data increased OOD accuracy in NLI, the effect was the exact opposite for QA and MNIST. The key idea in domain generalization is that the test distributions are unknown and little information about them is available apart from the fact that there is no task shift. Without this prior knowledge, deciding whether (or how much) to filter a dataset is a challenging task. + +# 6 Related Work + +In Section 2 we have provided relevant work that falls into one of our five modeling categories. Here, we discuss additional literature on robustness and generalization and new efforts towards dataset creation, benchmarks, and evaluation. + +Generalization Benchmarks. Hendrycks et al. (2020b) have constructed a robustness benchmark for multiple language understanding tasks by splitting training sets from existing benchmarks according to topics, styles, and vocabulary; this has been subsequently used to study robustness of model rankings (Mishra and Arunkumar, 2021). Benchmarks have also been constructed to study dataset artifacts and generalization capabilities of models (Mishra et al., 2020a,b; Mishra and Sachdeva, 2020). MRQA (Fisch et al., 2019) is a benchmark for evaluating domain generalization of question answering (reading comprehensive) models. MRQA contains 6 datasets each for training, development, and evaluation. For image classification, many benchmarks have been proposed to evaluate domain generalization, such as PACS (Li et al., 2017), OfficeHome (Venkateswara et al., 2017), Digits (Volpi et al., 2018), and WILDS (Koh et al., 2021) which is a compendium of domain generalization benchmarks for tasks such as image classification, text sentiment and toxicity prediction. + +Corruption Robustness. Hendrycks and Dietterich (2019) introduced ImageNet-C and CIFAR-C to test robustness along corruptions such as weather, noise, blur, and digital artifacts, and ImageNet-P which tests robustness against small tilts and changes in brightness. MNIST-C was introduced by Mu and Gilmer (2019) for similar corruptions of handwritten digit images. + +Adversarial and Contrastive Sets. Generation of adversarial examples (Jia and Liang, 2017; + +Ribeiro et al., 2018; Iyyer et al., 2018; Alzantot et al., 2018b) and approaches to defend against word substitution (Jia et al., 2019) have been explored. Contrastive examples have been introduced as a means for evaluation, for example, manually crafted contrast sets for textual entailment (Gardner et al., 2020) or template-based (McCoy et al., 2019b; Glockner et al., 2018; Naik et al., 2018b). Model-in-the-loop dataset creation methods have also been proposed for various NLP tasks (Nie et al., 2020; Arunkumar et al., 2020; Kiela et al., 2021) and visual question answering (Sheng et al., 2021; Li et al., 2021b). + +# 7 Discussion + +Recently, Miller et al. (2021) have empirically shown linear trends between in-distribution and out-of-distribution performance on multiple image classification tasks, across various model architectures, hyper-parameters, training set size, and duration of training. They also show that there are certain settings of domain shift under which the linear trend does not hold. Our work empirically shows that while data filtering may benefit OOD generalization on the NLI benchmark, this does not hold for other tasks such as image classification and question answering. This suggests that data filtering may benefit generalization in certain types of domain shift, but not on others. Concurrently, Yi et al. (2021) have theoretically shown that models robust to input perturbations generalize well on OOD distribution within a Wasserstein radius around the training distribution. Our empirical observations in this paper in both vision and language domains, agree with the theory of Yi et al. (2021). + +In this work, we conduct a comprehensive study of methods which are designed for OOD generalization on three tasks: NLI, QA, and IC. We evaluate each method on in-domain, OOD, and adversarial robustness. Our findings suggest that more data typically benefits both OOD and robustness. Data filtering hurts OOD accuracy on two out of three tasks, and also hurts robustness on all three tasks. In context of our findings and work by Miller et al. (2021); Yi et al. (2021), we recommend that methods designed either for robustness or generalization should be evaluated on multiple aspects and not on the single metric that they are optimized for. + +# Acknowledgements + +This work was funded in part by DARPA SAIL-ON program (W911NF2020006) and DARPA CHESS program (FA875019C0003). The views and opinions of the authors expressed herein do not necessarily state or reflect those of the funding agencies and employers. + +# Broader Impact + +One underlying assumption behind using large datasets for training (or pre-training) vision and language models is that larger datasets increase the likelihood of obtaining a diverse set of samples to reduce overfitting. However, recent studies (Bender et al., 2021; Stanovsky et al., 2019) serve as cautionary tales when employing uncurated internet data to train large language models, and discuss how large data does not necessarily imply that models will learn the dievrse distribution. At the same time, the inverse (small data aids diversity) is also not true (as shown by this paper) and comes with its own problems – for instance, Figure 2 shows that dataset filtering can lead to much larger changes in the data distribution beyond notions of proportionality and fairness. As such, the decision on how many and what samples to remove can also introduce its own set of biases. Data curation is a challenging problem and needs further task-specific study since the concepts of bias and fairness often depend on the task definition and specifications of ideal outcomes. Insights from this paper could help researchers and practitioners in choosing appropriate approaches for improving generalization and robustness. + +# References + +Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. 2018a. Generating natural language adversarial examples. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2890–2896, Brussels, Belgium. Association for Computational Linguistics. +Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. 2018b. Generating natural language adversarial examples. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2890–2896, Brussels, Belgium. Association for Computational Linguistics. +Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and + +David Lopez-Paz. 2019. Invariant risk minimization. arXiv preprint arXiv:1907.02893. +Anjana Arunkumar, Swaroop Mishra, Bhavdeep Sachdeva, Chitta Baral, and Chris Bryan. 2020. Real-time visual feedback for educative benchmark creation: A human-and-metric-in-the-loop workflow. +Sara Beery, Grant Van Horn, and Pietro Perona. 2018. Recognition in terra incognita. In Proceedings of the European conference on computer vision (ECCV), pages 456-473. +Emily M Bender, Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. 2021. On the dangers of stochastic parrots: Can language models be too big? In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, pages 610-623. +Prajjwal Bhargava, Aleksandr Drozd, and Anna Rogers. 2021. Generalization in NLI: Ways (not) to go beyond simple heuristics. In Proceedings of the Second Workshop on Insights from Negative Results in NLP, pages 125-135, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +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. +Ronan Le Bras, Swabha Swayamdipta, Chandra Bhagavatula, Rowan Zellers, Matthew E. Peters, Ashish Sabharwal, and Yejin Choi. 2020. Adversarial filters of dataset biases. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 1078-1088. PMLR. +Lucy Chai, Jun-Yan Zhu, Eli Shechtman, Phillip Isola, and Richard Zhang. 2021. Ensembling with deep generative views. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 14997-15007. +Ying-Hong Chan and Yao-Chung Fan. 2019. A recurrent bert-based model for question generation. In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, pages 154-162. +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. + +JS Denker, WR Gardner, HP Graf, D Henderson, RE Howard, W Hubbard, LD Jackel, HS Baird, and I Guyon. 1988. Neural network recognizer for handwritten zip code digits. In Proceedings of the 1st International Conference on Neural Information Processing Systems, pages 323-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. +Adam Fisch, Alon Talmor, Robin Jia, Minjoon Seo, Eunsol Choi, and Danqi Chen. 2019. Mrqa 2019 shared task: Evaluating generalization in reading comprehension. In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, pages 1-13. +Yaroslav Ganin and Victor Lempitsky. 2015. Unsupervised domain adaptation by backpropagation. In International conference on machine learning, pages 1180-1189. PMLR. +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. +Matt Gardner, Yoav Artzi, Victoria Basmov, Jonathan Berant, Ben Bogin, Sihao Chen, Pradeep Dasigi, Dheeru Dua, Yanai Elazar, Ananth Gottumukkala, Nitish Gupta, Hannaneh Hajishirzi, Gabriel Ilharco, Daniel Khashabi, Kevin Lin, Jiangming Liu, Nelson F. Liu, Phoebe Mulcaire, Qiang Ning, Sameer Singh, Noah A. Smith, Sanjay Subramanian, Reut Tsarfaty, Eric Wallace, Ally Zhang, and Ben Zhou. 2020. Evaluating models' local decision boundaries via contrast sets. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1307-1323, Online. Association for Computational Linguistics. +Siddhant Garg and Goutham Ramakrishnan. 2020. Bae: Bert-based adversarial examples for text classification. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6174-6181. +Max Glockner, Vered Shwartz, and Yoav Goldberg. 2018. Breaking NLI systems with sentences that require simple lexical inferences. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 650-655, Melbourne, Australia. Association for Computational Linguistics. + +Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. 2015. Explaining and harnessing adversarial examples. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. +Ishaan Gulrajani and David Lopez-Paz. 2020. In search of lost domain generalization. In International Conference on Learning Representations. +Awni Hannun, Carl Case, Jared Casper, Bryan Catanzaro, Greg Diamos, Erich Elsen, Ryan Prenger, Sanjeev Satheesh, Shubho Sengupta, Adam Coates, et al. 2014. Deep speech: Scaling up end-to-end speech recognition. arXiv preprint arXiv:1412.5567. +Dan Hendrycks and Thomas G. Dietterich. 2019. Benchmarking neural network robustness to common corruptions and perturbations. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Dan Hendrycks, Xiaoyuan Liu, Eric Wallace, Adam Dziedzic, Rishabh Krishnan, and Dawn Song. 2020a. Pretrained transformers improve out-of-distribution robustness. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2744-2751. +Dan Hendrycks, Xiaoyuan Liu, Eric Wallace, Adam Dziedzic, Rishabh Krishnan, and Dawn Song. 2020b. 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. +Dan Hendrycks, Norman Mu, Ekin Dogus Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. 2020c. Augmix: A simple data processing method to improve robustness and uncertainty. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural computation, 9(8):1735-1780. +Mohit Iyyer, John Wieting, Kevin Gimpel, and Luke Zettlemoyer. 2018. Adversarial example generation with syntactically controlled paraphrase networks. 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 1875-1885, New Orleans, Louisiana. Association for Computational Linguistics. +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. +Robin Jia, Aditi Raghunathan, Kerem Goksel, and Percy Liang. 2019. Certified robustness to adversarial word substitutions. 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 4129-4142, Hong Kong, China. Association for Computational Linguistics. +Nora Kassner and Hinrich Schütze. 2020. Negated and misprimed probes for pretrained language models: Birds can talk, but cannot fly. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7811-7818, Online. Association for Computational Linguistics. +Douwe Kiela, Max Bartolo, Yixin Nie, Divyansh Kaushik, Atticus Geiger, Zhengxuan Wu, Bertie Vidgen, Grusha Prasad, Amanpreet Singh, Pratik Ringshia, Zhiyi Ma, Tristan Thrush, Sebastian Riedel, Zeerak Waseem, Pontus Stenetorp, Robin Jia, Mohit Bansal, Christopher Potts, and Adina Williams. 2021. Dynabench: Rethinking benchmarking in NLP. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4110-4124, Online. Association for Computational Linguistics. +Pang Wei Koh, Shiori Sagawa, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, Tony Lee, et al. 2021. Wilds: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning, pages 5637-5664. PMLR. +Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: A benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:452-466. +Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. 1998. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324. +Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. 2017. Deeper, broader and artier domain generalization. In Proceedings of the IEEE international conference on computer vision, pages 5542-5550. +Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. 2018a. Learning to generalize: Meta-learning for domain generalization. In Thirty-Second AAAI Conference on Artificial Intelligence. + +Dianqi Li, Yizhe Zhang, Hao Peng, Liquan Chen, Chris Brockett, Ming-Ting Sun, and William B Dolan. 2021a. Contextualized perturbation for textual adversarial attack. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5053-5069. +Linjie Li, Jie Lei, Zhe Gan, and Jingjing Liu. 2021b. Adversarial vqa: A new benchmark for evaluating the robustness of vqa models. In International Conference on Computer Vision (ICCV). +Yi Li and Nuno Vasconcelos. 2019. Repair: Removing representation bias by dataset resampling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9572-9581. +Yingwei Li, Yi Li, and Nuno Vasconcelos. 2018b. Resound: Towards action recognition without representation bias. In Proceedings of the European Conference on Computer Vision (ECCV), pages 513-528. +Evan Z Liu, Behzad Haghgoo, Annie S Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang, and Chelsea Finn. 2021. Just train twice: Improving group robustness without training group information. In International Conference on Machine Learning, pages 6781-6792. PMLR. +Shayne Longpre, Yi Lu, Zhucheng Tu, and Chris DuBois. 2019. An exploration of data augmentation and sampling techniques for domain-agnostic question answering. In Proceedings of the 2nd Workshop on Machine Reading for Question Answering, pages 220–227, Hong Kong, China. Association for Computational Linguistics. +Tom McCoy, Ellie Pavlick, and Tal Linzen. 2019a. 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. +Tom McCoy, Ellie Pavlick, and Tal Linzen. 2019b. 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. +John P Miller, Rohan Taori, Aditi Raghunathan, Shiori Sagawa, Pang Wei Koh, Vaishaal Shankar, Percy Liang, Yair Carmon, and Ludwig Schmidt. 2021. Accuracy on the line: On the strong correlation between out-of-distribution and in-distribution generalization. In International Conference on Machine Learning, pages 7721-7735. PMLR. +Swaroop Mishra and Anjana Arunkumar. 2021. How robust are model rankings: A leaderboard customization approach for equitable evaluation. In + +Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 13561-13569. +Swaroop Mishra, Anjana Arunkumar, Chris Bryan, and Chitta Baral. 2020a. Our evaluation metric needs an update to encourage generalization. arXiv preprint arXiv:2007.06898. +Swaroop Mishra, Anjana Arunkumar, Bhavdeep Sachdeva, Chris Bryan, and Chitta Baral. 2020b. Dqi: A guide to benchmark evaluation. arXiv preprint arXiv:2008.03964. +Swaroop Mishra and Bhavdeep Singh Sachdeva. 2020. Do we need to create big datasets to learn a task? In Proceedings of SustainNLP: Workshop on Simple and Efficient Natural Language Processing, pages 169-173. +John Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. 2020. TextAttack: A framework for adversarial attacks, data augmentation, and adversarial training in NLP. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 119-126, Online. Association for Computational Linguistics. +Norman Mu and Justin Gilmer. 2019. Mnist-c: A robustness benchmark for computer vision. arXiv preprint arXiv:1906.02337. +Aakanksha Naik, Abhilasha Ravichander, Norman Sadeh, Carolyn Rose, and Graham Neubig. 2018a. Stress test evaluation for natural language inference. In Proceedings of the 27th International Conference on Computational Linguistics, pages 2340-2353, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Aakanksha Naik, Abhilasha Ravichander, Norman Sadeh, Carolyn Rose, and Graham Neubig. 2018b. Stress test evaluation for natural language inference. In Proceedings of the 27th International Conference on Computational Linguistics, pages 2340-2353, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Hyeonseob Nam, HyunJae Lee, Jongchan Park, Wonjun Yoon, and Donggeun Yoo. 2021. Reducing domain gap by reducing style bias. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8690-8699. +Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. 2011. Reading digits in natural images with unsupervised feature learning. +Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. 2020. Adversarial NLI: A new benchmark for natural language understanding. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4885-4901, Online. Association for Computational Linguistics. + +Danish Pruthi, Bhuwan Dhingra, and Zachary C Lipton. 2019. Combating adversarial misspellings with robust word recognition. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5582-5591. +Fengchun Qiao, Long Zhao, and Xi Peng. 2020. Learning to learn single domain generalization. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2020, Seattle, WA, USA, June 13-19, 2020, pages 12553-12562. IEEE. +Aditi Raghunathan, Sang Michael Xie, Fanny Yang, John Duchi, and Percy Liang. 2020. Understanding and mitigating the tradeoff between robustness and accuracy. Proceedings of Machine Learning Research. +Jonas Rauber, Wieland Brendel, and Matthias Bethge. 2017. Foolbox: A python toolbox to benchmark the robustness of machine learning models. In *Reliable Machine Learning in the Wild Workshop*, 34th International Conference on Machine Learning. +Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2018. Semantically equivalent adversarial rules for debugging NLP models. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 856-865, Melbourne, Australia. Association for Computational Linguistics. +Marco Tulio Ribeiro, Tongshuang Wu, Carlos Guestrin, and Sameer Singh. 2020. Beyond accuracy: Behavioral testing of NLP models with CheckList. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4902-4912, Online. Association for Computational Linguistics. +Sasha Sheng, Amanpreet Singh, Vedanuj Goswami, Jose Alberto Lopez Magana, Wojciech Galuba, Devi Parikh, and Douwe Kiela. 2021. Human-adversarial visual question answering. arXiv preprint arXiv:2106.02280. +Gabriel Stanovsky, Noah A. Smith, and Luke Zettlemoyer. 2019. Evaluating gender bias in machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1679-1684, Florence, Italy. Association for Computational Linguistics. +Samson Tan, Shafiq Joty, Min-Yen Kan, and Richard Socher. 2020. It's morphin'time! combating linguistic discrimination with inflectional perturbations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2920-2935. +Rohan Taori, Achal Dave, Vaishaal Shankar, Nicholas Carlini, Benjamin Recht, and Ludwig Schmidt. 2020. Measuring robustness to natural distribution shifts in image classification. In Advances in Neural Information Processing Systems, volume 33, pages 18583-18599. + +Vladimir N Vapnik and A Chervonenkis. 1991. The necessary and sufficient conditions for consistency of the method of empirical risk minimization. Pattern Recognition and Image Analysis, 1(3):284-305. +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 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998-6008. +Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. 2017. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5018-5027. +Riccardo Volpi, Hongseok Namkoong, Ozan Sener, John C. Duchi, Vittorio Murino, and Silvio Savarese. 2018. Generalizing to unseen domains via adversarial data augmentation. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montreal, Canada, pages 5339-5349. +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. +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. +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence 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. +Mingzhu Wu, Nafise Sadat Moosavi, Andreas Rücklé, and Iryna Gurevych. 2020. Improving qa generalization by concurrent modeling of multiple biases. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 839-853. +Qizhe Xie, Zihang Dai, Eduard Hovy, Thang Luong, and Quoc Le. 2020. Unsupervised data augmenta + +tion for consistency training. Advances in Neural Information Processing Systems, 33. +Zhenlin Xu, Deyi Liu, Junlin Yang, Colin Raffel, and Marc Niethammer. 2020. Robust and generalizable visual representation learning via random convolutions. In International Conference on Learning Representations. +Yao-Yuan Yang, Cyrus Rashtchian, Hongyang Zhang, Russ R Salakhutdinov, and Kamalika Chaudhuri. 2020. A closer look at accuracy vs. robustness. In NeurIPS. +Mingyang Yi, Lu Hou, Jiacheng Sun, Lifeng Shang, Xin Jiang, Qun Liu, and Zhiming Ma. 2021. Improved ood generalization via adversarial training and pretraining. In International Conference on Machine Learning, pages 11987-11997. PMLR. +Alan L Yuille and Chenxi Liu. 2021. Deep nets: What have they ever done for vision? International Journal of Computer Vision, 129(3):781-802. +Rowan Zellers, Yonatan Bisk, Ali Farhadi, and Yejin Choi. 2019. From recognition to cognition: Visual commonsense reasoning. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pages 6720-6731. Computer Vision Foundation / IEEE. +Rowan Zellers, Yonatan Bisk, Roy Schwartz, and Yejin Choi. 2018. SWAG: A large-scale adversarial dataset for grounded commonsense inference. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 93-104, Brussels, Belgium. Association for Computational Linguistics. \ No newline at end of file diff --git a/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/images.zip b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bfa759bff00520a7d0586b42530e3e2ff0db7fcc --- /dev/null +++ b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f82c7f4a55bae97c7ca995aefb2bcc6e75db9b1ff51c324607c827f53af488d +size 510075 diff --git a/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/layout.json b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c2ceb71888995349f16c290d389a4636119988d2 --- /dev/null +++ b/generalizedbutnotrobustcomparingtheeffectsofdatamodificationmethodsonoutofdomaingeneralizationandadversarialrobustness/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58f04647db73b01e87864c4b2b65143bf9ab3aa8cda34aa110c42df422d610e6 +size 424840 diff --git a/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_content_list.json b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2d6d6e2e3ab540831d1ff077dbcf249ea74c6325 --- /dev/null +++ b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25a5f0e0d7dbbbdb29cf9874db45e751313b470b8c08ceb18b9e717458dede6a +size 73274 diff --git a/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_model.json b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fe604c2ce875ba91a400a71391623538775c96e5 --- /dev/null +++ b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40db5321ae6465c2a3e39df4f0eebfd12b16d2a47d5fa09fb926d7af5d9cd137 +size 94122 diff --git a/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_origin.pdf b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e345e9256c14761eeb239231c080cf9016879be0 --- /dev/null +++ b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/1568fa84-3c12-4f36-bb6a-ff67d9aee249_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78fc8c71f33ee79e94fdf4118e91a6fb9d72fb1c5e22bbf20be859c6cdfeea2e +size 617640 diff --git a/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/full.md b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a72d44d357c9c45204ff65b1a77f59f28ecd2cfd --- /dev/null +++ b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/full.md @@ -0,0 +1,364 @@ +# Going “Deeper”: Structured Sememe Prediction via Transformer with Tree Attention + +Yining Ye $^{1}$ , Fanchao Qi $^{1}$ , Zhiyuan Liu $^{1,2,3,4*}$ , Maosong Sun $^{1,2,3*}$ + +$^{1}$ Dept. of Comp. Sci. & Tech., Institute for AI, Tsinghua University, Beijing, China +Beijing National Research Center for Information Science and Technology + +$^{2}$ Institute Guo Qiang, Tsinghua University, Beijing, China + +$^{3}$ International Innovation Center of Tsinghua University, Shanghai, China $^{4}$ Beijing Academy of Artificial Intelligence + +{yeyn19,qfc17}@mails.tsinghua.edu.cn, + +{liuzy,sms}@tsinghua.edu.cn + +# Abstract + +Sememe knowledge bases (SKBs), which annotate words with the smallest semantic units (i.e., sememes), have proven beneficial to many NLP tasks. Building an SKB is very time-consuming and labor-intensive. Therefore, some studies have tried to automate the building process by predicting sememes for the unannotated words. However, all existing sememe prediction studies ignore the hierarchical structures of sememes, which are important in the sememe-based semantic description system. In this work, we tackle the structured sememe prediction problem for the first time, which is aimed at predicting a sememe tree with hierarchical structures rather than a set of sememes. We design a sememe tree generation model based on Transformer with an adjusted attention mechanism, which shows its superiority over the baseline methods in experiments. We also conduct a series of quantitative and qualitative analyses of the effectiveness of our model. All the code and data of this paper are available at https://github.com/thunlp/STG. + +# 1 Introduction + +A word is the fundamental element of natural languages, but its meaning can be further divided. To explore semantics atomically, linguists define a se-meme as the minimum semantic unit (Bloomfield, 1926). It is even believed that the meanings of all words in any language can be represented by a limited set of sememes, which is closely related to the idea of semantic primitives (Wierzbicka, 1996). + +HowNet (Dong and Dong, 2006) is the most well-known sememe knowledge base (SKB). It comprises more than 100,000 English and Chinese words and phrases manually annotated by about 2,000 sememes that are defined by linguistic experts. Multiple senses of a polysemous word are + +![](images/ddd9435aead4284691f100aa06f31a652ae39e9d026543998082ae4751e9cd77.jpg) +Figure 1: Sememe annotations of the words "throne" and "emperor" in HowNet. + +independently annotated, and the sememes annotated to a sense are hierarchically organized as a sememe tree. Figure 1 illustrates the sememe annotations of two English words in HowNet. + +Different from other lexical knowledge bases, SKBs like HowNet define words intensionally with a limited set of semantic units (sememes), thus have some unique strengths. For example, SKBs can be combined with neural network models smoothly by regarding sememes as the external semantic labels of words (Qi et al., 2019; Qin et al., 2020). Moreover, thanks to the limitedness of sememes, SKBs have been proven very useful in the low-data regimes, e.g., improving the representation learning of rare words by transferring knowledge from frequent words via sememes (Niu et al., 2017). As a result, SKBs have been widely utilized in many NLP tasks (Qi et al., 2021b). + +However, most languages have no SKBs like HowNet, and it is too expensive to manually build an SKB for a new language from scratch. In addition, even for the languages covered in HowNet (English and Chinese), new words are emerging every day and the meanings of existing words keep changing. It is also costly to expand and update + +HowNet. To solve these issues, a series of studies have been conducted, trying to automatically predict sememes for monolingual or cross-lingual words (Xie et al., 2017; Jin et al., 2018; Qi et al., 2018; Du et al., 2020; Lyu et al., 2021). For simplicity, all previous sememe prediction studies ignore the hierarchical structures of sememes. They simplify sememe prediction as a multi-label classification task, and their models output a structureless set of sememes. + +However, the structures of sememes are very important. For one thing, the structural information is indispensable in the sememe-based semantic description system, as it carries semantics, and branches of sememe trees stand for the relations of sememes. As shown in Figure 1, the difference in sememe structure results in the different meanings of the second sense of "throne" and "emperor", although they have four identical sememes. For another, the structures of sememes are necessary for many sememe-based applications (Liu and Li, 2002; Zhu et al., 2019; Liu et al., 2020). + +In this paper, we try to tackle structured sememe prediction, which is aimed at predicting sememes together with their hierarchical structures rather than the structureless sememes only. This task is essentially a kind of tree generation task but is more challenging than other tree generation tasks. First, the size of its node type is more than 2,000 (i.e., over 2,000 sememes), which is much larger than that of most tree generation tasks, e.g., less than 100 for code generation and semantic parsing (rab). Second, the structures of sememe trees are extremely diverse — almost any sememe can be the child node of another sememe, and one sememe node can have an arbitrary number of children. Many of the existing tree prediction methods depend on the certain number of children of a node and perform strongly correlated with the number of candidates (Yin and Neubig, 2017), thus are not applicable. + +To handle this difficult task, we conduct further formalization. Different from most structureless sememe prediction studies whose input is merely a word, inspired by Du et al. (2020), we regard a sentence of definition as the input, and the task is formalized as a sequence-to-tree task. We do this for two reasons. First, sememe prediction can be conducted at the sense level (one definition corresponds to one sense of a word). Second, definitions can provide more useful information than single + +words for structured sememe prediction. + +Further, we propose a model based on Transformer (Vaswani et al., 2017) especially designed for the task of sememe tree generation (STG). We decompose the attention in Transformer into two parts that capture the semantic similarity and topological relations between sememes, respectively, in order to better represent the characteristics of sememe trees. Experimental results show that our method outperforms baseline methods including the vanilla tree Transformer model. We also conduct quantitative and qualitative analyses of the results of our method. + +# 2 Related Work + +# 2.1 Sememe Knowledge Base + +As a kind of special lexical knowledge base, SKBs represented by HowNet have been widely explored in various NLP applications, including word representation learning (Niu et al., 2017), word sense disambiguation (Hou et al., 2020), language modeling (Gu et al., 2018), reverse dictionary (Zhang et al., 2020b), textual adversarial and backdoor attacks (Zang et al., 2020; Qi et al., 2021c), etc. + +Meanwhile, some studies focus on automating the process of expanding and constructing SKBs. They propose different methods to automatically predict sememes for words. Xie et al. (2017) present the task of lexical sememe prediction and propose two simple but effective methods that are based on collaborative filtering and matrix factorization, respectively. Jin et al. (2018) and Lyu et al. (2021) utilize the Chinese character and glyph information in lexical sememe prediction and achieve higher performance. Du et al. (2020) introduce dictionary definitions into sememe prediction and find that the abundant semantic information in definitions is very beneficial to sememe prediction. But they do not conduct sense-level sememe prediction. They simply concatenate the definitions of multiple senses of a word and predict the combined sememe set for the word. + +The above studies use the sememe annotations of existing words in HowNet to predict sememes for new words, aiming to expand HowNet. Some studies try to construct SKBs for new languages automatically. Qi et al. (2018) present the task of cross-lingual lexical sememe prediction, which predicts sememes for words in a new language by bilingual word embedding alignment of a HowNet-covered language and a new language. Qi et al. (2020) pro + +pose to build a multilingual SKB based on BabelNet, a multilingual encyclopedia dictionary (Navigli and Ponzetto, 2012). BabelNet is composed of BabelNet synsets, each of which contains multilingual synonyms, e.g., hello (English),你好 (Chinese) and bonjour (French) are included in one BabelNet synset. The multilingual synonyms in a synset convey the same meaning and should have the same sememe annotations. Therefore, they propose the task of sememe prediction for BabelNet synsets, hoping that if all synsets are annotated with sememes, all words in over 200 languages in BabelNet would obtain sememe annotations. Moreover, the sememe annotations are independently annotated to senses, because a synset corresponds to a sense. Following Qi et al. (2020), Qi et al. (2022) further utilize multilingual and multimodal information in BabelNet to improve the performance of sememe prediction for BabelNet synsets. + +In addition, Qi et al. (2021a) make an attempt to construct an SKB based on a dictionary fully automatically. They regard the words in the controlled defining vocabulary of a dictionary as sememes rather than use the existing sememe set of HowNet. + +Although achieving satisfactory sememe prediction results, all these studies ignore the hierarchical structures of sememes. This work is the first attempt to conduct structured sememe prediction. + +# 2.2 Tree Generation + +Structured sememe prediction is a kind of tree generation task. Some tree generation tasks have been widely explored, such as code generation (rab; Yin and Neubig, 2017; Sun et al., 2020; Nguyen et al., 2019), semantic parsing (Shiv and Quirk, 2019; Li et al., 2020) and math word problem solving (Liu et al., 2019; Zhang et al., 2020a; Wu et al., 2021). However, as explained in §1, sememe tree generation is more challenging than these tasks because of its large size of node types and a vast variety of structures. + +Quite a few tree generation studies use the sequence modeling models represented by recurrent neural networks, especially LSTM (Hochreiter and Schmidhuber, 1997), and achieve great performance (Zaremba and Sutskever, 2014; Allamanis et al., 2016). Recently, with the widespread use of Transformer in sequence modeling, some studies have shown that Transformer-based models also perform well on tree generation and are more parallelizable to deal a large amount of data (Shiv and + +Quirk, 2019; Nguyen et al., 2019; Zugner et al., 2021). Therefore, we also design our sememe tree generation model based on Transformer. + +# 3 Methodology + +In this section, we first detail two straightforward sememe tree generation (STG) models, which will serve as the baselines. Then, we describe the modification of tree attention and introduce a novel STG model. + +# 3.1 Neighbor-based STG (NSTG) + +A sememe tree can be divided into multiple sememe paths from the root node to leaf nodes. Assuming different sememe paths are independent, the probability of generating a sememe tree can be formalized as: + +$$ +P (T | w) = \prod_ {S \in T} P (S | w), \tag {1} +$$ + +where $T$ refers to the sememe tree of the synset $w$ , and $S$ denotes a sememe path in $T$ . + +Using the multiplicative theorem of probability, the probability of each sememe path is formalized as: + +$$ +P (S | w) = \prod_ {i = 1} ^ {N _ {S}} P \left(s _ {i} | w, S _ {0: i - 1}\right), \tag {2} +$$ + +where $N_{s}$ is the length of $S$ , $s_i$ is the $i-th$ sememe of $S$ , and $S_{0:i-1}$ refers to the previous path from the beginning token START to the $(i-1)$ -th sememe of $S$ , where START is added as the root node of a sememe tree. + +With the Markov assumption, we further decompose a sememe path into parent-child sememe pairs. Generating a child sememe based on a father sememe is the atomic step of generating a sememe path: + +$$ +P (S) = \prod_ {i = 1} ^ {N _ {S}} P \left(s _ {i} \mid w, s _ {i - 1}\right), \tag {3} +$$ + +Inspired by Xie et al. (2017), we assume that similar words should share similar sememe tree structures and we can apply collaborative filtering (Xie et al., 2017) to the STG task and propose the Neighbor-based STG (NSTG) model. + +Specifically, for each sememe pair $e_i = (s_{i-1}, s_i)$ , the non-normalized generation proba + +![](images/289f6fbad20fc22afa24d47d81451cd1914164130053f3ce7dbc8f49e55e234d.jpg) +Figure 2: Definition and sememe tree sequence of "bn:00077087n" in BabalNet + +bility can be approximated as: + +$$ +\hat {P} \left(s _ {i} \mid w, s _ {i - 1}\right) = \sum_ {w _ {j}} \operatorname {s i m} \left(w _ {j}, w\right) \times M _ {j, e _ {i}} \times d ^ {r _ {i}}, \tag {4} +$$ + +where $\text{sim}(w_j, w)$ measures the similarity between two words (senses), based on the embeddings of the two words' definitions from BERT (Devlin et al., 2019). $M_{j,e_i}$ indicates whether the synset $w_j$ possesses the sememe pair $e_i$ . $r_j$ is the descending rank of the similarity. $d \in (0,1)$ is a hyper-parameter, which can be viewed as the declined confidence factor that helps the model concentrate on the most similar words. We use sigmoid as the normalization strategy. + +We also adopt the beam search algorithm to generate sememe paths. The key point in beam search is to design a well-performed generation function at each search step. + +# 3.2 Transformer-based STG (TSTG) + +NSTG model is simple and efficient because it does not require extra training. Nevertheless, the generalization ability of NSTG is limited to the representative ability of sentence encoding. And it fails to utilize the sequential information in the generated sememe paths, which are of critical importance in the STG task. To address this issue, we can follow previous tree generation studies and use a Transformer model to learn and decode hierarchical sememe structures. This method is named Transformer-based STG (TSTG). + +The normal Transformer architecture accepts sequential inputs. Therefore, we need to convert trees into sequences. We linearize sememe trees by the pre-order depth-first traversal. However, the count of branches of a node is not certain in STG, so we use a special BACK token to represent the back and eventually get a one-to-one mapping from sememe tree to sememe tree sequence. An example of the sememe tree sequence is shown in Figure 2. + +We decompose the step of STG into repeatedly + +sememe generation and BACK token generation, ending with the depth going back to 0. + +# 3.3 Tree-attention Transformer Model (TaSTG) + +The above method enables transformer architecture to generate trees. However, it suffers some problems. + +# Problems of Attention Computation + +Normal attention in Transformer is formalized as: + +$$ +\alpha_ {i j} = \frac {\left(\left(\boldsymbol {w} _ {i} + \boldsymbol {p} _ {i}\right) W ^ {Q}\right) \left(\left(\boldsymbol {w} _ {j} + \boldsymbol {p} _ {j}\right) W ^ {K}\right) ^ {T}}{\sqrt {d}}, \tag {5} +$$ + +where $\pmb{w}_i, \pmb{w}_j$ refer to node embeddings, and $bmp_i, bmp_j$ refer to positional embeddings. $\alpha_{ij}$ is the attention score of the $i$ -th and $j$ -th nodes. + +Absolute positional embedding is tied with node embedding in the normal transformer. However, for the exact position $i$ and $j$ , there is little evidence that the node and where it appears in a sequence has a strong correlation. This randomness may cause noise in attention computation, especially for tree-structured data. One position has two neighbors in a sequence, but it is not true in a tree. As in the example in Figure 2, the topological relations of nodes (Human, Royal) and nodes (Human, Head-Of-State) are considered to be the same. However, the distance in the sequence representation of them is 3 and 1, which differs a lot. + +To better capture the structure of tree data, we think attention should satisfy the following three requirements: (1) topologically neighbored nodes' attention should be high; (2) semantically similar nodes' attention should be high; (3) some sub-trees of brother nodes can convert symmetrically in STG tasks. + +# Our Modification + +Inspired by Ke et al. (2020), we untie the correlations between positions and words. We divide the computation of attention into two parts: semantic attention and positional attention. (1) Semantic attention captures the semantic similarity of twos nodes in the tree, and the computation is the same as normal attention. (2) Positional attention is specially designed to capture the topological relations of nodes in the tree. + +Correspondingly, we design a new self attention computation method for tree structure as follows: + +$$ +\alpha_ {i j} = \frac {\boldsymbol {s} _ {i} \cdot \boldsymbol {s} _ {j} + \boldsymbol {p} _ {i} \cdot \boldsymbol {p} _ {j}}{\sqrt {2 d}} + \boldsymbol {b} _ {i, j}, \tag {6} +$$ + +where $s_i, s_j$ refers to the node encoding, $p_i, p_j$ refers to the positional encoding of $i$ and $j$ , and $b_{i,j}$ refers to the distance encoding of $i$ and $j$ . $\frac{1}{\sqrt{2d}}$ is used to retain the scale of attention score. + +For tree position, we define Depth embedding as learnable parameters to capture features of tree input. Simultaneously, we define Distance embedding as learnable parameters as the bias in position attention. Attention is considered to be higher when depths are closer and distance is smaller. + +For the multi-head version, Depth embedding and Distance embedding are different in all the heads. And for efficiency, we share the Depth embedding and Distance embedding in all the layers, so we only need to compute position attention in the first layer and reuse it in other layers. The function can be quickly computed by: + +$$ +a t t n = \left(\frac {A _ {Q} * A _ {K} ^ {T}}{\sqrt {2 d}} + \frac {P _ {Q} * P _ {K} ^ {T}}{\sqrt {2 d}} + B\right) A _ {V}, \tag {7} +$$ + +where $B$ is formalized as the distance metric of all the nodes in the tree. With the help of BACK, we can compute the $B$ in $O(n^{2})$ times with a stack-based algorithm. + +BACK token is special in tree sequence because it has the same number as other nodes and distributes randomly in all the depths. To overcome the imbalance of nodes, we specially add the BACK token in odd depth between two sememe nodes, while sememe nodes are in even depth. We will further discuss the efficiency of Tree-attention in §5.1. + +The transformer decoder layer is composed of three sub-layers. We adopt Tree-attention in the self-attention sub-layer. For the sub-layer to perform multi-head attention over the output of the encoder stack, we use normal attention because it is hard to capture the attention between tree nodes and sequence reasonably, we leave it for future work. + +# 4 Experiments + +# 4.1 Dataset + +HowNet provides no definitions for words, and using an external dictionary requires special efforts to conduct a sense-level alignment with HowNet. In this paper, we resort to the BabelSememe dataset, which is built by Qi et al. (2020). A BabelNet + +synset corresponds to a sense of a word and includes definitions from other sources like WordNet (Miller, 1998), and some BabelNet synsets are manually aligned with senses of words in HowNet. One example is Figure 2. + +Since there is no other attempt aligned with sense-level definitions and sememe trees, we finally use BabelNet as the only dataset. In other words, we try to predict sememes for BabelNet synsets given their definitions. There are 34,964/3,228/3,228 synsets with definitions in the training/validation/test sets. + +# 4.2 Experimental and Parameter Settings + +For NSTG, we use sentence-BERT (Reimers et al., 2019) to encode definitions and compute similarity. The embedding dimension is 768. For hyperparameters, we set the beam size in beam search to 50 and select the top 10 candidates for merging. We set the declined confidence factor base $d$ to 0.9 empirically. + +For TSTG and TaSTG, we use the base version of BERT as the encoder, and the dimension of word embeddings is 768. We use sememe embedding pre-trained by SPSE (Xie et al., 2017), and the dimension is 200. We train an 8-layer, 8-head transformer decoder, and the learning rate is set to $10^{-5}$ . To avoid duplicate prediction, we only choose the valid sememes that have not been predicted. We also use beam search during the prediction. + +# 4.3 Baselines + +We use NSTG and TSTG as the baseline. We ablate our TsSTG to understand the efficiency of the modification of the decoder. First, we remove bias and build up the TaSTB-B model, which has almost the same parameters as TaSTG. To understand the compute of depth encoding, we also convert the relative position of tree node $i$ from the depth of $i$ to the traversal order of $i$ , and build up the TaSTB-D model. + +# 4.4 Evaluation Protocol + +We use the following metrics for STG: + +BLEU Since the generated tree sequence is short, and higher order n-grams may not overlap, we use smoothed BLEU-4 score (Lin and Och, 2004), following Feng et al. (2020). + +Strict-F1 To measure the structural similarity of the sememe tree $T$ and predicted tree $T'$ , we define the Strict-F1 metric as follows: + +
MethodBLEUStrictEdgeVertex
NSTG10.725.627.533.9
TSTG15.535.637.245.0
TaSTG17.039.741.248.2
TaSTG-D14.937.539.045.9
TaSTG-B15.139.140.547.4
+ +Table 1: Result of different models. + +1. Start from the roots of $T$ and $T'$ and put them into the current node sets $O$ and $O'$ . The intersection list $U$ is empty. +2. Get the intersections $U_{i}$ for the children of both $O$ and $O^{\prime}$ in layer $i$ . Add $U_{i}$ to $U$ , and then update both $O$ and $O^{\prime}$ with their children until reaching the deepest leaves. +3. For precision $(P)$ , recall $(R)$ and F1 score $F1$ , we define $P = \frac{\text{Size}(U)}{\text{Size}(T')}, R = \frac{\text{Size}(U)}{\text{Size}(T)}, F1 = \frac{2 \times P \times R}{P + R}$ . + +The Strict-F1 metric is challenging because it supposes that if the predicted parent sememe node is incorrect, all its corresponding children sememes are not considered. + +Edge, Vertex Inspired by the classical evaluation metrics in structure learning tasks such as taxonomy induction (Bordea et al., 2016), we also use the Edge and Vertex metrics. The former evaluates the precision, recall, and F1-score after breaking down trees into edges, while the latter computes the non-hierarchical prediction result after breaking down trees into nodes. + +# 4.5 Main Results + +The experimental results for all the models are shown in Table 1, from which we observe that: + +(1) TaSTG model reaches the highest F1 score, which indicates that Tree-attention works more conservatively than the other models. All transformer-based models significantly outperform the NSTG model, which is mainly because NSTG merely makes predictions based on similar synsets and existing sememe pairs, while $11.5\%$ synsets in the test set have unseen sememe pairs, which are hard for NSTG to predict. +(2) Removing the Distance embedding and converting the Depth embedding to Forward embedding both result in a negative impact on the model's performance. This suggests that in tree-structured + +![](images/e9aad72b3a087236dc72cd6d68fb2a1c023d070568f55319af18280a792dfb74.jpg) +Figure 3: The average score of Distance Embedding of different heads. + +![](images/8e9584e33228e1c5240bef0751a84c379e5431d5b22e7295ef4d4f77f006a2d7.jpg) +(a) heat with BACK token +Figure 4: Visualization of computation results of different Depth embedding. + +![](images/3bc803047934b75426b1e785f84ae1f71d42ed3e6a55369edf99702b3f95e355.jpg) +(b) heat without BACK token + +input, it's more important to focus on topologically similar nodes. And the gain of Depth embedding is much more than that of Distance embedding, which might be because the number of learnable parameters for tree structure in Depth embedding is much more. +(3) Differences between the BLEU are smaller than those of F1, which indicates that the BLEU score may not capture the hierarchical similarity between the output tree and the answer. + +# 5 Analysis + +In this part, we further discussed the efficiency of positional attention and analyzed the performance of our model in different tree complexity, and make a case analysis of our models. + +# 5.1 Hierarchical Feature Capture + +In this section, we study whether Tree-attention learns hierarchical structures. And we analyze the performance of Positional attention in structure reconstructing. + +![](images/18d89a067ae1697a3fd7c851b4d3d457f2b29b2a081a47d3a73ac7ac0f8a1ed2.jpg) +(a) change over depth + +![](images/f58d662f0613ff199f598a5517dd213be0ece6a7e6c326b9a87cbd3d0df9f0bd.jpg) +(b) change over size +Figure 5: Test results over the complexity of trees. Confidence intervals shown in the figures are estimated with a confidence level of $95\%$ . + +![](images/01fb5cc0665322ce95f6bbdeb08e88a35e4d8548d7eeeb1ac247af8cfc407828.jpg) +(c) change over the number of terminal nodes + +# Visualization of Positional Attention + +Considering that the most straightforward way of interpreting the hierarchical features is to visualize the attention scores, we plot the heat-map of our Positional attention result. + +The average scores of Distance embedding of different heads are shown in Figure 3. We can explicitly see that when the distance is small, the Positional attention bias is high, which indicates that our Distance embedding mainly focuses on topologically similar nodes. The bias is lower when distance is 2, we guess this is used to eliminate the influence of brother nodes, in which depths are the same and the Depth encoding score is high. + +Then we visualize the Depth embedding computation result of different depths, the result is shown in Figure 4. Knowing that we define BACK token in odd depth and sememe node in even depth, we plot the score with and without BACK token. From the result, we can see that: + +(1) The result in the deeper layer tends to be high, which means when generating atomic steps, models focus more on longer tree paths, this may be because different sememe paths indicate different dimensions of senses, and during generating a new path, models need to avoid the existing paths. +(2) In Figure 4(a), scores of depth-0 are much lower than others. It is because depth-0 represents START, which is noise when generating other nodes. Likely, BACK token in even columns retains a lower score. Our model captures this feature and focuses more on meaningful nodes. +(3) For a row in Figure 4(b) $(i < j)$ , the score is higher when the depth is closer; and for a column $(i > j)$ , the score is higher when the depth is far, which indicates that during generation, our models focus more on succeeds, and focus more + +
MethodBLEUStrictEdgeVertex
NSTG23.944.346.965.4
TSTG38.269.771.982.6
TaSTG35.970.372.582.1
TaSTG-D32.167.670.381.0
TaSTG-B33.869.572.482.0
+ +Table 2: The Restricted evaluation result of different models. + +on closer ancestors. + +From the visualize, we can directly see that our model successfully captures the hierarchical feature of tree-structured input by using Depth embedding and Distance embedding. + +# Structure Reconstruction Ability + +To better measure the ability of models to capture hierarchical information, we design a Restricted evaluation, during which we provide correct sememes without structures for our models and ask the models to predict structures for the input sememes. This evaluation focuses on evaluating the structure organization ability of our models in STG. Especially, We ignore the synset who have sememe tree of size 1 in Restricted evaluation, because this has no structural information. Results are demonstrated in Table 2, from which we can observe that: + +(1) All the models achieve significant improvement over the results in Table 1. It indicates that the major challenge for the STG task comes from selecting appropriate candidate sememes at each level. +(2) NSTG model shares the lowest gain because it tends to give a relatively conservative prediction, resulting in the lowest Recall score ( 36.6 in the restricted test compared with 53.3 of TaSTG). In + +![](images/fbb902abf099bfbb80e5dd1bffabfe5be45fbc3c9670af6fc70474c9c195d031.jpg) +Figure 6: Some representative cases of STG. + +the contrast, the Base transformer model generates big trees (18% larger than TaSTG) and gets a higher Recall score in the restricted test, gaining most improvements in the restricted test, performing similarly with TaSTG. + +However, our STG models' performances are far from perfect, which implies that understanding sememe tree structures is still challenging. + +# 5.2 Sememe Tree Complexity (STC) Analysis + +In order to further investigate our models under different scenarios and get a deeper understanding of STG tasks, we further conduct three auxiliary experiments over different levels of sememe tree complexity (STC). Here we define the STC as the annotated sememe number of target words, depth of target tree, and number of terminal nodes in a tree. We conduct these experiments with StrictF1 on Open evaluation due to limited space. We combine results of words that have more than 8 sememes, which is deeper than 6, or which have more than 5 terminal nodes since there are less than $1\%$ . From the result, we can see that: + +In Figure 5(a),Figure 5(b), we can see that prediction performance first increases and then drops with the growth of tree size and depth, which indicates that the STG task is difficult both when there are too few or many sememes in synset. This is in compliance with previous work Qi et al. (2020). + +Since the big size and high depth of a tree may not absolutely represent high complexity, we also + +implement the performance of models with the number of terminal nodes, et tree paths, the result are shown in Figure 5(c). + +(1) With the help of Depth embedding and Distance embedding, TaSTG reaches the highest score in all the cases. And base transformer model performs worse when there are fewer tree paths. +(2) Due to the number of learnable parameters of structure capture, TaSTG-B performs much better than TaSTG-D. And the gain of Distance embedding and Depth embedding is huge when there are more tree paths. This is because Distance embedding distinguishes nodes from different tree paths. + +# 5.3 Case Study + +To show the insights and challenges intuitively, we give some representative cases in Table 6 and make a qualitative case analysis of our model. + +(1) Rare Sememe: Some predictions include very rare sememes. This kind of case challenges our model to get the meaning of sememe from a few train data. Our model successfully captures rare information from definition when it appears. For Example, our model learns the connection with sememe "Kazakhstan" and the word "Kazakhstan", because it appears a few times in the train set. However, in some predictions, definitions don't directly imply the meanings of some sememes, and it's difficult for our model to make such predictions without extra training data. For example, our model cannot predict "Pakistan" from the definition. This kind + +of case challenges models on learning sememe definitions, but it is not contained in our train set. + +(2) Related Sememe: The most common error type is Related Sememes (e.g., predicting "Come-Together" while the correct sememe is "Ally"). It implies that learning BabelNet's annotation preferences to distinguish related sememes that only have minor differences is still challenging for current STG models. +(3) Confusing Structure: Some definitions of synsets have rich meaning. For example, our model predicts correct sememes for "premarital pregnancy" but the incorrect structure, which shows the challenge of predicting correct structures. However, tackling the confusing structure of sememes is a difficult problem even for human experts. + +# 6 Conclusion and Future Work + +In this paper, we handle the structured sememe prediction task for the first time. We propose a Transformer-based tree generation model by adapting the attention mechanism to trees. Experimental results show that our model outperforms baselines including the general tree Transformer. We also conduct extensive experiments and detailed analyses to demonstrate the different properties of our models and the challenges of the task. + +We will explore the following research directions in the future: (1) We will better measure the semantic similarity of tree nodes. In this paper, the Strict-F1 score only focuses on the structure and ignores the semantic similarity of generated sememe pairs with the answer. (2) We will further explore to import the tree-attention mechanism in all sublayers of the decoder and figure out the influence. (3) We will try to combine our method with other sememe-based applications and further analyze the influence of the structure information of sememes. + +# 7 Acknowledgements + +This work is supported by the National Key RD Program of China (No. 2020AAA0106502), Institute Guo Qiang at Tsinghua University, Beijing Academy of Artificial Intelligence (BAAI), and International Innovation Center of Tsinghua University, Shanghai, China. We also thank all the anonymous reviewers for their valuable comments and suggestions. + +# References + +Miltiadis Allamanis, Hao Peng, and Charles Sutton. 2016. A convolutional attention network for extreme summarization of source code. In Proceedings of ICML. PMLR. +Leonard Bloomfield. 1926. A set of postulates for the science of language. Language, 2(3):153-164. +Georgeta Bordea, Els Lefever, and Paul Buitelaar. 2016. Semeval-2016 task 13: Taxonomy extraction evaluation (texeval-2). In Proceedings of SemEval. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL-HLT. +Zhendong Dong and Qiang Dong. 2006. HowNet and the Computation of Meaning (With CD-Rom). World Scientific. +Jiaju Du, Fanchao Qi, Maosong Sun, and Zhiyuan Liu. 2020. Lexical sememe prediction by dictionary definitions and local semantic correspondence. Journal of Chinese Information Processing, 34(5):1-9. +Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. 2020. Codebert: A pre-trained model for programming and natural languages. In Findings of the Association for Computational Linguistics: EMNLP 2020. +Yihong Gu, Jun Yan, Hao Zhu, Zhiyuan Liu, Ruobing Xie, Maosong Sun, Fen Lin, and Leyu Lin. 2018. Language modeling with sparse product of sememe experts. In Proceedings of EMNLP. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. *Neural computation*, 9(8):1735-1780. +Bairu Hou, Fanchao Qi, Yuan Zang, Xurui Zhang, Zhiyuan Liu, and Maosong Sun. 2020. Try to substitute: An unsupervised chinese word sense disambiguation method based on hownet. In Proceedings of COLING. +Huiming Jin, Hao Zhu, Zhiyuan Liu, Ruobing Xie, Maosong Sun, Fen Lin, and Leyu Lin. 2018. Incorporating Chinese characters of words for lexical sememe prediction. In Proceedings of ACL. +Guolin Ke, Di He, and Tie-Yan Liu. 2020. Rethinking positional encoding in language pre-training. In Proceedings of ICLR. +Shucheng Li, Lingfei Wu, Shiwei Feng, Fangli Xu, Fengyuan Xu, and Sheng Zhong. 2020. Graph-to-tree neural networks for learning structured input-output translation with applications to semantic parsing and math word problem. In *Findings of the Association for Computational Linguistics: EMNLP* 2020. + +Chin-Yew Lin and Franz Josef Och. 2004. Orange: a method for evaluating automatic evaluation metrics for machine translation. In Proceedings of COLING. +Qianying Liu, Wenyv Guan, Sujian Li, and Daisuke Kawahara. 2019. Tree-structured decoding for solving math word problems. In Proceedings of EMNLP-IJCNLP. +Qun Liu and Sujian Li. 2002. Word similarity computing based on HowNet. International Journal of Computational Linguistics & Chinese Language Processing, 7(2):59-76. +Yijiang Liu, Meishan Zhang, and Donghong Ji. 2020. End to end chinese lexical fusion recognition with sememe knowledge. In Proceedings of COLING. +Boer Lyu, Lu Chen, and Kai Yu. 2021. Glyph enhanced Chinese character pre-training for lexical sememe prediction. In *Findings of the Association for Computational Linguistics: EMNLP* 2021. +George Miller. 1998. WordNet: An electronic lexical database. MIT press. +Roberto Navigli and Simone Paolo Ponzetto. 2012. Babelnet: The automatic construction, evaluation and application of a wide-coverage multilingual semantic network. Artificial Intelligence, 193:217-250. +Xuan-Phi Nguyen, Shafiq Joty, Steven Hoi, and Richard Socher. 2019. Tree-structured attention with hierarchical accumulation. In Proceedings of ICLR. +Yilin Niu, Ruobing Xie, Zhiyuan Liu, and Maosong Sun. 2017. Improved word representation learning with sememes. In Proceedings of ACL. +Fanchao Qi, Liang Chang, Maosong Sun, Sicong Ouyang, and Zhiyuan Liu. 2020. Towards building a multilingual sememe knowledge base: Predicting sememes for babelnet synsets. In Proceedings of AAAI. +Fanchao Qi, Yangyi Chen, Fengyu Wang, Zhiyuan Liu, Xiao Chen, and Maosong Sun. 2021a. Automatic construction of sememe knowledge bases via dictionaries. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021. +Fanchao Qi, Junjie Huang, Chenghao Yang, Zhiyuan Liu, Xiao Chen, Qun Liu, and Maosong Sun. 2019. Modeling semantic compositionality with sememe knowledge. In Proceedings of ACL. +Fanchao Qi, Yankai Lin, Maosong Sun, Hao Zhu, Ruobing Xie, and Zhiyuan Liu. 2018. Cross-lingual lexical sememe prediction. In Proceedings of EMNLP. +Fanchao Qi, Chuancheng Lv, Zhiyuan Liu, Xiaojun Meng, Maosong Sun, and Hai-Tao Zheng. 2022. Sememe prediction for babelnet synsets using multilingual and multimodal information. In Findings of the Association for Computational Linguistics: ACL 2022. + +Fanchao Qi, Ruobing Xie, Yuan Zang, Zhiyuan Liu, and Maosong Sun. 2021b. Sememe knowledge computation: a review of recent advances in application and expansion of sememe knowledge bases. Frontiers of Computer Science, 15(5):1-11. +Fanchao Qi, Yuan Yao, Haoji Xu, Zhiyuan Liu, and Maosong Sun. 2021c. Turn the combination lock: Learnable textual backdoor attacks via word substitution. In Proceedings of ACL. +Yujia Qin, Fanchao Qi, Sicong Ouyang, Zhiyuan Liu, Cheng Yang, Yasheng Wang, Qun Liu, and Maosong Sun. 2020. Improving sequence modeling ability of recurrent neural networks via sememes. IEEE/ACM Transactions on Audio, Speech, and Language Processing. +Nils Reimers, Iryna Gurevych, Nils Reimers, Iryna Gurevych, Nandan Thakur, Nils Reimers, Johannes Daxenberger, Iryna Gurevych, Nils Reimers, Iryna Gurevych, et al. 2019. Sentence-bert: Sentence embeddings using siamese bert-networks. In Proceedings of EMNLP. +Vighnesh Shiv and Chris Quirk. 2019. Novel positional encodings to enable tree-based transformers. Proceedings of NeurIPS. +Zeyu Sun, Qihao Zhu, Yingfei Xiong, Yican Sun, Lili Mou, and Lu Zhang. 2020. Treegen: A tree-based transformer architecture for code generation. In Proceedings of the AAAI. +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 Proceedings of NeurIPS. +Anna Wierzbicka. 1996. Semantics: Primes and universals: Primes and universals. Oxford University Press, UK. +Qinzhuo Wu, Qi Zhang, and Zhongyu Wei. 2021. An edge-enhanced hierarchical graph-to-tree network for math word problem solving. In *Findings of the Association for Computational Linguistics: EMNLP* 2021. +Ruobing Xie, Xingchi Yuan, Zhiyuan Liu, and Maosong Sun. 2017. Lexical sememe prediction via word embeddings and matrix factorization. In Proceedings of IJCAI. +Pengcheng Yin and Graham Neubig. 2017. A syntactic neural model for general-purpose code generation. In Proceedings of ACL. +Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020. Word-level textual adversarial attacking as combinatorial optimization. In Proceedings of ACL. +Wojciech Zaremba and Ilya Sutskever. 2014. Learning to execute. arXiv preprint arXiv:1410.4615. + +Jipeng Zhang, Roy Ka-Wei Lee, Ee-Peng Lim, Wei Qin, Lei Wang, Jie Shao, and Qianru Sun. 2020a. Teacher-student networks with multiple decoders for solving math word problem. In Proceedings of IJCAI. +Lei Zhang, Fanchao Qi, Zhiyuan Liu, Yasheng Wang, Qun Liu, and Maosong Sun. 2020b. Multi-channel reverse dictionary model. In Proceedings of AAAI. +Jingwen Zhu, Yuji Yang, Bin Xu, and Juezi Li. 2019. Semantic representation learning based on hownet. Journal of Chinese Information Processing, 33(03):33-41. +Daniel Zugner, Tobias Kirschstein, Michele Catasta, Jure Leskovec, and Stephan Gunnemann. 2021. Language-agnostic representation learning of source code from structure and context. In Proceedings of ICLR. \ No newline at end of file diff --git a/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/images.zip b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4bd897599d6f1081c9f6639a9e316e269fcf52e5 --- /dev/null +++ b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7816a7f29eb51e946457fff681c6fc59773e7cdfc7469f2313785cb9fc69eb0a +size 316628 diff --git a/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/layout.json b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..676c5cd5902f0761cdca0c851575fb872b3c7581 --- /dev/null +++ b/goingdeeperstructuredsememepredictionviatransformerwithtreeattention/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:307ded099e8d2886aee7b5b64ca909b11a7c328580a16aa6544093dd00909879 +size 389122 diff --git a/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_content_list.json b/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..319604c04e746306694729743b137f9bae13c956 --- /dev/null +++ b/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66c7442888a5500e2f8193df2560ed79a461454df73945b6aa8ceafe30f62e5f +size 95988 diff --git a/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_model.json b/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..606ea289116b01c625bf877a6f84eed94ef373d7 --- /dev/null +++ b/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98e5a7bd8553465a7c5eba1a767a3b4cfe2c64c01f48e9cfbb85cd91091cc510 +size 113134 diff --git a/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_origin.pdf b/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f31c0ee065fb91a7f0fc03c8963c898dcc163d75 --- /dev/null +++ b/goodnightat4pmtimeexpressionsindifferentcultures/4c6bca7c-dd22-4104-aaae-7ab19638bec4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccf0b408ee8e2d0445923251eddadcc47b0ca2a6d61bbf79d8f7afb1005eee07 +size 540669 diff --git a/goodnightat4pmtimeexpressionsindifferentcultures/full.md b/goodnightat4pmtimeexpressionsindifferentcultures/full.md new file mode 100644 index 0000000000000000000000000000000000000000..24e44968f1678ed212083aff920db88ced34c71f --- /dev/null +++ b/goodnightat4pmtimeexpressionsindifferentcultures/full.md @@ -0,0 +1,321 @@ +# Good Night at 4 pm?! Time Expressions in Different Cultures + +Vered Shwartz + +Department of Computer Science, University of British Columbia + +vshwartz@cs.ubc.ca + +# Abstract + +We propose the task of culture-specific time expression grounding, i.e. mapping from expressions such as "morning" in English or "manhã" in Portuguese to specific hours in the day. We propose 3 language-agnostic methods, one of which achieves promising results on gold standard annotations that we collected for a small number of languages. We then apply this method to 27 languages and analyze the similarities across languages in the grounding of time expressions. + +# 1 Introduction + +Natural language understanding requires the ability to map language such as color descriptions (McMahan and Stone, 2015), spatial instructions (Chen et al., 2019), and gradable adjectives (Shivade et al., 2016) to real-world physical properties. This paper focuses on temporal grounding, particularly mapping time expressions such as "morning" and "evening" to hours in the day. Temporal commonsense reasoning has been gaining traction lately (Zhou et al., 2019; Qin et al., 2021), and this important capability can benefit various temporal tasks such as event ordering and duration prediction. + +One of the challenges in grounding time expressions to standard times is that such expressions may be interpreted with some variation by different people. Reiter and Sripada (2002) found that human-written weather forecasts exhibited significant individual differences between forecasters in the interpretation of time expressions. One factor for this variation is cultural differences. Vilares and Gomez-Rodriguez (2018) analyzed the time of day in which people from 53 countries posted time-specific greetings such as "good morning" and "good evening" on Twitter. They showed variation in greeting times across languages and cultures, which they connected to known facts and published statistics about cultural differences, such as differences in average wake and sleep times. + +We propose to re-frame the research question posed by Vilares and Gomez-Rodriguez (2018) as a task of time expression grounding: given a time expression, the goal is to map it to a range of hours during the day. For example, what is the range of hours an Italian speaker refers to when saying pomeriggio (afternoon)? Such a grounding model can provide cultural context to machine translation systems (de Medeiros Caseli et al., 2010), language learning apps (Teske, 2017), and user-centered dialogue systems (Miehle et al., 2016). + +We collected gold standard interpretations from four countries, which indeed exhibited some variation. We then proposed 3 language-agnostic methods based on either a corpus or a language model (LM). The corpus-based method performed well across languages, outperforming the method proposed by Vilares and Gomez-Rodriguez (2018) on 3 out of 4 languages. Encouraged by the performance on the labelled languages, we applied the method to additional 23 unlabelled languages, and analyzed the differences predicted by the models. + +In the future, we plan to incorporate this method into NLP systems that may benefit from temporal grounding. Areas of future work involve testing our methods on low-resource languages, as well as re-searching ways to overcome reporting bias (Gordon and Van Durme, 2013): the under-representation of trivial facts in written text. We hope this work would be another small step in the long-term goal of developing culturally-aware NLP models (Hovy and Yang, 2021).1 + +# 2 Data + +We collected gold standard annotations for the start and end times of five time expressions: morning, noon, afternoon, evening, and night. The annotations were collected in Amazon Mechanical Turk (AMT) for English, Hindi, Italian, and Portuguese. + +![](images/609c124fbe3721626bb809528de671f22303bb4c47672b8a16f3d2619e5ca439.jpg) +Figure 1: Percents of native languages collected from each country. India is the only country where the majority native language differs from the language used in Wikipedia and BERT (Hindi). Numbers in brackets: (1) percents of native speakers of the target language (in orange) living in this country (López, 2015); and (2) percents of the country's population that speaks this language at home (from Wikipedia). + +We describe the rationale behind the choice of languages (§2.1), the HIT (Human Intelligence Task) and annotation guidelines (§2.2), and the observations from the collected data (§2.3). + +# 2.1 Choice of Languages + +The languages in our dataset are not meant to be a representative sample of all languages. We selected these languages based on the following criteria. + +Availability of AMT Workers. By and large, AMT does not facilitate filtering workers by the languages in which they are fluent.2 We thus treated country as a proxy for language, e.g. assuming that most workers in Brazil speak Portuguese, while asking workers about their native language. AMT is available at select countries, and the number of workers in each country varies. We got the most responses from US and India (100 each), in line with published analyses of demographics (Difallah et al., 2018) and language demographics in AMT (Pavlick et al., 2014). We collected 91 responses from Brazil and 58 from Italy. + +The Interplay between Country and Language. We focused on pairs of country and language where most of the country's population speaks that language, and most of the L1 speakers of the language reside in that country. For instance, $78.1\%$ of US + +residents speak English at home, and $76.9\%$ of L1 English speakers reside in the US. $^{3}$ Figure 1 shows that for 3 out of the 4 countries, the majority of workers indicated they were native speakers of the majority language. The exception is India, which has many languages. Hindi is the most spoken language in India (followed by Bengali: $8\%$ and Telugu: $6.7\%$ ) and has the larger Wikipedia corpus and a BERT model. Among the workers from India, $16\%$ indicated they were Hindi speakers. + +While the gold standard annotations are limited to 4 languages, the framework we describe in Section 3 is unsupervised and almost entirely language-agnostic. As we discuss in Section 4.3, we applied the model to additional 23 languages, selected based on the availability of a Wikipedia corpus and an LM for that language. $^{4}$ + +# 2.2 Annotation Task + +Figure 3 displays the HIT. We asked workers to identify their native language, and posed them the following questions regarding each time expression (e.g. noon). + +1. If the native language is not English: What is the equivalent word for noon in your native language? We allowed workers to check “There is no equivalent expression in my language”. +2. What is the range of time you consider as noon? Workers were required to indicate the start and end times. + +We then allowed workers to add any time expression in their native language that wasn't mentioned in the HIT, as well as free text comments. To ensure the quality of annotations, we required that workers had a $95\%$ approval rate for at least 100 prior HITs. We paid 0.3 USD per HIT. + +# 2.3 Observations + +Figure 5 displays the average start and end time for each country and each time expression. Notably, morning is quite consistent across the different countries and noon is the short period around $12\mathrm{pm}$ . The variation is higher for afternoon and evening. Many workers from Brazil noted that Portuguese uses the same word for evening and night (noite), and that evening turns quickly into night + +![](images/c242bf9036ad05030d701e3d2cddaaab3c8d6b4264276f10b7381d87cff78c40.jpg) +Figure 2: Start and end time distributions for each time expressions, as indicated by workers from 4 countries. +Figure 3: The AMT HIT used to collect the gold standard grounding of time expressions to times. + +
What is your native language? [Select language...]
What is the equivalent word for morning in your native language?____ +What is the range of time you consider as morning?---to----[x] There is no equivalent expression for morning in my native language.
What is the equivalent word for noon in your native language?____ +What is the range of time you consider as noon?---to----[x] There is no equivalent expression for noon in my native language.
What is the equivalent word for afternoon in your native language?____ +What is the range of time you consider as afternoon?---to----[x] There is no equivalent expression for afternoon in my native language.
What is the equivalent word for evening in your native language?____ +What is the range of time you consider as evening?---to----[x] There is no equivalent expression for evening in my native language.
What is the equivalent word for night in your native language?____ +What is the range of time you consider as night?---to----[x] There is no equivalent expression for night in my native language.
If there is another time expression in your native language, what is it and roughly how is it translated to English? Expression in native language: English translation: Time:---to----
Do you have any comments?____
+ +because of the country's tropical climate. This results in a very early night time in the annotations (3:16 pm), and high overlap between the afternoon, evening, and night spans. + +Workers across countries suggested a missing expression that spans the time between midnight and sunrise, which they referred to as "midnight", "after midnight", "late night", "early morning", and "dawn". Other suggestions included "twilight" (6-7 pm, India), "sunrise" (5-6 am, Italy), "late morning" (11-11:59 am, Italy), "after lunch" (1:15-2 pm, Italy), and "late afternoon" (3-4 pm, Italy). + +Finally, some workers commented that the interpretations of time expressions varies in different seasons because of the changes in sunrise and sunset times. The data was collected in October, and although we don't know the exact location of the workers, we can test the night start and end times against the average October sunrise and sun- + +set times in the capital of each country. Setting aside Brazil that doesn't distinguish evening and night, there is somewhat of a match between the average sunset time and the average night start time: US: 6:30 pm/6:59 pm, India: 5:52 pm/4:49 pm, and Italy 6:30 pm/6:22 pm. There was no such match between sunrise time and the end of the night or beginning of the morning.[5] + +# 3 Methods + +We define the time expression grounding task: given a time expression, the goal is to predict its start and end times. We developed 3 methods that differ along two dimensions: (1) the source from which the times are learned: a corpus ( $\S 3.1$ ) or a language model ( $\S 3.2$ ); and (2) whether to compute start and end times directly or indirectly through estimating a distribution of times. + +# 3.1 Extractive Approach + +Estimating Hour Distributions. We search Wikipedia for occurrences of a regular expression that matches a broad range of time formats, including both 24-hour and 12-hour clock formats. For each time expression $X_{i}$ , we compute $D_{i}$ , the distribution of hours from co-occurring time mentions within the same paragraph. For example, given the sentence "See you in the evening, at 19:30" we extract a co-occurrence of "evening" with 7 pm. We used Google Translate to translate the English time expressions to other languages, keeping multiple + +# Template + +```txt +It was [MASK] in the . +It is [MASK] in the . +It happened yesterday in the , at [MASK]. +It happened in the , at [MASK]. +It will happen in the , at [MASK]. +Every at [MASK]. +``` + +```latex +The $<\text{time\_exp}>$ starts at [MASK]. +The $<\text{time\_exp}>$ ends at [MASK]. +``` + +Table 1: Templates used by the LM-based method to predict the distribution (top) or start/end times (bottom). + +translations for each time expression. + +Inferring Start and End. To infer the start and end times $S_{i}$ and $E_{i}$ from $D_{i}$ , we define an optimization problem and formulate it as an integer linear programming (ILP) problem detailed below. + +# Input: + +$\mathbf{D}_1$ ... $\mathbf{D}_5$ : hour distribution per expression + +Define: // start and end variables + +$(\mathbf{S}_1,\mathbf{E}_1)\ldots (\mathbf{S}_5,\mathbf{E}_5),0\leq S_i,E_i\leq 23$ + +# Maximize: + +$\sum_{i}\sum_{h}$ WithinRange $(h,S_i,E_i)\cdot D_i[h]$ + +# Constrained to: + +// start before end except at night + +$\forall_{i = 1,\dots,4}S_i < E_i$ $S_5 < E_5 + 24$ + +// sort expressions + +$\forall_{i = 1,\dots,4}S_{i + 1}\geq E_i$ + +The goal is to find a global solution for all the time expressions, with non-overlapping time ranges in which the expressions are sorted, e.g. morning comes before noon. We maximize the number of observations in $D_{i}$ that are within the inferred start and end times. + +# 3.2 LM-Based Approach + +We used multilingual BERT (mBERT; Devlin et al., 2019), a single BERT model trained on Wikipedia in multiple languages that achieves strong zero-shot cross-lingual transfer performance (Wu and Dredze, 2019). + +Method 1: Estimating Hour Distributions. For each time expression, we query BERT for substitutes for the masked token in each template in the top part of Table 1. We translated the templates to other languages using Google Translate. For better translation quality, we assigned time expressions (morning, noon, ...) into the + + placeholder and hours (9:00, 12:00,...) into the [MASK] placeholder.7 + +Since LM predictions are sensitive to the prompt, we follow Jiang et al. (2020) and aggregate the predictions across these various templates. We also allow for various time formats. For example, we query BERT for the substitutes of each of "It is [MASK]:00 in the morning", "It is [MASK].00 in the morning", and "It is [MASK] in the morning". We sum the distributions and normalize the scores for all numbers within the range of 0 and 23. + +For languages spoken mostly in countries where 12-hour clock is the norm, we computed the distribution for hours in the range of 0 and 12. We then assigned each hour back into the template and predicted whether the next token is more likely to be am or pm (or its equivalent in the target language). For example, if BERT assigned 9:00 a score of 0.3 in the morning distribution, and the query "It is 9:00 [MASK] in the morning" predicted am with a score of 0.9 and pm with 0.1, then in the final 24-hour clock distribution, 9 has a score of $0.3 \cdot 0.9 = 0.27$ and 21 has a score of $0.3 \cdot 0.1 = 0.03$ . + +Finally, we use the same ILP formulation to infer the start and end times from the hour distributions. + +Method 2: Directly Predict Start and End Times. For each time expression, we separately query BERT for the substitutes of the masked tokens in the start template and end template in the bottom part of Table 1. We apply the same processing as described above. The output of this step is a start time distribution $SD_{i}$ and an end time distribution $ED_{i}$ over 24 hours for each time expression $X_{i}$ . We infer the start and end times with the same optimization problem, but with a slightly modified objective detailed below. The objective is to select the most highly scored start and end time for each expression, that adhere to the same constraints. + +```txt +Maximize: $\sum_{i}\sum_{h}(\mathbb{1}(S_{i} == h)\cdot SD_{i}[h] + \mathbb{1}(E_{i} == h)\cdot ED_{i}[h])$ +``` + +![](images/9fd32f5d2681af913b32fb703a923249e5361a2dc0207fe5cf6869f6a1030340.jpg) + +![](images/395d100737d0e05cc6752d3a227f527552b9f45f2140403237fee77d821f08f0.jpg) + +![](images/4cd12b74f0bc38d4df44c8362bbe50fe13f00b8b391015ef048f1e9d943ea928.jpg) +Figure 4: Start and end times for each time expressions, in English, Hindi, Italian, and Portuguese, as estimated by each method and compared to the gold standard. Note that the predicted time ranges are non-overlapping, while the gold standard ranges of certain time expressions overlap. + +![](images/d98426525fbb23cbcd005e1c46a9d6e94225f1d8c1eaf76253493cf21b84fa06.jpg) + +# 4 Experiments + +# 4.1 Baseline + +Our baseline is based on the Greetings method proposed by Vilares and Gomez-Rodriguez (2018). Their study focused on 4 out of the 5 time expressions used in our paper: morning, afternoon, evening, and night. We use their dataset and induce the corresponding time expression distributions. We focus on tweets in English from the US (1.34M), Portuguese from Brazil (2M), Italian from Italy (4,821), and Hindi from India (6,069). We then infer the start and end times using the ILP problem in Section 3.1. Although the dataset does not include statistics for "noon" (due to the lack of a corresponding greeting), the global objective in the ILP formulation is expected to infer the start and end times for noon based on the surrounding time expressions. + +# 4.2 Results + +Figure 4 displays the predicted start and end times for each expression according to each method, in comparison to the gold standard times of each language. For quantitative evaluation, we define minute-level accuracy. We classify each minute of the day to a time expression based on the start and end times, and compute the accuracy compared to the gold standard minute classification. Since the gold standard grounding allows overlap between time expressions, we reward models for predicting any of the gold standard time expressions for a given minute. Table 2 shows the accuracy as well + +
ModelTypeAcc.ΔStartΔEnd
EN
ExtractiveDist84.30.61.7
LMDist63.33.02.6
SE49.22.63.6
GreetingsDist80.70.81.8
HI
ExtractiveDist80.42.51.9
LMDist54.25.84.9
SE63.53.13.1
GreetingsDist60.72.43.1
IT
ExtractiveDist90.11.00.5
LMDist80.62.12.4
SE55.33.74.0
GreetingsDist71.91.82.2
PT
ExtractiveDist65.02.93.0
LMDist77.35.26.6
SE95.51.01.9
GreetingsDist79.54.74.7
+ +Table 2: Minute-level accuracy and differences in gold and predicted start and end times across languages. + +as the average differences in hours between the predicted and gold standard start (ΔStart) and end (ΔEnd) times. + +There is a general preference for the extractive method, that achieves between $65\%$ and $90\%$ accuracy across languages. The exception is Portuguese, where this method performs worse than the others, and in particular by the LM Start-End method that performs remarkably well. The two LM-based methods perform substantially worse on the other languages. Finally, the results for India are surprisingly not bad despite the mismatch between the native languages of the annotators and the language used by our methods. + +
MorningNoonAfternoonEveningNight
StartEnd%StartEnd%StartEnd%StartEnd%StartEnd%
EN4:0012:0036.312:0013:006.613:0017:0011.717:0018:0016.418:004:0029.0
DE4:0015:0034.715:0016:006.116:0017:008.317:0022:0020.522:004:0030.4
FR3:0011:0035.611:0017:0021.317:0018:001.118:0019:0010.319:003:0031.8
JA5:0012:0041.312:0013:006.413:0015:006.115:0018:008.118:005:0038.1
ES3:0011:0029.411:0012:006.112:0021:0040.3--0.021:003:0024.2
RU7:0011:0021.611:0013:0015.413:0014:003.414:0015:0011.515:007:0048.0
PT1:0011:0031.311:0012:004.012:0021:0039.3--0.021:001:0025.3
ZH6:0012:0020.012:0013:003.213:0018:0014.418:0020:0025.520:006:0036.9
IT6:0012:0024.412:0013:004.813:0018:0020.318:0022:0020.222:006:0030.2
FA7:0011:0042.011:0012:000.012:0020:0034.620:0021:001.221:007:0022.2
AR1:002:0039.72:003:000.23:004:005.74:0023:0053.523:001:000.9
PL1:0012:0055.812:0021:0029.121:0022:002.022:0023:001.823:001:0011.3
NL4:0013:0031.413:0017:0017.617:0018:002.518:0021:0024.021:004:0024.5
UK8:0010:0012.510:0011:002.811:0012:0016.712:0013:0010.613:008:0057.3
HE4:0011:0019.711:0012:005.612:0018:0028.618:0022:0026.222:004:0019.9
TR4:0012:0036.612:0013:000.313:0014:005.914:0022:0023.422:004:0033.8
ID4:0011:0036.411:0015:0016.415:0018:009.2--0.018:004:0037.9
CS1:0016:0046.316:0017:008.517:0018:0019.018:0023:0020.223:001:006.0
SV6:0011:0023.711:0012:009.412:0013:007.513:0022:0026.822:006:0032.6
VI1:0012:0052.912:0013:006.613:0018:0025.818:0019:002.319:001:0012.5
KO3:004:0013.14:005:000.85:0010:0031.910:0011:008.311:003:0045.9
FI12:0013:006.013:0014:000.214:0015:000.615:0016:0011.316:0012:0081.9
HU3:0011:0030.611:0012:0013.812:0016:0017.616:0023:0026.623:003:0011.4
EL1:0011:5945.111:5915:0019.9--0.015:0021:0023.621:001:0011.4
NO7:0011:0016.811:0012:001.612:0013:0014.813:0022:0032.422:007:0034.4
CA4:0015:0039.015:0016:007.116:0017:0016.717:0018:008.818:004:0028.3
HI10:0011:0035.611:0012:000.012:0013:0016.013:0014:000.814:0010:0047.6
+ +Table 3: Start and end time for various languages, as predicted by the extractive method, along with the percent of corpus occurrences for each expression. + +# 4.3 Application to Other Languages + +We applied our proposed methods to additional unlabelled languages detailed in Table 3. The languages are sorted according to their Wikipedia corpus size. The Table shows the predicted start and end time for each language and each time expression.9 + +Without labelled data it is hard to judge the correctness of the predictions, but the predictions of some languages seem more reasonable than others. In particular, we observed that some time expressions appeared in the corpus more frequently than others, causing the model to dedicate most of the 24 hours to such expressions. The percent column in Table 3 show the percent of all corpus occurrences dedicated to each expression. For instance, $81.9\%$ of the occurrences found for Finnish are for night, and the model predicted a 20 hour night. It could be a result of the extremely short days in Finland during the winter, but this is likely exaggerated by the bias in corpus occurrences. + +# 5 Analysis + +# 5.1 Uniformity of Time Distributions + +Figure 5 presents the hour distribution for each expression in Italian, as estimated using the extractive (blue) and LM-Dist (orange) methods. As the figure demonstrates, the LM-predicted distribution is more uniform than the extractive one. This is true across most languages: the average entropy of the extractive distributions across languages is $2.78 \pm 0.3$ , and $3.09 \pm 0.05$ for the LM-Based distributions. For comparison, a uniform distribution across all 24 hours yields an entropy of 3.18. + +The uniform distributions predicted by BERT are possibly caused by the similarity between the different inputs (time expressions) and the different outputs (numbers). Previous work showed that BERT confuses semantically-similar but mutually-exclusive concepts such as colors (Shwartz and Choi, 2020). The representation of numbers in distributional models is also suboptimal (Naik et al., 2019; Thawani et al., 2021). + +# 5.2 Analysis of Extracted Sentences + +We sampled 25 English sentences extracted by the extractive method (§3.1), and manually analyzed them to determine whether they are valid, i.e., the sentence discusses a time and refers to it as a (reasonable) time expression. Among the invalid sen + +
Type%Example
① Valid72%Every evening at 18:45
② Reference error16%suffered apoplectic fit on the morning of 2 February, and died at 11:45 am, 4 days later
③ Verse12%“Book of Signs” (1:19–12:50); the account of Jesus' final night
④ 12-hr clock without am/pm下午1:00-5:00開放Between 1:00-5:00 in the afternoon.
⑤ WSD errortomorrow 17:00 woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe wOE woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe w oe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe woe wote woe wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wOTE wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wole wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote woke wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote woge wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wete wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wotide wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wite wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wate wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wota wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote watee wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote walewite wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wotewite wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wolewite wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote woke wite wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wote wole wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite wite witeswite wite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite switeswite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite SWite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite Swite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite SWite SWite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite SWite Swite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite Swite SWite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite Swite Swite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite Swite SWite SWite SWite Swite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWiteSWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWiteSWite SWite SWite SWiteSWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWite SWiteSWite SWite SWite SWite SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEigeSWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SWEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEigen SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige sBige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEig SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEigeSBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBeige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEiger SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige SBEige
+ +Table 4: Top: Manual categorization of a sample of the English sentences extracted in the extractive method, along with a (slightly shortened) example of each category. Bottom: additional error examples in other languages. + +![](images/25d3d10cbc226a01db135bc4e630a66f6a3f1d13659458f4e8c2d9b3a4698721.jpg) +Figure 5: Distribution of hours per time expressions in Italian as estimated by the extractive (blue) and LM-based Dist (orange) methods. + +![](images/3691255bc8faff4e2738793d8fd61fcfb57c9a9343f54b6324be9cc75de9dbd2.jpg) +Figure 6: A heatmap showing the accuracy of predicting start and end times for each language from the times of each other language. Dark red indicates $100\%$ accuracy while dark blue indicates $0\%$ accuracy. + +tence, we manually categorized the types of errors. + +Table 4 presents the percents of each category, along with representative examples. In accordance with the results in Table 2, most of the extractions were valid. Among the errors, 4 sentences contained reference errors, for instance reporting on someone being injured in the morning and dying at another time of the day a few days later. Three sentences included a citation from the Bible or the New Testament, treating the chapter and verse separated by a colon as a time mention. + +We repeated the same analysis for languages spoken by members of our research group: Chinese, Korean, Russian, Hebrew, and Italian. The percent of valid sentences ranged from $52\%$ (Chinese) to $80\%$ (Korean). Across languages, reference was a common error in longer paragraphs, but in preliminary experiments we found that splitting the paragraphs to sentences yields a sparse signal. In Chinese, that uses both 12-hour and 24-hour notations, the 12-hour clock was sometimes used without specifying am or pm in unambiguous contexts + +such as “5:00 in the afternoon”. In Hebrew, the word for “evening” has a rarer meaning of “before” which led to WSD error. In Korean, we translated “afternoon” to $\text{오후}$ that more broadly means “pm”. + +# 5.3 Similarity Across Languages + +Using the predictions from the extractive method (§3.1), we compute the accuracy of predicting the start and end times of each language from the times of each other language. Figure 6 shows a heatmap of the most similar and most dissimilar languages with respect to time ranges. + +The most similar language pairs in terms of time ranges are pairs of closely related languages: Norwegian and Swedish (100%) followed by Portuguese and Spanish (92%). In particular, the latter two don't distinguish evening from night. + +The similarity between Italian and Chinese $(92\%)$ might be explained by the similarity between the average times of waking up and going to bed in both countries: both Italian men and Chinese women go to sleep close to midnight and wake up + +around 7:30 on average (Walch et al., 2016). + +Finally, Hindi and Ukrainian have similar predictions as well (92%), but considering the extremely early night start time predicted for both (2 pm and 1 pm), we conjecture that this is mostly due to noise in the data. The same pattern emerges between pairs of dissimilar languages such as Czech and Russian or Farsi and Polish (36%), where the model of each language devotes most of its 24 hours to a single time expression. + +# 6 Related Work + +Temporal Commonsense. Work on temporal reasoning ranges from extracting and normalizing temporal expressions (Strötgen and Gertz, 2010; Angeli et al., 2012; Vashishtha et al., 2019), to inferring possibly explicit temporal attributes of events, including their order (Ning et al., 2018; Vashishtha et al., 2019), duration (Chambers and Jurafsky, 2008; Vashishtha et al., 2019), and typical times or frequencies (Zhou et al., 2019). + +Various benchmarks were proposed to measure models' temporal reasoning abilities. The bAbI suite contains a task that requires reasoning about the order of time expressions (Weston et al., 2015). MC-TACO is a reading comprehension task pertaining to ordering, duration, stationarity, frequency, and typical times of events (Zhou et al., 2019). TIMEDIAL (Qin et al., 2021) is a dialogue QA task focusing on temporal commonsense. Zhou et al. (2021) and Thukral et al. (2021) both cast the temporal ordering task as an NLI task. In another line of work, tracking state changes in procedural text is also related to temporal ordering (Dalvi et al., 2018; Zhang et al., 2020). Despite the success of pre-trained LMs on language understanding tasks, their performance on these benchmarks is limited, maybe due to the fact that many temporal relations are not explicitly stated in text (Davis and Marcus, 2015). A promising direction is to train LMs explicitly on temporal knowledge (Zhou et al., 2020). + +Cultural Commonsense. Language has a social function, yet, there is little focus on culture-dependant language processing (Hovy and Yang, 2021). Several recent papers start addressing this gap. Yin et al. (2021) and Liu et al. (2021) extended existing visual question answering datasets with images from non-Western cultures. Models trained to answer questions regarding images in the original datasets learned Western commonsense knowledge such as the association between weddings and + +white dresses. As a result, their performance drops on non-Western images, such as an Indian wedding ceremony where the bride is wearing a red sari. + +With respect to temporal commonsense, Acharya et al. (2021) surveyed crowdsourcing workers in the US and India regarding rituals that are commonly found across cultures such as birth, marriage, and funerals. In particular, they asked questions pertaining to temporal aspects such as typical time and duration of each event. The paper presented anecdotal differences such that a wedding lasts a few hours in the US but a few days in India. The focus of both Vilares and Gómez-Rodríguez (2018) and Acharya et al. (2021) is on analyzing such cultural differences. Conversely, we formulated cultural-differences in the grounding of time expressions into a task, for which we collected gold standard annotations and proposed several methods. + +Language Grounding and World Knowledge. Our work is related to language grounding (Roy and Reiter, 2005) and to extracting world knowledge from text corpora (Carlson et al., 2010; Tandon et al., 2014). In the intersection of these two lines of work, Forbes and Choi (2017) extracted from a corpus physical commonsense knowledge about actions and objects along five dimensions (size, weight, strength, rigidity, and speed), while Elazar et al. (2019) induced distributions of typical values of various quantitative attributes such as time, duration, length, and speed. In particular, Elazar et al. (2019) mention cultural differences that arose when crowdsourcing workers were asked to estimate whether an item's price was expensive or not: annotators from India judged prices differently from annotators in the US. + +# 7 Discussion and Conclusion + +We addressed the task of grounding time expressions such as "morning" and "noon" in different languages to explicit hours. Our extractive method achieves good performance on languages for which we collected gold annotations. We dedicate the remainder of the paper to discuss various limitations and considerations for future work. + +Temporal and Seasonal Factors. As discussed in §2.3, some workers mentioned that their interpretation of time expressions depends on the season, e.g., night starts earlier in the winter in the Northern Hemisphere. In addition, the time of day in + +which the workers answered the survey might have introduced some bias. The batches were published according to the authors'timezone and working hours, which might have been outside working hours for some countries. An early riser answering an AMT survey at 5 am or a night owl that answers it at 2 am might not be representative of the population. Finally, Vilares and Gomez-Rodriguez (2018) showed that tweets greeting "good morning" appeared later in the day during weekends and holidays, indicating later wake up times. It is possible that such factors will also affect the judgement of survey respondents. + +Languages and Countries. Although there is no direct mapping between culture and language, one can often teach about the other. For example, in ConceptNet (Speer et al., 2017), a multilingual commonsense knowledge base, the English entry for breakfast specifies pancakes as breakfast food, while the Chinese entry mentions noodles.[10] + +In this paper, we treated language as a proxy for culture, making the simplifying assumption that the grounding of time expressions to times is similar across speakers of the same language. This assumption is challenged for countries with multiple languages and for languages spoken across multiple countries. For example, we can expect a Portuguese speaker from Brazil and a Portuguese speaker from Portugal to perceive time expressions differently due to the different time zones in which they live. + +The alternative approach of using country as a proxy for culture is not applicable since corpora and language models are available for languages rather than countries. We can therefore assume that the models' predictions for each language are dominated by the country with the larger number of speakers (or more precisely, with the larger number of Wikipedia contributors). For example, the grounding of time expressions of the Portuguese model is likely dominated by speakers in Brazil and doesn't represent speakers in Portugal faithfully. + +Reporting Bias. Every method that learns about the world from texts (or from language models, trained on text corpora), suffers from reporting bias (Gordon and Van Durme, 2013; Shwartz and Choi, 2020). The frequency of occurrences in a corpus is an imperfect proxy for measuring the quantity or frequency of things in the world. In our case, + +it may be that some hours are less spoken of in general: perhaps fewer newsworthy events happen late at night? Some time expressions might be less ambiguous than others and therefor appear less frequently with an exact time mention. + +Inducing time distributions from greetings also confounds other cultural factors such as politeness. The mapping between greetings and time expressions is not perfect, e.g. as Vilares and Gomez-Rodriguez (2018) note, "bonjour" in French means "good morning" but is also used throughout the day to mean "hello". Finally, Twitter memes might use a greeting with a different intention, as in the famous "good morning to everyone except" meme.[11] + +While the methods in this paper are language-agnostic, they are designed based on English, and they don't produce equally good predictions for all languages. First, the automatic translation of time expressions and templates from English to other languages may introduce some errors. Second, beyond the differences in the set of commonly used time expressions in each language (e.g., "evening" being missing from Spanish, or "dawn" being commonly used in other languages), time might also be discussed differently in different languages. In some languages it may be more common to use cardinals to discuss hours, as in "It is two in the afternoon". Finally, the success of our methods also depends on the availability of large text corpora and the quality of the LM. We used mBERT because it is available for 104 languages, but we focused on relatively high-resource languages. This model doesn't perform equally well across all languages (Wu and Dredze, 2020). In the future, we plan to find alternative sources for collecting gold standard annotations for additional languages, which will facilitate evaluating the performance of our methods on a broader range of languages. + +# Acknowledgements + +This work was supported in part by a research gift from the Allen Institute for AI (AI2). We thank Wen Xiao, Grigorii Guz, Hyeju Jang, and Giuseppe Carenini for helping with the error analysis in different languages, and Yuval Pinter and Daniel Hershcovich for insightful feedback. + +# References + +Anurag Acharya, Kartik Talamadupula, and Mark A Finlayson. 2021. Towards an atlas of cultural commonsense for machine reasoning. In AAAI. +Gabor Angeli, Christopher Manning, and Daniel Jurafsky. 2012. Parsing time: Learning to interpret time expressions. In Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 446-455, Montreal, Canada. Association for Computational Linguistics. +Andrew Carlson, Justin Betteridge, Bryan Kisiel, Burr Settles, Estevam R Hruschka, and Tom M Mitchell. 2010. Toward an architecture for never-ending language learning. In Twenty-Fourth AAAI conference on artificial intelligence. +Nathanael Chambers and Dan Jurafsky. 2008. Unsupervised learning of narrative event chains. In Proceedings of ACL-08: HLT, pages 789-797, Columbus, Ohio. Association for Computational Linguistics. +Howard Chen, Alane Suhr, Dipendra Misra, Noah Snavely, and Yoav Artzi. 2019. Touchdown: Natural language navigation and spatial reasoning in visual street environments. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). +Bhavana Dalvi, Lifu Huang, Niket Tandon, Wen-tau Yih, and Peter Clark. 2018. Tracking state changes in procedural text: a challenge dataset and models for process paragraph comprehension. 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 1595-1604, New Orleans, Louisiana. Association for Computational Linguistics. +Ernest Davis and Gary Marcus. 2015. Commonsense reasoning and commonsense knowledge in artificial intelligence. *Commun. ACM*, 58(9):92-103. +Helena de Medeiros Caseli, Bruno Akio Sugiyama, and Junia Coutinho Anacleteo. 2010. Using common sense to generate culturally contextualized machine translation. In Proceedings of the NAACL HLT 2010 Young Investigators Workshop on Computational Approaches to Languages of the Americas, pages 24-31, Los Angeles, California. Association for Computational Linguistics. +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. + +Djellel Difallah, Elena Filatova, and Panos Ipeirotis. 2018. Demographics and dynamics of mechanical turk workers. In Proceedings of the eleventh ACM international conference on web search and data mining, pages 135-143. +Yanai Elazar, Abhijit Mahabal, Deepak Ramachandran, Tania Bedrax-Weiss, and Dan Roth. 2019. How large are lions? inducing distributions over quantitative attributes. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3973–3983, Florence, Italy. Association for Computational Linguistics. +Maxwell Forbes and Yejin Choi. 2017. Verb physics: Relative physical knowledge of actions and objects. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 266-276, Vancouver, Canada. Association for Computational Linguistics. +Jonathan Gordon and Benjamin Van Durme. 2013. Reporting bias and knowledge acquisition. In Proceedings of the 2013 workshop on Automated knowledge base construction, pages 25-30. +Dirk Hovy and Diyi Yang. 2021. The importance of modeling social factors of language: Theory and practice. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 588-602, Online. Association for Computational Linguistics. +Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. 2020. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423-438. +Fangyu Liu, Emanuele Bugliarello, Edoardo Maria Ponti, Siva Reddy, Nigel Collier, and Desmond Eliott. 2021. Visually grounded reasoning across languages and cultures. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 10467-10485, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +AL López. 2015. Infographic: A world of languages and how many speak them. retrieved november 8, 2015. +Brian McMahan and Matthew Stone. 2015. A Bayesian model of grounded color semantics. Transactions of the Association for Computational Linguistics, 3:103-115. +Juliana Miehle, Koichiro Yoshino, Louisa Pragst, Stefan Ultes, Satoshi Nakamura, and Wolfgang Minker. 2016. Cultural communication idiosyncrasies in human-computer interaction. In Proceedings of the 17th Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 74-79, Los Angeles. Association for Computational Linguistics. + +Aakanksha Naik, Abhilasha Ravichander, Carolyn Rose, and Eduard Hovy. 2019. Exploring numeracy in word embeddings. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3374-3380, Florence, Italy. Association for Computational Linguistics. +Qiang Ning, Zhili Feng, Hao Wu, and Dan Roth. 2018. Joint reasoning for temporal and causal relations. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2278-2288, Melbourne, Australia. Association for Computational Linguistics. +Ellie Pavlick, Matt Post, Ann Irvine, Dmitry Kachaev, and Chris Callison-Burch. 2014. The language demographics of Amazon Mechanical Turk. Transactions of the Association for Computational Linguistics, 2:79-92. +Lianhui Qin, Aditya Gupta, Shyam Upadhyay, Luheng He, Yejin Choi, and Manaal Faruqui. 2021. TIME-DIAL: Temporal commonsense reasoning in dialog. 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 7066-7076, Online. Association for Computational Linguistics. +Ehud Reiter and Somayajulu Sripada. 2002. Squibs and discussions: Human variation and lexical choice. Computational Linguistics, 28(4):545-553. +Deb Roy and Ehud Reiter. 2005. Connecting language to the world. Artificial Intelligence, 167(1):1-12. Connecting Language to the World. +Chaitanya Shivade, Marie-Catherine de Marneffe, Eric Fosler-Lussier, and Albert M. Lai. 2016. Identification, characterization, and grounding of gradable terms in clinical text. In Proceedings of the 15th Workshop on Biomedical Natural Language Processing, pages 17-26, Berlin, Germany. Association for Computational Linguistics. +Vered Shwartz and Yejin Choi. 2020. Do neural language models overcome reporting bias? In Proceedings of the 28th International Conference on Computational Linguistics, pages 6863-6870, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. Conceptnet 5.5: An open multilingual graph of general knowledge. In *Thirty-first AAAI conference on artificial intelligence*. +Jannik Strötgen and Michael Gertz. 2010. HeidelTime: High quality rule-based extraction and normalization of temporal expressions. In Proceedings of the 5th International Workshop on Semantic Evaluation, pages 321-324, Uppsala, Sweden. Association for Computational Linguistics. + +Niket Tandon, Gerard De Melo, and Gerhard Weikum. 2014. Acquiring comparative commonsense knowledge from the web. In Twenty-Eighth AAAI Conference on Artificial Intelligence. +Kaitlyn Teske. 2017. Duolingo. calico journal, 34(3):393-401. +Avijit Thawani, Jay Pujara, Filip Ilievski, and Pedro Szekely. 2021. Representing numbers in NLP: a survey and a vision. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 644-656, Online. Association for Computational Linguistics. +Shivin Thukral, Kunal Kukreja, and Christian Kavouras. 2021. Probing language models for understanding of temporal expressions. In Blackbox NLP workshop. +Siddharth Vashishtha, Benjamin Van Durme, and Aaron Steven White. 2019. Fine-grained temporal relation extraction. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2906-2919, Florence, Italy. Association for Computational Linguistics. +David Vilares and Carlos Gomez-Rodriguez. 2018. Grounding the semantics of part-of-day nouns worldwide using Twitter. In Proceedings of the Second Workshop on Computational Modeling of People's Opinions, Personality, and Emotions in Social Media, pages 123-128, New Orleans, Louisiana, USA. Association for Computational Linguistics. +Olivia J Walch, Amy Cochran, and Daniel B Forger. 2016. A global quantification of "normal" sleep schedules using smartphone data. Science advances, 2(5):e1501705. +Jason Weston, Antoine Bordes, Sumit Chopra, Alexander M Rush, Bart van Merrienboer, Armand Joulin, and Tomas Mikolov. 2015. Towards ai-complete question answering: A set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698. +Shijie Wu and Mark Dredze. 2019. Beto, bentz, becas: The surprising cross-lingual effectiveness of BERT. 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 833–844, Hong Kong, China. Association for Computational Linguistics. +Shijie Wu and Mark Dredze. 2020. Are all languages created equal in multilingual BERT? In Proceedings of the 5th Workshop on Representation Learning for NLP, pages 120-130, Online. Association for Computational Linguistics. +Da Yin, Liunian Harold Li, Ziniu Hu, Nanyun Peng, and Kai-Wei Chang. 2021. Broaden the vision: Geodiverse visual commonsense reasoning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 2115-2129, + +Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Li Zhang, Qing Lyu, and Chris Callison-Burch. 2020. Reasoning about goals, steps, and temporal ordering with WikiHow. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4630-4639, Online. Association for Computational Linguistics. +Ben Zhou, Daniel Khashabi, Qiang Ning, and Dan Roth. 2019. "going on a vacation" takes longer than "going for a walk": A study of temporal commonsense understanding. 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 3363-3369, Hong Kong, China. Association for Computational Linguistics. +Ben Zhou, Qiang Ning, Daniel Khashabi, and Dan Roth. 2020. Temporal common sense acquisition with minimal supervision. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7579-7589, Online. Association for Computational Linguistics. +Ben Zhou, Kyle Richardson, Qiang Ning, Tushar Khot, Ashish Sabharwal, and Dan Roth. 2021. Temporal reasoning on implicit events from distant supervision. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1361-1371, Online. Association for Computational Linguistics. \ No newline at end of file diff --git a/goodnightat4pmtimeexpressionsindifferentcultures/images.zip b/goodnightat4pmtimeexpressionsindifferentcultures/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7f9941e7036f0837e2174e6323bff05615b4f19d --- /dev/null +++ b/goodnightat4pmtimeexpressionsindifferentcultures/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008e26f8269a674fbb15eefb595eb544bc778cdaa3f37d145ce0b204db5a2715 +size 600577 diff --git a/goodnightat4pmtimeexpressionsindifferentcultures/layout.json b/goodnightat4pmtimeexpressionsindifferentcultures/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6553f6f0ba75d473479d641cf949c9e52a05d006 --- /dev/null +++ b/goodnightat4pmtimeexpressionsindifferentcultures/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee1b54dd13e692b27aaec0401703ce35e96275135d53dd3b790f2c04abfc7425 +size 355548 diff --git a/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_content_list.json b/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8514b6ed8390f438a4729c47b9d2c2ffd004f624 --- /dev/null +++ b/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f69e163ee9f6a22f2568f42d9e54c67be98b2d3daf172c959d1f990fcf2f658 +size 88517 diff --git a/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_model.json b/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..44d32d6e447ee0480f6b420fc4a3bd6e74dae46a --- /dev/null +++ b/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b9a2beda4afb9e0795c6755a96398f0284eaa83c4b9b1010d2e9c52d86852c1 +size 111351 diff --git a/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_origin.pdf b/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8db048f1bda43dbe3992a32eafcca009ac1933a8 --- /dev/null +++ b/graphneuralnetworksformultiparallelwordalignment/3a39e1a1-d86d-45ff-80bf-72aa765159f4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79448a5724fabbb2cc86350ffe83020e947b545104c8a244c1773ce7b0063a0b +size 823225 diff --git a/graphneuralnetworksformultiparallelwordalignment/full.md b/graphneuralnetworksformultiparallelwordalignment/full.md new file mode 100644 index 0000000000000000000000000000000000000000..13926ef7fe80b92ef58fc919308a194cdd233eba --- /dev/null +++ b/graphneuralnetworksformultiparallelwordalignment/full.md @@ -0,0 +1,357 @@ +# Graph Neural Networks for Multiparallel Word Alignment + +Ayyoob Imani1, Lütfi Kerem Şenel1, Masoud Jalili Sabet1, François Yvon2, Hinrich Schütze1 + +1Center for Information and Language Processing (CIS), LMU Munich, Germany + +2Université Paris-Saclay, CNRS, LIsN, France + +{ayyoob, masoud, lksenel}@cis.lmu.de, + +francois.yvon@limsi.fr + +# Abstract + +After a period of decrease, interest in word alignments is increasing again for their usefulness in domains such as typological research, cross-lingual annotation projection and machine translation. Generally, alignment algorithms only use bitext and do not make use of the fact that many parallel corpora are multiparallel. Here, we compute high-quality word alignments between multiple language pairs by considering all language pairs together. First, we create a multiparallel word alignment graph, joining all bilingual word alignment pairs in one graph. Next, we use graph neural networks (GNNs) to exploit the graph structure. Our GNN approach (i) utilizes information about the meaning, position and language of the input words, (ii) incorporates information from multiple parallel sentences, (iii) adds and removes edges from the initial alignments, and (iv) yields a prediction model that can generalize beyond the training sentences. We show that community detection provides valuable information for multiparallel word alignment. Our method outperforms previous work on three word alignment datasets and on a downstream task. + +# 1 Introduction + +Word alignments are crucial for statistical machine translation (Koehn et al., 2003) and useful for many other multilingual tasks such as neural machine translation (Alkhouli and Ney, 2017; Alkhouli et al., 2016), typological analysis (Lewis and Xia, 2008; Ostling, 2015; Asgari and Schütze, 2017) and annotation projection (Yarowsky and Ngai, 2001; Fossum and Abney, 2005; Wisniewski et al., 2014; Huck et al., 2019). The rise of deep learning initially led to a temporary plateau, but interest in word alignments is now increasing, demonstrated by several recent publications (Jalili Sabet et al., 2020; Chen et al., 2020; Dou and Neubig, 2021). + +While word alignment is usually considered for bilingual corpora, our work addresses the problem + +![](images/909403a4bab4a0768e7d9b563e2b0c6b70272ece349246c8f2546deff138e93f.jpg) +Figure 1: Alignment graph for the verse "It will produce thorns and thistles for you, and you will eat the plants of the field." in a 12-way multiparallel corpus. Colors represent languages. Each English (yellow) node is annotated with its word. Red dashed lines cut links that incorrectly connect distinct concepts. We exploit community detection algorithms to detect distinct concepts. This provides valuable information for our GNN model and improves word alignments. + +of word alignment in multiparallel corpora, containing sentence level parallel text in more than two languages. Examples of multiparallel corpora are JW300 (Agić and Vulić, 2019), PBC (Mayer and Cysouw, 2014) which covers the highest number of languages (1334), and Tatoeba. While the per-language amount of data provided in such corpora is less than bilingual corpora, they support highly low-resource languages, many of which are not covered by existing language technologies (Joshi et al., 2020). Therefore, these corpora are essential for studying many of the world's low-resource languages. + +We consider the task of word alignment for multiparallel sentences. The basic motivation is that the alignment between words in languages $U$ and + +$V$ can benefit from word-level alignments of $U$ and $V$ with a translation in a third language $W$ . Following up on the work of Imani Googhari et al. (2021), we model multilingual word alignments with tools borrowed from graph theory (community detection algorithms) combined with neural network based models, specifically, the graph neural network (GNN) model of Scarselli et al. (2009). + +GNNs were proposed to extend the powerful current generation of neural network models to the processing of graph-structured data and they have gained increasing popularity in many domains (Wu et al., 2020; Sanchez-Gonzalez et al., 2018; He et al., 2020). GNNs can incorporate heterogeneous sources of signal in the form of node and edge features. We use this property to take into account properties of the whole alignment graph, notably its tendency to cluster into communities, see Figure 1. + +With our new proposed methods, we obtain improved results on word alignment for three language pairs: English-French, Finnish-Hebrew and Finnish-Greek. As a demonstration of the importance of high-quality alignments, we use our word alignments to project annotations from high-resource to low-resource languages. We improve a part-of-speech tagger for Yoruba by training it over a high-quality dataset, which is created using annotation projection. + +Contributions: i) We propose a graph neural network model to enhance word alignments in a multiparallel corpus. The model incorporates a diverse set of features for word alignments in multiparallel corpora and an elegant way of training it efficiently and effectively. ii) We show that community detection improves multiparallel word alignment. iii) We show that the improved alignments improve performance on a downstream task for a low resource language. iv) We propose a new method to infer alignments from the alignment probability matrix. v) We will make our code publicly available. + +# 2 MultiParallel Word Alignment Graphs + +# 2.1 Building MultiParallel Word Alignment Graphs + +Our starting point is the work of Imani Googhari et al. (2021), who introduce MPWA (MultiParallel Word Alignment), a framework that utilizes the synergy between multiple language pairs to improve bilingual word alignments for a target language pair. The rationale is that some of the missing alignment + +edges between a source and a target language can be recovered using their alignments with words in other languages. + +An MPWA graph is constructed using the following two steps: + +1. create initial bilingual alignments for all language pairs in a multiparallel corpus using a bilingual word aligner; +2. represent the bilingual alignments for each multiparallel sentence in a graph containing one vertex for each token occurring in any language and one edge for each initial bilingual word alignment link. + +Potentially missing alignment links are then added based on the graph structure in an inference step, casting the word alignment task as an edge prediction problem. Figure 1 gives an example of a multiparallel word alignment graph for a 12-way multiparallel sentence. + +Imani Googhari et al. (2021) use two traditional graph algorithms, Adamic-Adar and non-negative matrix factorization, for predicting new alignment edges from the MPWA graph. However, these graph algorithms are applied to individual multiparallel sentences independently and therefore cannot accumulate knowledge from multiple sentences. Moreover, their edge predictions are solely based on the structure of the graph and do not take advantage of other beneficial signals such as a word's language, relative position and meaning. Another limitation of this work is that it only adds links and does not remove any, which is important to improve precision. + +This work addresses these shortcomings by using GNNs to predict alignment edges from MPWA graphs. + +# 2.2 Community Detection in Alignment Graphs + +One important advantage of GNNs over traditional graph algorithms is that they can directly incorporate signals from different sources in the form of node and edge features. We utilize this by taking into account the following observation: The nodes in the alignment graph are words in parallel sentences that are translations of each other. If the initial bilingual alignments are of good quality, we expect words that are mutual translations to form densely connected regions or communities; see Figure 1. These communities should not be + +linked to each other, each corresponding to a distinct connected component. In other words, ideally, words representing a concept should be densely connected, but there should be no links between different concepts. While, this intuition will not be true for all concepts between all possible language pairs, we nonetheless hypothesize that identifying distinct concepts in a multiparallel word alignment graph can provide useful information. + +To examine to what extent these expectations are met, we count the components in the original Eflomal-generated (Östling and Tiedemann, 2016) graph (see §4.2 for details on the initial alignments). Table 1 shows that the average number of components per sentence is less than three ("Eflomal intersection", columns #CC). But intuitively, the number of components should roughly correspond to sentence length (or, more precisely, the number of content words). This indicates that there are many links that incorrectly connect different concepts. To detect such links, we use community detection (CD) algorithms. + +CD algorithms find subnetworks of nodes that form tightly knit groups that are only loosely connected with a small number of links (Girvan and Newman, 2002). One well-known approach to CD attempts to maximize the modularity measure (Newman and Girvan, 2004). Modularity assesses how beneficial a division of a community into two communities is, in the sense that there are many links within communities and only a few between them. Given a graph $G$ with $n$ nodes and $m$ edges and $G$ 's adjacency matrix $A \in \mathbb{R}^{n \times n}$ , modularity is defined as: + +$$ +m o d = \frac {1}{2 m} \sum_ {i j} \left(A _ {i j} - \gamma \frac {d _ {i} d _ {j}}{2 m}\right) I \left(c _ {i}, c _ {j}\right) \tag {1} +$$ + +where $d_{i}$ is the degree of node $i$ . $I(c_{i},c_{j})$ is 1 if nodes $i$ and $j$ are in the same community, 0 otherwise. + +As exact modularity maximization is intractable, we experiment with two CD algorithms implementing different heuristic approaches: + +- Greedy modularity communities (GMC). This method uses Clauset-Newman-Moore greedy modularity maximization (Clauset et al., 2004). GMC begins with each node in its own community and greedily joins the pair of communities that most increases modularity until no such pair exists. + +
FIN-HEBFIN-GRCENG-FRA
#CCF1#CCF1#CCF1
Eflomal intersection2.20.4041.60.6462.20.678
GMC13.70.39610.10.37513.50.411
LPC41.50.71337.10.75446.00.767
Sentence length25.723.227.4
+ +Table 1: Effect of community detection algorithms (GMC and LPC) on alignment prediction. #CC: average number of connected components. $F_{1}$ : word alignment performance. + +- Label propagation communities (LPC). This method finds communities in a graph using label propagation (Cordasco and Gargano, 2010). It begins by giving a label to each node of the network. Then each node's label is updated by the most frequent label among its neighbors in each iteration. It performs label propagation on a portion of nodes at each step and quickly converges to a stable labeling. + +After detecting communities, we link all nodes inside a community and remove all intercommunity links. GMC (LPC) on average removes $3\%$ $(7\%)$ of the edges. Table 1 reports the average number of graph components per sentence before and after running GMC and LPC, as well as the corresponding $F_{1}$ for word alignment (see §4.1 for details on the evaluation datasets). We see that the number of communities found is lower for GMC than for LPC; therefore, LPC identifies more candidate links for deletion. Comparing the number of communities detected with the average sentence length, GMC seems to have failed to detect enough communities to split different concepts properly. The $F_{1}$ scores confirm this observation and show that LPC performs well at detecting the communities we are looking for. + +This analysis shows that CD algorithms compute valuable information for word alignments. To exploit this in our GNN model, we add node community information as a node feature; see §3.1.3. + +# 3 Predicting and using MultiParallel Word Alignments (MPWAs) + +# 3.1 GNNs for MPWA + +GNNs can be used in transductive or inductive settings. Transductively, the final model can only be + +used for inference over the same graph that it is trained on. In an inductive setting, which we use here, nodes are represented as feature vectors, and the final model has the advantage of being applicable to a different graph in inference. + +Below is the step-by-step overview of our GNN-based approach for an MPWA graph: + +1. run community detection algorithms on the initial graph (§2.2); +2. obtain features for the nodes of the graph (§3.1.3); +3. compute node embeddings from node features and initial alignment links in the GNN encoding step (§3.1.2); +4. learn to distinguish between nodes that are aligned together and that are not aligned together in the GNN decoding step (§3.1.2); + +After the GNN model is trained on multiple MPWA graphs, it is used to infer an alignment probability matrix between tokens in a source language and tokens in a target language for a multiparallel sentence, see §3.1.4. Our method predicts new alignment links from this matrix, independently of initial edges. Therefore, given an initial bilingual alignment, it is not limited to adding edges, but it can also remove them. + +# 3.1.1 Model Architecture + +Our model is inspired by the Graph Auto Encoder (GAE) model of Kipf and Welling (2016) for link prediction. A GAE model consists of an encoder and a decoder. The encoder creates a hidden representation for each node of the graph and the decoder predicts the links of the graph given the nodes' representations. Using the graph of word alignments, the model will learn the word alignment task. Therefore it will be able to predict word alignments that are missed by the original bilingual word aligner and also detect incorrect alignment edges. + +We make changes to this model to improve the model's quality and reduce its computational cost. We use GATConv layers (Velicković et al., 2018) for the encoder instead of GCNConv (Kipf and Welling, 2017) and a more sophisticated decoder instead of simple dot product for a stronger model. We also introduce a more efficient training procedure. + +The encoder is a graph attention network (GAT) (Velicković et al., 2018) with two GATConv layers followed by a fully connected layer. Layers are connected by RELU non-linearities. A GATConv layer computes its output $\mathbf{x}_i^{\prime}$ for a node $i$ from its input $\mathbf{x}_i$ as + +$$ +\mathbf {x} _ {i} ^ {\prime} = \alpha_ {i, i} \mathbf {W} \mathbf {x} _ {i} + \sum_ {j \in \mathcal {N} (i)} \alpha_ {i, j} \mathbf {W} \mathbf {x} _ {j}, \tag {2} +$$ + +where $\mathbf{W}$ is a weight matrix, $\mathcal{N}(i)$ is some neighborhood of node $i$ in the graph, and $\alpha_{i,j}$ is the attention coefficient indicating the importance of node $j$ 's features to node $i$ . $\alpha_{i,j}$ is computed as + +$$ +\alpha_ {i, j} = \frac {\exp \left(\mathrm {g} \left(\mathbf {a} ^ {\top} \left[ \mathbf {W x} _ {i} \parallel \mathbf {W x} _ {j} \right]\right)\right)}{\sum_ {k \in \mathcal {N} (i) \cup \{i \}} \exp \left(\mathrm {g} \left(\mathbf {a} ^ {\top} \left[ \mathbf {W x} _ {i} \parallel \mathbf {W x} _ {k} \right]\right)\right)} \tag {3} +$$ + +where $\parallel$ is concatenation, $g$ is LeakyReLU, and $\mathbf{a}$ is a weight vector. Given the features for the nodes and their alignment edges, the encoder creates a contextualized hidden representation for each node. + +Based on the hidden representations of two nodes, the decoder predicts whether a link connects them. The decoder architecture consists of a fully connected layer, a RELU non-linearity and a sigmoid layer. + +# 3.1.2 Training + +By default, GAE models are trained using full batches with random negative samples. This approach requires at least tens of epochs over the training dataset to converge and a lot of GPU memory for graphs as large as ours. We train our model using mini-batches to decrease memory requirements and improve the performance. Using our training approach the model converges after one epoch. We take care to select informative negative samples (as opposed to random selection) as described below. + +Figure 2 displays our GNN model and the training process. The training set contains one graph for each sentence. Each graph is divided into multiple batches. Each batch contains a random subset of the graph's edges as positive samples. The negative samples are created as follows. Given a sentence $u_{1}u_{2}\ldots u_{n}$ in language $U$ and its translation $v_{1}v_{2}\ldots v_{m}$ in language $V$ , for each alignment edge $u_{i}:v_{j}$ in the current batch, two negative edges $u_{i}:v_{j}'$ and $u_{i}':v_{j}$ ( $j' \neq j$ , $i' \neq i$ ) are randomly sampled. + +For each training batch, the encoder takes the batch's whole graph (i.e., node features for all + +![](images/d66940cb7b68a825a7f2ab89e1a104fd928fd114f86e9578d5d978a3e8cc1763.jpg) +Figure 2: GNN training. At each training step, node features and links of a multiparallel sentence are fed to a graph attention network (GAT) that creates hidden representations for all nodes. On the decoder side, at each step, one batch of alignment links and hidden node representations is used to create positive and negative samples, which are then processed and classified by a multi-layer perceptron (MLP). Parameters of GAT and MLP are updated for each batch. $\mathrm{FC} =$ fully connected. + +graph nodes and all graph edges) as input and computes hidden representations for the nodes. On the decoder side, for each link between two nodes in the batch, the hidden representations of the two nodes are concatenated to create the decoder's input. The decoder's target is the link class: 1 (resp. 0) for positive (resp. negative) links. We train with a binary classification objective: + +$$ +\mathcal {L} = - \frac {1}{b} \sum_ {i = 1} ^ {b} \log \left(p _ {i} ^ {+}\right) + \frac {1}{2 b} \sum_ {i = 1} ^ {2 b} \log \left(p _ {i} ^ {-}\right) \tag {4} +$$ + +where $b$ is the batch size and $p_i^+$ and $p_i^-$ are the model predictions for the $i^{th}$ positive and negative samples within the batch. Parameters of the encoder and decoder as well as the node-embedding feature layer are updated after each training step. + +# 3.1.3 Node Features + +We use three main types of node features: (i) graph structural features, (ii) community-based features and (iii) word content features. + +Graph structural features. We use degree, closeness (Freeman, 1978), betweenness (Brandes, 2001), load (Newman, 2001) and harmonic centrality (Boldi and Vigna, 2014) features as additional information about the graph structure. These features are continuous numbers, providing information about the position and connectivity of the nodes within the graph. We standardize (i.e., z-score) each feature across all nodes, and train an embedding of size four for each feature.3 + +Community-based features. One way to incorporate community information into our model is to + +train the model based on a refined set of edges after the community detection step. This approach hobbles the GNN model by making decisions about many of the edges before the GNN gets to see them. Our initial experiments also confirmed that training the GNN over CD refined edges does not help. Therefore, we add community information as node features and let the GNN use them to improve its decisions. We use the community detection algorithms GMC and LPC (see §§2.2) to identify communities in the graph. Then we represent the community membership information of the nodes as one-hot vectors and learn an embedding of size 32 for each of the two algorithms. + +Word content features. We train embeddings for word position (size 32) and word language (size 20). We learn 100-dimensional multilingual word embeddings using Levy et al. (2017)'s sentenceID method on the 84 PBC languages selected by Imani Googhari et al. (2021). Word embeddings serve as initialization and are updated during GNN training. + +After concatenating these features, each node is represented by a 236 dimensional vector that is then fed to the encoder. + +# 3.1.4 Inducing Bilingual Alignment Edges + +Given a source sentence $\hat{x} = x_{1},x_{2},\ldots ,x_{m}$ in language $X$ and a target sentence $\hat{y} = y_{1},y_{2},\ldots ,y_{l}$ in language $Y$ , we feed all possible alignment links between source and target to the decoder. This produces a symmetric alignment probability matrix $S$ of size $m\times l$ where $S_{ij}$ is the predicted alignment probability between words $x_{i}$ and $y_{j}$ . Using these values directly to infer alignment edges is usually suboptimal; therefore, more sophisticated methods + +have been suggested (Ayan and Dorr, 2006; Liang et al., 2006). Here we propose a new approach: it combines Koehn et al. (2005)'s Grow-Diag-Final-And (GDFA) with Dou and Neubig (2021)'s probability thresholding. We modify the latter to account for the variable size of the probability matrix (i.e., length of source/target sentences). Our method is not limited to adding new edges to some initial bilingual alignments, a limitation of prior work. As we predict each edge independently, some initial links can be discarded from the final alignment. + +We start by creating a set of forward (source-to-target) alignment edges and a set of backward (target-to-source) alignment edges. To this end, first, inspired by probability thresholding (Dou and Neubig, 2021), we apply softmax to $S$ , and zero out probabilities below a threshold to get a source-to-target probability matrix $S^{XY}$ : + +$$ +S ^ {X Y} = S * \left(\operatorname {s o f t m a x} (S) > \frac {\alpha}{l}\right) \tag {5} +$$ + +Analogously, we compute the target-to-source probability matrix $S^{YX}$ : + +$$ +S ^ {Y X} = S ^ {\top} * \left(\operatorname {s o f t m a x} \left(S ^ {\top}\right) > \frac {\alpha}{m}\right) \tag {6} +$$ + +where $\alpha$ is a sensitivity hyperparameter, e.g., $\alpha = 1$ means that we pick edges with a probability higher than average. We experimentally set $\alpha = 2$ . Next, from each row of $S^{XY}$ ( $S^{YX}$ ), we pick the cell with the highest value (if any exists) and add this edge to the forward (backward) set. + +We create the final set of alignment edges by applying the GDFA symmetrization method (Koehn et al., 2005) to forward and backward sets. The gist of GDFA is to use the intersection of forward and backward as initial alignment edges and add more edges from the union of forward and backward based on a number of heuristics. We call this method TGDFA (Thresholding GDFA). + +We also experiment with combining TGDFA with the original bilingual GDFA alignments. We do so by adding bilingual GDFA edges to the union of forward and backward before performing the GDFA heuristics. We refer to these alignments as TGDFA+orig. + +We evaluate the resulting alignments using $F_{1}$ score and alignment error rate (AER), the standard metrics in the word alignment literature. + +# 3.2 Annotation Projection + +Annotation projection automatically creates linguistically annotated corpora for low-resource lan + +guages. A model trained on data with "annotation-projected" labels can perform better than a completely unsupervised method. Here, we focus on universal part-of-speech (UPOS) tagging (Petrov et al., 2012) for the low resource target language Yoruba; this language only has a small set of annotated sentences in Universal Dependencies (Nivre et al., 2020) and has poor POS results in unsupervised settings (Kondratyuk and Straka, 2019). + +The quality of the target annotated corpus depends on the quality of the annotations in the source languages and the quality of the word alignments between sources and target. We use the Flair (Akbik et al., 2019) POS taggers for three high resource languages, English, German and French (Akbik et al., 2018), to annotate 30K verses whose Yoruba translations are available in PBC. We then transfer the POS tags from source to target using three different approaches: (i) We directly transfer annotations from English to the target. (ii) For each word in the target, we get its Eflomal bilingual alignments in the three source languages and predict the majority POS to annotate the target word. (iii) The same as in (ii), but we use our GNN (TGDFA) alignments (instead of Eflomal alignments) to project from source to target. In all three approaches, we discard any target sentence from the POS tagger training data if more than $50\%$ of its words are annotated with the "X" (other) tag. + +We train a Flair SequenceTagger model on the target annotated data using mBERT embeddings (Devlin et al., 2019) and evaluate on Yoruba test from Universal Dependencies. + +# 4 Experimental Setup + +# 4.1 Word Alignment Datasets + +Following Imani Googhari et al. (2021), we use PBC, a multiparallel corpus of 1758 sentence-aligned editions of the Bible in 1334 languages. + +Evaluation data. For our main evaluation, we use the two word alignment gold datasets for PBC published by Imani Googhari et al. (2021): Blinker (Melamed, 1998) and HELFI (Yli-Jyrä et al., 2020). The HELFI dataset contains the Hebrew Bible, Greek New Testament and their translations into Finnish. For HELFI, we use Imani Googhari et al. (2021)'s train/dev/test splits. The Blinker dataset provides word level alignments between English and French for 250 Bible verses. + +
MethodFIN-HEBFIN-GRCENG-FRA
Prec.Rec.F1AERPrec.Rec.F1AERPrec.Rec.F1AER
Eflomal (intersection)0.8180.2690.4050.5950.8970.5060.6470.3530.9710.5210.6780.261
Eflomal (GDFA)0.5080.4480.4760.5240.7330.6710.7010.3000.8560.7100.7760.221
WAdAd (intersection)0.7810.6120.6860.3140.8490.6960.7650.2350.9380.6890.7940.203
NMF (intersection)0.7800.5760.6630.3370.8640.6690.7540.2480.9480.6240.7530.245
WAdAd (GDFA)0.5460.6930.6110.3890.7070.7830.7430.2570.8310.7960.8130.186
NMF (GDFA)0.5480.6460.5930.4070.7200.7590.7390.2610.8440.7670.8040.195
GNN (TGDFA)0.8110.6480.7200.2800.8450.7240.7800.2200.9260.7110.8040.192
GNN (TGDFA+orig)0.6220.6830.6510.3490.7380.7800.7580.2420.8630.7890.8240.174
+ +Table 2: Word alignment results on PBC for GNN and baselines. The best result in each column is in bold. GNN outperforms the baselines as well as the graph algorithms WAdAd and NMF on $F_{1}$ and AER. + +Training data. The graph algorithms used by Imani Googhari et al. (2021) operate on each multiparallel sentence separately. In contrast, our approach allows for an inductive setting where a model is trained on a training set, accumulating knowledge from multiple multiparallel sentences. We combine the verses in the training sets of Finnish-Hebrew and Finnish-Greek for a combined training set size of 24,159. + +# 4.2 Initial Word Alignments + +We use the Eflomal statistical word aligner to obtain bilingual alignments. We train it for every language pair in our experiments. We do not consider SimAlign (Jalili Sabet et al., 2020) since it is shown to perform poorly for languages whose representations in the multilingual pretrained language model are of low quality. We use Eflomal asymmetrical alignments post-processed with the intersection heuristic to get high precision bilingual alignments as input to the GNN. We use the same subset of 84 languages as Imani Googhari et al. (2021). + +# 4.3 Training Details + +We use PyTorch Geometric $^6$ to construct and train the GNN. The model's hidden layer size is 512 for both GATConv and Linear layers. We train for one epoch on the training set - a small portion of the training set is enough to learn good embeddings (see §5.1.1). For training, we use a batch size of 400 and learning rate of .001 with AdamW (Loshchilov and Hutter, 2017). The whole training + +process takes less than 4 hours on a GeForce GTX 1080 Ti and the inference time is on the order of milliseconds per sentence. + +# 5 Experiments and Results + +# 5.1 Multiparallel corpus results + +Table 2 shows results on Blinker and HELFI for our GNNs and the baselines: bilingual alignments and two graph-based algorithms WAdAd and NMF from Imani Googhari et al. (2021). Our GNNs yield a better trade-off between precision and recall, most likely thanks to their ability to remove edges, and achieve the best $F_{1}$ and AER on all three datasets, outperforming WAdAd and NMF. + +GNN (TGDFA) achieves the best results on HELFI (FIN-HEB, FIN-GRC) while GNN (TGDFA+orig) is best on Blinker (ENG-FRA). As argued in Imani Googhari et al. (2021), this is mostly due to the different ways these two datasets were annotated. Most HELFI alignments are one-to-one, while many Blinker alignments are many-to-many: phrase-level alignments where every word in a source phrase is aligned with every word in a target phrase. This suggests that one can choose between GNN (TGDFA) and GNN (TGDFA+orig) based on the desired characteristics of the alignment. + +# 5.1.1 Effect of Training Set Size + +To investigate the effect of training set size, we train the GNN on subsets of our training data with increasing sizes. Figure 3 shows results. Performance improves fast until around 2,000 verses; then it stays mostly constant. Using more than 6,400 samples does not change the performance at all. Therefore, in the other experiments we use 6,400 randomly sampled verses from the training set to train GNNs. + +![](images/e55d7b69018de03814a200e80619083911301af98c04a407b107f7a057ec588f.jpg) +Figure 3: $F_{1}$ of GNN (TGDFA) and GNN (TGDFA+orig) on Blinker as a function of train size + +# 5.1.2 Ablation Experiments + +To examine the importance of node features, we ablate language, position, centrality, community and word embedding features. Table 3 shows that removal of graph structural features drastically reduces performance. Community features and language information are also important. Removal of word position information and word embeddings – which store semantic information about words – has the least effect. Based on these results, it can be argued that the lexical information contained in the initial alignments and in the community features provides a strong signal regarding word relatedness. The novel information that is crucial is about the overall graph structure which goes beyond the local word associations that are captured by word position and word embeddings. + +# 5.1.3 Effect of Word Frequency + +We investigate the effect of word frequency on alignment performance where frequency is calculated based on the source word in the PBC; the first bin has the highest frequency. Figure 4 shows that the performance of Eflomal drops with frequency and it struggles to align very rare words. In contrast, GNN is not affected by word frequency as severely and its performance gains are even greater for rare words. WAdad which is the multilingual baseline from (Imani Googhari et al., 2021) has the same trend as the GNN method, but the GNN method is more robust. + +# 5.2 Annotation Projection + +Table 4 presents accuracies for POS tagging in Yoruba. Unsupervised baseline performance is + +![](images/7ff03f0bb8600c9bc62f1e8c950dc1c335d06d87e7d9a2b117f33a4c30a9d57e.jpg) +Figure 4: $F_{1}$ for different frequency bins. + +
FIN-HEBFIN-GRCENG-FRA
GNN (TGDFA)0.7200.7800.804
¬ language-0.323-0.280-0.370
¬ position-0.068-0.045-0.066
¬ centrality-0.636-0.730-0.772
¬ community-0.204-0.238-0.253
¬ word-embedding-0.139-0.103-0.129
GNN (TGDFA+orig)0.6510.7580.824
¬ language-0.238-0.077-0.162
¬ position-0.088+0.029-0.032
¬ centrality-0.556-0.530-0.617
¬ community-0.156-0.039-0.083
¬ word-embedding-0.135+0.002-0.058
+ +Table 3: $F_{1}$ for GNNs and $\Delta F_{1}$ for five ablations + +50.86%. Supervised training using pseudo-labels mostly outperforms the unsupervised baseline. Projecting the majority POS labels to Yoruba improves over projecting English labels. Using the GNN model to project labels works best and outperforms Eflomal-GDFA-majority (resp. the unsupervised baseline) by $5\%$ (resp. $15\%$ ) absolute improvement. + +# 6 Related Work + +Bilingual Word Aligners. Much work on bilingual word alignment is based on probabilistic models, mostly implementing variants of the IBM models of Brown et al. (1993): e.g., Giza++ (Och and Ney, 2003), fast-align (Dyer et al., 2013) and Eflomal (Östling and Tiedemann, 2016). More recent work, including SimAlign (Jalili Sabet et al., 2020) and SHIFT-ATT/SHIFT-AET (Chen et al., 2020), uses pretrained neural language and machine translation models. Although neural models achieve superior performance compared to statistical aligners, they can only be used for fewer than two hundred high-resource languages that are supported by multilingual language models like BERT (Devlin et al., 2019) and XLM-R (Conneau et al., 2020). This makes statistical models the only option for the majority of the world's languages. + +
ModelYoruba YTB
Unsupervised (Kondratyuk and Straka, 2019)50.86
Eflomal Inter – eng43.45
Eflomal GDFA – eng55.13
Eflomal Inter – majority54.13
Eflomal GDFA – majority60.27
GNN (TGDFA) – majority65.74
GNN (TGDFA+orig) – majority64.55
+ +Table 4: POS tagging with annotation projection for Yoruba. Apart from "Unsupervised", all lines show a sequence tagger trained on pseudo-labels induced by word alignments. GNN-based pseudo-labels outperform prior work by $5\%$ absolute. + +Multiparallel Corpora. Prior applications of using multiparallel corpora include reliable translations from small datasets (Cohn and Lapata, 2007), and phrase-based machine translation (PBMT) (Kumar et al., 2007). Multiparallel corpora are also used for language comparison (Mayer and Cysouw, 2012), typological studies (Östling, 2015; Asgari and Schütze, 2017) and PBMT (Nakov and Ng, 2012; Bertoldi et al., 2008; Dyer et al., 2013). ImaniGooghari et al. (2021) provide a tool to browse a word-aligned multiparallel corpus, which can be used for the comparative study of languages and for error analysis in machine translation. + +To the best of our knowledge Lardilleux and Lepage (2008) and Östling (2014)7 are the only word alignment methods designed for multiparallel corpora. However, the latter method is outperformed by Eflomal (Östling and Tiedemann, 2016), a bilingual method from the same author. Recently, Imani Googhari et al. (2021) proposed MPWA, which we use as our baseline. + +Graph Neural Networks (GNNs) have been used to address many problems that are inherently graph-like such as traffic networks, social networks, and physical and biological systems (Liu and Zhou, 2020). GNNs achieve impressive performance in many domains, including social networks (Wu et al., 2020) and natural science (Sanchez-Gonzalez et al., 2018) as well as NLP tasks like sentence classification (Huang et al., 2020), question generation (Pan et al., 2020), summarization (Fernandes et al., 2019) and derivational morphology (Hofmann et al., 2020). + +# 7 Conclusion and Future Work + +We introduced graph neural networks and community detection algorithms for multiparallel word alignment. By incorporating signals from diverse sources as node features, including community features, our GNN model outperformed the baselines and prior work, establishing new state-of-the-art results on three PBC gold standard datasets. We also showed that our GNN model improves downstream task performance in low-resource languages through annotation projection. + +We have only used node features to provide signals to GNNs. In the future, other signals can be added in the form of edge features to further boost the performance. + +# References + +Zeljko Agić and Ivan Vulić. 2019. Jw300: A wide-coverage parallel corpus for low-resource languages. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3204-3210. +Alan Akbik, Tanja Bergmann, Duncan Blythe, Kashif Rasul, Stefan Schweter, and Roland Vollgraf. 2019. FLAIR: An easy-to-use framework for state-of-the-art NLP. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations), pages 54-59, Minneapolis, Minnesota. Association for Computational Linguistics. +Alan Akbik, Duncan Blythe, and Roland Vollgraf. 2018. Contextual string embeddings for sequence labeling. In Proceedings of the 27th International Conference on Computational Linguistics, pages 1638-1649, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Tamer Alkhouli, Gabriel Bretschner, Jan-Thorsten Peter, Mohammed Hethnawi, Andreas Guta, and Hermann Ney. 2016. Alignment-based neural machine translation. In Proceedings of the First Conference on Machine Translation: Volume 1, Research Papers, pages 54-65, Berlin, Germany. Association for Computational Linguistics. +Tamer Alkhouli and Hermann Ney. 2017. Biasing attention-based recurrent neural networks using external alignment information. In Proceedings of the Second Conference on Machine Translation, pages 108-117, Copenhagen, Denmark. Association for Computational Linguistics. +Ehsaneddin Asgari and Hinrich Schütze. 2017. Past, present, future: A computational investigation of the typology of tense in 1000 languages. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 113-124, + +Copenhagen, Denmark. Association for Computational Linguistics. +Necip Fazil Ayan and Bonnie J. Dorr. 2006. A maximum entropy approach to combining word alignments. In Proceedings of the Human Language Technology Conference of the NAACL, Main Conference, pages 96-103, New York City, USA. Association for Computational Linguistics. +Nicola Bertoldi, Madalina Barbaiani, Marcello Federico, and Roldano Cattoni. 2008. Phrase-based statistical machine translation with pivot languages. In International Workshop on Spoken Language Translation (IWSLT) 2008. +Paolo Boldi and Sebastiano Vigna. 2014. Axioms for centrality. _Internet Mathematics_, 10(3-4):222-262. +Ulrik Brandes. 2001. A faster algorithm for betweenness centrality. Journal of mathematical sociology, 25(2):163-177. +Peter F. Brown, Stephen A. Della Pietra, Vincent J. Della Pietra, and Robert L. Mercer. 1993. The mathematics of statistical machine translation: Parameter estimation. Computational Linguistics, 19(2):263-311. +Yun Chen, Yang Liu, Guanhua Chen, Xin Jiang, and Qun Liu. 2020. Accurate word alignment induction from neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 566-576, Online. Association for Computational Linguistics. +Aaron Clauset, Mark EJ Newman, and Christopher Moore. 2004. Finding community structure in very large networks. Physical review $E$ , 70(6):066111. +Trevor Cohn and Mirella Lapata. 2007. Machine translation by triangulation: Making effective use of multi-parallel corpora. In Proceedings of the 45th Annual Meeting of the Association of Computational Linguistics, pages 728-735, Prague, Czech Republic. Association for Computational Linguistics. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettle-moyer, and Veselin Stoyanov. 2020. Unsupervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8440-8451, Online. Association for Computational Linguistics. +Gennaro Cordasco and Luisa Gargano. 2010. Community detection via semi-synchronous label propagation algorithms. In 2010 IEEE international workshop on: business applications of social network analysis (BASNA), pages 1-8. IEEE. +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. +Zi-Yi Dou and Graham Neubig. 2021. Word alignment by fine-tuning embeddings on parallel corpora. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2112-2128, Online. Association for Computational Linguistics. +Chris Dyer, Victor Chahuneau, and Noah A. Smith. 2013. A simple, fast, and effective reparameterization of IBM model 2. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 644-648, Atlanta, Georgia. Association for Computational Linguistics. +Patrick Fernandes, Miltiadis Allamanis, and Marc Brockschmidt. 2019. Structured neural summarization. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Victoria Fossum and Steven Abney. 2005. Automatically inducing a part-of-speech tagger by projecting from multiple source languages across aligned corpora. In Second International Joint Conference on Natural Language Processing: Full Papers. +Linton C Freeman. 1978. Centrality in social networks conceptual clarification. Social networks, 1(3):215-239. +Michelle Girvan and Mark EJ Newman. 2002. Community structure in social and biological networks. Proceedings of the national academy of sciences, 99(12):7821-7826. +Xiangnan He, Kuan Deng, Xiang Wang, Yan Li, Yong-Dong Zhang, and Meng Wang. 2020. LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation, page 639-648. Association for Computing Machinery, New York, NY, USA. +Valentin Hofmann, Hinrich Schütze, and Janet B. Pierrehumbert. 2020. A graph auto-encoder model of derivational morphology. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 1127-1138. Association for Computational Linguistics. +Lianzhe Huang, Xin Sun, Sujian Li, Linhao Zhang, and Houfeng Wang. 2020. Syntax-aware graph attention network for aspect-level sentiment classification. In Proceedings of the 28th International Conference on Computational Linguistics, pages 799-810, Barcelona, Spain (Online). International Committee on Computational Linguistics. + +Matthias Huck, Diana Dutka, and Alexander Fraser. 2019. Cross-lingual annotation projection is effective for neural part-of-speech tagging. In Proceedings of the Sixth Workshop on NLP for Similar Languages, Varieties and Dialects, pages 223-233, Ann Arbor, Michigan. Association for Computational Linguistics. +Ayyoob Imani Googhari, Masoud Jalili Sabet, Lutfi Kerem Senel, Philipp Dufter, François Yvon, and Hinrich Schütze. 2021. Graph algorithms for multiparallel word alignment. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8457-8469, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Ayyoob ImaniGooghari, Masoud Jalili Sabet, Philipp Dufter, Michael Cysou, and Hinrich Schütze. 2021. ParCourE: A parallel corpus explorer for a massively multilingual corpus. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing: System Demonstrations, pages 63-72, Online. Association for Computational Linguistics. +Masoud Jalili Sabet, Philipp Dufter, François Yvon, and Hinrich Schütze. 2020. SimAlign: High quality word alignments without parallel training data using static and contextualized embeddings. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 1627-1643, Online. Association for Computational Linguistics. +Pratik Joshi, Sebastin Santy, Amar Budhiraja, Kalika Bali, and Monojit Choudhury. 2020. The state and fate of linguistic diversity and inclusion in the nlp world. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6282-6293. +Thomas N Kipf and Max Welling. 2016. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308. +Thomas N. Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR). +Philipp Koehn, Amittai Axelrod, Alexandra Birch, Chris Callison-Burch, Miles Osborne, and David Talbot. 2005. Edinburgh system description for the 2005 iwslt speech translation evaluation. International Workshop on Spoken Language Translation. +Philipp Koehn, Franz J Och, and Daniel Marcu. 2003. Statistical phrase-based translation. Technical report, University of Southern California Marina del Rey Information Sciences Inst. +Dan Kondratyuk and Milan Straka. 2019. 75 languages, 1 model: Parsing Universal Dependencies universally. 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 2779-2795, Hong Kong, China. Association for Computational Linguistics. +Shankar Kumar, Franz J. Och, and Wolfgang Macherey. 2007. Improving word alignment with bridge languages. In Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL), pages 42-50, Prague, Czech Republic. Association for Computational Linguistics. +Adrien Lardilleux and Yves Lepage. 2008. A truly multilingual, high coverage, accurate, yet simple, subsentential alignment method. In The 8th conference of the Association for Machine Translation in the Americas (AMTA 2008), pages 125-132. +Omer Levy, Anders Søgaard, and Yoav Goldberg. 2017. A strong baseline for learning cross-lingual word embeddings from sentence alignments. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 765-774, Valencia, Spain. Association for Computational Linguistics. +William D. Lewis and Fei Xia. 2008. Automatically identifying computationally relevant typological features. In Proceedings of the Third International Joint Conference on Natural Language Processing: Volume-II. +Percy Liang, Ben Taskar, and Dan Klein. 2006. Alignment by agreement. In Proceedings of the Human Language Technology Conference of the NAACL, Main Conference, pages 104-111, New York City, USA. Association for Computational Linguistics. +Zhiyuan Liu and Jie Zhou. 2020. Introduction to graph neural networks. Synthesis Lectures on Artificial Intelligence and Machine Learning, 14(2):1-127. +Ilya Loshchilov and Frank Hutter. 2017. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101. +Thomas Mayer and Michael Cysouw. 2012. Language comparison through sparse multilingual word alignment. In Proceedings of the EACL 2012 Joint Workshop of LINGVIS & UNCLH, pages 54-62, Avignon, France. Association for Computational Linguistics. +Thomas Mayer and Michael Cysouw. 2014. Creating a massively parallel bible corpus. In Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC'14), pages 3158-3163. +I. Dan Melamed. 1998. Manual annotation of translational equivalence: The Blinker project. CoRR, cmplg/9805005. + +Preslav Nakov and Hwee Tou Ng. 2012. Improving statistical machine translation for a resource-poor language using related resource-rich languages. Journal of Artificial Intelligence Research, 44:179-222. +Mark EJ Newman. 2001. Scientific collaboration networks. ii. shortest paths, weighted networks, and centrality. Physical review $E$ , 64(1):016132. +Mark EJ Newman and Michelle Girvan. 2004. Finding and evaluating community structure in networks. Physical review $E$ , 69(2):026113. +Joakim Nivre, Marie-Catherine de Marneffe, Filip Ginter, Jan Hajic, Christopher D. Manning, Sampo Pyysalo, Sebastian Schuster, Francis Tyers, and Daniel Zeman. 2020. Universal Dependencies v2: An evergrowing multilingual treebank collection. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 4034-4043, Marseille, France. European Language Resources Association. +Franz Josef Och and Hermann Ney. 2003. A systematic comparison of various statistical alignment models. Computational Linguistics, 29(1):19-51. +Robert Ostling. 2014. Bayesian word alignment for massively parallel texts. In Proceedings of the 14th Conference of the European Chapter of the Association for Computational Linguistics, volume 2: Short Papers, pages 123-127, Gothenburg, Sweden. Association for Computational Linguistics. +Robert Östling. 2015. Word order typology through multilingual word alignment. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 205-211, Beijing, China. Association for Computational Linguistics. +Robert Östling and Jörg Tiedemann. 2016. Efficient word alignment with Markov Chain Monte Carlo. The Prague Bulletin of Mathematical Linguistics, 106(1). +Liangming Pan, Yuxi Xie, Yansong Feng, Tat-Seng Chua, and Min-Yen Kan. 2020. Semantic graphs for generating deep questions. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1463-1475, Online. Association for Computational Linguistics. +Slav Petrov, Dipanjan Das, and Ryan McDonald. 2012. A universal part-of-speech tagset. In Proceedings of the Eighth International Conference on Language Resources and Evaluation (LREC'12), pages 2089-2096, Istanbul, Turkey. European Language Resources Association (ELRA). +Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. 2018. Graph networks as learnable physics engines for inference and control. In Proceedings of the 35th International + +Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 4470-4479. PMLR. +Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. 2009. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61-80. +Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. 2018. Graph attention networks. In International Conference on Learning Representations. +Guillaume Wisniewski, Nicolas Pécheux, Souhir Gahbiche-Braham, and François Yvon. 2014. Cross-lingual part-of-speech tagging through ambiguous learning. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1779–1785, Doha, Qatar. Association for Computational Linguistics. +Yongji Wu, Defu Lian, Yiheng Xu, Le Wu, and Enhong Chen. 2020. Graph convolutional networks with markov random field reasoning for social spammer detection. Proceedings of the AAAI Conference on Artificial Intelligence, 34(01):1054-1061. +David Yarowsky and Grace Ngai. 2001. Inducing multilingual POS taggers and NP brackets via robust projection across aligned corpora. In Second Meeting of the North American Chapter of the Association for Computational Linguistics. +Anssi Yli-Jyra, Josi Purhonen, Matti Liljeqvist, Arto Antturi, Pekka Nieminen, Kari M. Rantilä, and Valter Luoto. 2020. HELFI: a Hebrew-Greek-Finnish parallel Bible corpus with cross-lingual morpheme alignment. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 4229-4236, Marseille, France. European Language Resources Association. + +# A Appendix + +# A.1 Languages + +
AfrikaansAlbanianArabicArmenianAzerbaijaniBashkir
BasqueBelarusianBengaliBretonBulgarianBurmese
CatalanCebuanoChechenChineseChuvashCroatian
CzechDanishDutchEnglishEstonianFinnish
FrenchGeorgianGermanGreekGujaratiHaitian
HebrewHindiHungarianIcelandicIndonesianIrish
ItalianJapaneseJavaneseKannadaKazakhKirghiz
KoreanLatinLatvianLithuanianLow SaxonMacedonian
MalagasyMalayMalayalamMarathiMinangkabauNepali
Norwegian (B.)Norwegian (N.)PunjabiPersianPolishPortuguese
PunjabiRomanianRussianSerbianSlovakSlovenian
SpanishSwahiliSundaneseSwedishTagalogTajik
TamilTatarTeluguTurkishUkrainianUrdu
UzbekVietnameseWaray-WarayWelshWest FrisianYoruba
+ +Table 5: List of the 84 languages we used in our experiments. \ No newline at end of file diff --git a/graphneuralnetworksformultiparallelwordalignment/images.zip b/graphneuralnetworksformultiparallelwordalignment/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..80f294b05185c458201db722e867128e2eca832e --- /dev/null +++ b/graphneuralnetworksformultiparallelwordalignment/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98f08b98b9a16d411cfbecc278088e4d7b150f01839739abe6629e2c66498395 +size 440737 diff --git a/graphneuralnetworksformultiparallelwordalignment/layout.json b/graphneuralnetworksformultiparallelwordalignment/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..51e39e5e7acf0f4b14df20110f2f064441e340de --- /dev/null +++ b/graphneuralnetworksformultiparallelwordalignment/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:686070eb4ae98a9ea7a97804d9cacfe9565b49e6f45a46023c04f1bd52a29000 +size 419163 diff --git a/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_content_list.json b/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..146137fd09ce4d00d42bd095fcd6d9c93c6cef80 --- /dev/null +++ b/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5910f9a4bb86712f32c652396dcc02d7fa4d737a2a8c793b7bff0a7184891e23 +size 73507 diff --git a/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_model.json b/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..750d9744c4402cf107aabec78fd6aee072547311 --- /dev/null +++ b/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:932e0a4ffe5ae1bb296bcf3765c1691340cf166b72328bc8baaab510b2481d62 +size 87289 diff --git a/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_origin.pdf b/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1c864fead45dc9200e49a3f39ca9f27b14c6026f --- /dev/null +++ b/graphrefinementforcoreferenceresolution/84e405c2-37a5-4098-9b64-00ba21778ee0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca0740df99724f9ae8245586f976444e6fa7208a17e409dc8ecbbf6784c7810a +size 567754 diff --git a/graphrefinementforcoreferenceresolution/full.md b/graphrefinementforcoreferenceresolution/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2196df6021d0d167955ef7f422913fd3eb5633c4 --- /dev/null +++ b/graphrefinementforcoreferenceresolution/full.md @@ -0,0 +1,279 @@ +# Graph Refinement for Coreference Resolution + +Lesly Miculicich * + +Microsoft + +leslym@microsoft.com + +James Henderson + +Idiap Research Institute + +james.henderson@idiap.ch + +# Abstract + +The state-of-the-art models for coreference resolution are based on independent mention pairwise decisions. We propose a modelling approach that learns coreference at the document-level and takes global decisions. For this purpose, we model coreference links in a graph structure where the nodes are tokens in the text, and the edges represent the relationship between them. Our model predicts the graph in a non-autoregressive manner, then iteratively refines it based on previous predictions, allowing global dependencies between decisions. The experimental results show improvements over various baselines, reinforcing the hypothesis that document-level information improves conference resolution. + +# 1 Introduction + +Current state-of-the-art (SOTA) solutions for coreference resolution such as (Toshniwal et al., 2020; Xu and Choi, 2020; Wu et al., 2020) formulate the problem in an end-to-end manner where the models jointly learn to detect mentions and link coreferent mentions. The objective is to predict the antecedent of each mention-span in a document, so the model performs pair-wise decisions of all mentions. After having the model predictions, related mentions are grouped into clusters. Under this scenario, each decision (i.e., whether two mentions are related to the same entity or not) is independent. Lee et al. (2018) proposed an iterative method to update the representation of a mention with information of its probable antecedents. However, the final decisions are still made locally. + +We propose a modeling approach that learns coreference at the document-level and takes global decisions. We propose to model mentions and coreference links in a graph structure where the nodes are tokens in the text, and the edges represent the relationships between them. Figures 1 and 2 + +![](images/2968fea3928e9204ef3d024baa88a1606b9aeb1fec344356b61572134dd9a4b8.jpg) +Figure 1: Example of a graph structure for coreference. Mention spans are shown in bold, and colors represent entity clusters. The mention heads are underlined. + +![](images/f47839e2b1d5005214d247b7912b74ee9e35f08fa1e0e2a930ac3d1ac9e382f9.jpg) +Figure 2: Example of a graph in matrix representation. The connection types are encoded as, 0: no links, 1: mention links, 2: coreference links. + +show a short example taken from the CoNLL 2012 dataset (Pradhan et al., 2012) showing the graph in two perspectives. Figure 1 shows how the token nodes in a text are connected with edges drawn with arrows. We differentiate the connections between words in a coreference mention, 'mention links', and the ones among mentions in a cluster, 'coreference links' (see Sec. 4). Figure 2 shows the same graph in a matrix representation, where the number in a cell indicates the type of relation between the row and the column. Our model receives a document as input then predicts and iteratively refines the graph of mentions and coreference links. + +We follow a similar approach to the Graph-to-Graph Transformer (G2GT) proposed in (Mohammadshahi and Henderson, 2021, 2020) for syntactic parsing, but instead of encoding sentences, we en + +code documents. Our model predicts the graph in a non-autoregressive manner, then iteratively refines it based on previous predictions. This recursive process introduces global dependencies between decisions. Unlike (Mohammadshahi and Henderson, 2021), we define different structures for input and output graphs, to reflect the different roles of these graphs. To ensure that locality in the input graph reflects all the relevant relationships, the input graph encodes relations for all mention tokens. This makes the encoding process easier. To provide a unique specification of the target graph, the output only encodes a minimal set of connections. This facilitates prediction. We initialize the Transformer with pre-trained language models, either BERT (Devlin et al., 2019), or SpanBERT (Joshi et al., 2020). + +Another difference with (Mohammadshahi and Henderson, 2021) is that our model predicts two levels of representation. While they predict the whole graph at each iteration, during the first iteration our model only predicts edges that identify mention-spans. This is because mention detection is a sentence-level phenomenon whose outputs are required as inputs to coreference resolution, which is a discourse-level phenomenon. But we do not organise these two tasks in a pipeline. Starting at the second iteration, the model predicts the complete graph. This allows the model to refine mention decisions given coreference decisions, and vice versa. In this way, we propose to use iterative graph refinement as an alternative to pipeline architectures for multi-level deep learning models. The iterative process finishes when there are no more changes in the graph or when a maximum number of iterations is reached. + +Ideally, the whole document should be encoded at once, but in practice there is a limit on the maximum length. In order to deal with this issue, we propose two strategies: overlapping windows and reduced document. In the first strategy, we split documents into overlapping windows of the maximum allowed size $K$ . The segments overlap for a length $K / 2$ . At decoding time, segments are input in order, and we construct the final graph by joining all graphs from different segments. In the second strategy, we use two networks. The mention-span network is the previously described overlapping model, and we use it for predicting the first graph. For the second network, we reduce the document by including only the tokens of candidate mention + +spans, separated by a special token. This network refines the initial graph for the following iterations. + +The experiments show improvements over the relevant baselines and state-of-the-art. They also indicate that the models reach the best solution in a maximum of three iterations. Given that we predict the graph at once for each iteration, our model's complexity is lower than the baselines. Our contributions are the following: + +- We propose a novel modeling approach to coreference resolution using a graph structure and multi-level iterative refinement. +- We propose two iterative graph refinement models that can predict the complete entity coreference structure of a document. +- We show improvements over baseline models and the relevant state-of-the-art. + +The rest of the paper is organized as follows. Section 2 presents a summary of coreference resolution approaches related to this paper. Section 3 briefly describes the fundamentals of state-of-the-art approaches. In Section 4, we define entity mentions and their coreference links as a graph, and formulate the task as a sequence-to-graph problem. In Section 5, we present our iterative refinement solution to global modelling of the coreference graph, and in Section 6, we present two proposed architectures to address the resulting computational issues. Sections 7, 8 and 9 contain the experimental setup, results and discussion, respectively. Finally, Section 10 draws the conclusions of this paper. + +# 2 Related Work + +The first approaches to coreference resolution (CR) were rule-based systems (Lappin and Leass, 1994; Manning et al., 2014), but eventually, they were outperformed by machine learning approaches (Aone and William, 1995; McCarthy, 1995; Mitkov, 2002) due to annotated corpora's creation. In general, there are three coreference approaches: mention-pair, entity-mention, and ranking models. Mention-pair models set coreference as a binary classification problem. The initial stage is the mention detection, where the input is raw text, and the output is the locations of each entity mention in the text. Mention detection is done as an independent task in a pipeline model (Soon et al., 2001) or as part of an end-to-end model (Lee et al., 2017). The next stage is the classification of mention pairs. At first, + +the best classifiers were decision trees (Soon et al., 2001; McCarthy, 1995; Aone and William, 1995), but later, neural networks became the SOTA. The final stage is reconciling the pair-wise decisions to create entity chains, usually by utilizing greedy algorithms or clustering approaches. Entity-mention models focus on maintaining single underlying entity representation for each cluster, contrasting the independent pair-wise decisions of mention-pair approaches (Clark and Manning, 2015, 2016). Ranking models aim at ranking the possibles antecedent of each mention instead of making binary decisions (Wiseman et al., 2016). An alternative modeling approach is to perform clustering instead of classification (Fernandes et al., 2012). + +SOTA models for CR are mostly based on Lee et al. (2017). They introduced the first end-to-end model that jointly optimizes mention detection and coreference resolution tasks. These neural network-based models also simplify the mention input representation to be word embedding vectors, instead of the traditional pipeline of different linguistic feature extraction tools such as part-of-speech (POS) tagging and dependency parsing. The following models proposed improvements over this work. (Lee et al., 2018) improved the previous model by introducing higher order inference so the entity's mention representation will get iteratively updated with the weighted average of antecedent representations, where the weights are the predictions from the model at the previous iteration. This contrasts with our approach in that we iterate over the whole coreference link graph and we perform discrete decisions at each iteration. Fei et al. (2019) use reinforcement learning to directly optimize the model on the evaluation metrics. Joshi et al. (2019) uses BERT embeddings (Devlin et al., 2019) as input. Joshi et al. (2020) introduced a new SpanBERT embedding model, which is shown to outperform BERT for the CR task. Xu and Choi (2020) showed that higher order inference has low impact on strong models such as SpanBERT. Toshniwal et al. (2020) proposed a bounded memory model trained to manage limited memory by learning to forget entities. Finally, Wu et al. (2020) formulated the problem of coreference resolution as question-answering and trained a model for span prediction. This model has the advantage of being pretrained with larger data-sets from the question-answering task. + +# 3 Baseline: Neural Coreference Resolution + +Neural coreference resolution, as formulated in (Lee et al., 2017, 2018), is a mention-pair approach. It uses an exhaustive method defining mentions as any text span of any size in a document. There, a document $D$ represents a sequence of tokens of size $N$ . The objective is to assign an antecedent $y_{i}$ to each of the $M$ text spans $m_{i}$ in $D$ . The set of possible antecedents of the span $m_{i}$ is denoted as $\mathrm{Y}(i)$ . This set contains all text spans with index less than $i$ , plus a null antecedent $\epsilon$ , $\mathrm{Y}(i) = \{\epsilon, m_{1}, \dots, m_{i-1}\}$ . The null antecedent is assigned when: (a) the span is not an entity mention, (b) the span is the first mention of an entity in the document. The final mention clusters are constructed greedily by grouping connected spans based on the model predictions during decoding time. + +The model is trained to learn a conditional probability distribution over documents $p(y_{1},\dots,y_{n}|D)$ , assuming independence among each decision of antecedent assignment $y_{i}$ , as follows: + +$$ +p \left(y _ {1}, \dots , y _ {M} \mid D\right) = \prod_ {i = 1} ^ {M} p \left(y _ {i} \mid D\right) \tag {1} +$$ + +In (Lee et al., 2018), the probability distribution $p(y_i|D)$ is inferred over $T$ iterations of the model over the same input document. At each iteration $t$ , the span representations are updated with the weighted average of all possible antecedents at time $t - 1$ where the weights are given by the probability distribution of the model at time $t - 1$ . They called this model high-order coreference resolution since each mention representation considers information from its probable antecedents. + +The training optimization is done using cross-entropy. Given that a mention-span $m_{i}$ can have more than one true antecedent, the loss considers the sum of probabilities of all true antecedents in the annotated data: + +$$ +\log \prod_ {i = 1} ^ {M} \sum_ {y _ {i} \in \mathrm {Y} (i) \cap \mathrm {C} (i)} p \left(y _ {i} \mid D\right) \tag {2} +$$ + +where $\mathrm{C}(i)$ indicates the cluster of mention-spans that includes $m_{i}$ in the annotated data. If the span does not belong to any cluster or all its antecedents have been pruned, then the span is assigned to the null cluster $\mathrm{C}(i) = \{\epsilon\}$ . + +This model's complexity is of the order $\mathcal{O}(N^4)$ , where $N$ is the document length. The complexity is computed by considering all possible text spans $M$ of the document, so $\mathcal{O}(M) = \mathcal{O}(N^2)$ . Then, it considers all possible combinations of span-antecedents $\mathcal{O}(M^2)$ . The model prunes spans and candidate antecedents to predetermined maximum numbers in order to maintain computational efficiency. + +# 4 Graph Modeling + +We propose to model the set of coreference links of a document in a graph structure where the nodes are tokens1 and the edges are links of different types. Given a document $D = [x_{1}, \ldots, x_{N}]$ of size $N$ , the coreference graph is defined as the matrix $G \subset \mathbb{N}^{N \times N}$ of links between tokens. Here, the relation type between two tokens, $x_{i}$ and $x_{j}$ , is encoded with integers and is denoted as $g_{i,j} \in \{0, 1, 2\}$ . We define three relation types: (0) no link, (1) mention link, and (2) coreference link, as illustrated in Figure 2. + +Mention links This type of link serves to identify mentions. We define mention links in two different manners depending on whether the graph is an input or output of the model, for functional reasons. When the graph is an input $G^{in}$ , there is a directed link from each mention's token to the mention head, including the head to itself. When the graph is the model's output $G^{out}$ , there is only one directed link from the last token of the mention-span to the first token. Both encoding methods define a mention-span uniquely, even when having nested mentions; every mention has a unique start-end combination and a unique head. The model utilizes the output for prediction, so it is simpler to predict one single link, whereas, in the input, the model uses links to all tokens to provide a more direct representation of the role of every token in the mention. + +Mention heads We simplified the head identification process by considering the first token of a mention span as the head. Although this method is naive, experiments show that this approximation works well enough in practice. However, as some spans can potentially have the same first token in case of nested mentions, we fix this issue by assigning the next token as the head if the first is already + +the head of any other mention. Investigating alternative approaches to mention head identification is future work. + +Coreference links This type of link defines the relationship between a mention and each of its antecedents. We also define coreference links in two different manners depending on whether the graph is an input or output of the model. When the graph is input, there is a link from a mention head token to the head of each mention in the same cluster. When the graph is a model's output, the mention should be connected to at least one of its antecedents. If the mention has no antecedent, or corresponds to the first mention of an entity in the text, then it is connected to a null antecedent $\epsilon$ . We use all possible connections between mentions in an entity cluster for the input so that the model receives a direct input for each coreference relationship. On the other hand, we consider that predicting at least one connection of the mention to its cluster is sufficient to specify the output graph. + +The objective is to learn the conditional probability distribution $p(G|D)$ . This distribution is initially approximated by assuming independence among each relation $g_{i,j}$ as: + +$$ +p (G | D) = \prod_ {i = 1} ^ {N} \prod_ {j = 1} ^ {i} p \left(g _ {i, j} | D\right) \tag {3} +$$ + +The probability $p(g_{i,j}|D)$ is split in two cases: one for mention links $p_m$ and the other for coreference links $p_c$ . The mention link probability is defined as: + +$$ +p _ {m} \left(g _ {i, j} = 1 \mid D\right) = \sigma \left(W _ {m} \cdot \left[ h _ {i}, h _ {j} \right]\right) \tag {4} +$$ + +where $W_{m}$ is a parameter matrix, and $h_i$ and $h_j$ are the hidden state representations of the tokens $x_{i}$ and $x_{j}$ respectively. This probability indicates whether there is a mention starting at position $j$ and ending at position $i$ of the document $D$ . The optimization is done using binary-cross-entropy $loss_{m}$ . + +The coreference link probability is defined as: + +$$ +p _ {c} \left(g _ {i, j} = 2 \mid D\right) = \frac {\exp \left(W _ {c} \cdot \left[ h _ {i} , h _ {j} \right]\right)}{\sum_ {j ^ {\prime} \in \mathrm {A} (i)} \exp \left(W _ {c} \cdot \left[ h _ {i} , h _ {j ^ {\prime}} \right]\right)} \tag {5} +$$ + +where $W_{c}$ is a parameter matrix, and $h_i$ and $h_j$ are the hidden state representations of the tokens $x_{i}$ and $x_{j}$ respectively. Similar to the baseline, we denote $\mathrm{A}(i)$ as the set of all candidate antecedents of $x_{i}$ . This set contains all mention heads with + +an index less than $i$ , plus a null head $\epsilon$ , $\mathrm{A}(i) = \{\epsilon, x_k \mid k < i$ and $x_k \in \mathrm{H}(\mathrm{D})\}$ , and $\mathrm{H}(\mathrm{D})$ is the set of all candidate mention heads in the document. The optimization is done with cross-entropy loss. Given that a mention-span $m_i$ can have more than one true antecedent, the loss considers the sum of probabilities of all true antecedents in the annotated data (as in Equation(2)): + +$$ +l o s s _ {c} = l o g \prod_ {i \in \mathrm {H} (D)} \sum_ {j \in \mathrm {Y} (i) \cap \hat {\mathrm {C}} (i)} p _ {c} \left(g _ {i, j} | D\right) \tag {6} +$$ + +where $\hat{\mathrm{C}}(i)$ indicates the annotated cluster of mention-spans that includes $m_i$ in the annotated data. If the mention does not belong to any cluster, then the span is assigned to the null cluster $\hat{\mathrm{C}}(i) = \{\epsilon\}$ . The final loss is the sum of $loss_m$ and $loss_c$ . + +The token's hidden state representations $\{h_1,..,h_N\}$ are the last hidden layer of a Transformer model. We use various pre-trained Transformer models to initialize the weight parameters, then fine-tune for the coreference task. + +# 5 Iterative Refinement + +The strong independence assumption made in Equation (3) does not reflect the real scenario and could lead to poor performance. Therefore, we use an iterative refinement approach to model interdependencies between relations, similar to G2GT (Mohammadshahi and Henderson, 2021). Under this approach, the model makes $T$ iterations over the same document $D$ . At each iteration $t$ , the predicted coreference graph $G_{t}$ is conditioned on the previously predicted one $G_{t-1}$ . The model's conditional probability distribution is now defined as follows: + +$$ +p \left(G ^ {t} \mid D, G ^ {t - 1}\right) = \prod_ {i = 1} ^ {N} \prod_ {j = 1} ^ {i} p \left(g _ {i, j} \mid D, G ^ {t - 1}\right) \tag {7} +$$ + +This means that the graph should be input to the Transformer model (Vaswani et al., 2017). Following (Mohammadshahi and Henderson, 2021), the graph is encoded by inputting an embedding for the type of each relation into the self-attention function of the Transformer: + +$$ +\begin{array}{l} \operatorname {A t t e n t i o n} (Q, K, V, L _ {k}, L _ {v}) = \\ \operatorname {s o f t m a x} \left(\frac {Q \cdot (K + L _ {k}) ^ {\intercal}}{\sqrt {d}}\right) \cdot \left(V + L _ {v}\right) \tag {8} \\ \end{array} +$$ + +$$ +\begin{array}{l} \text {w h e r e} \quad L _ {v} = E \left(G _ {t - 1}\right) \cdot W _ {v} \\ L _ {k} = E \left(G _ {t - 1}\right) \cdot W _ {k} \\ \end{array} +$$ + +where $E$ is a matrix of embeddings which encode the types of links in the graph, as illustrated in Figure 2. Thus, the relationship between a pair of tokens is encoded as an embedding vector which is input when computing the attention function for that pair of tokens. $W_{k}, W_{v}$ are weight matrices that serve to specialize $E(G_{t - 1})$ to be either key or value vectors. The complexity of our model is of the order of $\mathcal{O}(N^2\times T)$ , where $N$ is the document length, and $T$ is the number of refinement iterations of the model. + +To illustrate the iterative refinement of a graph, Figure 3 shows an example of two iterations of the model. The mention links are indicated with solid line arrows and the coreference links with dotted arrows. The initial graph matrix $G_0^{in}$ is full of zeros, so no connections are drawn. The first predicted graph $G_1^{out}$ only has mention-links because initially there were no mention heads to be connected. This graph is transformed to serve as input $G_1^{in}$ for the next iteration. Finally, during the second iteration, the model predicts the coreference graph $G_2^{out}$ . The model can continue iterating for a maximum of $T$ times. + +# 6 Architectures + +There exists in practice a maximum length for encoding a document due to limited hardware memory. In this section, we describe two strategies to manage this issue: overlapping windows and reduced document. In the experiments we also report results for a naive strategy of truncating the documents at the maximum segment length of $K$ for both training and testing. + +# 6.1 Overlapping Windows + +Here, we split the documents into overlapping segments of the maximum size $K$ , with an overlap of $K/2$ tokens. The segments are encoded individually in our G2GT model. During training, each segment is treated as an independent sample. However, during decoding, the segments are decoded in order. The subgraph corresponding to the overlapping part is input to the next segment. The union of the segmented graphs forms the final graph. + +# 6.2 Reduced Document + +This model has two parts; one to detect mentions and the other to perform coreference resolution. + +![](images/31b98f73b9a0042f48d6c42af69f5ef40be5657cb77fa0f6780e614273340cc3.jpg) +Figure 3: Example of iterations with G2GT. + +![](images/54e837acc64b13ec02aa788110e8e7c3195fcb0ecd0fc808c1eed60e4e277782.jpg) +Figure 4: Example of iterations with G2GT in two stages. + +The mention detection is similar to the previously described model. The coreference resolution part receives a shorter version of the document as input. The complete model is described in the following: + +Mention Detection This Transformer is non-iterative so it corresponds to the definition in Equation (3). To encode the document, we apply overlapping windows, as in the previous section. For prediction, we used the soft-target method proposed in (Miculicich and Henderson, 2020). This method enables the model to increase the recall of detection. Given that the candidate mentions will be fixed for the coreference resolution part, we need to detect most of them here. + +Coreference Resolution This part is a G2GT with iterative refinement. The input is a shorter version of the document obtained by concatenating the tokens from candidate mention-spans with a separation token in between and removing all other tokens. To maintain coherence in the document, we modify the token input representation to the sum of three vectors: (a) a token embedding, (b) an embedding of the token's position in the original + +document, so we retain information of distance between mentions, and (c) the token's contextualized representation obtained from the mention detection part where the original document is encoded. This second part predicts only coreference links, but the input graph contains both candidate mentions and coreference links. The set of candidate mentions remains the same across all iterations of this second part, but the mentions are refined in the sense that the final output only includes the mentions which are involved in the final coreference links. + +Figure 4 shows an example of this architecture with one iteration over a document. The mention links are indicated with solid line arrows and the coreference links with dotted arrows. The first model predicts the graph of mention-spans $G^{out}$ . This graph is transformed into the input format for the next model $G_{0}^{in}$ . Then, the second model predicts the graph of coreference $G_{1}^{out}$ . Note that this coreference resolution model can continue iterating for $T$ times. The final coreference graph is the output after the final iteration of the second model. The final set of mentions is only a subset of the mention candidates output by the first + +
TrainDev.TestTotal
# documents2,8023433483,493
# words1.3 M160 K170 K1.6 M
Avg. length464466488458
# entity changes/clusters35 K4.5 K4.5 K44 K
# coreference links120 K14 K15 K150 K
# mentions155 K19 K19 K194 K
+ +model, namely those mentions which participate in coreference links. + +# 7 Experimental Setting + +# 7.1 Dataset + +We use the CoNLL 2012 corpus (Pradhan et al., 2012). It contains data from diverse domains e.g., newswire, magazines, conversations. We experiment only with the English part. Table 1 shows the statistics of the dataset; the average length per document does not exceed 500 words. We pre-process the text to extract sub-word units (Sennrich et al., 2016) with BERT tokenizer (Wu et al., 2016). We map the positional annotation of mentions from words to sub-words and retain this mapping for back transformation during evaluation. + +# 7.2 Model configuration + +We use the implementation of Wolf et al. (2019)2 of 'BERT-base', 'BERT-large' (Joshi et al., 2019) and 'SpanBERT-large' (Joshi et al., 2020). All hyper-parameters follow this implementation unless specified otherwise. + +Training The G2GT considers an independent loss for each different refinement iteration. There is no back-propagation between refinement iterations because the model makes discrete decisions when predicting the graph for the next refinement step. There are two stopping criteria for the refinement: (a) when a maximum number of iterations $T$ is reached, or (b) when there are no more changes in the graph, $G_{t} = G_{t - 1}$ . This criterion is for both training and testing. Our models are trained with a maximum segment length of $K = 512$ and a batch size of 1 document. We use Adam (Kingma and Ba, 2014; Wolf et al., 2019) optimizer with a base learning rate of $2e - 3$ and no warm-up. As our graphs are directed, we use only the lower triangle of $G$ for predictions. The components of the reduced models are trained independently. The coref + +Table 1: Dataset statistics and splits. + +
ModelIter.MUCB3CEAFφ4Avg. F1
G2GTT=275.768.465.269.8
BERT-baseT=376.969.366.070.7
truncatedT=477.269.766.371.0
T=577.269.766.371.0
G2GTT=280.669.867.472.6
BERT-baseT=381.671.068.673.7
overlapT=481.570.968.773.7
T=581.470.668.773.5
G2GTT=279.276.168.571.6
BERT-baseT=380.069.670.273.3
reducedT=481.970.171.274.4
T=581.970.171.274.4
+ +Table 2: Refinement iterations $T$ on the development set (CoNLL 2012). + +erence resolution follows the currently described training schema. The mention detection model has no iterative refinement step and follows the training schema of the span scoring soft-target approach described in (Miculicich and Henderson, 2020), with $\rho = 0.1$ . + +Evaluation At evaluation time, we map back all sub-word units to words and reconstruct the document in CoNLL 2012 format. We use the precision, recall, and F1 score calculated in three different manners: MUC that counts the number of links between mentions, $\mathbf{B}^3$ that counts the number of mentions, and CEAF that counts the entity clusters. We did paired bootstrapping re-sampling for significance test following (Koehn, 2004). + +# 8 Results Analysis + +This section describes the results of various baselines and our models. First, we analyze the optimum number of refinement iterations, and then we show results using the best models. + +Table 2 shows the performance of our G2GT models when varying the maximum number of refinement iterations $T$ from 2 to 5 ( $T = 1$ is mention detection only). The results are in terms of the F1 score of the three coreference metrics and the average. All three implementations shown in the table perform the best when using $T = 4$ . There is a significant decrease in performance when the graphs are not refined, $T = 2$ , showing the importance of modelling the interdependencies between coreference relations. + +Table 3 shows the evaluation results on the test set in terms of precision (P), recall (R), and F1 score for each metric. The last column displays the average F1 of the three metrics. The first section + +
ModelMUCB3CEAFφ4Avg. F1
PRF1PRF1PRF1
Clark and Manning (2015)76.169.472.665.656.060.459.453.056.063.0
Wiseman et al. (2016)77.569.873.466.857.061.562.153.957.764.2
Clark and Manning (2016)79.270.474.669.958.063.463.555.559.265.7
Lee et al. (2017)78.473.475.868.661.865.062.759.060.867.2
Fei et al. (2019)85.477.981.477.966.471.770.666.368.473.8
Xu and Choi (2020)85.985.585.779.078.979.076.775.275.980.2
Wu et al. (2020)88.687.488.082.482.082.279.978.379.183.1
Baseline (Lee et al., 2018)81.479.580.472.269.570.868.267.167.673.0
+ BERT-base (Joshi et al., 2019)80.482.381.469.673.871.769.068.568.873.9
+ BERT-large (Joshi et al., 2019)84.782.483.576.574.075.374.169.871.976.9
+ SpanBERT-large (Joshi et al., 2020)85.884.885.378.377.978.176.474.275.379.6
G2GT BERT-base truncated78.477.978.169.671.070.366.867.367.071.8
G2GT BERT-base overlap81.282.882.069.873.671.669.669.369.474.4
G2GT BERT-base reduced83.483.183.270.173.771.972.170.171.075.4
G2GT BERT-large truncated80.179.279.671.371.071.169.168.868.973.2
G2GT BERT-large overlap83.583.283.374.574.174.375.270.172.676.7
G2GT BERT-large reduced84.783.183.976.874.075.475.370.172.677.3
G2GT SpanBERT-large overlap85.884.985.378.778.078.376.474.575.479.7
G2GT SpanBERT-large reduced85.986.0*†85.9*79.3*79.4*†79.3*76.475.9*76.1*80.5*
+ +Table 3: Evaluation on the test set (CoNLL 2012). * significant at p < 0.01 compared to (Joshi et al., 2020), † significant at p < 0.05 compared to (Xu and Choi, 2020) + +of the table exhibits scores of different coreference resolution systems from the literature. The second section shows the result of the 'Baseline' (Lee et al., 2018) system described in Section 3. This model uses ELMo (Peters et al., 2018) instead of BERT to obtain token representations. Baseline plus 'BERT-base', 'BERT-large' (Joshi et al., 2019) and 'SpanBERT-large' (Joshi et al., 2020) correspond to the baseline using those pretrained representations. We copy all these values from the original papers. The last section of the table presents scores of our graph-to-graph models with iterative refinement. 'truncated' is our model with no special treatment for document length; the documents are truncated at the maximum segment length of $K$ . 'overlap' and 'reduce' are the models described in Section 6. + +As expected, pre-training with SpanBERT results in better scores than with BERT, and BERT-large is better than BERT-base. Not surprisingly, 'G2GT BERT-base truncated' and 'G2GT BERT-large truncated' perform poorly in comparison to the baseline because their information is incomplete. For BERT-base, both the 'overlap' and 'reduce' models have better scores than the comparable baseline. For BERT-large and SpanBERT, the 'overlap' model has similar scores to the baseline, but the 'reduce' model consistently improves over the baseline. + +Preliminary experiments with G2GT 'overlap' in a pipeline approach, where mention detection is performed before coreference, showed that it is not better than in a joint approach showed here. Overall, our G2GT 'reduce' method consistently shows the highest scores across all the models for each pre-trained model. Our models do not surpass SOTA (Wu et al., 2020) (shown in grey), but as mentioned before, this SOTA model is also trained on the much more abundant data from the question-answering task, and so it is not directly comparable to our model. We leave the issue of incorporating additional data into the training of our model to future work. + +# 9 Discussion + +These results support our claim that coreference resolution benefits from making global coreference decisions using document-level information. First, refinement of coreference decisions using global information about other coreference decisions clearly improves accuracy, as indicated by the improved scores for models with more than one coreference iteration in Table 2. Second, the model which is able to combine information from the entire document, G2GT 'reduce', is clearly better than the model which performs the task on large windows of text and then merges the results, G2GT 'overlap'. We believe that the benefits of full-document + +iterative refinement will extend to other discourse-level phenomena, and that the G2GT architecture will be an effective way to achieve this benefit. + +One issue with our method is the necessity to iteratively pass the input through an expensive encoder model more than once. However, the number of iterations needed is small, and results in significant improvement. + +The length management methods would not be necessary if we had more efficient pre-trained Transformer models or larger-memory GPU hardware which could handle longer sequences. However, the computational cost of very large Transformers will always be an issue, so in general there is a need to address the issue of how to reduce the number of inputs when modelling phenomena which require large contexts, such as coreference resolution. This paper contributes towards addressing this general issue. + +# 10 Conclusion + +We proposed a G2GT model with iterative refinement for coreference resolution. For this purpose, we define a graph structure to encode coreference links contained in a document. That enables our model to predict the complete coreference graph at once. The graph is then refined in a recursive manner, iterating the model conditioned on the document and the graph prediction from the previous step. This allows global modelling of all coreference decisions using all document-level information, but it introduces computational issues for longer documents. We experimented with two methods to manage long documents and maintain computational efficiency. The first method encodes the document in overlapping segments. The second method reduces the set of tokens which are input. + +The evaluation shows that both methods can outperform a comparable baseline, and that the second method has better performance than the first one and than all other comparable models. This experiment shows that global decisions and document-level information are useful to improve coreference and thus should not be ignored. It also shows that the models can benefit from increasingly powerful pre-trained language models, BERT-base (Devlin et al., 2019), BERT-large (Devlin et al., 2019), and SpanBERT (Joshi et al., 2020). + +By empirically showing the benefits of making global decisions and using document-level information in coreference resolution, this work motivates + +further work on this topic. In addition, the model designs developed in this work provide a viable approach to addressing the related issues. Addressing the computational issues with modelling large documents in Transformers is an area of active research, and our proposed methods could be improved in future work. + +# Acknowledgements + +This work was supported in part by the Swiss National Science Foundation, under grants 200021_178862 and CRSII5_180320. + +# References + +Chinatsu Aone and Scott William. 1995. Evaluating automated and manual acquisition of anaphora resolution strategies. In 33rd Annual Meeting of the Association for Computational Linguistics, pages 122-129, Cambridge, Massachusetts, USA. Association for Computational Linguistics. +Kevin Clark and Christopher D. Manning. 2015. Entity-centric coreference resolution with model stacking. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 1405-1415, Beijing, China. Association for Computational Linguistics. +Kevin Clark and Christopher D. Manning. 2016. Improving coreference resolution by learning entity-level distributed representations. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 643-653, Berlin, Germany. Association for Computational Linguistics. +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. +Hongliang Fei, Xu Li, Dingcheng Li, and Ping Li. 2019. End-to-end deep reinforcement learning based coreference resolution. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 660-665, Florence, Italy. Association for Computational Linguistics. +Eraldo Fernandes, Cicero dos Santos, and Ruy Milidiu. 2012. Latent structure perceptron with feature induction for unrestricted coreference resolution. In Joint Conference on EMNLP and CoNLL - Shared + +Task, pages 41-48, Jeju Island, Korea. Association for Computational Linguistics. +Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. 2020. Span-BERT: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64-77. +Mandar Joshi, Omer Levy, Luke Zettlemoyer, and Daniel Weld. 2019. BERT for coreference resolution: Baselines and analysis. 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 5803-5808, Hong Kong, China. Association for Computational Linguistics. +Diederik P Kingma and Jimmy Ba. 2014. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. +Philipp Koehn. 2004. Statistical significance tests for machine translation evaluation. In Proceedings of the 2004 Conference on Empirical Methods in Natural Language Processing, pages 388-395, Barcelona, Spain. Association for Computational Linguistics. +Shalom Lappin and Herbert J. Leass. 1994. An algorithm for pronominal anaphora resolution. Computational Linguistics, 20(4):535-561. +Kenton Lee, Luheng He, Mike Lewis, and Luke Zettle-moyer. 2017. End-to-end neural coreference resolution. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 188-197, Copenhagen, Denmark. Association for Computational Linguistics. +Kenton Lee, Luheng He, and Luke Zettlemoyer. 2018. Higher-order coreference resolution with coarse-to-fine inference. 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 687-692, New Orleans, Louisiana. Association for Computational Linguistics. +Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. 2014. The Stanford CoreNLP natural language processing toolkit. In Proceedings of 52nd Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 55-60, Baltimore, Maryland. Association for Computational Linguistics. +JF McCarthy. 1995. Using decision trees for coreference resolution. In Proc. 14th International Joint Conf. on Artificial Intelligence (IJCAI), Quebec, Canada, Aug. 1995. +Lesly Miculicich and James Henderson. 2020. Partially-supervised mention detection. In Proceedings of the Third Workshop on Computational Models of Reference, Anaphora and Coreference, pages 91-98, + +Barcelona, Spain (online). Association for Computational Linguistics. +Ruslan Mitkov. 2002. Anaphora Resolution. Longman, London, UK. +Alireza Mohammadshahi and James Henderson. 2020. Graph-to-graph transformer for transition-based dependency parsing. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3278-3289, Online. Association for Computational Linguistics. +Alireza Mohammadshahi and James Henderson. 2021. Recursive non-autoregressive graph-to-graph transformer for dependency parsing with iterative refinement. Transactions of the Association for Computational Linguistics, 9:120-138. +Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. 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 2227-2237, New Orleans, Louisiana. Association for Computational Linguistics. +Sameer Pradhan, Alessandro Moschitti, Nianwen Xue, Olga Uryupina, and Yuchen Zhang. 2012. CoNLL-2012 shared task: Modeling multilingual unrestricted coreference in OntoNotes. In Joint Conference on EMNLP and CoNLL - Shared Task, pages 1-40, Jeju Island, Korea. Association for Computational Linguistics. +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. +Wee Meng Soon, Hwee Tou Ng, and Daniel Chung Yong Lim. 2001. A machine learning approach to coreference resolution of noun phrases. Computational Linguistics, 27(4):521-544. +Shubham Toshniwal, Sam Wiseman, Allyson Ettinger, Karen Livescu, and Kevin Gimpel. 2020. Learning to Ignore: Long Document Coreference with Bounded Memory Neural Networks. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8519-8526, Online. Association for Computational Linguistics. +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 I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 5998-6008. Curran Associates, Inc. + +Sam Wiseman, Alexander M. Rush, and Stuart M. Shieber. 2016. Learning global features for coreference resolution. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 994-1004, San Diego, California. Association for Computational Linguistics. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al. 2019. Huggingface's transformers: State-of-the-art natural language processing. ArXiv, pages arXiv-1910. +Wei Wu, Fei Wang, Arianna Yuan, Fei Wu, and Jiwei Li. 2020. CorefQA: Coreference resolution as query-based span prediction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6953-6963, Online. Association for Computational Linguistics. +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. +Liyan Xu and Jinho D. Choi. 2020. Revealing the myth of higher-order inference in coreference resolution. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8527-8533, Online. Association for Computational Linguistics. \ No newline at end of file diff --git a/graphrefinementforcoreferenceresolution/images.zip b/graphrefinementforcoreferenceresolution/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..27920474fe22cdace19185547be826947708fc88 --- /dev/null +++ b/graphrefinementforcoreferenceresolution/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c6840799a8391c4afed993479bbcbedefebb3e496b3012807adafa0be5b1478 +size 413732 diff --git a/graphrefinementforcoreferenceresolution/layout.json b/graphrefinementforcoreferenceresolution/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d8a693ea0406958ddcca99437a6cb5b8a00df48a --- /dev/null +++ b/graphrefinementforcoreferenceresolution/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a86c71b89d23e19d1397eb61103eef2271508d1503aba491bf9017c504c5327 +size 348261 diff --git a/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_content_list.json b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..14eb8af331c52316293f8fb17dd5cbffcec06aea --- /dev/null +++ b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df9f44521776ce88fcba93f7f9f4a7e901a108099000662ca0cde66aa6ed7730 +size 86297 diff --git a/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_model.json b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_model.json new file mode 100644 index 0000000000000000000000000000000000000000..866893985bef24785cce0c0b8f94618eb7671116 --- /dev/null +++ b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62053d17d27f8c1c62c615a44b9b56256758a3bdf3bf142c8d02fae8a0343e99 +size 104379 diff --git a/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_origin.pdf b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4eb6acca52add629d4066c889817ecc3fbe71a44 --- /dev/null +++ b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/f1607406-623d-4d8f-879e-546cf71a2744_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40a3e5035a381f9941ab5c4e4db571635d8249f6f3c8365bd0af18b9d7f94553 +size 485401 diff --git a/grscombininggenerationandrevisioninunsupervisedsentencesimplification/full.md b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/full.md new file mode 100644 index 0000000000000000000000000000000000000000..e64f7b9a8cf1c1d73f8a725ea9800cc827160dff --- /dev/null +++ b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/full.md @@ -0,0 +1,310 @@ +# GRS: Combining Generation and Revision in Unsupervised Sentence Simplification + +Mohammad Dehghan $^{1}$ , Dhruv Kumar $^{2}$ , Lukasz Golab $^{1}$ + +1University of Waterloo + +2Grammarly + +{m25dehgh,lgolab}@uwaterloo.ca + +dhruv.kumar@grammarly.com + +# Abstract + +We propose GRS: an unsupervised approach to sentence simplification that combines text generation and text revision. We start with an iterative framework in which an input sentence is revised using explicit edit operations, and add paraphrasing as a new edit operation. This allows us to combine the advantages of generative and revision-based approaches: paraphrasing captures complex edit operations, and the use of explicit edit operations in an iterative manner provides controllability and interpretability. We demonstrate these advantages of GRS compared to existing methods on the Newsela and ASSET datasets. + +# 1 Introduction + +Text simplification is the task of reducing the complexity and improving the readability of text while preserving its meaning. This is beneficial for persons with reading disabilities (Evans et al., 2014), non-native speakers, people with low literacy, and children. Furthermore, other NLP tasks can use simplification as a pre-processing step, such as summarization (Klebanov et al., 2004), parsing (Chandrasekar et al., 1996), and machine translation (Šajner and Popovic, 2016). + +Sentence simplification models can be categorized into generative and revision-based. Generative approaches produce a simple sentence from a complex sentence in one step, in an auto-regressive way (Zhang and Lapata, 2017; Guo et al., 2018; Kriz et al., 2019; Surya et al., 2019; Martin et al., 2020a). Revision-based methods iteratively edit a given sentence using a sequence of edit operations such as word deletion (Alva-Manchego et al., 2017; Dong et al., 2019; Kumar et al., 2020; Agrawal et al., 2021). While generative models learn complex edit operations implicitly from data, the explicit edit operations performed by revision-based approaches can provide more control and interpretability. + +Simplification methods can also be categorized as supervised or unsupervised. Supervised methods tend to have better performance, but require aligned complex-simple sentence pairs for training (Zhang and Lapata, 2017; Guo et al., 2018; Kriz et al., 2019; Martin et al., 2020a,b; Maddela et al., 2021). Unsupervised methods do not need such training data but do not perform as well (Surya et al., 2019; Kumar et al., 2020; Zhao et al., 2020). + +We propose GRS: a new approach to bridge the gap between generative and revision-based methods for unsupervised sentence simplification. The insight is to introduce paraphrasing as an edit operation within an iterative revision-based framework. For paraphrasing, we use a fine-tuned BART model (Lewis et al., 2020) with lexically-constrained decoding (Hokamp and Liu, 2017; Post and Vilar, 2018; Hu et al., 2019a). This decoding technique allows us to select words from the initial sentence that must be changed in the paraphrased sentence (otherwise, paraphrasing an entire sentence reduces to a pure generative model). To avoid the computational overhead of repeatedly performing constraint-based decoding using various combinations of words to paraphrase, GRS includes a complex component detector to identify the most appropriate words to paraphrase. The code is available at https://github.com/imohammad12/GRS. + +GRS is unsupervised in the sense that it does not require aligned complex-simple sentence pairs, but it uses supervised models. The paraphrasing model requires paraphrasing corpora, and the complex component detector requires two unlabeled corpora, one containing more complex sentences than the other. However, collecting paraphrasing data and unaligned simplification data is simpler than collecting aligned complex-simple pairs. + +# 2 Related Work + +Early work on simplification relied on rules, e.g., to split or shorten long sentences (Chandrasekar and + +Srinivas, 1997; Carroll et al., 1998; Vickrey and Koller, 2008). Later work treated simplification as a monolingual phrase-based machine translation (MT) task (Coster and Kauchak, 2011; Wubben et al., 2012), with syntactic information added, such as constituency trees (Zhu et al., 2010). Recent work, reviewed below, leverages neural models in a generative and revision-based manner. + +Supervised Generative Methods employ Seq2Seq models to learn simplification operations from aligned complex-simple sentence pairs (Nisioi et al., 2017). Building on a Seq2Seq model, Zhang and Lapata (2017) used reinforcement learning to optimize a reward based on simplicity, fluency and relevance. Recent methods build on transformer (Vaswani et al., 2017) models, by integrating external databases containing simplification rules (Zhao et al., 2018), using an additional loss function to generate diverse outputs (Kriz et al., 2019), combining syntactic rules (Maddela et al., 2021), and conditioning on length and syntactic and lexical complexity features (Martin et al., 2020a). + +Unsupervised Generative Methods rely on non-aligned complex and simple corpora. Zhao et al. (2020) adopted a back-translation framework, whereas Surya et al. (2019) used an unsupervised style transfer paradigm. Martin et al. (2020b) used a pre-trained BART model fine-tuned on paraphrased sentence pairs. + +Controllable Generative Methods produce outputs at specified grade levels (Scarton and Specia, 2018; Nishihara et al., 2019), or apply syntactic or lexical constraints on the generated sentences (Martin et al., 2020a,b). However, these models do not provide any insights into the simplification process. + +Supervised Revision-Based Methods use complex-simple sentence pairs to learn where to apply edit operations. Alva-Manchego et al. (2017) use keep, replace, and delete operations. Some recent work used iterative non-autoregressive models to edit sentences by either predicting token-level edit-operations (Omelianchuk et al., 2021) or using a fixed pipeline of edit operations (Agrawal et al., 2021). Dong et al. (2019) proposed a hybrid method with explicit edit operations in an end-to-end generative model. + +Unsupervised Revision-Based Methods such as Narayan and Gardent (2016) apply a pipeline of edit operations in a fixed order. Kumar et al. (2020) presented an unsupervised revision-based approach by modelling text simplification as an unsupervised + +![](images/980ab64d2d4a116a787130e7debd7e00312b0853f9d12ecbbb34ff48c2411940.jpg) +Figure 1: An overview of GRS. Given a complex input sentence, simplifications are iteratively produced via paraphrasing and deletion, with paraphrasing guided by the complex component detector. Sentences passing a filter (Equation 4) are candidates for input to the next iteration. + +search problem. While GRS also uses a revision-based framework and an unsupervised search strategy, we integrate a generative paraphrasing model into the framework to leverage the strengths of both text generation and text revision approaches. + +# 3 GRS Model + +# 3.1 Overview + +Our solution, GRS, iteratively revises a given complex sentence by applying edit operations on sentence fragments. In each iteration, multiple candidate simplifications are produced and evaluated using a scoring function (Section 3.5), and the best candidate is selected (Section 3.6). The selected sentence acts as the input to the next iteration. This process continues until none of the candidate sentences are simpler than the input sentence. + +GRS uses two edit operations: paraphrasing (Section 3.2; guided by the complex component detector described in Section 3.3) and deletion (Section 3.4). The scoring function (Section 3.5) guides our search for best simplification, using soft and hard constraints on simplicity, linguistic acceptability, and meaning preservation. + +In Section 3.6, we explain how paraphrasing and deletion work in an iterative search framework, how candidate sentences are selected, and when the algorithm terminates. Figure 1 gives an overview of GRS, which is explained further in Section 3.6. + +![](images/ebc6a7cb91dcfd16eaeaa2aa4f2e855eace5b26e99aeba799948d0c144108448.jpg) +Figure 2: Two iterations of edit operations: deletion, then paraphrasing to simplify the complex fragments ("announcement" and "massive") identified by the complex component detector and given as negative constraints to the paraphrasing model. This example demonstrates the interpretability of GRS through building a simplification path leading to the final sentence. + +# 3.2 Paraphrasing Operation + +We use a pre-trained BART model (Lewis et al., 2020), fine-tuned on a small subset of ParaBank 2 paraphrasing dataset (Hu et al., 2019b); however, any paraphrasing auto-regressive model can be used instead. During inference, we use lexical-constrained decoding (Hokamp and Liu, 2017; Post and Vilar, 2018; Hu et al., 2019a) to place negative constraints on complex words and phrases in the input sentence. Negative constraints are words that the paraphrasing model is forced not to generate during decoding. Figure 2 shows an example in which an input sentence was paraphrased to exclude two complex words (negative constraints): "massive" and "announcement". We explain how to choose negative constraints below, with the help of the complex component detector. + +# 3.3 Complex Component Detector + +Constrained decoding is computationally more expensive than greedy and beam search decoding. In GRS, before paraphrasing a sentence, the complex component detector predicts the best negative constraints; then the sentence and the predicted negative constraints are given to the paraphrasing model to generate a new candidate sentence. As a result, the paraphrasing operation is called only once per iteration of GRS, using the predicted negative constraints, avoiding the expensive process of repeatedly paraphrasing the input using different combinations of negative constraints. + +![](images/eb2c5451cd5666ac2dc68c26be7314312571a45f28ade8afee8c0e7caa83f180.jpg) +Figure 3: One of the attention matrices of the DeBERTa complex-simple classifier (head 11 of the second layer). Attention weights are reflected by color intensity. The input sentence in this example is "below are some useful links to facilitate your involvement." We used BertViz (Vig, 2019) to visualize attention weights. + +We implemented the complex component detector as a complex-simple classifier that gives a simplicity probability to a given sentence. We only require two corpora with different complexity levels to train this classifier. Since aligned complex-simple sentence pairs are not required, this classifier can be trained on any pair of corpora with different complexity levels. Reid and Zhong (2021) showed that it is possible to extract style-specific sections of a sentence using the attention layers of a style classifier. Similarly, we use the attention layers of our complex-simple classifier to extract the complex components from a given input sentence. + +We fine-tune the pre-trained DeBERTa model (He et al., 2020) as our complex-simple classifier. Figure 3 illustrates one of the attention heads of the second layer of DeBERTa. This visualization shows that the word "facilitate" was attended to more than the other words in the given sentence. We use this intuition and devise a formula (Equations 1 and 2 below) to detect complex words by analyzing attention weights. + +BERT (Devlin et al., 2019) and its extensions (e.g. DeBERTa) add a [CLS] token to the beginning and a [SEP] token to the end of each sentence (as shown in Figure 3). In these models, the hidden states of the [CLS] token in the last layer are used for classification tasks. In our complex-simple classifier, we found that the attention paid by the [CLS] token in the second layer to other words in the sentence can help us detect complex components. Equations 1 and 2 demonstrate how we extract complex components from attention head matrices of the second layer of the classifier. Here, $\mathbf{A}_{h,i}^{[CLS]}$ refers to the amount of attention the [CLS] token in the $h$ th attention head of the second layer + +pays to the $i$ th token of the input sentence. $N$ and $H$ refer to the length of the input sentence and the number of attention heads, respectively. $c_{i}$ defines whether the $i$ th token is complex or not. If $c_{i} = 1$ , then this token will be set as a negative constraint. $\bar{T}$ is a threshold used for finding complex tokens. In the example demonstrated in Figure 3, only $c_{8}$ , which refers to the word "facilitate", is a complex token. + +$$ +\bar {T} = \frac {\sum_ {h = 0} ^ {H - 1} \sum_ {i = 0} ^ {N - 1} \mathbf {A} _ {h , i} ^ {[ C L S ]}}{N} \tag {1} +$$ + +$$ +c _ {i} = \left\{ \begin{array}{l l} 1, & \text {i f} \sum_ {h = 0} ^ {H - 1} \mathbf {A} _ {h, i} ^ {[ C L S ]} \geq \bar {T} \\ 0, & \text {o t h e r w i s e} \end{array} \right. \tag {2} +$$ + +# 3.4 Deletion Operation + +Deletion aims to remove peripheral information to make sentences simpler, and is composed of two sub-operations: removal and extraction. Inspired by Kumar et al. (2020), we use the constituency tree of the input sentence to obtain all constituents from different depths of the parse tree. These constituents can be deleted (removal) or selected as a simplified candidate sentence (extraction). The removal sub-operation creates new candidate sentences by removing each of these phrases from the input sentence. The extraction sub-operation selects phrases as candidate sentences, which helps the model extract the main clause and drop peripheral information. The example in Figure 2 drops the phrase "burying 25 nepalese sherpa guides under sheets of ice the size of houses" from the complex sentence since it is not the main clause. + +# 3.5 Scoring Function + +Candidates generated by our two edit operations may not be correct in terms of linguistic acceptability. Furthermore, important information from the original sentence may have been removed. We use a score function to filter out non-grammatical candidates or sentences that are not conceptually similar to the original sentence. The score function is composed of three important components. + +Meaning Preservation $(H_{mp})$ : First, we use the method proposed in Reimers and Gurevych (2019) to obtain the semantic representations of the sentences. We then use the cosine similarity measure between the representations of the original and the generated candidate sentence. Our meaning + +preservation measure acts as a hard filter. A hard filter assigns a zero score to candidate sentences that do not pass a certain threshold. + +Linguistic Acceptability $(H_{la})$ : By removing some components of a complex input sentence, the output sentence may become nonsensical. To check the linguistic acceptability of the generated sentences, we train a classifier on the CoLA (the corpus of linguistic acceptability) (Warstadt et al., 2019) dataset. This classifier measures the probability that a given sentence is grammatical. This module, like the meaning preservation module, is used as a hard filter in the score function. + +Simplicity $(S_{simp})$ : This is a soft constraint, for which we use the complex-simple classifier mentioned in Section 3.3, which computes the simplicity probability of a sentence. + +These three measures together evaluate the quality of each candidate sentence, as shown in Equation 3. In this equation, $S$ , $S_{simp}$ , $H_{la}$ , $H_{mp}$ , $c$ , and $o$ refer to the score function, simplicity module, linguistic acceptability, hard filter, meaning preservation, hard filter, candidate sentence, and the original sentence, respectively. + +$$ +S (c) = S _ {s i m p} (c) * H _ {m p} (c, o) * H _ {l a} (c) \tag {3} +$$ + +# 3.6 Simplification Search + +Our unsupervised search method is inspired by Kumar et al. (2020), but with different simplification operations and a different score function. Given a complex input sentence, paraphrasing and deletion operations generate candidate sentences separately. In each iteration, the paraphrasing operation creates only one candidate sentence, as described in Section 3.2, whereas the deletion operation generates multiple candidate sentences (Section 3.4). Candidates sentences are then evaluated according to the scoring function. Given a score for each candidate sentence, we filter out those candidates that do not improve the score of the input sentence by some threshold. The threshold depends on the edit operation that the candidate sentence has been created from. In equation 4, $t_{op}$ is the threshold associated with operator op. $S$ , $c$ , and $c'$ refer to the score function, the candidate sentence, and the input sentence in the current iteration, respectively. + +$$ +S (c) > S \left(c ^ {\prime}\right) * t _ {o p} \tag {4} +$$ + +Finally, at the end of each iteration, out of the + +remaining sentences (that are not filtered out), we select the one with the highest score. + +# 4 Experiments + +This section discusses the experimental setup (Sections 4.1 through 4.4), a comparison of GRS with existing approaches (Section 4.5), a controllability study (Section 4.6), an evaluation of the complex component detector (Section 4.7), an analysis of the simplification search (Section 4.8), and a human evaluation (Section 4.9). + +# 4.1 Data + +We use the Newsela (Xu et al., 2015) and ASSET datasets (Alva-Manchego et al., 2020) to evaluate GRS against existing simplification methods. Newsela contains 1840 news articles for children at five reading levels. We use the split from Zhang and Lapata (2017), containing 1129 validation and 1077 test sentence pairs. ASSET includes 2000 validation and 359 test sentences pairs. Each sentence has ten human-written references. + +# 4.2 Training Details + +Paraphrasing Model: We fine-tune a pre-trained BART model (Lewis et al., 2020) implemented by Wolf et al. (2020). To do this, we use a subset of the ParaBank 2 paraphrasing dataset (Hu et al., 2019b) containing 47,000 pairs. We observe that a conservative paraphrasing model helps us to control the generated output. This is because such a model is better at specifically changing only words provided as negative constraints. Thus, for finetuning the BART model, we select paraphrasing sentence pairs that are semantically similar to each other. For calculating the semantic similarity of sentence pairs, we use the model from Reimers and Gurevych (2019) to obtain sentence embeddings, and then we use cosine-similarity to find the most similar sentence pairs. + +The BART model is composed of a 12-layer encoder and a 12-layer decoder, each layer containing 16 attention heads. The model's hidden size is 1024, and the tokenizer vocabulary size is 50265. We use a batch size of 8 (per device). It took approximately 1.5 hours to fine-tune the model using three NVIDIA 2080 Ti GPUs. + +Complex-Simple Classifier: We use a pretrained DeBERTa (He et al., 2020) model implemented by Wolf et al. (2020). This model is composed of a 12-layer self-attentional encoder, each + +layer containing 12 attention heads. The model's hidden size is 768, and the tokenizer vocabulary size is 30522. To fine-tune the DeBERTa model for the binary classification task, we use the Newsela-Auto dataset (Jiang et al., 2020). To train the classifier, we use the AdamW (Loshchilov and Hutter, 2019) optimizer with a learning rate of $5 \times 10^{-5}$ and a batch size of 16. Note that we do not use the alignment between complex-simple sentence pairs in the Newsela-Auto dataset. Thus, our complex-simple classifier can be trained on any text corpora with different complexity levels. It took approximately one hour to fine-tune the classifier using a single NVIDIA 2080 Ti GPU. The accuracy of this classifier is 78.46. + +Meaning Preservation Module of the Scoring Function: To obtain contextual embeddings of sentences, we use the Sentence Transformers (Reimers and Gurevych, 2019) framework, specifically, the paraphrase-mpnet-base-v2 pre-trained model. + +Linguistic Acceptability Module of the Scoring Function: To score the linguistic acceptability of a sentence, we fine-tune a pre-trained DeBERTa model (He et al., 2020) for a binary classification task on the CoLA (the corpus of linguistic acceptability) (Warstadt et al., 2019) dataset. It contains 10,657 sentences, each labelled either as grammatical or ungrammatical. The configuration and training hyperparameters of this classifier are the same as the complex-simple classifier explained above. It took approximately 30 minutes to fine-tune the model using a single NVIDIA 2080 Ti GPU. On the validation set, the accuracy of the model is 79.33. + +Simplification Search and Score Function: The threshold associated with paraphrasing $(t_{par})$ is 0.8, and the thresholds related to the removal $(t_{dl - rm})$ and extraction $(t_{dl - ex})$ sub-operations of the deletion operation are 1.1, and 1.25, respectively. The score function's meaning preservation $(H_{mp})$ and linguistic acceptability $(H_{la})$ thresholds are 0.7 and 0.3, respectively. We obtained these values using the validation set. These values are used for both ASSET and Newsela datasets. + +# 4.3 Evaluation Metrics + +To evaluate GRS and other models, we use SARI (Xu et al., 2016) as our primary metric. SARI (System output Against References and against the Input sentence) evaluates the quality of the output text by calculating how often the output text correctly keeps, inserts, and deletes n-grams from + +
ModelSARI ↑Add ↑Delete ↑Keep ↑FKGL ↓Len
Identity Baseline12.240.000.0036.728.8223.04
Unsupervised Models
Zhao et al. (2020)37.201.5173.5336.543.8011.78
Kumar et al. (2020)38.361.0177.5836.512.819.61
Martin et al. (2020b)38.294.4476.0234.424.6512.49
GRS: DL (RM + EX)37.520.6669.4542.443.9312.64
GRS: PA36.423.4469.5536.285.7919.08
GRS: PA + DL (RM + EX)40.013.0680.4336.533.2011.72
Supervised Models
Narayan and Gardent (2014)34.730.7773.2230.214.5212.40
Zhang and Lapata (2017)38.032.4369.4742.204.7814.36
Dong et al. (2019)39.282.1377.1738.533.8010.92
Zhao et al. (2020)39.142.8074.2840.344.1111.63
Martin et al. (2020b)41.206.0281.7035.882.359.22
+ +Table 1: Comparison of supervised and unsupervised simplification models on the Newsela test set. PA and DL refer to paraphrasing and deletion, respectively. RM and EX refer to the removal and extraction sub-operations of the deletion operation. $\uparrow$ denotes the higher the value, the better. $\downarrow$ denotes the lower the value, the better. + +the complex sentence, compared to the reference text, where $1 \leq n \leq 4$ . We report the overall SARI score, as well as individual SARI scores corresponding to n-grams correctly added (ADD), deleted (DELETE) and kept (KEEP); the overall SARI score is the mean of these three scores. We also report the FKGL score, which only considers the output sentence, not the source and reference sentences. It is computed based on sentence length and the number of syllables for each word in the sentence. We use the EASSE package (Alva-Manchego et al., 2019) to calculate SARI and FKGL. We do not use the BLEU (Papineni et al., 2002) metric since Sulem et al. (2018) showed that BLEU does not correlate well with simplicity. + +# 4.4 Models Tested + +We evaluate GRS with different configurations: only deletion - GRS: DL(RM+EX), only paraphrasing - GRS: PA, and both deletion and paraphrasing - GRS: PA+DL(RM+EX). We also consider the complex sentence itself as a trivial baseline, denoted by 'Identity Baseline'. The ASSET dataset contains multiple references for a sentence, so we also calculate an upper bound for a given evaluation metric, which we denote as 'Gold Reference'. To calculate the 'Gold Reference' score, each reference is selected once, and the scores are calculated against others. Finally, we average across all the reference scores to obtain the final 'Gold Reference' score. + +We also compare GRS with existing approaches. From unsupervised methods, we select unsupervised generative models that use Seq2Seq models Surya et al. (2019); Zhao et al. (2020). We + +also compare with Martin et al. (2020b), which leverages pretrained language models and a large paraphrase pair dataset, and Kumar et al. (2020), an iterative revision-based method with several explicit edit operations (deletion, lexical substitution and reordering). + +From supervised methods, we start with Narayan and Gardent (2014) and Xu et al. (2016), which use phrase-based MT models. We also consider Seq2Seq generative methods: Zhang and Lapata (2017), which uses reinforcement learning, and Zhao et al. (2020); Martin et al. (2020a,b), which use Seq2Seq transformer models. Next, we select Omelianchuk et al. (2021), a recent supervised revision-based method. Finally, we consider Dong et al. (2019), a hybrid approach using explicit edit operations in a generative framework. + +# 4.5 Evaluation Results + +Tables 1 and 2 illustrate the results on Newsela and ASSET, respectively. We report the overall SARI score, the individual scores of three operations used in SARI score, the FKGL score, and the average length of the output sentences. To evaluate previous methods, we obtained their output sentences on ASSET and Newsela from the respective project Github pages or by contacting the respective authors, followed by calculating the SARI and FKGL scores using the EASSE package (described in Section 4.3). One exception is Omelianchuk et al. (2021): since they also used the EASSE package, we copied their reported ASSET scores in Table 2, but they did not report the average sentence length. + +For Newsela, using paraphrasing and deletion + +
ModelSARI ↑Add ↑Delete ↑Keep ↑FKGL ↓Len
Identity Baseline20.730.000.0062.2010.0219.72
Gold Reference44.8910.1758.7665.736.4916.54
Unsupervised Models
Surya et al. (2019)35.190.8345.9858.757.6016.81
Zhao et al. (2020)33.951.9942.0957.777.5118.80
Kumar et al. (2020)36.671.2951.3357.407.3316.56
Martin et al. (2020b)42.427.1561.3258.777.4916.36
GRS: DL (RM + EX)37.900.8962.3250.504.1711.18
GRS: PA40.417.0062.3751.886.7017.94
GRS: PA + DL (RM + EX)37.403.8967.4640.853.4510.69
Supervised Models
Narayan and Gardent (2014)34.651.359.2443.415.1810.95
Xu et al. (2016)37.115.0745.2161.067.9520.50
Zhang and Lapata (2017)36.592.3850.1057.307.6614.37
Zhao et al. (2018)38.674.3651.3760.297.7318.36
Dong et al. (2019)34.952.4042.6959.738.3816.49
Martin et al. (2020a)40.136.5350.8462.997.2919.49
Zhao et al. (2020)35.152.2245.3257.917.8316.14
Martin et al. (2020b)44.0510.9361.9159.306.1318.49
Omelianchuk et al. (2021)43.218.0464.2557.356.87——
+ +Table 2: Comparison of supervised and unsupervised simplification models on the ASSET test set. PA and DL refer to paraphrasing and deletion, respectively. RM and EX refer to the removal and extraction sub-operations, the sub-operations of the deletion operation. $\uparrow$ denotes the higher value, the better. $\downarrow$ denotes the lower value, the better. + +
ValueSARI ↑Add ↑Delete ↑Keep ↑FKGL ↓Len
Effect of Meaning Preservation Threshold (Hmp)
0.2538.182.1584.6427.760.427.68
0.539.492.3083.5832.591.638.99
0.639.782.5981.9434.802.4610.29
0.739.993.1679.8136.993.2712.16
Effect of the Removal Threshold of Deletion Operation (tdl-rm)
0.937.331.9382.7227.342.198.58
1.038.032.2081.6330.252.539.80
1.140.013.0680.4336.533.2011.72
1.239.983.1579.9636.853.2612.07
Effect of the Paraphrasing Threshold (tpar)
0.839.993.1679.8136.993.2712.16
0.940.013.1579.5537.313.3212.24
1.039.422.6975.0340.543.8412.99
1.138.551.9770.4743.234.1113.50
Effect of the Linguistic Acceptability Threshold (Hla)
0.639.423.0678.1937.003.6512.54
0.739.523.0077.9837.573.6812.67
0.839.693.0877.6038.403.7912.85
0.938.412.9376.8738.424.0413.04
+ +Table 3: Impact of paraphrasing, deletion, meaning preservation, and linguistic acceptability thresholds on the Newsela dataset. + +together (GRS: PA + DL(RM+EX)) gives the best performance on the SARI metric. On the Newsela dataset, our best model outperforms previous unsupervised methods and achieves +1.6 SARI improvement. It also outperforms all supervised methods except Martin et al. (2020b). + +For ASSET, even though Martin et al. (2020b) perform better than our best model, we improve + +the performance over Kumar et al. (2020) by $+3.6$ SARI points and close the gap between revision-based and generative approaches. Compared to supervised models, our unsupervised model again outperforms others except Martin et al. (2020b) and Omelianchuk et al. (2021). For the ASSET dataset, we observe that our model with only paraphrasing (GRS (PA)) has the best SARI score. + +Analyzing the results, we observe that simplification is done differently by human annotators in Newsela than in ASSET. In Newsela, removal of peripheral information through content deletion happens more aggressively. The average reference sentence length is 12.75 compared to 23.04 for the source sentences. However, in ASSET, content removal is conservative and can be handled by paraphrasing alone. The average reference sentence length is 16.54 compared to 19.72 for the source sentences. Simplifications in ASSET focus on lexical simplification, sentence splitting and word reordering. + +Martin et al. (2020b) leverage a pretrained BART model (Lewis et al., 2020) and fine-tune it on a paraphrasing dataset containing 1.1 million sequence pairs. Unlike traditional paraphrasing datasets that are structured at the sentence level, their paraphrasing dataset contains multiple sentences in a sequence, thus allowing the model to learn a sentence splitting operation as well. Thus, they outperform + +
CCD-moduleAcc ↑Rec ↑Prec ↑F1 ↑
LS-CCD84.6737.3670.5148.84
Att-Cls84.5847.9572.5957.75
+ +Table 4: Performance of different Complex Component Detectors (CCD) on the Complex Word Identification (CWI) task. CWIG3G2 dataset has been used for this evaluation. LS-CCD and Att-Cls refer to the CCD module obtained from Lexical Simplification edit operation of Kumar et al. (2020) and the original CCD module used in GRS design explained in Section 3.3, respectively. $\uparrow$ denotes the higher value, the better. + +the previous best unsupervised models on ASSET. On Newsela, both GRS and the model from Kumar et al. (2020) perform better than Martin et al. (2020b) since they include an explicit removal edit operation. Martin et al. (2020b) instead do not explicitly perform content removal and only do content deletion by way of paraphrasing. Finally, Kumar et al. (2020) does not perform well on ASSET since they do not perform paraphrasing. Our new design thus combines the advantages of both revision-based and generative approaches. + +# 4.6 Controllability + +By manipulating the thresholds for the components of the score function and the edit operations, we can control the amount of deletion, paraphrasing, and the trade-off between simplicity and meaning preservation. We show the results in Table 3 using the GRS (PA + DL) model and the Newsela test set. The column labels have the same meaning as in Tables 1 and 2. + +Meaning Preservation Threshold: As mentioned in Section 3.5, meaning preservation is a hard filter in our score function. As the meaning preservation threshold increases, candidate sentences less similar to the original sentence are pruned. Sentences more similar to the original sentence have higher Keep and lower Delete SARI scores. The SARI Add score increases since paraphrasing is prioritized over deletion. Finally, the length of the output sentences increases since the model becomes more conservative. + +Removal Threshold of Deletion Operation: By increasing this threshold, the SARI Keep score increases and the SARI Delete score decreases, which also results in increased average length. The SARI Add score increases as well since a higher deletion threshold makes the model conservative on deletions and thus candidates from the paraphras + +ing operation are more likely to be selected. + +Paraphrasing Threshold: Reducing this threshold results in more aggressive paraphrasing. Thus, we observe an increase in the SARI Delete and Add scores since paraphrasing replaces complex words and phrases with simpler ones. + +Linguistic Acceptability Threshold: Like meaning preservation, linguistic acceptability is a hard filter in our score function (Section 3.5). As the linguistic acceptability threshold increases, more candidate sentences receive a zero score. This results in a more conservative model that makes fewer changes to the input sentences because the original sentences are already linguistically acceptable. By increasing the linguistic acceptability threshold, the SARI Deletion score drops and the SARI Keep score increases. Also, this results in longer sentences. + +# 4.7 Complex Component Detector Evaluation + +To show the effectiveness of the proposed Complex Component Detector (CCD) mentioned in Section 3.3, we evaluate the CCD module on the Complex Word Identification (CWI) task. The task is defined as a sequence tagging problem in which each word in a sentence is tagged as complex or not complex. We use the test set of CWIG3G2 (Yimam et al., 2017), a professionally written news dataset. As explained in Section 3.3, the CCD module used in GRS (denoted by Att-Cls) operates by interpreting the attention matrix of the second layer of the complex-simple classifier. We also compare with the lexical simplification operation of Kumar et al. (2020), denoted by LS-CCD. It uses the IDF scores to find complex words in a sentence. + +Table 4 shows the complex word identification performance of the two CCD modules on CWIG3G2. Att-Cls outperforms LS-CCD in recall, precision, and the F1 score. Tables 5 demonstrate the performance of GRS with different CCD modules on ASSET (Alva-Manchego et al., 2020) and Newsela (Xu et al., 2015) test sets. On both datasets, the GRS model using Att-Cls has higher deletion and addition scores compared to the GRS model using LS-CCD. The overall SARI score is considerably higher when using Att-Cls on ASSET. + +# 4.8 Simplification Search Analysis + +GRS is an interpretable unsupervised simplification method in which we can trace the simplification process. That is, we know which edit operation is applied on a given complex sentence in each + +
ModelSARI ↑Add ↑Delete ↑Keep ↑FKGL ↓Len
ASSET
Identity Baseline20.730.000.0062.2010.0219.72
Gold Reference44.8910.1758.7665.736.4916.54
GRS(PA, CCD:LS-CCD)37.805.5957.3950.447.1718.75
GRS(PA, CCD:Att-Cls)40.417.0062.3751.886.7017.94
Newsela
Identity Baseline12.240.000.0036.728.8223.04
GRS(PA+DL(RM), CCD:LS-CCD)39.302.8778.1836.853.3913.54
GRS(PA+DL(RM), CCD:Att-Cls)39.613.1879.1336.523.4513.43
+ +Table 5: Comparison of GRS versions that use different Complex Component Detectors (CCD) on ASSET and Newsela. PA and DL refer to paraphrasing and deletion, respectively. RM refers to removal, which is the sub-operation used in deletion operation. $\uparrow$ denotes the higher value, the better. $\downarrow$ denotes the lower value, the better. + +
ModelIterations/Sent (all-Operations)PA-iterationsDL-iterations
RMEX
Newsela
GRS: PA4.724.72--
GRS: DL0.79-0.460.33
GRS: PA + DL4.403.720.370.31
ASSET
GRS: PA4.184.18--
GRS: DL1.05-0.540.51
GRS: PA + DL3.792.940.390.45
+ +iteration. Table 6 demonstrates how many simplification iterations were needed to simplify a complex sentence, on average, in the Newsela and ASSET datasets. We also show the average frequency of each operation to simplify a given sentence. + +Table 6 illustrates that when both edit operations are allowed (GRS:PA+DL), almost four simplification iterations are applied to a sentence, and paraphrasing is generally more common than deletion. + +# 4.9 Human Evaluation + +We selected 30 sentences from the ASSET test set for human evaluation. Following (Kriz et al., 2019), we measure Fluency (whether the sentence is grammatical and well-formed), Simplicity (whether it is simpler than the complex sentence), and Adequacy (whether it keeps the meaning of the complex sentence). We asked four volunteers to assess the sentences based on these metrics and evaluate the performance of various models, including GRS. Results are shown in Table 7. All models are unsupervised except Dress-Ls (Zhang and Lapata, 2017). + +Table 6: Analysis of edit operation used during simplification search, showing the average number of simplification iterations of GRS and the average share of each edit operation. PA and DL refer to paraphrasing and deletion, respectively. RM and EX refer to the removal and extraction sub-operations of the deletion operation. + +
CCD-moduleAdequacy ↑Simplicity ↑Fluency ↑Average ↑
Reference4.294.084.764.37
GRS(PA)3.984.044.474.17
(Surya et al., 2019)3.573.484.323.79
(Zhao et al., 2020)3.893.274.543.89
(Martin et al., 2020b)3.954.174.784.30
(Kumar et al., 2020)3.153.564.153.62
(Zhang and Lapata, 2017)3.673.644.694.00
+ +Table 7: Human evaluation on the ASSET dataset. Adequacy, simplicity, and fluency are human evaluation metrics, and in the fourth column, the average of these metrics is shown. Each row represents a simplification model. Human evaluation scores are based on a 1-5 Likert scale. $\uparrow$ denotes the higher value, the better. + +The fourth column in Table 7 shows the average score of all three metrics used in the human evaluation. According to the average scores, MUSS (Martin et al., 2020b) has the best performance, followed by GRS. The human evaluation demonstrates that the automatic evaluation (SARI scores shown in Table 2) is aligned with human evaluation scores. GRS has the best performance in meaning preservation (Adequacy). This may be because we have a relatively conservative paraphrasing model. Also, GRS evaluated in this study is only leveraging paraphrasing, and this version is the most conservative. + +# 5 Conclusion + +We proposed GRS, a controllable and interpretable method for unsupervised text simplification that bridges the gap between previous unsupervised generative and revision-based approaches. We combined the two approaches by incorporating an explicit paraphrasing edit operation into an iterative simplification search algorithm. Empirically, we showed that GRS has the advantages of both approaches. GRS outperformed state-of-the-art unsupervised methods on the Newsela dataset and reduced the gap between generative and revision-based unsupervised models on the ASSET dataset. + +# References + +Sweta Agrawal, Weijia Xu, and Marine Carpuat. 2021. A non-autoregressive edit-based approach to controllable text simplification. In *Findings of the Association for Computational Linguistics: ACL-IJCNLP* 2021, pages 3757-3769, Online. Association for Computational Linguistics. +Fernando Alva-Manchego, Joachim Bingel, Gustavo Paetzold, Carolina Scarton, and Lucia Specia. 2017. Learning how to simplify from explicit labeling of complex-simplified text pairs. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 295-305, Taipei, Taiwan. Asian Federation of Natural Language Processing. +Fernando Alva-Manchego, Louis Martin, Antoine Bordes, Carolina Scarton, Benoit Sagot, and Lucia Specia. 2020. ASSET: A dataset for tuning and evaluation of sentence simplification models with multiple rewriting transformations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4668-4679, Online. Association for Computational Linguistics. +Fernando Alva-Manchego, Louis Martin, Carolina Scarton, and Lucia Specia. 2019. EASSE: Easier automatic sentence simplification evaluation. 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): System Demonstrations, pages 49-54, Hong Kong, China. Association for Computational Linguistics. +John Carroll, Guido Minnen, Yvonne Canning, Siobhan Devlin, and John Tait. 1998. Practical simplification of english newspaper text to assist aphasic readers. In Proceedings of the AAAI-98 Workshop on Integrating Artificial Intelligence and Assistive Technology, pages 7-10. CiteSeer. +R. Chandrasekar, Christine Doran, and B. Srinivas. 1996. Motivations and methods for text simplification. In *COLING* 1996 Volume 2: The 16th International Conference on Computational Linguistics. +R Chandrasekar and B Srinivas. 1997. Automatic induction of rules for text simplification: revised version of the article originally published in knowledge-based computer systems: Research and applications. (eds k.s.r. anjaneyulu, m. sasikumar and s. ramani) narosa publishing house, new delhi, 1997.1. Knowledge-Based Systems, 10(3):183-190. +Will Coster and David Kauchak. 2011. Learning to simplify sentences using Wikipedia. In Proceedings of the Workshop on Monolingual Text-To-Text Generation, pages 1-9, Portland, Oregon. Association for Computational Linguistics. +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. +Yue Dong, Zichao Li, Mehdi Rezagholizadeh, and Jackie Chi Kit Cheung. 2019. EditNTS: An neural programmer-Interpreter model for sentence simplification through explicit editing. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3393–3402, Florence, Italy. Association for Computational Linguistics. +Richard Evans, Constantin Orasan, and Iustin Dornescu. 2014. An evaluation of syntactic simplification rules for people with autism. In Proceedings of the 3rd Workshop on Predicting and Improving Text Readability for Target Reader Populations (PITR), pages 131-140, Gothenburg, Sweden. Association for Computational Linguistics. +Han Guo, Ramakanth Pasunuru, and Mohit Bansal. 2018. Dynamic multi-level multi-task learning for sentence simplification. In Proceedings of the 27th International Conference on Computational Linguistics, pages 462-476, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2020. Deberta: Decoding-enhanced bert with disentangled attention. In International Conference on Learning Representations. +Chris Hokamp and Qun Liu. 2017. Lexically constrained decoding for sequence generation using grid beam search. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1535-1546, Vancouver, Canada. Association for Computational Linguistics. +J. Edward Hu, Huda Khayrallah, Ryan Culkin, Patrick Xia, Tongfei Chen, Matt Post, and Benjamin Van Durme. 2019a. Improved lexically constrained decoding for translation and monolingual rewriting. 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 839-850, Minneapolis, Minnesota. Association for Computational Linguistics. +J. Edward Hu, Abhinav Singh, Nils Holzenberger, Matt Post, and Benjamin Van Durme. 2019b. Large-scale, diverse, paraphrastic bittexts via sampling and clustering. In Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL), pages 44-54, Hong Kong, China. Association for Computational Linguistics. +Chao Jiang, Mounica Maddela, Wuwei Lan, Yang Zhong, and Wei Xu. 2020. Neural CRF model for + +sentence alignment in text simplification. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7943-7960, Online. Association for Computational Linguistics. +Beata Beigman Klebanov, Kevin Knight, and Daniel Marcu. 2004. Text simplification for information-seeking applications. In OTM Confederated International Conferences "On the Move to Meaningful Internet Systems", pages 735-747. Springer. +Reno Kriz, João Sedoc, Marianna Apidianaki, Carolina Zheng, Gaurav Kumar, Eleni Miltsakaki, and Chris Callison-Burch. 2019. Complexity-weighted loss and diverse reranking for sentence simplification. 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 3137-3147. +Dhruv Kumar, Lili Mou, Lukasz Golab, and Olga Vechtomova. 2020. Iterative edit-based unsupervised sentence simplification. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7918-7928, Online. Association for Computational Linguistics. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. 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. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In International Conference on Learning Representations. +Mounica Maddela, Fernando Alva-Manchego, and Wei Xu. 2021. Controllable text simplification with explicit paraphrasing. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3536-3553, Online. Association for Computational Linguistics. +Louis Martin, Éric de la Clergerie, Benoit Sagot, and Antoine Bordes. 2020a. Controllable sentence simplification. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 4689-4698, Marseille, France. European Language Resources Association. +Louis Martin, Angela Fan, Éric de la Clergerie, Antoine Bordes, and Benoit Sagot. 2020b. Muss: Multilingual unsupervised sentence simplification by mining paraphrases. arXiv preprint arXiv:2005.00352. +Shashi Narayan and Claire Gardent. 2014. Hybrid simplification using deep semantics and machine translation. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 435-445, Baltimore, + +Maryland. Association for Computational Linguistics. +Shashi Narayan and Claire Gardent. 2016. Unsupervised sentence simplification using deep semantics. In Proceedings of the 9th International Natural Language Generation conference (INLG), pages 111-120. +Daiki Nishihara, Tomoyuki Kajiwara, and Yuki Arase. 2019. Controllable text simplification with lexical constraint loss. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop, pages 260-266, Florence, Italy. Association for Computational Linguistics. +Sergiu Nisioi, Sanja Štajner, Simone Paolo Ponzetto, and Liviu P. Dinu. 2017. Exploring neural text simplification models. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 85-91, Vancouver, Canada. Association for Computational Linguistics. +Kostiantyn Omelianchuk, Vipul Raheja, and Oleksandr Skurzhanskyi. 2021. Text Simplification by Tagging. In Proceedings of the 16th Workshop on Innovative Use of NLP for Building Educational Applications, pages 11-25, Online. Association for Computational Linguistics. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pages 311-318, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics. +Matt Post and David Vilar. 2018. Fast lexically constrained decoding with dynamic beam allocation for neural machine translation. 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 1314-1324, New Orleans, Louisiana. Association for Computational Linguistics. +Machel Reid and Victor Zhong. 2021. LEWIS: Levenshtein editing for unsupervised text style transfer. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 3932-3944, Online. Association for Computational Linguistics. +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. Association for Computational Linguistics. +Carolina Scarton and Lucia Specia. 2018. Learning simplifications for specific target audiences. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), + +pages 712-718, Melbourne, Australia. Association for Computational Linguistics. +Sanja Štajner and Maja Popovic. 2016. Can text simplification help machine translation? In Proceedings of the 19th Annual Conference of the European Association for Machine Translation, pages 230-242. +Elior Sulem, Omri Abend, and Ari Rappoport. 2018. Semantic structural evaluation for text simplification. 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 685-696, New Orleans, Louisiana. Association for Computational Linguistics. +Sai Surya, Abhijit Mishra, Anirban Laha, Parag Jain, and Karthik Sankaranarayanan. 2019. Unsupervised neural text simplification. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2058-2068, Florence, Italy. Association for Computational Linguistics. +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, volume 30. Curran Associates, Inc. +David Vickrey and Daphne Koller. 2008. Sentence simplification for semantic role labeling. In Proceedings of ACL-08: HLT, pages 344–352, Columbus, Ohio. Association for Computational Linguistics. +Jesse Vig. 2019. A multiscale visualization of attention in the transformer model. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 37-42, Florence, Italy. Association for Computational Linguistics. +Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. 2019. Neural network acceptability judgments. Transactions of the Association for Computational Linguistics, 7:625-641. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric 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. +Sander Wubben, Antal van den Bosch, and Emiel Krahmer. 2012. Sentence simplification by monolingual machine translation. In Proceedings of the 50th Annual Meeting of the Association for Computational + +Linguistics (Volume 1: Long Papers), pages 1015-1024, Jeju Island, Korea. Association for Computational Linguistics. +Wei Xu, Chris Callison-Burch, and Courtney Naples. 2015. Problems in current text simplification research: New data can help. Transactions of the Association for Computational Linguistics, 3:283-297. +Wei Xu, Courtney Napoles, Ellie Pavlick, Quanze Chen, and Chris Callison-Burch. 2016. Optimizing statistical machine translation for text simplification. Transactions of the Association for Computational Linguistics, 4:401-415. +Seid Muhie Yimam, Sanja Štajner, Martin Riedl, and Chris Biemann. 2017. CWIG3G2 - complex word identification task across three text genres and two user groups. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 401-407, Taipei, Taiwan. Asian Federation of Natural Language Processing. +Xingxing Zhang and Mirella Lapata. 2017. Sentence simplification with deep reinforcement learning. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 584-594, Copenhagen, Denmark. Association for Computational Linguistics. +Sanqiang Zhao, Rui Meng, Daqing He, Andi Saptono, and Bambang Parmanto. 2018. Integrating transformer and paraphrase rules for sentence simplification. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3164-3173, Brussels, Belgium. Association for Computational Linguistics. +Yanbin Zhao, Lu Chen, Zhi Chen, and Kai Yu. 2020. Semi-supervised text simplification with backtranslation and asymmetric denoising autoencoders. Proceedings of the AAAI Conference on Artificial Intelligence, 34(05):9668-9675. +Zhemin Zhu, Delphine Bernhard, and Iryna Gurevych. 2010. A monolingual tree-based translation model for sentence simplification. In Proceedings of the 23rd International Conference on Computational Linguistics (Coling 2010), pages 1353-1361, Beijing, China. Coling 2010 Organizing Committee. \ No newline at end of file diff --git a/grscombininggenerationandrevisioninunsupervisedsentencesimplification/images.zip b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4ada07aaad5c96ed67647343bfbefd892592b079 --- /dev/null +++ b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69a43a8b031cbf15e00ea2a0c8628b5c278e741dbc80ef67d94653578f884df6 +size 478115 diff --git a/grscombininggenerationandrevisioninunsupervisedsentencesimplification/layout.json b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2b9c00908ba2d649f3f131ac34cace0fef13449c --- /dev/null +++ b/grscombininggenerationandrevisioninunsupervisedsentencesimplification/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d2d3ef51605fe6f15756e07d6f88843eb7e71ded5cb386929afbfc586ce4b7b +size 341828 diff --git a/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_content_list.json b/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e68c677efa4fb1b43ec35762687b1887b34d7714 --- /dev/null +++ b/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9932685727fd768bc3c75c725eac0310457655fe9c7b2dfc2d3b0f67f8fe24a +size 104742 diff --git a/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_model.json b/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..32bf68ebf1dc31acc3363a9d906bec1c4165ade0 --- /dev/null +++ b/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c879446fb591ef54e6190688e733da9b4803ededad97e0170ebfcedddf221c6f +size 128047 diff --git a/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_origin.pdf b/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1ff16559bd2a6e0c30eb1a612bb1d1b79b9e120d --- /dev/null +++ b/heyaicanyousolvecomplextasksbytalkingtoagents/12b79a59-c4d0-4f33-ab61-dbbd805176d0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d22df2d526a2ae153a727d10c7f8d6e5addf4cd69e83849affdc326125af7a90 +size 1009323 diff --git a/heyaicanyousolvecomplextasksbytalkingtoagents/full.md b/heyaicanyousolvecomplextasksbytalkingtoagents/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4efd5bacfdb039e06ebafc718cc3f255177327f1 --- /dev/null +++ b/heyaicanyousolvecomplextasksbytalkingtoagents/full.md @@ -0,0 +1,443 @@ +# Hey AI, Can You Solve Complex Tasks by Talking to Agents? + +# Tushar Khot Kyle Richardson Daniel Khashabi Ashish Sabharwal + +Allen Institute for AI, Seattle, WA, U.S.A. + +{tushark,kyler,danielk,ashishs} $@$ allenai.org + +# Abstract + +Training giant models from scratch for each complex task is resource- and data-inefficient. To help develop models that can leverage existing systems, we propose a new challenge: Learning to solve complex tasks by communicating with existing agents (or models) in natural language. We design a synthetic benchmark, COMMAQA, with three complex reasoning tasks (explicit, implicit, numeric) designed to be solved by communicating with existing QA agents. For instance, using text and table QA agents to answer questions such as "Who had the longest javelin throw from USA?" We show that black-box models struggle to learn this task from scratch (accuracy under $50\%$ ) even with access to each agent's knowledge and gold facts supervision. In contrast, models that learn to communicate with agents outperform black-box models, reaching scores of $100\%$ when given gold decomposition supervision. However, we show that the challenge of learning to solve complex tasks by communicating with existing agents without relying on any auxiliary supervision or data still remains highly elusive. We release COMMAQA, along with a compositional generalization test split, to advance research in this direction. + +# 1 Introduction + +A common research avenue pursued these days is to train monolithic language models with billions of parameters (Radford et al., 2019; Raffel et al., 2020; Brown et al., 2020) to solve every language understanding and reasoning challenge (Wang et al., 2018, 2019). In contrast, humans often tackle complex tasks by breaking them down into simpler subtasks, and solving these by interacting with other people or automated agents whose skill-sets we are familiar with. This approach allows us to learn to solve new complex tasks quickly and effectively, by building upon what's already known. Can AI systems learn to do the same? + +![](images/82bd6757aa0b6a3831315e4028e4ce3aa2b1f85f50e58fa3e13847e0f6c4c64e.jpg) +Figure 1: Motivating example for a setup where a system is expected to learn to accomplish goals by interacting with agents via a natural language interface. + +To facilitate research in this direction, we propose a new reasoning challenge and a benchmark called COMMAQA where, in addition to the usual end-task supervision, one has access to a set of predefined AI agents with examples of their natural language inputs. Importantly, the target end-task is designed to be too difficult for current models to learn based only on end-task supervision. The goal is instead to build models that learn to solve the target task by decomposing it into sub-tasks solvable by these agents, and interacting with these agents in natural language to do so. + +As a motivating example, consider the interaction depicted in Figure 1 where a system is asked to buy a book series with a certain property. The system breaks this goal down, using agent-1 (here Google Assistant) to identify the referenced book series as well as the list of books in that series, and then using agent-2 (here Amazon Alexa) to make the purchase. While both of these agents interact with the system in natural language, they have different and complementary skill sets, $^{2}$ rely on privately held knowledge sources, and have been + +built at an enormous cost. At the same time, neither agent by itself can accomplish the original goal. + +An alternative to building such a system that interacts with existing agents is to teach all requisite sub-tasks and skills to a large black-box system, say via multi-task learning (Khashabi et al., 2020; Gupta et al., 2021). This, however, not only wastes time and resources, but is often also infeasible. For example, agents such as Google Assistant and OpenAI GPT-3 use private knowledge resources and are computationally expensive to train even once. It would thus be nearly impossible to build a single system with the capabilities of both of these agents. + +We note that agents need not be sophisticated AI assistants. An agent may simply be a previously developed question-answering (QA) model, a math module, a function of textual input, an image captioning system—anything the community already knows how to build. The goal is to learn to leverage existing agents for more complex tasks. + +To enable the development of general systems for this task, we identify the minimal inputs that must be assumed for the task to be learnable—training data for the complex task, existing agents that together can solve the complex task, and examples of valid questions that can be asked of these agents (capturing the agents' capabilities). We build a new synthetic benchmark dataset called COMMAQA (Communicating with agents for QA), containing three complex multihop QA tasks (involving Explicit, Implicit, and Numeric reasoning) and four input QA agents that can solve these tasks. + +COMMAQA is not yet another multi-hop reading comprehension dataset. It is designed to facilitate the development of a new family of techniques that teach systems to communicate with a wide variety of agents to solve different types of complex tasks. + +We demonstrate that black-box models struggle on COMMAQA even when provided with auxiliary data, such as domain-relevant agent knowledge. On the other hand, a model that leverages the agents (Khot et al., 2021) can achieve very high accuracy but relies on auxiliary supervision (decomposition annotations). While it is possible to identify valid decompositions using just the end-task labels, the search space is extremely large and naive approaches, as we show, help only with one of the datasets. COMMAQA thus serves as a new challenge for the NLP community. + +Contributions: We (1) propose a new challenge of learning to solve complex tasks by communicat- + +ing with agents; (2) develop a synthetic multi-hop QA dataset COMMAQA with three reasoning types; (3) provide auxiliary training data and a compositional generalization test set; (4) demonstrate the challenging nature of COMMAQA for black-box models; and (5) show the promise of compositional models that learn to communicate with agents. + +# 2 Related Work + +Multi-hop QA (Khashabi et al., 2018; Mihaylov et al., 2018; Khot et al., 2020; Geva et al., 2021) focuses on reasoning with multiple facts. Some multi-hop datasets (Yang et al., 2018; Dua et al., 2019) have been used to develop modular approaches such as TMNs (Khot et al., 2021), which are a step towards our goal—they try to solve complex questions by leveraging agents such as single-hop QA models. However, these approaches have had limited success because current datasets are insufficient for the development of such models, for two reasons. First, prevalent single-hop shortcuts (Min et al., 2019a; Trivedi et al., 2020) incentivize models trained on answer supervision alone to learn to exploit these shortcuts rather than learn to compositionally communicate with agents. E.g., they learn to answer a multi-hop question by just asking one single-hop question (Min et al., 2019b). Second, these datasets often contain sub-problems not solvable by existing models/agents, such as producing structured output (e.g., outputting a list of all touchdowns mentioned in the context).3 + +Semantic Parsing typically focuses on mapping language problems to executable symbolic representation based on a pre-defined grammar (Krishnamurthy et al., 2017; Chen et al., 2020). Similar ideas are also found in the area of program synthesis (Gulwani, 2011; Desai et al., 2016). These goals, like ours, seek to simplify complex problems into simpler executable forms, without relying on explicit intermediate annotation (Clarke et al., 2010; Berant et al., 2013). We, however, diverge from this line by seeking agent communication in free-form language, not bound to any pre-specified set of operations or domain specific languages. + +# Question Decomposition is used to solve multi + +hop QA but the resulting models (Talmor and Berant, 2018; Min et al., 2019b; Perez et al., 2020; Khot et al., 2021) are often dataset-specific, rely on decomposition annotations, and limited to one or two QA agents. To address these limitations, our proposed challenge covers three dataset types and four agents. Additionally, models are expected to learn to decompose the task by interacting with the agents, rather than relying on human annotations. + +Synthetic Reasoning Challenges have recently been proposed (Lake and Baroni, 2018; Sinha et al., 2019; Clark et al., 2020; Betz and Richardson, 2021) to help systematically identify the weaknesses of existing models and inspire modeling innovation (Liu et al., 2021). Our new tasks are unique and focus on simulating complex agent interaction to motivate the development of decomposition-based modeling approaches. + +Text-Based Games, similar to our work, involve interacting in plain text in order to accomplish a goal (Yuan et al., 2019, 2020; Hausknecht et al., 2020; Ammanabrolu et al., 2021; Jansen, 2021). This is typically done in a physical environment, which acts as an "agent" in our setting. Unlike many works in this area, we focus on different classes of compositional questions (e.g., implicit, numerical) and formulate a challenge that makes minimal assumptions about having access to agents' internal information or input language. + +# 3 Challenge Task Definition + +We formalize the new challenge task of learning to talk with agents to solve complex tasks. To ensure generality of solutions, we identify minimal inputs for the task to be well-defined and learnable. + +First we must define $\{f_i\}_{i=1}^m$ , the agents or models that solve simpler sub-tasks. Minimally, we need to define the space of valid inputs $\mathcal{L}_i$ for each agent $f_i$ , i.e., how can they be invoked. For a system to identify the appropriate agent for each subtask, we also need to define the capabilities of each agent. Since these agents are often defined for natural language tasks, the space of inputs captures the capabilities of these agents too. For instance, "Buy the book 'Harry Potter and the Sorcerer's Stone'" captures the Alexa agent's capability of buying books. Instead of complex formal specifications of the agent's capabilities, we use natural language + +inputs as a rich and convenient representation. + +Next, we need a target task $\mathcal{T}$ that can be solved via a composition of the capabilities of various $f_{i}$ . Finally, to pose this as a machine learning problem, we need training data $\mathcal{D} = \{(x_k,y_k)\}_{k = 1}^N$ for $\mathcal{T}$ . Since collecting annotations for complex tasks can be difficult, $\mathcal{D}$ is expected to be relatively small. Models must therefore use the available agents, instead of learning the complex task from scratch. + +Given these pre-requisites, we can define the challenge task as follows: + +Challenge: Learn a model to solve a complex task $\mathcal{T}$ given only: + +- Training dataset $\mathcal{D} = \{(x_k,y_k)\}_{k = 1}^N$ for $\mathcal{T}$ +- Agents $\{f_1, \ldots, f_m\}$ that can help solve $\mathcal{T}$ ; +- Examples from the space $\mathcal{L}_i$ of valid inputs for each agent $f_{i}$ that captures its capabilities. + +One example of this challenge is answering multi-hop questions given two agents: an open-domain TextQA agent $f_{1}$ and an open-domain TableQA agent $f_{2}$ . Agent $f_{1}$ can use large textual corpora to answer questions such as "Who directed Kill Bill?". Agent $f_{2}$ can use tables (e.g., Filmography tables) to answer questions such as "List the movies directed by Quentin Tarantino". Finally, the training data $\mathcal{T}$ for the complex task would contain examples such as ("What movies has the director of Kill Bill appeared in?", ["Reservoir Dogs", ...,]). + +# 4 Dataset: COMMAQA Benchmark + +We next propose a new benchmark dataset COMMAQA that enables the development of models that can learn to communicate with existing agents. Specifically, we provide a collection of three synthetic datasets where each question is answerable by talking to simple QA agents. Note that we are not proposing a new class of questions but a new dataset for the proposed challenge task. A high-level overview of this dataset is shown in Fig. 2. + +We choose QA as the underlying task and use QA agents for this challenge because the question-answer format can capture a broad range of tasks (Gardner et al., 2019) while also naturally surfacing the capability of each agent. For instance, the question "What are the key frames in v?" describes a capability of the invoked agent (namely, identifying key frames), in addition to the specific inputs. We next describe our framework for build- + +![](images/73543906b3f7079eb1bda7ecb4b6e990636ae5a58e2120daf96155d0a8bcaa57.jpg) +Figure 2: High-level overview of the task, with examples from COMMAQA-E. Given the agents, their valid inputs, and training examples for a complex task, the goal is to learn to solve this task by communicating with the agents. + +ing COMMAQA, which we believe can be extended to other complex tasks, e.g., video summarization. + +# 4.1 Agent Definition + +To define the $i$ -th agent, we build a knowledge base that captures its internal knowledge resource $\mathcal{K}_i$ . We use natural language question templates to define the set of questions that this agent can answer over this internal knowledge. For example, given a KB with relations such as "directed(x,y)", the agent would answer questions based on the template: "Who directed the movie _?" + +Knowledge Base, $\kappa_{i}$ . To build the knowledge base, we define a KB schema as a set of binary relations between entity types, e.g., director/movie, person). We build a list of entity names that belong to each entity type. To avoid potential conflicts with the LM's pre-training knowledge, all entity names are generated non-existent words. + +Rather than building a static and very large KB, we sample a possible world independently for each question, by sub-sampling entities for each entity type and then randomly assigning the KB relations between these entities. This prevents memorization of facts across the train and test splits, which in the past has led to over-estimation of QA model performance (Lewis et al., 2021). This also encourages models to learn proper multi-hop reasoning using the agents, rather than memorizing answers. + +Examples of Valid Inputs. To define the space of valid inputs for each agent $f_{i}$ , we define a set of question templates that can be answered by it over $\mathcal{K}_{ik}$ (e.g., Who directed _?). We construct questions corresponding to a relation in both directions, e.g., "Who all directed _?" and "For which movies was _ a director?". To emulate diversity + +in natural language, we specify multiple phrasings for the same question. We use these templates to generate examples of valid inputs in $\mathcal{L}_i$ by grounding them with entities of the appropriate entity type (e.g., Who directed Kill Bill?). + +To ensure generalization to a broad set of tasks, we do not limit the questions to only single span answers. Depending on the question, the agent can produce answers as a single string (span, boolean or a number), a list of strings (e.g., "Which movies did Spielberg direct?"), or a map (e.g., "What are the states and their capitals in USA?"). + +Implementation. To answer the question, agents convert questions into queries against their internal knowledge (based on the templates) which we implement as a symbolic function (written in Python), instead of a model. While a language model might be able to generalize to out-of-distribution variations in language, its behavior can be often unpredictable. By implementing the agents as pattern-based functions, we ensure that the resulting systems would stay within the language constraints of each agent and generalize to restricted language models. Additionally, this enables faster development of approaches without spending resources on running a large-scale LM for each agent. + +# 4.2 Complex Task Definition + +Given the space of valid input questions for each agent, we construct training examples for the complex task using templated theories. These theories consist of a complex question template and a composition rule expressed as a sequence of questions asked to appropriate agents. For example, + +"What movies have the directors from $1 directed?" + +#1 = [textQA] "Who is from the country $1?" + +$2 =$ [tableqa] "Which movies has #1 directed?" + +
OperatorPseudo-codeExample
selectreturn fi(q(a))#1=[23, 35] q="Which is largest value in #1?" fi=mathqa → 35
projectreturn [(x, fi(q(x))) for x in a]#1=[Jordan, Johnson] q="What were the lengths of throw by #1?" fi= textqa → [(Jordan, [23, 34]), (Johnson, [45, 56])]
projectValuesreturn [(k, fi(q(v))) for (k, v) in a]#1=[(Jordan, [23, 34]), (Johnson, [45, 56])] q="Which is largest value in #1?" fi=mathqa → [(Jordan, 34), (Johnson, 56)]
filterreturn [x for x in a if fi(q(x))]#1=[23, 34, 56] q="Is #1 greater than 50?" fi=mathqa → [56]
filterValuesreturn [(k, v) for (k, v) in a if fi(q(v))]#1=[(Jordan, 34), (Johnson, 56)] q="Is #1 greater than 50?" fi=mathqa → [(Johnson, 56)]
+ +Composition Operators. While this simple theory would work for single span answers, these agents often return list or map answers. Even within this simple example, there can be multiple directors from a given country and this list cannot be directly fed to the tableqa model, i.e., "Which movies has [...] directed?". This problem gets even more challenging with complex structures. E.g., maintaining a map structure while operating on the values of the map (see 3rd row in Table 1). + +To handle the different answer structures, we define a special set of compositional operators in Table 1. These operators take agent $f_{i}$ , a structured answer $a$ , and a query with a placeholder as inputs, and execute a set of queries (as defined by the pseudo-code in Table 1) against $f_{i}$ . These operators are inspired by QDMR (Wolfson et al., 2020), but modified to be actually executable. E.g., the "project" operator in QDMR: "return directors of #1?" does not specify how to execute this query whereas our operation (project) [textqa] "Who are the directors of #1?" specifies how to use the TextQA model and #1 to generate a map. + +We also define a set of agent-independent data structure transformations in Table 2, e.g., convert a map into a list of its keys. Since longer chains of reasoning are prone to more errors (Fried et al., 2015; Khashabi et al., 2019), we don't model these simple transformations as additional reasoning steps. Instead, we concatenate compositional operators with transformations to create about 20 new, combined operators such that transformations can be applied after an operation in a single step, e.g., project Values operation performs the project operation followed by the Values transformation. + +Given these operators, the final theory for the above example would look like: + +Table 1: Compositional Operators used in this work to transform structured answers into queries answerable by an agent. The operator takes the agent $f_{i}$ , a structured answer $a$ (we use the answer index, e.g., #1, to refer to any answer), and a query with a placeholder as inputs and executes the pseudo-code shown here. + +
"What movies have the directors from $1 directed?"
#1 = (select) [textqa] "Who is from the country $1?"
#2 = (project_valuesflat_unique) [tableqa] "Which movies has #1 directed?"
+ +
Transf.Procedure
FLATFlatten list of lists into a single list
UNIQUEReturn the unique items from a list
KEYSReturn the list of keys from a map
VALUESReturn the list of values from a map
+ +Table 2: Simple transformations that modify the output data structure. These transformations can be chained together with an operation, e.g., PROJECT VALUES. + +Building Examples. Given a KB schema, question templates for each agent, and theories, we can now build examples for the complex task (Fig. 3). We first sample a possible world based on the KB schema. We assign each relation to one of the agents based on which agents are likely to answer such questions, i.e., only this agent would answer questions about this relation. This captures multimodality of knowledge, e.g., movie awards might be described in text or a table, but a person's birth date is likely described in text. When a relation can be captured by knowledge in multiple modalities, it is assigned to one of them per KB. This emulates the challenging setting where a model must interact with multiple agents to find the answer.7 We use the templated theories to construct questions by grounding placeholders. We select $m$ valid questions8 for each KB such that each theory has the same number of examples across the dataset. + +# 4.3 Auxiliary Information + +In addition to the basic task definition, we also consider auxiliary information that may be available + +![](images/d378d3524948e73bcb32b1992303158b26eb957aad28b74985dc8ce26e52d1d3.jpg) +Figure 3: High-level schema of our dataset construction process. We use a list of entities and a KB schema to generate a list of facts. The QA agents operate over these facts to answer a set of pre-determined questions that form the examples of valid inputs from $\mathcal{L}_i$ . We define multiple complex question templates and a corresponding theory that can be used to answer them. We then ground these question templates (i.e. sample $1) to create complex questions and use the agents to generate the answers. + +in some cases. The main goal of this information is to (a) provide stepping stones for development of methods towards the final goal of learning to communicate with agents using answer supervision only, and (b) evaluate the abilities of current state-of-the-art assuming access to this additional information. We emphasize that such auxiliary information may not always be available (e.g., when using a proprietary agents such as Alexa). + +We consider two kinds of such information—auxiliary supervision for the complex task's training examples $(x_{k},y_{k})\in \mathcal{D}$ , and auxiliary data about the agents $\{f_i\}$ themselves (not tied to $\mathcal{D}$ ). This is summarized in Table 3. + +Auxiliary Supervision for $(x_{k},y_{k})\in \mathcal{D}$ + +- Gold Decomposition $\mathcal{D}_k$ for $x_{k}$ +- Gold Knowledge $\mathcal{F}_k$ for $x_{k}$ + +Auxiliary Data for agents $\{f_i\}$ : + +- Training data $\mathcal{D}_{f_i} = \{(u_{ij},v_{ij})\}_{j = 1}^M$ for agent $f_{i}$ , where $u_{ij}\in \mathcal{L}_i$ and $v_{ij} = f_i(u_{ij})$ +- Complete knowledge resource $\kappa_{i}$ used by $f_{i}$ , or a manageable subset $\kappa_{ik} \subset \kappa_{i}$ containing $\mathcal{F}_{k}$ + +Table 3: Auxiliary information as stepping stones towards the full COMMAQA task. + +For auxiliary supervision, we consider having access to annotated decomposition $\mathcal{D}_k$ of a complex task training input $x_{k}$ into valid inputs for various agents. We also consider annotated gold facts $\mathcal{F}_k$ that could be used to answer $x_{k}$ . + +For auxiliary data, we consider having access to the training data used to build the agents, or the underlying knowledge base $\kappa_{i}$ used by them (and possibly even a question-specific relevant subset $\kappa_{ik}$ ). For example, $\kappa_{i}$ would be equivalent to the entire text and table corpora used by TextQA and TableQA agents, and $\kappa_{ik}$ could be the texts and ta + +bles relevant to the question domain (e.g., movies). Such information can be used to train a stronger black-box model on the end-task, e.g., fine-tuning on the agent's training data first or using the gold facts to identify relevant context. These approaches that circumvent the agents are not the target of our dataset, but we nevertheless evaluate them to highlight their limits. + +Building Auxiliary Information. We generate the gold decomposition $\mathcal{D}_k$ for each example $x_{k}$ using the same language as the theories (see Fig. 4). We verbalize each relation to create the underlying knowledge resource $\kappa_{ik}$ used by the agent $f_{i}$ (e.g., relation director(M, P) is converted into "M was a movie directed by P" or "movie: M; director: P" depending on the agent assigned to this relation). While our KB and resulting facts are intentionally simple to show the limitations of black-box models, such verbalization may not always be possible with larger KBs and hence should not be relied upon. For each training example, we collect the facts used by each agent in the decomposition and treat these as gold facts $\mathcal{F}_k$ . + +# 4.4 COMMAQA Dataset + +We use the above framework to build three datasets capturing three challenges in multi-hop reasoning. + +COMMAQA-E: Explicit Decomposition. This dataset consists of multi-hop questions from the movie domain where the reasoning needed to answer the question is Explicitly described in the question itself (Yang et al., 2018; Ho et al., 2020; Trivedi et al., 2021). For example, "What awards have the movies directed by Spielberg won?". We use a TextQA and TableQA agent where certain relations can either be expressed in text or table (more details in App. Fig. 6). + +COMMAQA-I: Implicit Decomposition. This dataset consists of multi-hop questions where the + +![](images/f134ef298d6d02b8eb92e1ea2cbe559ef864399f6ce92d0b0b05dc12986648bb.jpg) +Figure 4: Sample Decomposition Annotations for example questions in COMMAQA. We denote the composition operators using the format (operation) [agent] "question". + +reasoning needed is Implicit (Khot et al., 2020; Geva et al., 2021), for example, "Did Aristotle use a laptop?". Inspired by such questions in StrategyQA (Geva et al., 2021), we create this dataset using three agents(TextQA, KBQA and MathQA) with just two question styles: (1) "What objects has _ likely used?" and (2) "What objects has _ helped make?". However each question has three possible strategies depending on the context (see App. Fig. 7 for more details). This is a deliberate choice as similar sounding questions can have very different strategies in a real world setting, e.g., "Did Steve Jobs help develop an Iphone?" vs. "Did Edison help develop the television?". + +COMMAQA-N: Numeric Decomposition. This dataset consists of Numeric (also referred to as discrete) reasoning questions (Dua et al., 2019; Amini et al., 2019) requiring some mathematical operation, in addition to standard reasoning. For example, "Who threw javelins longer than 5 yards?" We create this dataset in the sports domain with TextQA, TableQA and MathQA agents (more details in App. Fig. 8). + +Dataset Statistics. The final dataset consists of the three QA sub-datasets described above, key statistics summarized in Table 4. + +There are 10K total examples in each dataset with $80\% / 10\% / 10\%$ train/dev/test split. To prevent models from guessing answer spans, we introduce more distractors by sampling a large number of facts for COMMAQA-E and COMMAQA-I. This results in a larger number of facts in the KB ( $\sim 170$ ) and larger length of the KB in these two datasets ( $\sim 2500$ tokens). Since COMMAQA-N can have derived answers from numeric reasoning and has longer chains (avg #steps 4.7 vs. 2.7 in COMMAQA-E), we do not need a large number of + +
COMMAQA
EIN
#questions10K10K10K
#theories666
#steps per theory2.73.24.7
#entity types7135
#relations11164
#templates in L i426830
#entities per answer3.213.291.36
#KB facts per KB169.4175.780
#T5tokens per KB2252.92540.91513.4
#Gold facts per qn7.56.915.4
+ +Table 4: Statistics of COMMAQA. All per-question and per-KB statistics are averages. + +distractor facts (80 facts/KB). + +Metrics. The answer $y_{k}$ to each question $x_{k}$ in COMMAQA is an unordered list of single-word entities. $^{10}$ By the design of the dataset, a model that performs the desired reasoning should be able to output $y_{k}$ correctly, barring entity permutation. Hence, we use exact match accuracy as the metric. $^{11}$ (see appendix for a softer metric, F1 score) + +# 5 Experiments + +We evaluate various models on COMMAQA, including a baseline model (with no auxiliary information) for the task and state-of-the-art models that have access to auxiliary information. + +# 5.1 Models + +# 5.1.1 COMMAQA Baseline Model + +We develop a baseline approach that directly targets the challenge task without relying on any auxiliary information. Specifically, we use the Text Modular Network (TMN) framework (Khot et al., 2021) that trains a NextGen model that communicates + +with the agents. This model is trained to produce the next question (including operation and agent) in a decomposition chain, given the questions and answers so far, which is then executed against the agent to produce the answer for the current step. Additionally this framework samples multiple questions at each step of the chain to search $^{12}$ for the most likely chain of reasoning. + +We generate the training data for NextGen via distant supervision. Specifically, we perform a naive brute-force search where we sample $l$ questions at each step for up to $o$ steps. $^{13}$ The operations are chosen randomly but we only consider the applicable operations (e.g., "select" for the first step). We use lexical overlap between the questions in the examples of valid inputs and the complex question to avoid wasteful random sampling. $^{14}$ We assume all chains that lead to the gold answer $^{15}$ represent valid decompositions, and use them to build the training dataset for TMNs. We refer to the model as $\mathrm{TMN - S}_l$ (see App. B for details). + +# 5.1.2 Auxiliary Supervision Models + +We next present models that depend on auxiliary information and hence target a simpler variant of the task: (1) a model trained to communicate with agents using gold decomposition supervision, $\mathcal{D}$ ; (2) a black-box model trained to answer questions given all the agents' knowledge, $\kappa_{i}$ ; and (3) a two-stage model that first identifies the most-relevant context (using gold knowledge supervision $\mathcal{F}_i$ ) and uses this shorter context to answer the question. + +Models with Decomposition Supervision: Given decomposition supervision, we can directly use this gold data to train the NextGen model. We refer to this model as TMN-S when we use this search and TMN-G when we greedily select the most likely question at each step. + +Models with Access to Agent Knowledge: Given access to the facts associated with each (train or test) question $x_{k}$ , i.e., each agent's domain-relevant knowledge $\mathcal{K}_{ik}$ , the facts can be concatenated to create a context and frame the challenge as a reading comprehension (RC) task. We train + +
ModelAux. InfoEINAvg.
TMN-S50.00.0*0.00.0
TMN-S1017.00.0*0.05.7
Auxiliary Supervision Models
T5-L{Kik}0.910.235.415.5
UQA-L{Kik}1.010.239.016.7
T5-LFk, {Kik}42.249.444.745.4
UQA-LFk, {Kik}40.149.743.444.4
T5-3BFk, {Kik}42.349.943.446.2
TMN-GDk75.436.0100.070.5
TMN-SDk100.0100.0100.0100.0
+ +Table 5: Accuracy of models trained and tested separately on the 3 datasets. Last column reports average accuracy across the datasets (weighed equally). TOP highlighted rows: Target models for COMMAQA that try solve the task using no auxiliary supervision by communicating with agents. Naive search is able to generate some training data for COMMAQA-E but does not result in any valid decomposition (indicated by *) on COMMAQA-I. BOTTOM rows: Models that rely on auxiliary supervision. Black-box models struggle even when given the domain-relevant KB $\mathcal{K}_{ik}$ . Using the additional fact supervision $\mathcal{F}_k$ helps these models, but their accuracy remains below $50\%$ . TMN models with auxiliary decomposition supervision $\mathcal{D}_k$ can solve all tasks with search ("TMN-S") indicating that the task is solvable by communicating with agents. + +two standard black-box models, T5-L (Raffel et al., 2020) and UnifiedQA-L (Khashabi et al., 2020),17 to generate answers18 given a question and context. + +Models with Fact Supervision: If, in addition to access to the underlying knowledge $\mathcal{K}_{ik}$ , we also have the auxiliary supervision for the gold facts $\mathcal{F}_k$ , we can use this annotation to train a model to first retrieve a small subset of relevant facts from $\mathcal{K}_{ik}$ (see App. D.1 for details). Since the context is shorter, we also train a T5-3B model19 on this task. + +# 5.2 Results + +Table 5 reports the accuracy of these four classes of models on the COMMAQA dataset. + +Baseline model has near-zero accuracy: The top two rows represent baseline models that use brute-force search to generate training data for TMNs. For COMMAQA-I, we don't find even a single chain leading to the gold answer, and hence no training data. With COMMAQA-E and COMMAQA-N, we do find valid decompositions + +purpose of our benchmark dataset. Nevertheless, we conduct experiments in this setting for completeness. + +17We use T5 models as they can handle longer contexts. +18We alphabetically sort answers for a deterministic order. +$^{19}\mathrm{T}5 - 11\mathrm{B}$ performed worse than or same as the 3B model. + +for a subset of the questions (see statistics in Table 8 of Appendix), but not enough to train an effective NextGen model. Expanding the search to $l = 20$ helps achieve $\sim 100\%$ accuracy on COMMAQA-E (with $\sim 700\mathrm{K}$ agent calls). However, we don't observe any gains on COMMAQA-I and COMMAQAN with even 2M agent calls (see App. C). + +Black-box models struggle even with access to agent knowledge: Due to the large number of distractors, black-box models—even with access to agent knowledge at both train and test time—struggle to learn the task across all three datasets with average accuracy below 20. The extremely low performance on COMMAQA-E is especially notable, given that the reasoning needed for each question is explicitly described. While these models are able to solve similar datasets (Yang et al., 2018), the low scores on our synthetic dataset with more distractors indicates that they are still unable to truly learn this kind of reasoning. + +Fact annotations help but are insufficient: Models trained on shorter context (obtained by relying on gold fact training annotation) are able to take advantage of the reduced number of distractors, improving their score to about 45 pts across all datasets. However, even with the larger 3B model, there is no noticeable improvement, indicating 45 pts being roughly a ceiling for these models. + +COMMAQA is solvable by talking to the agents: The TMN model, if given gold decomposition annotation for training, can solve this task (bottom two rows). This experiment is an oracle setting that shows that COMMAQA is noise-free, unambiguous, and solvable by a model that learns to talk to the agents (as designed). Note that greedily selecting the next question results in much lower performance on the two datasets (E and I) that have multiple decompositions for the same question. + +# 5.3 Compositional Generalization + +We also design compositional generalization test sets COMMAQA-E $^{\text{CG}}$ and COMMAQA-N $^{\text{CG}}$ . Specifically we create questions using novel composition of queries that have been seen during training but never together in this form. For instance, we create a new question "What awards have the directors of the winning movies received?", given that the model was trained on questions such as "What awards have the actors of the winning movies received?", "What movies have the directors from directed?", and "What movies have + +
ModelAux. InfoE^CGN^CG
TMN-S1016.20.0
Auxiliary Supervision Models
T5-LFk, {Kik}37.02.0
T5-3BFk, {Kik}39.223.8
TMN-SDk79.497.6
+ +Table 6: Lower accuracy on compositional generalization test sets. TMN-S with decomposition supervision still outperforms other models. + +people from the country acted in?" + +As shown in Table 6, all models exhibit a drop in accuracy relative to their score in Table 5, but the compositional model trained on gold decomposition still outperforms black-box models. Our error analysis of TMN-S on COMMAQA-E identified this key issue: While TMN-S learns to generalize, it generates questions outside the space of valid agent inputs (e.g., "Who are the directors in the movie _?" vs. "Which movies has directed?"). + +# 6 Closing Remarks + +We motivated a new challenge of solving complex tasks by communicating with existing AI agents. This challenge, we believe, will help develop more generalizable and efficient models. We introduced a new benchmark dataset COMMAQA with three multi-hop reasoning challenges, all solvable by composing four QA agents. State-of-the-art language models struggle to solve COMMAQA, even when provided with agents' internal knowledge. In contrast, a model that is able to learn to communicate with the agents, albeit using annotated decompositions, is able to solve this task. These results point to the need for and the potential of such approaches, but without reliance on auxiliary annotations, to solve complex tasks. + +COMMAQA is only one instantiation of our overall framework. One can extend it in many ways, such as using LMs to enrich lexical diversity, emulating the behavior of imperfect real-world agents that even attempt to answer out-of-scope questions, diversifying to other reasoning types such as Boolean questions where using distant supervision is even harder (Dasigi et al., 2019), and extending the generalization dataset to include new examples of valid inputs as well as new agents. + +# Acknowledgments + +The authors the Aristo team at AI2, in particular Peter Clark, as well as the reviewers for valuable feedback. Experiments were conducted on beaker.org. + +# References + +Aida Amini, Saadia Gabriel, Shanchuan Lin, Rik Koncel-Kedziorski, Yejin Choi, and Hannaneh Hajishirzi. 2019. MathQA: Towards interpretable math word problem solving with operation-based formalisms. In NAACL. +Prithviraj Ammanabrolu, Jack Urbanek, Margaret Li, Arthur Szlam, Tim Rocktäschel, and Jason Weston. 2021. How to motivate your dragon: Teaching goal-driven agents to speak and act in fantasy worlds. In NAACL. +Iz Beltagy, Matthew E. Peters, and Arman Cohan. 2020. Longformer: The long-document transformer. arXiv:2004.05150. +Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. 2013. Semantic Parsing on Freebase from Question-Answer Pairs. In EMNLP. +Gregor Betz and Kyle Richardson. 2021. DeepA2: A modular framework for deep argument analysis with pretrained neural text2text language models. arXiv:2110.01509. +Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, T. J. Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeff Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. ArXiv, abs/2005.14165. +Xinyun Chen, Chen Liang, Adams Wei Yu, Denny Zhou, Dawn Song, and Quoc V. Le. 2020. Neural symbolic reader: Scalable integration of distributed and symbolic representations for reading comprehension. In ICLR. +Peter Clark, Oyvind Tafjord, and Kyle Richardson. 2020. Transformers as soft reasoners over language. *IJCAI*. +James Clarke, Dan Goldwasser, Ming-Wei Chang, and Dan Roth. 2010. Driving semantic parsing from the world's response. In CoNLL. +Pradeep Dasigi, Matt Gardner, Shikhar Murty, Luke Zettlemoyer, and Eduard Hovy. 2019. Iterative search for weakly supervised semantic parsing. In NAACL-HLT. +Aditya Desai, Sumit Gulwani, Vineet Hingorani, Nidhi Jain, Amey Karkare, Mark Marron, and Subhajit Roy. 2016. Program synthesis using natural language. In ICSE. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of + +deep bidirectional transformers for language understanding. In NAACL. +Dheeru Dua, Yizhong Wang, Pradeep Dasigi, Gabriel Stanovsky, Sameer Singh, and Matt Gardner. 2019. DROP: A reading comprehension benchmark requiring discrete reasoning over paragraphs. In *NAACL*. +Daniel Fried, Peter A. Jansen, Gus Hahn-Powell, Mihai Surdeanu, and Peter E. Clark. 2015. Higher-order lexical semantic models for non-factoid answer reranking. TACL, 3:197-210. +Matt Gardner, Jonathan Berant, Hannaneh Hajishirzi, Alon Talmor, and Sewon Min. 2019. Question answering is a format; when is it useful? ArXiv, abs/1909.11291. +Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Peters, Michael Schmitz, and Luke S. Zettlemoyer. 2017. AllenNLP: A deep semantic natural language processing platform. arXiv preprint arXiv:1803.07640. +Mor Geva, Daniel Khashabi, Elad Segal, Tushar Khot, Dan Roth, and Jonathan Berant. 2021. Did Aristotle Use a Laptop? A Question Answering Benchmark with Implicit Reasoning Strategies. TACL. +Sumit Gulwani. 2011. Automating string processing in spreadsheets using input-output examples. ACM Sigplan Notices, 46(1):317-330. +Tanmay Gupta, Anita Kamath, Aniruddha Kembhavi, and Derek Hoiem. 2021. Towards general purpose vision systems. ArXiv, abs/2104.00743. +Matthew Hausknecht, Prithviraj Ammanabrolu, Marc-Alexandre Côté, and Xingdi Yuan. 2020. Interactive fiction games: A colossal adventure. In AAAI. +Xanh Ho, A. Nguyen, Saku Sugawara, and Akiko Aizawa. 2020. Constructing a multi-hop qa dataset for comprehensive evaluation of reasoning steps. In COLING. +Peter A Jansen. 2021. A systematic survey of text worlds as embodied natural language environments. arXiv preprint arXiv:2107.04132. +Daniel Khashabi, Erfan Sadeqi Azer, Tushar Khot, Ashish Sabharwal, and Dan Roth. 2019. On the possibilities and limitations of multi-hop reasoning under linguistic imperfections. arXiv, abs/1901.02522. +Daniel Khashabi, Snigdha Chaturvedi, Michael Roth, Shyam Upadhyay, and Dan Roth. 2018. Looking beyond the surface: a challenge set for reading comprehension over multiple sentences. In *NAACL*. +Daniel Khashabi, Sewon Min, Tushar Khot, Ashish Sabhwaral, Oyvind Tafjord, Peter Clark, and Hannaneh Hajishirzi. 2020. UnifiedQA: Crossing format boundaries with a single QA system. In Findings of EMNLP. + +Tushar Khot, Peter Clark, Michal Guerquin, Paul Edward Jansen, and Ashish Sabharwal. 2020. QASC: A dataset for question answering via sentence composition. In AAAI. +Tushar Khot, Daniel Khashabi, Kyle Richardson, Peter Clark, and Ashish Sabharwal. 2021. Text modular networks: Learning to decompose tasks in the language of existing models. In NAACL. +Jayant Krishnamurthy, Pradeep Dasigi, and Matt Gardner. 2017. Neural semantic parsing with type constraints for semi-structured tables. In EMNLP. +Brenden Lake and Marco Baroni. 2018. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In ICML, pages 2873-2882. +Patrick Lewis, Pontus Stenetorp, and Sebastian Riedel. 2021. Question and answer test-train overlap in open-domain question answering datasets. In EACL. +Nelson F Liu, Tony Lee, Robin Jia, and Percy Liang. 2021. Can small and synthetic benchmarks drive modeling innovation? A retrospective study of question answering modeling approaches. arXiv preprint arXiv:2102.01065. +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:1907.11692. +Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. 2018. Can a suit of armor conduct electricity? a new dataset for open book question answering. In EMNLP. +Sewon Min, Eric Wallace, Sameer Singh, Matt Gardner, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2019a. Compositional questions do not necessitate multi-hop reasoning. In ACL. +Sewon Min, Victor Zhong, Luke S. Zettlemoyer, and Hannaneh Hajishirzi. 2019b. Multi-hop reading comprehension through question decomposition and rescoring. In ACL. +Ethan Perez, Patrick Lewis, Wen-tau Yih, Kyunghyun Cho, and Douwe Kiela. 2020. Unsupervised question decomposition for question answering. In EMNLP. +Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. +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. + +Koustuv Sinha, Shagun Sodhani, Jin Dong, Joelle Pineau, and William L Hamilton. 2019. CLUTRR: A diagnostic benchmark for inductive reasoning from text. In EMNLP. +Alon Talmor and Jonathan Berant. 2018. The web as a knowledge-base for answering complex questions. In *NAACL*. +Harsh Trivedi, Niranjan Balasubramanian, Tushar Khot, and Ashish Sabharwal. 2020. Is multihop QA in DiRe condition? Measuring and reducing disconnected reasoning. In EMNLP. +Harsh Trivedi, Niranjan Balasubramanian, Tushar Khot, and Ashish Sabharwal. 2021. MuSiQue: Multi-hop questions via single-hop question composition. ArXiv, abs/2108.00573. +Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. 2019. Superglue: A stickier benchmark for general-purpose language understanding systems. In NeurIPS, volume 32. +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 Blackbox NLP Workshop. +Thomas Wolf, Julien Chaumont, Lysandre Debut, Victor Sanh, Clement Delangue, Anthony Moi, Pierric Cistac, Morgan Funtowicz, Joe Davison, Sam Shleifer, et al. 2020. Transformers: State-of-the-art natural language processing. In EMNLP: System Demonstrations. +Tomer Wolfson, Mor Geva, Ankit Gupta, Matt Gardner, Yoav Goldberg, Daniel Deutch, and Jonathan Berant. 2020. Break it down: A question understanding benchmark. TACL. +Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William W. Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. 2018. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In EMNLP. +Xingdi Yuan, Marc-Alexandre Côté, Jie Fu, Zhouhan Lin, Christopher Pal, Yoshua Bengio, and Adam Trischler. 2019. Interactive language learning by question answering. In EMNLP-IJCNLP. +Xingdi Yuan, Jie Fu, Marc-Alexandre Côté, Yi Tay, Christopher Pal, and Adam Trischler. 2020. Interactive machine comprehension with information seeking agents. In ACL. +Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. 2020. Big Bird: Transformers for longer sequences. In NeurIPS. + +# A Multiple Answers in a Question + +If a question refers to multiple answers, e.g. "Is #3 a part of #2?", the operator execution is unclear. To handle such cases, the operator must specify the answer to operate over as a parameter. E.g. (filter(#3)) [mathqa] "Is #3 a part of #2?" would filter the answers in #3 whereas (filter(#2)) [mathqa] "Is #3 a part of #2?" would filter the answers in #2. + +# B Search Approach Details + +We describe in more detail the approach used to build the training data $\hat{\mathcal{D}}$ using the simple search technique. To generate the space of possible decompositions, for each question, we first select $f$ operations from the list of valid operations in Table 7. We only consider these operations as these are the only operators needed for COMMAQA. Note that even with this restricted set of operators, models struggle on COMMAQA-I and COMMAQA-N. Additionally, we only consider the select operation for the first step. For all subsequent steps, we only consider replacements of $\_$ with a previous answer index. + +To select the questions, we first simplify the space of inputs by converting the questions into Fill-In-The-Blank (FITB) questions by removing the named entities. E.g "Who was born in 1991?" is changed to "Who was born in _.?" This is also a necessary step as the operators need questions with placeholders to handle structured answers. At every step, we expand this pool of questions by replacing the blanks with entities in the complex question and any answer index from the previous steps (e.g. #1, #2 in the third step of a decomposition). To avoid wasteful sampling, we use lexical overlap between questions in this expanded question pool and the input question to identify the top $g$ most relevant questions. The agent associated with each question is tracked throughout this process. + +In the end, we consider the cross product between the $f$ operations and $g$ questions to produce $l = f \times g$ total questions at each steps. These $l$ questions are then executed using the appropriate agent and only the successful questions (i.e. answered by the agent) are considered for the next step. This is the key reason why the search space is much smaller than $l^o$ for $o$ reasoning steps. + +Table 8 presents the overall statistics of the search approach. + +select +filter +filterValues_keys +filter() +filterValues()_keys +project +projectValues +projectValues-flat +projectValues-flat_unique +project_values-flat +project_values-flat_unique + +Table 7: Set of operations considered in the search approach. can be replaced by any of the answer indices from the previous steps to create a new operation. + +
DatasetNumQs/ StepModels callsNum +ve chainsNum qs w/ +ve chainsDev Acc
CommaQA-E5708012462420
CommaQA-E1011659545642117
CommaQA-E15541816132587032.8
CommaQA-E206831682505166998.9
CommaQA-I581325000
CommaQA-I10123202000
CommaQA-I151149762000
CommaQA-I201525736000
CommaQA-N59448140270
CommaQA-N1035117846270
+ +Table 8: Statistic of the search-based approach for different values of $l$ (NumQs/Step). While we get few +ve chains for COMMAQA-N, it is not sufficient to train an effective model. + +
CommaQA
EM/ F1 scoresEIN
Full Context
T5-Large0.9 / 30.1210.2 / 25.435.4 / 38.4
UQA-Large1.00 / 30.010.2 / 25.7539.0 / 41.4
Using Gold Facts
T5-Large42.2/ 75.549.9 / 65.544.7 / 45.3
UQA-Large40.1 / 75.349.7 / 65.843.4 / 44.8
T5-3B*42.3 / 75.749.9 / 65.643.4 / 45.3
Decompositions
TMN-G75.4 / 75.436 / 36100 / 100
TMN-S100 / 100100 / 100100 / 100
TMN-S (I=5)0.0 / 0.00.0 / 0.00.0 / 0.0
TMN-S (I=10)17.0 / 17.10.0 / 0.00.0 / 0.0
+ +Table 9: EM / F1 scores on the test set using the baseline approaches. + +![](images/c95b3011311b82c3a8e4c8a9f11804b549e66143c1cd7fc8b8f24de5cc4ef521.jpg) +Figure 5: With an order of magnitude increase in search space, we can achieve close to $100\%$ accuracy on COMMAQA-E. However COMMAQA-I and COMMAQA-N need smarter search strategies to generate useful training supervision. + +# C Search Cost vs Accuracy + +One could always exhaustively search for all possible decompositions to reproduce the gold decompositions for all the questions. But this would be computationally highly expensive as each call to the agent would often invoke a large-scale LM or a complex AI assistant. To characterize the computational cost of these approaches, we extend the search parameter to include $l = 15$ and $l = 20$ (capped at 5M agent calls) and compute the accuracy of the TMN-S model trained on the resulting dataset (shown in Fig. 5). We can achieve close to $100\%$ accuracy on COMMAQA-E where the search is sufficiently exhaustive (about 700K model calls) mainly due to the shorter rules and the lexical signal. COMMAQA-I and COMMAQA-N, on the other hand, even with an order of magnitude increase in the number of agent calls, we don't observe any increase in the model accuracy. + +# D Black-Box Models + +We train the T5 models on each of the three datasets to generate the answer given the question and facts. We format the input sequence as Q: A:. Since many of the answers can be multiple spans, we sort20 and concatenate them into a single string with ‘+’ as the separator. As noted in Table 4, the verbalized facts can result in a context over 2K tokens long. We trained T5-Large models on A100 80G GPUs and RTX8000s to train on such a long context. Transformers designed for longer documents (Beltagy + +et al., 2020; Zaheer et al., 2020) would be able to handle such contexts more efficiently but generally under-perform due to sparse attention. Hence we don't evaluate them here. + +For all T5-based models, model tuning was standardly performed using a random hyper-parameter search in the style of Devlin et al. (2019) using the public huggingface implementation (Wolf et al., 2020); model selection was done based on the highest EM accuracy on the development sets. We specifically experimented with learning rates in the range of $(1e - 3f$ to $5e - 5f)$ using both Adam and Adagrad optimizers and generally found the settings comparable to the original T5 pre-training parameters (Raffel et al., 2020) to be optimal (Adafactor, $\mathrm{lr} = 0.001$ , 10 epochs, 0-1000 warmup steps, gradient accumulation was used extensively in place of batching to fit long sequences into GPU memory). The optimal T5-3B models and T5-L for full context on COMMAQA-E were trained with $\mathrm{lr} = 5\mathrm{e} - 5$ . All other models were trained with a lr of 1e-3. We will release the complete list of optimal hyper-parameters along with the code. + +# D.1 Models with Fact Supervision + +To select the relevant facts, we train a RoBERTa-Large (Liu et al., 2019) model on the gold facts and select the top-scoring facts to produce a shorter context that fits in 512 tokens. The RoBERTa model was training using the AllenNLP library (Gardner et al., 2017) with the standard parameters used for RoBERTa - learning rate of 2e-5, triangular LR scheduler with $10\%$ warmup steps, gradient clipping at 1.0, batch size of 16, 5 epochs of training with patience of 3 epochs. We didn't observe a noticeable difference in score with a random parameter search, so kept these parameters constant. The model was trained to score each fact independently on the train set and the best model was selected based on the accuracy on the dev set. The model was then evaluated on the facts from the train, dev and test set to produce the shorter context for all three sets. The facts were sorted based on the model's scores and the top-scoring facts were added to the context till the number of tokens did not exceed 512 tokens (white-space splitting). + +# E Text Modular Networks: Training + +To train the NextGen model for TMNs, we use the same parameters as the prior work (Khot et al., 2021). We train a T5-Large model as the NextGen + +# Knowledge Base + +# Text KB + +directedmovie,person) acted/movie,person) wrote/movie,person) produced/movie,person paward(person,p_awar birth(person, year) nationality(person,nation + +# Table KB + +directed鲷le, person) acted鲷le, person) wrote鲷le, person) produced鲷le, person) paward鲷le, person, p_award) maward鲷le, m_award released鲷le, year + +# Entities + +movie: ["Vitrilateral", ...] person: ["Alpinista", ...] m_award: ["Trummer", ...] + +# Valid Inputs + +# TextQA Agent + +Who is from the country Schelpla? +From which country is Magainitis? +Where is Alpinista from? +From which country is Gigabut? +Who is from the country Spanulum +Which awards were given to Fideli Alpinista produced which movies? +Who is from the country Moumine +Who all produced the movie Hoop + +# TableQA Agent + +Which movies were given the Trummer award? Who are the writers of the movie Misgendery? Which writers wrote Vitrilateral? Which movies were released in 1957? Who are the writers of the movie Chickenpot? Which year was the movie Compresse released in? Who are the writers of the movie Misgendery? Which movies were given the Pompeosale award + +# Theory + +Theory 1: What movies have people from the country $1 acted in? A1:select(textQA, _, "Who are from $1?") A2:project_keys_free_unique(textQA/tableaque.A "Which movies has {} been an actor in?" + +Theory 2: What movies have the directors from $1 directed? A1:select(textQA, _ "Who is from the country $17?" A2:project_keys_FLAT_unique(textQA/tableea, A1, "Which movies has I directed?") + +Theory 3: What awards have movies produced by people born in $1 won? +A1:select(textqa, "Who were born in the year $1?") +A2:project_keys Flat_unique(textqa/tableqa, A1, "For which movies was I the producer?") +A3:project_keys Flat_unique(tableqa, A2, "Which awards did the movie I win?") + +Theory 4: What awards have movies written by people born in $1 won? +A1:select(textQA, _, "Who were born in the year $1?") +A2:project_keysflat_unique(textQA/tableqa, A1, "What movies has {} written?") +A3:project_keysflat_unique(tableqa, A2, "Which awards were given to {}?" + +Theory 5: What awards did the movies directed by the $1 winners receive? A1:select(textQA/tableqa,..., "Who have won the $1 award?" A2:project_keys_FLAT_unique(textQA/tableqa, A1, "What mo has () been the director of?") A3:project_keys_FLAT_unique(tableqa, A2, "Which awards of the movie () win?") + +Theory 6: What awards have the actors of the $1 winning movies received? +A1:select(/tableqa, _, "The award $1 has been awarded to which movies?") +A2:project_keysflatiquetique(xtra/tableqa,A1, "Who are actors in the movie (J?)") +A3:project_keysflatiquetique(tableqa,A2, "\{ has been awarded which awards?") + +Figure 6: Example KB, space of valid inputs, and the theory used to construct COMMAQA-E. + +model using a batch size of 64, lr of 5e-6, 5 epochs and warmup of 1000 steps in all our experiments. We used the public huggingface implementation (Wolf et al., 2020) to train this model. During inference, we use a beam size of 10 and select 5 questions at each step. We use nucleus sampling with $p = 0.95$ and $k = 10$ . For greedy search, we use the same parameters but select one question at each step. We use the sum log likelihood of each generated question as the score of the reasoning chain. (see released code for the exact settings) + +![](images/ce7c166f3e29f6d69a90458ae4b763a01343d23ffedeaf385b83038404815305.jpg) +Figure 7: Example KB, space of valid inputs, and the theory used to construct COMMAQA-I. + +![](images/698d28ede907a67d7e046017ad03ca22a469c608f716213f44604d7869f62374.jpg) + +# Complex Questions (and Theory) + +![](images/52145679260963ad72fdccc3681d0a4ca0e708ad44834118c700d453de88203f.jpg) +Figure 8: Example KB, space of valid inputs, and the theory used to construct COMMAQA-N. \ No newline at end of file diff --git a/heyaicanyousolvecomplextasksbytalkingtoagents/images.zip b/heyaicanyousolvecomplextasksbytalkingtoagents/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1b7c6d41eb7d8c419995e4d9c820107857347db7 --- /dev/null +++ b/heyaicanyousolvecomplextasksbytalkingtoagents/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3ddaab8cf4adb1d5dfefbedb0126838ee1d2348bcce31a509b963641fe650ac +size 1241884 diff --git a/heyaicanyousolvecomplextasksbytalkingtoagents/layout.json b/heyaicanyousolvecomplextasksbytalkingtoagents/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..18f107babf5a5adc1af5d052f273e8d691320014 --- /dev/null +++ b/heyaicanyousolvecomplextasksbytalkingtoagents/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30ff91068e4d1e6eb59a5a2f3f6c8ad63487891fa914991295731cbbfa47b93b +size 523634 diff --git a/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_content_list.json b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6b0ae630dd5773b9e738927685342b1da2f4a15b --- /dev/null +++ b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:702c8ff03cd75a55fa64336b4a36d27f4f04369f2e93dc2b59e3f5411b8496de +size 82574 diff --git a/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_model.json b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d0ffed9309cc4741a9389e9655726757da15dfae --- /dev/null +++ b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a239d7d73c2f2ce549892faeefd776211b49127d5f3668c20dcb371f9b285ff +size 103648 diff --git a/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_origin.pdf b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..53ebf2c77a4fffb590155046dcb1d5d532c9d386 --- /dev/null +++ b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/74f07998-b4f2-4bc4-b75c-9c8a102f005f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26d23337f9e7a64d0ed886575e20cdff54f343d24fcf01f595d871db64f81dae +size 1156514 diff --git a/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/full.md b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6125c5dbbfcd76d728b18aa232d4018e081577c2 --- /dev/null +++ b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/full.md @@ -0,0 +1,402 @@ +# HiCLRE: A Hierarchical Contrastive Learning Framework for Distantly Supervised Relation Extraction + +Dongyang Li $^{1,2}$ , Taolin Zhang $^{3,4}$ , Nan Hu $^{1}$ , Chengyu Wang $^{3}$ , Xiaofeng He $^{1,5\dagger}$ + +1 School of Computer Science and Technology, East China Normal University + +$^{2}$ Shanghai Key Laboratory of Trsustworthy Computing $^{3}$ Alibaba Group + +$^{4}$ School of Software Engineering, East China Normal University + +$^{5}$ Shanghai Research Institute for Intelligent Autonomous Systems + +dongyangli0612@gmail.com, zhangtl0519@gmail.com + +hunan.vinny1997@gmail.com, chengyu.wcy@alibaba-inc.com + +hexf@cs.ecnu.edu.cn + +# Abstract + +Distant supervision assumes that any sentence containing the same entity pairs reflects identical relationships. Previous works of distantly supervised relation extraction (DSRE) task generally focus on sentence-level or bag-level denoising techniques independently, neglecting the explicit interaction with cross levels. In this paper, we propose a Hierarchical Contrastive Learning Framework for Distantly Supervised Relation Extraction (HiCLRE) to reduce noisy sentences, which integrate the global structural information and local fine-grained interaction. Specifically, we propose a three-level hierarchical learning framework to interact with cross levels, generating the de-noising context-aware representations via adapting the existing multi-head self-attention, named Multi-Granularity Recontextualization. Meanwhile, pseudo positive samples are also provided in the specific level for contrastive learning via a dynamic gradient-based data augmentation strategy, named Dynamic Gradient Adversarial Perturbation. Experiments demonstrate that HiCLRE significantly outperforms strong baselines in various mainstream DSRE datasets. + +# 1 Introduction + +Relation extraction (RE) can draw relations of two entities from unstructured text. It can be widely used in natural language processing applications such as knowledge graph construction (Khatib et al., 2020; Tang et al., 2020) and question answering (Wang and Jiang, 2019; Liu et al., 2020; Saxena et al., 2020). Existing RE works (Wei et al., 2020; Alt et al., 2020; Veyseh et al., 2020) rely on a large-scale annotated dataset, which is time-consuming and labor-intensive. DSRE (Mintz et al., + +Figure 1: Example of semantic relationships in specific levels and cross levels. The red cross means the semantic difference of two bag-level relations and the dotted arrow indicates the semantic overlapping of cross levels. (Best viewed in color). +![](images/6a3d2e27477dc9a8944047d1d82303090c0b277be898b1aaab457311b27a41d2.jpg) +Cook Apple Steve Jobs +$\mathbf{S}_1$ · In 1998, Steve Jobs asked Cook to join Apple. +S2 Under Cook's leadership, Apple has increased its donations to charity. +$\boxed{S_3}$ The cook should put the apple into microwave on High for 2 minutes. + +2009) attempts to address this issue via automatically generating training text samples. Obviously, this assumption introduces noisy data and may hurt the performance. Hence, multi-instance learning (MIL) (Zeng et al., 2015) is further proposed to assign a bag containing "at least one" correct sentence of relation triple. + +The previous approaches of DSRE tackle the task at different granularities (i.e. sentence-level and bag-level). (1) Sentence-level. These works (Wu et al., 2019; Li et al., 2019) focus on finding the ground-truth relational labels from the internal semantics of the input sentences. (2) Bag-level. Although these works (Su et al., 2018; Beltagy et al., 2019; Chen et al., 2021a; Christopoulou et al., 2021) consider the information of sentence-level and bag-level simultaneously, but they ignore the explicit cross-level interactions, which contain plenty of knowledge to further boost the DSRE task performance. As shown in Figure 1, the rich semantic information of bag-level and sentence + +level are provided for the "Cook" and "Apple" in the entity level. For example, "Steve Jobs" in $s_1$ is also the co-founder of "Apple" company and the label of bag-level is the "/business/person/company" exactly shows the relation of this entity pair. Meanwhile, the huge semantic difference exists in a specific level such as the "/business/person/company" and "/location/country/capital" in bag level. + +To overcome the challenges mentioned above, we propose a Hierarchical Contrastive Learning framework for distantly supervised Relation Extraction (HiCLRE), which facilities semantic interactions within a specific level and cross levels: + +(1) Multi-Granularity Recontextualization: To capture the cross-level structural information, we adapt the multi-head self-attention mechanism into three-level granularities, including entity-level, sentence-level and bag-level. We align the context-aware feature of each layer with the input of attention mechanism respectively. The refined representations as recontextualized interaction semantics are picked out for the corresponding level via the attention scores aggregated by the other two levels. + +(2) Dynamic Gradient Adversarial Perturbation: To obtain the more accurate specific-level representations, we employ gradient-based contrastive learning (Hadsell et al., 2006; van den Oord et al., 2018) to pull the information of constructed pseudo positive samples and push the difference of negative samples. Concretely, we calculate the dynamic perturbation from two aspects, including the normalized gradient of task loss and the temporal weighted memories similarity between the last and current epoch. + +To verify the effectiveness of HiCLRE, we evaluate our model on three mainstream DSRE datasets, including NYT10 (Riedel et al., 2010), GDS (Jat et al., 2017), and KBP (Ling and Weld, 2012). The experimental results show that HiCLRE significantly outperforms the state-of-the-art baselines' performance, achieving a $2.2\%$ relative AUC increase and improving the $\mathrm{P@M}$ score from $77.2\%$ to $78.2\%$ . Furthermore, the ablation study shows the individual contributions of each module. + +Accordingly, the major contributions of this paper are summarized as follows: + +- We propose a hierarchical contrastive learning framework for DSRE task (HiCLRE), which fully utilizes the semantic interaction within the specific level and cross levels, reducing the influence of noisy data. + +- The multi-granularity recontextualization is proposed to enhance the cross-level interaction and the dynamic gradient adversarial perturbation learns better representations within three specific levels. +- Extensive experiments show that our model outperforms the strong baseline over DSRE datasets and detailed analysis demonstrates the modules are also effective. + +# 2 Related Work + +# 2.1 Distantly Supervised Relation Extraction + +Recently, these works are divided into two categories. (1) Human-designed Feature. (Yao et al., 2011) propose three types of LDA (i.e. Rel-LDA, Rel-LDA1, and Type-LDA) to cluster the similar triples together. MIML (Hoffmann et al., 2011; Surdeanu et al., 2012) and MIL (Zeng et al., 2015) attempt to relax the limitation of distantly supervision assumption to tackle the data generation problem. (2) Neural Networks Representation. These models automatically generate the feature representation via end-to-end learning to reduce manual intervention. (Qin et al., 2018) introduce a generative adversarial training framework that provides a cleaned dataset for RE task. (Ye and Ling, 2019) consider both inter-bag and intra-bag attention to handle the noise at sentence-level and bag-level independently. SENT (Ma et al., 2021) is a sentence-level framework to generate efficient training samples by negative training to filter the noisy data. These works generally use the partial levels' information independently to explore the relational semantics. + +# 2.2 Contrastive Learning + +Loss Function NCE (Gutmann and Hyvarinen, 2010) learns a classifier to distinguish the clean and noisy examples with the probability density function. InfoNCE (van den Oord et al., 2018) integrates the mutual information into the NCE, which can maximize similarity and minimize the difference. + +Data Augmentation These works can be generally divided into three categories. (1) Data augmentation by simple text processing. EDA (Wei and Zou, 2019) proposes synonyms replace, randomly insert and randomly delete operations. CIL (Chen et al., 2021a) utilizes TF-IDF scores to insert/ substitute some unimportant words to/in instance to construct positive samples. (2) Data augmentation by + +![](images/6f42a4887336f6072f4a77eb9d7a6b4be8ef9886427005623acb806878e17db0.jpg) +Figure 2: Model overview of HiCLRE. The left part is our model architecture and the right part shows the details on pseudo positive sample construction and multi-granularity recontextualization. (Best viewed in color). + +embedding processing. ConSERT (Yan et al., 2021) explore four different data augmentation strategies (i.e. adversarial attack, token shuffling, cutoff and dropout) to generate views in BERT (Devlin et al., 2019) embedding layer. SimCSE (Gao et al., 2021) applies twice dropout in the forward process to refine the better sentence representation. (3) Data augmentation by external knowledge. ERICA (Qin et al., 2021) enumerates all the entity pairs in the training samples to link the corresponding relation from the external knowledge graph to obtain sufficient augmented data. The mentioned above methods are generally augmenting from the data aspect, ignoring the influence of the changes inside the model during the training process (Zang et al., 2020; Zou et al., 2020). Hence, we propose a hierarchical contrastive learning model to capture the global structure information and fine-grained interaction within the levels. + +# 3 Methodology + +# 3.1 Model Overview and Notations + +The main architecture of our model is shown in Figure 2. The HiCLRE mainly includes two components. (1) Multi-Granularity Recontextualization + +aims to integrate the importance of cross levels to determine what valuable representation should be extracted in the target level. (2) Dynamic Gradient Adversarial Perturbation is proposed for specific levels to enhance the internal semantics via constructing the pseudo positive samples. + +In HiCLRE, each sentence of input samples is consisted of certain tokens $S_{ij} = (t_{i1}, t_{i2}, \dots, t_{ik})$ , where $S_{ij}$ denotes the $i$ -th sentence of bag $B_j$ . $k$ is the total number of tokens in $S_{ij}$ and $j$ represents the bag's index. $e_{i1}$ and $e_{i2}$ are head and tail entity of sentence $S_{ij}$ respectively. Each bag contains $n$ sentences $B_j = (S_{1j}, S_{2j}, \dots, S_{nj})$ . Our model aims to predict the specific relation $r_j$ of bag $B_j$ from $|r|$ relations. $d$ denotes the hidden state dimension of pre-trained language models (PLMs). + +# 3.2 Hierarchical Learning Modeling + +We first introduce our hierarchical learning process including sentence-level and bag-level respectively and then describe the Multi-Granularity Recontextualization and Dynamic Gradient Adversarial Perturbation specifically. + +# 3.2.1 Sentence Representation + +To be specific, the input of sentence encoder is the token sequence of sentence $S_{ij}$ and its corresponding head entity $e_{i1}$ and tail entity $e_{i2}^2$ . The textual encoder sums the token embedding, segment embedding and position embedding for each token to achieve its input embedding, and then computes context-aware hidden representations $H = \{h_{t_{i1}}, h_{t_{i2}}, \dots, h_{e_{i1}}, \dots, h_{e_{i2}}, \dots, h_{t_{ik}}\}$ : + +$$ +H = \mathcal {F} \left(\left\{t _ {i 1}, t _ {i 2}, \dots , t _ {i k} \right\}\right) \tag {1} +$$ + +where $\mathcal{F}$ is the PLMs (e.g. BERT) as our encoder and $H\in \mathbb{R}^{k\times d}$ . The sentence's embedding is calculated by the hidden representations of head entity, tail entity and the [CLS] tag, which is in the first position of the input sequence to denote the whole semantic of the sentence. + +$$ +h _ {S _ {i j}} = \sigma \left(\left[ h _ {e _ {i 1}} \| h _ {e _ {i 2}} \| h _ {[ C L S ]} \right] \cdot W _ {S}\right) + b _ {S} \tag {2} +$$ + +where the $\parallel$ means the concatenation operation, $W_{S}\in \mathbb{R}^{3d\times d}$ is a weight matrix and $b_{S}$ is the bias. $\sigma$ denotes the non-linear function. + +# 3.2.2 Bag Representation + +In this section, we use a sentence-level attention-based mechanism (Lin et al., 2016) to yield the aggregated bag representation. Let $h_{B_j} \in \mathbb{R}^d$ denotes the bag representation, and which is computed from the sentence's attention weight $\alpha_{ij}$ and hidden representation $h_{S_{ij}}$ . + +$$ +h _ {B _ {j}} = \sum_ {i = 1} ^ {n} \alpha_ {i j} h _ {S _ {i j}} \tag {3} +$$ + +To avoid naively treating each sentence of bags equally, the selective attention mechanism assigns the importance to reduce the noise instance. Each weight $\alpha_{ij}$ is generated by a query-based function: + +$$ +\alpha_ {i j} = \frac {\exp (f _ {i j})}{\sum_ {n} \exp (f _ {i j})} \tag {4} +$$ + +where $f_{ij}$ measures how well the input sentence $S_{ij}$ and the predicted relation $r_j$ matches. + +$$ +f _ {i j} = h _ {S _ {i j}} \mathbf {A} _ {\mathbf {j}} \mathbf {r} _ {\mathbf {j}} \tag {5} +$$ + +where $\mathbf{A_j}\in \mathbb{R}^{d\times d}$ is a weighted diagonal matrix, and $\mathbf{r_j}\in \mathbb{R}^d$ is the representation of relation $r_j$ + +which is mapped from the relation label. The final relation type of bag $B_{j}$ is predicted: + +$$ +p \left(r _ {j} \mid h _ {B _ {j}}, \theta\right) = \frac {\exp \left(O _ {r}\right)}{\sum_ {p = 1} ^ {| r |} \exp \left(O _ {p}\right)} \tag {6} +$$ + +$$ +O _ {r} = \sigma \left(W _ {r} \cdot h _ {B _ {j}}\right) + b _ {r} \tag {7} +$$ + +where $W_{r} \in \mathbb{R}^{|r| \times d}$ is trainable transformation matrix and $b_{r} \in \mathbb{R}^{|r|}$ is the bias. $\theta$ denotes bag encoder's parameters. $O_{r} \in \mathbb{R}^{|r|}$ represents the final output of our model, which is associated with all relation types. Therefore, the relation classification objective function of DSRE task is denoted as: + +$$ +\mathcal {L} _ {\text {t a s k}} = - \sum_ {j = 1} ^ {| r |} \log p (r _ {j} \mid h _ {B _ {j}}, \theta) \tag {8} +$$ + +# 3.3 Multi-Granularity Recontextualization + +The hierarchical learning process described above neglects the explicit interaction of cross levels to refine the better level's representation. Hence, after updating the hidden representations generated by the PLMs, our HiCLRE model attempts to recontextualize the enhanced representations for each level. This is accomplished using a modified Transformer layer (Vaswani et al., 2017) that substitutes the multi-headed self-attention with multi-headed attention between the target level and the other two levels' representations. + +Specifically, the underlying calculation process of multi-head self-attention is defined as: + +$$ +\operatorname {A t t}. (Q, K, V) = \operatorname {s o f t m a x} \left(\frac {Q K ^ {T}}{\sqrt {d _ {k}}}\right) V \tag {9} +$$ + +where $< Q, K, V >$ means query, key, and value respectively. $d_{k}$ is the dimension of $K$ . For example, if we focus on the enhanced bag-level representation $^3$ , the $h_{B_j}$ is substituted for the value, whereas the sentence-level $h_{S_{ij}}$ and entity-level $h_e$ mean the key and query respectively: + +$$ +h _ {B _ {j}} ^ {\prime} = \operatorname {M L P} \left(\operatorname {A t t}. \left(h _ {e}, h _ {S _ {i j}}, h _ {B _ {j}}\right)\right) \tag {10} +$$ + +where MLP is the linear multi-layer linear function. The similarity calculation (i.e. query and key) acts as the cross-level information interaction attending to the bag-level representation. After the interaction with multi-headed attention, we run a position-wise MLP similar to the standard transformer layer. + +Next, we concatenate enhanced target level representation with original hierarchical hidden state to obtain an informative level's representation: + +$$ +h _ {B _ {\text {a t t}} j} = \sigma \left(\left[ h _ {B _ {j}} \| h _ {B _ {j}} ^ {\prime} \right] \cdot W _ {\text {a t t}}\right) + b _ {\text {a t t}} \tag {11} +$$ + +where $W_{att} \in \mathbb{R}^{2d \times d}$ is a weight matrix and $b_{att}$ is the bias. Finally, we leverage the three-level enhanced representation $h_{e_{att_j}}, h_{S_{att_j}}$ and $h_{B_{att_j}}$ to replace the hierarchical hidden representation in the following calculation process. + +# 3.4 Dynamic Gradient Adversarial Perturbation + +In addition to considering the interaction of cross levels, the semantic differences of fine-grained relations within the levels can also help models further enhance the context-aware representations. We construct a pseudo positive sample for contrastive learning (Jaiswal et al., 2020) to push the dissimilar relations away. Since the changes of specific-level gradient (Zhang et al., 2020) and the better context-aware semantic can boost the robustness representations, we devise the gradient perturbation and inertia weight memory mechanisms respectively. + +# 3.4.1 Gradient Perturbation + +The continuous gradient perturbations $pt_{adv}$ is calculated from the gradient $g$ of the task loss with the parameter $V$ . + +$$ +g _ {j} = \bigtriangledown_ {V} \mathcal {L} _ {\text {t a s k}} \left(h _ {B _ {j}}; \theta\right) \tag {12} +$$ + +where $V$ is the representation of the bag's sentences. We differentiate the entity to generate the gradient perturbation for sentence level and the token for the entity level. + +$$ +p t _ {a d v _ {j}} = \epsilon \cdot \frac {g _ {j}}{\| g _ {j} \|} \tag {13} +$$ + +where $\| g\|$ is the norm of the gradient from the loss function, $\epsilon$ is a hyperparameter to control the disturbing degree. + +# 3.4.2 Inertia Weight Memory + +With the training epoch increasing, we use the time-sequential information of different granularities to further improve the robustness of internal semantics. Specifically, we add the inertia weight information (Shi and Eberhart, 1998) on the perturbation term, which takes advantage of the difference of representations between the last and the current + +epoch. The inertia weight information is denoted as follows: + +$$ +I _ {w} = \frac {T - u}{T} \operatorname {s i m} \left(r e p _ {(u)}, r e p _ {(u - 1)}\right) \tag {14} +$$ + +where $T$ is the total epoch number of the training process and $u$ is the current epoch index. $rep_{(u)}$ can denote the entity, sentence, or bag representation respectively of the $u$ -th epoch. $rep$ is a embedding matrix saving the semantic memory in the order of element index, updated from the second epoch during the training process. Then, we combine the inertia weight information with gradient perturbation for bag level: + +$$ +p t _ {a d v _ {j}} = \epsilon \frac {g _ {j}}{\| g _ {j} \|} + \frac {T - u}{T} \operatorname {s i m} \left(r e p _ {(u)}, r e p _ {(u - 1)}\right) \tag {15} +$$ + +We add $pt_{adv_j}$ into the bag embedding, and get pseudo positive sample $h_{B_j}' = h_{B_j} + pt_{adv_j}$ . Then we randomly sample a bag in the batch act as the negative sample. The positive and negative samples in InfoNCE loss (van den Oord et al., 2018) are replaced by the dynamic gradient perturbations and random bags respectively: + +$$ +\mathcal {L} _ {b a g} ^ {i n f o} = - \log \frac {\exp \left(\cos \left(h _ {B _ {j}} , h _ {B _ {j}} ^ {\prime}\right) / \tau\right)}{\sum_ {k = 1} ^ {m} \mathbb {1} _ {[ k \neq j ]} \exp \left(\cos \left(h _ {B _ {j}} , h _ {B _ {k j}}\right) / \tau\right)} \tag {16} +$$ + +where $\mathbb{1}_{[k\neq j]}$ is an indicator function, $\tau$ is a hyperparameter and $\cos$ is the cosine function. Due to the different granularities in the hierarchical framework, we devise different memories for entity-level, sentence-level, and bag-level, respectively. + +# 3.5 Training Objective + +In HiCLRE, our training objective contains two components, including the DSRE task loss and the contrastive learning loss. The total loss of contrastive learning is the sum of three-level infoNCE loss. Therefore, the overall objective function is formulated as follows: + +$$ +\mathcal {L} _ {\text {t o t a l}} = \lambda_ {1} \mathcal {L} _ {\text {e n}} ^ {\text {i n f o}} + \lambda_ {2} \mathcal {L} _ {\text {s e n}} ^ {\text {i n f o}} + \lambda_ {3} \mathcal {L} _ {\text {b a g}} ^ {\text {i n f o}} + \lambda_ {4} \mathcal {L} _ {\text {t a s k}} \tag {17} +$$ + +where $\lambda_{l}$ is hyper-parameter and $\sum_{l = 1}^{4}\lambda_{l} = 1$ denoting the weight of each components. + +# 4 Experiments + +# 4.1 Datasets and Baselines + +We evaluate our HiCLRE model on three DSRE datasets, including NYT10 (Riedel et al., 2010), + +
ModelsNYT10GDS
AUCP@100P@200P@300P@MAUCP@500P@1000P@300P@M
Mintz10.752.350.245.049.2-----
PCNN-ATT34.173.068.067.369.479.990.687.675.284.5
MTB-MIL40.876.271.169.472.288.594.892.287.091.3
RESIDE41.581.875.474.377.289.194.891.182.789.5
REDSandT42.478.875.073.075.386.195.692.684.691.0
DISTRE42.268.067.065.366.889.997.093.887.692.8
CIL43.181.575.572.176.990.897.194.087.893.0
HiCLRE(ours)45.382.078.574.078.295.599.698.498.398.8
+ +Table 1: General experimental results of HiCLRE and baselines on NYT10 and GDS datasets. + +GDS (Jat et al., 2017), and KBP (Ling and Weld, 2012). Table 4 shows the detailed statistics. NYT10 is annotated from the New York Times and aligned to Freebase and NYT10-M removes the noisy relation types manually from NYT10. GDS is extracted from human-judged Google Relation Extraction corpus. KBP is constructed over the newswire and web text from the corpus, which is used in the yearly TAC Knowledge Base Population challenges (Ji et al., 2010). Statistics of four datasets are showed in Appendix A. + +Mintz (Mintz et al., 2009) concatenates various features of sentences to train a multi-class logistic regression classifier. PCNN-ATT (Lin et al., 2016) proposes a selective attention-based piecewise CNN to get sentence embeddings. MTB-MIL (Soares et al., 2019) proposes a Matching the Blanks method to learn the sentences' representation by the entity linked text. RESIDE (Vashishth et al., 2018) exploits the information of entity type and relation alias to add a soft limitation for relation classification. REDSandT (Christou and Tsoumakas, 2021) employs the PLMs to focus on instance embedding, aggregating the representations to the attention modules. DISTRE (Alt et al., 2019) combines the selective attention to its Transformer-based model. CIL (Chen et al., 2021a) proposes a contrastive instance learning method under the MIL framework. + +# 4.2 Evaluation Metrics + +Following the previous works (Chen et al., 2021b), we adopt the five general evaluation metrics in DSRE task to evaluate the performance, including AUC, $\mathbf{P}@\mathbf{N}$ and $\mathbf{P}@\mathbf{M}$ . Specifically, AUC (i.e. Area Under Curve) depicts the area under the ROC curve $^{5}$ . $\mathbf{P}@\mathbf{N}$ refers to the $\mathbf{P}@\mathbf{100}$ , $\mathbf{P}@\mathbf{200}$ and + +$\mathrm{P@300}$ used in the metrics, denoting the top 100, top 200 and top 300 precision respectively. $\mathrm{P@M}$ is the mean value of the above three $\mathrm{P@N}$ results. + +# 4.3 Parameter Settings + +The underlying encoders of the entity level and sentence level are implemented by BERT_base (Devlin et al., 2019). The backbone encoder contains 12 Transformer layers and 12 self-attention heads, generating 768 hidden units for each token context-aware representation. During the training stage, we set the model's learning rate as $\{1\mathrm{e} - 5,2\mathrm{e} - 5,2\mathrm{e} - 7\}$ . We choose AdamW (Loshchilov and Hutter, 2017) as our model's loss optimizer, which weight decay is 1e-5 and learning rate is 0.1. The max epoch is set to 5. We find the best hyper-parameter of temperature $\tau$ is 0.05, the $\lambda$ set is $\{0.4,0.4,0.1,0.1\}$ and $\epsilon$ is 2. We show the important hyper parameters' searching results at Appendix C. + +# 4.4 General Experimental Results + +We first evaluate our HiCLRE model in the NYT10 and GDS that are popular used datasets in the DSRE task. Table 1 shows the overall performance on the NYT10 and GDS datasets. From the results, we can observe that (1) On both two datasets, the performance of our HiCLRE model outperforms all the strong baseline models significantly on the four metrics, achieving a new state-of-the-art result. (2) The performance of HiCLRE is greatly improved compared with the strongest baseline in two distantly supervised datasets (i.e. +2.2 AUC / +4.7 AUC). Meanwhile, we find the results of other four metrics are also increasing consistently. In general, it can be seen from Table 1 that the multi-granularity recontextualization for cross levels interaction and the dynamic gradient-based ad + +versarial perturbation for specific levels can improve the performance greatly. Some general cases also prove the effectiveness in Appendix B. + +The baselines and HiCLRE's overall PR-cureve is illustrated in Figure 3. From the curve, we can observe that (1) Our HiCLRE shows higher precision and recall results compared to other strong baselines. (2) Although the curve initially fluctuates quite a bit, both metrics of HiCLRE are basically stabilized at a relatively large gap during the training process. We conjecture that the difference of hierarchical context-aware representation is not obvious at the beginning of the model's training and the stored representations for inertia weight memory of specific levels do not exist in the first training epoch. During the training process, the mentioned above two learning problems tend to be stable and the performance of these two metrics is continuously performing better. + +![](images/bcb2a24cdc013cf7bd4f4542a13c5f7513c38465cf11accbf0fa21a2659c51b8.jpg) +Figure 3: PR-curves of HiCLRE and other baselines on NYT10 dataset. (Best viewed in color) + +
ModelsNYT10-MKBP
AUCF1P@MAUCF1P@M
PCNN-A41.932.068.615.431.532.8
DISTRE35.731.465.122.137.546.4
CIL56.034.375.929.541.647.3
HiCLRE61.436.988.046.161.056.4
+ +# 4.5 Evaluation on Human Annotated Dataset + +Due to the inevitable annotated errors of distantly supervision assumption, we further evaluate our model on the human-annotated high-quality relation extraction datasets, including NYT10-M and KBP. The performances of baselines and HiCLRE are shown in Table 2. The result shows that Hi + +CLRE can significantly outperform the three strong baselines especially the AUC metric reaches 46.1, which improves about $50\%$ (29.5 $\mapsto$ 46.1) performance than CIL (Chen et al., 2021a) on the KBP dataset. This phenomenon implies that our model possesses a steady generalization ability to other analogous relation extraction datasets. + +# 5 Detailed Analysis of HiCLRE + +# 5.1 Ablation Study + +To verify the effectiveness of various modules in our HiCLRE model, we conduct ablation study experiments on the NYT10 dataset. Specifically, we remove the following argued contributions in turn to evaluate the performance, including multi-granularity recontextualization, three-level contrastive learning loss, and the data augmentation strategies in each level. The final results are shown in Table 3. From the results, we conclude that (1) The context-aware representation interactions for cross levels and the enhanced internal semantics representations for specific level are essential, dropping $-1.8\%$ and $-2.7\%$ point on the AUC metric respectively. (2) We also find the sentence-level data augmentation skills for our HiCLRE model are the most important (e.g. $-4.9\%$ and $-2.6\%$ on AUC) compared to the other two levels. The possible reason may be that the sentence granularity is the fundamental input granularity for the DSRE task including the term "bag" is also constructed by choosing the sentences with identical entity pairs. + +Table 2: Experiment results on human-annotated datasets. + +
MethodsAUCF1P@M
HiCLRE45.349.578.2
-Multi-Gra. Recon.-Three-level CL Loss43.547.176.4
42.647.970.8
-Bag Level-bag gradient43.948.175.4
-bag memory42.448.672.3
-Sentence Level-sen. gradient40.448.973.9
-sen. memory42.748.167.2
-Entity Level-en. gradient43.048.470.1
-en. memory43.146.773.2
+ +Table 3: Ablation study of HiCLRE on NYT10. "–" means removing the module behind. + +# 5.2 The Influence of Multi-Granularity Recontextualization + +Figure 4 shows the comparison of final stable results and speed of convergence between the + +multi-granularity recontextualization and single-granularity7 on the NYT10 dataset. we can observe that (1) multi-granularity recontextualization converges faster to not only stable but also better results. (2) When the final performance of the model converge stably, our multi-granularity recontextualization have less jitter amplitude making our model more robust. + +![](images/eac479f55ba3bf94256115cc81b320ee0fd355e4a7a3903eb34fcbeee67034fc.jpg) +Figure 4: The comparison including convergence speed (i.e. steps) and performance (i.e. F1-score) of training process between our multi-granularity cross-level attention (Multi-Gra.) and single-granularity (Single-Gra.). (Best viewed in color) + +Figure 5 shows the two heat maps of the module with and without attention calculations, proving our multi-granularity recontextualization mechanism is effective for denoising the redundant sentences. For example, we take the sentence-level representations act as "V" value. Our multi-granularity recontextualization mechanism can achieve the higher attention scores (e.g. $S_{3}$ and $S_{4}$ ) for the important sentences in a bag, whereas the no recontextualization models incorrectly assign the highest attention score (e.g. $S_{7}$ ) to the noisy sentences. This phenomenon indicates that this mechanism has a better ability to filter noisy sentences. + +# 5.3 The Influence of Gradient-based Data Augmentation + +To further prove our data augmentation skill of contrastive learning is effective, we choose the other three strategies (i.e. randomly deleting a word, twice dropout, and randomly noise) to perform the evolution process of representation learning space. + +Following the previous works (Wang and Isola, 2020), we treat the pseudo sample as the positive + +Figure 5: The heat maps of our multi-headed attention mechanism (ours) and no attention mechanism (right) among cross levels. (Best viewed in color) +![](images/aaba5ae4a549f6f7dbf5cba0544a4ea04627a7681097e1059fb526135d1f8059.jpg) +bag relation: /business/person/company +S3: In 1998, Steve Jobs asked Cook to join Apple. +S4: Under Cook's leadership, Apple has increased its donations to charity. +S7: The cook should put the apple into microwave on High for 2 minutes. + +instance and a randomly chosen instance from the batch as the negative instance to calculate alignment and uniformity. Then, we plot the transformation of the align-uniform points in Figure 6. The lower alignment and uniformity results indicate the better context-aware representations of the contrastive learning process. Compared to the other positive sample generation skills, our dynamic gradient adversarial perturbation module reduces the alignment and uniformity metrics steadily to the lower value and faster speed. + +![](images/947c2957a0b8e0fd22aa4038c1885b284f11080287e9c65339c6ea2e6a104267.jpg) +Figure 6: Results comparison of HiCLRE and other data augmentation skills in terms of alignment and uniformity. The arrows indicate the training direction. (Best viewed in color). + +# 6 Conclusion + +In this paper, we propose HiCLRE, a hierarchical contrastive learning framework for distantly supervised relation extraction. Multi-Granularity Recontextualization module of HiCLRE utilizes a multi-head self-attention mechanism to transmit + +the information across three levels. Dynamic Gradient Adversarial Perturbation module combines the gradient perturbation with inertia memory information to construct better pseudo positive samples for contrastive learning. Experiments show the effectiveness of HiCLRE against the strong baseline models in various DSRE datasets. + +# Acknowledgements + +We would like to thank anonymous reviewers for their valuable comments. + +# References + +Christoph Alt, Aleksandra Gabryszak, and Leonhard Hennig. 2020. Probing linguistic features of sentence-level representations in relation extraction. In ACL, pages 1534-1545. +Christoph Alt, Marc Hübner, and Leonhard Hennig. 2019. Fine-tuning pre-trained transformer language models to distantly supervised relation extraction. In ACL, pages 1388-1398. +Iz Beltagy, Kyle Lo, and Waleed Ammar. 2019. Combining distant and direct supervision for neural relation extraction. In NAACL, pages 1858-1867. +Tao Chen, Haizhou Shi, Siliang Tang, Zhigang Chen, Fei Wu, and Yueting Zhuang. 2021a. CIL: contrastive instance learning framework for distantly supervised relation extraction. In ACL, pages 6191-6200. +Tao Chen, Haochen Shi, Liyuan Liu, Siliang Tang, Jian Shao, Zhigang Chen, and Yueting Zhuang. 2021b. Empower distantly supervised relation extraction with collaborative adversarial training. In AAAI, pages 12675-12682. +Fenia Christopoulou, Makoto Miwa, and Sophia Ananiadou. 2021. Distantly supervised relation extraction with sentence reconstruction and knowledge base priors. In NAACL, pages 11-26. +Despina Christou and Grigorios Tsoumakas. 2021. Improving distantly-supervised relation extraction through bert-based label and instance embeddings. IEEE Access, pages 62574-62582. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: pre-training of deep bidirectional transformers for language understanding. In *NAACL*, pages 4171–4186. +Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021. Simcse: Simple contrastive learning of sentence embeddings. In EMNLP, pages 6894-6910. +Michael Gutmann and Aapo Hyvärinen. 2010. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In AISTATS, pages 297-304. + +Raia Hadsell, Sumit Chopra, and Yann LeCun. 2006. Dimensionality reduction by learning an invariant mapping. In CVPR, pages 1735-1742. +Raphael Hoffmann, Congle Zhang, Xiao Ling, Luke S. Zettlemoyer, and Daniel S. Weld. 2011. Knowledge-based weak supervision for information extraction of overlapping relations. In ACL, pages 541-550. +Ashish Jaiswal, Ashwin Ramesh Babu, Mohammad Zaki Zadeh, Debapriya Banerjee, and Fillia Makedon. 2020. A survey on contrastive self-supervised learning. CoRR, abs/2011.00362. +Sharmistha Jat, Siddhesh Khandelwal, and Partha P. Talukdar. 2017. Improving distantly supervised relation extraction using word and entity based attention. In NIPS. +Heng Ji, Ralph Grishman, Hoa Trang Dang, Kira Griffin, and Joe Ellis. 2010. Overview of the tac 2010 knowledge base population track. In TAC, volume 3, pages 3-3. +Khalid Al Khatib, Yufang Hou, Henning Wachsmuth, Charles Jochim, Francesca Bonin, and Benno Stein. 2020. End-to-end argumentation knowledge graph construction. In AAAI, pages 7367-7374. +Pengshuai Li, Xinsong Zhang, Weijia Jia, and Hai Zhao. 2019. GAN driven semi-distant supervision for relation extraction. In NAACL, pages 3026-3035. +Yankai Lin, Shiqi Shen, Zhiyuan Liu, Huanbo Luan, and Maosong Sun. 2016. Neural relation extraction with selective attention over instances. In ACL. +Xiao Ling and Daniel S. Weld. 2012. Fine-grained entity recognition. In AAAI. +Dayiheng Liu, Yeyun Gong, Jie Fu, Yu Yan, Jiusheng Chen, Daxin Jiang, Jiancheng Lv, and Nan Duan. 2020. Rikinet: Reading wikipedia pages for natural question answering. In ACL, pages 6762-6771. +Ilya Loshchilov and Frank Hutter. 2017. Fixing weight decay regularization in adam. CoRR. +Ruotian Ma, Tao Gui, Linyang Li, Qi Zhang, Xuanjing Huang, and Yaqian Zhou. 2021. SENT: sentence-level distant relation extraction via negative training. In ACL, pages 6201-6213. +Mike Mintz, Steven Bills, Rion Snow, and Daniel Jurafsky. 2009. Distant supervision for relation extraction without labeled data. In ACL, pages 1003-1011. +Pengda Qin, Weiran Xu, and William Yang Wang. 2018. DSGAN: generative adversarial training for distant supervision relation extraction. In ACL, pages 496-505. +Yujia Qin, Yankai Lin, Ryuichi Takanobu, Zhiyuan Liu, Peng Li, Heng Ji, Minlie Huang, Maosong Sun, and Jie Zhou. 2021. ERICA: improving entity and relation understanding for pre-trained language models via contrastive learning. In ACL, pages 3350-3363. + +Sebastian Riedel, Limin Yao, and Andrew McCallum. 2010. Modeling relations and their mentions without labeled text. In ECML, pages 148-163. +Apoory Saxena, Aditay Tripathi, and Partha P. Talukdar. 2020. Improving multi-hop question answering over knowledge graphs using knowledge base embeddings. In ACL, pages 4498-4507. +Yuhui Shi and Russell C. Eberhart. 1998. Parameter selection in particle swarm optimization. In Evolutionary Programming, pages 591-600. +Livio Baldini Soares, Nicholas FitzGerald, Jeffrey Ling, and Tom Kwiatkowski. 2019. Matching the blanks: Distributional similarity for relation learning. In ACL, pages 2895-2905. +Sen Su, Ningning Jia, Xiang Cheng, Shuguang Zhu, and Ruiping Li. 2018. Exploring encoder-decoder model for distant supervised relation extraction. In *IJCAI*, pages 4389-4395. +Mihai Surdeanu, Julie Tibshirani, Ramesh Nallapati, and Christopher D. Manning. 2012. Multi-instance multi-label learning for relation extraction. In EMNLP, pages 455-465. +Yun Tang, Jing Huang, Guangtao Wang, Xiaodong He, and Bowen Zhou. 2020. Orthogonal relation transforms with graph context modeling for knowledge graph embedding. In ACL, pages 2713-2722. +Aaron van den Oord, Yazhe Li, and Oriol Vinyals. 2018. Representation learning with contrastive predictive coding. CoRR. +Laurens van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-sne. pages 2579-2605. +Shikhar Vashisht, Rishabh Joshi, Sai Suman Prayaga, Chiranjib Bhattacharyya, and Partha P. Talukdar. 2018. RESIDE: improving distantly-supervised neural relation extraction using side information. In EMNLP, pages 1257-1266. +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 NIPS, pages 5998-6008. +Amir Pouran Ben Veyseh, Franck Dernoncourt, Dejing Dou, and Thien Huu Nguyen. 2020. Exploiting the syntax-model consistency for neural relation extraction. In ACL, pages 8021-8032. +Chao Wang and Hui Jiang. 2019. Explicit utilization of general knowledge in machine reading comprehension. In ACL, pages 2263-2272. +Tongzhou Wang and Phillip Isola. 2020. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In ICML, pages 9929-9939. + +Jason W. Wei and Kai Zou. 2019. EDA: easy data augmentation techniques for boosting performance on text classification tasks. In EMNLP, pages 6381-6387. +Zhepei Wei, Jianlin Su, Yue Wang, Yuan Tian, and Yi Chang. 2020. A novel cascade binary tagging framework for relational triple extraction. In ACL, pages 1476-1488. +Shanchan Wu, Kai Fan, and Qiong Zhang. 2019. Improving distantly supervised relation extraction with neural noise converter and conditional optimal selector. In AAAI, pages 7273-7280. +Yuanmeng Yan, Rumei Li, Sirui Wang, Fuzheng Zhang, Wei Wu, and Weiran Xu. 2021. Consert: A contrastive framework for self-supervised sentence representation transfer. In ACL, pages 5065-5075. +Limin Yao, Aria Haghighi, Sebastian Riedel, and Andrew McCallum. 2011. Structured relation discovery using generative models. In EMNLP, pages 1456-1466. +Zhi-Xiu Ye and Zhen-Hua Ling. 2019. Distant supervision relation extraction with intra-bag and inter-bag attentions. In NAACL, pages 2810-2819. +Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020. Word-level textual adversarial attacking as combinatorial optimization. In ACL, pages 6066-6080. +Daojian Zeng, Kang Liu, Yubo Chen, and Jun Zhao. 2015. Distant supervision for relation extraction via piecewise convolutional neural networks. In EMNLP, pages 1753-1762. +Wei Emma Zhang, Quan Z. Sheng, Ahoud Abdulrahmn F. Alhazmi, and Chenliang Li. 2020. Adversarial attacks on deep-learning models in natural language processing: A survey. ACM, pages 24:1-24:41. +Wei Zou, Shujian Huang, Jun Xie, Xinyu Dai, and Jiajun Chen. 2020. A reinforced generation of adversarial examples for neural machine translation. In ACL, pages 3486-3497. + +# A Datasets Statistics + +
Dataset# Rel.# Train# TestTest Type
NYT1058522,611172,448DS
GDS518,3285,663Partly MA
NYT10-M25417,89311,085MA
KBP1287,940288MA
+ +Table 4: Statistics of four datasets. Rel.: relation, DS: distantly supervised and MA: manually annotated. + +# B Case Study + +We enumerate several representative examples in Figure 7 to further explore why our model can work in the distantly supervised scenario. In the left part of the figure, there are two bags containing the different entity pairs (i.e. $\langle$ "Bill Gates", "Microsoft" $\rangle$ and $\langle$ "Robert Walter", "Cardinal Health") . Previous works ignore the consideration of the representation interaction in a specific levels and cross levels, which may be hard to predict similar or difficult instances. For example, sentences of bag $B_{1}$ are always classified into the relation "major_shareholders_of". Although these two relations (i.e. "major_shareholders_of" and "/person/company") are pretty similar to each other, none of the four sentences' semantics in $B_{1}$ represent the meaning of "major_shareholders_of". In particular, after the context-aware representations interaction via cross levels and specific levels, HiCLRE can correctly predict the bag to the ground-truth label; likewise, the bag $B_{2}$ is in the same situation. + +In the right part of the figure, we demonstrate an example of that HiCLRE can pull the correlated instance closely and push the uncorrelated instance away. We reduce the dimension of bag examples' representations by t-SNE (van der Maaten and Hinton, 2008) and show the example results in the coordinate system. $R^{*}$ is the target instance to be classified, the symbol "+" represents the degree of relevance and - represents the degree of irrelevance. HiCLRE can pull the related sample $R^{+}$ to $R^{+++}$ (i.e. closer to $R^{*}$ ), while pushing the uncorrelated sample $R^{-}$ to $R^{- - }$ (farther from $R^{*}$ ). This phenomenon is own to the design of gradient-based perturbation, which gives significant enhancement to interactions in a specific level. + +# C The influence of important hyper parameters + +We experiment with our model on the NYT10 dataset with four important hyper-parameters, and discover a suitable parameters' combination to reach better performance. + +
BagSentenceWrong PredictionHiCLRE(ours) Prediction
B1If Bill Gates had to worry about health insurance would he have started Microsoft? +Bill Gates will be involved , Mr. Trump said , with a new Microsoft product . +Microsoft will invest $ 1.7 billion in India over the next four years, its chairman , Bill Gates , said Wednesday . +Three decades after he started Microsoft with the dream of placing a personal computer in every home and business , Bill Gates said that he would leave his day-to-day role there in two years ./business /company_ shareholder /major_share holders_of/business /person /company
B2Robert Walter retired from Cardinal Health in June 2008. +Robert Walter is setting down his memories of Cardinal Health's life. +Cardinal Health reported $151000 in personal aircraft use last year for Robert Walter./business /company /founders/business /person /company
+ +![](images/fb562c2aeb8583185daf7ea198eb34a3c64b30bda746d06ace2891d657087019.jpg) +Figure 7: Examples of cases in our experiments. The left table means the comparison of predicted labels. The right figure shows the Dynamic Gradient Adversarial Perturbation module's working process.(Best viewed in color). + +![](images/db256d701c7febb2662fe983bef9fb23f0023b91a247ae2ed0777d4bb1ac69ba.jpg) + +![](images/162c1d269eb27a595cbdfc51d03a04de354ec1a68b0f38b4622f5716aadd982d.jpg) + +![](images/ac1fff23c6c8ec80a40ed9ccb7195a41f02baffc2cae802e543fd8e0be2b0158.jpg) +Figure 8: The influence of four important hyper-parameters on the NYT10 dataset. (Best viewed in color). + +![](images/51882f22457885ba5806e606771eae90bad9d8e2be079d762878f3f78f967495.jpg) \ No newline at end of file diff --git a/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/images.zip b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..42162f52cca38e916b88aade648342fe51b7de8c --- /dev/null +++ b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb389bad3cf5daf56145df9c7b5380b2bd7ea69a3297e3bf723dd371afa8df20 +size 647852 diff --git a/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/layout.json b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7361b1f541299872dce886c530f4c87f9fbe263d --- /dev/null +++ b/hiclreahierarchicalcontrastivelearningframeworkfordistantlysupervisedrelationextraction/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a67e8bbbf26624c42efcdea4937b592dd6f99bac6f91c696f43ac88b47e6d06 +size 455876 diff --git a/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_content_list.json b/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5e738dd54bc1eca290865aa51de35aba47aa4d73 --- /dev/null +++ b/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b72da284bef80296d2cc18a428f94146bf6f556aafce38c034dc0b25f0817043 +size 51859 diff --git a/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_model.json b/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f37ac92accd874ce7247bbd887fb0c0d78027d23 --- /dev/null +++ b/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9380132110ef68463de70d431163bbab981ce12bbef7c4c3b619aaf1cdd0f82 +size 62534 diff --git a/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_origin.pdf b/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f85466c95611961f95687dd66568cbc7440dd6f1 --- /dev/null +++ b/hierarchicalinductivetransferforcontinualdialoguelearning/464a698b-05c0-437c-a556-5006df313459_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0be49d974d8dca9a8d75d737ccbdd90b47bf1cc328223ca38564e9e31cc48a09 +size 1652318 diff --git a/hierarchicalinductivetransferforcontinualdialoguelearning/full.md b/hierarchicalinductivetransferforcontinualdialoguelearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d99c88f636aa20742d036584f82fc8c9c3875a47 --- /dev/null +++ b/hierarchicalinductivetransferforcontinualdialoguelearning/full.md @@ -0,0 +1,206 @@ +# Hierarchical Inductive Transfer for Continual Dialogue Learning + +Shaoxiong Feng $^{1,2}$ Xuancheng Ren $^{3}$ Kan Li $^{1}$ Xu Sun $^{3,4}$ + +$^{1}$ Beijing Institute of Technology $^{2}$ University of Technology Sydney $^{3}$ MOE Key Laboratory of Computational Linguistics, School of CS, Peking University $^{4}$ Beijing Academy of Artificial Intelligence + +{shaoxiongfeng, likan}@bit.edu.cn {renxc, xusun}@pku.edu.cn + +# Abstract + +Pre-trained models have achieved excellent performance on the dialogue task. However, for the continual increase of online chit-chat scenarios, directly fine-tuning these models for each of the new tasks not only explodes the capacity of the dialogue system on the embedded devices but also causes knowledge forgetting on pre-trained models and knowledge interference among diverse dialogue tasks. In this work, we propose a hierarchical inductive transfer framework to learn and deploy the dialogue skills continually and efficiently. First, we introduce the adapter module into pre-trained models for learning new dialogue tasks. As the only trainable module, it is beneficial for the dialogue system on the embedded devices to acquire new dialogue skills with negligible additional parameters. Then, for alleviating knowledge interference between tasks yet benefiting the regularization between them, we further design hierarchical inductive transfer that enables new tasks to use general knowledge in the base adapter without being misled by diverse knowledge in task-specific adapters. Empirical evaluation and analysis indicate that our framework obtains comparable performance under deployment-friendly model capacity. + +# 1 Introduction + +Neural dialogue models (Shang et al., 2015; Serban et al., 2016; Li et al., 2016) have drawn increasing attention due to their high commercial value. Previous work usually makes efforts to improve the diversity and coherence of the responses (Serban et al., 2017; Zhang et al., 2018a,c; Feng et al., 2020; Sun et al., 2021). However, the application of neural dialogue models also requires advanced conversation skills, and recently, a lot of work tries to enable models to express empathy (Zhou et al., 2018; Rashkin et al., 2019), be knowledgeable (Ghazvininejad et al., 2018; Dinan et al., 2019), and demonstrate consistent personalities (Qian et al., 2018; Zhang et al., 2018b, 2019). + +Specifically, the dialogue model is trained on a task-specific dataset to learn the corresponding conversation skill. However, with the increasing number of online chit-chat scenarios, the dialogue system is further expected to continually specialize in new tasks without sacrificing the performance on old tasks. Meanwhile, the dialogue system must keep its capacity as small as possible for the deployment on the computation resource-limited embedded devices. + +Pre-trained models (Radford et al., 2018; Devlin et al., 2019) have successfully facilitated the learning of the downstream tasks in various fields. To address the challenge of continual dialogue learning, directly fine-tuning pre-trained models on each of the new dialogue tasks is a straightforward way to equip the dialogue system with new conversation skills continually. However, it explodes the capacity of the dialogue system because knowledge of new tasks need to be stored in new pre-trained models to avoid erasing knowledge of old tasks. A more advanced approach is to multi-task one pretrained model on all old tasks and then fine-tune it on new tasks, which can alleviate the capacity problem and use general knowledge between old tasks to improve the model performance on new tasks (Smith et al., 2020). Nonetheless, these advantages come at the cost of performance decline on some old tasks due to knowledge interference between diverse tasks. + +To tackle these problems, we propose a hierarchical inductive transfer framework to construct and deploy the dialogue system with fewer computational resources. The framework is inspired by the fact that the conversational skills are multilayered, and while general skills, e.g., uttering fluent sentences, are necessary for all scenarios and the requisite for sophisticated skills, specialized skills, such as negotiating and debating, work for fewer occasions. In the hierarchy of conversational skills, the latter skills could be efficiently built upon + +the former skills if they are well-learned. However, considering it is difficult to determine the proper order of the skills and the skills needed for a dataset, we take the following practical approach. + +We first introduce the adapter module, consisting of a small sub-net, into the pre-trained model. Each block of the pre-trained model is assigned two adapters inserted after the self-attention layer and the feed-forward layer. During training, adapters, as the only trainable parameters, learn knowledge of dialogue tasks, which avoids knowledge forgetting on pre-trained models and therefore keeps the capacity of the dialogue system almost constant as the number of dialogue tasks increases. Then, we separate the adapter into the base adapter and the task-specific adapter to avoid the performance decline of models on old tasks caused by knowledge interference between diverse tasks. The former is multi-tasked with old tasks to obtain general knowledge by regularization between diverse tasks, which facilitates the learning of new tasks. The latter is further fine-tuned on any dialogue task to learn the corresponding task-specific knowledge, which maintains the model performance on old tasks. Finally, the proposed framework significantly enhances the training efficiency due to the learning of dialogue tasks only being conducted via adapters. + +# 2 Method + +In this section, we first describe the vanilla adapter and how to apply it to the dialogue tasks and then present the hierarchical inductive transfer to learn general knowledge and task-specific knowledge. + +# 2.1 Adapter for Continual Dialogue Learning + +Directly fine-tuning pre-trained models for each of the new dialogue tasks will cause knowledge forgetting, and therefore each task requires a large set of parameters for maintaining the model performance on both old and new tasks. Compared with it, we keep the parameters of the pre-trained model fixed and use the adapter to learn new tasks. Adapters are inserted after the self-attention layer and the feed-forward layer of each block of the pre-trained model, illustrated in Figure 1: + +$$ +\mathbf {h} ^ {l + 1} = \operatorname {L N} \left(\mathbf {h} ^ {l} + \operatorname {A d a} \left(\operatorname {F u n} \left(\mathbf {h} ^ {l}\right)\right)\right), \tag {1} +$$ + +where $\mathbf{h}^l$ and $\mathbf{h}^{l + 1}$ represent the input and the output of sub-blocks, and $\mathrm{Fun}(\cdot)$ , $\mathrm{Ada}(\cdot)$ , and $\mathrm{LN}(\cdot)$ represent the function layer (i.e., the self-attention + +![](images/59f8dac02ea742907324497e0739ccd2647360579df14ccc5a3dcf67b8ca65be.jpg) +Figure 1: An overview of the hierarchical inductive transfer framework. + +layer or the feed-forward layer), the adapter, and the layer norm, respectively. + +Each adapter consists of a bottleneck module with a skip-connection. Concretely, the bottleneck module first down-projects the $d_{o}$ -dimension output of the previous layer into features with a smaller dimension, $d_{a}$ , followed by a nonlinearity, and then up-projects to the original dimension. Formally, it can be expressed as: + +$$ +\operatorname {A d a} (\mathbf {o}) = \mathbf {o} + W ^ {U} a \left(W ^ {D} \mathbf {o}\right), \tag {2} +$$ + +where $W^{D}(d_{o} \times d_{a})$ and $W^{U}(d_{a} \times d_{o})$ are the parameters of the down- and the up-projections, and $a(\cdot)$ is the activation function. By adjusting the value of $d_{a}$ , we can control the number of parameters of adapters to a deployment-friendly range. + +For each new task, only a few parameters need to be trained on the cloud servers and delivered to the embedded devices, which significantly improves the training efficiency and reduces the size of the dialogue system. Please refer to Appendix B for a more detailed discussion. + +# 2.2 Hierarchical Inductive Transfer + +In continual dialogue learning, the old tasks usually contain useful knowledge for the learning of new tasks. But they may also have knowledge interference with new tasks. To alleviate this issue, one can multi-task the adapters with all old tasks and find general knowledge for new tasks. However, the regularization between diverse tasks also causes the performance decline of multi-tasked models on some old tasks due to knowledge interference among old tasks. Therefore, we further design a hierarchical inductive transfer framework that consists of two kinds of adapter, the base adapter and the task-specific adapter. + +Specifically, we take the vanilla adapters as the base adapters and introduce a set of new adapters + +
MethodΘθΔConvAI2WoWEDBSTAverage
FE+0.216×5.4%0.86980.91290.62550.74130.7874
FT+4.0 ×100%0.88550.9170.62670.78380.8032
MT+FT+2.0 ×100%0.88780.92740.62410.82410.8158
Ada+0.075×1.87%0.8880.91770.62040.76620.7981
AdaHIT+0.112×4.2%0.89140.91930.63580.81670.8158
+ +Table 1: Comparison in terms of total number of additional parameters $(\Theta)$ , trainable parameters per task $(\theta_{\Delta})$ , and performance on tasks. The proposed AdaHIT achieves performance competitive with the state-of-the-art (MT+FT) with far fewer total parameters to be stored and parameters to be trained. + +inserted before the feed-forward layers of each base adapter as the task-specific sub-adapters, shown in Figure 1. It can be formulated as: + +$$ +\mathrm {A d a} _ {\mathrm {b s}} (\mathbf {o}) = \mathbf {o} + W ^ {U} \mathrm {A d a} _ {\mathrm {t s}} \left(a \left(W ^ {D} \mathrm {A d a} _ {\mathrm {t s}} (\mathbf {o})\right)\right), (3) +$$ + +where $\mathrm{Ada_{bs}}(\cdot)$ and $\mathrm{Ada_{ts}}(\cdot)$ represent the base adapter and the task-specific adapter. Each task-specific adapter also consists of a bottleneck module and a skip-connection. + +During training, we first multi-task the base adapters with all old tasks to find general knowledge and then fine-tune a set of task-specific adapters for each task, including old tasks and new tasks, which enables the new task to benefit from the knowledge of old tasks without sacrificing the model performance on some old tasks. + +# 3 Experiment + +# 3.1 Datasets and Baselines + +Datasets To evaluate the proposed framework, we take ConvAI2 (an extension of the PersonaChat dataset (Zhang et al., 2018b)), Wizard of Wikipedia (WoW) (Dinan et al., 2019), Empathetic Dialogues (ED) (Rashkin et al., 2019), and Blended Skill Talk (BST) (Smith et al., 2020) as an instance of continual dialogue learning. The first three tasks are the old tasks and the last task represents the new task. + +Baselines Four methods of inductive transfer are used to compare with our framework (AdaHIT), including feature extraction (FE), which adds and optimizes a classification layer on the top of the pretrained model (Vaswani et al., 2017), fine-tuning (FT), which updates all parameters of the pretrained model for each task, multi-tasking with fine-tuning $(\mathbf{MT} + \mathbf{FT})$ , which first multi-tasks the entire pre-trained model with all old tasks and then fine-tunes it on the new task, and vanilla adapter (Ada), which trains a set of adapters for each task. + +# 3.2 Experimental Settings + +Following Smith et al. (2020), we use the poly-encoder with 256M parameters (Humeau et al., 2019) as the underlying model, pretrain it on the pushshift.io Reddit dataset, and then conduct inductive transfer on the downstream tasks. We also truncate the length of label and text to 72 and 360, and set the embedding size to 768 as Smith et al. (2020). The batch size is 128 and the other responses in a batch are set as negatives for training. The dimension of adapters $d_{a}$ is 64. We adopt AdaMax (Kingma and Ba, 2015) as the optimizer throughout the experiments, and the learning rates are 9e-4, 2.5e-3, 1e-3, and 4e-4 for ConvAI2, WoW, ED, and BST. The total training epochs are 8 with linear warm-up for $10\%$ and linear decay for the rest. All experiments are conducted using ParlAI1. + +# 3.3 Experimental Results + +For the retrieval-based dialogue scenarios, we measure hits@ $1 / \mathrm{K}^2$ on the validation set of each task for automatic evaluation. The number of candidates is 20 for ConvAI2 and 100 for other tasks. The results reported in Table 1 show that AdaHIT achieves the best average performance, the same as MT+FT, at the cost of far fewer parameters to be trained and stored, indicating the superiority of deployment on embedded devices. AdaHIT significantly outperforms Ada in both old tasks and new task with a slight regression of computational efficiency, which demonstrates that the hierarchical inductive transfer can extract general knowledge to facilitate the learning of the new task while boosting the model performance on old tasks effectively. + +# 3.4 Ablation Study and Analysis + +Effect of Base Adapter To analyze the effect of the base adapter, we train it with different tasks, and then test it on BST in a zero-shot manner, + +
Dataset for AdapterBST (Zero-Shot)BST (Fine-Tuning)
ConvAI20.7530.8039
WoW0.62220.7751
ED0.63490.7846
MT0.7680.8167
+ +Table 2: Effect of training datasets for the base adapter. + +
Number of Layers123456
AdaHIT0.8090.8070.7960.7850.7620.734
Position of Layers0246810
AdaHIT0.8090.8080.8090.8010.7930.763
+ +Table 3: Ablation Study in terms of number and position of removed adapters on BST. + +or a fine-tuning manner which is the same with AdaHIT. From the results in Table 2, we can observe that the base adapter with multi-tasking obtains the best performance under both the zero-shot and the fine-tuning setting, indicating that multitasking provides more general knowledge for the learning of BST. It is also worth mentioning that the base adapter trained on ConvAI2 achieves better performance than adapters on other tasks, because ConvAI2 contains more useful information, e.g., persona, that also exists every sample of BST. + +Visualization To verify whether AdaHIT helps task adaption, we visualize the representations from models with different base adapters, i.e., trained on MT and ConvAI2, the result of which is shown in Figure 2. As we can see, the two models can both adjust to specific downstream tasks but representations with MT are better distributed and more tightly clustered. It is also interesting to see that the model with MT may implicitly distinguish the skills for each task, because while ED and ConvAI2 share more common skills, they are quite different from WoW, and such difference is evidently reflected by the visualization. + +Ablation Study We further investigate the impact of adapters on model performance quantitatively. First, we gradually remove each trained adapter from the bottom layer, and then increase the number of removed adapters. As shown in Table 3, the adapters of higher layers have more significant effects than the adapters of lower layers, indicating that we can only insert the adapters into the higher layers to improve the training efficiency. + +# 4 Related Work + +Continual Dialogue Learning Neural dialogue models (Mou et al., 2016; Xing et al., 2017; Zhao + +![](images/77408d45816686374f33a5f7d4092c135eec3844494af13cfe5efced47d6ef99.jpg) +Figure 2: Visualization of learned sentence representations from AdaHIT with differently-trained base adapters. MT is on the left and ConvAI2 is on the right. + +![](images/64bbb42f00a7c6ba44b84b8424600760797370472fc63139ce68ebb85762a897.jpg) + +et al., 2017; Shen et al., 2018; Feng et al., 2021) can acquire various kinds of conversation skills from corpora, such as characterizing personalities (Qian et al., 2018; Zhang et al., 2018b), expressing emotion and empathy (Zhou et al., 2018; Rashkin et al., 2019), and retrieving knowledge (Ghazvininejad et al., 2018; Dinan et al., 2019). Unlike existing work on enhancing a particular conversation skill, we work towards a new dialogue learning paradigm, where conversation skills are gradually embedded into a single model by mutual reinforcement instead of interference. + +Inductive Transfer Continual learning in terms of transferring inductive knowledge from pretrained models to downstream tasks can be categorized into feature-based, fine-tuning-based, and adapter-based (Ruder, 2019). We adopt the adapter-based approach that benefits from both pre-trained models and a small set of extra parameters for task-specific knowledge. Unlike conventional adapters (Houlsby et al., 2019; Poth et al., 2021; Pfeiffer et al., 2021), knowledge in the proposed adapters will be used to further boost the learning of new dialogue tasks, whereas knowledge of each task is separated into general and task-specific parts to avoid knowledge interference. Madotto et al. (2020) also uses the adapters to acquire the conversation skills, but it does not consider knowledge transfer and interference between adapters. + +# 5 Conclusion + +In this work, we propose a hierarchical inductive transfer framework to efficiently train and deploy the pre-trained models for growing numbers of new dialogue tasks requiring diverse skills. Considering the computation resource-limited embedded devices, we first adopt the adapter module, a small plug-in sub-net, as the only incremental and trainable parameters for learning each of the new dialogue tasks. To take advantage of knowledge in old tasks to facilitate the learning of new tasks, we fur + +ther propose the hierarchical inductive transfer to alleviate knowledge interference between tasks and provide general knowledge for new tasks. Extensive experiments and analysis demonstrate that the proposed framework achieves high computational efficiency with competitive performance. + +# Acknowledgements + +This research is supported by Beijing Natural Science Foundation (No. 4222037 and L181010), National Natural Science Foundation of China (No. 61972035), Natural Science Foundation of China (NSFC) No. 62176002, and Beijing Academy of Artificial Intelligence (BAAI). Xu Sun and Kan Li are the corresponding authors. + +# References + +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, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171-4186. Association for Computational Linguistics. +Emily Dinan, Stephen Roller, Kurt Shuster, Angela Fan, Michael Auli, and Jason Weston. 2019. Wizard of wikipedia: Knowledge-powered conversational agents. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Shaoxiong Feng, Xuancheng Ren, Hongshen Chen, Bin Sun, Kan Li, and Xu Sun. 2020. Regularizing dialogue generation by imitating implicit scenarios. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 6592-6604. Association for Computational Linguistics. +Shaoxiong Feng, Xuancheng Ren, Kan Li, and Xu Sun. 2021. Multi-view feature representation for dialogue generation with bidirectional distillation. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 12812-12820. AAAI Press. +Marjan Ghazvininejad, Chris Brockett, Ming-Wei Chang, Bill Dolan, Jianfeng Gao, Wen-tau Yih, and Michel Galley. 2018. A knowledge-grounded neural conversation model. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, + +(AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 5110-5117. AAAI Press. +Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-efficient transfer learning for NLP. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 2790-2799. PMLR. +Samuel Humeau, Kurt Shuster, Marie-Anne Lachaux, and Jason Weston. 2019. Real-time inference in multi-sentence tasks with deep pretrained transformers. CoRR, abs/1905.01969. +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. +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016. A diversity-promoting objective function for neural conversation models. In *NAACL HLT* 2016, The 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego California, USA, June 12-17, 2016, pages 110-119. The Association for Computational Linguistics. +Andrea Madotto, Zhaojiang Lin, Yejin Bang, and Pascale Fung. 2020. The adapter-bot: All-in-one controllable conversational model. CoRR, abs/2008.12579. +Lili Mou, Yiping Song, Rui Yan, Ge Li, Lu Zhang, and Zhi Jin. 2016. Sequence to backward and forward sequences: A content-introducing approach to generative short-text conversation. In COLING 2016, 26th International Conference on Computational Linguistics, Proceedings of the Conference: Technical Papers, December 11-16, 2016, Osaka, Japan, pages 3349-3358. ACL. +Jonas Pfeiffer, Aishwarya Kamath, Andreas Rückle, Kyunghyun Cho, and Iryna Gurevych. 2021. Adapterfusion: Non-destructive task composition for transfer learning. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, EACL 2021, Online, April 19 - 23, 2021, pages 487-503. Association for Computational Linguistics. +Clifton Poth, Jonas Pfeiffer, Andreas Rückle, and Iryna Gurevych. 2021. What to pre-train on? efficient intermediate task selection. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, + +2021, pages 10585-10605. Association for Computational Linguistics. +Qiao Qian, Minlie Huang, Haizhou Zhao, Jingfang Xu, and Xiaoyan Zhu. 2018. Assigning personality/profile to a chatting machine for coherent conversation generation. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, July 13-19, 2018, Stockholm, Sweden, pages 4279-4285. ijcai.org. +Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding by generative pre-training. OpenAI Blog. +Hannah Rashkin, Eric Michael Smith, Margaret Li, and Y-Lan Boureau. 2019. Towards empathetic open-domain conversation models: A new benchmark and dataset. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28-August 2, 2019, Volume 1: Long Papers, pages 5370-5381. Association for Computational Linguistics. +Sebastian Ruder. 2019. Neural transfer learning for natural language processing. Ph.D. thesis, National University of Ireland, Galway. +Iulian Vlad Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C. Courville, and Joelle Pineau. 2016. Building end-to-end dialogue systems using generative hierarchical neural network models. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, February 12-17, 2016, Phoenix, Arizona, USA, pages 3776-3784. AAAI Press. +Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron C. Courville, and Yoshua Bengio. 2017. A hierarchical latent variable encoder-decoder model for generating dialogues. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 3295-3301. AAAI Press. +Lifeng Shang, Zhengdong Lu, and Hang Li. 2015. Neural responding machine for short-text conversation. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing of the Asian Federation of Natural Language Processing, ACL 2015, July 26-31, 2015, Beijing, China, Volume 1: Long Papers, pages 1577-1586. The Association for Computer Linguistics. +Xiaoyu Shen, Hui Su, Shuzi Niu, and Vera Demberg. 2018. Improving variational encoder-decoders in dialogue generation. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 5456-5463. AAAI Press. + +Eric Michael Smith, Mary Williamson, Kurt Shuster, Jason Weston, and Y-Lan Boureau. 2020. Can you put it all together: Evaluating conversational agents' ability to blend skills. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 2021-2030. Association for Computational Linguistics. +Bin Sun, Shaoxiong Feng, Yiwei Li, Jiamou Liu, and Kan Li. 2021. Generating relevant and coherent dialogue responses using self-separated conditional variational autoencoders. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 5624-5637. Association for Computational Linguistics. +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 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998-6008. +Chen Xing, Wei Wu, Yu Wu, Jie Liu, Yalou Huang, Ming Zhou, and Wei-Ying Ma. 2017. Topic aware neural response generation. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 3351-3357. AAAI Press. +Hainan Zhang, Yanyan Lan, Jiafeng Guo, Jun Xu, and Xueqi Cheng. 2018a. Reinforcing coherence for sequence to sequence model in dialogue generation. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, July 13-19, 2018, Stockholm, Sweden, pages 4567-4573. ijcai.org. +Saizheng Zhang, Emily Dinan, Jack Urbanek, Arthur Szlam, Douwe Kiela, and Jason Weston. 2018b. Personalizing dialogue agents: I have a dog, do you have pets too? In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 2204-2213. Association for Computational Linguistics. +Wei-Nan Zhang, Qingfu Zhu, Yifa Wang, Yanyan Zhao, and Ting Liu. 2019. Neural personalized response generation as domain adaptation. World Wide Web, 22(4):1427-1446. +Yizhe Zhang, Michel Galley, Jianfeng Gao, Zhe Gan, Xiujun Li, Chris Brockett, and Bill Dolan. 2018c. Generating informative and diverse conversational responses via adversarial information maximization. In Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montreal, Canada, pages 1815-1825. + +Tiancheng Zhao, Ran Zhao, and Maxine Eskenazi. 2017. Learning discourse-level diversity for neural dialog models using conditional variational autoencoders. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pages 654-664. Association for Computational Linguistics. + +Hao Zhou, Minlie Huang, Tianyang Zhang, Xiaoyan Zhu, and Bing Liu. 2018. Emotional chatting machine: Emotional conversation generation with internal and external memory. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 730-739. AAAI Press. + +# A Structure of Adapters + +We have designed and evaluated diverse structures of adapters for continual dialogue tasks, such as the self-attention structure and the convolutional structure. However, there is no significant effect on performance, which is in line with previous adapter-based work. For the basic bottleneck structure, there are two advantages. First, it can limit the number of parameters per adapter by setting the bottleneck dimension $d_{a} \ll d_{o}$ . Second, it also provides a flexible way to trade-off model performance with parameter efficiency. + +
MethodConvAI2WoWED
MT (B-FT)0.88780.92740.6241
MT (A-FT)0.87670.90940.6136
+ +# B Training Efficiency of Adapters + +Compared with the traditional fine-tuning method, our framework conducts the learning of dialogue tasks only by adapters, which reduces the memory requirements and the computing operations of each batch and therefore trains more samples with the same time. For example, there is a two-layer network, and only the first layer is trainable: + +$$ +y _ {1} = f \left(w _ {1} * x + b _ {1}\right) +$$ + +$$ +y _ {2} = f \left(w _ {2} * y _ {1} + b _ {2}\right) +$$ + +Although we still need to calculate $\frac{\partial y_2}{\partial y_1}$ due to the chain rule, we do not calculate $\frac{\partial y_2}{\partial w_2}$ and $\frac{\partial y_2}{\partial b_2}$ (i.e., + +Table 4: Results on the old tasks. MT (B-FT) and MT (A-FT) represent the multi-tasking model before and after being fine-tuned on the new task, respectively + +
ConvAI2WoWEDBSTAverage
0.88330.92330.62880.83420.8174
+ +Table 5: Results of the model that is first pre-trained on the old tasks and then multi-tasked on all tasks. + +reducing the computing operations) and do not save them (i.e., reducing the memory requirements) for the parameter update. Considering the number of parameters of Transformer, the proposed framework indeed improves the training efficiency. Moreover, we can only insert the adapters in the top layers because the adapters in the bottom layers have a weaker effect on the model performance, indicated by Table 3, which limits the chain derivative to the top layers and further reduces the computing operations. + +# C Knowledge Forgetting of FT + +In order to demonstrate knowledge forgetting of the traditional fine-tuning method, we evaluate the performance of the multi-tasking model (MT) on the old tasks before and after being fine-tuned on the new task. As shown in Table 4, the model fine-tuned on the new task (BST) shows consistent performance degradation on the old tasks. + +For a fair comparison, both our method (AdaHIT) and MT+FT are multi-tasked on the old tasks and then fine-tuned on the new task. We also provide the results of a stronger model that is first pre-trained on the old tasks and then multi-tasked on all tasks (i.e., both the old and the new tasks). The results of Table 5 show that AdaHIT still achieves comparable performance but consumes less computational cost. \ No newline at end of file diff --git a/hierarchicalinductivetransferforcontinualdialoguelearning/images.zip b/hierarchicalinductivetransferforcontinualdialoguelearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..dc698fe5a39376e83573d25fa28cb31fcfcbe2c1 --- /dev/null +++ b/hierarchicalinductivetransferforcontinualdialoguelearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68b4ab54d37578c4e60bb4622f0b69ba3d7d223c724f980396a219441f742018 +size 154247 diff --git a/hierarchicalinductivetransferforcontinualdialoguelearning/layout.json b/hierarchicalinductivetransferforcontinualdialoguelearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..afbc38cbc18d90f3bc825eaba6d5add3dc90e312 --- /dev/null +++ b/hierarchicalinductivetransferforcontinualdialoguelearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d82d89465a45597ffc77bfb5d3249c85bdc9b1d3e7171860228e2561dc6cf2 +size 217515 diff --git a/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_content_list.json b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ed3a5c1a66defef4f5203250f68702cf0b640278 --- /dev/null +++ b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e4f2d427466c3feb1d9775fb36bdf3db55e3615653eecda55483bcefca30ae4 +size 100139 diff --git a/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_model.json b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e6ea48f90fbd0296e9647b08579cb4d460f01ec1 --- /dev/null +++ b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc0150299fba8aa50aa6df34eb5fb49f9b013ed8dd68a1c553cf4f869483e442 +size 113304 diff --git a/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_origin.pdf b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7616a209adc0285f375e1b7c3fec9207c1685035 --- /dev/null +++ b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/530979a1-0faf-47a5-a7a6-fbbf17f96571_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfa48294e4a418a84041e3a10323c83d6f6f81ace4d9563618e697c973515aa8 +size 532930 diff --git a/hierarchicalrecurrentaggregativegenerationforfewshotnlg/full.md b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2a1d6dee3d0588354fea68796fc5063154100b48 --- /dev/null +++ b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/full.md @@ -0,0 +1,380 @@ +# Hierarchical Recurrent Aggregative Generation for Few-Shot NLG + +Giulio Zhou +Huawei Noah's Ark Lab +London, UK + +Gerasimos Lampouras +Huawei Noah's Ark Lab +London, UK + +Ignacio Iacobacci +Huawei Noah's Ark Lab +London, UK + +{giuliozhou, gerasimos.lampouras, ignacio.iacobacci}@huawei.com + +# Abstract + +Large pretrained models enable transfer learning to low-resource domains for language generation tasks. However, previous end-to-end approaches do not account for the fact that some generation sub-tasks, specifically aggregation and lexicalisation, can benefit from transfer learning to different extents. To exploit these varying potentials for transfer learning, we propose a new hierarchical approach for few-shot and zero-shot generation. Our approach consists of a three-modulated jointly trained architecture: the first module independently lexicalises the distinct units of information in the input as sentence sub-units (e.g. phrases), the second module recurrently aggregates these sub-units to generate a unified intermediate output, while the third module subsequently post-edits it to generate a coherent and fluent final text. We perform extensive empirical analysis and ablation studies on few-shot and zero-shot settings across 4 datasets. Automatic and human evaluation shows that the proposed hierarchical approach is consistently capable of achieving state-of-the-art results when compared to previous work. + +# 1 Introduction + +The recent development of large pretrained language models (PLMs; i.e. BERT (Devlin et al., 2019), GPT-3 (Brown et al., 2020), T5 (Raffel et al., 2020)) has caused a shift of interest in the research community towards domain adaptation and transfer learning. For the task of concept-to-text natural language generation (NLG), wherein the aim is to generate a natural language text that describes the semantic content of an abstract structured machine-readable input (Meaning Representation; MR), transfer learning from PLMs has become a popular and high performing approach with 13 out of the 15 participating teams in the latest + +![](images/ff45e3d36df213f890e5d4a81bcdb3e622a1ca009d16b32881af9c2494596f33.jpg) +Figure 1: Structure of Hierarchical Recurrent Aggregative Generation (HRAG). The lexicalisation PLM generates one sub-phrase per attribute-value pair. The aggregation PLM recurrently combines sub- phrases and the post-edit PLM rephrases them into a fluent output. + +WebNLG+ Shared Task (Ferreira et al., 2020) employing a fine-tuned pretrained model as their main submitted system. Specifically, T5-based systems achieved a human evaluation ranking on par with the ground truth in terms of fluency and adequacy. Transfer learning from PLMs also enables training on few-shot and zero-shot settings, i.e. when sufficient in-domain data are unavailable. Prominent and relevant examples include machine translation (Zoph et al., 2016; Brown et al., 2020) and NLG for task-oriented dialogues (Peng et al., 2020). + +This paper focuses on concept-to-text NLG, where recent machine learning and in extension transfer learning approaches adopt an end-to-end + +![](images/1462970b29c914520e4c7fc9a8f33bb68d5282569621741d641fd451c7f811d2.jpg) +Figure 2: Example of lexicalisation (in blue), recurrent aggregation (in orange), and post-editing (in red) stages. + +architecture (Peng et al., 2020) that inputs the full meaning representation and produces the full output text. In such end-to-end models, the traditional sub-tasks (Reiter and Dale, 2000) involved in language generation (i.e. planning, lexicalisation, aggregation, referring expression generation, and surface realisation) are performed implicitly. However, we posit that some of these sub-tasks, specifically lexicalisation (i.e. choice of vocabulary) and aggregation (i.e. process of combining simpler sentence structures to form complex ones), exhibit varying potential for exploiting transfer learning as the former is more domain-specific than the latter. For example, it is more difficult to exploit transfer learning for lexicalisation since if certain words are not already associated with a particular MR input, few-shot learning may not be able to create a strong association through the limited data. This is further exacerbated in zero-shot learning. On the other hand, the knowledge required to form complicated sentence structures and apply aggregation strategies is more commonly shared between domains and would benefit more from transfer learning. + +We aim to exploit these differing potentials for transfer learning in few-shot and zero-shot generation, via a new hierarchical approach to concept-to-text NLG. Specifically, we propose Hierarchical Recurrent Aggregative Generation (HRAG), a three-modulated architecture where the first module is in charge of independently lexicalising each unit of information in the input as a sub-phrase (e.g. a phrase expressing that unit of information alone), the second module is responsible for recurrently aggregating these sub-units to generate a unified text, and the third module rephrases it to produce a coherent and fluent output; see Figure 1. These are jointly trained via a loss that combines their discrete objectives. Concept-to-text is ideal for HRAG + +as MRs can be split into attribute-value pairs that vaguely correspond to output sub- phrases. + +In this paper, we (i) present Hierarchical Recurrent Aggregative Generation and experimentally demonstrate the benefits of separately applying transfer learning to language generation subtasks; (ii) facilitate the model's training by inferring module-specific training signal from the available output targets; (iii) provide extensive empirical analysis and ablation studies on few-shot and zero-shot settings across 4 datasets, one of which we adapt ourselves for few-shot learning; (iv) perform human evaluation comparing our proposed approach to previous work on few-shot generation. Our automatic and human evaluation results show that our hierarchical approach achieves state-of-the-art results when compared against previous work. + +# 2 Method + +Figure 1 shows the overall structure of the proposed hierarchical model HRAG. Its three modules are in charge of lexicalisation, aggregation and postedit, and are inspired by traditional NLG stages and their specific potential for transfer learning in a few-shot setting. Figure 2 shows an example of how the outputs of each stage are formed. + +# 2.1 Input segmentation + +In a pre-processing step, the input MR is divided into individual attribute value pairs $s_x v_x$ each corresponding to one distinct fact (i.e. unit of information). Concept-to-text generation is particularly fitted to our approach as the input MR is usually straightforwardly divisible into distinct facts. To elaborate, a typical input MR consists of one or more predicates that denote the communicative goal of the sentence, followed by a set of attribute-value pairs that correspond to the information that + +should be expressed in the final text. + +For example, in Figure 2 the input MR describes that the text should offer/suggest to the user a stylist named "Atelier Salon Willow Glen" that is in the city of "San Jose", and also inform them that it has found "10" salons that match their criteria. We assume that each attribute-value pair corresponds to one distinct fact which is expressed as a sub-phrase of the final output, e.g. $\text{CITY} = \text{SAN JOSE}$ loosely corresponds to the sub-phrase "in San Jose". + +# 2.2 Lexicalisation + +The next stage is lexicalisation, i.e. the process of selecting the required vocabulary to express the input. HRAG's respective module achieves this by independently generating a corresponding phrase $w_{1}^{x}\ldots w_{len\_ x}^{x}$ for each input fact $s_x v_x$ , e.g. "located in San Jose" should be generated from input CITY = SAN JOSE in Figure 2. We opt to generate from single facts, disconnected from their MR context, as it makes it easier for the model to associate them with their relevant vocabulary. This might lead to the loss of informative context, but HRAG reintroduces context in a later stage. Additionally, having a single fact input facilitates transfer learning in the few-shot setting since any previous context may be irrelevant to new domains. A final benefit is that such input is more robust to unseen facts, as any unknown attributes will only affect the corresponding sub-phrase and will not interfere with the generation from other facts. + +In contrast, due to considering the whole input at once, previous end-to-end models need to be exposed to a lot of different combinations and orderings of attribute-value slots, to sufficiently associate complex input MRs with the output text. In few-shot settings, this becomes an issue as available MR combinations during training are limited. + +# 2.3 Recurrent aggregation + +In this stage, the generated sub- phrases of the lexicalisation module are ordered based on the input's original order, and input into the aggregation layer one at a time in a recurrent fashion. At the first step, the first two sub- phrases $w_{1}^{1}\ldots w_{len - 1}^{1}$ and $w_{1}^{2}\ldots w_{len - 2}^{2}$ , and the correspondent attribute-value pairs $s_1v_1$ $s_2v_2$ , are input into the aggregation layer to produce the combined sub-phrase $w_{1}^{[1,2]}\ldots w_{len\_ [1,2]}^{[1,2]}$ (see Figure 1). For example, the sub- phrases "it is called Atelier Salon Willow Glen" and "located in San Jose" are combined to form + +"There is a nice salon called Atelier Salon Willow Glen located in San Jose" as shown in Figure 2. + +At each subsequent step $r$ the input of the aggregation module consists of the concatenation of the previously aggregated sub- phrases $w_{1}^{[1,r - 1]}\dots w_{len\_ [1,r - 1]}^{[1,r - 1]}$ , the current sub-phrase $w_{1}^{r}\dots w_{len\_ r}^{r}$ , and the correspondent attribute-value pairs $s_1v_1s_2v_2\dots s_rv_r$ , to produce the combined sub-phrase $w_{1}^{[1,r - 1]}\dots w_{len\_ [1,r]}^{[1,r]}$ . The aggregation module is called recurrently until all the sub- phrases generated by the lexicalisation module are combined into a single output $w_{1}^{[1,n]}\dots w_{len\_ [1,n]}^{[1,n]}$ . + +Each distinct aggregation layer has the advantage of being able to disassociate (to some extent) from the specific semantics of the input and direct its attention on how to combine (and copy over) the sub-phrases of the lexicalisation module. This is further enhanced by the recurrent structure of the proposed aggregation layer which permits the model to focus on a limited amount of operations at a time, converging into a final unified output. + +# 2.4 Post-editing + +The aggregation layer models are trained to combine sub- phrases into larger sub- phrases and do not necessarily produce a fluent and coherent text complete with appropriate punctuation and devoid of errors. In order to rewrite the aggregated subphrases, fix any errors and finalise the text, the post-edit module takes the fully aggregated subphrases $w_{1}^{[1,n]}\ldots w_{len\_ [1,n]}^{[1,n]}$ and produces the output $w_{1}^{\prime}\ldots w_{l}^{\prime}$ , as seen in the top stage of Figure 2. Being largely domain-agnostic, aggregation and post-edit benefit the most from transfer learning. + +# 2.5 Training, reranking and selection + +Each module is built on top of a PLM; these PLMs have separate shared weights per stage and are specifically fine-tuned for that stage. For training, the modules' losses are combined as in Eq. 1: + +$$ +\begin{array}{l} L o s s = \frac {1}{n} \sum_ {n} L o s s _ {l e x} + \\ \frac {1}{n - 1} \sum_ {n - 1} L o s s _ {a g g r} + L o s s _ {p e} \tag {1} \\ \end{array} +$$ + +where cross entropy is used for $Loss_{lex}$ , $Loss_{aggr}$ and $Loss_{pe}$ , and $n$ the number of units in the MR. + +To mitigate any data sparsity issues, we employ language agnostic delexicalisation (Zhou and Lam-pouras, 2021) for the lexicalisation and aggregation + +![](images/ed10258d9accca9d0cf821c6c7f77f17249d8c079cc5bb606d8a60614965cabf.jpg) +Figure 3: Example of sub-phrase target inference for training the lexicalisation module. The underlined values are matched with the input values. + +modules, with relexicalisation performed before post-edit. Briefly, any input value that is determined to occur in the text (via embedding similarity) is delexicalized. In addition, to minimise the error propagated between layers, each module generates multiple hypotheses per input and forward the hypothesis with the least slot error rate to the next iteration/module, where the slot error rate is defined as the percentage of values in the input that are missing, repeated or hallucinated in the output. + +# 2.6 Inferring labels + +Ideally, the PLMs that are used in HRAG's different modules would be fine-tuned on stage-specific parallel input and target data. However, while the post-edit module can be trained against the dataset's final output target, such direct annotations for the first two modules are not readily available. To overcome this, we adopt a distant supervision approach to automatically extract stage-appropriate training signals from the existing data. + +For the lexicalization stage, we extract subphrase targets from the output target that weakly correspond to the individual facts; this process is depicted in Figure 3. Given an MR, we first determine occurrences of its values in the output target via language agnostic delexicalisation. If the value is not matched, we repeat the process using the attribute instead; this is useful for some boolean attributes (e.g. "accepts credit cards = yes"). If a match is still not found, we assume that the fact is not present in the output target, and we ignore that attribute-value pair from the input during training. + +For each fact $s_x v_x$ , the corresponding target subphrase is set to include the matched value of $v_x$ and all words preceding and following it until either a punctuation mark or another matched value is + +reached. This will cause some overlap between the inferred sub-phrase targets but ensures that all the relevant vocabulary is included in each fact's target. While using this noisy training signal may encourage some hallucinations of irrelevant input, in preliminary experiments this strategy worked better than alternatives; the aggregation layer proved robust enough to ignore irrelevant or repeated words that were output from the lexicalisation layer. + +Using the aforementioned value matching, we can similarly infer targets for the aggregation layers. However, to facilitate the process, the order in which lexicalisation sub- phrases are aggregated (see Section 2.3) needs to be fixed to the appearance order of the corresponding matched values in the output target. Given the example of Figure 3, the order would be INFORM $(\mathrm{COUNT} = 10) >$ OFFER $(\mathrm{CITY} = \mathrm{SANJOSE}) >$ OFFER (STYLIST NAME $=$ ATELIER SALON WILLOW GLEN). + +The aggregation targets are then inferred as such: for every aggregation group $s_1v_1$ , $s_2v_2$ , ..., $s_rv_r$ , the target consists of a subphrase of the output target, from its beginning, including the words of the last matched value $v_r$ , and until either a punctuation or another matched value is reached after that point. Again following the example of Figure 3, the aggregation target for INFORM (COUNT = 10) + OFFER (CITY = SAN JOSE) will be "I found 10 salons you may like. There is a nice salon in San Jose called". + +We note that this order of lexicalisation subphrases is only imposed during training since we are limited by the output target. During testing, as we mentioned in Section 2.5, the generated subphrases of the lexicalisation module follow the original input's order. This results in a significant discrepancy between the order of sub-phrases that HARG is exposed to during training and inference, but we leave its exploration for future work. + +# 3 Experimental Setup + +# 3.1 Datasets + +We perform experiments on four datasets: Schema-Guided Dialogue (Rastogi et al., 2020, SGD) with the few-shot splits provided by (Kale and Rastogi, 2020, FewShotSGD), MultiWoZ 2.2 (Zang et al., 2020), FewShotWoZ (Peng et al., 2020) and WebNLG 3.0 (Ferreira et al., 2020). The first three are task-oriented dialogue datasets, that have been adapted to different extents for few-shot learning by previous work. For our experiments, dialogue MRs are linearised as lists of "INTENT (ATTRIBUTE = + +
# TriplesFew-shot dataFull data
1-triple3467686
2-triple6196948
3-triple8137610
4-triple8987061
5-triple7045084
6-triple191536
7-triple168501
+ +VALUE)”, similar to what is depicted in Figure 2, while utterances are tokenised and lower-cased. + +In contrast to the other datasets, WebNLG 3.0 (Ferreira et al., 2020) does not contain dialogues but describes entities from a variety of domains, and consists of sets of RDF triples and corresponding texts in English and Russian; here we use only the English portion. The dataset is organised in subsets based on the number of RDF triples in the input, ranging from 1 to 7. To create appropriate splits for few-shot learning, for each length-specific subset, we identified all unique combinations of RDF properties in the input and limited the dataset to a single (where available) instance per combination. In other words, we kept only 1 instance per property for the 1-triple subset, 1 instance per pair of properties for the 2-triple subset, and so forth. Our splits essentially constitute a 1-shot learning dataset, which we will refer to as FewShotWeb dataset. Table 1 details how many of the total data were kept in our WebNLG 3.0 few-shot splits (FewShotWeb); as the triple length grows, most property combinations are unique which results in a bigger portion of the data being included. Interestingly, the 1-triple subset covers 346 out of 372 occurring properties, which makes it particularly suited for supervised learning of our lexicalisation module. The preprocessing of the RDF triples and target text was performed as in Zhou and Lampouras (2021). + +# 3.2 Automatic metrics + +Following related work, to estimate the fluency of the output, we provide results for BLEU-4 (computed with SacreBLEU) (Papineni et al., 2002; Post, 2018), and BLEURT (Sellam et al., 2020) (specifically the bleurt-base-128 version). We calculate the BLEU score over multiple references to mitigate the unreliability of single reference evaluation. + +To estimate adequacy, we use Missing Slot Error + +Table 1: WebNLG 3.0 few-shot splits. + +
BLEU ↑BLEURT ↑MER ↓
Lexicalisation46.29-0.390.00
+ aggregation46.60-0.301.16
+ post-edit53.00-0.201.13
+ selection53.04-0.200.14
E2E T550.15-0.230.84
+ delex50.25-0.270.81
+ +Table 2: Results of ablation study on 5-Shot SGD. + +(MER), computed as the macro-averaged percentage of values in the MR that are missing (i.e. do not appear verbatim) from the output utterance. We should note that MER is an imperfect approximation compared to slot error rate, as it does not account for hallucinations, boolean or no-value attributes. These types of slot errors are difficult to detect in non-delexicalized output, which all systems in our experiments produce. Evaluation is performed consistently across all datasets. + +# 3.3 Systems + +We compare HRAG against a fine-tuned end-to-end T5 model (E2E T5), equivalent to the "Naive" model shown by Kale and Rastogi (2020), which achieved state-of-the-art on the MultiWoZ dataset as well as in the recent WebNLG Challenge 2020 (Castro Ferreira et al., 2020). We employ t5-small for the underlying PLMs of both HRAG and E2E T5, to be consistent with Kale and Rastogi (2020). + +# 4 Results + +# 4.1 Ablation Study + +First, we present an ablation study of HRAG on the 5-shot SGD dataset aimed to analyse the impact of its components; the results are presented in Table 2. To examine the output of the lexicalisation module without aggregation, we simply concatenate the independently generated sub- phrases to form a unified text. As is to be expected, such a concatenation achieves low BLEU and BLEURT scores, clearly indicating the need for more sophisticated aggregation. Nevertheless, the lexicalisation module achieves $0\%$ missing slot error thanks to its focus on individual units of information. + +For the aggregation module, we examine the output of its final iteration. Its performance is on par with lexicalisation output, seemingly suggesting that aggregation offers little improvement. However, based on output analysis, the low BLEU and + +BLEURT are misleading and do not reflect the output quality. We attribute the lack of automatic score improvements to the module's tendency to overgenerate at the end of the output in anticipation of the next sub-phrase (as shown in the example in Figure 2). Other errors emerge from no-value attributes and due to sub-optimal training targets. MER increases the most during aggregation, as its recurrent nature is prone to error propagation. We should also note that using a single aggregation layer to aggregate all sub-phrases at the same time had comparable BLEU and BLEURT performance but underperformed by 8.18 points in MER. + +The role of the post-edit module is to obviate errors propagated from the lexicalisation and aggregation modules, and it greatly improves performance by 6.4 and 0.1 points in BLEU and BLEURT respectively. Specifically, this stage fixes the lexicalisation of no-value attributes, removes over-generated tokens, improves fluency, and adds or removes values that have been missed or repeated. Nonetheless, as this is an extra generation step, it occasionally removes some required values, as indicated by the almost constant slot error. + +Due to these frequent imperfections in the postedit layer's output, the final output of HRAG is selected between the output of the last aggregation iteration and the output of the post-edit module according to which one has the lower MER. This process leads to the highest BLEU and BLEURT scores and an MER close to $0\%$ . + +Finally, we examine delexicalisation's impact on E2E T5, applying it similarly to how it is applied to HRAG. While HRAG benefits from delexicalisation as it improves its generalisation ability and helps reduce MER, we observe marginal improvements (an MER decrease of $0.03\%$ ) when applied over a strong end-to-end model like E2E T5. + +# 4.2 Few-Shot Evaluation + +Table 3 shows automatic evaluation results for E2ET5 and HRAG systems trained on an increasing amount of data on FewShotSGD, FewShotWeb and MultiWoZ datasets. Overall the behaviour of the two systems is consistent across the three datasets. + +As discussed in Section 4.1, HRAG manages to preserve the input MR values throughout the generation, and as such outperforms E2E T5 in MER across all dataset splits by a significant margin, especially when trained on smaller splits. E2E T5 only overperforms on $0.1\%$ MultiWoZ, but a closer + +
BLEU ↑510204080
E2E T550.1555.7560.3762.5363.62
HRAG53.0456.9560.9462.4963.97
BLEURT ↑510204080
E2E T5-0.23-0.15-0.09-0.06-0.05
HRAG-0.20-0.13-0.09-0.06-0.04
MER ↓510204080
E2E T50.840.650.370.340.27
HRAG0.140.050.030.070.01
+ +(a) FewShotSGD + +
BLEU ↑1234567
E2E T521.4637.4741.1745.3145.0945.4246.40
HRAG28.0039.0443.8945.6445.6145.6246.68
BLEURT ↑1234567
E2E T5-0.320.080.130.220.210.220.23
HRAG-0.200.110.190.240.230.230.25
MER ↓1234567
E2E T522.8123.8019.4819.3220.7220.1019.54
HRAG8.215.581.750.980.520.240.35
+ +(b) FewShotWeb + +
BLEU ↑0.1%0.5%1%5%10%20%
E2E T53.3425.9041.2748.7750.6552.56
HRAG14.1331.6940.3948.7249.7150.34
BLEURT ↑0.1%0.5%1%5%10%20%
E2E T5-1.29-0.39-0.16-0.08-0.070.00
HRAG-0.74-0.33-0.18-0.12-0.10-0.09
MER ↓0.1%0.5%1%5%10%20%
E2E T54.855.795.762.862.442.10
HRAG7.453.531.640.750.700.86
+ +(c) Reduced MultiWoZ + +Table 3: Automatic evaluation results. + +examination of the outputs reveals that the $4.85\%$ MER is achieved at great expense to fluency as the system simply copies all input MRs instead of generating utterances. Although HRAG was not completely unaffected by such behaviour, it was still able to generate relevant outputs thanks to its ability to independently lexicalise smaller and simpler sub-phrases which lead to improvements of 10.79 BLEU and 0.55 BLEURT scores over E2E T5 despite the higher MER on $0.1\%$ MultiWoZ. + +Results in Table 3 demonstrate the effectiveness of HRAG in extremely low-resourced conditions with differences in BLEU and BLEURT scores of 2.89 and 0.3 for FewShotSGD and 6.54 and 0.12 for FewShotWeb on their respective smaller + +
BLEU ↑RestaurantLaptopTaxiTvTrainHotelAttractionAVG
E2E T525.7325.9417.6226.2515.0428.3419.4122.62
HRAG25.5522.9518.5524.7019.3129.9614.4422.21
BLEURT ↑RestaurantLaptopTaxiTvTrainHotelAttractionAVG
E2E T5-0.080.03-0.430.02-0.32-0.07-0.44-0.18
HRAG-0.12-0.11-0.40-0.09-0.34-0.04-0.47-0.22
MER ↓RestaurantLaptopTaxiTvTrainHotelAttractionAVG
E2E T57.436.7316.873.8018.763.7521.4111.25
HRAG4.212.587.234.1513.471.399.206.03
+ +Table 4: Automatic evaluation results on FewShotWoZ. AVG is the macro-average score across all domains. + +splits. Improvements over the end-to-end systems converge as the number of training examples increases, but HRAG consistently performs best in MER across all datasets and training pool sizes. In terms of BLEU/BLEURT, HRAG is able to maintain an edge over E2E T5 on all FewShotSGD and FewShotWeb splits, while on MultiWoZ, E2E T5 appears to be the best performing system, especially in terms of BLEURT score with a difference up to 0.9. By looking at the system's outputs, however, HRAG appears to perform comparably or even outperform E2E T5 despite lower BLEURT scores, as shown in the examples in Table 5. More examples are presented in Appendix B. + +Table 4 shows results on FewShotWoZ; models are trained and tested separately on each domain. Similarly to the results shown in Table 3, HRAG excels in terms of MER, missing on average $5\%$ fewer values compared to E2E T5. In BLEU and BLEURT scores, while on average E2E T5 outperforms HRAG, there is no consistently better system. Unfortunately, only one reference per MR is provided making multi-reference scoring impossible and in extension BLEU more unreliable. In Section 4.4, we perform human evaluation to better assess systems performance on FewShotWoZ. + +# 4.3 Zero-Shot Evaluation + +We perform zero-shot analysis on SGD and WebNLG testsets; Figure 4 shows the results of the systems presented in Section 4.2 with reported performances split into domains seen and unseen during training according to the original datasets. + +In both datasets, HRAG achieves MER in unseen cases lower than even E2E T5's seen scores, further validating the generalisation ability of HRAG when little to no resources are available. Overall, HRAG achieves higher BLEU and BLUERT + +scores than E2E T5 as well, with the exception of BLEURT scores for FewShotSGD. However, similarly to what has been found in Section 4.2, HRAG's outputs do not appear to necessarily be more disfluent than E2E T5 outputs. + +Interestingly, HRAG's MER for unseen FewShotWeb is lower than the corresponding seen one. We observe that HRAG tends to avoid generating complex sentence structures when dealing with unseen inputs, and simply concatenates the lexicalisation sub- phrases (e.g. "liselotte grschebina, born in the german empire, attended the school of applied arts in stuttgart, israel.). This strategy benefits FewShotWeb as HRAG focuses on copying elements from the input and effectively avoids introducing noise. Such behaviour is not observed for FewShotSGD, but seen/unseen MER are still comparable and in close proximity to $0\%$ . + +# 4.4 Human Evaluation + +To account for the shortcomings of automatic evaluation, we employed the human evaluation framework Direct Assessment (Graham et al., 2017) to set up tasks on the Amazon Mechanical Turk (AMT) platform and assess the fluency and adequacy of various models' outputs. We created separate tasks to assess the fluency and adequacy of the texts on two distinct subsets, in order to minimise correlation between the criteria. Specifically, we sampled 750 MRs from each test set of 5-shot SGD and FewShotSGD, and collected the corresponding outputs of HRAG, E2E T5, and the ground truth (GOLD); we include the latter to provide context to the evaluation. We picked the 5-shot subset of SGD to observe how the systems behave when exposed to the least amount of in-domain data. The pool of crowd-workers was limited to those residing in English-speaking countries, and who had a high acceptance rate; every text was evaluated by at least + +
MR:hotel [ inform (stars = 4) ]BLEURT ↑
E2E T5:it has a 4 star rating.0.21
HRAG:it's a 4 star hotel.-0.79
MR:attraction [ request (name), inform (area = city centre; choice-1 = many)]BLEURT ↑
E2E T5:there are many attractions in the city centre. what is the name of the attraction you are looking for?0.01
HRAG:there are many attractions in the city centre. do you have a name?-0.37
MR:train [ offerbook (none), inform (leave = 05:59 ; arrive-1 = 07:27 ; depart = cambridge ; dest-1 = london ; dest-2 = liverpool street ; day = saturday ; id-1 = tr2895) ]BLEURT ↑
E2E T5:tr2895 leaves cambridge at 05:59 and arrives in london at 07:27 on saturday . would you like me to book you a ticket ?0.05
HRAG:i have tr2895 that leaves at 05:59 and arrives at 07:27 from cambridge to liverpool street london on saturday . would you like me to book it for you ?-0.20
+ +![](images/beffd2d76cbff64d58ef45c60c8a81b3199047da8055ea1755fac3a6b7022ab5.jpg) +Figure 4: Zero-shot automatic evaluation results. + +3 crowd-workers on a 1 to 100 Likert scale. After consulting the crowd-workers' reliability based on the Direct Assessment platform analysis, we had to filter out $39.5\%$ of the participants. + +Table 6 gathers the raw and mean standardised z-scores of the evaluation. Both models of course are considered worse than the ground truth, but HRAG performs better than E2E T5 in both fluency and adequacy, with the exception of fluency in + +Table 5: Output examples from E2E T5 and HRAG trained on ${20}\%$ MultiWoZ. + +
FluencyAdequacy
rawz-scorerawz-score
5S-SGDGOLD80.5020.10378.6900.044
E2E T576.355-0.03376.864-0.017
HRAG77.245-0.01277.5080.041
FS-WOZGOLD76.9360.01880.2100.066
E2E T575.845*0.016*78.6090.042
HRAG75.824*0.014*79.0960.043
+ +Table 6: Human Evaluation results; * denotes no statistically significant difference between assessments. + +FewShotWoZ where the systems exhibit no statistically significant difference (according to Wilcoxon rank-sum tests). These results further support the efficacy of HARG for few-shot settings. + +# 5 Related work + +Despite being an important research topic with real-life applications, domain adaptation for low-resource/few-shot concept-to-text NLG has not been extensively researched. Wen et al. (2016) leveraged the scarcity of target in-domain data by augmenting it with synthetic data, Tran and Nguyen (2018) used variational autoencoders in conjunction with text similarity and domain critics to better guide the fine-tuning process, while Mi et al. (2019) tackled the problem by defining domain adaptation as an optimisation meta-learning task. Most recently, Peng et al. (2020) and Kale and Rastogi (2020) have proposed the use of pretrained language models to tackle few-shot and zero-shot + +learning in concept-to-text NLG, achieving significant gains over strong non-pretrained baselines. Specifically, Peng et al. (2020) proposed SC-GPT, a semantically conditioned GPT-2 model, wherein, prior to few-shot learning, the GPT-2 model is further fine-tuned on a number of task-oriented dialogue datasets in order to mitigate the problem of representation bias. On the other hand, in Kale and Rastogi (2020), a set of human-authored templates are used to generate high-quality sentences corresponding to each unit of information in an MR. These are then concatenated and given as input to a T5 model (T2G2) to form a coherent sentence. In this paper's evaluation, we opt to compare our approach against the naive T5 baseline introduced by Kale and Rastogi (2020), as it is shown to overly outperform SC-GPT by basically replacing the underlying GPT-2 model for T5, and SC-GPT was outperform all previous non-pretrained baselines. We do not compare against T2G2, as access to human authored templates or other such manually annotated resources, which are by nature very domain-specific and costly to create, are not necessarily guaranteed in low-resource settings. We note that T2G2 is equivalent to the naive T5 when templates are not employed. + +In our proposed system, the hierarchy emerges from modelling the lexicalisation and aggregation sub-tasks on separate layers. Previous attempts in exploring hierarchical structures for text generation tasks instead focused on modelling different aspects of the input or output. In concept-to-text NLG for task-oriented dialogues, Su et al. (2018) proposed a multi-layered decoding process where each layer was responsible for generating words associated with specific part-of-speech tags. Chen et al. (2019) and Tseng et al. (2019) took advantage of the intrinsically hierarchical structure of dialogue acts to create better input representations and ease domain adaptation. Our approach is also related to coarse-to-fine approaches, which have been explored in story (Fan et al., 2018), review (Li et al., 2019) and keyphrase (Chen et al., 2020) generation tasks. However, in these tasks, the output is not necessarily restricted to be an exact realisation of the input, and can be initially loosely prompted or drafted, and subsequently expanded. + +# 6 Conclusion + +We proposed Hierarchical Recurrent Aggregative Generation, a three-modulated jointly trained archi + +tecture, designed to exploit the different extents to which lexicalisation and aggregation can benefit from transfer learning. Additionally, due to the lack of explicit training signals for HRAG's modules, we show how module-specific targets can be inferred from the available output targets. Extensive automatic metric experiments and analysis across 4 datasets, as well as accompanying human evaluation, demonstrates that HRAG outperforms previous state-of-the-art approaches, especially in regards to missing slot error and adequacy. + +# References + +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877-1901. Curran Associates, Inc. +Thiago Castro Ferreira, Claire Gardent, Nikolai Ilinykh, Chris van der Lee, Simon Mille, Diego Moussallem, and Anastasia Shimorina. 2020. The 2020 bilingual, bi-directional WebNLG+ shared task: Overview and evaluation results (WebNLG+ 2020). In Proceedings of the 3rd International Workshop on Natural Language Generation from the Semantic Web (WebNLG+), pages 55-76, Dublin, Ireland (Virtual). Association for Computational Linguistics. +Wang Chen, Hou Pong Chan, Piji Li, and Irwin King. 2020. Exclusive hierarchical decoding for deep keyphrase generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1095-1105, Online. Association for Computational Linguistics. +Wenhu Chen, Jianshu Chen, Pengda Qin, Xifeng Yan, and William Yang Wang. 2019. Semantically conditioned dialog response generation via hierarchical disentangled self-attention. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3696-3709, Florence, Italy. Association for Computational Linguistics. +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. +Angela Fan, Mike Lewis, and Yann Dauphin. 2018. Hierarchical neural story generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 889-898, Melbourne, Australia. Association for Computational Linguistics. +Thiago Ferreira, Claire Gardent, Nikolai Ilinykh, Chris van der Lee, Simon Mille, Diego Moussallem, and Anastasia Shimorina. 2020. The 2020 bilingual, bidirectional webnlg+ shared task overview and evaluation results (webnlg+ 2020). In Proceedings of the 3rd International Workshop on Natural Language Generation from the Semantic Web (WebNLG+). +Yvette Graham, Timothy Baldwin, Alistair Moffat, and Justin Zobel. 2017. Can machine translation systems be evaluated by the crowd alone. *Natural Language Engineering*, 23(1):3-30. +Mihir Kale and Abhinav Rastogi. 2020. Template guided text generation for task-oriented dialogue. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6505-6520, Online. Association for Computational Linguistics. +Junyi Li, Wayne Xin Zhao, Ji-Rong Wen, and Yang Song. 2019. Generating long and informative reviews with aspect-aware coarse-to-fine decoding. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1969-1979, Florence, Italy. Association for Computational Linguistics. +Fei Mi, Minlie Huang, Jiyong Zhang, and Boi Faltings. 2019. Meta-learning for low-resource natural language generation in task-oriented dialogue systems. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI-19, pages 3151-3157. International Joint Conferences on Artificial Intelligence Organization. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, pages 311-318. +Baolin Peng, Chenguang Zhu, Chunyuan Li, Xiujun Li, Jinchao Li, Michael Zeng, and Jianfeng Gao. 2020. Few-shot natural language generation for task-oriented dialog. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 172-182, Online. Association for Computational Linguistics. +Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186-191, Brussels, Belgium. Association for Computational Linguistics. + +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. +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. +Ehud Reiter and Robert Dale. 2000. Building Natural Language Generation Systems. Studies in Natural Language Processing. Cambridge University Press. +Thibault Sellam, Dipanjan Das, and Ankur Parikh. 2020. BLEURT: Learning robust metrics for text generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7881-7892, Online. Association for Computational Linguistics. +Noam Shazeer and Mitchell Stern. 2018. Adafactor: Adaptive learning rates with sublinear memory cost. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pages 4603-4611. PMLR. +Shang-Yu Su, Kai-Ling Lo, Yi-Ting Yeh, and Yun-Nung Chen. 2018. Natural language generation by hierarchical decoding with linguistic patterns. 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 61-66, New Orleans, Louisiana. Association for Computational Linguistics. +Van-Khanh Tran and Le-Minh Nguyen. 2018. Adversarial domain adaptation for variational neural language generation in dialogue systems. In Proceedings of the 27th International Conference on Computational Linguistics, pages 1205-1217, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Bo-Hsiang Tseng, PaweL, Budzianowski, Yen-chen Wu, and Milica Gasic. 2019. Tree-structured semantic encoder with knowledge sharing for domain adaptation in natural language generation. In Proceedings of the 20th Annual SIGdial Meeting on Discourse and Dialogue, pages 155–164, Stockholm, Sweden. Association for Computational Linguistics. +Tsung-Hsien Wen, Milica Gašić, Nikola Mrkšić, Lina M. Rojas-Barahona, Pei-Hao Su, David Vandyke, and Steve Young. 2016. Multi-domain neural network language generation for spoken dialogue systems. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human + +Language Technologies, pages 120-129, San Diego, California. Association for Computational Linguistics. + +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funpowicz, 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. + +Xiaoxue Zang, Abhinav Rastogi, Srinivas Sunkara, Raghav Gupta, Jianguo Zhang, and Jindong Chen. 2020. MultiWOZ 2.2: A dialogue dataset with additional annotation corrections and state tracking baselines. In Proceedings of the 2nd Workshop on Natural Language Processing for Conversational AI, pages 109-117, Online. Association for Computational Linguistics. + +Giulio Zhou and Gerasimos Lampouras. 2021. Generalising multilingual concept-to-text NLG with language agnostic delexicalisation. 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 114-127, Online. Association for Computational Linguistics. + +Barret Zoph, Deniz Yuret, Jonathan May, and Kevin Knight. 2016. Transfer learning for low-resource neural machine translation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1568-1575, Austin, Texas. Association for Computational Linguistics. + +# A Configurations + +Fine-tuning is performed with Adafactor (Shazeer and Stern, 2018) as an optimiser, with learning rate set to $1e^{-3}$ and Huggingface (Wolf et al., 2020)'s default parameters; gradient accumulation is used with a batch size of 256 for all the datasets except FewShotWoZ where the batch size is set to 1 as in (Peng et al., 2020); early-stopping is adopted with patience set to 30 and a combined loss between BLEU and slot error rate as the scoring function. + +Reranking is performed as described in Section 2.5, with 5 lexicalisation and aggregation hypotheses generated at each time step. However, at training time, for computational reasons, only the lexicalisation outputs are reranked. At inference time, reranking is performed for both the baseline and HRAG's post-edit module, with 10 hypotheses generated and reranked. Each system is fine-tuned + +with 5 different seeds. Section 4 reports the average performance of each system. + +# B Examples + +Table 7 shows examples from FewShotWoZ where E2E T5 suffers from hallucinations. + +# C Full results + +Tables 8 and 9 show the full results presented in Section 4.3. + +# D Inferred training signal examples + +Tables 10, 11, 12, and 13 show examples of inferred training signals for the lexicalization and aggregation modules as discussed in Section 2.6. Note that as described in the aforementioned section, during training the input facts are ordered according to their values' appearance in the reference to facilitate the proper inference of the training signal for aggregation. Also note that we show the values intact in these examples for clarity, even though throughout our experiments the signal is inferred after a delexicalization pre-processing step. + +
MR:inform count ( count = 11 ; near = nob hill ; type = restaurant )
E2E T5:there are 11 restaurants near nob hill in the north hill area . it is a nice restaurant
HRAG:there are 11 restaurants near nob hill area
MR:inform ( memory = 4 gb;; type = laptop ; name = satellite nereus 81 ; IsForBusiness = true )
E2E T5:the satellite nereus 81 laptop is not for business computing and has 4 gb memory and a 4 gb memory
HRAG:the satellite nereus 81 laptop has 4 gb of memory with a good battery rating , and is for business computing
MR:inform ( price = 10.10 gbp ; id = tr5433 ) , book ( none )
E2E T5:tr5433 will cost 10.10 gbp per ticket and leaves at tr5433 . can i book it for you ?
HRAG:tr5433 price is 10.10 gbp payable at the station . can i book it for you ?
+ +Table 7: FewShotWoZ output examples. + +
BLEU ↑1234567
E2E T520.4439.7944.7550.0150.4851.0651.13
HRAG27.2941.6347.6850.1650.1750.4051.14
BLEURT ↑1234567
E2E T5-0.320.140.210.290.290.310.31
HRAG-0.190.170.270.320.310.320.32
MER ↓1234567
E2E T525.5424.5219.7819.8619.9520.2119.65
HRAG10.766.782.281.200.760.290.43
+ +(a) Seen + +
BLEU ↑1234567
E2E T522.6534.7436.9539.7738.7338.7340.70
HRAG28.8435.9939.4040.3140.2340.2341.41
BLEURT ↑1234567
E2E T5-0.330.000.030.130.110.120.14
HRAG-0.210.040.100.160.140.140.17
MER ↓1234567
E2E T518.8322.7719.0418.5321.8519.9519.39
HRAG4.493.820.990.500.180.170.23
+ +Table 8: Full automatic evaluation results for FewShot-WoZ. + +(b) Unseen + +
BLEU ↑510204080
E2E T552.3757.7863.2665.0165.94
HRAG55.4759.6163.6464.9666.11
BLEURT ↑510204080
E2E T5-0.21-0.12-0.05-0.05-0.01
HRAG-0.16-0.09-0.05-0.02-0.01
MER ↓510204080
E2E T50.690.640.390.240.23
HRAG0.120.050.040.010.01
+ +(a) Seen + +
BLEU ↑510204080
E2E T541.1047.5048.5952.4654.14
HRAG43.1346.1149.9152.7055.20
BLEURT ↑510204080
E2E T5-0.35-0.25-0.23-0.18-0.20
HRAG-0.37-0.30-0.25-0.23-0.19
MER ↓510204080
E2E T51.550.680.290.840.45
HRAG0.230.090.000.030.00
+ +(b) Unseen + +Table 9: Full automatic evaluation results for Few-ShotSGD. + +MR: offer ( pickup location = Santa fe depot ; pickup date = march 2nd ; type = standard ; car name = accord ) +Reference: there is an accord , standard , at Santa fe depot on march 2nd . + +
FactInferred sub-phrase target
1: offer ( car name = accord )there is an accord
2: offer ( type = standard )standard
3: offer ( pickup location = Santa fe depot )at Santa fe depot on
4: offer ( pickup date = march 2nd )on march 2nd
Facts to be combinedInferred aggregation target
1 + 2there is an accord , standard
1 + 2 + 3there is an accord , standard , at Santa fe depot on
1 + 2 + 3 + 4there is an accord , standard , at Santa fe depot on march 2nd
+ +# Post-edit target + +there is an accord , standard , at Santa fe depot on march 2nd . + +MR: confirm ( restaurant name = jo's sushi bar ; location = pleasant hill ; time = 11 am ; number of seats = 2 ; date = march 13th ) +Reference: you want a table for 2 at jo's sushi bar in pleasant hill at 11 am on march 13th ? + +
FactInferred sub-phrase target
1: confirm ( number of seats = 2 )you want a table for 2 at
2: confirm ( restaurant name = jo 's sushi bar )at jo 's sushi bar in
3: confirm ( location = pleasant hill )in pleasant hill at
4: confirm ( time = 11 am )at 11 am on
5: confirm ( date = march 13th )on march 13th
Facts to be combinedInferred aggregation target
1 + 2you want a table for 2 at jo 's sushi bar in
1 + 2 + 3you want a table for 2 at jo 's sushi bar in pleasant hill at
1 + 2 + 3 + 4you want a table for 2 at jo 's sushi bar in pleasant hill at 11 am on
1 + 2 + 3 + 4 + 5you want a table for 2 at jo 's sushi bar in pleasant hill at 11 am on march 13th
+ +# Post-edit target + +you want a table for 2 at jo ’ s sushi bar in pleasant hill at 11 am on march 13th ? + +Table 10: Inferred training signal for the lexicalization and aggregation modules from FewShotSGD. + +MR: inform_no_MATCH (goodmeal = breakfast ; near = civic center) + +Reference: unfortunately there are no restaurant -s near civic center that are good for breakfast + +
FactInferred sub-phrase target
1: inform_no_match ( near = civic center )unfortunately there are no restaurant -s near civic center that are good for
2: inform_no_match ( goodformeal = breakfast )that are good for breakfast
Facts to be combinedInferred aggregation target
1 + 2unfortunately there are no restaurant -s near civic center that are good for breakfast
+ +# Post-edit target + +unfortunately there are no restaurant -s near civic center that are good for breakfast + +MR: inform ( choice = 91 ; destination = cambridge ; departure = leicester ; leaveat = the specified time), select (leaveat = 11:09 ; day = friday ) +Reference: there are 91 trains leaving leicester to cambridge after the specified time. how does friday 11:09 sound ? + +
FactInferred sub-phrase target
1: inform ( choice = 91 )there are 91 trains leaving
2: inform ( departure = leicaster )trains leaving leicaster to
3: inform ( destination = cambridge )to cambridge after
4: inform ( leaveat = the specified time )after the specified time
5: select ( day = friday )how does friday
6: select ( leaveat = 11:09 )11:09 sound
Facts to be combinedInferred aggregation target
1 + 2there are 91 trains leaving leicaster to
1 + 2 + 3there are 91 trains leaving leicaster to cambridge after
1 + 2 + 3 + 4there are 91 trains leaving leicaster to cambridge after the specified time
1 + 2 + 3 + 4 + 5there are 91 trains leaving leicaster to cambridge after the specified time . how does friday
1 + 2 + 3 + 4 + 5 + 6there are 91 trains leaving leicaster to cambridge after the specified time . how does friday 11:09 sound
+ +# Post-edit target + +there are 91 trains leaving leicaster to cambridge after the specified time . how does friday 11:09 sound ? + +Table 11: Inferred training signal for the lexicalization and aggregation modules from FewShotWoZ. + +MR: hotel_request ( stars ; price ; area ), hotel_inform ( choice = 29 ) +Reference: there are 29 hotels that meet your needs . can you narrow it down to area , price range and stars ? + +
FactInferred sub-phrase target
1: hotel_inform ( choice = 29 )there are 29 hotels that meet your needs
2: hotel_request ( area )can you narrow it down to area
3: hotel_request ( price )price range and
4: hotel_request ( stars )range and stars
Facts to be combinedInferred aggregation target
1 + 2there are 29 hotels that meet your needs . can you narrow it down to area
1 + 2 + 3there are 29 hotels that meet your needs . can you narrow it down to area , price range and
1 + 2 + 3 + 4there are 29 hotels that meet your needs . can you narrow it down to area , price range and stars
+ +# Post-edit target + +there are 29 hotels that meet your needs . can you narrow it down to area , price range and stars ? + +MR: booking_nobook (time = 10:00; day = yesterday), booking_request (time) + +Reference: i am sorry we could not book you for saturday at 10:00 . would you like to try another time ? + +
FactInferred sub-phrase target
1: booking_nobook ( day = Saturday )i am sorry we could not book you for saturday at
2: booking_nobook ( time = 10:00 )at 10:00
3: booking_request ( time )you like to try another time
Facts to be combinedInferred aggregation target
1 + 2i am sorry we could not book you for saturday at 10:00
1 + 2 + 3i am sorry we could not book you for saturday at 10:00 . would you like to try another time
+ +# Post-edit target + +i am sorry we could not book you for saturday at 10:00 . would you like to try another time ? + +Table 12: Inferred training signal for the lexicalization and aggregation modules from reduced MultiWoZ. + +
MR: <amdavad ni gufa, location, ahmedabad>, <amdavad ni gufa, country, india>, <india, leader, sumitra mahajan> +Reference: amdavad ni gufa is located in ahmedabad, india , where sumitra mahajan is a leader .
FactInferred sub-phrase target
1: <amdavad ni gufa, location, ahmedabad>amdavad ni gufa is located in ahmedabad
2: <amdavad ni gufa, country, india>india
3: <india, leader, sumitra mahajan>where sumitra mahajan is a leader
Facts to be combinedInferred aggregation target
1 + 2amdavad ni gufa is located in ahmedabad , india
1 + 2 + 3amdavad ni gufa is located in ahmedabad , india , where sumitra mahajan is a leader
Post-edit target
amdavad ni gufa is located in ahmedabad , india , where sumitra mahajan is a leader .
MR: <asterix ( comics character ) , creator, rené goscinny>, <asterix ( comics character ) , creator, albert uderzo> +Reference: the comic strip character asterix was created by albert uderzo and rené goscinny .
FactInferred sub-phrase target
1: <asterix ( comics character ) , creator, albert uderzo>the comic strip character asterix was created by albert uderzo and
2: <asterix ( comics character ) , creator, rené goscinny>and rené goscinny
Facts to be combinedInferred aggregation target
1 + 2the comic strip character asterix was created by albert uderzo and rené goscinny
Post-edit target
the comic strip character asterix was created by albert uderzo and rené goscinny .
+ +Table 13: Inferred training signal for the lexicalization and aggregation modules from FewShotWeb. \ No newline at end of file diff --git a/hierarchicalrecurrentaggregativegenerationforfewshotnlg/images.zip b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d214ba0a27093addbb9009991efe1b4a97206b0f --- /dev/null +++ b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef11707fa1aa6fdf4744ce333e213b1e71d7368ae53430e747fa327010f58854 +size 1170824 diff --git a/hierarchicalrecurrentaggregativegenerationforfewshotnlg/layout.json b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4c470866a2eeab161ca99e3bf964fde9ccbf44b1 --- /dev/null +++ b/hierarchicalrecurrentaggregativegenerationforfewshotnlg/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66940b6f0512cac1e660423304539109810de3c9b687c0159300a5b61c4d8990 +size 374304 diff --git a/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_content_list.json b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..91dbf6f69d8a1195b56487865e02a0c209dc381b --- /dev/null +++ b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:827adb56860734f8bfde472c2db3b36838ca635ab0e026d1a5e48feb053a53b0 +size 72492 diff --git a/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_model.json b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6378723d38c9fc9d8d1e5443d9e1fb7bf7fb57d8 --- /dev/null +++ b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b984734b49a9d1e29f547d03870658476ceec2e7bca3f5d8d2f0a94661d0dab2 +size 87565 diff --git a/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_origin.pdf b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f18254b60d6fbe38fadb2e15581318a468b40e8b --- /dev/null +++ b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/011ae2e7-b05a-4de7-a128-c5107d7dab0d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19a2c7ed25405824ca643b7205458a2d7a4ea345bf5b2c1b90eb927aacf45533 +size 1219301 diff --git a/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/full.md b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f229636446eef79d96f3dfefe92672d95575c8a5 --- /dev/null +++ b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/full.md @@ -0,0 +1,290 @@ +# HIE-SQL: History Information Enhanced Network for Context-Dependent Text-to-SQL Semantic Parsing + +Yanzhao Zheng* Haibin Wang* Baohua Dong Xingjun Wang Changshan Li† Alibaba Group, Hangzhou, China + +{zhengyanzhao.zyz,binke.whb,baohua.dbh,xingjun.wxj}@alibaba-inc.com, lics16@mails.tsinghua.edu.cn + +# Abstract + +Recently, context-dependent text-to-SQL semantic parsing which translates natural language into SQL in an interaction process has attracted a lot of attention. Previous works leverage context-dependence information either from interaction history utterances or the previous predicted SQL queries but fail in taking advantage of both since of the mismatch between natural language and logicform SQL. In this work, we propose a History Information Enhanced text-to-SQL model (HIE-SQL) to exploit context-dependence information from both history utterances and the last predicted SQL query. In view of the mismatch, we treat natural language and SQL as two modalities and propose a bimodal pretrained model to bridge the gap between them. Besides, we design a schema-linking graph to enhance connections from utterances and the SQL query to the database schema. We show our history information enhanced methods improve the performance of HIE-SQL by a significant margin, which achieves new state-of-the-art results on the two context-dependent text-to-SQL benchmarks, the SparC and CoSQL datasets, at the writing time. + +# 1 Introduction + +Conversation user interfaces to databases have launched a new research hotspot in Text-to-SQL semantic parsing (Zhang et al., 2019; Guo et al., 2019; Wang et al., 2020; Lin et al., 2020; Xu et al., 2021; Cao et al., 2021; Hui et al., 2021; Yu et al., 2021b) and benefited us in industry (Dhamdhere et al., 2017; Weir et al., 2020). Most previous works focus on the context-independent text-to-SQL task and propose many competitive models. Some models (Wang et al., 2020; Scholak et al., 2021) even surprisingly work well on the context-dependent + +
U1: List the name of the teachers and the courses assigned for them to teach.
S1: SELECT T3.Name, T2.Course FROM course Arrange AS T1 +JOIN course AST2 ON T1.Course_ID = T2.Course_ID +JOIN teacher AST3 ON T1.Teacher_ID = T3.Teacher_ID
U2: Arrange this list with the teachers name in ascending order.
S2: SELECT T3.Name, T2.Course FROM course Arrange AS T1 +JOIN course AST2 ON T1.Course_ID = T2.Course_ID +JOIN teacher AST3 ON T1.Teacher_ID = T3.Teacher_ID +ORDER BY T3.Name
U3: Include teachers id in the same list.
S3: SELECT T3.Name, T2.Course, T1_teacher_ID FROM course Arrange AS T1 +JOIN course AST2 ON T1.Course_ID = T2.Course_ID +JOIN teacher AST3 ON T1.Teacher_ID = T3.Teacher_ID +ORDER BY T3.Name
+ +Figure 1: An example of context-dependent text-to-SQL interaction in CoSQL where $U_{i}$ is the utterance of turn $i$ and $S_{i}$ is the corresponding SQL query for $U_{i}$ . The tokens with red color are the history information that should be considered in later predictions. It is context-independent if we just consider the prediction of $S_{1}$ . + +text-to-SQL task by just appending the interaction history utterances to the input. Especially, PICARD (Scholak et al., 2021) achieves state-of-the-art performances both in Spider (Yu et al., 2018b), a cross-domain context-independent text-to-SQL benchmark, and CoSQL (Yu et al., 2019a), a cross-domain context-dependent text-to-SQL benchmark, before our work. However, every coin has two sides. That implies underachievement of the exploration of context information in context-dependent text-to-SQL semantic parsing. + +Compared with context-independent text-to-SQL semantic parsing, context-dependent text-to-SQL semantic parsing are more challenging since of the various types of dependence in utterances which make models vulnerable to parsing errors. As $\mathbf{R}^2\mathbf{SQL}$ (Hui et al., 2021) considers, different context dependencies between two adjacent utterances require the model to establish dynamic connections between utterances and database schema carefully. However, context information is not only from the last utterance. Long-range dependence is + +also the case in CoSQL as the prediction of $S_{3}$ depends on "the name of the teachers and the courses" in $U_{1}$ in Figure 1. A workable proposition for long-range dependence is to inherit context information from previous predicted SQL queries. But it is not a piece of cake to take advantage of previously predicted queries since of the mismatch between natural language and logic-form SQL. As Liu et al. (2020) conclude, roughly encoding the last predicted SQL query and utterances takes the wooden spoon while easily concatenation of interaction history utterances and current utterance appears to be strikingly competitive in their evaluation of 13 existing context modeling methods. + +In this paper, we propose a history information enhanced network to make full use of both history interactive utterances and previous predicted SQL queries. We first treat the logic-form SQL query as another modality with natural language. We present SQLBERT, a bimodal pre-trained model for SQL and natural language which is able to capture the semantic connection and bridge the gap between SQL and natural language. It produces general-purpose representations and supports our context-dependent text-to-SQL semantic parsing. + +Besides, we propose a history information enhanced schema-linking graph to represent the relations among current utterance, interaction history utterances, the last predicted query, and corresponding database schema. Considering it is weird to shift a topic back and forth in an interaction, we assume that the long-range dependence is successive. For example, that $S_{3}$ depends on $U_{1}$ implies that $S_{2}$ does too in Figure 1. In that case, we can leverage the long-range dependence from the last predicted query. Therefore, unlike the previous schema-linking graph just with utterances and database schema (Hui et al., 2021), the last predicted query takes part in our graph. Besides, we distinguish current utterance and interaction history utterances in the schema-linking graph. We encode the schema-linking relations with Relative Self-Attention Mechanism (Shaw et al., 2018). + +In our experiments, the proposed methods of SQLBERT and the history information enhanced schema-linking substantially improve the performance of our model. At the time of writing, our model ranks first on both two large-scale cross-domain context-dependent text-to-SQL leaderboards, SparC (Yu et al., 2019b) and CoSQL (Yu et al., 2019a). Specifically, our model achieves + +a $64.6\%$ question match and $42.9\%$ interaction match accuracy on SparC, and a $53.9\%$ question match and $24.6\%$ interaction match accuracy on CoSQL. + +# 2 Related Work + +Text-to-SQL semantic parsing follows a long line of research on semantic parsing from natural language to logical language (Zelle and Mooney, 1996; Zettlemoyer and Collins, 2005; Wong and Mooney, 2007). + +Recently, context-independent text-to-SQL semantic parsing has been well studied. Spider (Yu et al., 2018b) is a famous dataset for the complex and cross-domain context-independent text-to-SQL task. Some works (Bogin et al., 2019a,b; Chen et al., 2021) apply graph neural networks to encode database schema. Xu et al. (2021) succeed in applying deep transformers to the context-independent text-to-SQL task. Yu et al. (2018a) employ a tree-based decoder to match SQL grammar. Rubin and Berant (2021) improve the tree-based decoder by a bottom-up method. Scholak et al. (2021) refine the sequence-based decoder via carefully designed restriction rules. Guo et al. (2019) and Gan et al. (2021) propose SQL intermediate representations to bridge the gap between natural language and SQL. Lei et al. (2020) study the role of schemalinking in text-to-SQL semantic parsing. Wang et al. (2020) propose a unified framework to capture the schema-linking. Lin et al. (2020) represent the schema-linking as a tagged sequence. Cao et al. (2021) further integrate non-local and local features via taking advantage of both schema-linking graph and its corresponding line graph. Besides, many previous works (Deng et al., 2021; Yu et al., 2021a; Shi et al., 2021) focus on pre-train models for context-independent text-to-SQL semantic parsing. + +With more attentions on context-dependent text-to-SQL semantic parsing, existing works have been devoted to the context-dependent text-to-SQL task. SparC (Yu et al., 2019b) and CoSQL (Yu et al., 2019a) datasets are specially proposed for the task. EditSQL (Zhang et al., 2019) and IST-SQL (Wang et al., 2021) focus on taking advantages of the last predicted query for the prediction of current query. EditSQL tries to copy the overlap tokens from the last predicted query, while IST-SQL proposes an interaction state tracking method to encode the information from the last predicted query. + +IGSQL (Cai and Wan, 2020) and $\mathbf{R}^2\mathbf{S}\mathbf{L}$ (Hui et al., 2021) leverages the contextual information among the current utterance, interaction history utterances and database schema via context-aware dynamic graphs. Notably, $\mathbf{R}^2\mathbf{S}\mathbf{L}$ simulates the information by connecting the schema graphs with the tokens in interactive utterances. Yu et al. (2021b) creatively propose a context-aware pre-trained language model. However, the problem of making full use of both interaction history utterances and predicted queries for the context-dependent text-to-SQL task remains open. + +# 3 HIE-SQL + +First, we formally define the conversational text-to-SQL semantic parsing problem. In the rest of the section, we detail the architecture of history information enhanced text-to-SQL model (HIE-SQL). + +# 3.1 Preliminaries + +Task Definition. Given the current user utterance $u_{\tau}$ , interaction history $h_{\tau} = [u_1, u_2, \dots, u_{\tau - 1}]$ , the schema $D = \langle T, C \rangle$ of the target database such that the set of tables $T = \{t_1, \dots, t_{|T|}\}$ and the set of columns $C = \{c_1, \dots, c_{|C|}\}$ , our goal is to generate the corresponding SQL query $s_{\tau}$ . + +Model Architecture. Figure 2 shows the encoder-decoder framework of HIE-SQL. We will introduce it in four modules: (i) Multimodal Encoder, which encodes SQL query and natural language context in a multimodal manner, (ii) SQLBERT, a bimodal pre-trained encoder for SQL and natural language, (iii) HIE-Layers, which encode pre-defined schema-linking relations between all elements of the output of Language Model, and (iv) Decoder, which generates SQL query as an abstract syntax tree. + +# 3.2 Multimodal Encoder + +Since of the huge syntax structure differences between SQL and natural language, using a single language model to encode both languages at the same time increases the difficulty and cost of training the model. Inspired by the efficiency of the works (Kiela et al., 2019; Tsimpoukelli et al., 2021) to solve the multimodal problems, we build an additional pre-trained Encoder named SQLBERT (we will detail it in the following section) to pre-encode SQL query. Then we learn weights $W \in R^{N \times M}$ to project the N-dimensional SQL query embeddings + +![](images/dc1b281d7e5d6b607dd2d56a9218b56ad4f1eb5cacdeed8f7f4f4155bae52cec.jpg) +Figure 2: Structure and components of HIE-SQL. The red arrows represent the direction of back propagation during the training stage, witch means parameters of SQL Encoder will not be updated during training. Linear represents one fully connected layer. And we use SQLBERT as the SQL Encoder in the structure. + +to M-dimensional token input embedding space of the language model: + +$$ +\mathcal {S} = W f \left(s _ {\tau - 1}\right), \tag {1} +$$ + +where $f(\cdot)$ is the last hidden state output of SQL-BERT. + +We arrange the input format of HIE-SQL as $x = ([\mathrm{CLS}], \mathcal{U}, [\mathrm{CLS}], \mathcal{S}, [\mathrm{SEP}], \mathcal{T}, [\mathrm{SEP}], \mathcal{C})$ in which + +$$ +\mathcal {U} = \left(u _ {1}, [ \mathrm {C L S} ], u _ {2}, \dots , [ \mathrm {C L S} ], u _ {\tau}\right), +$$ + +$$ +\mathcal {T} = \left(t _ {1}, [ \mathrm {S E P} ], t _ {2}, \dots , [ \mathrm {S E P} ], t _ {| T |}\right), \tag {2} +$$ + +$$ +\mathcal {C} = \left(c _ {1}, [ \mathrm {S E P} ], c _ {2}, \dots , [ \mathrm {S E P} ], c _ {| C |}\right). +$$ + +All the special separator tokens and language word tokens in $x$ are converted to the word embedding by embedding layer of the language model. Gathering the embeddings of natural language and SQL, we feed them to self-attention blocks in a language model. In the training stage, we directly take the golden SQL query of the last turn as an input SQL query and set $S$ to empty for the first turn. As for the inference stage, we apply the SQL query generated by HIE-SQL in the last turn. + +# 3.3 SQLBERT + +As mentioned above, we treat the SQL query as another modality that can provide information of the SQL query from the previous round as a reference for the model. So we need an encoder to extract the representation of the SQL query. + +![](images/10311b8136dced8c348537a55e6c3591725423036d7adee29b955096d10da7bf.jpg) +Figure 3: Input format and training objective of SQL-BERT. + +Model Architecture. Considering the success of multi-modal pre-trained models, such as ViLBERT (Lu et al., 2019) for language-image and CodeBERT (Feng et al., 2020) for natural language and programming language, we propose SQLBERT, a bimodal pre-trained model for natural language and SQL. We develop SQLBERT by using the same model architecture as RoBERTa (Liu et al., 2019). The total number of model parameters is 125M. + +Input Format. As the training method showed in Figure 3, we set the same input as CodeBERT (Feng et al., 2020) does. To alleviate the difficulty of training and resolve inconsistencies between natural language and schema, we append the question-relevant database schema to the concatenation of SQL query and question. We represent the whole input sequence into the format as $x = \left( [\mathrm{CLS}], s_1, s_2,..s_n, [\mathrm{SEP}], q_1, q_2,..q_m, [\mathrm{SEP}], t_1 : c_{11}, c_{12},..., [\mathrm{SEP}], t_2 : c_{21},..., [\mathrm{SEP}], \ldots \right)$ , in which $s, q, t$ , and $c$ are the tokens of SQL query, question, tables, and columns respectively. + +Training Objective. The main training objective of SQLBERT is the masked language modeling (MLM). It's worth noting that we only mask the tokens of SQL query because we only need SQLBERT to encode SQL query in the downstream task. Specifically, we utilize a special objective referenced span masking (Sun et al., 2019) by sampling $15\%$ independent span in SQL clause except the reserved word (e.g., SELECT, FROM, WHERE), which aims to avoid leaking answers and help SQLBERT learn the information structure of SQL better. In the training stage, we adopt a dynamic masking strategy via randomly shuffling the order of tables and columns in the original schema. We describe the masked span prediction loss as + +$$ +\mathcal {L} (\theta) = \sum_ {k = 1} ^ {n} - l o g \mathcal {P} _ {\theta} \left(s _ {k} ^ {m a s k} \mid s ^ {\backslash m a s k}, q, t, c\right), \tag {3} +$$ + +where $\theta$ stands for the model parameters, $s_k^{mask}$ is the masked span of SQL input, $s^{\backslash mask}$ is the unmasked part. + +![](images/3def9c6196b66e5c53c4d3a75c924df90b5459266faa1e71bf32f7c54ecab906.jpg) +Figure 4: An example of the schema-linking graph for the prediction of $S_{2}$ in Figure 1. The graph is a subgraph of the whole schema-linking graph. We only respectively choose one token in the history utterance $(U_{1})$ , the current utterance $(U_{2})$ , and the last predicted SQL query $(S_{1})$ in the example. Besides, we omit all unequal relation edges (S-C-UC and S-T-UT) and default "no relation" edges. + +Training Data. Unlike SCoRe (Yu et al., 2021b), which uses multiple open-source text-to-SQL datasets (WiKiTABLES (Bhagavatula et al., 2015), WikiSQL (Zhong et al., 2017), Spider, SparC, and CoSQL) and data synthesis methods to obtain a large amount of pre-training data, we train SQLBERT only with the datasets including Spider, SparC and CoSQL. For each sample, we only use its question, SQL query, and the corresponding database schema. As for SparC and CoSQL, which is a context-dependent version, we simply concatenate the current utterance with the history utterances to build the question input. The size of the training dataset is 34,175. + +# 3.4 HIE-Layers + +Schema-Linking Graph. To explicitly encode the complex relational database schema. We convert it to a directed graph $\mathcal{G} = \langle \mathcal{V},\mathcal{E}\rangle$ , where $\mathcal{V} = C\cup T$ and $\mathcal{E}$ represents the set of pre-existing relations within columns and tables such as the foreign-key relation. In addition, we also consider the unseen linking to the schema in the contexts of current utterance, interaction history utterances, and the last predicted SQL query. Specifically, we define the context-dependent schema-linking graph $\mathcal{G}_c = \langle \mathcal{V}_c,\mathcal{E}_c\rangle$ where $\mathcal{V}_c = C\cup T\cup U\cup H\cup S$ and $\mathcal{E}_c = \mathcal{E}\cup \mathcal{E}_{U\leftrightarrow D}\cup \mathcal{E}_{H\leftrightarrow D}\cup \mathcal{E}_{S\leftrightarrow D}$ . The additional relation edges are listed in Table 1. In Figure 4, we show an example of the proposed schema-linking graph. + +Graph Encoding. The work (Wang et al., 2020) shows that Relative Self-Attention Mechan + +
Current UtteranceInteraction HistorySQL Query
ColumnsU-C-EMH-C-EMS-C-EC
U-C-PMH-C-PMS-C-UC
U-C-VMH-C-VM
TablesU-T-EMH-T-EMS-T-ET
U-T-PMH-T-PMS-T-UT
+ +Table 1: Edge types between current utterance $U$ , interaction history $H$ , SQL $S$ , and database schema $D$ (Columns $C$ and Tables $T$ ). We set two match types between the language tokens of $U$ , $H$ , and $D$ : EM for Exact Match, PM for Partial Match. When using database contents, we set VM (Value Match) for exactly matching the value of columns. As for SQL $S$ , we simply match the words of tables and columns that appear in it to the target database schema: EC (Equal Columns) and UC (Unequal Columns) for columns, ET (Equal Tables) and UT (Unequal Tables) for tables. And we omit the pre-existing relations in schema such as the foreign-key relation (C-C-FK) in the table. + +anism (Shaw et al., 2018) is an efficient way to encode graphs whose nodes are at the token level. It rebuilds the calculation of the self-attention module in the transformer layers as follows: + +$$ +e _ {i j} = \frac {x _ {i} W ^ {Q} (x _ {j} W ^ {K} + r _ {i j} ^ {K}) ^ {T}}{\sqrt {d _ {z}}}, +$$ + +$$ +\alpha_ {i j} = \underset {j} {\operatorname {s o f t m a x}} \left\{e _ {i j} \right\}, \tag {4} +$$ + +$$ +z _ {i} = \sum_ {j = 1} ^ {n} \alpha_ {i j} (x _ {j} W ^ {V} + r _ {i j} ^ {V}). +$$ + +HIE-Layers consist of 8 transformer layers, whose self-attention modules are described above. Specifically, we initialize a learned embedding for each type of edge defined above. For every input sample, we build a relation matrix $\mathcal{R} \subseteq (L \times L)$ where $L$ is the length of the input token. $\mathcal{R}^{(i,j)}$ represents the relation type between $i$ -th and $j$ -th input tokens. While computing the relative attention, we set the $r_{ij}^{K} = r_{ij}^{V} = \mathcal{R}_{e}^{(i,j)}$ where $\mathcal{R}_{e}^{(i,j)}$ is the corresponding embedding of $\mathcal{R}^{(i,j)}$ . + +# 3.5 Decoder + +To build the decoder of HIE-SQL, we apply the same work (Yin and Neubig, 2017) as Wang et al. (2020) propose, which generates SQL as an abstract syntax tree in depth-first traversal order by using LSTM (Hochreiter and Schmidhuber, 1997) to output sequences of decoder actions. We recommend the reader to refer to the work (Yin and Neubig, 2017) for details. + +# 3.6 Regularization Strategy + +We introduce R-Drop (Liang et al., 2021), a simple regularization strategy, to prevent the overfitting of the model. Concretely, we feed every input + +data $x_{i}$ to go through our model twice and the loss function is as follows: + +$$ +\mathcal {L} _ {N L L} ^ {i} = - \log \mathcal {P} _ {1} (y _ {i} | x _ {i}) - \log \mathcal {P} _ {2} (y _ {i} | x _ {i}), +$$ + +$$ +\begin{array}{l} \mathcal {L} _ {K L} ^ {i} = \frac {1}{2} \left(D _ {K L} \left(\mathcal {P} _ {1} \left(y _ {i} \mid x _ {i}\right) \| \mathcal {P} _ {2} \left(y _ {i} \mid x _ {i}\right)\right) \right. \tag {5} \\ + D _ {K L} \left(\mathcal {P} _ {2} \left(y _ {i} \mid x _ {i}\right) \| \mathcal {P} _ {1} \left(y _ {i} \mid x _ {i}\right)\right)), \\ \end{array} +$$ + +$$ +\mathcal {L} ^ {i} = \mathcal {L} _ {N L L} ^ {i} + \mathcal {L} _ {K L} ^ {i}, +$$ + +where $-\log \mathcal{P}_1(y_i|x_i)$ and $-\log \mathcal{P}_2(y_i|x_i)$ are two output distributions for input $x_{i}$ at all decoder steps, $\mathcal{L}_{NLL}^{i}$ is the negative log-likelihood learning objective of decoder actions, and $\mathcal{L}_{KL}^{i}$ is the bidirectional Kullback-Leibler (KL) divergence between these two output distributions. + +# 4 Experiment + +# 4.1 Setup + +Setting. We initialize the weights of Language Model with GraPPa (Yu et al., 2021a), an effective pre-training model for table semantic parsing that performs well on the context-independent text-to-SQL datasets (e.g. Spider). We stack 8 HIE-layers, which are introduced in section 3.4, on top of the Language Model. When training the model with R-Drop, we set the Dropout rate of 0.1 for the Language Model and HIE-Layers, 0.3 for the decoder. We use Adam optimizer to conduct the parameter learning and set the learning rate of $1e^{-5}$ for fine-tuning GraPPa and $1e^{-4}$ for HIE-Layers and Decoder. The learning rate linearly increases to the setting point at first max_steps/8 steps, then decreases to 0 at max_steps, where max_steps = 50000 with 24 training batch-size. As for SQLBERT, we fine-tune CodeBERTBASE (Feng et al., 2020) on the dataset we described in Section 3.3. We set the learning rate as $1e^{-5}$ , a batch size of 64, + +
DatasetSystem ResponseInteractionTrainDevTestUser QuestionsVocabAvg Turn
CoSQL300721642935511559895855.2
SparC429830344228421272637943.0
+ +Table 2: Details of SparC and CoSQL datasets. + +
ModelSparCCoSQL
DevTestDevTest
QMIMQMIMQMIMQMIM
EditSQL + BERT (Zhang et al., 2019)47.229.547.925.339.912.340.813.7
IGSQL + BERT (Cai and Wan, 2020)50.732.551.229.544.115.842.515.0
IST-SQL + BERT (Wang et al., 2021)----44.414.741.815.2
R²SQL + BERT (Hui et al., 2021)54.135.255.830.845.719.546.817.0
RAT-SQL† + SCoRe (Yu et al., 2021b)62.242.562.438.152.122.051.621.2
T5-3B + PICARD† (Scholak et al., 2021)----56.924.254.623.7
HIE-SQL + GraPPa (ours)64.745.064.642.956.428.753.924.6
+ +Table 3: Performances of various models in SparC and CoSQL. QM and IM stand for question match and interaction match respectively. The models with $\dagger$ are proposed for the context-independent text-to-SQL task and applied to the context-dependent text-to-SQL task by just appending interaction history utterances to the input. + +and train SQLBERT for 10 epochs. The shape of learned weights of the linear layer applied to the output of SQLBERT is $768 \times 1024$ . We only need one V100 (32G) GPU to train our model. While inferring, we set the beam size to 3. + +Datasets. We conduct experiments on two cross-domain context-dependent text-to-SQL datasets, SparC (Yu et al., 2019b) and CoSQL (Yu et al., 2019a). Table 2 depicts the statistic information of them. + +Evaluation Metrics. The main metric we used to measure model performance in SparC and CoSQL is interaction match (IM), which requires all output SQL queries in interaction to be correct. We also use question match (QM) to evaluate the accuracy of every single question. + +# 4.2 Experiment Result + +Results of our proposed HIE-SQL model are shown in Table 3. In terms of interaction match, our model achieves state-of-the-art performances on both development set and test set of SparC and CoSQL. For the test set of SparC, HIE-SQL outperforms the prior state-of-the-art (Yu et al., 2021b) by $4.8\%$ in IM and $2.2\%$ in QM. For CoSQL, compared with the previous state-of-the-art (Scholak et al., 2021), a rule-based auto-regressive method + +based on the large pre-trained model-T5-3B (Raffel et al., 2020) which contains 2.8 billion parameters, HIE-SQL improves IM of development set by $4.5\%$ and IM of the test set by $0.9\%$ with only 580M parameters. Besides, HIE-SQL surpasses RAT-SQL + SCoRe in all metrics of SparC and CoSQL. This demonstrates that properly integrating interaction utterances and predicted SQL queries is an effective way to enhance the model's ability for Context-Dependent Text-to-SQL Semantic Parsing. + +To further explore the advantages of HIE-SQL, we test the performance on different turns and at different difficulty levels of utterances. As shown in Figure 5, with the increase of turns, the lead of our model gets greater and greater. When the indexes of turns are greater than or equal to 4, the accuracy of HIE-SQL is $17\%$ higher than that of $\mathbf{R}^2\mathbf{S}\mathbf{L}\mathbf{Q}$ . It demonstrates that the main contribution of introducing SQL query is to improve the robustness of the model to long interaction. HIE-SQL is also robust to the varying difficulty levels of utterances. Our model performs equally in hard and extra hard levels, and achieves $39.6\%$ accuracy on the extra hard level, which is $17.8\%$ higher than that of $\mathbf{R}^2\mathbf{S}\mathbf{L}\mathbf{Q}$ . + +![](images/5648bb3fa817f1f5aedb41df33e2dbacfd44cce8da8d9675f0da240ff3ec266a.jpg) +Figure 5: Performances of previous works and HIE-SQL in different turns (left) and different difficulty levels (right) on SparC. + +![](images/634729e1a9a05824e70be7de910cdd82f27f3e70b7643332eb3090372b3f9b3a.jpg) + +
ModelSparCCoSQL
QMIMQMIM
HIE-SQL64.745.056.428.7
w/o SQL query65.844.356.523.9
w/o SQLBERT63.944.754.826.3
w/o ΕH↔D64.044.356.026.3
+ +# 4.3 Ablation Study + +We provide ablation studies to examine the contribution of each component of HIE-SQL. We want to identify whether introducing the last SQL query has a significant impact on performance. Also, we would like to investigate whether the pre-trained SQL encoder, SQLBERT, can improve the model's ability to understand SQL queries. What's more, we conduct another ablation study regarding additional graph edges between historical utterances and database schema $\mathcal{E}_{H\leftrightarrow D}$ to check the necessity of the join of historical utterance information in schema-linking. + +As shown in Table 4, Our full model achieves about 5 points and 1 point improvement of IM in CoSQL and SparC respectively compared with the model without the last SQL query input. The pre-encoding SQL query by SQLBERT can further improve the performance. It confirms SQLBERT's ability to efficiently represent SQL features. In addition, $\mathcal{E}_{H\leftrightarrow D}$ also plays a positive role. + +Table 4: Ablation study of HIE-SQL in development sets of SparC and CoSQL. As for ablation on SQL query, we drop the SQL query and only feed utterances and database schema to the model. As for ablation on SQLBERT, we directly concatenate the tokens of SQL query and other context tokens for the input of the language model. And w/o $\mathcal{E}_{H\leftrightarrow D}$ means we treat historical utterances like the current utterance in our schemalinking. + +
DatasetModelT-FF-TT-T
SparCHIE-SQL12588383
w/o SQL query132104379
CoSQLHIE-SQL140106278
w/o SQL query161128254
+ +Table 5: The counts of different switches in the pairs of adjacent predicted SQL queries. T-F stands for the match of the former predicted query and unmatched of the later predicted query with golden queries. F-T stands for the reverse case. T-T is the case of both matching. + +![](images/61821ffc9b1b84a54f624149ca8a5ba761c05ae62664638159dd68795a5d9885.jpg) +Figure 6: Ablation study result of regarding R-Drop in development set of CoSQL. We show the performances in QM and IM of two models at different training steps. We set the beam size $= 1$ in the inference stage. + +Table 5 shows the continuity of performance of our model compared with that of the model without the last SQL query input. Our model has a higher rate of continuous match, but a lower rate of switching from mismatch to match. It illustrates that our model does use the SQL information and is sensitive to the accuracy of the last predicted SQL query which explains the higher question match without SQL query input. + +As shown in Figure 6, the model with R-drop outperforms the model without R-Drop in both QM + +
Ua1Which cartoon aired first?
HIE-SQLSELECT title FROM cartoon ORDER BY original_air_date asc LIMIT 1
RAT-SQLSELECT title FROM cartoon ORDER BY original_air_date asc LIMIT 1
Ua2What was the last cartoon to air?
HIE-SQLSELECT title FROM cartoon ORDER BY original_air_date desc LIMIT 1
RAT-SQLSELECT title FROM cartoon ORDER BY original_air_date desc LIMIT 1
Ua3What channel was it on?
HIE-SQLSELECT channel FROM cartoon ORDER BY original_air_date desc LIMIT 1
RAT-SQLSELECT channel FROM cartoon ORDER BY original_air_date desc LIMIT 1
Ua4What is the production code?
HIE-SQLSELECT production_code FROM cartoon ORDER BY original_air_date desc LIMIT 1
RAT-SQLSELECT production_code FROM cartoon ORDER BY original_air_date asc LIMIT 1
Ub1List the name of the teachers and the courses assigned for them to teach.
HIE-SQLSELECT Name, Course FROM ...
RAT-SQLSELECT Name, Course FROM ...
Ub2Arrange this list with the teachers name in ascending order
HIE-SQLELECT Name, Course FROM ... ORDER BY Name Asc
RAT-SQLELECT Name, Course FROM ... ORDER BY Name Asc
Ub3Include teachers ID in tha same list
HIE-SQLSELECT Name, Course, Teacher_ID FROM ... ORDER BY Name Asc
RAT-SQLSELECT Teacher_ID FROM ... ORDER BY Teacher_ID Asc
+ +Table 6: Examples in CoSQL. $U_{ij}$ is the input utterance of turn $j$ of example $i$ with corresponding predictions of HIE-SQL and RAT-SQL following. All predictions of HIE-SQL are the ground truth queries in the cases. + +and IM. Additionally, the standard deviations of the IM in the last 20k steps are 0.014 and 0.015 of HIESQL and the one without R-Drop respectively even the curve of HIE-SQL has a more obvious upward trend. It shows that R-Drop improves the robustness of our model and stabilizes its performance in IM. What's more, when the key information the last SQL query is introduced, our model needs more training steps to fit the same training data. After adding R-drop, in the same training step, the model will forward the data twice to get the KL loss. This is equivalent to doubling the amount of training data in the same step. Therefore, our model has learned the training data more fully and is able to make full use of various historical interaction information. + +# 4.4 Case Study + +In Table 6, we offer some cast studies about the performance of HIE-SQL and RAT-SQL in the + +examples of CoSQL in order to demonstrate the superiority of HIE-SQL in context-dependent text-to-SQL semantic parsing problems more visually. As the examples show, RAT-SQL fails to distinguish the right one from two long-range dependences in $U_{a1}$ and $U_{a2}$ in the first example and fails to inherit the query information from $U_{b2}$ in $U_{b3}$ . By contrast, HIE-SQL inherits the right context-dependence from the last predicted query to avoid the confusion. + +# 5 Conclusion + +We present HIE-SQL, a history information enhanced context-dependent text-to-SQL model, which targets at explicitly capturing the context-dependence from both interaction history utterances and the last predicted SQL query. With the help of the proposed bimodal pre-trained model, SQLBERT, HIE-SQL bridge the gap between the + +utterances and predicted SQL despite the mismatch of natural language and logic-form SQL. Moreover, we also introduce a method of schema-linking to enhance the connections among utterances, SQL query, and database schema. + +Taken together, HIE-SQL achieves consistent improvements on the context-dependent text-to-SQL task, especially in the interaction match metric. HIE-SQL achieves new state-of-the-art results on two famous context-dependent text-to-SQL datasets, SparC and CoSQL. + +# References + +Chandra Sekhar Bhagavatula, Thanapon Noraset, and Doug Downey. 2015. Tabel: Entity linking in web tables. In Proceedings of the 2015 Conference of International Semantic Web (ISWC), Part I, volume 9366 of Lecture Notes in Computer Science, pages 425-441. +Ben Bogin, Jonathan Berant, and Matt Gardner. 2019a. Representing schema structure with graph neural networks for text-to-SQL parsing. In Proceedings of the 57th Conference of the Association for Computational Linguistics (ACL), volume 1, pages 4560-4565. +Ben Bogin, Matt Gardner, and Jonathan Berant. 2019b. Global reasoning over database structures for text-to-SQL parsing. 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 3657-3662. +Yitao Cai and Xiaojun Wan. 2020. IGSQL: database schema interaction graph based neural model for context-dependent text-to-SQL generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6903-6912. +Ruisheng Cao, Lu Chen, Zhi Chen, Yanbin Zhao, Su Zhu, and Kai Yu. 2021. LGESQL: line graph enhanced text-to-SQL model with mixed local and non-local relations. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (ACL/IJCNLP), volume 1, pages 2541-2555. +Zhi Chen, Lu Chen, Yanbin Zhao, Ruisheng Cao, Zihan Xu, Su Zhu, and Kai Yu. 2021. ShadowGNN: Graph projection neural network for text-to-SQL parser. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), volume 1, pages 5567-5577. +Xiang Deng, Ahmed Hassan Awadallah, Christopher Meek, Oleksandr Polozov, Huan Sun, and Matthew Richardson. 2021. Structure-grounded pretraining for text-to-SQL. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), volume 1, pages 1337-1350. +Kedar Dhamdhere, Kevin S McCurley, Ralfi Nahmias, Mukund Sundararajan, and Qiqi Yan. 2017. Analyza: Exploring data with conversation. In Proceedings of the 22nd + +International Conference on Intelligent User Interfaces (ACM IUI), pages 493-504. +Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, and Ming Zhou. 2020. CodeBERT: A pre-trained model for programming and natural languages. In *Findings of the Association for Computational Linguistics: EMNLP* 2020 (EMNLP-Findings), pages 1536-1547. +Yujian Gan, Xinyun Chen, Jinxia Xie, Matthew Purver, John R Woodward, John Drake, and Qiaofu Zhang. 2021. Natural SQL: Making SQL easier to infer from natural language specifications. In *Findings of the Association for Computational Linguistics: EMNLP* 2021 (EMNLP-Findings). +Jiaqi Guo, Zecheng Zhan, Yan Gao, Yan Xiao, Jian-Guang Lou, Ting Liu, and Dongmei Zhang. 2019. Towards complex text-to-SQL in cross-domain database with intermediate representation. In Proceedings of the 57th Conference of the Association for Computational Linguistics (ACL), volume 1, pages 4524-4535. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. *Neural Comput.*, 9(8):1735-1780. +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 Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI), volume 35, pages 13116-13124. +Douwe Kiela, Suvrat Bhooshan, Hamed Firooz, and Davide Testuggine. 2019. Supervised multimodal bittransformers for classifying images and text. In Visually Grounded Interaction and Language (ViGIL), NeurIPS 2019 Workshop. +Wenqiang Lei, Weixin Wang, Zhixin Ma, Tian Gan, Wei Lu, Min-Yen Kan, and Tat-Seng Chua. 2020. Re-examining the role of schema linking in text-to-sql. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6943-6954. +Xiaobo Liang, Lijun Wu, Juntao Li, Yue Wang, Qi Meng, Tao Qin, Wei Chen, Min Zhang, and Tie-Yan Liu. 2021. R-Drop: Regularized dropout for neural networks. arXiv preprint arXiv:2106.14448. +Xi Victoria Lin, Richard Socher, and Caiming Xiong. 2020. Bridging textual and tabular data for cross-domain text-to-SQL semantic parsing. In Findings of the Association for Computational Linguistics: EMNLP 2020 (EMNLP-Findings), pages 4870-4888. +Qian Liu, Bei Chen, Jiaqi Guo, Jian-Guang Lou, Bin Zhou, and Dongmei Zhang. 2020. How far are we from effective context modeling? an exploratory study on semantic parsing in context. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI), pages 3580-3586. +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. +Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. 2019. ViLBERT: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In Advances in + +Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems (NeurIPS), pages 13-23. +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. J. Mach. Learn. Res., 21:140:1-140:67. +Ohad Rubin and Jonathan Berant. 2021. SmBoP: Semi-autoregressive bottom-up semantic parsing. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), volume 1, pages 311-324. +Torsten Scholak, Nathan Schucher, and Dzmitry Bahdanau. 2021. PICARD: Parsing incrementally for constrained auto-regressive decoding from language models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP). +Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. 2018. Self-attention with relative position representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), volume 2, pages 464-468. +Peng Shi, Patrick Ng, Zhiguo Wang, Henghui Zhu, Alexander Hanbo Li, Jun Wang, Cicero Nogueira dos Santos, and Bing Xiang. 2021. Learning contextual representations for semantic parsing with generation-augmented pre-training. In Proceedings of the Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI), pages 13806-13814. +Yu Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xin Tian, Danxiang Zhu, Hao Tian, and Hua Wu. 2019. Ernie: Enhanced representation through knowledge integration. arXiv preprint arXiv:1904.09223. +Maria Tsimpoukelli, Jacob Menick, Serkan Cabi, SM Eslami, Oriol Vinyals, and Felix Hill. 2021. Multimodal few-shot learning with frozen language models. arXiv preprint arXiv:2106.13884. +Bailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov, and Matthew Richardson. 2020. RAT-SQL: relation-aware schema encoding and linking for text-to-SQL parsers. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (ACL), pages 7567-7578. +Runze Wang, Zhen-Hua Ling, Jingbo Zhou, and Yu Hu. 2021. Tracking interaction states for multi-turn text-to-SQL semantic parsing. In Proceedings of the Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI), pages 13979-13987. +Nathaniel Weir, Prasetya Utama, Alex Galakatos, Andrew Crotty, Amir Ilkhechi, Shekar Ramaswamy, Rohin Bhushan, Nadja Geisler, Benjamin Hattasch, Steffen Eger, et al. 2020. DBPal: A fully pluggable nl2sql training pipeline. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, pages 2347-2361. +Yuk Wah Wong and Raymond J. Mooney. 2007. Learning synchronous grammars for semantic parsing with lambda calculus. In Proceedings of the 45th Annual Meeting of the Association for Computational Linguistics (ACL), pages 960-967. + +Peng Xu, Dhruv Kumar, Wei Yang, Wenjie Zi, Keyi Tang, Chenyang Huang, Jackie Chi Kit Cheung, Simon J. D. Prince, and Yanshuai Cao. 2021. Optimizing deeper transformers on small datasets. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (ACL/IJCNLP), volume 1, pages 2089-2102. +Pengcheng Yin and Graham Neubig. 2017. A syntactic neural model for general-purpose code generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (ACL), pages 440-450. +Tao Yu, Chien-Sheng Wu, Xi Victoria Lin, Bailin Wang, Yi Chern Tan, Xinyi Yang, Dragomir R. Radev, Richard Socher, and Caiming Xiong. 2021a. GraPPa: Grammar-augmented pre-training for table semantic parsing. In 9th International Conference on Learning Representations (ICLR). +Tao Yu, Michihiro Yasunaga, Kai Yang, Rui Zhang, Dongxu Wang, Zifan Li, and Dragomir R. Radev. 2018a. SyntaxSQLNet: Syntax tree networks for complex and cross-domain text-to-SQL task. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1653-1663. +Tao Yu, Rui Zhang, Heyang Er, Suyi Li, Eric Xue, Bo Pang, Xi Victoria Lin, Yi Chern Tan, Tianze Shi, Zihan Li, Youxuan Jiang, Michihiro Yasunaga, Sungrok Shim, Tao Chen, Alexander R. Fabbri, Zifan Li, Luyao Chen, Yuwen Zhang, Shreya Dixit, Vincent Zhang, Caiming Xiong, Richard Socher, Walter S. Lasecki, and Dragomir R. Radev. 2019a. CoSQL: A conversational text-to-SQL challenge towards cross-domain natural language interfaces to databases. 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 1962-1979. +Tao Yu, Rui Zhang, Alex Polozov, Christopher Meek, and Ahmed Hassan Awadallah. 2021b. SCoRe: Pre-training for context representation in conversational semantic parsing. In 9th International Conference on Learning Representations (ICLR). +Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir R. Radev. 2018b. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3911-3921. +Tao Yu, Rui Zhang, Michihiro Yasunaga, Yi Chern Tan, Xi Victoria Lin, Suyi Li, Heyang Er, Irene Li, Bo Pang, Tao Chen, Emily Ji, Shreya Dixit, David Proctor, Sungrok Shim, Jonathan Kraft, Vincent Zhang, Caiming Xiong, Richard Socher, and Dragomir R. Radev. 2019b. SParC: Cross-domain semantic parsing in context. In Proceedings of the 57th Conference of the Association for Computational Linguistics (ACL), volume 1, pages 4511-4523. +John M. Zelle and Raymond J. Mooney. 1996. Learning to parse database queries using inductive logic programming. In Proceedings of the Thirteenth National Conference on Artificial Intelligence and Eighth Innovative Applications of Artificial Intelligence Conference (AAAI/IAAI), pages 1050-1055. + +Luke S. Zettlemoyer and Michael Collins. 2005. Learning to map sentences to logical form: Structured classification with probabilistic categorical grammars. In Proceedings of the 21st Conference in Uncertainty in Artificial Intelligence (UAI), pages 658-666. +Rui Zhang, Tao Yu, Heyang Er, Sungrok Shim, Eric Xue, Xi Victoria Lin, Tianze Shi, Caiming Xiong, Richard Socher, and Dragomir R. Radev. 2019. Editing-based SQL query generation for cross-domain context-dependent questions. 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 5337-5348. +Victor Zhong, Caiming Xiong, and Richard Socher. 2017. Seq2SQL: Generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103. \ No newline at end of file diff --git a/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/images.zip b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cdcf62f2a797f6659b02585beac86052867b2cce --- /dev/null +++ b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1ddd20b8d5b38ef4ea1c9b076502e23bd17fee962d3e4168f7be6169ed879cc +size 598154 diff --git a/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/layout.json b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..082830289004779f774bf2c0f063e045cb84ddcb --- /dev/null +++ b/hiesqlhistoryinformationenhancednetworkforcontextdependenttexttosqlsemanticparsing/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:390ccd7bc07b0a595104a014f5d6c0755c0d79acd4d6223fe007e39dbdaee1d7 +size 349207 diff --git a/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_content_list.json b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c1b8bd4801076226b8fe09c2326bd30ce52e7610 --- /dev/null +++ b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e43fe4c962142bc87c3f49c9e23bc997d1eefd29494c34d1f11c9f88a4c7f629 +size 123311 diff --git a/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_model.json b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3ca5d1c47eb81800592e4d741d697f4956b77e25 --- /dev/null +++ b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76e5946bcc7bc9672620a098b8a187a3c9e7ac8e7adf9d1445892ab8f99d97c5 +size 138465 diff --git a/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_origin.pdf b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..865ff58d85b37697f62e801cad020af74c89157a --- /dev/null +++ b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/709cb99d-b48f-447d-bf1a-35cc1839d08d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2829727b5b06a4c6492566a82c197388beea64efd8c9fbb808a988b77ab37873 +size 1570887 diff --git a/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/full.md b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a126aafdc64ba299085fe9dae3e4e0685bcea8e4 --- /dev/null +++ b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/full.md @@ -0,0 +1,423 @@ +# HiStruct+: Improving Extractive Text Summarization with Hierarchical Structure Information + +Qian Ruan +DFKI GmbH, Germany +klararuan@gmail.com + +Malte Ostendorff +DFKI GmbH, Germany +malte.ostendorff@dfki.de + +Georg Rehm +DFKI GmbH, Germany +georg.rehm@dfki.de + +# Abstract + +Transformer-based language models usually treat texts as linear sequences. However, most texts also have an inherent hierarchical structure, i.e., parts of a text can be identified using their position in this hierarchy. In addition, section titles usually indicate the common topic of their respective sentences. We propose a novel approach to formulate, extract, encode and inject hierarchical structure information explicitly into an extractive summarization model based on a pre-trained, encoder-only Transformer language model (HiStruct+ model), which improves SOTA ROUGEs for extractive summarization on PubMed and arXiv substantially. Using various experimental settings on three datasets (i.e., CNN/DailyMail, PubMed and arXiv), our HiStruct+ model outperforms a strong baseline collectively, which differs from our model only in that the hierarchical structure information is not injected. It is also observed that the more conspicuous hierarchical structure the dataset has, the larger improvements our method gains. The ablation study demonstrates that the hierarchical position information is the main contributor to our model's SOTA performance. + +# 1 Introduction + +Texts, especially long documents, contain internal hierarchical structure like sections, paragraphs, sentences, and tokens. When we manually summarize a text, the hierarchical text structure usually plays a key role. Taking a scientific paper as an example, we might focus more on the sections with the titles of "methodology", "discussion", and "conclusion" while paying less attention to the sections like "background". Furthermore, the sentences within one section could have closer relationship with each other, than the ones outside this section. Understanding not only the sequential relations between the sentences but also the internal hierarchical text structure helps us better determine the + +important sentences within a document. Similarly, a neural summarization model could benefit from these hierarchical structure information. + +In this paper, we focus on extractive text summarization of single documents, which is the task of binary sentence classification with labels indicating whether a sentence should be included in a summary. Recently, pre-trained language models based on Transformer (Vaswani et al., 2017), such as BERT (Devlin et al., 2019), have been widely used to extract contextual representations from texts. The pre-trained Transformer language models (TLMs) can be easily reused for fine-tuning on the downstream tasks, so that the representations already learned from the large pretraining corpora are preserved. Liu and Lapata (2019) have achieved the state-of-the-art (SOTA) performance by fine-tuning BERT for extractive summarization on short document datasets including CNN/DailyMail. However, the TLMs consider merely the sequential-context-dependency by adding a linear positional encoding to each input token embeddings. The hierarchical text structure information is not taken into account explicitly. + +We propose a novel approach to formulate, extract, encode and inject the hierarchical structure (HiStruct) information explicitly into an extractive summarization model (HiStruct+ model), which consists of a TLM for sentence encoding and two stacked inter-sentence Transformer layers for hierarchical learning and extractive summarization (see Figure 1). We experiment with BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019), and Longformer (Beltagy et al., 2020) as underlying TLMs. The HiStruct information utilized in our work includes the section titles and the hierarchical positions of sentences, which are encoded using our proposed novel methods. The resulting embeddings can be injected into the TLM sentence representations to provide the HiStruct information for the summarization task. + +![](images/660195c930bab3aa7b52a9aac42a779ce2884678718104353f35d7991efef364.jpg) +Figure 1: Architecture of the HiStruct+ model. The model consists of a base TLM for sentence encoding and two stacked inter-sentence Transformer layers for hierarchical contextual learning with a sigmoid classifier for extractive summarization. The two blocks shaded in light-green are the HiStruct injection components. + +The HiStruct+ models are evaluated on short documents (i.e., CNN/DailyMail (See et al., 2017)) and long documents (i.e., PubMed and arXiv (Cohen et al., 2018)) with various hierarchical characteristics. Our models produce competitive results on CNN/DailyMail and set the SOTA ROUGEs for extractive summarization on PubMed and arXiv to a new level. We also compare the HiStruct+ models with the corresponding strong baselines, which differ from our models only in that the HiStruct information is not injected. Using various experimental settings, our models collectively outperform the baselines on the three datasets, indicating the effectiveness of the proposed HiStruct encoding methods. The improvements are especially substantial on PubMed and arXiv, which contain longer scientific papers with conspicuous hierarchical structures. Ablation studies suggest that the performance gains are mainly contributed by the hierarchical position information of sentences. + +Our contributions in this work are four-folds: (1) We conceptualize novel measures to compare the internal hierarchical structure of the datasets. (2) We propose novel methods to formulate the HiStruct information and implement data preprocessing to extract them from the raw datasets. (3) We propose novel methods to encode and inject + +the HiStruct information into an extractive summarization model explicitly. The effects of different encoding settings and injection settings are systematically investigated. (4) The data containing the extracted HiStruct information, the best HiStruct+ models, as well as the scripts for preprocessing, training and evaluation are available on GitHub1. + +# 2 Related Work + +# 2.1 Text Summarization + +Extractive Text Summarization (ETS) is to classify sentences within a document with labels indicating whether a sentence should be included in the summary. Liu and Lapata (2019) fine-tune BERT with stacked Transformer layers and a sigmoid classifier (BERTSUMEXT). Instead of directly utilizing the existing Transformer encoder for document encoding, Zhang et al. (2019) pre-train a hierarchical Transformer encoder consisting of a sentence encoder and a document encoder (HIBERT) and fine-tune it for ETS. For long documents, Xiao and Carenini (2019) propose a RNN-based ETS model incorporating both the global and the local context (ExtSum-LG). To address the problem of redundancy in extractive summaries, the authors fur + +ther improve their work by introducing redundancy reduction (Xiao and Carenini, 2020). They systematically explore and compare different methods including Trigram Blocking (Paulus et al., 2018), RdLoss, MMR-Select and MMR-Select+ (Xiao and Carenini, 2020). Trigram Blocking is a traditional redundancy reduction method that avoids adding a candidate sentence to the summary if it has trigram overlap with the previously selected sentences. Their previous model combined with the redundancy reduction methods produce SOTA performance for ETS on PubMed and arXiv (Xiao and Carenini, 2020). + +Previous works on extractive summarization model hierarchical structure of documents by introducing a hierarchical attention, where they first learn contextual token representations based on the linear dependencies between tokens and then add additional CNN (Cheng and Lapata, 2016) or RNN (Nallapati et al., 2017) or Transformer (Zhang et al., 2019; Liu and Lapata, 2019) layer(s) to learn document-level representations for each sentence based on the linear dependencies between sentences. However, they learn hierarchical representations of sentences in an implicit way. The models are like black boxes, lacking interpretability. In contrast, our proposed approach enriches sentence representations in an explicit way by using section titles and hierarchical positions of sentences as additional HiStruct information, which is more intuitive and interpretable. + +Abstractive text summarization (ATS) is to generate summaries with new sentences which are not present in the source text. BERTSUMABS (Liu and Lapata, 2019) uses the pre-trained BERT as the encoder in its encoder-decoder architecture. Instead of simply using the pre-trained BERT, recent works, including T5 (Raffel et al., 2020), BART (Lewis et al., 2020) and PEGAUSUS (Zhang et al., 2020) pre-train encoder-decoder models specifically for seq2seq tasks. The first attempt at addressing neural abstractive summarization of long documents is undertaken by Cohan et al. (2018). Aksenov et al. (2020) overcome the length limitations of BERT by a new method of BERT-windowing, allowing it to deal with longer documents. Gidiotis and Tsoumakas (2020) propose a divide-and-conquer approach to train a model to summarize each part of the document separately. To address the essential issue of the quadratic full attention operation of TLMs, Zaheer et al. (2020) propose + +BigBird with a sparse attention mechanism. + +Hybrid text summarization combines extractive summarization, abstractive summarization, or other techniques as a two-stage hybrid system. MatchSum (Zhong et al., 2020) is a recent work that first selects sentences from a document using an extractive model and builds a set of candidate summaries based on them. The summarization task is then formulated as a semantic text matching problem between the source document and the candidate summaries. Pilault et al. (2020) presents a hybrid system that consists of an extractive model and a Transformer language model. The Transformer language model employs an encoder-decoder architecture for abstractive summarization, conditioned on the sentences extracted by the extractive model. + +# 2.2 Injection of Additional Information + +The idea of injecting additional information to TLM is inspired by two former works, LAMBERT (Garncarek et al., 2020) and LayoutLM (Xu et al., 2020), where the visual layout information is injected into BERT by adjusting its input embeddings. These models were not proposed for text summarization and they cannot be applied to plain texts since the layout positions have to be obtained from scanned document images. In contrast, our approach makes use of the internal HiStruct information, which can be found in most types of textual data. Moreover, we enrich the output representations from the TLM instead of adjusting the input embeddings. This saves compute resources since TLM pre-training is not required. + +# 3 Methodology + +# 3.1 Hierarchical Structure Information + +Hierarchical position of a sentence is represented in the proposed method as a vector of its positions at each hierarchy-level. + +$$ +S S V _ {s} = \left(a _ {s}, b _ {s}\right) \tag {1} +$$ + +Given the $s$ -th sentence within a document, its hierarchical position is formulated as a 2-dimensional vector $(a_{s}, b_{s})$ , denoted as the sentence structure vector $SSV_{s}$ , where $a_{s}$ represents the linear position of the section containing the sentence and $b_{s}$ is the linear position of the sentence within the section. All sentences within the same section have the same value in the first dimension of the SSV, indicating the close relationships between them. The second dimension indicates more precisely their + +linear relations within the section. By this very simple numerical formulation, hierarchical relations between sentences are clearly identified. + +Section titles exist in particular in long documents like scientific papers. They usually imply the section content and describe the common topic for its sub-sentences (Ostendorff et al., 2020). In our work, we propose to utilize the corresponding section title as an additional HiStruct information when encoding its sub-sentences. There exist typical section titles in scientific papers. Similar section titles like "Conclusion", "Conclusions" and "Concluding remarks" have the same semantic meaning and can be grouped into one typical section title class of "Conclusions". This is also taken into consideration when encoding the section titles. + +# 3.2 Hierarchical Structure Encoding + +Hierarchical position embedding is based on the existing linear position encoding methods (PE), including the sinusoidal method (sin) used by Transformer (Vaswani et al., 2017) and the learnable method (la) used by BERT (Devlin et al., 2019). We use one of the PEs to encode the two dimensions of a SSV respectively, resulting in two embeddings. Using the la PE, the embeddings are initialized randomly and trained with the entire summarization model. Using the sin PE, the two embeddings are calculated simply by Equations 2 and 3 as described by Vaswani et al. (2017). + +$$ +P E _ {(p o s, 2 i)} = \sin (p o s / 1 0 0 0 0 ^ {2 i / d _ {m o d e l}}) \tag {2} +$$ + +$$ +P E _ {(p o s, 2 i + 1)} = \cos (p o s / 1 0 0 0 0 ^ {2 i / d _ {m o d e l}}) \tag {3} +$$ + +where $pos$ is the value in one dimension of the SSV and $i$ is the $i$ -th dimension of the resulting embedding. + +Given the $s$ -th sentence with the hierarchical position of $(a_{s}, b_{s})$ , and the desired size of the output embeddings $d$ , the Sentence Hierarchical Position Embedding (sHE) can be generated by Equations 4, 5, 6, using different combination modes. + +$$ +s H E _ {\text {s u m}} (s, d) = P E \left(a _ {s}, d\right) + P E \left(b _ {s}, d\right) \tag {4} +$$ + +$$ +s H E _ {\text {m e a n}} (s, d) = \frac {P E \left(a _ {s} , d\right) + P E \left(b _ {s} , d\right)}{2} \tag {5} +$$ + +$$ +s H E _ {\text {c o n c a t}} (s, d) = P E \left(a _ {s}, \frac {d}{2}\right) \mid P E \left(b _ {s}, \frac {d}{2}\right) \tag {6} +$$ + +where the symbol $|$ denotes vector concatenation. + +Using one of the PEs (i.e., sin or la) associated with one of the combination modes (i.e., sum, mean or concat), it totals six different settings of + +the hierarchical position encoding method: sin-sum, sin-mean, sin-concat, la-sum, la-mean and la-concat. + +(Classified) section title embedding is generated by the same pre-trained TLM, which is involved in the summarization model. We have two options to encode section titles: section title embedding (STE) and classified section title embedding (classified STE). A section title embedding is generated by feeding the tokenized section title into the TLM and summing up the last hidden states at each token position as a single embedding. Similar section titles consisting of similar tokens lead to embeddings that are already similar to each other in some way. We also manually pre-define typical section title classes and the corresponding intraclass section titles depending on the datasets and the domains. Using the classified STE, all intraclass STEs are replaced with the embedding of its corresponding class. In the case that a section title does not belong to any class or it falls into more than one class, the original STE is used. + +# 3.3 Model Architecture + +Figure 1 illustrates the overview architecture of the proposed HiStruct+ model. The model consists of a base TLM for sentence encoding and two stacked inter-sentence Transformer layers for hierarchical learning and extractive summarization. The sequence on top is the input document, tokenized by the corresponding tokenizer of the involved TLM. The input embeddings to the TLM are the same as in the original TLM. In order to represent individual sentences, we insert a BOS token at the start of every sentence. Only the BOS token embeddings are preserved as the initial sentence representations $(S_{s})$ . Each sentence representation is first enriched with a Sentence Linear Position Embedding, which encodes its linear position within the whole document. An additional Sentence Hierarchical Position Embedding $(sHE_{s})$ can be added, which is generated by encoding the hierarchical position of the sentence using the proposed hierarchical position encoding method. If section titles are available, we can further enrich the sentence representation by adding a STE or classified STE $(STE_{s})$ . The sentence representations with the injected HiStruct information are fed to the two stacked Transformer encoder layers to learn inter-sentence document-level hierarchical contextual features. The result is a set of Hierarchical Contextual Sentence Embed + +dings $(HS_{s})$ . The final output layer is a sigmoid classifier, which calculates the confidence score $\hat{y}_s$ of including the $s$ -th sentence in the extractive summary based on the $HS_{s}$ . The loss of the summarization model is the binary classification entropy of the prediction $\hat{y}_s$ against the gold label $y_s$ . + +The two HiStruct injection components shaded in light-green are optional. Removing these from the HiStruct+ model based on BERT, the architecture is identical to BERTSUMEXT (Liu and Lapata, 2019), which is a strong baseline against our models on CNN/DailyMail. When using RoBERTa and Longformer as the base TLM, we also construct a baseline model without the two components. The comparison baselines are named as TransformerETS in this paper. The effectiveness of injecting HiStruct information using the proposed methods can be systematically investigated by comparing our HiStruct+ model to the corresponding TransformerETS baseline which uses the same base TLM and the same input length, but is unaware of the HiStruct information. + +# 4 Experimental Setup + +# 4.1 Datasets + +Our models are evaluated on three benchmark datasets for single document summarization, including CNN/DailyMail (See et al., 2017), PubMed and arXiv (Cohan et al., 2018). Table 4 presents detailed statistics of the datasets. + +The three datasets represent different document types ranging from short news articles to long scientific papers. To emphasize the difference in the hierarchical structure among different datasets, we define the concepts of hierarchical depth (hi-depth) and hierarchical width (hi-width). The hi-depth refers to the number of the hierarchy-levels within the document. Scientific papers have a deeper hierarchy consisting of sections, paragraphs, sentences and tokens (i.e., hi-depth $= 4$ ). In news articles, paragraphs are not further grouped into sections (i.e., hi-depth $= 3$ ). In this case, we use paragraphs instead of sections as the highest hierarchy level when representing the hierarchical position of sentences (i.e., the first dimension of the SSVs). The hierarchical width, hi-width = $\frac{N_s}{N_{hsh}}$ , is the ratio of total number of sentences $N_s$ and the number of the text-units regarding the highest structure hierarchy $N_{hsh}$ . It indicates how many sentences are there on average in every paragraph/section. The + +more sentences are there, the second dimension of the SSVs has a more wide range of values, and the values in the first dimension of the SSVs differ a lot from the linear sentence positions. Larger hi-depth and larger hi-width indicate that the hierarchical structure of the dataset is more conspicuous. + +We hypothesize that the proposed method works better on datasets with more conspicuous hierarchical structures, where hi-depth and hi-width are larger. This will be proved by comparing the performance improvements on the three datasets with different hierarchical characteristics. + +CNN/DailyMail is included as an exemplary dataset with less conspicuous hierarchical structure compared to PubMed and arXiv. The average hi-width over all documents is 1.33, which is much smaller than those in PubMed and arXiv. The dataset contains more than 310k news articles. We use the standard splits given by See et al. (2017) for training, validation, and testing. + +During data preprocessing, we first split documents into sentences and paragraphs respectively with the Stanford CoreNLP toolkit (Manning et al., 2014). The sentences and paragraphs are tokenized, resulting in the lists of sentence tokens and the lists of paragraph tokens. SSVs corresponding to each sentence can be obtained by comparing those lists side by side. For all three datasets, we use a greedy selection algorithm similar to Nallapati et al. (2017) and Liu and Lapata (2019) to select sentences from documents as the gold extractive summaries (ORACLE). Sentences in the ORACLE summaries are assigned with the gold label 1. + +PubMed and arXiv contain longer scientific papers. PubMed contains papers in the bio-medical domain, while arXiv contains papers in various domains. The average hi-width over all PubMed documents is 15.79, in arXiv it is 37.33. We use the original splits given by Cohan et al. (2018) for training, validation, and testing. SSVs are obtained by tokenizing the sentences and sections of every document respectively. The details on the generation of section title embeddings and classified section title embeddings can be found in Appendix A.2. + +# 4.2 Implementation Details + +We implement our model based on BERTSUMEXT (Liu and Lapata, 2019) and use HuggingFace Transformers (Wolf et al., 2020) to make use of the pretrained instances of BERT, RoBERTa and Longformer. On CNN/DailyMail, we select 3 sentences + +with Trigram Blocking. On PubMed and arXiv, 7 sentences are extracted while Trigram Blocking is not applied (see more details with regard to implementation in Appendix A.3 and A.4). + +# 5 Results and Discussion + +We evaluate the performance of our summarization models automatically using ROUGE metrics (Lin, 2004) including F1 ROUGE-1 (R1), ROUGE-2 (R2) and ROUGE-L (RL). Tables 1, 2 and 3 summarize the performance of our models in comparison to the baselines and the previously reported SOTA results on CNN/DailyMail, PubMed and arXiv respectively. On all three datasets, ablation studies are systematically conducted to investigate the contributions of different experimental settings. To analyze the output summaries from an overall perspective, we plot the distribution of the extracted sentences on each dataset and compare it to the ORACLE summaries and those outputted by the comparison baseline (see Figure 2). Appendix A.6 demonstrates human evaluation of extracted summaries for a more intuitive understanding about the superiority of the proposed system. + +# 5.1 Results on CNN/DailyMail + +ROUGE results on CNN/DailyMail are summarized in Table 1. The first three blocks highlight the results reported by the corresponding papers of abstractive, extractive, and hybrid summarization systems. The best results regarding the respective type of the summarization system are underlined. In the baselines block, the first two lines highlight the ORACLE results that build the upper bounds for extractive systems taking the same number of input tokens. The LEAD-n baselines simply select the first n sentences in a document as its extractive summary. Despite its simplicity, the LEAD-3 baseline already achieves relatively competitive performance. The three TransformerETS models are the corresponding comparison baselines that use the same model architecture and experimental settings as our models but without injected HiStruct information. The following block presents the results of our HiStruct+ models based on different TLMs with various input lengths. To make the evaluation results comparable to the SOTA extractive model BERTSUMEXT, we follow their approach and report the averaged results of three best checkpoints. + +Regardless the base TLM and input length, our HiStruct+ models collectively outperform the corre + +
Model ↓ / Metric →R1R2RL
Abstractive
BERTSUMABS (2019)41.7219.3938.76
BART (2020)44.1621.2840.90
PEGASUS (2020)44.1721.4741.11
BigBird PEGASUS (2020)43.8421.1140.74
Extractive
HIBERT (2019)
(BERT-base)42.3119.8738.78
(BERT-large)42.3719.9538.83
BERTSUMEXT (2019)
(BERT-base)43.2520.2439.63
(BERT-large)43.8520.3439.90
Hybrid
MatchSum (2020)
(BERT-base)44.2220.6240.38
(RoBERTa-base)44.4120.8640.55
Reproduced baselines
ORACLE (512 tok.)52.4630.7648.66
ORACLE (1,024 tok.)55.4532.7851.59
LEAD-340.3317.3936.56
TransformerETS
BERT-base (1,024 tok.)43.3220.2739.69
BERT-large (512 tok.)43.4520.3639.83
RoBERTa-base (1,024 tok.)43.6220.5339.99
Our models (Extractive)
HiStruct+
BERT-base (1,024 tok.)43.3820.3339.78
BERT-large (512 tok.)43.4920.40*39.90*
RoBERTa-base (1,024 tok.)43.6520.54*40.03*
Our models (Hybrid)
HiStruct+
RoBERTa-base (1,024 tok.)
& MatchSum (RoBERTa-base)44.3120.7340.47
+ +Table 1: F1 ROUGE results on CNN/DailyMail. Bold are the scores of the HiStruct+ models that are better than the corresponding TransformerETS baseline. The symbol * indicates an improvement over the corresponding SOTA ROUGE for extractive summarization. + +sponding TransformerETS baselines by merely injecting the hierarchical position information of sentences. However, the performance improvements gained by our models on CNN/DailyMail are small. One of the reasons might be that we merely inject the hierarchical position information of sentences, section titles are not available. Furthermore, as discussed in Section 4, the hierarchical structure of the CNN/DailyMail documents is not so obvious as those in PubMed and arXiv. + +Compared to the SOTA extractive model, our best HiStruct+ model produces competitive results. The R2 and RL scores are improved slightly. The model can be reused in many hybrid approaches. When we apply MatchSum based on our best + +![](images/ce66cf96b70f55a7bfe1e8a741f5c602bc1ac9c7e22015f55367a82d04303300.jpg) + +![](images/798555e76362a287f313ec6b16088cefc264bdebf3cec00864a15ac5e3d56594.jpg) +(a) CNN/DailyMail + +![](images/c335f82dc1d07824c68aaafec9f10b7189a9e16929e05fc742d169c75a43c08a.jpg) +(b) PubMed +(c) arXiv +Figure 2: Proportions of the extracted sentences at each linear position. The x-axis values are linear sentence indices, the y-axis values are percentages of the extracted sentences. In this figure, only the first 25 sentence indices are included due to space limitation. + +model, the ROUGE results are further increased. + +Ablation studies on CNN/DailyMail (see the results and detailed discussions in Appendix A.5) suggest that the setting la-sum works best for hierarchical position encoding. Two stacked Transformer layers in the summarization model perform better than one or three Transformer layers. When taking longer inputs than the length limit of the TLM, substantial improvements are achieved by using the copied token position embeddings for initialization instead of random initialization. + +The extracted summaries are analyzed in more detail by plotting the proportions of the extracted sentences at each linear position within the whole document as shown in Figure 2a. The model in green is our best-performed HiStruct+ model on CNN/DailyMail. The model in orange is the corresponding comparison baseline without injected HiStruct information. The model in blue is the ORACLE system, which produces the gold extractive summaries. We can observe that the ORACLE sum + +mary sentences are distributed across documents more smoothly, while our HiStruct+ model and the baseline model tend to select the first sentences and fail to select sentences that appear at later positions within the documents. Compared to the baseline, the HiStruct+ model leads to more similar proportions as the ORACLE summaries at the most sentence indices. + +# 5.2 Results on PubMed + +
Model ↓ / Metric →R1R2RL
Abstractive
PEGASUS (2020)45.4919.9042.42
BigBird PEGASUS (2020)46.3220.6542.33
DANCER PEGASUS (2020)46.3419.9742.42
Extractive
Sent-CLF (2020)45.0119.9141.16
Sent-PTR (2020)43.3017.9239.47
ExtSum-LG+ (2020)
RLoss45.3020.4240.95
MMR-Select+45.3920.3740.99
Hybrid
TLM-I+E(G,M) (2020)42.1316.2739.21
Reproduced baselines
ORACLE (4,096 tok.)49.7327.2945.26
ORACLE (9,600 tok.)52.8028.9548.08
ORACLE (15k tok.)53.0429.0848.31
LEAD-738.3012.5434.31
LEAD-1038.5913.0534.81
TransformerETS
Longformer-base (15k tok.)41.6915.7637.48
Longformer-large (15k tok.)41.6915.7937.49
Our models (Extractive)
HiStruct+
Longformer-base (15k tok.)
sHE+STE(classified)46.59*20.3942.11*
sHE+STE46.49*20.2942.02*
sHE45.76*19.6441.34*
Longformer-large (15k tok.)
sHE+STE(classified)46.38*20.1741.92*
sHE45.67*19.6041.26*
+ +Table 2: F1 ROUGE results on PubMed. Bold are the scores of the HiStruct+ models that are better than the corresponding TransformerETS baseline. The symbol * indicates that the corresponding SOTA ROUGE for extractive summarization is improved by our model. The symbol ’ indicates that the SOTA ROUGEs (incl. all types of summarization approaches) are outperformed. + +ROUGE results on PubMed are summarized in Table 2. As shown in the baselines block, the ORACLE upper bounds for extractive summarization are increased significantly by increasing the input length, which makes it possible to exploit potential gains from modeling longer input. The + +LEAD-n baselines do not produce competitive results on PubMed. It indicates that the first sentences in PubMed are not so informative as those in CNN/DailyMail. The last two TransformerETS models in the block are the comparison baselines that are unaware of HiStruct. + +The last block in Table 2 presents the results of two groups of HiStruct+ models, grouped by the base TLM used in the summarization model. In PubMed, we can choose to inject the sentence hierarchical position embeddings (sHEs) with or without the section title embeddings (STEs). STEs can be replaced by classified STEs. This can result in three different injection settings for a model group, namely sHE, sHE+STE, and sHE+STE(classified). For each model setting, we report the results of the best-performed checkpoint. + +Our best HiStruct+ model on PubMed is a model based on Longformer-base taking 15,000 input tokens, which injects the sHEs and the classified STEs into the extractive model. It achieves ROUGE results of 46.59/20.39/42.11, which beat the SOTA extractive model ExtSum-LG+MMR-Select+ collectively on all three ROUGE metrics with improvements of 1.2/0.02/1.12. Taking the SOTA abstractive and hybrid approaches into account, our results are still very competitive. + +All HiStruct+ models produce the competitive results that are better than or very close to the former SOTA results for extractive summarization. They also collectively outperform the TransformerETS baselines by a large margin on all evaluation metrics. The overperformance is much more substantial than that on CNN/DailyMail, even if only the hierarchical position information is injected. This supports our hypothesis that the proposed model works better on datasets with more conspicuous hierarchical structures. + +Ablation studies on PubMed suggest that the largest improvement of our models against the baseline is contributed by the hierarchical position information of sentences. This is observed when we compare the three models in the first group of HiStruct+ models with the first TransformerETS baseline. Injecting merely sHE, the results are already increased by 4.07/3.88/3.86. When the section title embedding (STE) is included additionally, the results are further increased by 0.73/0.65/0.68. When using classified STE instead, the ROUGEs are increased by a small margin of 0.1/0.1/0.09. Comparing the second group of HiStruct+ models + +to the second TransformerETS baseline, it is also observed that injecting the sHE leads to the largest performance gain. + +The extracted summaries analysis on PubMed test set is demonstrated in Figure 2b. The model in green is our best-performed HiStruct+ model on PubMed, the model in orange is the corresponding TransformerETS baseline, the model in blue is the ORACLE system. The ORACLE summaries are distributed across documents evenly. The TransformerETS baseline favors the first 5 sentences and ignores the sentences appearing at later positions. In contrast, our HiStruct+ model overcomes the problem of focusing merely on the first sentences. The outputs of the HiStruct+ model are close to the ORACLE summaries. It indicates that by injecting HiStruct information explicitly using our method, the model successfully learns the deeper internal hierarchical structure of the PubMed documents and relies less on the linear sentence positions. + +# 5.3 Results on arXiv + +ROUGE results on arXiv are summarized in Table 3. The results of the HiStruct+ models are presented in two groups. The first group takes $15\mathrm{k}$ input tokens, while the second group increases the input length to $28\mathrm{k}$ . In the groups, different injection settings are compared. + +Our best-performed HiStruct+ model on arXiv is an extractive model based on Longformer-base with 28k input tokens, injecting the sHEs with the original STEs. This model beats the results achieved by ExtSum-LG+RLoss and sets the new SOTA ROUGEs for extractive summarization on arXiv to 45.22/17.67/40.16. + +All HiStruct+ models collectively outperform the corresponding TransformerETS baselines (i.e., the last two models in the baselines block) by a large margin on all ROUGE scores. On this dataset, the HiStruct+ improvement is much more significant than those on both CNN/DailyMail and PubMed. The arXiv dataset has the largest hi-width among the three datasets and the hierarchical structure is most conspicuous, which might be the reason why the HiStruct+ models yield the largest performance improvements on arXiv. + +Ablation studies in the first HiStruct+ group also suggest that the largest improvement of our HiStruct+ model against the TransformerETS baseline is contributed by injecting the sentence hierarchical position information, which is encoded as + +
Model ↓ / Metric →R1R2RL
Abstractive
PEGASUS (2020)44.7017.2725.80
BigBird PEGASUS (2020)46.6319.0241.77
DANCER PEGASUS (2020)45.0117.6040.56
LED-large (2020)46.6319.6241.48
Extractive
Sent-CLF (2020)34.018.7130.41
Sent-PTR (2020)42.3215.6338.06
ExtSum-LG + (2020)
RLoss44.0117.7939.09
MMR-Select+43.8717.5038.97
Hybrid
TLM-I+E(G,M) (2020)41.6214.6938.03
Reproduced baselines
ORACLE (15k tok.)53.5826.1947.76
ORACLE (28k tok.)53.9726.4248.12
LEAD-1037.3710.8533.17
TransformerETS
Longformer-base (15k tok.)38.4911.5933.85
Longformer-base (28k tok.)38.4711.5633.82
Our models (Extractive)
HiStruct+
Longformer-base (15k tok.)
sHE+STE(classified)44.94*17.4239.90*
sHE+STE45.02*17.4839.94*
sHE43.0415.8738.13
Longformer-base (28k tok.)
sHE+STE(classified)45.17*17.6140.10*
sHE+STE45.22*17.6740.16*
+ +Table 3: F1 ROUGE results on arXiv. Bold are the scores of the HiStruct+ models that are better than the corresponding TransformerETS baseline. The symbol * indicates that the corresponding SOTA ROUGE for extractive summarization is improved by our model. + +sHEs. The effect of using the classified STE on arXiv is opposite to that on PubMed. The summarization performance declines slightly when we replace the STE with the classified STE. This outcome occurs in the second group of HiStruct+ models as well. We notice the fact that there are 500k unique section titles in arXiv, while PubMed contains 164k unique section titles. Accordingly, it becomes much more difficult to group a large number of section titles correctly into several section classes. Furthermore, the PubMed dataset contains papers mostly in the bio-medical domain. The structure of those papers tends to follow specific writing conventions in the bio-medical sciences. The arXiv dataset, in contrast, contains scientific papers that are not limited to a specific domain. As a consequence, the document structure and the writing styles are more diverse. + +The extracted summaries analysis on arXiv is demonstrated in Figure 2c. The baseline (in orange) tends to select the first sentence and the sentences indexed between 10 and 20, while it excludes sentences at later positions. It is clearly observed that the summary sentences extracted by the HiStruct+ model are evenly distributed, the informative sentences appearing at later positions are not ignored. + +# 6 Conclusions + +This work addresses hierarchical modeling for extractive text summarization by explicitly leveraging hierarchical structure information, including section titles, as well as hierarchical position information of the sentences. We propose an intuitive and interpretable approach to formulate, extract, encode and inject the hierarchical structure information into an extractive summarization model. + +The proposed HiStruct+ models are systematically evaluated on CNN/DailyMail, PubMed, and arXiv. On PubMed, our model increases the former SOTA ROUGEs for extractive summarization by 1.2/0.02/1.12. On arXiv, the new SOTA results for extractive summarization are set to 45.22/17.67/40.16. Our ablation studies suggest that the SOTA performance are mostly gained by providing the hierarchical position information of sentences to the summarization model. When comparing the HiStruct+ models with the baselines that are unaware of the HiStruct information, improvements are consistently observed on all three datasets under various experimental settings, indicating the effectiveness of the proposed method. Moreover, our experiments show that the more conspicuous hierarchical structure the dataset has, the larger the improvements of our method are. The proposed metrics of hi-depth and hi-width determine whether it is worth using our method by comparing the metrics of any dataset to those of the three involved datasets. + +Utilizing the HiStruct information also for abstractive summarization is subject of future work. Similarly, we see great potential in an encoder-decoder architecture with the proposed HiStruct injection components. + +# Acknowledgements + +The work presented in this article has received funding from the German Federal Ministry of Education and Research (BMBF) through the project QURA-TOR (no. 03WKDA1A). + +# References + +Dmitrii Aksenov, Julian Moreno-Schneider, Peter Bourgonje, Robert Schwarzenberg, Leonhard Hennig, and Georg Rehm. 2020. Abstractive text summarization based on language model conditioning and locality modeling. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 6680-6689, Marseille, France. European Language Resources Association. +Iz Beltagy, Matthew E. Peters, and Arman Cohan. 2020. Longformer: The long-document transformer. *ArXiv* preprint, abs/2004.05150. +Jianpeng Cheng and Mirella Lapata. 2016. Neural summarization by extracting sentences and words. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 484-494, Berlin, Germany. Association for Computational Linguistics. +Arman Cohan, Franck Dernoncourt, Doo Soon Kim, Trung Bui, Seokhwan Kim, Walter Chang, and Nazli Goharian. 2018. A discourse-aware attention model for abstractive summarization of long documents. 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 615-621, New Orleans, Louisiana. Association for Computational Linguistics. +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. +Lukasz Garncarek, Rafal Powalski, Tomasz Stanisławek, Bartosz Topolski, Piotr Halama, and Filip Gralinski. 2020. LAMBERT: layout-aware language modeling using BERT for information extraction. ArXiv preprint, abs/2002.08087. +Alexios Gidiotis and Grigorios Tsoumakas. 2020. A divide-and-conquer approach to the summarization of academic articles. ArXiv preprint, abs/2004.06190. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. 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. +Chin-Yew Lin. 2004. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pages 74-81, Barcelona, Spain. Association for Computational Linguistics. + +Yang Liu and Mirella Lapata. 2019. Text summarization with pretrained encoders. 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 3730-3740, Hong Kong, China. Association for Computational Linguistics. +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, abs/1907.11692. +Christopher Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven Bethard, and David McClosky. 2014. The Stanford CoreNLP natural language processing toolkit. In Proceedings of 52nd Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 55-60, Baltimore, Maryland. Association for Computational Linguistics. +Ramesh Nallapati, Feifei Zhai, and Bowen Zhou. 2017. Summarrunner: A recurrent neural network based sequence model for extractive summarization of documents. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA, pages 3075-3081. AAAI Press. +Malte Ostendorff, Terry Ruas, Till Blume, Bela Gipp, and Georg Rehm. 2020. Aspect-based document similarity for research papers. In Proceedings of the 28th International Conference on Computational Linguistics, pages 6194-6206, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Romain Paulus, Caiming Xiong, and Richard Socher. 2018. A deep reinforced model for abstractive summarization. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. +Jonathan Pilault, Raymond Li, Sandeep Subramanian, and Chris Pal. 2020. On extractive and abstractive neural document summarization with transformer language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9308-9319, Online. Association for Computational Linguistics. +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. +Abigail See, Peter J. Liu, and Christopher D. Manning. 2017. Get to the point: Summarization with pointer-generator networks. In Proceedings of the 55th Annual Meeting of the Association for Computational + +Linguistics (Volume 1: Long Papers), pages 1073-1083, Vancouver, Canada. Association for Computational Linguistics. +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 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998-6008. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric 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. +Wen Xiao and Giuseppe Carenini. 2019. Extractive summarization of long documents by combining global and local context. 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 3011-3021, Hong Kong, China. Association for Computational Linguistics. +Wen Xiao and Giuseppe Carenini. 2020. Systematically exploring redundancy reduction in summarizing long documents. 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 516-528, Suzhou, China. Association for Computational Linguistics. +Yiheng Xu, Minghao Li, Lei Cui, Shaohan Huang, Furu Wei, and Ming Zhou. 2020. Layoutm: Pre-training of text and layout for document image understanding. In KDD '20: The 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, CA, USA, August 23-27, 2020, pages 1192-1200. ACM. +Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontañón, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, and Amr Ahmed. 2020. Big bird: Transformers for longer sequences. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. +Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter J. Liu. 2020. PEGASUS: pre-training with extracted gap-sentences for abstractive summarization. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, + +Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 11328-11339. PMLR. +Xingxing Zhang, Furu Wei, and Ming Zhou. 2019. HIBERT: Document level pre-training of hierarchical bidirectional transformers for document summarization. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 5059-5069, Florence, Italy. Association for Computational Linguistics. +Ming Zhong, Pengfei Liu, Yiran Chen, Danqing Wang, Xipeng Qiu, and Xuanjing Huang. 2020. Extractive summarization as text matching. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6197-6208, Online. Association for Computational Linguistics. + +# A Appendix + +# A.1 Statistics of the Datasets + +
DatasetCNN/DailyMailPubMedarXiv
Raw documents
avg. #words792.242,967.225,825.68
avg. #sentences40.3186.37206.3
avg. #sections*31.25.915.55
avg. hi-width1.3315.7937.33
Raw gold summaries
avg. #words53.25202.42272
avg. #sentences3.756.859.61
Novel n-grams in gold summaries
avg. % novel
1grams13.970.20.15
2grams51.792.692.73
Nr. of documents
#train287,227119,924203,037
#val13,3686,6336,436
#test11,4906,6586,440
Documents tokenized by the RoBERTa tokenizer
avg. doc length9644,2528,991
75% doc length1,2195,38211,289
85% doc length1,4486,70914,294
99% doc length2,34515,27735,559
+ +Table 4: Statistics of the datasets. * avg. #paragraphs in CNN/DailyMail. + +The CNN/DailyMail2, PubMed and arXiv3 datasets are used in experiments. We use the original splits provided by See et al. (2017) and Cohan et al. (2018) for training, validation and testing. + +# A.2 Pre-defined Section Title Classes + +The pre-defined dictionaries of the typical section title classes and the corresponding in-class section titles are released in our GitHub project (see Section 1). There are 164,195 unique section titles in PubMed, and 500,015 in arXiv, which are encoded as section title embeddings (STE) respectively using the proposed encoding method. + +For PubMed, we define 8 section title classes: introduction, background (i.e., background, review and related work), case (i.e., case reports), method, result, discussion, conclusion and additional information (i.e., additional information such as conflicts of interest, financial support and acknowledgments). For arXiv, we define 10 classes: introduction, background, case, theory (i.e., problem formulation and proof of theorem), method, result, discussion, conclusion, reference and additional + +information. Classified STEs are prepared accordingly by replacing the original STEs of the intraclass section titles with the encoding of the section title class. + +# A.3 Implementation Details + +The learning rate schedule follows Liu and Lapata (2019) with warm-up. On CNN/DailyMail, we train the HiStruct+ models and the TransformerETS baselines 50,000 steps with 10,000 warm-up steps. On PubMed and arXiv, the models are trained 70,000 steps with 10,000 warm-up steps when taking 15,000 tokens as input. When training models on arXiv with 28,000 input tokens, we train 100,000 steps with 10,000 warm-up steps. + +The number of the extracted sentences depends on the dataset. On CNN/DailyMail, we follow Liu and Lapata (2019) to select 3 sentences for each document as its extractive summary and apply Trigram Blocking (Paulus et al., 2018) to reduce the redundancy of the selected sentences. On PubMed and arXiv, 7 sentences are extracted without Trigram Blocking. + +The length limit of the original TLM is overcome by adding extra token linear position embeddings (tPE) to cover the desired length. The additional tPE are then trained with the whole summarization model. Instead of initializing them randomly, we copy the original tPE of the TLM multiple times until the desired length is covered. + +The HiStruct+ models and the TransformerETS baselines are trained on 3 GPUs (NVIDIA® Quadro RTXTM 6000 GPUs with 24GB memory) with gradient accumulation every two steps. Checkpoints are saved and evaluated on the validation set every 1,000 steps. The top-3 checkpoints based on the validation loss are kept. The batch size varies with the base TLM and the input length. On CNN/DailyMail, the base TLM is fine-tuned with the whole summarization model. Due to resource limitation, the TLM (i.e., Longformer) is not fine-tuned when training the summarization model on PubMed and arXiv with longer inputs. + +# A.4 Model Architectures and Experimental Settings + +The detailed model architectures and experimental settings for the models trained on CNN/DailyMail, PubMed and arXiv are summarized in Table 5, Table 6 and Table 7 respectively. The detailed model architectures and experimental settings include: + +Base TLM: the Transformer language model used for sentence encoding in the summarization system. + +Input length: how many tokens are taken as input. + +Extra tPE: how to initialize the extra input token linear position embeddings when taking longer input. We can choose to randomly initialize them or copy the original ones. + +FT: whether the base TLM is fine-tuned with the entire summarization model. + +TL: the number of the Transformer layers stacked upon the base TLM for extractive summarization. + +WS: warmup steps, how many steps are used for warming-up of the learning rate. + +TS: the total training steps. + +BS: batch size, how many documents are used as one batch during training. + +AC: accumulation count, gradient accumulation every $k$ steps. + +GPU: the number of GPUs used for training, we use NVIDIA® Quadro RTXTM 6000 GPUs with 24GB memory. + +HiStruct: the injection setting. Hierarchical structure information that can be injected into the summarization model are: sHE (i.e., sentence hierarchical position embeddings), STE (i.e., section title embeddings), or STE(classified) (i.e., classified section title embeddings) + +HPE: the hierarchical position encoding method used in the model. The method is based on the sinusoidal (sin) or the learnable (la) linear position encoding method associated with a combination mode (i.e., sum/mean/concat) + +#PE: the numbers of the learned position embeddings for each hierarchy-level of the hierarchical positions and the linear sentence positions, when using the learnable position encoding method. We set them to a same value during training. + +SS: saving steps, save checkpoints every $k$ steps. + +n: select $n$ sentences as the extractive summary for each document. + +TB: trigram blocking, whether to apply Trigram Blocking during sentence selection + +# A.5 Ablation Studies on CNN/DailyMail + +The effect of token-level hierarchical position embeddings is investigated in experiments. The hierarchical position embeddings of tokens are generated as followings: + +Given the $t$ -th token within the document, its hierarchical position is represented by Equation 7: + +$$ +T S V _ {t} = \left(a _ {t}, b _ {t}, c _ {t}\right) \tag {7} +$$ + +where $a_{t}$ represents the linear position of the section which contains the token, $b_{t}$ is the sentence's position within the section and $c_{t}$ is the linear position of the token within the sentence. + +Given the $t$ -th token and the desired size of the output embeddings $d$ , its token hierarchical position embeddings (tHE) is encoded by Equations 8, 9, 10, using different combination modes. + +$$ +t H E _ {\text {s u m}} (t, d) = P E \left(a _ {t}, d\right) + P E \left(b _ {t}, d\right) + P E \left(c _ {t}, d\right) \tag {8} +$$ + +$$ +t H E _ {\text {m e a n}} (t, d) = \frac {P E \left(a _ {t} , d\right) + P E \left(b _ {t} , d\right) + P E \left(c _ {t} , d\right)}{3} \tag {9} +$$ + +$$ +t H E _ {\text {c o n c a t}} (t, d) = P E \left(a _ {t}, \frac {d}{3}\right) \left| P E \left(b _ {t}, \frac {d}{3}\right) \right| P E \left(c _ {t}, \frac {d}{3}\right) \tag {10} +$$ + +Initial experiments are conducted to assess the summarization performance of the HiStruct+ models with or without the tHE. For this purpose, we compare a HiStruct+ model merely injecting sentence hierarchical position embeddings (i.e., sHE) with a HiStruct+ model with both sentence and token hierarchical position embeddings (i.e., sHE& tHE). That is, it adds the corresponding tHEs to the input embeddings at each input position, which are fed into the TLM. It also injects sHEs into the output sentence representations. + +Table 8 summarizes the evaluation results of three groups of HiStruct+ models based on different TLM with various input lengths. In each group, all experimental settings and parameters are the same, except for the injection setting of tHE. The experimental results suggest that the HiStruct+ models with merely sHE consistently outperform the HiStruct+ models with both sHE & tHE under various circumstances. The reason might be that we directly fine-tune the TLM on the extractive summarization task. When adding extra tHE to the input embeddings to the TLM, we do not pre-train the TLM with the adjusted inputs. It is reasonable that the TLM has difficulties in understanding of the new inputs based on the knowledge learned from the original format of encoding. Previous works, such as LayoutLM (Xu et al., 2020), LamBERT (Garncarek et al., 2020) and HIBERT (Zhang et al., 2019), which adjust the input embeddings or the encoder architecture of the pre-trained TLM, continue to pre-train the TLM on their own data. Continuing pre-training of the language models is a core part of these works and leads to significant improvements on downstream tasks. Due to lack of computing resources, we are not able to pre-train the language models. Furthermore, the key goal of our work is + +
Models/SettingsBase TLMInput lengthExtra tPEBSHiStructHPE#PE
Reproduced baselines
TransformerETS
BERT-base (1,024 tok.)BERT-base1,024copied200none--
BERT-large (512 tok.)BERT-large512-100none--
RoBERTa-base (1,024 tok.)RoBERTa-base1,024copied250none--
Our models (Extractive)
HiStruct+
BERT-base (1,024 tok.)BERT-base1,024copied200sHE onlyla-sum407
BERT-large (512 tok.)BERT-large512-100sHE onlyla-sum407
RoBERTa-base (1,024 tok.)RoBERTa-base1,024copied250sHE onlyla-sum407
+ +Table 5: Detailed model architectures and experimental settings for models trained on CNN/DailyMail (also see Table 1). The settings not included in the table are the same for all models. FT: yes, TL:2, WS:10,000, TS:50,000, AC:2, GPU:3, SS:1,000, n: 3, TB:yes. + +
Models/SettingsBase TLMBSHiStructHPE#PE
Reproduced baselines
TransformerETS
Longformer-base (15k tok.)Longformer-base500none--
Longformer-large (15k tok.)Longformer-large256none--
Our models (Extractive)
HiStruct+
Longformer-base (15k tok.)
sHE+STE(classified)Longformer-base500sHE+STE(classified)la-sum450
sHE+STELongformer-base500sHE+STEla-sum450
sHELongformer-base500sHE onlyla-sum450
Longformer-large (15k tok.)
sHE+STE(classified)Longformer-large256sHE+STE(classified)la-sum450
sHELongformer-large256sHE onlyla-sum450
+ +Table 6: Detailed model architectures and experimental settings for models trained on PubMed (also see Table 2). The settings not included in the table are the same for all models. Input length: 15,000; Extra tPE: copied; FT: no; TL:2; WS:10,000; TS:70,000; AC:2; GPU:3; SS:1,000; n: 7; TB:no. + +to experiment with various methods to make use of the internal hierarchical text structure information for extractive summarization. In this work, we conduct further experiments without token-level hierarchical position information and leave for future work the pre-training of language models with the adjusted input embeddings. + +The effect of different settings for hierarchical position encoding is investigated. As explained previously, based on different position encoding (PE) methods (i.e., sin or la) associated with various combination modes (i.e., sum, mean or concat), we have totally six different settings for hierarchical position encoding: sin-sum, sin-mean, sin-concat, la-sum, la-mean and la-concat. We investigate the effect of those 6 encoding settings systematically in experiments while keeping the rest settings and parameters the same, so that the evaluation results are comparable. + +Table 9 summarizes the evaluation results of six HiStruct+ models using the six encoding + +settings respectively, which are all trained on CNN/DailyMail based on BERT-base with 1,024 input tokens, injecting merely sHE. We observe that when using the la method, the combination mode sum leads to better results compared to the other modes (see the first three columns in Table 9). When using the sin method, the various combination modes do not make a conspicuous difference in summarization performance. The sum and concat modes perform slightly better. When using the sum mode, the la and the sin methods produce similar results (see the first row in Table 9). + +The effect of the encoding settings la-sum vs. sin-sum is further investigated in experiments. As discussed above, the encoding settings la-sum and sin-sum lead to similar results. We conduct experiments to further investigate the effect of using these methods. We also compare our HiStruct+ models with the corresponding TransformerETS baseline which differs from our models only in that it does not take into account extra HiStruct information. + +
Models/SettingsBase TLMInput lengthTSBSHiStructHPE#PE
Reproduced baselines
TransformerETS
Longformer-base (15k tok.)Longformer-base15,00070,000500none--
Longformer-base (28k tok.)Longformer-base28,000100,000500none--
Our models (Extractive)
HiStruct+
Longformer-base (15k tok.)
sHE+STE(classified)Longformer-base15,00070,000500sHE+STE(classified)la-sum720
sHE+STELongformer-base15,00070,000500sHE+STEla-sum720
sHELongformer-base15,00070,000500sHE onlyla-sum720
Longformer-base (28k tok.)
sHE+STE(classified)Longformer-base28,000100,000500sHE+STE(classified)la-sum1300
sHE+STELongformer-base28,000100,000500sHE+STEla-sum1300
+ +Table 7: Detailed model architectures and experimental settings for models trained on arXiv (also see Table 3). The settings not included in the table are the same for all models. Extra tPE: copied; FT: no; TL:2; WS:10,000; AC:2; GPU:3; SS:1,000; n: 7; TB:no. + +
Experimental ResultsR1R2RL
BERT-base (512 tok.)
HiStruct(sHE)+43.2320.1539.65
HiStruct(sHE&tHE)+40.7618.0337.08
BERT-base (1,024 tok.)
HiStruct(sHE)+43.3820.3339.78
HiStruct(sHE&tHE)+41.0418.2537.41
BERT-large (512 tok.)
HiStruct(sHE)+43.4620.439.85
HiStruct(sHE&tHE)+40.5817.7136.83
+ +Table 10 includes the ROUGEs of three set of comparison models, which use different TLM with various input lengths. In each group, the first model is the baseline without HiStruct injection. The second model and the third model differ from each other only with regard to the encoding setting. The experimental results suggest that both of the settings improve the summarization performance of the baseline model. It is also observed that the la-sum method outperforms the sin-sum method slightly on CNN/DailyMail. The differences are not substantial. + +The effect of the number of the stacked Transformer layers is investigated in our experiments. We fine-tune an extended BERT-base model with 1,024 input tokens for extractive summarization. We construct the HiStruct+ models with 1, 2, + +Table 8: Ablation study on CNN/DailyMail (a). Comparison of HiStruct+ models with/without token-level hierarchical position embeddings (tHE). The models in different blocks are based on different TLMs with various input lengths. Underlined are the best ROUGEs in each block. + +
la PEsin PE
R1R2RLR1R2RL
HiStruct+BERT-base (1,024 tok.)
sum43.3820.3339.7843.3720.2739.75
mean43.3320.3139.7343.3320.2839.72
concat43.2220.1839.6143.3720.2939.74
+ +Table 9: Ablation study on CNN/DailyMail (b). Comparison of HiStruct+ models using various hierarchical position encoding methods based on the sinusoidal or the learnable PE method, associated with the combination modes of sum, mean and concat respectively. Underlined are the best ROUGEs in each block. + +3 stacked Transformer layers respectively, while keeping all other settings the same. The results of those three HiStruct+ models are reported in the first block in Table 11. It is suggested that two stacked Transformer layers perform best in our HiStruct+ models for extractive summarization. + +The effect of different initialization strategies for the additional input Token Linear Position Embeddings is also investigated in experiments. When taking input texts longer than the original input length of the base TLM, we need to add extra Token Linear Position Embeddings (tPE) for each extended position. We can choose to randomly initialize the extra tPE or copy the original ones to cover the extended input length. To investigate the effect of different initialization strategies, we use the basic settings of the HiStruct+ model with two summarization layers, namely the second model in the first block in Table 11. To build the comparison model, only the initialization strategy is changed to random. As shown in the second block in Table + +
Experimental ResultsR1R2RL
BERT-base (1,024 tok.)
TransformerETS43.3220.2739.69
HiStruct(la-sum)+43.3820.3339.78
HiStruct(sin-sum)+43.3720.2739.75
BERT-large (512 tok.)
TransformerETS43.4520.3639.83
HiStruct(la-sum)+43.4920.439.9
HiStruct(sin-sum)+43.4620.439.85
RoBERTa-base (1,024 tok.)
TransformerETS43.6220.5339.99
HiStruct(la-sum)+43.6520.5440.03
HiStruct(sin-sum)+43.6420.5640.02
+ +Table 10: Ablation study on CNN/DailyMail (c). Comparison of the TransformerETS baseline and the HiStruct+ models using the la-sum and sin-sum settings for hierarchical position encoding respectively. The models in different blocks are based on different TLMs with various input lengths. Underlined are the best ROUGEs in each block. + +
Experimental ResultsR1R2RL
HiStruct(sHE)+ BERT-base (1,024 tok.)
-#Transformer layers for summarization
143.2920.2539.69
243.3720.2739.75
343.1620.1539.56
-Extra Token Linear Position Embeddings (tPE)
Randomly initialized40.5317.7636.8
Copied43.3720.2739.75
-With/without Sentence Linear Position Embeddings (sPE)
With sPE43.3720.2739.75
Without sPE43.3120.2539.69
+ +Table 11: Ablation study on CNN/DailyMail (d). The first block deals with the variation of the numbers of inter-sentence Transformer layers stacked on top of the TLM. The second block deals with the different methods to initialize extra input Token Linear Position Embeddings when taking longer input. The third block deals with the effect of Sentence Linear Position Embeddings. Underlined are the best ROUGEs in each block. + +11, substantial improvements are achieved by using the copied tPEs for initialization instead of random initialization. ROUGE-1, ROUGE-2 and ROUGE-L are increased by 2.84, 2.51 and 2.95 respectively. + +The effect of the Sentence Linear Position Embeddings is also investigated in experiments. As shown in Figure 1, besides the hierarchical positions of each sentence, we also take the linear position of each sentence within the whole document + +into account by adding a Sentence Linear Position Embedding (sPE) to each sentence representation. We assess the effect of the sPE by comparing two HiStruct+ models with or without the sPE. The second model in the first block in Table 11 is compared to a model that differs from it only in the injection of sPE. The results are shown in the third block in Table 11. The HiStruct+ model with sPE outperforms the HiStruct+ model without sPE by a small margin regarding all ROUGE metrics. + +# A.6 Human Evaluation of Extracted Summaries + +To have a more intuitive understanding about the superiority of the proposed system, we showcase two samples in Figure 3 for human evaluation and case analysis. The extractive summaries predicted by the HiStruct+ model and the baseline model are demonstrated respectively, in comparison with the gold summary (i.e., the abstract of the paper). To construct a final summary, top-7 sentences with the highest scores predicted by the model are extracted, and then combined in their original order. + +The first arXiv sample shows that the baseline simply selects the first sentences. The predicted summary focuses on detailed background knowledge and lacks an overview of the proposed work. In contrast, our HiStruct+ model selects sentences at later positions. The first five sentences introduce the main content and the entire proceeding of the work from an overall perspective. The last two sentences draw conclusions and give an outlook to future work, which is indicated by the phrases highlighted in green. + +The PubMed sample also indicates that the baseline favors the first sentences, which is consistent with our observations in Figure 2. Although the last two sentences highlight the same conclusion as in the gold summary that locally informed diagnosis and treatment strategies are needed, too much background information is unnecessarily included in the first five sentences. Our HiStruct+ model selects more informative sentences at later positions. The predicted summary covers all key parts of the gold summary: 1). the statistics are reported (i.e., $26\%$ of primary tuberculosis (tb) was multidrug resistant (mdr)); 2). the novel strain s256 is mentioned; 3). the conclusion is highlighted. The overall topic of the work is especially highlighted by the sentence with the green-colored phrase. + +
Dataset: arXivTransformerETS BaselineHiStruct+
Abstract (i.e., the gold summary)in this work, we have used an effective field theory ( eft ) framework based on heavy quark spin ( hqss ) , heavy flavour ( hfs ) and heavy antiquark - diquark symmetries ( hads ) . using a standard lagrangian for the heavy meson - heavy antimeson system , we fit the counter - terms of the model to predict some promising experimental data that can be interpreted as heavy meson - heavy antimeson molecules , that is , the @xmath0 and the @xmath1 .<q>next , and , taking advantage of hads , we use the same lagrangian to explore the consequences for heavy meson - doubly heavy baryon molecules , which can also be interpreted as triply heavy pentaquarks .
Selected Sentence Indices[0, 1, 2, 3, 4, 5, 6][5, 6, 7, 8, 9, 26, 27]
Predicted Extractive Summarysince the mid 1970 s the existence of heavy hadronic molecules ( composed by a pair of heavy hadrons instead of a pair of heavy quarks ) has been theorized@xcite .<q>this assumption was made based on the similarities between the heavy meson - heavy antimeson system and the deuteron .<q>however , it was not until the discovery of the @xmath0@xcite by the belle collaboration , in 2003 , that the first experimental data that could fit into that molecular scheme was found .<q>since then , many other xyz states have been found , being the @xmath1 also natural candidates to have a molecular structure ... besides , the @xmath2 limit of qcd simplifies the theory so a set of symmetries are induced .<q>probably , the most important symmetries induced in this limit are hqss , hfs , and hads .<q>we make use of them , along with the assumptions of the @xmath0 and the @xmath1 to be heavy hadronic molecules , to obtain a family of heavy meson - doubly heavy baryons that could also be interpreted as triply heavy pentaqquarks .<q>this proceeding is organized as follows .we make use of them , along with the assumptions of the @xmath0 and the @xmath1 to be heavy hadronic molecules , to obtain a family of heavy meson - doubly heavy baryons that could also be interpreted as triply heavy pentaqquarks .<q>this proceeding is organized as follows .<q>first we briefly introduced our eft based on hqss and hfs that we will use in the analysis of the @xmath0 and the @xmath1 .<q>second , we will discuss hads and its implications .<q>finally , our results will be shown in table [ tab : predictions ] .<q>as a summary , we can conclude that our analysis based on several qcd symmetries in the @xmath17 limit predicts the existence of several heavy meson - doubly heavy baryon molecular partners of the @xmath0 and the @xmath1 .<q>this same effective field theory approach could also be extended to study doubly heavy baryon - double heavy antibaryon molecular systems In the future
+ +
Dataset: PubMedTransformerETS BaselineHiStruct+
Abstract (i.e., the gold summary)of 235 mycobacterium tuberculosis isolates from patients who had not received tuberculosis treatment in the irkutsk oblast and the sakha republic (yakutia), eastern siberia, 61 (26%) were multidrug resistant. <q>a novel strain, s 256, clustered among these isolates and carried eis - related kanamycin resistance, indicating a need for locally informed diagnosis and treatment strategies.
Selected Sentence Indices[0, 1, 2, 3, 4, 39, 40][25, 26, 27, 37, 38, 39, 40]
Predicted Extractive Summaryfrom november 2008 through may 2010, m. tuberculosis isolates were cultured during routine care of adults > 18 years of age with primary tb and no history of treatment. <q>the patients were from 2 regional referral centers, the irkutsk regional tb - prevention dispensary and the research practice center for phthisiatry (yakutia); the study was approved by the institutional review boards at the university of virginia and irkutsk state medical university. <q>initial pretreatment isolates were grown on lowenstein - jensen agar slants and identified to species in accordance with world health organization recommendations. <q>drug susceptibility was tested by absolute concentration method on agar slants; drugs tested were rifampin (critical concentration 40 g / ml), isoniazid (1 g / ml and 10 g / ml), ethambutol (2 g / ml), streptomycin (10 g / ml), ethionamide (30 g / ml), and kanamycin (30 g / ml). <q>dna extraction was performed on all isolates, followed by 12-loci mycobacterial interspersed repetitive unit <q>the regionally distinct phylogenetic patterns and certain drug - resistance mutations necessitate careful application of novel diagnostics and empiric therapeutic strategies. <q>phylogenetic trees of mycobacterium tuberculosis from patients with primary tuberculosis, yakutia and irkutsk, russian federation.in eastern siberia, > 25% of primary tb was mdr, equivalent to the highest proportion reported from the russian federation (2) <q> however, regionally specific genotypic patterns and resistance mutations were identified . as expected , in irkutsk primary mdr tb <q>was driven by strains of beijing lineage (5,6). yet in the more geographically isolated population of yakutia, a strain previously unidentified in the russian federation, s 256, had a miru profile recently found among canadian aboriginal populations (11). in yakutia, <q>furthermore, lack of conventional fluoroquinolone or pyrazinamide susceptibility testing limited comparison with gyra and pnca mutations , respectively . despite these limitations , <q> this work characterizes severe isoniazid monoresistant and mdr tb in eastern siberia among patients with no history of tb treatment <q>the regionally distinct phylogenetic patterns and certain drug - resistance mutations necessitate careful application of novel diagnostics and empiric therapeutic strategies. <q>phylogenetic trees of mycobacterium tuberculosis from patients with primary tuberculosis, yakutia and irkutsk, russian federation.
+ +Figure 3: Two samples for human evaluation and case analysis of the extractive summaries predicted by the HiStruct+ model and the baseline model, in comparison with the gold summary (i.e., the abstract of the paper). The first sample is selected from the arXiv dataset, while the second sample is from PubMed. Top-7 sentences with the highest predicted scores are extracted, and then combined in their original order to construct a final summary. Their linear indices within the original document are shown in the second row of each table. The texts highlighted in yellow are the key words and the main content that appear in the gold summary. The phrases highlighted in green indicate typical parts of a scientific paper such as summation and future work. Sentences are split by $<\mathbf{q}>$ . \ No newline at end of file diff --git a/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/images.zip b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9015d368d4785d474ae177ac10b3420fa05dd4b6 --- /dev/null +++ b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e239834fb272c1bb10b63701fc9cefccd56f33c31b3f91c84d32ded4aaf8a835 +size 1469132 diff --git a/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/layout.json b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..99a45f93676cbea2dd41c5224ba67ec269c56da4 --- /dev/null +++ b/histructimprovingextractivetextsummarizationwithhierarchicalstructureinformation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a7d23cff1baacecc4c45476036899efb8e84d2817bb9951f88414f6bf0d6f25 +size 411646 diff --git a/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_content_list.json b/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..db20dcf7ef984eac678892337fd439ad780ff59c --- /dev/null +++ b/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0e87f0d287dcd818a08099cdde2b47b0ddde84b4a0048a5353f4d443cd986fb +size 104351 diff --git a/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_model.json b/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4890c97ebcb803ad812c1b026f5233ce8ff39fe5 --- /dev/null +++ b/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e4f12fb1d29acece9a7af504b3c0fca4092284e48d96062a6191c71cff78c5e +size 120763 diff --git a/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_origin.pdf b/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c28f8534516a090aab2d212abd59a2a7d8757868 --- /dev/null +++ b/hldchindilegaldocumentscorpus/c29ca9e1-024b-4153-a979-1a4f931e4e28_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38e77947001d792cdbdac30f0b38df5cddd894f38af80dbe8ca536c1be87556d +size 2146709 diff --git a/hldchindilegaldocumentscorpus/full.md b/hldchindilegaldocumentscorpus/full.md new file mode 100644 index 0000000000000000000000000000000000000000..11383e95f34e9578482d76af2f7dae9a4fa8efb4 --- /dev/null +++ b/hldchindilegaldocumentscorpus/full.md @@ -0,0 +1,412 @@ +# HLDC: Hindi Legal Documents Corpus + +Arnav Kapoor†, Mudit Dhawan‡, Anmol Goel†, T.H. Arjun†, Akshala Bhatnagar‡, Vibhu Agrawal‡, Amul Agrawal†, Arnab Bhattacharya¶, Ponnurangam Kumaraguru†, Ashutosh Modi¶* †IIT Hyderabad, ‡IIIT Delhi, ¶IIT Kanpur + +{arnav.kapoor,anmol.goel,arjun.thekoot}@research.iit.ac.in {mudit18159,akshalal8012,vibhu18116}@iiitd.ac.in,amul.agrawal@students.iit.ac.in, arnabb@cse.iitk.ac.in, pk.guru@iiit.ac.in, ashutoshm@cse.iitk.ac.in + +# Abstract + +Many populous countries including India are burdened with a considerable backlog of legal cases. Development of automated systems that could process legal documents and augment legal practitioners can mitigate this. However, there is a dearth of high-quality corpora that is needed to develop such data-driven systems. The problem gets even more pronounced in the case of low resource languages such as Hindi. In this resource paper, we introduce the Hindi Legal Documents Corpus (HLDC), a corpus of more than 900K legal documents in Hindi. Documents are cleaned and structured to enable the development of downstream applications. Further, as a use-case for the corpus, we introduce the task of bail prediction. We experiment with a battery of models and propose a Multi-Task Learning (MTL) based model for the same. MTL models use summarization as an auxiliary task along with bail prediction as the main task. Experiments with different models are indicative of the need for further research in this area. We release the corpus and model implementation code with this paper: https://github.com/Exploration-Lab/HLDC. + +# 1 Introduction + +In recent times, the legal system in many populous countries (e.g., India) has been inundated with a large number of legal documents and pending cases (Katju, 2019). There is an imminent need for automated systems to process legal documents and help augment the legal procedures. For example, if a system could readily extract the required information from a legal document for a legal practitioner, then it would help expedite the legal process. However, the processing of legal documents is challenging and is quite different from conventional text processing tasks. For example, legal documents are typically quite long (tens of pages), + +highly unstructured and noisy (spelling and grammar mistakes since these are typed), use domain-specific language and jargon; consequently, pretrained language models do not perform well on these (Malik et al., 2021b). Thus, to develop legal text processing systems and address the challenges associated with the legal domain, there is a need for creating specialized legal domain corpora. + +In recent times, there have been efforts to develop such corpora. For example, Chalkidis et al. (2019) have developed an English corpus of European Court of Justice documents, while Malik et al. (2021b) have developed an English corpus of Indian Supreme Court documents. Xiao et al. (2018) have developed Chinese Legal Document corpus. However, to the best of our knowledge, there does not exist any legal document corpus for the Hindi language (a language belonging to the Indo-European family and pre-dominantly spoken in India). Hindi uses Devanagari script (Wikipedia contributors, 2021) for the writing system. Hindi is spoken by approximately 567 million people in the world (WorldData, 2021). Most of the lower (district) courts in northern India use Hindi as the official language. However, most of the legal NLP systems that currently exist in India have been developed on English, and these do not work on Hindi legal documents (Malik et al., 2021b). To address this problem, in this paper, we release a large corpus of Hindi legal documents (HINDI LEGAL DOCUMENTS CORPUS or HLDC) that can be used for developing NLP systems that could augment the legal practitioners by automating some of the legal processes. Further, we show a use case for the proposed corpus via a new task of bail prediction. + +India follows a Common Law system and has a three-tiered court system with District Courts (along with Subordinate Courts) at the lowest level (districts), followed by High Courts at the state level, and the Supreme Court of India at the high- + +est level. In terms of number of cases, district courts handle the majority. According to India's National Judicial Data Grid, as of November 2021, there are approximately 40 million cases pending in District Courts (National Judicial Data Grid, 2021) as opposed to 5 million cases pending in High Courts. These statistics show an immediate need for developing models that could address the problems at the grass-root levels of the Indian legal system. Out of the 40 million pending cases, approximately 20 million are from courts where the official language is Hindi (National Judicial Data Grid, 2021). In this resource paper, we create a large corpus of 912,568 Hindi legal documents. In particular, we collect documents from the state of Uttar Pradesh, the most populous state of India with a population of approximately 237 million (PopulationU, 2021). The Hindi Legal Documents Corpus (HLDC) can be used for a number of legal applications, and as a use case, in this paper, we propose the task of Bail Prediction. + +Given a legal document with facts of the case, the task of bail prediction requires an automated system to predict if the accused should be granted bail or not. The motivation behind the task is not to replace a human judge but rather augment them in the judicial process. Given the volume of cases, if a system could present an initial analysis of the case, it would expedite the process. As told to us by legal experts and practitioners, given the economies of scale, even a small improvement in efficiency would result in a large impact. We develop baseline models for addressing the task of bail prediction. + +In a nutshell, we make the following main contributions in this resource paper: + +- We create a Hindi Legal Documents Corpus (HLDC) of 912,568 documents. These documents are cleaned and structured to make them usable for downstream NLP/IR applications. Moreover, this is a growing corpus as we continue to add more legal documents to HLDC. We release the corpus and model implementation code with this paper: https://github.com/Exploration-Lab/HLDC. +- As a use-case for applicability of the corpus for developing legal systems, we propose the task of Bail Prediction. +- For the task of bail prediction, we experiment with a variety of deep learning models. We propose a multi-task learning model based on trans + +former architecture. The proposed model uses extractive summarization as an auxiliary task and bail prediction as the main task. + +# 2 Related Work + +In recent years there has been active interest in the application of NLP techniques to the legal domain (Zhong et al., 2020a). A number of tasks and models have been proposed, inter alia, Legal Judgment Prediction (Chalkidis et al., 2019), Legal Summarization (Bhattacharya et al., 2019; Tran et al., 2019), Prior Case Retrieval (Jackson et al., 2003; Shao et al., 2020), Legal Question Answering (Kim and Goebel, 2017), Catchphrase Extraction (Galgani et al., 2012), Semantic Segmentation (Kalamkar et al., 2022; Malik et al., 2021a). + +Legal Judgement Prediction (LJP) involves predicting the final decision from the facts and arguments of the case. Chalkidis et al. (2019) released 11,478 cases from the European Court of Human Rights (ECHR). It contains facts, articles violated (if any), and the importance scores. Malik et al. (2021b) provided 34,816 case documents from the Supreme Court of India for the prediction task. Strickson and De La Iglesia (2020) published 4,959 documents from the U.K.'s Supreme court (the highest court of appeal). + +Majority of corpora for Legal-NLP tasks have been in English; recently, there have been efforts to address other languages as well, for example, Xiao et al. (2018), have created a large-scale Chinese criminal judgment prediction dataset with over 2.68 million legal documents. Work on Legal-NLP in languages other than English is still in its incipient stages. Our paper contributes towards these efforts by releasing corpus in Hindi. + +Majority of the work in the legal domain has focused on the higher court (Malik et al., 2021b; Strickson and De La Iglesia, 2020; Zhong et al., 2020b); however, the lower courts handle the maximum number of cases. We try to address this gap by releasing a large corpus of district court level legal documents. + +Some of the recent work has explored other Legal-NLP tasks in languages other than English. Chalkidis et al. (2021) released a multilingual dataset of 65K European Union (E.U.) laws for topic classification of legal documents. The data was translated into the 23 official E.U. languages and annotated with labels from the multilingual thesaurus, EUROVOC. Luz de Araujo et al. (2018) + +![](images/1ec1dbb16e9ddee72115f1b2214067d9226c1523dfb3b4b7c05e78d04d0d61da.jpg) +Figure 1: HLDC corpus creation pipeline + +have released 70 documents in Portuguese for Legal Named Entity Recognition. The dataset contains specific tags for law and legal cases entities in addition to the normal tags for named entities like person, locations, organisation and time-entities. COLIEE (Competition on Legal Information Extraction/Entailment) tasks (Kano et al., 2019, 2017) have published legal data in Japanese, along with their English translation. The competition has two sub-tasks, a legal information retrieval task and an entailment identification task between law articles and queries. Multiple datasets in Chinese have been released for different tasks, namely Reading Comprehension (Duan et al., 2019), Similar Case Matching (Xiao et al., 2019), Question Answering (Zhong et al., 2020b). Duan et al. (2019) proposed Chinese judicial reading comprehension (CJRC) dataset with about 10K documents and almost 50K questions with answers. Zhong et al. (2020b) presented JECQA, a legal question answering dataset collected from the National Judicial Examination of China with about 26K multiple-choice questions. They augment the dataset with a database containing the legal knowledge required to answer the questions and also assign meta information to each of the questions for in-depth analysis. Xiao et al. (2019) proposed CAIL2019-SCM, a dataset containing 8,964 triplets of the case document, with the objective to identify which two cases are more similar in the triplets. Similar case matching has a crucial application as it helps to identify comparable historical cases. A historical case with similar facts often serves as a legal precedent and influences the judgement. Such historical information can be used to make the legal judgement prediction models more robust. + +Kleinberg et al. (2017) proposed bail decision prediction as a good proxy to gauge if machine learning can improve human decision making. A large number of bail documents along with the binary decision (granted or denied) makes it an ideal task for automation. In this paper, we also propose the bail prediction task using the HLDC corpus. + +# 3 Hindi Legal Documents Corpus + +Hindi Legal Documents Corpus (HLDC) is a corpus of 912,568 Indian legal case documents in the Hindi language. The corpus is created by downloading data from the e-Courts website (a publicly available website: https://districts.ecourts.gov.in/). All the legal documents we consider are in the public domain. We download case documents pertaining to the district courts located in the Indian northern state of Uttar Pradesh (U.P.). We focus mainly on the state of U.P. as it is the most populous state of India, resulting in the filing of a large number of cases in district courts. U.P. has 71 districts and about 161 district courts. U.P. is a predominantly Hindi speaking state, and consequently, the official language used in district courts is Hindi. We crawled case documents from all districts of U.P. corresponding to cases filed over two years, from May 01, 2019 to May 01, 2021. Figure 2 shows the map of U.P. and district wise variation in the number of cases. As can be seen in the plot, the western side of the state has more cases; this is possibly due to the high population and more urbanization in the western part. Table 1 shows $\%$ -wise division of different case types in HLDC. As evident from the table, majority of documents pertain to bail applications. HLDC corpus has a total of 3,797,817 unique tokens, and on average, each document has 764 tokens. + +HLDC Creation Pipeline: We outline the entire pipeline used to create the corpus in Figure 1. The documents on the website are originally typed in Hindi (in Devanagari script) and then scanned to PDF format and uploaded. The first step in HLDC creation is the downloading of documents from the e-Courts website. We downloaded a total of 1,221,950 documents. To extract Hindi text from these, we perform OCR (Optical Character Recognition) via the Tesseract tool1. Tesseract worked well for our use case as the majority of case documents were well-typed, and it out + +![](images/8589e46531881de77920689e322a6cdd0ffbf2c24e2e200e078edc67d4245820.jpg) +Figure 2: Variation in number of case documents per district in the state of U.P. Prominent districts are marked. + +performed other OCR libraries2. The obtained text documents were further cleaned to remove noisy documents, e.g. too short (< 32 bytes) or too long (> 8096 bytes) documents, duplicates, and English documents (details in Appendix B). This resulted in a total of 912,568 documents in HLDC. We anonymized the corpus with respect to names and locations. We used a gazetteer3 along with regex-based rules for NER to anonymize the data. List of first names, last names, middle names, locations, titles like पाड़ल (Pandit: title of Priest), सरेश्ती (Sir: Sir), month names and day names were normalized to <नाम> (Naam: ). The gazetteer also had some common ambiguous words (these words can be names or sometimes verbs) like पाड़ल्ता (Prathna: Can refer to prayer, the action of request or name), रायया (Gaya: can refer to location name or verb), किकया (Kiya: can refer to infinitive ‘to do’ or name), रिलया (Liya: can refer to infinitive ‘to take’ or name). These were removed. Further, we ran RNN-based Hindi NER model4 on a subset of documents to find additional entities and these were subsequently used to augment our gazetteer (details Appendix C). Phone numbers were detected using regex patterns and replaced with a <कोगा-तन्दा> () tag, numbers written in both English and Hindi were considered. + +Legal documents, particularly in lower courts, are highly unstructured and lack standardization with respect to format and sometimes even the terms used. We converted the unstructured doc + +
Case Type% in HLDC
Bail Applications31.71
Criminal Cases20.41
Original Suits6.54
Warrant or Summons in Criminal Cases5.24
Complaint Cases4.37
Civil Misc3.4
Final Report3.32
Civil Cases3.23
Others (Matrimonial Cases, Session21.75
Trial, Motor Vehicle Act, etc.)
+ +Table 1: Case types in HLDC. Out of around 300 different case types, we only show the prominent ones. Majority of the case documents correspond to bail applications. + +![](images/53cf3e4a370a240fc6a3cfe3b628d4a0ee4219274bddaea9950e3649405eef19.jpg) +Figure 3: Ratio of number of bail applications to total number of applications in U.P. + +uments to semi-structured documents. We segmented each document into a header and a body. The header contains the meta-information related to the case, for example, case number, court identifier, and applicable sections of the law. The body contains the facts of the case, arguments, judge's summary, case decision and other information related to the final decision. The documents were segmented using regex and rule based approaches as described in Appendix D. + +Case Type Identification: HLDC documents were processed to obtain different case types (e.g., Bail applications, Criminal Cases). The case type was identified via the meta-data that comes with each document. However, different districts use a variation of the same case type name (e.g., Bail Application vs Bail App.). We resolved these standardization issues via manual inspection and regex-based patterns, resulting in a final list of 300 unique case types. + +Lexical Analysis: Although Hindi is the official language, U.P. being a large and populous + +![](images/389e338242a4d48d4984262b72920913f1c03c1d6882ce59734200f29f0a77dd.jpg) +Figure 4: Bail Corpus Creation Pipeline + +state, has different dialects of Hindi spoken across the state. We found evidence of this even in official legal documents. For example, the word जिक्ति (Sakin: motionless) appears 11,614 times in the dataset, $63.8\%$ occurrences of the word come from 6 districts of East U.P. (Ballia, Azamgarh, Maharajganj, Deoria, Siddharthnagar and Kushinagar). This particular variant of motionless being used most often only in East U.P. Similarly, the word नोल्वागीय (Gaushiya: cow and related animals) is mostly used in North-Western UP (Rampur, Pilibhit, Jyotiba Phule Nagar (Amroha), Bijnor, Budaun, Bareilly, Moradabad). Three districts - Muzaffarnagar, Kanshirarnagar and Pratapgarh district constitute $81.5\%$ occurrences of the word दिल्ल (Dand: punishment). These districts are, however, spread across UP. An important thing to note is that words corresponding to specific districts/areas are colloquial and not part of the standard Hindi lexicon. This makes it difficult for prediction model to generalize across districts $(\S 7)$ . + +Corpus of Bail Documents: Bail is the provisional release of a suspect in any criminal offence on payment of a bail bond and/or additional restrictions. Bail cases form a large majority of cases in the lower courts, as seen in Table 1. Additionally, they are very time-sensitive as they require quick decisions. For HLDC, the ratio of bail documents to total cases in each district is shown in Figure 3. As a use-case for the corpus, we further investigated the subset of the corpus having only the bail application documents (henceforth, we call it Bail Corpus). + +Bail Document Segmentation: For the bail documents, besides the header and body, we further segmented the body part into more subsections (Figure 4). Body is further segmented into Facts and Arguments, Judge's summary and Case Result. Facts contain the facts of the case and the defendant and prosecutor's arguments. Most of the bail documents have a concluding paragraph where the judge summarizes their viewpoints of the case, and this constitutes the judge's summary sub-section. The case result sub-section contains the final decision given by the + +judge. More details about document segmentation are in Appendix D. + +Bail Decision Extraction: Decision was extracted from Case Result Section using a rule based approach (Details in Appendix E). + +Bail Amount Extraction: If bail was granted, it usually has some bail amount associated with it. We extracted this bail amount using regex patterns (Details in Appendix F). + +We verified each step of the corpus creation pipeline (Detailed analysis in Appendix G) to ensure the quality of the data. We initially started with 363,003 bail documents across all the 71 districts of U.P., and after removing documents having segmentation errors, we have a Bail corpus with 176,849 bail documents. The bail corpus has a total of 2,342,073 unique tokens, and on average, each document has 614 tokens. A sample document segmented into various sections is shown in Appendix I. + +# 4 HLDC: Ethical Aspects + +We create HLDC to promote research and automation in the legal domain dealing with under-researched and low-resource languages like Hindi. The documents that are part of HLDC are in the public domain and hence accessible to all. Given the volume of pending cases in the lower courts, our efforts are aimed towards improving the legal system, which in turn would be beneficial for millions of people. Our work is in line with some of the previous work on legal NLP, e.g., legal corpora creation and legal judgement prediction (section 2). Nevertheless, we are aware that if not handled correctly, legal AI systems developed on legal corpora can negatively impact an individual and society at large. Consequently, we took all possible steps to remove any personal information and biases in the corpus. We anonymized the corpus (section 3) with respect to names, gender information, titles, locations, times, judge's name, petitioners and appellant's name. As observed in previous work (Malik et al., 2021b), anonymization of a judge's name is important as there is a correlation between a case outcome and a judge + +name. Along with the HLDC, we also introduce the task of Bail Prediction. Bail applications constitute the bulk of the cases (§3), augmentation by an AI system can help in this case. The bail prediction task aims not to promote the development of systems that replace humans but rather the development of systems that augment humans. The bail prediction task provides only the facts of the case to predict the final decision and avoids any biases that may affect the final decision. Moreover, the Bail corpus and corresponding bail prediction systems can promote the development of explainable systems (Malik et al., 2021b), we leave research on such explainable systems for future work. The legal domain is a relatively new area in NLP research, and more research and investigations are required in this area, especially concerning biases and societal impacts; for this to happen, there is a need for corpora, and in this paper, we make initial steps towards these goals. + +# 5 Bail Prediction Task + +To demonstrate a possible applicability for HLDC, we propose the Bail Prediction Task, where given the facts of the case, the goal is to predict whether the bail would be granted or denied. Formally, consider a corpus of bail documents $\mathcal{D} = b_{1},b_{2},\dots ,b_{i}$ , where each bail document is segmented as $b_{i} = (h_{i},f_{i},j_{i},y_{i})$ . Here, $h_i,f_i,j_i$ and $y_{i}$ represent the header, facts, judge's summary and bail decision of the document respectively. Additionally, the facts of every document contain $k$ sentences, more formally, $f_{i} = (s_{i}^{1},s_{i}^{2},\dots ,s_{i}^{k})$ , where $s_i^k$ represents the $k^{th}$ sentence of the $i^{th}$ bail document. We formulate the bail prediction task as a binary classification problem. We are interested in modelling $p_{\theta}(y_i|f_i)$ , which is the probability of the outcome $y_{i}$ given the facts of a case $f_{i}$ . Here, $y_{i}\in \{0,1\}$ , i.e., 0 if bail is denied or 1 if bail is granted. + +# 6 Bail Prediction Models + +We initially experimented with off-the-shelf pretrained models trained on general-purpose texts. However, as outlined earlier (§1), the legal domain comes with its own challenges, viz. specialized legal lexicon, long documents, unstructured and noisy texts. Moreover, our corpus is from an under-resourced language (Hindi). Nevertheless, we experimented with existing fine-tuned (pre-trained) models and finally propose a multi- + +task model for the bail prediction task. + +# 6.1 Embedding Based Models + +We experimented with classical embedding based model Doc2Vec (Le and Mikolov, 2014) and transformer-based contextualized embeddings model IndicBERT (Kakwani et al., 2020). Doc2Vec embeddings, in our case, is trained on the train set of our corpus. The embeddings go as input to SVM and XgBoost classifiers. IndicBERT is a transformer language model trained on 12 major Indian languages. However, IndicBERT, akin to other transformer LMs, has a limitation on the input's length (number of tokens). Inspired by Malik et al. (2021b); Chalkidis et al. (2019), we experimented with fine-tuning IndicBERT in two settings: the first 512 tokens and the last 512 tokens of the document. The fine-tuned transformer with a classification head is used for bail prediction. + +# 6.2 Summarization Based Models + +Given the long lengths of the documents, we experimented with prediction models that use summarization as an intermediate step. In particular, an extractive summary of a document goes as input to a fine-tuned transformer-based classifier (IndicBERT). Besides reducing the length of the document, extractive summarization helps to evaluate the salient sentences in a legal document and is a step towards developing explainable models. We experimented with both unsupervised and supervised extractive summarization models. + +For unsupervised approaches we experimented with TF-IDF (Ramos, 2003) and TextRank (a graph based method for extracting most important sentences) (Mihalcea and Tarau, 2004). For the supervised approach, inspired by Bajaj et al. (2021), we propose the use of sentence salience classifier to extract important sentences from the document. Each document $(b_{i} = (h_{i},f_{i},j_{i},y_{i})$ $\S 5)$ comes with a judge's summary $j_{i}$ . For each sentence in the facts of the document $(f_i)$ we calculate it's cosine similarity with judge's summary $(j_{i})$ Formally, salience of $k^{th}$ sentence $s_i^k$ is given by: salience $(s_i^k) = \cos (h_{j_i},h_{s_i^k})$ . Here $h_ji$ is contextualized distributed representation for $j_{i}$ obtained using multilingual sentence encoder (Reimers and Gurevych, 2020). Similarly, $h_{s_i^k}$ is the representation for the sentence $s_i^k$ . The cosine similarities provides ranked list of sentences and we select top + +![](images/5e7a09602dd54e155d946919cfba30f7c6d82f83abc44e08067027fbe9768a40.jpg) +Figure 5: Overview of our multi-task learning approach. + +$50\%$ sentences as salient. The salient sentences are used to train (and fine-tune) IndicBERT based classifier. + +# 6.3 Multi-Task Learning (MTL) Model + +As observed during experiments, summarization based models show improvement in results (§7). Inspired by this, we propose a multi-task framework (Figure 5), where bail prediction is the main task, and sentence salience classification is the auxiliary task. The intuition is that predicting the important sentences via the auxiliary task would force the model to perform better predictions and vice-versa. Input to the model are sentences corresponding to the facts of a case: $s_i^1, s_i^2, \ldots, s_i^k$ . A multilingual sentence encoder (Reimers and Gurevych, 2020) is used to get contextualized representation of each sentence: $\{h_i^1, h_i^2, \dots, h_i^k\}$ . In addition, we append the sentence representations with a special randomly initialized CLS embedding (Devlin et al., 2019) that gets updated during model training. The CLS and sentence embeddings are fed into standard single layer transformer architecture (shared transformer). + +# 6.3.1 Bail Prediction Task + +A classification head (fully connected layer MLP) on the top of transformer CLS embedding is used to perform bail prediction. We use standard cross-entropy loss $(L_{\text{bail}})$ for training. + +# 6.3.2 Salience Classification Task + +We use the salience prediction head (MLP) on top of sentence representations at the output of the shared transformer. For training the auxiliary task, we use sentence salience scores obtained via cosine similarity (these come from supervised summarization based model). For each sentence, we + +
GrantedDismissedTotal
All DistrictsTrain77010 (62%)46732 (38%)123742
Test21977 (62%)13423 (38%)35400
Validation11067 (63%)6640 (37%)17707
District WiseTrain77220 (62%)47121 (38%)124341
Validation9563 (60%)6366 (40%)15929
Test23271 (64%)13308 (36%)36579
+ +Table 2: Number of documents across each split + +use binary-cross entropy loss ( $L_{salience}$ ) to predict the salience. + +Based on our empirical investigations, both the losses are equally weighted, and total loss is given by $L = L_{\text{bail}} + L_{\text{salience}}$ + +# 7 Experiments and Results + +# 7.1 Dataset Splits + +We evaluate the models in two settings: all-district performance and district-wise performance. For the first setting, the model is trained and tested on the documents coming from all districts. The train, validation and test split is 70:10:20. The district-wise setting is to test the generalization capabilities of the model. In this setting, the documents from 44 districts (randomly chosen) are used for training. Testing is done on a different set of 17 districts not present in train set. The validation set has another set of 10 districts. This split corresponds to a 70:10:20 ratio. Table 2 provides the number of documents across splits. The corpus is unbalanced for the prediction class with about 60:40 ratio for positive to negative class (Table 2). All models are evaluated using standard accuracy and F1-score metric (Appendix H.1). + +Implementation Details: All models are trained using GeForce RTX 2080Ti GPUs. Models are + +
Model NameDistrict-wiseAll Districts
Acc.F1Acc.F1
Doc2Vec + SVM0.720.690.790.77
Doc2Vec + XGBoost0.680.590.670.57
IndicBert-First 5120.650.620.730.71
IndicBert-Last 5120.620.600.780.76
TF-IDF+IndicBert0.760.740.820.81
TextRank+IndicBert0.760.740.820.81
Salience Pred.+IndicBert0.760.740.800.78
Multi-Task0.780.770.800.78
+ +Table 3: Model results. For TF-IDF and TextRank models we take the sum of the token embeddings. + +tuned for hyper-parameters using the validation set (details in Appendix H.2). + +# 7.2 Results + +The results are shown in Table 3. As can be observed, in general, the performance of models is lower in the case of district-wise settings. This is possibly due to the lexical variation (section 3) across districts, which makes it difficult for the model to generalize. Moreover, this lexical variation corresponds to the usage of words corresponding to dialects of Hindi. Another thing to note from the results is that, in general, summarization based models perform better than Doc2Vec and transformer-based models, highlighting the importance of the summarization step in the bail prediction task. The proposed end-to-end multi-task model outperforms all the baselines in the district-wise setting with $78.53\%$ accuracy. The auxiliary task of sentence salience classification helps learn robust features during training and adds a regularization effect on the main task of bail prediction, leading to improved performance than the two-step baselines. However, in the case of an all-district split, the MTL model fails to beat simpler baselines like TF-IDF+IndicBERT. We hypothesize that this is due to the fact that the sentence salience training data may not be entirely correct since it is based on the cosine similarity heuristic, which may induce some noise for the auxiliary task. Additionally, there is lexical diversity present across documents from different districts. Since documents of all districts are combined in this setting, this may introduce diverse sentences, which are harder to encode for the salience classifier, while TF-IDF is able to look at the distribution of words across all documents and districts to extract salient sentences. + +# 7.3 Error Analysis + +We did further analysis of the model outputs to understand failure points and figure out improvements to the bail prediction system. After examining the miss-classified examples, we observed the following. First, the lack of standardization can manifest in unique ways. In one of the documents, we observed that all the facts and arguments seemed to point to the decision of bail granted. Our model also gauged this correctly and predicted bail granted. However, the actual result of the document showed that even though initially bail was granted because the accused failed to show up on multiple occasions, the judge overturned the decision and the final verdict was bail denied. In some instances, we also observed that even if the facts of the cases are similar the judgements can differ. We observed two cases about the illegal possession of drugs that differed only a bit in the quantity seized but had different decisions. The model is trained only on the documents and has no access to legal knowledge, hence is not able to capture such legal nuances. We also performed quantitative analysis on the model output to better understand the performance. Our model outputs a probabilistic score in the range $\{0,1\}$ . A score closer to 0 indicates our model is confident that bail would be denied, while a score closer to 1 means bail granted. In Figure 6 we plot the ROC curve to showcase the capability of the model at different classification thresholds. ROC plots True Positive and False Positive rates at different thresholds. The area under the ROC curve (AUC) is a measure of aggregated classification performance. Our proposed model has an AUC score of 0.85, indicating a high-classification accuracy for a challenging problem. + +We also plot (Figure 7) the density functions corresponding to True Positive (Bail correctly granted), True Negative (Bail correctly dismissed), False Positive (Bail incorrectly granted) and False Negatives (Bail incorrectly dismissed). We observe the correct bail granted predictions are shifted towards 1, and the correct bail denied predictions are shifted towards 0. Additionally, the incorrect samples are concentrated near the middle $(\approx 0.5)$ , which shows that our model was able to identify these as borderline cases. + +![](images/416f48173301597c727401b10b746f0b55c49f29a604301bf3942a8a08ad01eb.jpg) +Figure 6: ROC curve for the proposed model. The total AUC (Area under curve) is 0.85. + +![](images/1220c38033844c131b82cec42efe5910c15c2d871b2d47329130f81d25ef4487.jpg) +Figure 7: Kernel Density Estimate (KDE) plots of our proposed bail prediction model. The majority of errors (incorrectly dismissed / granted) are borderline cases with model output score around 0.5. + +# 8 Future Work and Conclusion + +In this paper, we introduced a large corpus of legal documents for the under-resourced language Hindi: Hindi Legal Documents Corpus (HLDC). We semi-structure the documents to make them amenable for further use in downstream applications. As a use-case for HLDC, we introduce the task of Bail Prediction. We experimented with several models and proposed a multi-task learning based model that predicts salient sentences as an auxiliary task and bail prediction as the main + +task. Results show scope for improvement that we plan to explore in future. We also plan to expand HLDC by covering other Indian Hindi speaking states. Furthermore, as a future direction, we plan to collect legal documents in other Indian languages. India has 22 official languages, but for the majority of languages, there are no legal corpora. Another interesting future direction that we would like to explore is the development of deep models infused with legal knowledge so that model is able to capture legal nuances. We plan to use the HLDC corpus for other legal tasks such as summarization and prior case retrieval. + +# 9 Acknowledgements + +This paper is dedicated to T.H. Arjun, who contributed towards making this research possible, you will be remembered! We would like to thank Prof. Angshuman Hazarika and Prof. Shouvik Kumar Guha for their valuable suggestions and for guiding us regarding the technical aspects of the Indian legal system. The author Ashutosh Modi would like to acknowledge the support of Google Research India via the Faculty Research Award Grant 2021. This project was partially supported by iHub at IIIT Hyderabad, project O2-001. + +# References + +Ahsaas Bajaj, Pavitra Dangati, Kalpesh Krishna, Pradhiksha Ashok Kumar, Rheeya Uppaal, Bradford Windsor, Eliot Brenner, Dominic Dotterrer, Rajarshi Das, and Andrew McCallum. 2021. Long document summarization in a low resource setting using pretrained language models. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing: Student Research Workshop, pages 71-80, Online. Association for Computational Linguistics. +Paheli Bhattacharya, Kaustubh Hiware, Subham Rajgaria, Nilay Pochhi, Kripabandhu Ghosh, and Saptarshi Ghosh. 2019. A Comparative Study of Summarization Algorithms Applied to Legal Case Judgments. In Leif Azzopardi, Benno Stein, Norbert Fuhr, Philipp Mayr, Claudia Hauff, and Djoerd Hiemstra, editors, Advances in Information Retrieval, volume 11437, pages 413-428. Springer International Publishing, Cham. +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. + +Ilias Chalkidis, Manos Fergadiotis, and Ion Androutsopoulos. 2021. MultiEURLEX - a multi-lingual and multi-label legal document classification dataset for zero-shot cross-lingual transfer. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6974-6996, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +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. +Xingyi Duan, Baoxin Wang, Ziyue Wang, Wentao Ma, Yiming Cui, Dayong Wu, Shijin Wang, Ting Liu, Tianxiang Huo, Zhen Hu, Heng Wang, and Zhiyuan Liu. 2019. CJRC: A Reliable Human-Annotated Benchmark DataSet for Chinese Judicial Reading Comprehension. In Maosong Sun, Xuanjing Huang, Heng Ji, Zhiyuan Liu, and Yang Liu, editors, Chinese Computational Linguistics, volume 11856, pages 439-451. Springer International Publishing, Cham. +Filippo Galgani, Paul Compton, and Achim Hoffmann. 2012. Towards automatic generation of catchphrases for legal case reports. In Proceedings of the 13th International Conference on Computational Linguistics and Intelligent Text Processing - Volume Part II, CIC Ling'12, page 414-425, Berlin, Heidelberg. Springer-Verlag. +Peter Jackson, Khalid Al-Kofahi, Alex Tyrrell, and Arun Vachher. 2003. Information extraction from case law and retrieval of prior cases. Artificial Intelligence, 150(1):239-290. AI and Law. +Divyanshu Kakwani, Anoop Kunchukuttan, Satish Golla, Gokul N.C., Avik Bhattacharyya, Mitesh M. Khapra, and Pratyush Kumar. 2020. IndicNLPSuite: Monolingual corpora, evaluation benchmarks and pre-trained multilingual language models for Indian languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4948-4961, Online. Association for Computational Linguistics. +Prathamesh Kalamkar, Aman Tiwari, Astha Agarwal, Saurabh Karn, Smita Gupta, Vivek Raghavan, and Ashutosh Modi. 2022. Corpus for automatic structuring of legal documents. CoRR, abs/2201.13125. +Yoshinobu Kano, Mi-Young Kim, Randy Goebel, and Ken Satoh. 2017. Overview of coliee 2017. In COL-IEE@ICAIL. +Yoshinobu Kano, Mi-Young Kim, Masaharu Yoshioka, Yao Lu, Juliano Rabelo, Naoki Kiyota, Randy + +Goebel, and Ken Satoh. 2019. COLIEE-2018: Evaluation of the Competition on Legal Information Extraction and Entailment. In Kazuhiro Kojima, Maki Sakamoto, Koji Mineshima, and Ken Satoh, editors, New Frontiers in Artificial Intelligence, volume 11717, pages 177-192. Springer International Publishing, Cham. +Justice Markandey Katju. 2019. Backlog of cases crippling judiciary. https://tinyurl.com/v4xu6mvk. +Mi-Young Kim and Randy Goebel. 2017. Two-step cascaded textual entailment for legal bar exam question answering. In Proceedings of the 16th edition of the International Conference on Artificial Intelligence and Law, pages 283–290, London United Kingdom. ACM. +Jon Kleinberg, Himabindu Lakkaraju, Jure Leskovec, Jens Ludwig, and Sendhil Mullainathan. 2017. Human Decisions and Machine Predictions*. The Quarterly Journal of Economics. +Quoc Le and Tomas Mikolov. 2014. Distributed representations of sentences and documents. In Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32, ICML'14, page II-1188-II-1196. JMLR.org. +Pedro H. Luz de Araujo, Teófilo E. de Campos, Renato R. R. de Oliveira, Matheus Stauffer, Samuel Couto, and Paulo Bermejo. 2018. LeNER-Br: a dataset for named entity recognition in Brazilian legal text. In International Conference on the Computational Processing of Portuguese (PROPOR), Lecture Notes on Computer Science (LNCS), pages 313-323, Canela, RS, Brazil. Springer. +Vijit Malik, Rishabh Sanjay, Shouvik Kumar Guha, Shubham Kumar Nigam, Angshuman Hazarika, Arnab Bhattacharya, and Ashutosh Modi. 2021a. Semantic segmentation of legal documents via rhetorical roles. CoRR, abs/2112.01836. +Vijit Malik, Rishabh Sanjay, Shubham Kumar Nigam, Kripabandhu Ghosh, Shouvik Kumar Guha, Arnab Bhattacharya, and Ashutosh Modi. 2021b. ILDC for CJPE: Indian legal documents corpus for court judgment prediction and explanation. 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 4046-4062, Online. Association for Computational Linguistics. +Rada Mihalcea and Paul Tarau. 2004. Textrank: Bringing order into text. In Proceedings of the 2004 conference on empirical methods in natural language processing, pages 404-411. +National Judicial Data Grid. 2021. National judicial data grid statistics. https://www.njdg.ecourts.gov.in/njdgnew/index.php. + +PopulationU. 2021. Population of uttar pradesh. https://www/populationu.com/in/ uttar-pradesh-population. +Juan Enrique Ramos. 2003. Using tfidf to determine word relevance in document queries. +Nils Reimers and Iryna Gurevych. 2020. Making monolingual sentence embeddings multilingual using knowledge distillation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4512-4525, Online. Association for Computational Linguistics. +Yunqiu Shao, Jiaxin Mao, Yiqun Liu, Weizhi Ma, Ken Satoh, Min Zhang, and Shaoping Ma. 2020. BERT-PLI: Modeling Paragraph-Level Interactions for Legal Case Retrieval. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, pages 3501-3507, Yokohama, Japan. International Joint Conferences on Artificial Intelligence Organization. +Benjamin Strickson and Beatrix De La Iglesia. 2020. Legal Judgement Prediction for UK Courts. In Proceedings of the 2020 The 3rd International Conference on Information Science and System, pages 204-209, Cambridge United Kingdom. ACM. +Vu Tran, Minh Le Nguyen, and Ken Satoh. 2019. Building legal case retrieval systems with lexical matching and summarization using a pre-trained phrase scoring model. In Proceedings of the Seventeenth International Conference on Artificial Intelligence and Law, ICAIL '19, page 275-282, New York, NY, USA. Association for Computing Machinery. +Wikipedia contributors. 2021. Devanagari — Wikipedia, the free encyclopedia. [Online; accessed 10-November-2021]. +WorldData. 2021. World data info: Hindi. https://www.worlddata.info/ languages/hindi.php. +Chaojun Xiao, Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Zhiyuan Liu, Maosong Sun, Yansong Feng, Xianpei Han, Zhen Hu, Heng Wang, et al. 2018. Cail2018: A large-scale legal dataset for judgment prediction. arXiv preprint arXiv:1807.02478. +Chaojun Xiao, Haoxi Zhong, Zhipeng Guo, Cunchao Tu, Zhiyuan Liu, Maosong Sun, Tianyang Zhang, Xianpei Han, Zhen Hu, Heng Wang, and Jianfeng Xu. 2019. Cail2019-scm: A dataset of similar case matching in legal domain. ArXiv, abs/1911.08962. +Haoxi Zhong, Chaojun Xiao, Cunchao Tu, Tianyang Zhang, Zhiyuan Liu, and Maosong Sun. 2020a. How does NLP benefit legal system: A summary of legal artificial intelligence. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5218-5230, Online. Association for Computational Linguistics. + +Haoxi Zhong, Chaojun Xiao, Cunchao Tu, Tianyang Zhang, Zhiyuan Liu, and Maosong Sun. 2020b. Jecqa: A legal-domain question answering dataset. In Proceedings of AAAI. + +# Appendix + +# A Data Statistics + +
DistrictNumber of Bail Applications
Muzaffarnagar17234
Moradabad16219
Budaun14533
Sitapur14478
Saharanpur10838
+ +Table 4: Top 5 districts with most number of bail applications in UP. + +# B Data Cleaning and Filtering + +1,221,950 documents were scraped from Ecourts website and 309,382 documents were removed in the cleaning and filtering process. Following rules were used to remove documents. + +- Removed blank documents (whose length is less than 32 bytes) +- Removed duplicate documents +- Removed too long and too short documents (>8096 bytes or <2048 bytes). +- Removed document where majority text was in English language. + +This resulted in 912,568 filtered case documents that constitute the Hindi Legal Document Corpus. + +# C NER Removal + +For removing names and locations, lookup was done in lists containing NER. Libraries like HindiNLP5 (which uses SequenceTagger from flair library6 which is based on an RNN model) were run on a subset of the data to find additional NER that were added to the lists. Since the Sequence-Tagger model is quite slow in processing documents, directly tagging large HLDC is not efficient. If a word was found in one of these lists then it was replaced with a tag. Phone numbers were replaced with () tag using the following regex + +$$ +\begin{array}{l} ((\backslash + *) ((0 [ - ] *) * | ((9 1)) *)) ((\backslash d \{1 2 \}) \\ + \left| (\backslash d \{1 0 \}) +)\right) \mid \backslash d \{5 \} ([ - ] *) \backslash d \{6 \} \\ \end{array} +$$ + +Phone numbers written in Hindi were also considered by using the same regex as above with English digits replaced with Hindi ones. + +# D Document Segmentation + +Out of 912,568 documents in HLDC, 340,280 were bail documents, these were further processed to obtain the Bail Document corpus. Bail documents were structured into different sections. We extracted these sections from the bail documents. Details are mentioned below. An example of document with different sections is shown in Table 10. + +# D.1 Header + +Header refers to the meta data related to the case, for example, दिल्लि (IPC (Indian Penal Code) sections), दिल्लि (police station), case number, date of hearing, accused name, etc. Header is present at the top of the document. Header mostly ended with दिल्लि (IPC) or दिल्लि (police station) details. Hence, in order to cut the document to get header, we first find the indices of दिल्लि (IPC) and दिल्लि (police station), and from these indices we find the finishing word of the header. We then segment the document at the finishing word. We also include the first line of upcoming paragraph in header as it also didn't contain case arguments but contained data like if this is the first bail application or not. + +# D.2 Case Result + +Case Result refers to the end of the document where judge writes their decision. Judge either accepts the bail application or rejects it. If the judge had accepted the bail document then this section mostly also contains bail amount and bail terms for accused. + +We observed that result section mostly began along the following line, निकार्योति के समामस्ति नतुयोति को दिल्ली वर (looking at all facts of the case), the keyword नतुयोति (facts) was very common around the start of the result section. Hence, we iterated over the indices of keyword नतुयोति (facts) in reverse order and checked if the division at that index is correct. To check if the division is correct we look for bail result in lower half of the division, if the bail result is present, we classify that division as correct else we move to next index of नतुयोति (facts). + +# D.3 Body + +The remaining portion of the document after removing header and result section was called body. Body section was further divided, as described below. + +# D.3.1 Judge's summary + +Most of the bail documents have a concluding paragraph where the judge summarizes their viewpoints of the case. To extract this, we first constructed certain regex which often precedes judge's summary, defendant's and prosecutor's arguments (described in Table 5). Since the document might have intermingling of different arguments and opinions, we opted for sentence level annotation of these labels using the regex pattern. The sentences not matching any criteria are given a tag of None. Next we try to replace the None by extending the tags of the sentences to paragraph level as long as no other tag is encountered. As the judge's opinion mostly occurs at the end, we start iterating from end and start marking the None as judge's opinion. If a label which is neither None nor judge's opinion is encountered, the document is discarded as we cannot extract the judge's opinion from the document using the process defined. If the judge's opinion label is found in reverse iteration, then we claim that judge's opinion can be extracted. Finally, all sentences labelled as judge's opinion either during reverse iteration or during paragraph level extension are extracted out as judge's summary and rest of the sentences form facts and opinions for further modelling. Using the above process, following are some cases where the judge's opinion cannot be extracted: + +1. Certain characters were mis-identified in the OCR pipeline and hence do not match the regex. +2. The segmentation of document into header, body and result caused a significant portion of the body and thus judge's opinion to move to result section. +3. The document was written from judge's perspective and hence judge's summary also contains the prosecutor's and defendant's arguments. +4. The regex didn't have $100\%$ coverage. + +# D.3.2 Facts and Arguments + +This section comprised of facts related to case, arguments from defendant and prosecutor. Mostly, this corresponds to the portion of the body after removing judge's summary. + +# E Extracting Bail Decision from Result + +To extract the bail decision we searched for keywords in result section. Keywords like वरिक्त + +
FieldHindi phrasesEnglish Translations
Judge's Summaryअवस्थयपान्दिके को वकहस्मुन्ति, प्रधानावली कोअवस्थलाकिना, कोकेयमूड़यरी मेअवस्थलाकिना सापावयकेअनुस्तार, मामालि कोत्तध्या वपरिकावलिया मेपरी रतरह से सपाषट, प्रधानमूकृना रियाटट, पूपलिया प्रधान...परांधाललन्दियाHearing the arguments of the parties, perusal of the records, as per the evidence available in the case diary, fully clear from the facts and circumstances of the case, First Information Report, Police Forms ...perused
Prosecutorजमानानल का वकहस्मुन्ति, कोत्तध्या अधियय-लजन्ति को अधियय वकहमूकृना रियाटा वपरिकावलिया मेपरी रतरह से सपाषट, प्रधानमूकृना रियाटा प्रधान...परांधाललन्दियाOpposing the bail, it has been argued on behalf of the prosecution, the objection against the bail application
Defendantअवस्थयपान्दिके को वकहस्मुन्ति,अधियानलाकिना कोत्तध्या वकहमूकृना रियाटा वपरिकावलिया मेपरी रतरह से सपाषट, प्रधानमूकृना रियाटा प्रधान...परांधाललन्दियाThe learned counsel for the accused has argued, has been falsely and enmity implicated in this case
+ +Table 5: Phrases used to construct regular expression for extracting judge's opinion. The list is just an indicative of the various phrases and variants used; the entire list can be found in code + +(Dismissed) and निरैय (invalidated) identified rejection of bail application and words like सन्दोकार (accepted) identified acceptance of bail application. Table 6 lists all the tokens used for extraction. + +# F Extracting Bail Amount from Result + +In case of granted bail decision, the judge specifies bail amount. We saw that the bail amount mostly comprises of personal bond money and surety money. There can be multiple personal bonds and sureties. The bail amount we extracted refers to the sum of all the personal bond money. Bail amount was present in two forms in result section, numerical and Hindi-text. Numerical bail amount was extracted by regex matching and text bail amount was extracted by creating a mapping for it. Table 8 shows few examples of bail mapping. + +# G HLDC Pipeline Analysis + +We used a validation set (0.1% of data) to evaluate our regex based approaches, the results are in Table 7. Note that metrics used for evaluation are + +
FieldTokens
Bail granted tokens₹र्षेयकर किमया जल्ता (is being accepted)₹र्षेयकर कल्लाहे (by accepting)₹र्षेयकर किमया जल्ता (accepted)₹र्षा किमया जल्ता कार अनुर्शि रिंगा जल्ता (ordered to be released)₹र्षेयकर किमया जल्ता जल्ताहे (deserves to be accepted)प्रधाड अनुर्शि प्रतिल वर्षाहे (sufficient evidence found)प्रधाड अनुर्शि प्रतिल वर्षाहे (I see sufficient evidence)प्रधाड अनुर्शि प्रतिल वर्षाहे (sufficient evidence there)प्रधाड अनुर्शि प्रतिल वर्षाहे (we see sufficient evidence)₹र्षा किमया जल्ता कार अनुर्शि रिं�ा जल्ता (ordered to be released)₹र्षा किमया जल्ता (should be released)₹र्षा किमया जल्ता (should be released)प्रधाड अनुर्शि प्रतिल वर्षा (should be released)₹र्षा किमया जल्ता (should be released)₹र्षा किमया जल्ता (should be released)₹र्षा किमया जल्ता (should be released)
Bail denied tokens₹र्षेयकर किमया जल्ता (is canceled)₹र्षेयकर किमया जल्ता (are canceled)₹र्षेयकर किमया जल्ता (are canceled)₹र्षेय़ि किमया जल्ता (is broken)₹र्षेय़ि किमया जल्ता (are broken)प्रधाड अनुर्शि प्रतिल वर्षाहे (insufficient evidence)प्रधाड अनुर्शि प्रतिल वर्षाहे (insufficient evidence)₹र्षेय़ि किमया जल्ता (is rejected)अपर्वोकर (denied)
+ +quite strict and hence the results are much lower for Judge's summary part. The segmentation and Judge's opinion were strictly evaluated and even a single sentence in the wrong segment reduces the accuracy. We also see that the main binary label of outcome detection (bail granted or denied) had an almost perfect accuracy of $99.4\%$ . Nevertheless, in future we plan to improve our pipeline further by training machine learning models. + +Table 6: Bail decision tokens + +
ProcessAccuracy
Header, Body and Case Result Segmentation89.7%
Judge's Opinion and Facts extraction85.7%
Bail Decision Extraction99.4%
+ +Table 7: Evaluation results of bail document division and bail decision extraction pipeline. + +
Text AmountIn Value Form
5-5 ूहजार +बूलस-बूलस ूहजार +पध्वलस-पध्वलस ूहजार +तीलस-तीलस ूहजार +...10000 +40000 +50000 +60000 +...
+ +# H Model Details + +# H.1 Evaluation Metrics + +To evaluate the performance of all the models, we use Accuracy, and F1-score, which are considered + +Table 8: Text bail amount mapping example + +
ModelHyper-Parameters (L=Learning Rate), (E=Epochs), (D=Embedding Dimension(Default 200)), (W=Weight Decay), (E=Epochs(Default 15))
District-wise SplitAll Districts Split
Doc2Vec + SVME=100E=100
Doc2Vec + XGBoostE=100, D=300E=100, D=300
IndicBert - (First 512 Tokens)L=3.69 × 10-6, W=2.6 × 10-2L=1.58 × 10-6, W=4.8 × 10-2
IndicBert - (Last 512 Tokens)L=5.60 × 10-5, W=1.0 × 10-2L=2.18 × 10-5, W=4.3 × 10-2
TF-IDF + IndicBertL=1.11 × 10-5, W=1.9 × 10-2L=9.84 × 10-6, W=4.9 × 10-2
TextRank + IndicBertL=3.17 × 10-6, W=3.1 × 10-2L=3.99 × 10-6, W=1.5 × 10-2
SaliencePred. + IndicBertL=1 × 10-5, W=3.2 × 10-2L=4.2 × 10-6, W=1.7 × 10-2
Multi-TaskE=30, L=5 × 10-5E=30, L=1 × 10-5
+ +Table 9: Listing of Hyper-Parameters for Training of Models + +standard evaluation metrics while performing classification experiments. These are mathematically described as the follows: + +$$ +A c c u r a c y = \frac {T P + T N}{T P + T N + F P + F N} +$$ + +$$ +F _ {1} S c o r e = \frac {2 * P r e c i s i o n * R e c a l l}{P r e c i s i o n + R e c a l l} +$$ + +where TP, FP, TN, and FN denote True Positives, False Positives, True Negatives, and False Negatives, respectively. The mathematical formulation for Precision and Recall is given as follows: + +$$ +P r e c i s i o n = \frac {T P}{T P + F P} +$$ + +$$ +R e c a l l = \frac {T P}{T P + F N} +$$ + +# H.2 Hyperparameter Tuning + +We used Optuna $^{7}$ for hyperparameter optimisation. Optuna allows us to easily define search spaces, select optimisation algorithms and scale with easy parallelization. We run parameter tuning on $10\%$ of the data to identify the best parameters before retraining the model with the best parameters on the entire dataset. The best parameters are listed in Table 9. + +I Sample Segmented Document + +
FieldExampleTranslation
Header: This chunk of the document contains meta information related to the case like court hearing date, IPC sections attached, police station of complaint, etc.Nāyāyāvalakhy āvīśāryā Nāyāyāvalaījāra (Lāsāmṛśo) / Lāsāmṛśo/ 4438/ 2020 C.N.R.No. UPAD01008173-2020 अधिकावर्षेश् रूकृप्रति प्रधाना सल्लया-4438/ 2020 C.N.R.No. UPAD01008173-2020 अधिकावर्षेश् रूकृप्रति प्रधाना सल्लया-4438/ 2020 C.N.R.No. UPAD01008173-2020 अ�र्षेश् रूकृप्रति प्रधाना सल्लया-4438/ 2020 C.N.R.No. UPAD01008173-2020 अधिकावर्षेश् रूकृप्रति प्रधाना सल्लया-44438/ 2020 C.N.R.No. UPAD01008173-2020 अधिकावर्षेश् रूकृप्रति प्रधाना सल्लया-4438/ 2020 C.N.R.No. UPAD01008173-2020 अ�स्थोर्षेश् रूकृप्रति प्रधाना सल्लया-4438/ 2020 C.N.R.No. UPAD01008173-2020 अधिकावर्षेश् रूकृ�या जूकृप्रति प्रधाना सल्लया-473/ 2020 अधिकावर्षेश् रूकृ�या-376, 504 v 506 अधिकावर्षेश् रूकृ�या-3(2)V अधिकावर्षेश् रूकृ�या/ अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकुमावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रूकृ�या-506 अधिकावर्षेश् रु़िी दिगे तन्दावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रूकृ�या +506 अधिकावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रु़िी दिगे तन्दावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रूकृ�या- +506 अधिकावर्षेश् रू邦ावर्षेश् रू邦ावर्षेश् +506 अधिकावर्षेश् रू邦ावर्षेश् +506 अधिकावर्षेश् रू邦ावर्षेश् +506 अधिकावर्षेश् रू邦ावर्षेश् +506 अधिकावर्षेश् यूकृ�या +506 अधिकावर्षेश् रू邦ावर्षेश् +506 अधिकावर्षेश् यू邦ावर्षेश् +506 अधिकावर्षेश् यू邦ावर्षेश् +506 अधिकावर्षेश् यू邦ावर्षेश् +506 अधिकावर्षेश् यू邦ावर्षे�<|im_start|>Court Special Judge (SC, / ST Act) Allahabad. Bail Petition Number -4438/2020 C. N. R. No. UPAD01008173-2020 NER Unknown Uttar Pradesh State Lawsuit Offense Number -773/2020 Article 376, 377, 504 & 506 Indian Penal Code & Article 3(2)V SC /ST Act Station -Sorav, Prayagraj. 04.03.2021 This bail petition has been given of behalf of petitioner/accused NER son NER, resident of Dhamapur, Abdalpur, Station - Sorav, District - Prayagraj Offense number 773/2020 Article 376, 377, 504 & 506 Indian Penal Code & Article 3(2) 5 SC /ST Act in Station - Sorav, Prayagraj which is endorsed by the affidavit of the pairroker father NER of the accused.
Facts and Arguments: This chunk of the document contains case facts related to the case and arguments from defendant and prosecutor.सल्लया मे आधिकावर्षेशा िधा प्रधाना के किक वाहिनी का सल्वया <Nāmā> <Nāmā> पुर्थिी <Nāmā> वाहिनी का सल्वया 06 वर्ष पूर्थिी तूधावर्षेशा िधा <Nāmā> वाहिनी का सल्वया िधा <Nāmā> वाहिनी का सल्वया िधा <Nāmā> वाहिनी का सल्वया िधा <Nāmā> वाहिनी का सल्वया िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्वया िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व�ा िधा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> वाहिनी का सल्व不受ा िधा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> वाहिनी का सल्व受益ा <Nāmā> वाहिनी का सल्व受益ा <Nāmā> वाहिनी का सल्व受益ा <Nāmā> वाहिनी का सल्व受益ा <Nāmā> वाहिनी का सल्व受益ा <Nāmā> वाहिनी क्यावर्षेशा िधा <Nāmā> वाहिनी क्यावर्षेशा िधा <Nāmā> वाहिनी क्यावर्षेशा <Nāmā> वाहिनी क्यावर्षेशा <Nāmā> वाहिनी क्यावर्षेशा <Nāmā> वाहिनी क्यावर्षेशा <Nāmā> वाहिनी क्यावर्षेशा <Nämā> वाहिनी क्यावर्षेशा <Nāmā> वाहिनी क्यावर्षेशा <Nāmā> वाहिनी क्यावर्षेशा <Nāmā> वाहिनी क्यावर्षेशा <Nāmā> +506 अधिकावर्षेशा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> वाहिनी का सल्व受ा िधा <Nāmā> +506 अधिकावर्षेशा <Nāmā> +506 अधिकावर्षेशा <Nāmā> +506 अधिकावर्षेशा <Nāmā> +506 अधिकावर्षेशा <Nāmā> +506 अधिकावर्षेशा <Nāmā>In short, petitioner facts are such that, the litigant (female) came in contact with NER son of NER 6 years ago. NER used to come to litigant's (female) house for delivering milk. Paraphrase ...Litigant (female) kept quiet due to public shame. Complaint was registered on basis of case record of litigant (female). It was argued on behalf of the accused that the petitioner has no previous crime record. Paraphrase ...it is a complete accusation which is untrue and fictitious. Paraphrase...With the intention of getting money, in order to blackmail, a false and fictitious complaint was filed by the victim (female). There is no mention of the signature of the litigant (female) and date on record. Petitioner is innocent and is being falsely framed. Petitioner is lodged in jail since 07.10.2020. Petitioner is ready to give bail. Hence petitioner be released on bail. On behalf of the prosecution party, refuting the bail application, special public prosecutor has said that...paraphrase ...the crime committed by the accused is of serious nature. So the bail petition of the accused be overruled.
+ +Table 10 - continued from previous page + +
FieldExampleTranslation
Judge's Opinion: This refers to the few lines present in the middle portion of the document where judge writes their opinion of the case.Madhajā Amīpūyukk kci āorār se Uppaśikṣṭṭamīt Vādībānān +Uddhīvakka Eevi rālajyckci kci āorār Sēneṭaupaśikṣṭṭamīt Vādībāyān +Lokak āamipuyakjuk kci āru bhu nāma Eevi Sāmāsast L Prayānā +kci āvāvāləkocan kci yānla / āamipuyukk ādhar +Pāoideita kci āshādiča kci āhāsāla ādēkār Ursašek Kāśāh +Balaṭačkacar āeνān Āpañakutitik kci kcfy kci yānla gānya +Lthāa Ājatīsūcukk kci gālāti ādēt h ānu <nʌm> े +Mārānē kci ādhāmokādīyāmā āyeh Āpūrādāh āk κ e Māhīlāta ādōr +Sāmālāj kci <nʌm> ā, ो gāmpūniēr <nʌm> kci āhā
Result: This chunk of the document contains decision made by judge on the case.Madhajā Māmālār āe k e Sāmāsast l tchy, Pāriśīpūyālīyān +Eev Āpūrādāh kci gāmpūniēr l l kci ādēkār āhū +Prayāhā / Āmipuyukk kci āj mānān l <nʌm> ādōd +Janae kci Āa dāhār pāyāaht nāhi pālāta āhū +Amipuyukk kci Āj mānān l prāhānā nārīsxtl +kci āj aye <nʌm> ā +Adaresha Āmipuyukk +Shālānādhr <nʌm> puñ <nʌm> <nʌm> <nʌm> kci Āj mānān l prāhānā pār ānīsxtl kci yānla +(रāmākesh) Āvīsāyān Ĩnāyādāhīsht (रेश्थोसीθ/ +Leśsθετιθε ᵓवट) ālalāhāhābād | JCO Code- UP5902So, looking at all the facts of the matter, the circumstances and the seriousness of the crime, (I) do not find enough basis for releasing the petitioner/accused on bail. The bail petition of the accused is fit to be overruled. Ruling the bail petition of the accused NER son NER is overruled. (Ramkesh) Special Judge (SCST Act) Allahabad | J C Code 5902
+ +Table 10: A sample segmented document \ No newline at end of file diff --git a/hldchindilegaldocumentscorpus/images.zip b/hldchindilegaldocumentscorpus/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f4563b4dca80f9a2d8fa15c819414162097cbb26 --- /dev/null +++ b/hldchindilegaldocumentscorpus/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20d4f59ffdfe9bd7d4907c25f52ae9117be55a69516340e43053fa35a5550d14 +size 1175561 diff --git a/hldchindilegaldocumentscorpus/layout.json b/hldchindilegaldocumentscorpus/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2e84815ac33c9ca12f1fd45724f6487b40bb6f21 --- /dev/null +++ b/hldchindilegaldocumentscorpus/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a940c673e8f61ddfdf3ca51df0e37c5457d82552897a81b421c568bf7c533fb6 +size 374922 diff --git a/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_content_list.json b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4c4bd73e116419c2d3b265407440d8120378dc13 --- /dev/null +++ b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:030675f22f5eadbfa3a67220cb3efceda9fa6901fce4a7533d68ed2fa5718346 +size 83144 diff --git a/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_model.json b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5e1f08229cab005b58b9162324d799fc157f8896 --- /dev/null +++ b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b1d187abfd5471d1aee508f49d17c3039763cfef3f0c875a0bf74f9ee274546 +size 99249 diff --git a/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_origin.pdf b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cab7c3559c4a54d84592aa13d4f356fea939ca23 --- /dev/null +++ b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/c425b0c6-d8c8-4fa6-b57d-5c1a8b72f818_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67872b90b3166c2a3729b6e82a63958e0ace07374560e9a8885061c408d3c5e1 +size 2991712 diff --git a/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/full.md b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b67ff51c1fe265565c82ac5059155bb941c5716e --- /dev/null +++ b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/full.md @@ -0,0 +1,358 @@ +# How Can Cross-lingual Knowledge Contribute Better to Fine-Grained Entity Typing? + +Hailong Jin $^{1,2}$ , Tiansi Dong $^{3}$ , Lei Hou $^{1,2*}$ , Juanzi Li $^{1,2}$ , Hui Chen $^{4}$ , Zelin Dai $^{4}$ , Qu Yincen $^{4}$ + +$^{1}$ Department of Computer Science and Technology, BNRist + +$^{2}$ KIRC, Institute for Artificial Intelligence, Tsinghua University, Beijing 100084, China + +$^{3}$ B-IT, University of Bonn, Germany + +4Alibaba Group, Hangzhou, China + +{jinhl,houlei}@mail.tsinghua.edu.cn + +# Abstract + +Cross-lingual Entity Typing (CLET) aims at improving the quality of entity type prediction by transferring semantic knowledge learned from rich-resourced languages to low-resourced languages. In this paper, by utilizing multilingual transfer learning via the mixture-of-experts approach, our model dynamically captures the relationship between target language and each source language, and effectively generalize to predict types of unseen entities in new languages. Extensive experiments on multilingual datasets show that our method significantly outperforms multiple baselines and can robustly handle negative transfer. We questioned the relationship between language similarity and the performance of CLET. With a series of experiments, we refute the commonsense that the more source the better, and propose the Similarity Hypothesis for CLET. + +# 1 Introduction + +Fine-grained Entity Typing (FET) aims at labeling entity mentions in a particular context with one or more specific types organized in a type hierarchy. For example, Donald Trump is classified as having the path of following types: President, Politician, Person. President is a subclass of Politician that in turn is a subclass of Person. FET provides accurate type information, and is therefore quite useful for various downstream NLP tasks, such as entity linking (Onoe and Durrett, 2020; Chen et al., 2020a; Zhu et al., 2020), relation extraction (Vashisth et al., 2018; Kuang et al., 2020), text generation (Dong et al., 2021; Elsahar et al., 2018), and so on. + +Supervised learning approaches to FET need huge amount of labeled training data (Ren et al., 2016; Shi et al., 2020; Chen et al., 2020b), and can be applied for a few rich-resourced languages, e.g., English, which have enough qualified labeled data. + +![](images/9a3bec5b26b47ee99566cd3be36bcdbf0ebff5d8e4fd207dc87ac0a090891de1.jpg) +Figure 1: Example of Cross-lingual Entity Typing. We use knowledge from source language (English) to help with entity typing task in target language (Chinese). + +For the vast majority of low-resourced languages, we have insufficient training data, or even do not have labeled data at all. However, languages are not independent, instead, some are more similar than others, and form a family tree. For example, Portuguese is similar to Spanish; Dutch can even be thought of as half way between German and English. This motivates us to utilize the knowledge from rich-resourced languages (source) to help to predict missing types in a low-resourced language (target), which is called the Cross-lingual Entity Typing (CLET). Previous research showed that transferring knowledge from multiple source languages could improve the performance of entity typing (Chen et al., 2019b). Recent research proposed a unified CLET model, trained with four rich source languages (English, Finnish, German, and Spanish), is able to accept over 100 different languages (Selvaraj et al., 2021). Behind such unified models is the assumption that the more rich-resourced languages a model has, the better the performance will be. This leads to the search of the best unified model for all low-resourced languages. + +Here, we raise the question: How will the similarity between the source and the target languages affect the performance? To this end, we carefully select six languages as follows: German, English, and Dutch in the west Germanic family, Russian + +in the Slavic family, and Spanish in the Romance family. This five languages are in the European family1. We select Chinese in the Sino-Tibetan family, which is totally different from the other five languages, as illustrated in Figure 2. The more similar two languages are, the higher is their lowest common ancestor located in the language tree. + +![](images/f39c4fa01971126239507fca8f3db1ead64d82014446315a3060aa92572be467.jpg) +Figure 2: Six selected languages are marked with red circles. + +![](images/145e9c534b717f82df693cab3e778d6d78a1c41ed8dce96fd4cb0b40e33ed964.jpg) + +Following the unsupervised multilingual transfer-learning setup, we use labeled data from source languages and unlabeled data from the target language, leverage multilingual BERT as feature encoder to produce language-independent features (Devlin et al., 2019), and use mixture-of-experts (MoE) approach (Jacobs et al., 1991; Shazeer et al., 2017) to capture the correlations between the target language and each source language. For each target example, the predicted posterior is a weighted combination of all the experts' predictions. Experts' weights reflect the proximity of the example to each source language. To further improve transfer quality, we apply a language discriminator to extract more language-invariant features from both source and target languages via adversarial learning. Extensive experiments show that our proposed method significantly outperforms multiple state-of-the-art monolingual methods. + +In contrast to other cross-lingual FET researches, our work explores how the similarity between source and target languages would affect the FET performance. Our experiment results surprisingly refute the commonly accepted assumption that the more and the richer the source languages are, the better performance it will be. Our results suggest the importance of the similarity between source and target languages. The more similar the source and the target are and the richer the source is, the + +better performance it will be. Adding a rich but dissimilar source may reduce the performance. This observation refutes the existence of the best unified model for all target languages. The best crosslingual source languages shall be rich and selected among the cluster of the most similar languages to the target language. + +The rest of this paper is organized as follows. Section 2 formally defines the problem of crosslingual fine-grained entity typing. Section 3 describes our approach. Section 4 reports two groups of experiments, one to evaluate our method, the other to explore the relation between language similarity and the performance of type prediction. Section 5 reviews some related works. Section 6 concludes our work. + +# 2 Problem Formulation + +We use $\mathbb{S} = \{\mathcal{S}_i\}_{i=1}^N$ as the set of source languages, in which $N$ is the number of source languages, $\mathcal{T}$ as the target language. Types are organized into a tree-structured hierarchy $\mathbf{Y}$ , shared by all languages. + +Based on the assumption that each mention can only have one type-path depending on the context, we represent each type-path uniquely by the terminal type (which might not be a leaf node). For example, type-path root-person-athlete can be represented as just athlete, while root-person can be unambiguously represented as the non-leaf person. + +For each source language $S_{i}\in \mathbb{S}$ , we have a set of training data $S_{i} = \{(x_{t},y_{t})\}_{t = 1}^{|S_{i}|}$ . $x_{t} = (m_{t},c_{t})$ contains two parts, $m_t = \langle w_l,\dots ,w_r\rangle$ is an entity mention and $c_{t} = \langle w_{1},\ldots ,w_{L}\rangle$ is its context, both $m_{t}$ and $c_{t}$ are word sequences, where $L$ is the context length and $1 < l\leq r < L$ . $y_{t}$ is the most specific type of $m_{t}$ , corresponding to a unique type-path in $\mathbf{Y}$ . For target language $\mathcal{T}$ , we create a set of unlabeled data $\mathcal{T} = \{x_{t}\}_{t = 1}^{|T|}$ . We formulate cross-lingual fine-grained entity typing (CLET) problem as follows: + +Definition 1 Given training data from source languages $\mathbb{S} = \{\mathcal{S}_i\}_{i=1}^N$ , and unlabeled data from target language $\mathcal{T}$ , we aim at learning a model $P(y|x)$ using the source training data and generalizing well to the target language. Given $x \in \mathcal{T}$ , our task is to predict its most specific type $\hat{y}$ depending on the learned model $P(y|x)$ . + +Notations The superscript and the subscript of an example denote the language from which it is + +sampled, and its index, respectively. For instance, $x_{j}^{\mathcal{S}_{i}} = (m_{j}^{\mathcal{S}_{i}}, c_{j}^{\mathcal{S}_{i}})$ is the $j^{th}$ example in $\mathcal{S}_{i}$ . Sometimes we omit superscripts for brevity. + +Figure 3: Framework of our proposed model. $x$ is an example from any language. $E$ is the shared encoder across all languages; $F_{S_i}$ is the classifier on the $i^{th}$ source language, the final prediction $P_{MoE}(y|x)$ is a weighted combination of all the classifiers' predictions; $M$ is the metric learning component, which takes the encoding of $x$ and source languages $\{S_i\}_{i=1}^N$ as input and computes weight $\alpha$ ; $\mathcal{D}$ is the language discriminator which is learned during adversarial training. +![](images/5dedb577a342b7e5abd8c5a845b8f28e4180a73f820b0462a82f66224b66af66.jpg) +Donald Trump was inaugurated as the 45th president of the United States on January 20, 2017. During his first week in office … +ES Trump nació el 14 de junio de 1946 en el barrio neoyorquino de Queens … +ZH 1月23日,特朗普签署了上任后第一份行政命令,正式宣布美国退出… + +# 3 Methodology + +# 3.1 Overview of Our Approach + +We model the multiple source languages as a mixture of experts, and learn metric $\alpha$ to weight the experts for different target examples (Jacobs et al., 1991; Shazeer et al., 2017). Our model consists of four key components, as shown in Figure 3, namely the shared feature extractor $E$ , a set of language-specific classifier $\{F_{S_i}\}_{i=1}^N$ , metric function $M$ and language discriminator $\mathcal{D}$ . Our model is a multitask learning architecture, with a shared encoder of all languages, and language-specific classifier $F_{S_i}$ for each language $S_i$ . Each input is firstly encoded with $E$ , and then fed to each classifier to obtain the language-specific predictions. The final predictions are then weighted based on the metric $M$ . + +# 3.2 Feature Extractor $E$ + +We use multilingual BERT (mBERT) as feature extractor (Devlin et al., 2019), since it follows + +the same model architecture and training procedure as BERT and produces an effective crosslingual word representation. Different from BERT, mBERT is pre-trained on concatenated Wikipedia data in 104 languages. Formally, given an example $x_{i} = (m_{i},c_{i})$ in any language, we utilize mBERT encoder to get its representation $E(x_{i})$ . Given a mention $m_{i} = \langle w_{l},\ldots ,w_{r}\rangle$ with its context $c_{i} = \langle w_{1},\ldots ,w_{L}\rangle$ , we simply feed the sequence ([CLS], $c_{i}$ , [SEP], $m_{i}$ , [SEP]) to mBERT encoder and use the output of [CLS] token as the representation of the mention with its context. + +# 3.3 Expert Classifier $F$ + +Each source $S_{i}$ has a language-specific classifier (expert) $F_{S_i}$ . With the representation $E(x_j^{S_i})$ of an example in $S_{i}$ , we employ a softmax classifier parameterized by $\theta_f^{S_i} = [W_f^{S_i},b_f^{S_i}]$ to get the language-specific prediction (i.e. posterior). + +$$ +P _ {\mathcal {S} _ {i}} \left(y \mid x _ {j} ^ {\mathcal {S} _ {i}}\right) = \operatorname {S o f t m a x} \left(W _ {f} ^ {\mathcal {S} _ {i}} E \left(x _ {j} ^ {\mathcal {S} _ {i}}\right) + b _ {f} ^ {\mathcal {S} _ {i}}\right) \tag {1} +$$ + +$$ +\hat {y} = \arg \max _ {y} P _ {\mathcal {S} _ {i}} (y | x _ {j} ^ {\mathcal {S} _ {i}}) \tag {2} +$$ + +where $W_{f}^{\mathcal{S}_{i}} \in \mathbb{R}^{K \times d_{z}}$ can be treated as the type embeddings, $b_{f}^{\mathcal{S}_{i}} \in \mathbb{R}^{K}$ is the type bias, $K$ is the number of types. The predicted type $\hat{y}$ is the type with maximum posterior probability. Since $F_{\mathcal{S}_{i}}$ is trained on labeled data from $S_{i}$ , so it will pay more attention on language-specific feature in $S_{i}$ . + +# 3.4 Mixture of Experts + +Given an entity $x$ from the target language, we model its posterior distribution as a mixture of posteriors produced by experts trained on different source language data: + +$$ +P _ {M o E} (y | x) = \sum_ {i = 1} ^ {N} \alpha (x, \mathcal {S} _ {i}) P _ {\mathcal {S} _ {i}} (y | x) \tag {3} +$$ + +$P_{\mathcal{S}_i(\cdot)}$ is the posterior distribution produced by the $i^{th}$ source classifier $F_{\mathcal{S}_i}$ (i.e., the $i^{th}$ expert). $\alpha (\cdot)$ is calculated by metric function $M$ , it measures the similarities between the target language example $x$ and each source languages $\{\mathcal{S}_i\}_{i = 1}^N$ . + +We utilize point-to-set distance as metric function (Guo et al., 2018) to define the distance between entity $x$ and a source $S_{i}$ is defined as follow. + +$$ +d (x, \mathcal {S} _ {i}) = \left(\left(E (x) - \mu^ {\mathcal {S} _ {i}}\right) ^ {\top} \mathbf {M} _ {\mathcal {S} _ {i}} \left(E (x) - \mu^ {\mathcal {S} _ {i}}\right)\right) ^ {\frac {1}{2}} \tag {4} +$$ + +where $\mu^{S_i}$ is the mean encoding of $S_{i}$ . Each source $S_{i}$ has a parameter matrix $\mathbf{M}_{S_i}$ , which is used to measure the similarity between an entity and this source. Based on the distance metric, confidence score is defined as $e(x,S_i) = -d(x,S_i)$ . The final metric values $\alpha (x,S_i)$ are then obtained by normalizing these scores: + +$$ +\alpha (x, \mathcal {S} _ {i}) = \operatorname {S o f t m a x} (e (x, \mathcal {S} _ {i})) \tag {5} +$$ + +This metric approach hypothesizes that both input entity and source language distribution are important in weight assignment. + +# 3.5 Language Discriminator $\mathcal{D}$ + +To further improve the quality, we adopt a language adversarial training module to minimize the divergence between source and target languages. In other words, feature extractor $E$ should capture more language-invariant information. Different from $\{F_{S_i}\}_{i = 1}^N$ , $\mathcal{D}$ , as a language classifier, can be trained on unlabeled data in both source and target languages. Given an entity $x$ , it takes $E(x)$ as input and predicts the likelihood of the language label of $x$ . $\mathcal{D}$ is defined as a softmax classifier parameterized by $\theta_d = [W_d,b_d]$ , where $W_{d}\in \mathbb{R}^{(N + 1)\times d_{z}}$ and $b_{d}\in \mathbb{R}^{N + 1}$ . + +$$ +P _ {L A N} (l \mid x) = \operatorname {S o f t m a x} \left(W _ {d} E (x) + b _ {d}\right) \tag {6} +$$ + +# 3.6 Model Training + +Our model's parameters include $\theta_f^{S_i}$ , $\theta_d$ and $\mathbf{M}_{\mathcal{S}_i}$ . We utilize language-adversarial training method to optimize parameters in language discriminator $\mathcal{D}$ and other components, separately. During the training process, $E$ aims at confusing $\mathcal{D}$ , so that $\mathcal{D}$ cannot predict the language in which a sample is written. The hypothesis is that if $\mathcal{D}$ cannot recognize the language of the input, the extracted features will contain more language-invariant information. We propose to use meta-training approach to learn the parameters in experts $(\theta_f^{S_i})$ and metric function $(\mathbf{M}_{\mathcal{S}_i})$ simultaneously. With each iteration through the training data, we update parameters in the mBERT encoder as well as parameters in our model. The training part is described in more detail in Appendix (Alg.1). + +# 4 Experiments + +A series of experiments are conducted to evaluate our CLET method and to examine how the lan + +
ENESDEZHNLRU
#train74,54319,76423,70913,71116,52824,918
#dev35,2759,33411,2766,4467,52112,527
#test50,26513,18115,8689,29410,73616,371
+ +Table 1: Dataset Statistics. EN: English, DE: German, ES: Spanish, ZH: Chinese, NL: Dutch, RU: Russian. + +guage similarity affects the performance of CLET. Our source code is available for reference. + +# 4.1 Model Evaluation + +# 4.1.1 Experiment Setting + +Dataset We construct our dataset based on the MVET dataset constructed from Wikipedia and Freebase (Yaghoobzadeh and Schütze, 2018). Each entity in MVET has an name in English, names in other languages, Freebase ID, and FIGER types. MVET contains 102 FIGER types (Ling and Weld, 2012), which forms a 3-level type hierarchy. For each entity, we utilize hyper-link in Wikipedia to find a sentence containing this entity mention. We collect data for six languages: English, German, Spanish, Chinese, Dutch, and Russian. Table 1 shows the statistics. + +Metrics To evaluate the performance of our proposed method, we use Accuracy (Strict-F1), Micro-averaged F1 (Mi-F1) and Macro-averaged F1 (Ma-F1), which have been used in many FET systems (Ling and Weld, 2012; Ren et al., 2016; Xu and Barbosa, 2018; Xin et al., 2018). + +Baselines We compare our model with five state-of-the-art monolingual methods and two our models as follows: (1) AttNER is an attentive neural model that utilizes a fixed attention mechanism to focus on relevant expressions in context (Shimaoka et al., 2017); (2) NFETC utilizes a variant of cross-entropy loss function and hierarchical loss normalization to handle out-of-context noise and overly-specific noise (Xu and Barbosa, 2018); (3) LTR utilizes a hybrid classification method beyond binary relevance to exploit type inter-dependency with latent type representation (Lin and Ji, 2019); (4) MLL2R uses multi-level learning to rank approach that embraces type hierarchy during both training and prediction (Chen et al., 2020b); (5) VAT alleviates dataset shift problem in FET by combining the proposed masked VAT with denoising methods (Shi et al., 2020). Our $\mathbf{no\_adv}$ is a variant of our model Our, which removes language + +discriminator $\mathcal{D}$ . For each baseline, we apply the same feature extractor, given a mention $m_{i}$ with its context $c_{i}$ , we feed the sequence ([CLS], $c_{i}$ , [SEP], $m_{i}$ , [SEP]) to mBERT encoder and use the output of [CLS] token as the representation of the mention with its context. + +Parameter Settings We implement our approach with PyTorch 1.2.0. In all experiments, Adam is used for optimizers, with learning rate 0.0002 for Chinese and 0.001 for European languages, and weight decay $10^{-8}$ for all languages. Batch size is 32 for Chinese experiment and 64 for European languages. We use the cased multilingual BERT-BASE with 12 Transformer blocks, 768 hidden units, 12 self-attention heads, GELU activations, a dropout rate of 0.1 and learned positional embeddings. WordPiece embeddings are employed to split a word into subwords, which are then directly fed into the model without any other preprocessing. Hyper-parameters are empirically selected and utilized in all experiments as follows: $\lambda = 0.2$ and $\gamma = 0.005$ for Chinese as the target language, $\lambda = 0.2$ and $\gamma = 0.01$ for Russian as the target language, $\lambda = 0.25$ and $\gamma = 0.005$ for Dutch as the target language. + +# 4.1.2 Overall Comparison Results + +We take English, German and Spanish as source languages $(N = 3)$ , and one of the three remaining as target language. Table 2 shows that our model consistently outperforms the state-of-the-art monolingual entity typing methods on three target languages. This shows that our model has the strong ability to transfer knowledge to new languages. Our model outperforms the best baseline with $4.0\%$ and $3.9\%$ in Mi-F1 and Ma-F1 on Chinese dataset, with $6.4\%$ and $5.2\%$ in Mi-F1 and Ma-F1 on Dutch dataset, with $6.0\%$ and $6.2\%$ in Mi-F1 and Ma-F1 on Russian dataset, respectively. + +# 4.1.3 Analysis + +Compared with monolingual methods, our method has two advantages. First, it can explicitly capture the relationship between a target entity and different source languages via a mixture-of-experts approach. In testing, metric module will calculate the similarity between the target entity and each source language. If the test entity is more similar to $S_{i}$ training examples, the trained metric function $M$ will predict a higher $\alpha$ for the expert $F_{S_{i}}$ . Second, we utilize language discriminator to further improve transfer quality between different + +languages. We fine-tune all the parameters from mBERT as well as parameters in our model jointly. Our cross-language approach can be seen as an effective way to augment training data for entity typing using different languages of data available. + +Our full model outperform its variant (which removes language discriminator $\mathcal{D}$ ) in all target languages consistently. This shows that language adversarial training really improves transfer quality on new language, because language adversarial training can be viewed as a kind of pre-training in target language. + +# 4.1.4 Unseen Entities + +We aim at testing whether our model is able to predict types for new entities. + +Data We remove entities which appear during training (in any source language), we call this entity-level zero-shot learning. We take English, German and Spanish as source languages, and one of the three remaining as target language. + +Results and Analysis Table 4 shows that the performance slightly decreased. This shows that our model has a degree of memory ability, in part because our model can extract and learn language-specific and language-invariant features for entities. These features appear in any source language training data, so in testing they help to make accurate judgements. + +# 4.1.5 Type Size and Performance + +The aim is to evaluate whether type size could effect the performance of type prediction. + +Data We measure our model's performance on different types. They are grouped into two groups: Head Type Group and Tail Type Group. Head Type Group has 24 types, each has at least 300 entities; Tail Type Group has 15 types, each has at most 20 entities. + +Results and Analysis Macro-averaged F1 metrics are reported in Table 3. Note that we use a different evaluation metric to calculate the F1 score for a type (Ren et al., 2016). Experiments results show that our model outperforms other baselines and works for both type groups. Generally, the performance on Head Type Group is better than Tail Type Group. Our model consistently outperforms the other methods on Tail Type Group. This shows that our model can deal with rare types. As types in Head Type Group are more coarse-grained and + +
MethodsEN+DE+ES→ZHEN+DE+ES→NLEN+DE+ES→RU
StrictMa-F1Mi-F1StrictMa-F1Mi-F1StrictMa-F1Mi-F1
AttNER0.5510.7020.7220.5570.7070.7240.5460.6890.706
NFETC0.5820.7390.7530.5720.7220.7420.5610.7110.729
MLL2R0.5750.7210.7400.5810.7360.7520.5720.7240.745
VAT0.5860.7440.7610.5870.7500.7650.5770.7290.749
LTR0.5940.7530.7720.5850.7440.7610.5800.7330.757
Ourno_adv0.6260.7750.7910.6360.7940.8220.6230.7880.812
Our0.6360.7920.8120.6400.8020.8290.6280.7950.817
+ +Table 2: Overall performance on three target languages. + +
MethodsHead Type GroupTail Type Group
Org.PersonLoc.WorkAvg.DurgLawAlgorithmTV channelAvg.
AttNER0.5540.5270.5520.5180.5240.2160.2730.3160.3350.327
NFETC0.5740.5390.5650.5370.5360.2920.2890.3440.3520.365
MLL2R0.5680.5480.5870.5620.5420.3030.3180.3260.3610.377
VAT0.5860.6230.6070.5830.5470.2880.3290.3570.3480.369
LTR0.6130.6050.6120.5920.5540.3160.3420.3370.3500.392
Ourno_adv0.6770.6470.6250.6150.5610.3170.3290.3820.3730.414
Our0.6930.6520.6310.6130.5650.3250.3310.3860.3880.407
+ +Table 3: Performance on different types. + +
TargetOur\( \mathbf{Ours_{no\_adv}} \)
StrictMa-F1Mi-F1StrictMa-F1Mi-F1
ZH0.6270.7780.7940.6210.7680.782
NL0.6350.7920.8180.6270.7810.807
RU0.6220.7850.8090.6150.7730.793
+ +Table 4: Typing performance on unseen entities. + +have more training data than types in Tail Type Group, our model performs better in predicting types in Head Type Group. + +# 4.2 How does Language Similarity Affect Cross-lingual Type Prediction? + +The idea of using rich source languages to predict entity types in low resource language may lead to following two hypotheses: (1) the richer the source is, the better predicting performance it will be; (2) the more sources, the better. Following experiments and the experiment results in Table 2 refute the two hypotheses and show that the similarity between source and target plays an important role. + +# 4.2.1 Dataset + +Languages are grouped into three levels of similarity: (1) the similar level has three languages: English, German, and Dutch. All are in the west Ger + +manic language family; (2) the less similar level consists of five languages in three language categories: Spanish in the Romance language family, Russian in the Slavic language family, and three languages from the similar level in the Germanic language family; (3) the dissimilar level consists of six languages in two language families: Chinese in the Sino-Tibetan language family, and the five European languages in the less similar level. + +# 4.2.2 The Similar Group + +Language similarity English, German, and Dutch are west Germanic languages. They are similar. Spanish is Romance language, and is less similar to English, German, and Dutch. + +Experiments & results We conducted six experiments: (1) three experiments by selecting any one from $\{\mathrm{EN},\mathrm{DE},\mathrm{ES}\}$ as source; (2) three experiments select any two from $\{\mathrm{EN},\mathrm{DE},\mathrm{ES}\}$ as sources. Experiment results in Table 5 show that: (1) Comparing with using English or German as single source language, using both of them achieves the best performance. Dutch is one of the closest relatives of both German and English and is colloquially said to be "roughly in between" them. For Dutch, some linguistic features are similar with English, some features are more similar with Ger + +
S+TBaselineOur no.advOur
StrictMa-F1Mi-F1StrictMa-F1Mi-F1StrictMa-F1Mi-F1
EN→NL0.5610.7090.7260.6270.7760.7930.6340.7890.814
DE→NL0.5800.7350.7510.6310.7860.8090.6380.7990.826
ES→NL0.5560.7020.7190.6190.7660.7820.6150.7580.773
EN+DE→NL0.5920.7580.7740.6420.8050.8330.6520.8190.843
DE+ES→NL0.5720.7230.7430.6200.7680.7830.6320.7880.811
EN+ES→NL0.5640.7150.7330.6230.7710.7870.6280.7800.797
EN+DE+ES→NL0.5870.7500.7650.6360.7940.8220.6400.8020.829
EN→RU0.5860.7420.7660.6140.7730.7920.6190.7810.801
DE→RU0.5640.7130.7270.6010.7590.7750.5970.7520.770
ES→RU0.5840.7390.7620.6260.7930.8140.6330.8020.827
EN+DE→RU0.5830.7360.7600.6180.7790.7990.6220.7840.808
DE+ES→RU0.5760.7270.7440.6150.7750.7950.6240.7890.811
EN+ES→RU0.5910.7510.7730.6200.7820.8030.6270.7950.815
EN+DE+ES→RU0.5800.7330.7570.6230.7880.8120.6280.7950.817
EN→ZH0.5730.7190.7380.6150.7540.7710.6210.7680.782
DE→ZH0.5590.6960.7130.6040.7420.7600.6110.7500.768
ES→ZH0.5770.7260.7440.6100.7480.7630.6170.7600.775
EN+DE→ZH0.5900.7480.7660.6230.7710.7860.6310.7830.805
DE+ES→ZH0.5830.7370.7560.6190.7640.7790.6260.7750.792
EN+ES→ZH0.5800.7310.7500.6320.7850.8070.6280.7780.797
EN+DE+ES→ZH0.5940.7530.7720.6260.7750.7910.6360.7920.812
+ +Table 5: Typing performance on target language with different source language combinations. + +man, so take both of them into account is the best way; (2) Adding less similar language source, here, adding Spanish to English and German, decreases the performance from 0.652 (shown in Table 3) to 0.640 (shown in Table 2). This shows that we do not need to use all of the training data in different languages, sometimes it may mislead the model's judgment. + +# 4.2.3 The Less Similar Group + +Language similarity English and German are Germanic languages, Spanish is a Romance language. As a Slavic language, Russian is less similar to Spanish, and much less similar to English and German. + +Experiments & results We conducted six experiments: (1) three experiments by selecting any one from $\{\mathrm{EN},\mathrm{DE},\mathrm{ES}\}$ as source; (2) three experiments by selecting any two from $\{\mathrm{EN},\mathrm{DE},\mathrm{ES}\}$ as source. Experiment results in Table 5 show that: (1) Using Spanish as the single source reaches the best performance 0.633; (2) If Spanish appears in the source language set, the performance is better; (3) Adding less similar language source (adding + +EN and DE to SP) may decrease the performance. The performance 0.628 of using all three languages is shown in Table 2; (4) Adding similar language source (adding German to English, or vice versa) improves the performance. + +# 4.2.4 The Dissimilar Group + +Language similarity English, German, and Spanish as source in the European language family, and Chinese as the target in the Sino-Tibetan language family, and is significantly dissimilar from the European languages. + +Experiments & results We conducted six experiments: (1) three experiments by selecting any one from $\{\mathrm{EN},\mathrm{DE},\mathrm{ES}\}$ as source; (2) three experiments by selecting any two from $\{\mathrm{EN},\mathrm{DE},\mathrm{ES}\}$ as source. Experiment results in Table 5 show adding dissimilar source consistently increases the performance. The best performance 0.636 is achieved by using all three source languages, shown in Table 2. English is relatively more important than German and Spanish, to predict Chinese entity types. Besides the fact that English has more training samples than German and Spanish, English has + +![](images/5e5e97a31503a992e518d4341c4b7b17e5a9642f3748305eb14a6d8ecf4f0954.jpg) +Figure 4: Average expert weights aggregated on language level. + +the poorest inflection system among all of Indo-European and Ural-Altaic languages, and shares some similarity with Chinese, in the sense that the word-order plays the dominant role in conveying meanings (Bates et al., 1984; Li et al., 1993). + +# 4.2.5 From Expert Weights to Peep How Language Similarity Affects Type Prediction + +We take the setting of using three source languages, and compute the instance-level expert weights for each entity, then average across all entities in the validation set, resulting a final language-level average expert weight for each source language. Fig. 4 shows the average expert weights for each target language, and further strengthens our claim that the more similar between the source language and the target, the larger weight the source language expert will be. In particular, (1) for Dutch, German Expert has the largest weight, and English and German Experts have much larger weights than Spanish Expert; (2) for Russian, Spanish Expert has much larger weight than German and English Experts, and English Expert has lightly larger weight than German Expert; (3) for Chinese, English Expert has the largest weight that is slightly larger than German Expert that is slightly larger than Spanish. + +# 4.2.6 Similarity Hypothesis for Cross-Linguial Entity Typing + +As a summary, we propose the Similarity Hypothesis for CLET as follows: The more similar the source and the target are, the better the performance will be; A large set of source languages with a high deviation of similarity performs worse than one of its subsets whose members are more similar to the target than other sources. + +# 5 Related Work + +Fine-grained Entity Typing. FET research targets at utilising sentence-level context for making predictions (Ling and Weld, 2012) and (Gillick et al., 2014), in which they created the commonly used FIGER and OntoNotes datasets. (Shimaoka et al., 2017) proposed an attentive LSTM network model to encode an entity context, and proposed an attention mechanism to allow the model to focus on relevant expressions in a context. (Xu and Barbosa, 2018) studied two kinds of noises, namely, out-of-context noise and overly-specific noise in training data. (Wu et al., 2019) leveraged a novel cost function to jointly model the correlation among hierarchical types and label noises. (Xiong et al., 2019) presented an effective method to impose label-relational inductive bias on fine-grained entity typing models. (Onoe and Durrett, 2019) investigated the problem of denoising distant training data for entity typing tasks. (Chen et al., 2019a) regularized distantly supervised models with Compact Latent Space Clustering (CLSC) to effectively utilize noisy data. (Lin and Ji, 2019; Shi et al., 2020) employed contextualized word representations to further boosts the performance. + +Cross-lingual task in NLP. To tackle the low-resourced problem, many cross-lingual transfer learning models have been proposed. Most of the research focuses on bilingual transfer case. (Xu and Yang, 2017) introduced a framework for distillation of discriminative knowledge across languages, focusing on the domain/distribution mismatch issues in cross-lingual text classification problem. (Chen et al., 2018) utilized an adversarial deep averaging network to extract language-invariant features for cross-lingual sentiment classification. (Wu et al., 2020) proposed a teacher-student learning method, where NER models in the source languages are used as teachers to train a student model on unlabeled data in the target language. Recently, some researches focus on the multi-source scenario, also known as multilingual transfer learning (MLTL). (Chen et al., 2019b) used both language-invariant and -specific features to improve the performance on the target language. (Karamanolakis et al., 2020) presented a cross-lingual text classification method, which extracts and transfers a small number of task-specific seed words, and creates a teacher that provides weak supervision to train a more powerful student in the target language. + +# 6 Conclusions and Discussions + +We address the problem of Cross-Linguial Entity Typing (CLET) in an unsupervised setting, and propose a mixture-of-experts (MoE) approach to dynamically capture the relation between the target language and each source language, which enables to acquire more knowledge from source languages. Experiments on multi-lingual datasets show that this approach outperforms various baselines and can effectively predict types of unseen entities in new languages. The presented work is the first to investigate how language similarity affects the performance of CLET, and propose the Similarity Hypothesis. This will be helpful for the empirical selection of source languages, and raises new questions, such as how we can quantitatively compute and compare similarities among languages. + +# 7 Acknowledgements + +This work is supported by the National Key Research and Development Program of China (2020AAA0106501), the grants from the Institute for Guo Qiang, Tsinghua University (2019GQB0003) and Beijing Academy of Artificial Intelligence, and Alibaba Inc. + +# References + +E. Bates, B. MacWhinney, C. Caselli, A. Devescovi, F. Tatale, and V. Venza. 1984. A Cross-linguistic Study of the Development of Sentence Interpretation Strategies. *Child Development*, 55:341–354. +Bo Chen, Xiaotao Gu, Yufeng Hu, Siliang Tang, Guoping Hu, Yueting Zhuang, and Xiang Ren. 2019a. Improving distantly-supervised entity typing with compact latent space clustering. 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 2862-2872. +Shuang Chen, Jinpeng Wang, Feng Jiang, and Chin-Yew Lin. 2020a. Improving entity linking by modeling latent entity type information. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7529-7537. +Tongfei Chen, Yunmo Chen, and Benjamin Van Durme. 2020b. Hierarchical entity typing via multi-level learning to rank. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8465-8475. +Xilun Chen, Ahmed Hassan, Hany Hassan, Wei Wang, and Claire Cardie. 2019b. Multi-source cross-lingual + +model transfer: Learning what to share. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3098-3112. +Xilun Chen, Yu Sun, Ben Athiwaratkun, Claire Cardie, and Kilian Weinberger. 2018. Adversarial deep averaging networks for cross-lingual sentiment classification. Transactions of the Association for Computational Linguistics, 6:557-570. +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. +Xiangyu Dong, Wenhao Yu, Chenguang Zhu, and Meng Jiang. 2021. Injecting entity types into entity-guided text generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 734-741. +Hady Elsahar, Christophe Gravier, and Frederique Laforest. 2018. Zero-shot question generation from knowledge graphs for unseen predicates and entity types. 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 218-228. +Dan Gillick, Nevena Lazic, Kuzman Ganchev, Jesse Kirchner, and David Huynh. 2014. Context-dependent fine-grained entity type tagging. arXiv preprint arXiv:1412.1820. +Jiang Guo, Darsh Shah, and Regina Barzilay. 2018. Multi-source domain adaptation with mixture of experts. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 4694-4703. +Robert A Jacobs, Michael I Jordan, Steven J Nowlan, and Geoffrey E Hinton. 1991. Adaptive mixtures of local experts. Neural computation, 3(1):79-87. +Giannis Karamanolakis, Daniel Hsu, and Luis Gravano. 2020. Cross-lingual text classification with minimal resources by transferring a sparse teacher. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 3604–3622. +Jun Kuang, Yixin Cao, Jianbing Zheng, Xiangnan He, Ming Gao, and Aoying Zhou. 2020. Improving neural relation extraction with implicit mutual relations. In 2020 IEEE 36th International Conference on Data Engineering (ICDE), pages 1021-1032. IEEE. +P. Li, E. Bates, and B. MacWhinney. 1993. Processing a Language without Inflections: A Reaction Time Study of Sentence Interpretation in Chinese. Journal of Memory and Language, 32:169-192. + +Ying Lin and Heng Ji. 2019. An attentive fine-grained entity typing model with latent type representation. 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 6198-6203. +Xiao Ling and Daniel S Weld. 2012. Fine-grained entity recognition. In Twenty-Sixth AAAI Conference on Artificial Intelligence. +Yasumasasa Onoe and Greg Durrett. 2019. Learning to denoise distantly-labeled data for entity typing. 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 2407-2417. +Yasumasa Onoe and Greg Durrett. 2020. Fine-grained entity typing for domain independent entity linking. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 8576-8583. +Xiang Ren, Wenqi He, Meng Qu, Lifu Huang, Heng Ji, and Jiawei Han. 2016. Afet: Automatic fine-grained entity typing by hierarchical partial-label embedding. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1369-1378. +Nila Selvaraj, Yasumasa Onoe, and Greg Durrett. 2021. Cross-lingual fine-grained entity typing. arXiv preprint arXiv:2110.07837. +Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. 2017. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538. +Haochen Shi, Siliang Tang, Xiaotao Gu, Bo Chen, Zhi-gang Chen, Jian Shao, and Xiang Ren. 2020. Alleviate dataset shift problem in fine-grained entity typing with virtual adversarial training. In *IJCAI*, pages 3898-3904. +Sonse Shimaoka, Pontus Stenetorp, Kentaro Inui, and Sebastian Riedel. 2017. Neural architectures for fine-grained entity type classification. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 1271-1280. +Shikhar Vashishth, Rishabh Joshi, Sai Suman Prayaga, Chiranjib Bhattacharyya, and Partha Talukdar. 2018. Reside: Improving distantly-supervised neural relation extraction using side information. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1257-1266. +Junshuang Wu, Richong Zhang, Yongyi Mao, Hongyu Guo, and Jinpeng Huai. 2019. Modeling noisy hierarchical types in fine-grained entity typing: a content-based weighting approach. In Proceedings of the 28th International Joint Conference on Artificial Intelligence, pages 5264-5270. AAAI Press. + +Qianhui Wu, Zijia Lin, Borje Karlsson, Jian-Guang Lou, and Biqing Huang. 2020. Single-/multi-source cross-lingual ner via teacher-student learning on unlabeled data in target language. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6505–6514. +Ji Xin, Yankai Lin, Zhiyuan Liu, and Maosong Sun. 2018. Improving neural fine-grained entity typing with knowledge attention. In Thirty-second AAAI conference on artificial intelligence. +Wenhan Xiong, Jiawei Wu, Deren Lei, Mo Yu, Shiyu Chang, Xiaoxiao Guo, and William Yang Wang. 2019. Imposing label-relational inductive bias for extremely fine-grained entity typing. 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 773-784. +Peng Xu and Denilson Barbosa. 2018. Neural fine-grained entity type classification with hierarchy-aware loss. 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 16-25. +Ruochen Xu and Yiming Yang. 2017. Cross-lingual distillation for text classification. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1415-1425. +Yadollah Yaghoobzadeh and Hinrich Schütze. 2018. Multi-multi-view learning: Multilingual and multi-representation entity typing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3060-3066. +Ming Zhu, Busra Celikkaya, Parminder Bhatia, and Chandan K Reddy. 2020. Latte: Latent type modeling for biomedical entity linking. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9757-9764. + +# 8 Appendix + +# Algorithm 1: model training + +Input: Training data on multiple source languages $\mathbb{S} = \{S_i\}_{i=1}^N$ , test data on target language $\mathcal{T}$ + +Output: Cross-lingual Fine-grained Entity Typing model $P_{MoE}(y|x)$ + +# repeat + +$\# \mathcal{D}$ iteration, update parameters in language discriminator $\mathcal{D}$ + +for iter $= 1$ to $k$ do + +$\mathcal{L}_D\gets 0$ + +Sample $N$ source mini-batches $\{x_{t}^{\mathcal{S}_{1}}\}_{t = 1}^{m},\dots ,\{x_{t}^{\mathcal{S}_{N}}\}_{t = 1}^{m}$ from $\mathbb{S}$ + +for $i = 1$ to $N$ do + +Calculate cross-entropy loss of language label on source $S_{i}$ , and add to $\mathcal{L}_D$ + +end + +Sample a target mini-batch $\{x_i^T\}_{i = 1}^m$ from $\mathcal{T}$ + +Calculate cross-entropy loss of language label on target $\mathcal{T}$ , and add to $\mathcal{L}_D$ + +Update parameters in $\mathcal{D}$ using $\nabla \mathcal{L}_D$ + +# end + +Main iteration, update parameters in encoder $E$ , experts $\{F_{S_i}\}_{i = 1}^N$ and metric function $M$ + +$\mathcal{L}_{moe}, \mathcal{L}_{sup}, \mathcal{L}_{adv} \gets 0$ + +Sample $N$ source mini-batches $\{(x_t^{\mathcal{S}_1},y_t^{\mathcal{S}_1})\}_{t = 1}^m,\dots ,\{(x_t^{\mathcal{S}_N},y_t^{\mathcal{S}_N})\}_{t = 1}^m$ from $\mathbb{S}$ + +for $i = 1$ to $N$ do + +Set meta-target as $\mathcal{T}_{meta} = S_{i}$ , meta-sources as $\mathcal{S}_{meta} = \{S_j\}_{j=1,j \neq i}^N$ + +Calculate cross-entropy loss of type information on $\mathcal{T}_{meta}$ , and add to $\mathcal{L}_{sup}$ + +Calculate metric weight $\alpha (x,S^{\prime})$ for each $x\in \mathcal{T}_{meta}$ and $S^{\prime}\in S_{meta}$ + +Calculate MoE loss over $(S_{meta},\mathcal{T}_{meta})$ using $\alpha$ , and add to $\mathcal{L}_{moe}$ + +Calculate cross-entropy loss of language label on $\mathcal{T}_{meta}$ , and add to $\mathcal{L}_{adv}$ + +# end + +Sample a target mini-batch $\{x_i^{\mathcal{T}}\}_{i = 1}^{m}$ from $\mathcal{T}$ + +Calculate cross-entropy loss of language label on target $\mathcal{T}$ , and add to $L_{adv}$ + +$\mathcal{L}\gets \lambda \cdot \mathcal{L}_{moe} + (1 - \lambda)\cdot \mathcal{L}_{sup} + \gamma \cdot \mathcal{L}_{adv}$ + +Update parameters in $E$ , $\{F_{S_i}\}_{i = 1}^N$ and $M$ using $\nabla \mathcal{L}$ + +until convergence; \ No newline at end of file diff --git a/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/images.zip b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..39623fb026429c25e520fda4b55f5ad420f7306c --- /dev/null +++ b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef9628bf88532b6a77914a8676c0fcee11c39ac93c74a428dfd1890d9b1a0fa3 +size 518615 diff --git a/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/layout.json b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7d50244bf38b6d69ef5ef42d5ca5219237d94f15 --- /dev/null +++ b/howcancrosslingualknowledgecontributebettertofinegrainedentitytyping/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bf1b20e4ff6c468689ac8009d8252bbf12ac7d6d15e850f12bd253f646b482b +size 467963 diff --git a/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_content_list.json b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b107ba4908dc89ed35e86adafa9c8a51dee700b2 --- /dev/null +++ b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1cf53541073f2c37efc68ff0d07afb2c9629d5871416d4a5a04cc61fb6654a5 +size 89005 diff --git a/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_model.json b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..06d37d4813443900e563c7aba5b5de080ef587a7 --- /dev/null +++ b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1969893bd970fb09f9369cc994f2933bc684461c8918186a62993707bdb8c582 +size 105400 diff --git a/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_origin.pdf b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5c083afeef33e9c433f9a7c7858816d439fc6650 --- /dev/null +++ b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/387f63bd-215f-4212-9270-c5aa960881dc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1c502e1026df845799c21c3e96864908aff483cdb8a95214fe592383d14f582 +size 545957 diff --git a/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/full.md b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1359c5bbece463bd287d9ad8acf1d2f5fe4af207 --- /dev/null +++ b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/full.md @@ -0,0 +1,351 @@ +# How Pre-trained Language Models Capture Factual Knowledge? A Causal-Inspired Analysis + +Shaobo Li $^{1*}$ , Xiaoguang Li $^{2*}$ , Lifeng Shang $^{2}$ , Zhenhua Dong $^{2}$ , Chengjie Sun $^{1\dagger}$ , Bingquan Liu $^{1}$ , Zhenzhou Ji $^{1}$ , Xin Jiang $^{2}$ and Qun Liu $^{2}$ + +1Harbin Institute of Technology + +$^{2}$ Huawei Noah's Ark Lab + +shli@insun.hit.edu.cn, {sunchengjie, liubq, jizhenzhou} @hit.edu.cn + +{lixiaoguang11, shang.lifeng, dongzhenhua, Jiang.Xin, qun.liu} @huawei.com + +# Abstract + +Recently, there has been a trend to investigate the factual knowledge captured by Pre-trained Language Models (PLMs). Many works show the PLMs' ability to fill in the missing factual words in cloze-style prompts such as "Dante was born in [MASK]." However, it is still a mystery how PLMs generate the results correctly: relying on effective clues or shortcut patterns? We try to answer this question by a causal-inspired analysis that quantitatively measures and evaluates the word-level patterns that PLMs depend on to generate the missing words. We check the words that have three typical associations with the missing words: knowledge-dependent, positionally close, and highly co-occurred. Our analysis shows: (1) PLMs generate the missing factual words more by the positionally close and highly co-occurred words than the knowledge-dependent words; (2) the dependence on the knowledge-dependent words is more effective than the positionally close and highly co-occurred words. Accordingly, we conclude that the PLMs capture the factual knowledge ineffectively because of depending on the inadequate associations. + +# 1 Introduction + +d Do Pre-trained Language Models (PLMs) capture factual knowledge? LAMA benchmark (Petroni et al., 2019) answers this question by quantitatively measuring the factual knowledge captured in PLMs: query PLMs with cloze-style prompts such as "Dante was born in [MASK]?" Filling in the mask with the correct word "Florence" is considered a successful capture of the corresponding factual knowledge. The percentage of correct fillings over all the prompts can be used to estimate the amount of factual knowledge captured. PLMs + +# Knowledge-Dependent: + +Columbus born between 25 August and 31 October 1451, died 20 May 1506 was an Italian explorer. + +# Positionally Close: + +Columbus born between 25 August and 31 October 1451, died 20 May 1506 was an Italian explorer. + +# Highly Co-occurred: + +Columbus born between 25 August and 31 October 1451, died 20 May 1506 was an Italian explorer. + +Figure 1: The associations we investigated. The underlined words are the missing words that need to be generated. The bold words, which hold specific associations with the missing words, are considered as the word-level patterns that PLMs may use to generate the missing words. + +show a surprisingly strong ability to capture factual knowledge in such probings (Jiang et al., 2020; Shin et al., 2020; Zhong et al., 2021), which elicits further research on a more in-depth question (Cao et al., 2021; Elazar et al., 2021a): How do PLMs capture the factual knowledge? In this paper, we try to answer this question with a two-fold analysis: + +Research Question 1 Which association do PLMs depend on to capture factual knowledge? + +Research Question 2 Is the association on which PLMs depend effective in capturing factual knowledge? + +We use association to refer to the explicit association between the missing words and the remaining words in the context. We define three typical associations between words. Figure 1 illustrates these associations in a mask-filling sample. + +Definition 1 Knowledge-Dependent (KD): According to a Knowledge Base (KB), the missing words can be deterministically predicted when providing the remaining words. + +Definition 2 Positionally Close (PC): The remaining words are positionally close to the missing words. + +![](images/b3e51b9ea0fabe3b34615ac523cfcb68c19af55b7543c2d56360946a021d073a.jpg) +(a) Dependence measure. +(b) Effectiveness measure. +Figure 2: The overview of the proposed analysis framework. The dependence measure quantifies how much the PLMs depend on each association to capture factual knowledge when per-training. The effectiveness measure evaluates whether the dependence on an association is good for the factual knowledge performance in probing. + +Definition 3 Highly Co-occurred (HC): The remaining words have a higher co-occurrence frequency with the missing words. + +Question 1 investigates how much PLMs depend on a specific group of remaining words to predict the missing words in pre-training samples. We select the remaining words to be investigated according to their association with the missing words. We propose a causal-inspired method to quantify the word-level dependence in each sample. The average dependence on the remaining words that hold the same association with the missing words over all the samples indicates how PLMs rely on this association to predict the missing words. We refer to this average dependence as dependence on the association. The above analysis is named dependence measure. + +In Question 2, we reveal the effectiveness of dependence by the correlation between the quantified dependence on associations and the factual knowledge capturing performance. The performance is probed with additionally crafted clozestyle prompts(Elazar et al., 2021a). The more the dependence on an association positive correlates with the probing performance, the more effective this association is. We refer to the second analysis as effectiveness measure. According the experiment results, we have the following observations: + +Observation 1 The PLMs depend more on the positional close and highly co-occurred associations than the knowledge-dependent association to capture factual knowledge. + +Observation 2 Depending on the knowledge-dependent association is more effective for factual knowledge capture than positional close and highly co-occurred associations. + +By connecting the two observations, we can answer the question of "how PLMs capture factual knowledge" as: The PLMs are capturing factual + +knowledge ineffectively since the PLMs depend more on the PC and HC association than the KD association. + +The contribution of this paper can be summarized as follows: (1) We quantify the word-level dependence for mask filling with a causal-inspired method, revealing the word-level patterns that PLMs use to predict the missing words quantitatively. (2) We compare the effectiveness of the dependence on different associations, which provides direct insights for improving PLMs for factual knowledge capture. (3) This paper introduces causal theories into PLMs by formulating the effect measurement process in mask language modeling. It paves the path to measure the causal effects between entities or events described in natural language. + +# 2 Method + +# 2.1 Overview + +We take a quick overview of our two-fold analysis with a running example in Figure 2. Figure 2a illustrates how to measure the dependence on the remaining words "Columbus" and "died" when predicting the missing words "20 May 1506." We let the PLM generate the missing words based on the original input first, then mask the remaining words in the input and let PLMs generate again. The difference between these two predictions is quantified and used to measure the dependence. The remaining and missing words hold the knowledge-dependent association in this sample. We repeat this measure on all the samples whose remaining and missing words have the KD association. Then the dependence on the KD association can be estimated by the average of the quantified difference. + +Figure 2b measures the effectiveness of the dependence on each association by calculating the correlation coefficient between the dependence and + +
AssociationKnowledge-DependentPositionally CloseHighly Co-occurred
InputWt born between 25 August and 31 October 1451, Wt Wo was an Italian explorer.Columbus born between 25 August and 31 October 1451, Wt Wo Wt an Italian explorer.Wt born between 25 August and 31 October 1451, died Wo was an Italian Wt.
SCMdo(Wt={MASK, MASK}) do(Wt={Columbus, died})do(Wt={MASK, MASK}) do(Wt={died, was})do(Wt={MASK, MASK}) do(Wt={Columbus, explorer})
+ +Table 1: To analyze the dependence of associations, we do interventions on treatment words to reveal their causal effects on the outcome words. + +the probing performance. Following (Petroni et al., 2019; Elazar et al., 2021a), the probing performance is indicated by the prediction accuracy and consistency when querying on the same fact with different prompts. Since the dependence on associations are quantified in the dependence measure, we can calculate the correlation coefficient between the dependence and performance over all the samples. Their correlation measures whether the dependence on an association is harmful or beneficial to the performance, showing the effectiveness of the dependence on an association quantitatively. + +Section Outline We organize the rest of this section as follows. In Section 2.2.1, we formalize how we quantify the dependence with the causal effect estimation. Section 2.2.2 gives detail about how we build the probing samples for different associations. Section 2.3.1 introduces the metrics we used to indicate the performance of factual knowledge capture. Section 2.3.2 describes the details about the effectiveness measure of associations. + +# 2.2 Quantify the Dependence on Associations + +# 2.2.1 Causal Effect Estimation for PLMs + +To study the causal effect of the different input words, we build a Structured Causal Model (SCM) for the missing words generation process and apply interventions on some input words to estimate their effect quantitatively. We consider the missing words as outcome words and the remaining words that hold a certain association (e.g. positionally close) with the outcome words as treatment words. Then, we can formally represent the word generation process with SCM, as the following structural equations: + +$$ +\begin{array}{l} w _ {c} = f (\mathbb {I}), w _ {t} = \operatorname {P L M} \left(w _ {c}\right) \tag {1} \\ w _ {o} = \mathrm {P L M} (w _ {c}, w _ {t}). \\ \end{array} +$$ + +Separate the words in a sentence into three groups: treatment words $W_{t}$ , outcome words $W_{o}$ and context words $W_{c}$ (specified by $w_{t}, w_{o}$ , and $w_{c}$ respectively). Equation 1 formulates the following data generation process: (1) Sample a sentence from the natural text space $\mathbb{I}$ and get the context words $w_{c}$ using function $f$ . (2) Generate the treatment words $w_{t}$ by the PLM based on $w_{c}$ only. (3) Generate outcome words $w_{o}$ based on both the $w_{c}$ and $w_{t}$ . + +To obtain the quantitative causal effect of treatment words $W_{t}$ on outcome words $W_{o}$ , we apply the do-calculus $do()$ (Pearl, 2009) on treatment words $W_{t}$ to introduce interventions for estimating the causal effect. $do()$ denotes the operation of forcibly setting the value of $W_{t}$ . Then the causal effect of $W_{t}$ on $W_{o}$ can be estimated by the Average Treatment Effect (ATE) (Rubin, 1974): + +$$ +\begin{array}{l} \mathbb {E} \left[ P \left(W _ {o} \mid d o \left(W _ {t} = \hat {w} _ {t}\right)\right) \right] \\ \begin{array}{l} \mathbb {E} [ P (W _ {o} | d o (W _ {t} = w _ {m})) ] \\ - \mathbb {E} [ P (W _ {o} | d o (W _ {t} = w _ {m})) ]. \end{array} \tag {2} \\ \end{array} +$$ + +Accordingly, we define ATE for PLMs as: + +$$ +\begin{array}{l} \tau = \sum_ {\mathbb {I}} \operatorname {P L M} \left(d o \left(W _ {t} = \hat {w} _ {t}\right), w _ {c}\right) P (s) \\ - \sum_ {\mathbb {I}} ^ {\mathbb {I}} \operatorname {P L M} \left(d o \left(W _ {t} = w _ {m}\right), w _ {c}\right) P (s), \tag {3} \\ \end{array} +$$ + +where $\hat{w}_t$ is the ground truth of the treatment words $W_t$ (the original value of $W_t$ without intervention). $w_m$ is the intervention value (several [MASK]s) for $W_t$ , and we use it to simulate removing the ground-truth value $\hat{w}_t$ from the input. $P(s)$ denotes the probability of selecting the sample $s$ that consists of $w_t$ , $w_o$ , and $w_c$ from $\mathbb{I}$ . $\mathrm{PLM}(\cdot, \cdot)$ denotes the output of PLMs with certain input. Table 1 illustrates the interventions on the SCM for different associations. + +The raw output of PLMs is a probability distribution over fixed vocabulary. We transform the output into reciprocal rank to quantify the differences: + +$$ +\mathrm {P L M} _ {k} \left(w _ {t}, w _ {c}\right) = \left\{ \begin{array}{l l} \frac {1}{r a n k _ {\hat {w} _ {o}}}, & \text {i f r a n k} _ {\hat {w} _ {o}} \leq k \\ 0, & \text {o t h e r w i s e} \end{array} \right. \tag {4} +$$ + +$\hat{w}_o$ is the ground-truth outcome words. $\text{rank}_{\hat{w}_o}$ is the rank position of $\hat{w}_o$ according to the generation probability of $\hat{w}_o$ output by $\mathrm{PLM}(w_c, w_t)$ . We set $k$ to 100 and use $\mathrm{PLM}_{100}$ to replace PLM in Equation 3 to calculate ATE. The ATE reflects the effect of $W_t$ on the prediction of $W_o$ , it can be regarded as a quantitative estimation of how much PLMs depend on $W_t$ when generating $W_o$ . + +# 2.2.2 Mark words by Associations + +Wikipedia is a rich source of knowledge (Thom et al., 2007; Hassanzadeh, 2021), and most of the PLMs nowadays have been pre-trained on Wikipedia (Devlin et al., 2019; Liu et al., 2019; Lan et al., 2019), so we take Wikipedia sentences as pre-training samples to construct the probing samples for dependence measure. We probe the mask-filling on these sentences to analyze what PLMs based on when capturing factual knowledge in pre-training. + +The outcome we want to observe is the predictions of factual words in the sentences. In order to locate the factual words, we align each sentence with a triplet (subject, predicate, object) in the KB. The words that correspond to the object serve as outcome words $W_{o}$ for observation, and the remaining words that hold an explicit association with $W_{o}$ are marked as treatment words $W_{t}$ for intervention. For different associations, the $W_{t}$ is identified as: + +1. Knowledge-Dependent: all the remaining words correspond to the predicate and object in the same triplet with the $W_{t}$ . +2. Positionally Close: the remaining words closest to $W_{o}$ . +3. Highly Co-occurred: the remaining words that have higher Pointwise Mutual Information (PMI) (Church and Hanks, 1990) with $W_{o}$ . The PMI is calculated over all the Wikipedia sentences using the following equation: + +$$ +\operatorname {P M I} \left(w _ {i}; \hat {w} _ {o}\right) = \frac {P \left(w _ {i} \mid \hat {w} _ {o}\right)}{P \left(w _ {i}\right)}, \tag {5} +$$ + +where $\hat{w}_o$ is a group of words (a span) and $w_{i}$ is a single word. + +4. We further define a Random (R) association, where the $W_{t}$ are randomly selected remaining words. It provides some empirical support for how much the modifications in the context affect the mask-filling output. + +Accordingly, one sentence yields four probing samples for the four associations, respectively. The four probing samples share the same $W_{o}$ but use different words as $W_{t}$ to show the dependence on different associations when predicting the same $W_{o}$ . We preserve that the number of words in $W_{t}$ is the same among different associations. For example, if there are two words used as $W_{t}$ by the KD association, we select the top two closest words with $W_{o}$ as $W_{t}$ for PC, and the words have the top two PMI with $W_{o}$ for HC. We can obtain a set of probing samples for each association. The sample sets for different associations source from the same set of sentences and have the same size. + +# 2.3 Measure the Effectiveness of Associations + +This section investigates which association can lead to better performance on factual knowledge capture. We first define the metrics to evaluate the performance, then we measure the effectiveness of an association by relating the dependence on this association with probing performance. + +# 2.3.1 Metrics for Factual Knowledge Probing + +Section 2.2 uses the original Wikipedia sentence as pre-training samples to quantify the dependence PLMs used to capture the corresponding fact in pre-training. The performance of capturing the corresponding fact is probed by having PLMs fill masks on crafted quires. We construct these queries by instantiating templates on triplets (Petroni et al., 2019). $T_{i}(s)$ denotes the $i$ -th query for the fact corresponds to $s$ . The accuracy mrr of capturing this fact is obtained by averaging over all the predictions obtained with different queries: + +$$ +\operatorname {m r r} (s) = \frac {1}{n} \sum_ {i} ^ {n} \mathrm {P L M} _ {k} \left(T _ {i} (s)\right), \tag {6} +$$ + +$\mathrm{PLM}_k(T_i(s))$ denotes the reciprocal rank of the ground truth in the PLM's output for query $T_{i}(s)$ it is defined in Equation 4. + +The consistency of the capture is indicated by the percentage of the pairs of queries that have the + +same result (Elazar et al., 2021a): + +$$ +\operatorname {c o n} (s) = \frac {\sum_ {i \neq j} \mathbb {1} _ {\mathrm {P L M} \left(T _ {i} (s)\right) = \mathrm {P L M} \left(T _ {j} (s)\right)}}{n (n - 1)}. \tag {7} +$$ + +There are $n$ different queries on every fact, and we can get $\binom{n}{2} = n(n-1)$ pairs of predictions in total. $\mathrm{PLM}(T_i(s))$ denotes the top-1 output for the query $T_i(s)$ . The value of $\mathbb{1}_{\mathrm{PLM}(T_i(s)) = \mathrm{PLM}(T_j(s))}$ is an indicator function that takes the value 1 if the PLMs returns identical at top-1 for $T_i(s)$ and $T_j(s)$ and 0 otherwise. The PLMs are better on the consistency metric if they keep the predictions consistent when queries only vary on the surface forms. E.g., the two queries "Dante was born in [MASK]" and "The birthday of Dante is [MASK]" should return the same results. + +Finally, we evaluate the factual knowledge capture performance by jointly examining the accuracy and consistency (Elazar et al., 2021a): + +$$ +\operatorname {t e s t} (s) = \operatorname {m r r} (s) \cdot \operatorname {c o n} (s) \tag {8} +$$ + +test(s) measures the probing performance on template-based queries. We also define a metric to measure how well the PLMs memorize the missing words in pre-training samples (Wikipedia sentences): + +$$ +\operatorname {t r a i n} (s) = \operatorname {P L M} _ {k} (s). \tag {9} +$$ + +# 2.3.2 Correlate Performance with Dependence + +We have quantified the dependence on each association and defined the metrics for probing performance in the above sections. We then calculate the Pearson correlation coefficient (Kirch, 2008) between dependence and probing performance to reveal the effectiveness of different associations. An association is considered more effective if the probing performance positively correlates with its dependence more. + +Because only part of the facts has available templates, the samples in the dependence measure without templates are ignored in the calculation. The factual knowledge captured by different PLMs may vary significantly due to the differences in model scale, pre-training data, or other settings. To make the correlation coefficient comparable between different PLMs, we calculate the correlation only on the factual knowledge gathered correctly by the PLM. I.e., only the pre-training samples with $\mathrm{train}(s) = \mathrm{PLM}_k(s) = 1$ are involved. + +
Sample in Dependence Measure
# Wikipedia sentences4,779,753
# Different triplets3,795,229
# Different predicates565
# Sentences with synthetic templates1,119,875
Queries in Effectiveness Measure
# Template-based queries7,645,635
# Different triplets654,112
# Different predicates38
# Different templates328
+ +Table 2: Statistics of the probing data. + +# 3 Experiments and Discussions + +# 3.1 Probing Data and PLMs + +We use the TREX dataset (Elsahar et al., 2018), which aligns KB triplets with Wikipedia sentences, to construct the samples for the dependence measure following the definition in Section 2.2.2. We employ the templates from (Elazar et al., 2021a) to construct the queries to probe the factual knowledge for the effectiveness measure. Table 2 shows the statistics for the data in the dependence measure and the effectiveness measure. The PLMs we analyzed include BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019), SpanBERT (Joshi et al., 2020), and ALBERT (Lan et al., 2019). + +# 3.2 Dependence on Associations + +The dependence on an association is the average ATE over the probing samples whose treatment words hold that association with the outcome words. Table 3 shows the quantified dependence of different associations. The accuracy in Table 3 represents the accuracy of recovering the masked factual words in pre-training samples, revealing how well does PLMs memorize the pre-training samples. It is calculated by Equation 9 with $k = 1$ . + +We find a general trend over all the picked PLMs: the Positionally Close (PC) association takes the dominant effect on the prediction results, the Highly Co-occurred (HC) association comes second, and the least for the Knowledge-Dependent (KD) association. The trend does not change much as increasing the model scale (large vs. base), using additional training data (RoBERTa vs. BERT), or improving the masking strategy (SpanBERT vs. BERT). Consequently, the accuracy drops the most when perturbing the positionally close words but least on knowledge-dependent words1. + +
ModelAccuracyDependences on Associations (k=100)
KDPCHCR
BERT-base-cased0.36230.15850.40850.17790.1081
BERT-large-cased0.36920.16030.41130.17910.0996
BERT-large-cased-wwm0.50300.13840.44770.23050.1072
SpanBERT-large0.52230.13510.36790.23830.1157
RoBERTa-base0.35110.13520.39260.20930.1053
RoBERTa-large0.42760.13600.39620.21620.0985
BERT-large-uncased-wwm0.50350.14100.43500.22900.1089
ALBERT-xxlarge-v20.47580.28520.43380.38010.2704
+ +Table 3: The quantified dependence on associations. Accuracy denotes the performance of filling in the masks in pre-training samples. The PLMs use cased and uncased vocabularies are separated. + +![](images/8cbe1b5d0343faec0c1c65fafb5c0136f43d4f8bfa302c4ff43cb5446292e404.jpg) +(a) BERT-large-cased-wwm + +![](images/21c9361d25cc2106d35db42564c98dfa2ed0bae7e90707ec37ecbedee39b0f9b.jpg) +(b) RoBERTa-large +Figure 3: The correlations between the dependence on associations and the probing performance on factual knowledge capture. + +![](images/27b17b7d645f6aed3fdbaa01e9b318e4b3596ae2b7df298f1c13d4a00db153f6.jpg) +(c) SpanBERT-large + +![](images/2fc3f52a7c295bead2b7a235457b19ef189299c3e3a958c4c4d50eb59a5ca61c.jpg) +(d) ALBERT-xxlarge-v2 + +The results provide quantitative evidence for Question 1 of "Which association do PLMs depend on to capture factual knowledge?:" PLMs prefer the associations founded with positionally close or the highly co-occurred words to the knowledge-based clues. It is different from how a conventional KB works, e.g., an object can be retrieved by the corresponding subject and predicate. + +# 3.3 Correlations between Dependence and Performance + +We show the correlation between association's dependence and the probing performance in Figure 3. Each point in the figure represents a piece of factual knowledge $s$ . We refer to it as a fact for convenience. The horizontal axis indicates $\operatorname{test}(s)$ for the fact, showing the probing performance of the fact with effectiveness measure. The vertical axis shows the dependence of associations when capturing this fact, which is quantified by the causal effect estimation defined in Section 2.2.1. The straight lines are the regression lines and different associations are shown in different line styles2. + +As we can see from the results, the dependence on the KD association positively correlates with the probing performance. The dependence on the HC association has a slightly positive correlation or almost has no correlations sometimes (such as ALBERT in Figure 3d). The PC association holds a negative correlation with the performance. + +These results can give an empirical answer to "Is the association on which PLMs depend effective in capturing factual knowledge?:" the more PLMs depend on the Knowledge-Dependent (KD) association, the better PLMs can capture the corresponding factual knowledge. Meanwhile, relying much on the positionally close association is harmful to the probing performance. + +The dependence measure results reveal that the PLMs depend most on the positionally close but least on the knowledge-dependent association. However, in effectiveness measure, we find that the positionally close association is the most ineffective for factual knowledge capture while the knowledge-dependent association is the most effective. By connecting the two results, we can conclude the answer to the question in the title: The PLMs do not capture factual knowledge ideally, + +
Case 1Pre-training samples for the dependence measure (Wikipedia Sentence)Dep.
KD: Kimwenza is a community in the Democratic Republic of the Congo in the Mont Ngafula commune in the south of the capital, Kinshasa .0.8564
PC: Kimwenza is a community in the Democratic Republic of the Congo in the Mont Ngafula commune in the south of the capital, Kinshasa .0.0000
HC: Kimwenza is a community in the Democratic Republic of the Congo in the Mont Ngafula commune in the south of the capital, Kinshasa .0.0000
Template-based Queries for the effectiveness measureMRR
The capital of Congo is Kinshasa .1.0
Kinshasa is the capital of Congo .1.0
Congo's capital is Kinshasa .1.0
Case 2Pre-training samples for the dependence measure (Wikipedia Sentence)ATE
KD: Drayton is a hamlet in England, in the county of Northamptonshire, . . . , hundred of Fawsley, ¾ of a mile on the low-lying north western side of the town of Daventry .0.0000
PC: Drayton is a hamlet in England, . . . , in the parish and union of Daventry, hundred of Fawsley, ¾ of a mile on the low-lying north western side of the town of Daventry .0.9496
HC: Drayton is a hamlet in England, . . . , in the parish and union of Daventry, hundred of Fawsley, ¾ of a mile on the low-lying north western side of the town of Daventry .0.8452
Template-based Queries for the effectiveness measureMRR
Drayton is located in Daventry .0.0
Drayton is in Daventry .0.0
Drayton can be found in Daventry .0.0
+ +Table 4: Two cases from SpanBERT-large. The quantified dependence on associations (denoted by Dep.) and the performance of factual knowledge capture (denoted by MRR). + +# since they depend more on the ineffective associations than the effective one. + +# 3.4 Case Study + +To illustrate the analysis result intuitively, we show two cases with SpanBERT-large in Table 4. The MRR shows the probing performance on the template-based query (calculated by Equation 6). In Case 1, the knowledge-dependent association gains the biggest effect, and the predictions are robust in all the template-based probing. However, the positionally close association takes the main effect in Case 2, while the PLM fails to recall the word "England" with the template-based queries. + +# 3.5 Discussions + +Generality of the Proposed Probing Method Generally, the dependence measure offers a way to measure how much the word-level patterns cause the prediction of missing words in Mask Language Model (MLM). Because words are readable, directly visible, and can be manipulated from the input side directly, the word-level patterns can provide more intuitive interpretations than numeric representation vectors (Elazar et al., 2021b) or neurons (Vig et al.). We use the proposed method to estimate the causal effect of three typical associations in this paper, while this method can be easily adapted to quantify the dependence on any word-level patterns. + +Reconsidering "PLM as KB" If we want to use a PLM like a KB, whether the PLM has the same inner workflow as KBs deserves to be considered. The prevalent KBs index knowledge as subject-predicate-object triplets and can infer with triplets + +(Speer et al., 2017; Bollacker et al., 2008; Vrandecic and Krötzsch, 2014). However, we find out that the knowledge-dependent association, which represents the process of inferring a missing object based on the given subject and predicate, has the lowest dependence in the PLMs. It provides evidence that the PLMs work quite differently with KBs and can not serve stably as KBs for now. + +Overfitting and Generalization Figure 4 shows the correlations between the dependence on associations and the mask-filling accuracy on pre-training samples (referred to as memorizing accuracy). The memorizing accuracy increases most as the dependence of the PC association increases, demonstrating that the more PLMs depend on the positionally close words, the better PLMs can recover the pretraining samples. However, there is an opposite trend in probing performance as shown in Figure 3. The additionally crafted queries used to evaluate the probing performance are mostly unseen in pertraining. If we consider these queries as the test set and the pre-training samples as the train set, we can conclude that the dependence on the PC associations makes the PLMs tend to overfit the training data and degrade the generalization on the test set. + +Factual Knowledge Capture in Pre-training We want to focus on the pre-training samples that help PLMs to capture factual knowledge. So we reconstruct the pre-training samples that predict some missing factual words (object) based on the factual clues (subject, predicate). We conduct the dependence measure on these samples to investigate how the factual knowledge is captured in pre-training. The mask-filling accuracy on these pre-training samples denotes how well PLMs memorize them + +![](images/b35563fe99e309daaf5c46101d888806739362b4fe0a8b8a498b0770a4646695.jpg) +(a) BERT-large-cased-wwm + +![](images/0a011179c0645d365a41b1d25e3ddc2edb5f5abc0120bfa3209299613e862e85.jpg) +(b) RoBERTa-large + +![](images/0b43450548f2b9c73b051f35c6df031ff8afffea69fa51e0908209ef813c1b93.jpg) +(c) SpanBERT-large +Figure 4: The correlations between the dependence on associations and the mask-filling accuracy on the pretraining samples (Wikipedia sentences). + +![](images/00a711b0ecfb9909bbfc69f4e952920349ee40272fe6c0eb467adae9514d201f.jpg) +(d) ALBERT-xxlarge-v2 + +in pre-training. We name it as "train" in Equation 9 and "Memorizing Accuracy" in Figure 4. + +Overlap between Associations The clues for different associations overlap sometimes, e.g., some remaining words may hold the KD and PC associations with the missing words at the same time. The overlaps do not impair the estimations because we use a set of samples to estimate the effect of each association. The samples that hold the same association stay in the same set, and the average causal effect in all these samples is the quantified dependence of this association. The sample sets are quite different for different associations. Table 5 shows the corresponding statistics of the overlaps. + +# 4 Related Works + +Probing Factual Knowledge in PLMs Factual Knowledge Probing in PLMs has attracted much attention recently. LAMA (Petroni et al., 2019) propose a benchmark that probes the factual knowledge in the PLMs with cloze-style prompts and shows PLMs' ability to capture factual knowledge. This ability can be further explored by tuning the prompts for probing Jiang et al. (2020); Shin et al. (2020); Zhong et al. (2021). + +Motivated by the probing results, some recent works analyze the captured factual knowledge from more perspectives. Cao et al. (2021) analyze the distribution of predictions and the answer leakage in probing. Poerner et al. (2020) propose that the PLMs could predict based on some correlation between surface forms rather than infer according to facts. Elazar et al. (2021a) reveal that the PLMs' outputs are inconsistent as querying the same fact with different prompts. + +This paper proposes a more fine-grained inspection of word-level patterns in the input. In addition to constructing more challenging probing data as input or analyzing the outputs more dually, we try + +to reveal the inner mechanism of PLMs by conducting intervention on the input and then observing the change in the output. + +Causal-inspired Interpretations in NLP A causal-inspired approach to explanation is to generate counterfactual examples and then compare the predictions (Feder et al., 2021a). Feder et al. (2021b) propose a framework for producing explanation for NLP models using counterfactual representation. Vig et al. analyze the effect of neurons (or attention heads) on the gender bias using causal mediation analysis. In this paper, we revisit the word-level post-hot interpretation (Sun et al., 2021; Li et al.) from a causal-effect perspective: intervene on some specified words in the input and measure the difference in the output to estimate the causal effect of these words. Furthermore, we evaluate the effectiveness of different causes by calculating correlations between their effects and performance. As far as we know, our work is the first study to probe and evaluate word-level patterns in the factual knowledge capture task. + +# 5 Conclusion + +In this paper, we try to answer the question of How Pre-trained Language Models Capture Factual Knowledge by measuring and evaluating different associations that PLMs use to capture factual knowledge. We present three word-level associations, knowledge-dependent, positionally close, and highly co-occurred in the analysis. The analysis results show that the PLMs rely more on the ineffective positionally close and highly co-occurred associations when capturing factual knowledge, and somewhat ignore the effective knowledge-dependent clues. These findings indicate that we should pay more attention to the knowledge-dependent association to let PLMs capture factual knowledge better. + +# References + +Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. 2008. Freebase: a collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD international conference on Management of data, pages 1247-1250. +Boxi Cao, Hongyu Lin, Xianpei Han, Le Sun, Lingyong Yan, Meng Liao, Tong Xue, and Jin Xu. 2021. Knowledgeable or educated guess? revisiting language models as knowledge bases. 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 1860-1874, Online. Association for Computational Linguistics. +Kenneth Ward Church and Patrick Hanks. 1990. Word association norms, mutual information, and lexicography. Computational Linguistics, 16(1):22-29. +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. +Yanai Elazar, Nora Kassner, Shauli Ravfogel, Abhilasha Ravichander, Eduard Hovy, Hinrich Schütze, and Yoav Goldberg. 2021a. Measuring and improving consistency in pretrained language models. Transactions of the Association for Computational Linguistics, 9:1012-1031. +Yanai Elazar, Shauli Ravfogel, Alon Jacovi, and Yoav Goldberg. 2021b. Amnesic probing: Behavioral explanation with amnesic counterfactuals. Transactions of the Association for Computational Linguistics, 9:160-175. +Hady Elsahar, Pavlos Vougiouklis, Arslen Remaci, Christophe Gravier, Jonathon Hare, Frederique Laforest, and Elena Simperl. 2018. T-rex: A large scale alignment of natural language with knowledge base triples. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018). +Amir Feder, Katherine A Keith, Emaad Manzoor, Reid Pryzant, Dhanya Sridhar, Zach Wood-Doughty, Jacob Eisenstein, Justin Grimmer, Roi Reichart, Margaret E Roberts, et al. 2021a. Causal inference in natural language processing: Estimation, prediction, interpretation and beyond. arXiv preprint arXiv:2109.00725. +Amir Feder, Nadav Oved, Uri Shalit, and Roi Reichart. 2021b. Causalm: Causal model explanation through counterfactual language models. Computational Linguistics, 47(2):333-386. + +Oktie Hassanzadeh. 2021. Predicting the future with wikidata and wikipedia. In Proceedings of the ISWC. +Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. 2020. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423-438. +Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. 2020 SpanBERT: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64-77. +Nora Kassner, Philipp Dufter, and Hinrich Schütze 2021. Multilingual LAMA: Investigating knowledge in multilingual pretrained language models. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 3250-3258, Online Association for Computational Linguistics. +Wilhelm Kirch, editor. 2008. Pearson's Correlation Coefficient, pages 1090-1091. Springer Netherlands, Dordrecht. +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. +Jiwei Li, Will Monroe, and Dan Jurafsky. Understanding neural networks through representation erasure. +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. CoRR, abs/1907.11692. +Judea Pearl. 2009. Causality. Cambridge university press. +Fabio Petroni, Tim Roktaschel, 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. +Nina Poerner, Ulli Waltinger, and Hinrich Schütze 2020. E-BERT: Efficient-yet-effective entity embeddings for BERT. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 803-818, Online. Association for Computational Linguistics. +Donald B Rubin. 1974. Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of Educational Psychology, 66(5):688. + +Taylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace, and Sameer Singh. 2020. AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4222-4235, Online. Association for Computational Linguistics. +Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. Conceptnet 5.5: An open multilingual graph of general knowledge. In *Thirty-first AAAI conference on artificial intelligence*. +Xiaofei Sun, Diyi Yang, Xiaoya Li, Tianwei Zhang, Yuxian Meng, Qiu Han, Guoyin Wang, Eduard Hovy, and Jiwei Li. 2021. Interpreting deep learning models in natural language processing: A review. arXiv preprint arXiv:2110.10470. +James A Thom, Jovan Pehcevski, and Anne-Marie Vercouestre. 2007. Use of wikipedia categories in entity ranking. arXiv preprint arXiv:0711.2917. +Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Yaron Singer, and Stuart Shieber. Investigating gender bias in language models using causal mediation analysis. +Denny Vrandecic and Markus Krötzsch. 2014. Wiki-data: a free collaborative knowledgebase. Communications of the ACM, 57(10):78-85. +Zexuan Zhong, Dan Friedman, and Danqi Chen. 2021. Factual probing is [MASK]: Learning vs. learning to recall. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5017-5033, Online. Association for Computational Linguistics. + +# Appendix + +# A Probing Sample Construction for the Dependence Measure + +We detail how we construct the probing samples for the dependence measure as follows. We take a subject-predicate-object triplet in Wikidata3 as a piece of factual knowledge (Petroni et al., 2019; Cao et al., 2021; Kassner et al., 2021; Elazar et al., 2021a). A subject-predicate-object triplet is aligned with a Wikipedia sentence by matching the subject, predicate, and object with their corresponding spans, respectively. A subject-predicate-object triplet is aligned with a Wikipedia sentence by matching the subject, predicate, and object with their corresponding spans, respectively. The words that correspond to the object are the factual words that are masked and need to be predicted, and we investigate how the different remaining words contribute to the prediction. + +The remaining words that have three typical associations with the masked words are considered in the analysis. The rules to identify the remaining words that have the Knowledge-Dependent (KD) association are: + +1. The $W_{o}$ and the $W_{t}$ describe the same subject-predicate-object triplet in KB. +2. The $W_{t}$ are the natural language description of the subject and predicate, the $W_{o}$ are that for the object. +3. If the subject and predicate corresponding to $W_{t}$ are given correctly (i.e., $W_{t} = \hat{w}_{t}$ ), the ground-truth value of the object is unique in the KB. + +The first rule makes the $W_{t}$ and $W_{o}$ grounded in the same piece of factual knowledge. The second rule makes predicting the outcome words similar to inferring the object using a KB when giving the subject and predicate. The third rule means if the treatment words are given correctly, there should be one and only one ground-truth value for the object. The third rule is similar to the N-1 relationship (Cao et al., 2021) in KB and lets the ground-truth treatment words can be regarded as a sufficient condition to predict the unique outcome words deterministically. + +We use the T-REx $^4$ dataset to provide the initial alignment between KB triplets and the Wikipedia sentences. We use the aliases in KB as keys for fuzzy string match (Levenshtein distance is less than 2, stemming before matching, etc.) to align more subjects, predicates, and objects with spans in the sentence. The sentences that have no aligned triplet are filtered out. + +Sometimes, the outcome words in a single sentence relate to multiple triplets that satisfy the rules for KB. E.g., there are two groups of remaining words that can infer the outcome words deterministically based on KB. We select them all as the $W_{t}$ when probing the KB association and keep the number of the masked words be the same in interventions for the other associations. $D_{\mathrm{KD}}$ , $D_{\mathrm{PC}}$ , and $D_{\mathrm{HC}}$ denote the sample sets for the Knowledge-Dependent (KD), Positionally Close (PC), and Highly Co-occurred (HC) associations, respectively. + +For the Highly Co-occurred association (HC), the remaining words that are top- $k$ in PMI with the ground-truth outcome words $\hat{w}_o$ are selected as $W_t$ . The $k$ is the number of words with the KD associations for the same sentence. The PMI between words is calculated by all the Wikipedia sentences. If the $\hat{w}_o$ consists of multiple words, occurring with all the words in $\hat{w}_o$ altogether are taken as co-occurring. The order of the words in $\hat{w}_o$ are ignored for efficiency. Table 5 shows more details about the probing samples. + +# B More Probing Results + +The Pearson correlation coefficients between the dependence on associations (raw value without standardization) and the performance are shown in Table 8. The three metrics, accuracy (defined in Equation 6), consistency (defined in Equation 7), and the overall performance metric (defined in Equation 8), are reported respectively. The correlation coefficients between the dependence and the performance are consistent with the slopes of the regression lines in Figure 3. Table 6 shows the accuracy decreasing results after masking the treatments words when generating the missing words in Wikipedia sentences. + +
Probing Samples in Dependence Measure
# Average treatment words4.0023
# Average outcome words1.8588
# Average words23.1031
Word-level Overlap Between Associations
DKD∩Hc44.25% (8,455,641)
KD∩Pc20.83% (3,981,305)
Pc∩Hc18.75% (3,582,576)
KD∩Pc∩Hc8.3349% (1,592,560)
Sample-level Overlap Between Associations
KD∩Hc3.12% (149,479)
KD∩Pc0.06% (2,995)
Pc∩Hc0.12% (5,777)
KD∩Pc∩Hc0.0001% (547)
Template-based Queries in Effectiveness Measure
# Average treatment words1.9484
# Average outcome words1.5844
# Average word per sample6.9617
+ +Table 5: Statistic of the probing data in the dependence measure. + +
ModelInput Context (Accuracy, %)
Completew/o KDw/o PCw/o HCw/o R
BERT-base-cased36.2322.05 (-14.17)2.67 (-33.56)19.68 (-16.54)26.71 (-9.52)
BERT-large-cased36.9222.11 (-14.81)2.70 (-34.22)19.04 (-17.88)27.11 (-9.81)
BERT-large-cased-wwm50.3035.22 (-15.08)11.50 (-38.80)26.09 (-24.21)39.04 (-11.25)
SpanBERT-large52.2336.87 (-15.35)16.66 (-35.57)26.78 (-25.44)39.87 (-12.35)
RoBERTa-base35.1123.07 (-12.03)4.81 (-30.30)16.38 (-18.72)25.70 (-9.41)
RoBERTa-large42.7628.26 (-14.50)8.98 (-33.78)21.21 (-21.54)32.67 (-10.09)
BERT-base-uncased36.9023.53 (-13.37)3.33 (-33.58)20.78 (-16.12)28.53 (-8.37)
BERT-large-uncased38.6224.58 (-14.04)2.88 (-35.74)21.61 (-17.00)29.83 (-8.79)
BERT-large-uncased-wwm50.3535.03 (-15.31)11.92 (-38.43)26.16 (-24.18)39.03 (-11.32)
ALBERT-xxlarge-v247.5823.02 (-24.56)11.58 (-36.00)15.25 (-32.34)24.42 (-23.16)
ALBERT-xlarge-v240.8716.13 (-24.74)8.15 (-32.72)9.57 (-31.30)15.11 (-25.76)
ALBERT-large-v239.028.03 (-30.99)3.82 (-35.20)4.52 (-34.50)9.00 (-30.02)
ALBERT-base-v232.763.63 (-29.13)1.74 (-31.03)1.76 (-31.00)3.63 (-29.13)
ALBERT-xxlarge-v147.5023.68 (-23.83)12.20 (-35.30)15.79 (-31.71)25.27 (-22.24)
ALBERT-xlarge-v148.1921.15 (-27.04)11.81 (-36.38)12.82 (-35.38)22.57 (-25.62)
ALBERT-large-v143.6414.14 (-29.50)7.52 (-36.12)7.93 (-35.71)14.80 (-28.84)
ALBERT-base-v140.9527.39 (-13.56)13.13 (-27.83)19.30 (-21.65)30.05 (-10.90)
+ +Table 6: The accuracy of the predictions when different treatment words are missing. + +
ModelATE of Association (k = 100/k = 1)
KDPCHCR
BERT-base-cased0.1585/0.14160.4085/0.33540.1779/0.16540.1081/0.0950
BERT-large-cased0.1603/0.14800.4113/0.34200.1791/0.17880.0996/0.0979
BERT-large-cased-wwm0.1384/0.15060.4477/0.38790.2305/0.24210.1072/0.1124
SpanBERT-large0.1351/0.15330.3679/0.35550.2383/0.25440.1157/0.1233
RoBERTa-large0.1360/0.14380.3962/0.33660.2162/0.21540.0985/0.0997
RoBERTa-base0.1352/0.11920.3926/0.30180.2093/0.18720.1053/0.0929
BERT-base-uncased0.1439/0.13370.4112/0.33570.1643/0.16120.0901/0.0837
BERT-large-uncased0.1522/0.14030.4401/0.35730.1713/0.17000.0946/0.0879
BERT-large-uncased-wwm0.1410/0.15310.4350/0.38420.2290/0.24180.1089/0.1131
ALBERT-base-v20.3987/0.29110.4269/0.31000.4269/0.31000.4021/0.2911
ALBERT-large-v20.4075/0.30980.4716/0.35190.4566/0.34500.3958/0.3001
ALBERT-xlarge-v20.3279/0.24740.4336/0.32720.4170/0.31300.3468/0.2576
ALBERT-xxlarge-v20.2852/0.24570.4338/0.36010.3801/0.32340.2704/0.2317
ALBERT-base-v10.1429/0.13550.3235/0.27820.2287/0.21650.1167/0.1089
ALBERT-large-v10.3638/0.29510.4569/0.36120.4488/0.35710.3621/0.2884
ALBERT-xlarge-v10.3223/0.27050.4425/0.36390.4266/0.35380.3116/0.2563
ALBERT-xxlarge-v10.2761/0.23840.4230/0.35310.3708/0.31710.2590/0.2224
+ +Table 7: The ATE of associations in more PLMs. + +
ModelAssociations (joint/accuracy/consistency)
KDPCHCR
BERT-base-cased0.1523/0.2222/0.0768-0.2156/-0.1839/-0.15970.0011/0.0180/-0.0137-0.0823/-0.0774/-0.0621
BERT-large-cased0.1398/0.1879/0.0788-0.1638/-0.1120/-0.1295-0.0017/0.0095/-0.0141-0.0810/-0.0741/-0.0638
BERT-large-cased-wmm0.2492/0.2795/0.1627-0.1904/-0.1783/-0.12900.0800/0.0851/0.0422-0.0487/-0.0455/-0.0417
SpanBERT-large0.2463/0.2784/0.1382-0.1068/-0.0781/-0.11870.1017/0.1175/0.0254-0.0384/-0.0307/-0.0391
RoBERTa-base0.2432/0.3062/0.1223-0.0414/-0.0440/-0.03660.0966/0.1252/0.0297-0.0201/-0.0054/-0.0423
RoBERTa-large0.2212/0.2666/0.1141-0.1131/-0.1455/-0.06420.0749/0.0911/0.0156-0.0311/-0.0441/-0.0236
BERT-base-uncased0.1635/0.2233/0.0954-0.1454/-0.1269/-0.11820.0130/0.0410/-0.0114-0.0659/-0.0630/-0.0596
BERT-large-uncased0.1507/0.2022/0.0749-0.2056/-0.1900/-0.10840.0247/0.0355/0.0085-0.0671/-0.0667/-0.0454
BERT-large-uncased-wmm0.2526/0.2776/0.1593-0.1772/-0.1589/-0.13460.0866/0.0886/0.0344-0.0462/-0.0419/-0.0401
ALBERT-base-v20.0453/0.0530/0.0347-0.1054/-0.1333/-0.04170.0071/-0.0005/0.0371-0.0886/-0.1186/-0.0117
ALBERT-large-v20.0809/0.0988/0.0370-0.1130/-0.1457/-0.08260.0201/0.0158/0.0093-0.0822/-0.1061/-0.0707
ALBERT-xlarge-v20.1515/0.2161/0.1064-0.1184/-0.1152/-0.07590.0278/0.0524/0.0154-0.0997/-0.0978/-0.0627
ALBERT-xlarge-v20.1685/0.1954/0.1347-0.1549/-0.1552/-0.10390.0445/0.0492/0.0496-0.0783/-0.0759/-0.0559
ALBERT-base-v10.3034/0.3563/0.1764-0.0650/-0.0504/-0.10100.1564/0.1724/0.04970.0111/0.0175/-0.0202
ALBERT-large-v10.1466/0.1741/0.1145-0.0384/-0.0639/-0.00370.0598/0.0530/0.0606-0.0186/-0.0408/0.0026
ALBERT-xlarge-v10.1593/0.1816/0.1486-0.0514/-0.0629/-0.00060.0498/0.0338/0.1172-0.0081/-0.0288/0.0431
ALBERT-xlarge-v10.1926/0.2207/0.1462-0.1314/-0.1346/-0.09290.0629/0.0647/0.0526-0.0563/-0.0535/-0.0475
+ +Table 8: The Pearson correlation coefficients between the ATEs and the factual knowledge capture metrics. \ No newline at end of file diff --git a/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/images.zip b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..24cbbcc4ca27df13c3fa8e363c85e01d1438207e --- /dev/null +++ b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44e2f7d2d557899a6ea9d0d5a477da6c1d6dbaa193170e285182441e492e33a9 +size 902006 diff --git a/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/layout.json b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1fcdad99c81a5f6d28b07b445dae6dcb49819fe4 --- /dev/null +++ b/howpretrainedlanguagemodelscapturefactualknowledgeacausalinspiredanalysis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72938691dbc2053a64638207b0665d70d96a1716c5750d78c670130d06b65c4c +size 419503 diff --git a/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_content_list.json b/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6c8baade399df3da91726ecf896cd2798f72c503 --- /dev/null +++ b/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25c8bc4d84c123d6945b8f70689b936ed04a4d2d1cc79b84b69978b86b35fa2b +size 99529 diff --git a/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_model.json b/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b812b08e2263784df97412556d0a31810ea9059d --- /dev/null +++ b/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ada3c947629818f29a4b840648b2ca82e16b9e6eb9657885c6f61f926822bc76 +size 118021 diff --git a/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_origin.pdf b/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4374a42b88d31403309f80b864de15fbcf1ae2cb --- /dev/null +++ b/humanlanguagemodeling/70d53ceb-21e5-4bb9-9578-b711aad7cc82_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9c2f98c8f0b3e9e4322bfb705cacbdc6c3bab2d573a650ca8938e0bd1fd894c +size 561806 diff --git a/humanlanguagemodeling/full.md b/humanlanguagemodeling/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1cadf88f7abcb669532202a116ab63cb44d801dc --- /dev/null +++ b/humanlanguagemodeling/full.md @@ -0,0 +1,365 @@ +# Human Language Modeling + +Nikita Soni, Matthew Matero, Niranjan Balasubramanian, and H. Andrew Schwartz +Department of Computer Science, Stony Brook University +{nisoni, mmatero, nirajan, has}@cs.stonybrook.edu + +# Abstract + +Natural language is generated by people, yet traditional language modeling views words or documents as if generated independently. Here, we propose human language modeling (HuLM), a hierarchical extension to the language modeling problem whereby a human-level exists to connect sequences of documents (e.g. social media messages) and capture the notion that human language is moderated by changing human states. We introduce, HaRT, a large-scale transformer model for the HuLM task, pre-trained on approximately 100,000 social media users, and demonstrate its effectiveness in terms of both language modeling (perplexity) for social media and fine-tuning for 4 downstream tasks spanning document-and user-levels: stance detection, sentiment classification, age estimation, and personality assessment. Results on all tasks meet or surpass the current state-of-the-art. + +# 1 Introduction + +Language use, like any human behavior, is moderated by underlying human states of being (Mehl and Pennebaker, 2003; Fleeson, 2001). Indeed, different ways of incorporating human information into NLP models have recently been shown to improve accuracy on many NLP tasks (Hovy, 2015; Lynn et al., 2017; Huang and Paul, 2019; Hovy and Yang, 2021). At the same time, while language modeling has proven itself fundamental to NLP, it is typically absent the notion of a human producing the natural language. + +From a statistical modeling perspective, this absence of human state can be seen as an instance of the ecological fallacy – the treatment of multiple observations (i.e. text sequences) from the same source (i.e. human) as independent (Piantadosi et al., 1988; Steel and Holt, 1996). + +To address this, we introduce the task of human language modeling (Hulm), which induces dependence among text sequences via the notion of a human state in which the text was generated. In particular, we formulate Hulm as the task of estimating the probability of a sequence of tokens, $w_{t,1:i}$ , while conditioning on a higher order state $(\mathbf{U}_{1:t-1})$ derived from the tokens of other documents written by the same individual. Its key objective is: + +$$ +P r \left(w _ {t, i} \mid w _ {t, 1: i - 1}, \mathbf {U} _ {1: t - 1}\right) +$$ + +where $t$ indexes a particular sequence of temporally ordered utterances (e.g. a document or social media post), and $\mathbf{U}_{1:t-1}$ represents the human state just before the current sequence, $t$ . In one extreme, $\mathbf{U}_{1:t-1}$ could model all previous tokens in all previous documents by the person. In the opposite extreme, $\mathbf{U}_{1:t-1}$ can be the same for all users and for values of $t$ reducing to standard language modeling: $Pr(w_i | w_{1:i-1})$ . Thus, HULM-based models without history can be used where traditional LMs are applied (and may even perform better). + +HuLM brings together ideas from human factor inclusion/adaptation (Hovy, 2015; Lynn et al., 2017; Hovy and Yang, 2021) and personalized modeling (King and Cook, 2020; Jaech and Ostendorf, 2018) into the framework of large pretrained language models. Compared to traditional language modeling, HuLM offers several technical advantages. First, the human state serves as a higher order structure that induces dependence between the text sequences of the same person/ thus posing a language modeling problem that is a more faithful treatment of human-generated natural language. Second, conditioning on prior texts of an individual can be seen as an implicit integration of text-derived human factors without having to explicitly model the identity of the individual. + +This enables fine-tuning of such a model to many downstream tasks. Third, using the temporally ordered prior texts for human contexts can be seen as a way to track the dynamic nature of human states (e.g. emotions, daily activities) and be combined to yield more stable personality traits (e.g., extraversion, openness). + +To build a language model that effectively addresses the HULM task, we develop HaRT, a human-aware recurrent transformer. HaRT is built using a new user-state based attention layer, that connects standard word sequence transformer layers in order to incorporate the human context. The recurrent user state allows HaRT to effectively model long contexts necessary to handle all the previous messages written by an individual. We train HaRT on the HULM task defined over a large collection of social media texts spanning 100K users and apply it (fine-tuning) on 2 downstream message-level tasks: stance detection (Mohammad et al., 2016), and sentiment analysis (Nakov et al., 2013) as well as 2 human-level tasks: age estimation and personality assessment (Schwartz et al., 2013). + +Contributions. Our contributions are threefold: (1) We introduce the task of human language modeling (HuLM), providing a mathematical definition and relation to traditional language modeling; (2) We propose HaRT, a novel transformer-based model for performing HuLM and capable of being fine-tuned to specific tasks including user-level tasks for which traditional language models cannot be applied without architectural alterations; (3) We evaluate HaRT, demonstrating state-of-the-art performance on five tasks: social media language modeling (perplexity), two document-level tasks (sentiment analysis and stance detection), and two user-level tasks (personality-openness assessment, and age estimation). + +# 2 Related Work + +Recent advances in language model pre-training have led to learned representation of text. Pretraining methods have been designed with different training objectives, including masked language modeling (Devlin et al., 2019) and permutation-based auto-regressive language modeling (Yang et al., 2019). These have contributed in building deep autoencoding architectures, allowing the same pre-trained model to successfully tackle + +a broad set of NLP tasks. While pre-training over large collections of text helps models acquire many forms of linguistic and world knowledge(Petroni et al., 2019; Jiang et al., 2020; Rogers et al., 2020), they are still devoid of the information about the text creator. + +Recently, it has been suggested that the NLP community address the social and human factors to get closer to the goal of human-like language understanding (Hovy and Yang, 2021). This call builds on a series of studies suggesting that integrating the human context into natural language processing approaches leads to greater accuracy across many applications in providing personalized information access (Dou et al., 2007; Teevan et al., 2005) and recommendations (Guy et al., 2009; Li et al., 2010; De Francisci Morales et al., 2012). The idea of contextualizing language with extra linguistic information has been the basis for multiple models: Hovy (2015) learn age- and gender-specific word embeddings, leading to significant improvements for three text classification tasks. Lynn et al. (2017) proposed a domain adaptation-inspired method for composing user-level, extra-linguistic information with message level features, leading to improvements for multiple text classification tasks. Welch et al. (2020a) propose a new form of personalized word embeddings that use demographic-specific word representations. + +In addition to addressing to social and human factors, recent work has also focused on personalized language models (King and Cook, 2020; Jaech and Ostendorf, 2018) learning author representations (Delasalles et al., 2019) and personalized word embeddings (Lin et al., 2017) pointing out the importance of personalized semantics in understanding language. Welch et al. (2020b) explore personalized versus generic word representations showing the benefits of both combined. While these models are trained for singular user, Mireshghallah et al. (2021) trains a single shared model for all users for personalized sentiment analysis. However, the approach is not scalable as it is still user specific and expects a unique user identifier. + +While not the primary goal, human language modeling may yield effective approaches to extend the context during language modeling. Thus, an aspect of this work can be seen as part of the recent pursuit of sequence models that cap + +ture dependencies beyond a fixed context length (Dai et al., 2018; Beltagy et al., 2020). For example, Keskar et al. (2019) and Dathathri et al. (2019) propose controllable language generation using one or more attribute classifiers or control codes. Guu et al. (2020) propose augmented language model pretraining with a latent knowledge retriever which allows the model to retrieve and attend over documents from a large corpus. These models extend context limits, but they do not model the higher order structure capturing a notion of the common source of documents i.e., the author. On the other hand, Yoshida et al. (2020) fits a hierarchical model extension to language modeling by adding recurrence to a pretrained language model. This idea forms a basis for our proposed HuLM architecture, HaRT, but Yoshida et al. do not exploit the inherent higher order structure (i.e. the model was not used for HuLM). + +# 3 Human Language Modeling (HuLM) + +Our goal is to re-formulate the language modeling task into one that directly enables a higher-order dependence structure that represents a human generating the language. + +Language modeling formulations pose probabilistic questions over text represented as sequences of tokens. The main goal is to model the probability of observing a given token sequence in the language as a whole. In particular language models (LMs) estimate the joint probability of the tokens in the string, defined in terms of the probabilities of each token in the sequence conditioned on the previous tokens. Given a string $\mathbf{W} \in \mathbb{L}$ , a sequence of $n$ tokens $\langle w_1, w_2, \dots, w_n \rangle$ , the probability of observing the string $\mathbf{W}$ in the language $\mathbf{L}$ is computed as: + +$$ +P r (\mathbf {W}) = \prod_ {i = 1} ^ {n} P r (w _ {i} | w _ {1: i - 1}) \tag {1} +$$ + +We pose the human language modeling problem (HuLM), where the goal is to model the probabilities of observing a sequence from the language as generated by a specific person. An initial idea might be to pose this task as conditioning the probability of a string, $w_{i}$ on a static representation of + +the person (or user, $\mathbf{U}_{\mathrm{static}}$ ): + +$$ +P r (\mathbf {W} | \mathbf {U} _ {\text {s t a t i c}}) = \prod_ {i = 1} ^ {n} P r (w _ {i} | w _ {1: i - 1}, \mathbf {U} _ {\text {s t a t i c}}) \tag {2} +$$ + +This addresses the first of the two goals we presented in the introduction, namely avoiding the ecological fallacy of assuming sequences from the same person are independent. However, it does not respect the idea that people vary in mood and can change. More precisely, human behaviors (language use) are influenced by dynamic human states of being (Fleeson, 2001; Mehl and Pennebaker, 2003). Thus, we pose HuLM with a more general formulation that enables the idea of a dynamic representation of humans, the user state $\mathbf{U}_t^4$ : + +$$ +P r \left(\mathbf {W} _ {t} \mid \mathbf {U} _ {t - 1}\right) = \prod_ {i = 1} ^ {n} P r \left(w _ {t, i} \mid w _ {t, 1: i - 1}, \mathbf {U} _ {1: t - 1}\right) \tag {3} +$$ + +where $t$ indexes a particular sequence of temporally ordered utterances (e.g. a document, or set of social media message). While $w_{t,i}$ is drawn from a multinomial distribution, $\mathbf{U}_{1:t-1}$ can be from any discrete or continuous multivariate distribution. + +In one extreme, $\mathbf{U}_{1:t - 1}$ could model all previous tokens in all previous documents by one person. In the opposite extreme, $\mathbf{U}_{1:t - 1}$ can be the same for all values of $t$ , giving a static representation for a user (equivalent to Equation 2) or even static across users which reduces to a standard language modeling version (equivalent to Equation 1). Still, modeling a user via their previous documents provides a seamless way to integrate the user information into language models – the only change is that the models will now have to incorporate more text when they are making predictions. Note that this problem formulation does not directly require explicit modeling of the identity of a user. This makes it easier to handle new users in downstream tasks and test instances, or creating models that can be further fine-tuned to both document- and user-level tasks. + +HuLM in Practice. Like traditional language models, there are two steps to applying HuLM based models to most tasks and applications: pretraining and fine-tuning. During pre-training, the + +model is trained on unlabeled data over Human Language Modeling (HuLM) pre-training task above. For finetuning, a HuLM based model is first initialized with the pre-trained parameters, and all of the parameters are fine-tuned using labeled data from the downstream tasks. Each downstream task has separate fine-tuned models, even though they are initialized with the same pretrained parameters. + +# 4 Human-aware Recurrent Transformer + +This section introduces, HaRT, a human-aware recurrent transformer that trains on the human language modeling (HuLM) formulation. + +HaRT is designed to produce human-aware contextual representations of text at multiple levels. HaRT's design is motivated by two goals: (i) We want to support hierarchical modeling, i.e., to hierarchically represent the set of all-messages written by a user and at the same time have human-aware contextual word representations. This implicitly entails modeling large context size. For example, GPT-2 (Radford et al., 2019) uses a context size of 1024 tokens, whereas our estimate of the average context size for a Twitter user is more than 12000 tokens. (ii) To support user-level tasks (e.g. personality assessment (Lynn et al., 2020)), we need representations of the entire set of messages written by a user capturing the inherent human states that broadly encompasses the user representation. + +HaRT addresses the hierarchical language modeling issue by processing all messages written by a user in a temporally ordered sequence of blocks. It uses a recurrence structure to summarize information in each block into a user state vector, which is then used to inform the attention between tokens in the subsequent block. For human-level tasks the aggregate of user states can be used as the representation of the entire context for the user. + +The idea of adding recurrence to pre-trained transformers builds on Yoshida et al. (2020)'s method for handling long contexts. However, the main difference is that HaRT models the input data (language) in the context of its source (user) along with inter-document context, thus enabling a higher order structure representing human context. + +# 4.1 HaRT Architecture + +Figure 1 shows the overall architecture for HaRT. It consists of a one modified transformer layer + +![](images/9682705201a71f2362c6a4b3a374ca9341eb6a1735a4aaba84b210408ce782c2.jpg) +Figure 1: HaRT architecture: HaRT processes a user's messages in blocks. It produces contextualized representations of messages in each block conditioning on a recurrently computed user state. The user state is inserted into an earlier layer (layer 2) to inform the self-attention computation via a modified query transform. The previous user state is then recurrently updated using the output of a later layer (layer 11). + +with a user-state based self-attention mechanism over more token-level standard self-attention based transformer layers from a pre-trained transformer (GPT-2). + +Inputs and Outputs Each input instance to HaRT consists of a temporally ordered sequence of messages (by message created time) from a given user $a$ , $\mathcal{M}_a = \langle M_1, \dots, M_n \rangle$ . We segment these messages into fixed sized blocks, $\mathcal{B}_a = \langle B_1, \dots, B_k \rangle$ . We sequentially fit messages into blocks, separating messages using a newly introduced special token $< |insep|>$ . If the number of tokens in a block falls short of the block size, we fill it with padded tokens. $k$ is a hyperparameter during training used to cap the maximum number of blocks controlling the amount/size of user history that is fed to the model. If the messages for a user fill less than $k$ blocks, we pad the rest to maintain the same size for each instance. + +For each block $B_{i}$ , HaRT outputs (i) contextualized representations of the tokens within the block conditioned on the previous user state $(U_{i-1})$ , and (ii) an updated representation of the user state, $U_{i}$ , which now also includes the information from the current block $B_{i}$ . We use the representation of the last non-pad token of a message as its representation for message-level tasks, and use the average of the user-states from all the blocks of a user as that user's representation for user-level tasks. + +User-State based Self-Attention HaRT constructs a user-state representation vector by combining information from each block in a recurrent + +manner. After processing the inputs in a given block $B_{i}$ , HaRT extends the previous user state $U_{i-1}$ with information from current block $B_{i}$ using the output representations $H^{(E)}$ from one of the later layers (we denote as the extract layer $L_{E}$ ). The recurrence for the new user state $U_{i}$ is: + +$$ +U _ {i} = \tanh \big (W _ {U} U _ {i - 1} + W _ {H} H ^ {(E)} \big) \qquad (4) +$$ + +The user state for the first block $U_{0}$ is initialized with the average of the (pretrained GPT-2) layer 11 outputs for words from the messages of more than 500 users (of the train set) computed using Schwartz et al. (2017). + +To produce the user-state conditioned contextual representations at a given layer, HaRT uses a modified self-attention procedure to one of the earlier layers, which we denote as the insert layer $(L_{IN})$ . The idea is to create a new query transform which includes the user-state vector, so that the attention between tokens is informed by the context of the previous messages written by the user. To this end, we take input hidden states to this insert layer $H_{i}^{IN - 1}$ , concatenate it with the user-state vector from the previous block $U_{i - 1}$ and then apply a linear transformation (using $W_{q}$ ) to obtain the query vectors $(Q_{i}^{IN})$ for the self-attention computation. + +$$ +Q _ {i} ^ {I N} = W _ {q} ^ {T} \left[ H _ {i} ^ {(I N - 1)}; U _ {i - 1} \right] \tag {5} +$$ + +The key, value transforms and the rest of the self-attention computation and further processing in the transformer to produce the output representations from the layer, all remain the same as in the original GPT-2 model. + +Implementation Choices There are multiple alternatives for a HaRT implementation including how to construct the user state, where and how to inject user state information. In our preliminary experiments we experimented with different extract layers but found that constructing user state from the penultimate layer (Layer 11) and injecting the user state in a single earlier layer (Layer 2 used by Yoshida et al. (2020)) to modify the query transformation was the most effective empirically. + +# 4.2 Pre-training HaRT + +HaRT is pre-trained using the HULM task in an autoregressive manner. + +The HULM task as defined in Equation 3 asks to predict a token that appears in a token sequence + +(i.e. a user's social media message) given the previous tokens in the sequence while also conditioning on previous user states. We turn this task into a pre-training objective defined over block segmented token sequences from a user. For each block of a given user, the task is to predict each token in the block while conditioning on (i) the previous tokens within the current block which are directly available as input, and also (ii) the tokens from the previous blocks that are available to HaRT through the recurrent user state. Formally, the pre-training objective is to maximize: + +$$ +\prod_ {a \in \text {U s e r s}} \prod_ {t = 1} ^ {| \mathcal {B} _ {a} |} \prod_ {i = 1} ^ {| B _ {t} ^ {(a)} |} P r \left(w _ {t, i} \mid w _ {t, 1: i - 1}, B _ {1: t - 1} ^ {(a)}\right) \tag {6} +$$ + +where, $w_{t,i}$ is the $i^{th}$ token in the $t^{th}$ block $(B_t^{(a)})$ for user $a$ . + +Pre-training data For the pre-training corpus we combine a subset of the Facebook posts dataset from Park et al. (2015), a subset of the County Tweet Lexical Bank (Giorgi et al., 2018) appended with newer 2019 and 2020 tweets, in total spanning 2009 through 2020. We filter the datasets to only include tweets marked as English from users who have at least 50 total posts and at least 1000 words in total, ensuring moderate language history for each user. The resulting dataset consists of just over 100,000 unique users, which we split into a train dataset consisting of messages from 96,000 users, a development dataset that consists of messages from 2000 users that were not part of the training set (unseen) and new messages from 2500 users seen in the training set, and a test set of messages from a separate set of 2000 unseen users that are neither in training or the development set. + +We refer to this as the HuLM-Corpus (HLC). + +# 4.3 Fine-tuning HaRT + +In the tradition of transformers for traditional language modeling, HaRT shares the same architecture for both pre-training and fine-tuning except for the output layers. It has a unified architecture across different downstream tasks. For finetuning, HaRT is first initialized with the pretrained parameters, and all of the parameters are fine-tuned using labeled data from the downstream tasks. Each downstream task has separate finetuned models, even though they are initialized with the same pre-trained parameters. Apart from using the labeled data from the downstream tasks, + +we also use the historical messages (when available) from the respective users to replicate the format of pre-training inputs and to benefit from the knowledge of the user. + +# 5 Evaluation: Human Language Modeling + +We seek to compare HaRT with a standard language model that is exposed to the same data but without modeling the notion of a user. Thus, we compare HaRT's human language modeling performance to the model it was based, GPT-2. For calibration we report performance on GPT-2's original pre-trained version (GPT-2frozen), and a version of the LM that was fine-tuned on the HuLMCorpus (GPT-2HLC). + +We train and evaluate the models using the train and test splits of the HuLM-Corpus described in Section 4.2. For hyperparameter search, we use the full development set of both seen and unseen users. Each training instance for HaRT is capped to 8-blocks of 1024-tokens each. Following previous work fine-tuning transformer language models for social media (V Ganesan et al., 2021), GPT-2 was trained over individual messages. We train both for five epochs and set the learning rate, batch size, and stopping patience based on the development set (see Appendix A.3). For HaRT, we initialize all GPT-2 self-attention layers with the corresponding weights in the pre-trained GPT-2. The user-state based self-attention layer weights (query, key, and value) are normal initialized with 0 mean and 0.02 standard deviation. + +Perplexity Table 1 reports the perplexity of all three models on the messages from the unseen users of the development split and the entire test split of HuLM-Corpus. The frozen pre-trained GPT-2 (GPT-2frozen) fares poorly to the domain mismatch while the fine-tuned version (GPT-2HLC) fares much better. However, the human language model HaRT achieves the best performance by a large margin, with a significant reduction in perplexity by more than $46\%$ on the test set relative to GPT-2HLC $(p < .001)$ . + +Effect of History Size. We further analyze the effect of history size by varying the amount of language, in terms of blocks, used per user. Figure 2 + +
ModelDev (ppl)Test (ppl)
GPT-2frozen112.82116.35
GPT-2HLC47.6148.51
HaRT27.49*26.11*
+ +Table 1: Comparing HaRT as a language model to GPT-2frozen, the frozen pre-trained GPT-2 and GPT-2HLC, the GPT-2 model fine-tuned on the HuLM-Corpus. HaRT shows large gains with a substantial reduction in perplexity compared to both versions of GPT-2. Bold font indicates best in column and * indicates statistical significance $p < .05$ via permutation test w.r.t GPT-2HLC + +![](images/0a6ba7d2f3ca19c52ed2b535937e9a9100bd0ebf8c2f84608e8c3dca7e04bcad.jpg) +Figure 2: . Perplexity scores, on test sets as a function of history size (number of blocks) used when training HaRT. Each block consists of 1024 tokens. Adding more history improves language modeling performance with big reduction going from 2 to 4 blocks and a smaller reduction from 4 to 8 blocks. + +shows that adding more history in general helps, with a big reduction in perplexity going from 2 to 4 blocks and a further reduction going from 4 to 8 blocks. Adding more context can induce a need to effectively balance likelihood of finding more important signals against the increasing chances of it drowning in less important information. + +# 6 Evaluation: Fine-tuning for Downstream Tasks + +Here, we evaluate the utility of fine-tuning HaRT for document- and user-level tasks. Just as standard transformer language models are fine-tuned for tasks, we take our pre-trained HaRT model and fine-tune it for stance detection, sentiment classification, age estimation, and personality (openness) assessment tasks. For both sets of tasks we compare fine-tuning the GPT-2HLC as a non-user-based LM baseline and also report previously published results from other task specific models, most of which employ historical context for re + +
ModelAge (r)OPE (r_dis)Stance (F1)Sentiment (F1)
GPT-2HLC0.8390.52168.6076.75
HaRT0.868*0.619*71.10*78.25*
+ +spective tasks. All hyperparameter settings and training details for the GPT-2 $_{\text{HLC}}$ and HaRT models for each task are listed in Appendix A.3. + +# 6.1 Document-Level Tasks + +We consider two document-level tasks that require models to read an input document (message) written by a user and output a label (stance of the user towards a topic or the sentiment expressed in the text). To fine-tune HaRT on these tasks, with each document we collect and attach previous messages written by the same users, represented using the procedure we outlined in Section 4.3. Thus, HaRT processes this input to produce message-and human-contextualized token-level representations. We represent the document by its last non-padded token representation and feed it to classification layer with a prior layer norm for predicting the output label. GPT-2HLC, without hierarchical structure, only uses the input document to make predictions. We fine-tune all parameters of HaRT and GPT-2HLC, as well as the classification layer weights using the standard cross-entropy loss (calculated only over the last non-padded token of the target (labeled) messages). + +Stance Detection. For stance detection we use the SemEval2016 dataset (Mohammad et al., 2016), which contains tweets annotated as being in favor of, against, or neutral toward one of five targets: atheism, climate change as a real concern, feminism, Hillary Clinton, and legalization of abortion. This data only includes labeled tweets from users and not any history, so we use the extended dataset from Lynn et al. (2019) and pre + +Table 2: We fine-tune HaRT and GPT-2HLC (GPT-2 fine-tuned for LM on the same data) for 4 downstream tasks: Age, Openness (OPE), Stance, and Sentiment, and find HaRT to perform better on all 4 tasks. For age and openness, we fine-tune HaRT only for the recurrence module, and fine-tune only the last 2 layers of GPT-2HLC. For stance and sentiment, we fine-tune full models. Results are reported in pearson r for Age, disattenuated pearson r for OPE and weighted F1 for Stance/Sentiment. Bold indicates best in column and * indicates statistical significance $p < .05$ via permutation test. + +
ModelStance (F1)Sentiment (F1)
MFC54.228.0
Lynn et al. (2019)65.969.5
MeLT66.663.0
BERTweet68.877.9
HaRT71.1*78.3*
+ +Table 3: We compare HaRT's performance on document level downstream tasks: Stance and Sentiment, against state of the art results. We also fine-tuned pretrained GPT-2, BERTweet (Nguyen et al., 2020), and MeLT (Matero et al., 2021) on both tasks for baselines. HaRT performs the best in both tasks with a substantial gain. Results are reported in weighted F1. Bold indicates best in column and * indicates statistical significance $p < .05$ w.r.t BERTweet via permutation test. + +serve the train/dev/test split of the same. To maintain (message created time) temporal accuracy in our autoregressive model, we only used the part of the extended dataset (history) that consists of messages posted earlier than the labeled messages. + +Sentiment Analysis. We use message-level sentiment annotations indicating positive, negative, and neutral categories from the SemEval-2013 dataset (Nakov et al., 2013). As with stance, we use a part of the extended dataset from Lynn et al. (2019) to get associated message history, and preserve the train/dev/test split of the same. + +# 6.2 User-Level Tasks + +We evaluate HaRT for age estimation and personality (openness) assessment, social scientific tasks which require producing outcomes at the user-level. We use a subset of the data from consenting users of Facebook who shared their Facebook posts along with demographic and personality scores (Kosinski et al., 2013; Park et al., 2015). + +For these user-level tasks we can leverage the recurrent user states in HaRT to produce a representation of the user. We represent the input as described in Section 4.3, and use the average of the user-states vectors from the non-padded blocks of each user and layer norm it to make predictions using a linear classifying layer to predict 1 label (regression task). We use only 4 blocks of history when training to fine-tune. + +For GPT-2HLC, since it can't directly handle all of the users text in one go, we replicate the user label for each message of the respective users and + +train the model to predict the label for each message using the last non-padded token of the message. To make the final prediction, we average the predictions across all messages from respective users and calculate the performance metric using this average as in (V Ganesan et al., 2021). + +For these user level tasks that require aggregate information, for both models, fine-tuning the entire set of parameters was worse than fine-tuning fewer layers. For GPT-2HLC fine-tuning only the last two layers gave the best performance. For HaRT fine-tuning only the recurrence module gave the best performance on development sets. We report results with these best dev settings. We use the mean squared error (MSE) as the training loss. + +Age Estimation Similar to the pre-training data, we filtered the above dataset for English language instances and included only the users with a minimum of 50 posts and a minimum of 1000 words. Age was self-reported and limited to those 65 years or younger. This resulted in a dataset of 56,930 users in train, 1836 users in dev, and 4438 users in test which was a subset of the test set (5000 users) from Park et al. (2015). We evaluate on both the test sets and report Pearson correlation $(r)$ metric on the latter for comparison purposes. We include results with the filtered data in Appendix (Table 8). + +Personality Assessment. We evaluate on the assessment of openness based on language (one's tendency to be open to new ideas) (Schwartz et al., 2013). To allow for direct comparisons, we use the same test set $(n = 1,943)$ as Lynn et al. (2020) and use a subset of their training set (66,764 users) of which $10\%$ were sampled as dev set, and report disattenuated pearson correlation $(r_{dis})$ to account for questionnaire reliability Lynn et al. (2018). As with age estimation, we report results with the filtered dataset in Appendix (Table 8). + +# 6.3 Results + +Table 2 summarizes the performance of HaRT against the baseline of fine-tuning a non-human-aware language model, GPT-2HLC. We see that HaRT yields substantial gains over GPT-2HLC across both user-level and document-level tasks, demonstrating clear benefits in all settings. + +Document-Level Tasks Table 3 compares HaRT with task-specific baselines for stance and sentiment detection including (i) Lynn et al. (2020) which used historical contexts to incorporate both + +
ModelAge (r)OPE (r_dis)
V Ganesan et al. (2021)0.7950.511
Sap et al. (2014)0.831-
Lynn et al. (2020)-0.626
HaRT0.868*0.619
+ +Table 4: Comparison of HaRT's performance on user level downstream tasks: Age and Openness (OPE), against state of the art results. V Ganesan et al. (2021) use lesser number of users (10000) in training. Results are reported in pearson r for Age and disattenuated pearson r for OPE. Bold indicates best in column and * indicates statistical significance between HaRT and (Sap et al., 2014) $(p < .05)$ using a bootstrap sampling test. We also find no statistical difference between HaRT and (Lynn et al., 2020) $(p = .35)$ . + +explicit and text-derived latent human factors, (ii) MeLT (Matero et al., 2021) which used a superset of the same historical contexts used here but for message-level language modeling, and (iii) BERTweet (Nguyen et al., 2020) which uses a large collection of tweets to pretrain an autoencoder that is then fine-tuned for target tasks. Sentiment results are weighted F1 scores over the three sentiment categories. Stance results are an average of weighted F1 scored over five different topics from respective topic-specific fine-tuned models. HaRT outperforms all models demonstrating the substantial benefits of human language modeling for these document-level downstream tasks. + +User-Level Tasks Table 4 compares HaRT with task-specific baselines for Age and Openness tasks that use the superset of the same data used by HaRT. For Age, HaRT outperforms all baselines including a strong non-neural lexica based predictor (Sap et al., 2014), and a RoBERTa-based system that uses carefully chosen frozen embeddings (V Ganesan et al., 2021). For Openness, HaRT is better than the frozen RoBERTa (Liu et al., 2019) embeddings and is comparable to Lynn et al. (2020)'s hierarchical attention model. These results also suggest the potential of HaRT's user states as a representation for user-level tasks. + +# 6.4 No Historical Context. + +HaRT can also be used anywhere a typical transformer language model is used by simply not feeding any historical context. Here, we seek to use our pre-trained HaRT as a language model that is fine-tuned to the messages (for the respective tasks) without any historical context. Table 5 com + +
ModelSentiment (F1)Stance (F1)
GPT-2HLC frozen62.757.7
HaRT nohist, frozen62.758.6
GPT-2HLC76.868.6
HaRT nohist77.7*70.8*
+ +Table 5: Results with experiments on Stance and Sentiment downstream tasks using only the labeled instances and no history. We compare HaRT with GPT-2HLC by training only the classification head (frozen) and additionally, by fine-tuning the models. Bold indicates best in column and * indicates statistical significance $p < .05$ via permutation test w.r.t GPT-2HLC. Results are reported in weighted F1. + +
ModelSentiment (F1)Stance (F1)
HaRT NOT PT63.4766.26
HaRT W/O RECUR77.0468.73
HaRT78.25*71.10*
+ +Table 6: Results with the ablation experiments on Stance and Sentiment downstream tasks. We experiment without the recurrence module (W/o recur), and HaRT without HuLM PT, and compare with HaRT. Bold indicates best in column and * indicates statistical significance $p < .05$ via permutation test w.r.t HaRT w/o recur. Results are reported in weighted F1. + +pares the performances of HaRT and GPT-2 $_{\text{HLC}}$ for the two document-level downstream tasks Stance, and Sentiment. For a fair comparison, we use the same data inputs for both the pre-trained models which consists of only the labeled messages and no historical context. We evaluate in 2 ways: 1) freezing the model and training only the classification layer using the outputs from the penultimate transformer layer, and 2) fine-tuning all model parameters along with a classification head with a layer norm prior to it. HaRT is at par or better with GPT-2 $_{\text{HLC}}$ for both frozen and fine-tuned versions, showing that it can provide gains even when historical context is unavailable. Hyperparameters settings are described in Appendix A.3. + +# 6.5 Ablation Studies + +In this section, we perform ablation experiments on HaRT to better understand their relative importance and report the results in Table 6. + +Pre-training We assess the impact of pre-training by evaluating the downstream performance of a version of the HaRT model that has not been pre + +trained on the HuLM task. Instead of using the weights from HuLM pre-training, we use HaRT with initialized weights as described in Section 5. Table 6 shows HuLM pre-training benefits – pretraining adds substantial gain of 14.78 points and 4.84 points in weighted F1 for sentiment analysis and stance detection respectively. + +Recurrence We assess the importance of recurrent user state by first pre-training HaRT without its recurrent module and then fine-tuning it for the downstream tasks. We still use the same batching as described in Section 4.2 but the information from a block no longer propagates to the next block in the forward pass, and backpropagation is still done on all blocks of a user together. Without the recurrence module we see a drop of 1.21 points and 2.37 points in the weighted F1 measure for sentiment and stance respectively. Interestingly, HaRT outperforms HaRT without recurrence, consistent with the idea that models benefit from user history on tasks that involve a user. + +# 7 Conclusions + +Language is deeply human. Yet, language models in wide-spread use today lack a notion of the human that generates the language. Motivated by other advances in human-centered language processing and psychological theory that suggest language is moderated by human states, we introduced human language modeling. HuLM extends LMs with the notion of a user and their states via their previous messages. In this first step toward large human language models, we developed a human-aware transformer (HaRT) that uses a recurrence mechanism to model user states and show that pre-training this transformer on the human language modeling task yields significant gains in both generation and fine-tuning for multiple downstream document- and user-level tasks. + +Overall, state-of-the-art results with HaRT, a model neither trained on substantially larger data nor adding many parameters, suggests progress for transformers not based on massive increases in data or parameters but on a task grounded in language's "natural" generators, people. + +# 8 Ethical Considerations + +While the multi-level human-document-word structure within HULM can enable bias correcting and fairness techniques (discussed next), the ability to better model language in its human context + +also presents opportunities for unintended harms or nefarious exploitation. For example, models that improve psychological assessment are not only useful for research and clinical applications, but could be used to target content for individuals without their awareness or consent. In the context of use for psychological research, such models may risk release of private research participant information if trained on private data without checks for exposure of identifying information. To negate this potential, we only release a version of HaRT that is without training on the consented-use private Facebook data until differential privacy standards can be verified. Unlike other human-centered approaches, HaRT is not directly fed user attributes as part of the pre-training thus the model parameters do not directly encode user attributes. + +HuLM aims to join a growing body of work to make AI more human-centered, and thus more applicable for interdisciplinary study of the human condition as well as leading to new clinical tools for psychological health. At this point, our models are not intended to be used in practice for mental health care nor labeling of individuals publicly with personality or age scores. While modeling the human state presents opportunities for reducing AI bias, prior to clinical or applied use, such models should be evaluated for failure modes such as error across target populations for error or outcome disparities (Shah et al., 2020). All user-level tasks presented here were reviewed and approved or exempted by an academic institutional review board (IRB). + +# 9 Acknowledgments + +This work was supported by DARPA via Young Faculty Award grant #W911NF-20-1-0306 to Stony Brook University; the conclusions and opinions expressed are attributable only to the authors and should not be construed as those of DARPA or the U.S. Department of Defense. This work was also supported in part by NIH R01 AA028032-01 and by the National Science Foundation under the grant IIS-1815358. + +# References + +Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. 2019. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM + +SIGKDD international conference on knowledge discovery & data mining, pages 2623-2631. +Iz Beltagy, Matthew E Peters, and Arman Cohan. 2020. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150. +Zihang Dai, Zhilin Yang, Yiming Yang, William W. Cohen, J. Carbonell, Quoc V. Le, and R. Salakhutdinov. 2018. Transformer-xl: Language modeling with longer-term dependency. +Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, and Rosanne Liu. 2019. Plug and play language models: A simple approach to controlled text generation. arXiv preprint arXiv:1912.02164. +Gianmarco De Francisci Morales, Aristides Gionis, and Claudio Lucchese. 2012. From chatter to headlines: harnessing the real-time web for personalized news recommendation. In Proceedings of the fifth ACM international conference on Web search and data mining, pages 153-162. +Edouard Delasalles, Sylvain Lamprier, and Ludovic Denoyer. 2019. Learning dynamic author representations with temporal language models. In 2019 IEEE International Conference on Data Mining (ICDM), pages 120-129. IEEE. +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. +Zhicheng Dou, Ruihua Song, and Ji-Rong Wen. 2007. A large-scale evaluation and analysis of personalized search strategies. In Proceedings of the 16th international conference on World Wide Web, pages 581-590. +William Fleeson. 2001. Toward a structure-and process-integrated view of personality: Traits as density distributions of states. Journal of personality and social psychology, 80(6):1011. +Salvatore Giorgi, Daniel Preotciuc-Pietro, Anneke Buffone, Daniel Rieman, Lyle Ungar, and H. Andrew Schwartz. 2018. The remarkable benefit of user-level aggregation for lexical-based population-level predictions. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1167-1172, Brussels, Belgium. Association for Computational Linguistics. +Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. 2020. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909. + +Ido Guy, Naama Zwerdling, David Carmel, Inbal Ronen, Erel Uziel, Sivan Yogev, and Shila Ofek-Koifman. 2009. Personalized recommendation of social software items based on social relations. In Proceedings of the third ACM conference on Recommender systems, pages 53-60. +Dirk Hovy. 2015. Demographic factors improve classification performance. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 752-762, Beijing, China. Association for Computational Linguistics. +Dirk Hovy and Diyi Yang. 2021. The importance of modeling social factors of language: Theory and practice. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 588-602, Online. Association for Computational Linguistics. +Xiaolei Huang and Michael J Paul. 2019. Neural user factor adaptation for text classification: Learning to generalize across author demographics. In Proceedings of the Eighth Joint Conference on Lexical and Computational Semantics (*SEM* 2019). +Aaron Jaech and Mari Ostendorf. 2018. Personalized language model for query auto-completion. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 700-705, Melbourne, Australia. Association for Computational Linguistics. +Zhengbao Jiang, Frank F. Xu, J. Araki, and Graham Neubig. 2020. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423-438. +Nitish Shirish Keskar, Bryan McCann, Lav R Varshney, Caiming Xiong, and Richard Socher. 2019. Ctrl: A conditional transformer language model for controllable generation. arXiv preprint arXiv:1909.05858. +Milton King and Paul Cook. 2020. Evaluating approaches to personalizing language models. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 2461-2469, Marseille, France. European Language Resources Association. +Michal Kosinski, David Stillwell, and Thore Graepel. 2013. Private traits and attributes are predictable from digital records of human behavior. Proceedings of the National Academy of Sciences, 110(15):5802-5805. +Lihong Li, Wei Chu, John Langford, and Robert E Schapire. 2010. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pages 661-670. + +Zih-Wei Lin, Tzu-Wei Sung, Hung-Yi Lee, and Lin-Shan Lee. 2017. Personalized word representations carrying personalized semantics learned from social network posts. In 2017 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU), pages 533-540. IEEE. +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. +Veronica Lynn, Niranjan Balasubramanian, and H. Andrew Schwartz. 2020. Hierarchical modeling for user personality prediction: The role of message-level attention. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5306-5316, Online. Association for Computational Linguistics. +Veronica Lynn, Salvatore Giorgi, Niranjan Balasubramanian, and H. Andrew Schwartz. 2019. Tweet classification without the tweet: An empirical examination of user versus document attributes. In Proceedings of the Third Workshop on Natural Language Processing and Computational Social Science, pages 18-28, Minneapolis, Minnesota. Association for Computational Linguistics. +Veronica Lynn, Alissa Goodman, Kate Niederhoffer, Kate Loveys, Philip Resnik, and H. Andrew Schwartz. 2018. CLPsych 2018 shared task: Predicting current and future psychological health from childhood essays. In Proceedings of the Fifth Workshop on Computational Linguistics and Clinical Psychology: From Keyboard to Clinic, pages 37-46, New Orleans, LA. Association for Computational Linguistics. +Veronica Lynn, Youngseo Son, Vivek Kulkarni, Niranjan Balasubramanian, and H Andrew Schwartz. 2017. Human centered nlp with user-factor adaptation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1146-1155. +Matthew Matero, Nikita Soni, Niranjan Balasubramanian, and H. Andrew Schwartz. 2021. MeLT: Message-level transformer with masked document representations as pre-training for stance detection. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 2959-2966, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Matthias R Mehl and James W Pennebaker. 2003. The sounds of social life: a psychometric analysis of students' daily social environments and natural conversations. Journal of personality and social psychology, 84(4):857. +Fatemehsadat Mireshghallah, Vaishnavi Shrivastava, Milad Shokouhi, Taylor Berg-Kirkpatrick, Robert Sim, and Dimitrios Dimitriadis. 2021. User identifier: Implicit user representations for simple and + +effective personalized sentiment analysis. arXiv preprint arXiv:2110.00135. +Saif M. Mohammad, Svetlana Kiritchenko, Parinaz Sobhani, Xiaodan Zhu, and Colin Cherry. 2016. Semeval-2016 task 6: Detecting stance in tweets. In Proceedings of the International Workshop on Semantic Evaluation, SemEval '16, San Diego, California. +P Nakov, S Rosenthal, Z Kozareva, V Stoyanov, A Ritter, and T Wilson. 2013. Task 2: Sentiment analysis in twitter. In Proceedings of the 7th International Workshop on Semantic Evaluation, Atlanta, Georgia. +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. +Gregory J. Park, H. A. Schwartz, J. Eichstaedt, Margaret L. Kern, M. Kosinski, D. Stillwell, L. Ungar, and M. Seligman. 2015. Automatic personality assessment through social media language. Journal of personality and social psychology, 108 6:934-52. +Fabio Petroni, Tim Roktaschel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, Alexander H. Miller, and Sebastian Riedel. 2019. Language models as knowledge bases? ArXiv, abs/1909.01066. +Steven Piantadosi, David P Byar, and Sylvan B Green. 1988. The ecological fallacy. American journal of epidemiology, 127(5):893-904. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Anna Rogers, Olga Kovaleva, and Anna Rumshisky. 2020. A primer in bertology: What we know about how bert works. Transactions of the Association for Computational Linguistics, 8:842-866. +Maarten Sap, Gregory Park, Johannes Eichstaedt, Margaret Kern, David Stillwell, Michal Kosinski, Lyle Ungar, and Hansen Andrew Schwartz. 2014. Developing age and gender predictive lexica over social media. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1146-1151, Doha, Qatar. Association for Computational Linguistics. +H Andrew Schwartz, Johannes C Eichstaedt, Margaret L Kern, Lukasz Dziurzynski, Stephanie M Ramones, Megha Agrawal, Achal Shah, Michal Kosinski, David Stillwell, Martin EP Seligman, et al. 2013. Personality, gender, and age in the language of social media: The open-vocabulary approach. PloS one, 8(9):e73791. + +H Andrew Schwartz, Salvatore Giorgi, Maarten Sap, Patrick Crutchley, Lyle Ungar, and Johannes Eichstaedt. 2017. Dlatk: Differential language analysis toolkit. In Proceedings of the 2017 conference on empirical methods in natural language processing: System demonstrations, pages 55-60. +Deven Santosh Shah, H Andrew Schwartz, and Dirk Hovy. 2020. Predictive biases in natural language processing models: A conceptual framework and overview. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5248-5264. +David G Steel and D Holt. 1996. Analysing and adjusting aggregation effects: the ecological fallacy revisited. International Statistical Review/Revue Internationale de Statistique, pages 39-60. +Jaime Teevan, Susan T Dumais, and Eric Horvitz. 2005. Personalizing search via automated analysis of interests and activities. In Proceedings of the 28th annual international ACM SIGIR conference on Research and development in information retrieval, pages 449-456. +Adithya V Ganesan, Matthew Matero, Aravind Reddy Ravula, Huy Vu, and H. Andrew Schwartz. 2021. Empirical evaluation of pre-trained transformers for human-level NLP: The role of sample size and dimensionality. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4515-4532, Online. Association for Computational Linguistics. +Charles Welch, Jonathan K. Kummerfeld, Verónica Pérez-Rosas, and Rada Mihalcea. 2020a. Compositional demographic word embeddings. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4076-4089, Online. Association for Computational Linguistics. +Charles Welch, Jonathan K. Kummerfeld, Verónica Pérez-Rosas, and Rada Mihalcea. 2020b. Exploring the value of personalized word embeddings. In Proceedings of the 28th International Conference on Computational Linguistics, pages 6856-6862, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtopicz, et al. 2019. Huggingface's transformers: State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771. +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. + +Davis Yoshida, Allyson Ettinger, and Kevin Gimpel. 2020. Adding recurrence to pretrained transformers for improved efficiency and context size. arXiv preprint arXiv:2008.07027. + +# A Appendix + +# A.1 Pre-training + +Twitter Data Collection As mentioned, in section 4.2, we use a combination of data from both Twitter and Facebook data sources. However, since the main Twitter corpus (Giorgi et al., 2018) only spans the years 2009 - 2015, we wanted to supplement our total corpus with newer language data. Generally, we follow the same procedures for data collection as introduced for the 2009 - 2015 years. Thus, we started with a $1\%$ random sample of publicly available tweets that can be mapped to US counties. On top of this we also applied the following filters: (1) Removal of non-English tweets, (2) Removal of users who did not tweet at least 3 times a week, (3) Removal of any duplicates among the collected data, and (4) Removal of any tweets containing URLs. We will be including this additional data as part of the CTLB project6. + +Data Size and Splits We sample evenly between Facebook and Twitter at the user-level to collect 50,000 from each and apply the same minimum language use requirement of 1,000 words spanning 50 messages. We show the details of the splits across training/development/testing as well as seen/unseen user categories in figure 3. We keep 4,000 users for development and testing, 2k for each split, that are not at all present in the training portion. For users that we do train on, we select 4,500 to keep $20\%$ of their messages for development and testing sets. + +# A.2 Perplexity on Seen versus Unseen Users + +Benefit of Seen users. By default, our experiments are run under an 'unseen user' condition where by the test corpus contains users that were not in HaRT's training corpus. However, one could argue that this is an unnecessary impairment since further training the human language model doesn't require labels and can often be run on test data. We compare the effect of having seen users during HaRT training by additionally calculating perplexity on test sets with seen users. To make it a fair comparison, since we found our "seen user" corpus was more difficult (perplexity on seen users + +
ModelUnseen usersSeen users
ppladj-pplppladj-ppl
GPT-2HLC48.51.0053.71.00
HaRT27.50.57*27.60.51*
+ +Table 7: Evaluation of benefit of having seen the users during HaRT training. We use adjusted perplexity (adj- $ppl$ ): the ratio of the perplexity to the upper-bound from not using HaRT during training (i.e.GPT-2HLC) on the same test set - lower implies better performance when normalized by difficulty of the test set. Seen users test set is the set with the messages from the users also available in the train set, while unseen users test set does not have users common with the train set and is the same as the test set in Table 1. Seen users test set is harder for both models. However, normalizing the scores show HaRT to have better performance over seen users test set. Bold font indicates best in column and * indicates statistical significance $p < {.05}$ via permutation test. + +test set was higher than unseen users test set for GPT-2 $_{\text{HLC}}$ as well), we use an adjusted perplexity, defined as the ratio of the model's perplexity divided by a non-HuLM upper-bound perplexity on the same test set (GPT-2 $_{\text{HLC}}$ ), normalizing by the difficulty of the test set. As shown in Table 7, we find a small but significant benefit to having seen the users during training. + +# A.3 Experimental Settings + +We use Open AI's pre-trained GPT-2 base model from Radford et al. (2019) made available by the Hugging Face library from Wolf et al. (2019) (transformers version 4.5.1) as our base model. We also make use of Hugging Face's code base to implement HuLM. Our training procedure involves all the default training hyperparameters from Hugging Face's GPT2 config except learning rate and the other specific hyperparams mentioned in the paper. We run a learning rate search sweep on a sampled dataset, for both HaRT and GPT-2HLC, using the Optuna framework from Akiba et al. (2019): 1) in a range of 5e-6 to 5e-4, with 3 trials each of 5 epochs for pre-training, 2) in a range of 5e-6 to 5e-4, with 10 trials each of 15 epochs for fine-tuning stance detection, and 3) in a range of 1e-7 to 1e-5, with 5 trials each of 15 epochs for fine-tuning sentiment analysis. We also setup an early stopping criteria for the downstream task trials, such that we continue the epoch runs till we hit an increase in loss for 3 consecutive runs, and pick the model with the best + +![](images/3ccd37740114c09d5ea5a0f5b6bb32ba28df61a42ebd6c0fd6cb6b3894133891.jpg) +Figure 3: Structure of our pre-training dataset visually showing the data source(FB vs Twt), training/development/testing splits, and seen/unseen users for training and testing. Our dataset totals 100,000 users and approximately 37 million messages. Due to GPU memory restrictions, we limited training to 8 blocks of history which brought our train dataset size to 17 million messages. Dev and Test sets were not limited during evaluation. + +F1 score. We couldn't run a similar sweep for user-level tasks due to compute time limits so we try a couple learning rates from document-level tasks but found the same learning rate that we use for pre-training to be better. Many of the experimental/hyperparameters (batch sizes, window sequence sizes and cappings) settings mentioned throughout this work including the number of trials and the number of epochs vary because of computational limitations based on data size and training time. + +All pre-training runs are trained on 2 Tesla V100 GPUs of 32GB. Training HaRT takes approx 16 hours for 1 epoch (with train data consisting of 8 blocks (each of 1024 tokens) of 96000 users). Fine-tuning tasks run on a mix of Tesla V100, Quadro RTX 8000, and A100 GPUs based on compute availability. All batch sizes mentioned are per GPU. + +Pre-training Settings We use 2.4447e-4 as the learning rate for training HaRT, with 1 user train batch size, 15 users eval batch size and early stopping patience set to 3. For GPT-2HLC, we use the default settings from Wolf et al. (2019) with train and eval batch size set to 60 and early stopping patience set to 3. + +Document-level Fine-tuning Settings We fine-tune HaRT for document-level tasks on their respective training data with an input instance capped to 8 blocks of 1024 tokens each, and no capping during evaluation. We train for 15 epochs using train and dev sets - along with history where available - with 1 user train batch size, 20 users + +eval batch size and early stopping patience set to 6. All models converge within 5 epochs except one stance target - feminism. GPT-2 $_{\text{HLC}}$ is fine-tuned with the same data - but not history - using the same settings except a different learning rate (from the hyperparameter sweep mentioned above), train and eval batch size of 60, and max tokens per message set to 200 (consistent with pre-training). + +User-level Fine-tuning Settings We fine-tune HaRT for user-level tasks with an input instance capped to 4 blocks of 1024 tokens each, and evaluation data capped to 63 blocks (to allow for dev set evaluation due to compute limitations). For fine-tuning HaRT, we use 4 user train batch size and 20 eval batch size with early stopping patience set to 3. We layer norm the user-states (hidden states of the user state vector) from HaRT, and linearly transform (to embedding dimensions) before averaging the user-states to make the user's age estimation. We train for 30 epochs with warmup steps equivalent to 10 epochs, and a weight decay set to 0.01. We find that for the task of Age estimation the model converges at epoch 21, however for Personality Assessment we find a simple classification linear layer to show better performance (with a convergence seen at epoch 28 when run for 35 epochs). In case of GPT-2HLC we with the same data (split into into individual messages capped to 200 tokens per message as in pre-training), for 15 epochs (much higher training time as compared to HaRT) with train and eval batch size set to 400, and early stopping patience set to 3. + +
ModelAge (r)OPE (r_dis)
HaRT (Full test set)0.8680.619
HaRT (Filtered test set)0.8720.635
+ +Table 8: HaRT's performance on user level downstream tasks: Age and Openness (OPE), on full test sets (5000 users and 1943 users respectively for Age and OPE) from Park et al. (2015) and Lynn et al. (2020), as well as on the resulting test set (4438 users and 1745 users respectively for Age and OPE) after filtering the dataset for English language with users having a minimum of 50 posts and 1000 words (as we do for our pre-training data). + +MeLT - Sentiment Fine-tuning Settings To apply MeLT (Matero et al., 2021) to the sentiment task we use use optuna (Akiba et al., 2019) to search both learning rate and weight decay parameters using a search space between 6e-6 and 3e-3 and between 1 and 1e-4 respectively. We keep the same architecture as described in the original MeLT paper, however we make 1 change during fine-tuning and that is the message-vector representation from MeLT is concatenated with the average of the observed tokens for the labeled message to include both local and global context into the fine-tuning layers. + +No Historical Context Fine-tuning Settings We run a hyperparameter sweep using Optuna (Akiba et al., 2019) for all models for learning rate (using search space between 5e-6 to 5e-4) and weight decay(using search space between 0.0 and 1.0) with early stopping patience set to 6. We do this for 15 and 10 trials for Stance and Sentiment models respectively, and pick the hyperparameters value for the best model in the same way as described in the Experimental Settings (A.3 section above. We use these values to fine-tune the models for 15 epochs and get the weighted F1 results. \ No newline at end of file diff --git a/humanlanguagemodeling/images.zip b/humanlanguagemodeling/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8a37c43050555c76c6ac47874d10b8e1fa7ca88c --- /dev/null +++ b/humanlanguagemodeling/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9eef7fc22396737e722ca7273c458a0def16a24c339276db47cdd9ca777eef9d +size 271645 diff --git a/humanlanguagemodeling/layout.json b/humanlanguagemodeling/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cb9c0d0157904ac3d9d362b687bed0f1610f6a32 --- /dev/null +++ b/humanlanguagemodeling/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f0f40108d8ce25ed67505056e384061e48dce60dd80303344ddf041754f941f +size 413066 diff --git a/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_content_list.json b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c8f0d004d387e5897843125d19527dedba20e58b --- /dev/null +++ b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fa86d1c9712c1983fcb4a34d6cc0a1f340043daa7e221fe90e468417ef40f3a +size 76291 diff --git a/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_model.json b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..93c783ed085acc84a2b0f14af0e61af68c3b30b1 --- /dev/null +++ b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07c2d7979c14f0f4568f3ffca17136ff082f605b4f11a6b0dc435e111a731b4f +size 91497 diff --git a/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_origin.pdf b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..043fc67a6f736f9792e309dd23869008fa646bed --- /dev/null +++ b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/0c46489f-396a-405e-ae28-5ca47b1308d9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:798d53a4d9f8b16f8b3eaa69ec2c42e3ab629656fad6bacfe098c0b5ebfc5a5d +size 2380333 diff --git a/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/full.md b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/full.md new file mode 100644 index 0000000000000000000000000000000000000000..596654ad89024912257bc8af5e8b116b8871421e --- /dev/null +++ b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/full.md @@ -0,0 +1,293 @@ +# HYBRIDIALOGUE: An Information-Seeking Dialogue Dataset Grounded on Tabular and Textual Data + +Kai Nakamura1, Sharon Levy2, Yi-Lin Tuan2, Wenhu Chen3, William Yang Wang2 + +1 California Institute of Technology + +2 University of California, Santa Barbara + +3 University of Waterloo, Vector Institute + +kai.nakamura42@gmail.com + +{sharonlevy,ytuan,william}@cs.ucsb.edu + +wenhuchen@uwaterloo.ca + +# Abstract + +A pressing challenge in current dialogue systems is to successfully converse with users on topics with information distributed across different modalities. Previous work in multiturn dialogue systems has primarily focused on either text or table information. In more realistic scenarios, having a joint understanding of both is critical as knowledge is typically distributed over both unstructured and structured forms. We present a new dialogue dataset, HYBRIDIALOGUE, which consists of crowdsourced natural conversations grounded on both Wikipedia text and tables. The conversations are created through the decomposition of complex multihop questions into simple, realistic multiturn dialogue interactions. We propose retrieval, system state tracking, and dialogue response generation tasks for our dataset and conduct baseline experiments for each. Our results show that there is still ample opportunity for improvement, demonstrating the importance of building stronger dialogue systems that can reason over the complex setting of information-seeking dialogue grounded on tables and text. + +# 1 Introduction + +When creating dialogue systems, researchers strive to enable fluent free-text interactions with users on a number of topics. These systems can be utilized to navigate users over the vast amount of online content to answer the user's question. Current systems may search for information within text passages. However, knowledge comes in many forms other than text. The ability to understand multiple knowledge forms is critical in developing more general-purpose and realistic conversational models. Tables often convey information that cannot be efficiently captured via text, such as structured relational representations between multiple entities across different categories (Chen et al., 2019, 2020b; Herzig et al., 2020). On the other hand, text may contain more detailed information regarding + +a specific entity. Thus, dialogue systems must be able to effectively incorporate and reason across both modalities to yield the best performance in the real world. + +While there are several existing datasets targeted at dialogue systems (Dinan et al., 2018; Budzianowski et al., 2018; Eric et al., 2017; Zhou et al., 2018b), these are limited to either table-only or text-only information sources. As a result, current dialogue systems may fail to respond correctly in situations that require combined tabular and textual knowledge. + +To advance the current state of dialogue systems, we create HYBRIDIALOGUE1. Our dataset is an information-seeking dialogue dataset grounded on structured and unstructured knowledge from tables and text. HYBRIDIALOGUE, or HYDI, is constructed by decomposing the complex and artificial multihop questions in OTT-QA (Chen et al., 2020a) which may not reflect real-life queries. We transform these into a series of simple and more realistic intermediate questions regarding tables and text that lead to and eventually answer the multihop question. HYBRIDIALOGUE contains conversations written by crowdsourced workers in a free-flowing and natural dialogue structure that answer these simpler questions and the complex question as well. We provide an example dialogue from our dataset in Figure 1. We also propose several tasks for HYBRIDIALOGUE that illustrate the usage of an information-seeking dialogue system trained on the dataset. These tasks include retrieval, system state tracking, and dialogue generation. Together, they demonstrate the challenges with respect to dialogue systems and the necessity for a dataset such as HYBRIDIALOGUE to further research in this space. + +Our contributions are as follows: + +- We create a novel dialogue dataset consist + +![](images/1ce008d53a18c714cd2045f5ae76994756dbce535b5ce5b7a99367a52a4005a5.jpg) +Figure 1: Overview of a sample from HYBRIDIALOGUE, where each conversation is created from a decomposed multihop question-answer pair. T0,...,T3 represent turns in the dialogue and consist of a single question and answer pair. The solid arrows represent the reference (e.g., row or intro paragraph) utilized to retrieve the correct answer in each turn. The dashed arrow represents a paragraph linked from a table cell. + +ing of $4800+$ samples of conversations that require reasoning over both tables and text. + +- We decompose the overly-complex multihop questions from an existing dataset into more realistic intermediate question-answer pairs and formulate these in the dialogue setting. +- We propose system state tracking, dialogue generation, and retrieval tasks for our dataset. Our baseline experiments demonstrate opportunities to improve current state-of-the-art models in these various tasks and the overall information-seeking dialogue setting. + +# 2 Related Work + +Related work in the space of dialogue-based question-answering can be split into two areas: question-answering systems and information-grounded dialogue. We provide a comparison of the related datasets in Table 1 and analyze these datasets below. + +Question-Answering As question-answering (QA) is one of the long-established NLP tasks, there are numerous existing datasets related to this task. Recently, QA datasets have been incorporating new modalities. The RecipeQA (Yagcioglu et al., 2018) dataset is comprised of question-answer pairs targeted at both image and text. OTT-QA (Chen et al., 2020a) and Hybrid + +
DatasetDialogueTurnsModality
CoQA8K127KText
Natural Questions0323KText
Hybrid-QA07kTable/Text
OTT-QA045KTable/Text
SQA6.6K17.5KTable
ShARC94832KText
DoQA2.4K10.9KText
RecipeQA036KImage/Text
KVRET3K12.7KTable
MultiWOZ10.4K113.6KTable
WoW22.3K101KText
Topical-Chat10.8K235.4KText
CMU_DOG4.2K130KText
HYBRIDIALOGUE4.8K22.5KTable/Text
+ +Table 1: Comparison of HYBRIDIALOGUE and other dialogue and question-answering datasets. For question-answering datasets, turns refers to question-answer pairs. For ShARC, dialogues refers to dialogue trees. + +QA (Chen et al., 2020b) both contain complex multihop questions with answers appearing in both text and tabular formats. Several datasets are also targeted at the open-domain question-answering task such as TriviaQA, HotPotQA, and Natural Questions (Joshi et al., 2017; Yang et al., 2018; Kwiatkowski et al., 2019). While single-turn question-answering is valuable, the dialogue setting is more interesting as it proposes many new challenges, such as requiring conversational context, reasoning, and naturalness. + +Conversational Question-Answering Several question-answering datasets contain question and answer pairs within a conversational structure. CoQA (Reddy et al., 2019) and DoQA (Campos et al., 2020) both contain dialogues grounded with knowledge from Wikipedia pages, FAQ pairs, and other domains. ShARC (Saeidi et al., 2018) employs a decomposition strategy where the task is to ask follow-up questions to understand the user's background when answering the original question. However, ShARC is limited to rule-based reasoning and 'yes' or 'no' answer types. SQA (Iyyer et al., 2017) provides a tabular-type dataset, consisting of the decomposition of WikiTable questions. Each decomposed answer is related to a cell or column of cells in a particular table. In these datasets, knowledge is limited to a single modality. + +In comparison, our dataset poses a more challenging yet realistic setting, where knowledge over structured tables and unstructured text is required to provide reasonable answers to the conversational questions. While the previous datasets contain samples written in a conversational structure, the answers are not necessarily presented in this way; they will instead formulate simple and short answers that do not emulate a human dialogue. Our dataset, therefore, extends conversational question-answering and falls into the dialogue space. HYBRIDIALOGUE contains natural dialogues with strongly related question-answer pair interactions whose answers are longer than the exact answer string. This models real-world occurrences in which a person wants to ask follow-up questions after their initial question has been answered. + +Dialogue Generation Among the dialogue datasets that leverage structured (tables and knowledge graphs) knowledge, some (Ghazvininejad et al., 2018; Zhou et al., 2018a) use conversational data from Twitter or Reddit and contain dialogues relying on external knowledge graphs such as Freebase (Bollacker et al., 2008) or ConceptNet (Speer et al., 2017). On the other hand, OpenDialKG (Moon et al., 2019), DuConv (Wu et al., 2019), DyKGChat (Tuan et al., 2019), and Kd-Conv (Zhou et al., 2020) collect conversations that are explicitly related to the paired external knowledge graphs. Other related work revolves around task-oriented dialogues that are grounded on tables. For example, KVRET (Eric et al., 2017) and MultiWOZ (Budzianowski et al., 2018; Ramadan et al., 2018; Eric et al., 2019; Zang et al., 2020) provide + +![](images/cdc1085b62d55197057e53384aeec7e3f978bf8cf9c5ce2dc8a517203ab5266c.jpg) +Figure 2: Overview of the dataset collection process, including the validation steps. + +tables that require an assistant to interact with users and complete a task. + +Dialogue datasets that are grounded on unstructured knowledge include CMU_DOG (Zhou et al., 2018b), which is composed of conversations regarding popular movies and their corresponding simplified Wikipedia articles. On the other hand, Wizard-of-Wikipedia (WoW) (Dinan et al., 2018) and Topical-Chat (Gopalakrishnan et al., 2019) simulate the human-human conversations through Wizard-Apprentice, in which the apprentice tries to learn information from the wizard. Our proposed task shares a similar idea with Wizard-of-Wikipedia and Topical-Chat in terms of asymmetric information among participants. However, we focus more on information-seeking dialogues grounded on both structured and unstructured knowledge, which provides abundant and heterogeneous information, and requires joint reasoning capabilities using both modalities. + +# 3 Dataset Creation + +# 3.1 Crowdsourcing Instructions + +Given a multihop question from OTT-QA, crowdsourced workers (Turkers) from Amazon Mechanical Turk (Crowston, 2012) were asked to decompose it into a series of simpler intermediate questions and answers to formulate a simulated conversation in English. As opposed to datasets such as Wizard of Wikipedia (Dinan et al., 2018) that are more open-ended, our annotators have a specific goal in mind: to answer an original complex question. By utilizing a single annotator to represent both sides, we keep the flow of the dialogue consistent and natural as it converges to the final an- + +![](images/c83a4ffa2ba2745172898557c172e8ebb125e1f272b32f2cfe5f9960f60aeff1.jpg) +Figure 3: Overview of the reference pool graph, indicating which reference candidates are added to the pool given the current available references. + +swer. The usage of two annotators for our specific task comes with the risk of having one user diverge and reduce the chance of reaching the correct final answer. + +We refer to the multihop question from OTT-QA as the "ultimate question". Turkers are instructed as follows: "In this task, you will engage in a dialogue with yourself. You will act as two characters: the seeker and the expert. At the top of the page, you are given the Ultimate Question. The seeker wants to know the answer to the ultimate question. However, directly asking this ultimate question is too complex. Thus, the seeker needs to decompose (break down) this complex question into a sequence of simple questions, which the expert will answer using a database." To further emphasize the naturalness of the dataset, Turkers were encouraged to ask questions that required understanding the conversation history context, such as through co-referencing. For example, Turkers used proper nouns with pronouns and indirect references such that they logically refer to their antecedents. An example conversation is demonstrated in Figure 1 and an overview of the dataset collection process is shown in Figure 2. + +# 3.2 Task Definitions + +A conversation is composed of a sequence of turns. Each conversation consists of a minimum of 4 turns and a maximum of 6 turns. This limitation is specified to ensure that Turkers are thoroughly decomposing each complex question and the conversations do not go off on tangents. Each turn $T$ acts as a piece of the decomposition of the ultimate question. The i-th turn $T_{i}$ consists of a natural language + +
Dataset Statistics
# Train Dialogues4359
# Development Dialogues242
# Test Dialogues243
# Turns (QA pairs)21070
Avg Turns per Dialogue4.34
# Wikipedia Pages2919
Avg # words per question10
Avg # words per answer12.9
# Table selections4975
# Row selections6769
# Cell selections1830
# (Linked) paragraph selections3337
# Intro selections7131
# Unique decompositions267
+ +Table 2: HYBRIDIALOGUE dataset statistics. + +question $Q_{i}$ , a natural language answer $A_{i}$ , a reference $R_{i}$ from an English Wikipedia page, and an available reference pool set $RP_{i}$ . The Turker provides $Q_{i}$ , $A_{i}$ , and selects a particular $R_{i}$ from the set $RP_{i}$ . $R_{i}$ can be considered the evidence required to generate $A_{i}$ given the question $Q_{i}$ . The reference pool $RP_{i}$ contains different types of references including the (linked) paragraph, a (whole) table, a single inner table row, multiple inner table rows, or a single cell. + +We differentiate between multiple rows and the whole table in order to obtain a more specific source for the information. For example, the question "Do you have a list of Steve's accomplishments?" requires a Table response as the answer contains a summary of the table. On the other hand, the question "Did he ever compete in the Grand Prix event type?" requires a selection of specific rows of some table. In order to enforce the naturalness and moderate the difficulty of questions, we restricted $RP_{i}$ based on $RP_{i-1}$ and $R_{i-1}$ . In other words, the type of questions that the Turker could ask were restricted to the references enabled from previous selections. In the Turker interface, $RP_{0}$ is restricted to the intro paragraph and any whole table references in a provided starting page. We illustrate how reference candidates are added to the reference pool in Figure 3. + +# 3.3 Validation + +To ensure high-quality samples, we conducted various filtering steps. Rejections were made due to the Turker not following the instructions at all or + +![](images/ccb2c3dff430cbab419ca3dd34c7ee0948c25821d78f6ac3328bc19a938c90e9.jpg) +Figure 4: Overview of the state tracking experiment. For each question in a conversation turn, there is a correct reference and corresponding state (e.g., row, linked paragraph) to select when answering the question. + +![](images/7a7064099aa6440301b224f8c6157b509961628d31c0422a5433c9bb8f6f05f8.jpg) + +having poor-quality conversations. For example, if the Turker purposefully copy and pasted unrelated paragraphs of texts, repeated the same questions multiple times, used unrelated references, or utilized a single reference throughout the entire conversation, we automatically rejected it. Turkers were paid an average of $1.1 per conversation. Completing a conversation took the worker an average of 5 minutes, which translates to an average of$ 13.2 per hour. In some cases, we gave bonuses to Turkers who consistently submitted high-quality results. After final verification of the accepted HITs, we obtained a final dataset consisting of 4,844 conversations. The statistics of the dataset are shown in Table 2. + +We conducted additional filtering to further enhance the dataset quality. Utilizing gold answers obtained from the source OTT-QA dataset, we checked if the final answer appeared as a substring in Turker's conversation. If it did, we autoapproved the conversation. For the remaining questions, we manually reviewed them. We approved conversations that had the correct answer but in a different format (e.g., September 1, 2021, instead of 9/1/21). In some cases, Turkers provided their own decomposition or their own ultimate question and decomposition, so they did not obtain the final answer provided by OTT-QA. In these cases, if the conversation was both accurate and had good quality, we accepted it. + +# 4 Tasks and Baseline Models + +We outline three different tasks in the following sections: retrieval, system state tracking, and dialogue generation. Together, these tasks formulate a + +pipeline dialogue system grounded on both structured and unstructured knowledge from tables and text. The first step of the system is to retrieve the correct Wikipedia reference given the first question in the dialogue. As the conversation continues, the system must be able to track the state of the conversation in order to obtain the correct information from the Wikipedia reference for the user. Finally, the system will need to generate a natural conversational response to communicate with the user at each turn. Thus, following each of these tasks in order simulates the pipeline system with our dataset. We describe each of these tasks and their respective models in detail below. + +# 4.1 Retrieval + +The retrieval experiment is run for each $T_{0}$ of each conversation. Given the first question of the conversation $Q_{0}$ , the model must predict the correct reference $R_{0}$ . First questions discuss information that is either in a table or an intro paragraph; so the candidate space contains all intro paragraphs and tables in the dataset. The purpose of the retrieval experiment is to get a baseline of how well we are able to predict the table or page the subsequent conversation will be based upon, given the first query. The references that are utilized in the subsequent conversation are on the same page as the selected intro paragraph or table. For our baseline, we run the Okapi BM25 retriever (Brown, 2020) on the entire dataset over all candidates and first turn queries. BM25 is a standard document retrieval model that uses keyword-matching techniques to rank documents. + +![](images/573a76f595be2276d33a015046f6508d663d091ffc3e63835ea023a529844c8e.jpg) +Figure 5: System state tracking with the TaPas model. Single rows and multiple rows are mapped to single cells and linked paragraphs are mapped to their respective cells in the original table in order to adapt to TaPas. + +![](images/44f1976ce4046a29a875dcbc3bd6494bb10b04608413ab521ec4e8787a0dcaa7.jpg) +Figure 6: Table, row, cell, and paragraph flattening for input to the SentenceBERT and DialogGPT models. + +# 4.2 System State Tracking + +Previous work in dialogue systems focuses on the task of belief state tracking, which aims to determine the user's goal or the current state of the conversation at each turn in the dialogue (Mrksic et al., 2017; Ren et al., 2018). Inspired by work in belief state tracking, we propose the task of system state tracking in an information-seeking dialogue system. The task is framed similarly to belief state tracking, where a model attempts to classify the current state in the conversation at each turn. However, the "state" in our proposed task is modeled as a reference location from the current reference pool. As such, the task is formulated as using the information from the existing conversation and current question to determine the state of the conversation and choose which reference to utilize to create an answer. The reference types considered in this experiment are single cell, linked paragraph, inner table row, and multiple inner table rows. The implementation of system state tracking increases the interpretability and explainability of the system by determining the understanding of the user's question and discovering the point in the conversation + +in which the model is incorrectly interpreting the user's question. This, in turn, can help us understand the types of errors the model is prone to and allow us to work towards increasing the robustness of the model regarding these errors. + +The system state tracking process is visualized in Figure 4. We perform system state tracking for all turns in each dialogue except the first turn. Given the history of the conversation $H_{i}$ , we predict the correct reference $R_{i}$ . $H_{i}$ consists of turns $T_{1}\ldots T_{i - 1}$ the current query $Q_{i}$ , and the candidate references $RP_{i}$ . Thus, the goal is to determine the correct reference $R_{i}$ at the specific turn in the dialogue, given the dialogue history. We utilize SentenceBERT (Reimers and Gurevych, 2019a) and TaPas (Herzig et al., 2020) as baselines for the experiment. + +SentenceBERT We utilize the sentence transformer and the triplet-loss configuration as described in equation 1. We minimize the difference between the correct candidate $R_{i}$ and context $H_{i}$ while maximizing the difference between every incorrect candidate $W$ and $H_{i}$ . We create samples for each $W \in RP_{i}$ where $W \neq R_{i}$ . ( $RP_{i}$ is the reference pool). $k$ is some fixed margin. + +$$ +l o s s = \max \left(\left| \left| H _ {i} - R _ {i} \right| \right| - \left| \left| H _ {i} - W \right| \right| + k, 0\right) \tag {1} +$$ + +To allow SentenceBERT to process the data, we flatten the references and preprocess a special token to provide information about the type of candidate it is. This process is visualized in Figure 6. + +TaPas We additionally utilize the TaPas model for system state tracking. TaPas is a BERT-based question-answering model for tabular data. We use the TaPas model that has been fine-tuned on the SQA dataset, which enables sequential question-answering in a conversational nature. As the model + +
TaskModel# SamplesMRR@10MAP
RetrievalBM2548440.4270.427
System State TrackingSentenceBERT6360.6030.600
TaPas6360.6890.634
+ +Table 3: The results of the retrieval and system state tracking experiments. + +
ReferenceMRR@10MAPCount
Cell0.3840.395108
Paragraph0.5990.606124
Row0.7820.786338
Multi-row0.8810.29266
+ +performs only cell selection, we adapt TaPas towards this setting. We do not need to pre-process the data differently for cell selection as TaPas already performs the cell selection task. We place linked paragraphs in their respective cells within a table to accommodate cell selection in this setting. For row and multi-row selection, we pre-process the data by choosing one cell from the row as the correct answer. This is done by finding the cell with the highest text similarity to the ground truth answer at that turn. Therefore, each row will have a single cell associated with it during fine-tuning. We visualize the state tracking experiment with TaPas in Figure 5. For our experiments, we fine-tuned the TaPas model with our pre-processed training set. + +# 4.3 Dialogue Generation + +We conduct experiments on dialogue response generation to look into the dataset's expressivity for real-world dialogue scenarios. We fine-tuned a pretrained DialogoGPT model (Zhang et al., 2020) by minimizing the negative log-likelihood with two input settings. $Q_{i}$ , $A_{i}$ , and $R_{i}$ are defined as the question, answer, and reference at the i-th turn, respectively. First, we only take the dialogue history as the input without knowledge content and predict the following natural language response. The format (DialogoGPT-noR) is described as: + +$$ +\left\{Q _ {1}, A _ {1}, \dots , Q _ {i}, A _ {i}, Q _ {i + 1} \right\} \mapsto A _ {i + 1} \tag {2} +$$ + +Second, we flatten the references and concatenate the dialogue history as the input and predict the following natural language response. The references + +Table 4: System state tracking results split by reference type for the TaPas model. + +
MethodSacREBLEUBERTscore
DiaLoGPT-noR14.720.8875
DiaLoGPT21.630.8901
+ +Table 5: The results of dialogue generation experiments on HYBRIDIALOGUE dataset. + +are flattened in the process seen in Figure 6. The format (DiaLoGPT) is: + +$$ +\left\{R _ {1}, Q _ {1}, A _ {1}, \dots , R _ {i + 1}, Q _ {i + 1} \right\} \mapsto A _ {i + 1} \tag {3} +$$ + +The two settings enable us to validate how much information the references provide for response construction. + +# 5 Experiments + +# 5.1 Retrieval + +As retrieval is the first step in the information-seeking dialogue pipeline, we need to ensure that information from the correct Wikipedia page is retrieved to determine whether the first question and any following questions will be answerable. We evaluate our retrieval model with MRR@10 (Mean Reciprocal Rank @10). Table 3 shows our results, where BM25 achieves an MRR@10 score of 0.427 for retrieving the correct candidate. + +# 5.2 System State Tracking + +Evaluation To evaluate the SentenceBERT and TaPas predictions, we calculate MRR@10 (Mean Reciprocal Rank @10) and MAP (Mean Average Precision). Each model produces scores for the candidate references for a question. These scores are sorted into a ranked list, and the correct references are identified in this list. We then calculate MRR and MAP values with respect to the ranking of the correct reference in the ranked list. + +When evaluating the TaPas model, we consider the highest-ranking cell from the ground truth row correct during test time. This simulates a more realistic setting by allowing any cell within the row to be correct. + +
Error TypeInputOutput
Incoherent[TABLE] Best-selling physical singles – 7–7.9 million copies; [QUERY] Can you give me a list ... [PARAGRAPH] .... Known for her emotive mezzo-soprano voice, Morissette began her career in Canada ...; [QUERY] What is the vocal range of this singer?DiaGPT: Alanis Nadine Morissette is a Canadian-American singer, songwriter, and actress. +GT: Alanis Morissette has a vocal range of mezzo-soprano.
Non-fluent[ROW] Year is 1985; Song is La detswinge; Artist is Bobbysocks; Position is 1st; Points is 123... [QUERY] Do you know what song they performed to win?DiaGPT: Yes, they performed to win the song La detswinge. +GT: Yeah, they did La detswinge.
Unfaithful[PARAGRAPH] Immigration to Spain...in 2005 alone, the immigrant population of Spain increased by 700,000 people.; [QUERY] when did the immigrant population of spain increase by 700,000 people?DiaGPT: The immigrant population increased by 700,000 in 1998. +GT: the immigrant population increased by that number in 2005
+ +Table 6: The error types observed in dialogue generation on HYBRIDIALOGUE. (GT: ground truth) + +Results The results of our experiments with TaPas and SentenceBERT are shown in Table 3. Our results show that TaPas achieves better results in comparison to SentenceBERT. We further analyze the results of TaPas by breaking down the MRR and MAP scores based on the four reference types: cell, linked paragraph, row, and multi-row. These results are shown in Table 4, along with the number of samples for each reference type in the test set. We find that TaPas achieves the best overall results for row states, which also comprise the largest fraction of samples. Meanwhile, multi-row achieves a high MRR score but a low MAP score, indicating that TaPas ranks some of the correct row candidates very low. Cell and linked paragraph states are limited to a single cell within the table, but linked paragraph samples achieve noticeably better results. This is likely because the paragraph text will contain more information than a cell's text, making it easier to determine the correct reference. + +# 5.3 Dialogue Generation + +We adopted SacreBLEU (Post, 2018) and BERTscore (Zhang et al., 2019) as the automatic evaluation metrics. As shown in Table 5, concatenating references can consistently improve both metrics and the collected references are necessary for generating dialogue. It can be seen that differences are more noticeable for SacreBLEU as opposed to BERTscore. This is due to the naturally similar outputs of BERTscore, where the ranking of the scores is a more reliable view of the metric. + +We conduct further error analysis and find three main types of errors as listed in Table 6: incoherent, non-fluent, and unfaithful. As shown in Table 6, the generated response "Alanis Nadine Morissette is a Canadian-American singer, song- + +writer, and actress." is not an appropriate response to the question. In this case, the generated response is incoherent based on the dialogue. Sometimes the response has the correct information, but it is not a fluent sentence. One example is the generated statement "Yes, they performed to win the song La detswing". The final primary error type is that the generated response may be unfaithful to the perceived knowledge. For example, given a paragraph mentioning several years and events in history, the generated response mentions "1998", while the answer should be "2005". + +# 5.4 Human Evaluation + +In addition, we conduct a human evaluation. We randomly sample 200 test samples containing previous conversation histories, human-written answers, and machine-generated answers from DialogGPT. For each sample, we have two Turkers provide ratings. We ask the Turker to evaluate the machine-generated response on three criteria: coherence, fluency, and informativeness from a scale of 1 to 5. Coherence measures how well the response is connected to the question and prior conversation history. Fluency measures the use of proper English. Informativeness measures how accurate the machine-generated response is against the human-provided ground truth response. We provide the average ratings for each model in Table 7. The model that utilizes the state tracking references achieves a better "informativeness" rating as it is able to utilize the extra information to provide a more correct response. It is notable however that the model with no references achieves better coherence and fluency scores. Thus, the human evaluation demonstrates the importance and challenge for models to provide both an accurate and articulate response. + +
MethodCFI
DiaLoGPT-noR3.883.983.13
DiaLoGPT3.593.683.49
+ +Table 7: The results of human evaluation on dialogue generation model outputs. $\mathrm{C} =$ Coherence, $\mathrm{F} =$ Fluency, $\mathrm{I} =$ Informativeness. + +# 6 Conclusion + +In this paper, we presented a novel dataset, HYBRIDIALOGUE, for information-seeking dialogue where knowledge is grounded in both tables and text. While previous work has combined table and text modality in the question-answering space, this has not been utilized in the dialogue setting. Our results in the various tasks demonstrate that there is still significant room for improvement and illustrate the need to build models that can adapt well to this hybrid format. In addition to the baseline tasks, future research can utilize HYBRIDIALOGUE to explore automatic multihop question decomposition. + +# Ethical Considerations + +While the dialogues in our dataset are grounded on both structured and unstructured data, they are limited to tables and text and do not cover other forms such as knowledge graphs. Additionally, the conversations are limited to discussions on single Wikipedia pages. We believe future research can expand on this for the creation of more open-ended information-seeking dialogues. + +Wikipedia has extensive measures of risks and employs staff and volunteer editors to make sure Wikipedia articles meet the requirement and quality of the Wikimedia Foundation. Our data is based on Wikipedia pages, and we contain our dialogues to Wikipedia knowledge. We carefully validate the dataset collection process, and the quality of our data is carefully controlled. + +The HYBRIDIALOGUE dataset was built from the OTT-QA dataset, which is under MIT license. The authors of the OTT-QA dataset paper have allowed us to utilize the dataset within our use case. + +For the dataset collection task, we required Turkers to have a HIT Approval Rate of greater than $96\%$ and be located in AU, CA, IE, NZ, GB, or the US. We also required workers to have had 500 HITs approved previously. Workers were shown an interface containing text input fields and navigation + +tools. Turkers were also given an instruction page containing a video demo and a completed example. The time to complete the task is around 5 minutes, and Turkers were paid $1.1 per conversation, which translates to an hourly wage of$ 13.2 per hour. For the human evaluation task, Turkers were paid $0.1 per task with an estimated time of fewer than 30 seconds per task. The dataset collection protocol was approved by the IRB. We follow the user agreement on Mechanical Turk for our dataset creation, which gives us explicit consent to receive users' service in the form of data annotation in return for monetary compensation. Given our settings, the Turkers understand that their data will be utilized in machine learning research. + +We will be providing open access to our dataset for use in future research. This includes the samples of dialogues written by Mechanical Turk workers, the references that each dialogue turn is associated with, and the Wikipedia pages in which the references are located. The dataset will be open-sourced under the MIT License. + +# 7 Acknowledgements + +We thank all the reviewers precious comments in revising this paper. This work was supported by a Google Research Award and the National Science Foundation award #2048122. The views expressed are those of the author and do not reflect the official policy or position of the funding agencies. + +# References + +Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. 2008. Freebase: a collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD international conference on Management of data. +Dorian Brown. 2020. Rank-BM25: A Collection of BM25 Algorithms in Python. +Paweł Budzianowski, Tsung-Hsien Wen, Bo-Hsiang Tseng, Inigo Casanueva, Stefan Ultes, Osman Ramadan, and Milica Gašić. 2018. MultiWOZ - a large-scale multi-domain Wizard-of-Oz dataset for task-oriented dialogue modelling. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 5016-5026, Brussels, Belgium. Association for Computational Linguistics. +Jon Ander Campos, Arantxa Otegi, Aitor Soroa, Jan Deriu, Mark Cieliebak, and Eneko Agirre. 2020. DoQA - accessing domain-specific FAQs via conversational QA. In Proceedings of the 58th Annual Meeting of + +the Association for Computational Linguistics, pages 7302-7314, Online. Association for Computational Linguistics. +Wenhu Chen, Ming-Wei Chang, Eva Schlinger, William Yang Wang, and William W Cohen. 2020a. Open question answering over tables and text. In International Conference on Learning Representations. +Wenhu Chen, Hongmin Wang, Jianshu Chen, Yunkai Zhang, Hong Wang, Shiyang Li, Xiyou Zhou, and William Yang Wang. 2019. Tabfact: A large-scale dataset for table-based fact verification. In International Conference on Learning Representations. +Wenhu Chen, Hanwen Zha, Zhiyu Chen, Wenhan Xiong, Hong Wang, and William Yang Wang. 2020b. HybridQA: A dataset of multi-hop question answering over tabular and textual data. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1026-1036, Online. Association for Computational Linguistics. +Kevin Crowston. 2012. Amazon mechanical turk: A research tool for organizations and information systems scholars. In *Shaping the Future of ICT Research*. Methods and Approaches, pages 210–221, Berlin, Heidelberg. Springer Berlin Heidelberg. +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. +Emily Dinan, Stephen Roller, Kurt Shuster, Angela Fan, Michael Auli, and Jason Weston. 2018. Wizard of wikipedia: Knowledge-powered conversational agents. In International Conference on Learning Representations. +Mihail Eric, Rahul Goel, Shachi Paul, Abhishek Sethi, Sanchit Agarwal, Shuyag Gao, and Dilek Hakkani-Tur. 2019. Multiwoz 2.1: Multi-domain dialogue state corrections and state tracking baselines. arXiv preprint arXiv:1907.01669. +Mihail Eric, Lakshmi Krishnan, Francois Charette, and Christopher D. Manning. 2017. Key-value retrieval networks for task-oriented dialogue. In Proceedings of the 18th Annual SIGdial Meeting on Discourse and Dialogue, pages 37-49, Saarbrücken, Germany. Association for Computational Linguistics. +Marjan Ghazvininejad, Chris Brockett, Ming-Wei Chang, Bill Dolan, Jianfeng Gao, Wen-tau Yih, and Michel Galley. 2018. A knowledge-grounded neural conversation model. In Thirty-Second AAAI Conference on Artificial Intelligence. + +Karthik Gopalakrishnan, Behnam Hedayatnia, Qinlang Chen, Anna Gottardi, Sanjeev Kwatra, Anu Venkatesh, Raefer Gabriel, and Dilek Hakkani-Tur. 2019. Topical-Chat: Towards Knowledge-Grounded Open-Domain Conversations. In Proc. Interspeech 2019, pages 1891-1895. +Jonathan Herzig, Pawel Krzysztof Nowak, Thomas Müller, Francesco Piccinno, and Julian Eisenschlos. 2020. TaPas: Weakly supervised table parsing via pre-training. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4320-4333, Online. Association for Computational Linguistics. +Mohit Iyyer, Wen-tau Yih, and Ming-Wei Chang. 2017. Search-based neural structured learning for sequential question answering. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1821-1831, Vancouver, Canada. Association for Computational Linguistics. +Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. 2017. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1601-1611, Vancouver, Canada. Association for Computational Linguistics. +Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: A benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:452-466. +Seungwhan Moon, Pararth Shah, Anuj Kumar, and Rajen Subba. 2019. Opendialkg: Explainable conversational reasoning with attention-based walks over knowledge graphs. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. +Nikola Mrkšić, Diarmuid Řeaghdha, Tsung-Hsien Wen, Blaise Thomson, and Steve Young. 2017. Neural belief tracker: Data-driven dialogue state tracking. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1777-1788, Vancouver, Canada. Association for Computational Linguistics. +F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. 2011. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-2830. + +Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186-191, Brussels, Belgium. Association for Computational Linguistics. +Osman Ramadan, Paweł Budzianowski, and Milica Gasic. 2018. Large-scale multi-domain belief tracking with knowledge sharing. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, volume 2, pages 432-437. +Siva Reddy, Danqi Chen, and Christopher D. Manning. 2019. CoQA: A conversational question answering challenge. Transactions of the Association for Computational Linguistics, 7:249-266. +Nils Reimers and Iryna Gurevych. 2019a. Sentence-bert: Sentence embeddings using siamese bert-networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics. +Nils Reimers and Iryna Gurevych. 2019b. SentenceBERT: Sentence embeddings using Siamese BERTnetworks. 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, Hong Kong, China. Association for Computational Linguistics. +Liliang Ren, Kaige Xie, Lu Chen, and Kai Yu. 2018. Towards universal dialogue state tracking. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2780-2786, Brussels, Belgium. Association for Computational Linguistics. +Marzieh Saeidi, Max Bartolo, Patrick Lewis, Sameer Singh, Tim Roktaschel, Mike Sheldon, Guillaume Bouchard, and Sebastian Riedel. 2018. Interpretation of natural language rules in conversational machine reading. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2087-2097, Brussels, Belgium. Association for Computational Linguistics. +Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. Conceptnet 5.5: An open multilingual graph of general knowledge. In *Thirty-first AAAI* conference on artificial intelligence. +Yi-Lin Tuan, Yun-Nung Chen, and Hung-Yi Lee. 2019. Dykgchat: Benchmarking dialogue generation grounding on dynamic knowledge graphs. 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). +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric 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. +Wenquan Wu, Zhen Guo, Xiangyang Zhou, Hua Wu, Xiyuan Zhang, Rongzhong Lian, and Haifeng Wang. 2019. Proactive human-machine conversation with explicit conversation goal. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3794-3804. +Semih Yagcioglu, Aykut Erdem, Erkut Erdem, and Nazli Ikizler-Cinbis. 2018. RecipeQA: A challenge dataset for multimodal comprehension of cooking recipes. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1358-1368, Brussels, Belgium. Association for Computational Linguistics. +Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. 2018. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2369-2380, Brussels, Belgium. Association for Computational Linguistics. +Xiaoxue Zang, Abhinav Rastogi, Srinivas Sunkara, Raghav Gupta, Jianguo Zhang, and Jindong Chen. 2020. Multiwoz 2.2: A dialogue dataset with additional annotation corrections and state tracking baselines. In Proceedings of the 2nd Workshop on Natural Language Processing for Conversational AI, ACL 2020, pages 109-117. +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q Weinberger, and Yoav Artzi. 2019. Bertscore: Evaluating text generation with bert. In International Conference on Learning Representations. +Yizhe Zhang, Siqi Sun, Michel Galley, Yen-Chun Chen, Chris Brockett, Xiang Gao, Jianfeng Gao, Jingjing Liu, and William B Dolan. 2020. Dialogpt: Large-scale generative pre-training for conversational response generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 270-278. +Hao Zhou, Tom Young, Minlie Huang, Haizhou Zhao, Jingfang Xu, and Xiaoyan Zhu. 2018a. Common-sense knowledge aware conversation generation with graph attention. In *IJCAI*. +Hao Zhou, Chujie Zheng, Kaili Huang, Minlie Huang, and Xiaoyan Zhu. 2020. Kdconv: A chinese multi-domain dialogue dataset towards multi-turn knowledge-driven conversation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7098-7108. + +Kangyan Zhou, Shrimai Prabhumoye, and Alan W Black. 2018b. A dataset for document grounded conversations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 708-713, Brussels, Belgium. Association for Computational Linguistics. + +# A Appendix + +# A.1 Conversation Decompositions + +We counted the number and frequency of unique decompositions in our dataset, which is the selected reference sequence in a conversation. The most frequent decompositions are shown in Table 8. + +
DecompositionCount
I → T → R → P1419
I → T → R → C733
I → T → R → R290
I → T → R → C → P218
T → R → R → P → P136
T → R → P → P116
T → R → C → P116
+ +Table 8: Top 7 most frequent decompositions. A decomposition is defined to be the sequence of references in a given conversation. $\mathrm{I} =$ Intro, $\mathrm{T} =$ Table. $\mathrm{R} =$ Row, $\mathrm{P} =$ Linked Paragraph, $\mathrm{C} =$ Cell + +# A.2 Experimental Details + +We utilized paraphrase-distilroberta-base-v1 model with 82 million parameters provided by the SBERT library (Reimers and Gurevych, 2019b) for the SentenceBERT system state tracking experiment. The TaPas model is built on the BERT model (Devlin et al., 2019). We utilize the TaPas-base model, which correlates to the BERT-base model that contains 110 million parameters. For system state tracking evaluation, we utilize average_precision_score from sklearn (Pedregosa et al., 2011). For retrieval experiments, we utilized the BM25Okapi algorithm from the Rank-BM25 library (Brown, 2020). Our experiments on dialogue generation utilize DialogGPT-small in the Huggingface transformers library (Wolf et al., 2020), which contains 124 million parameters. \ No newline at end of file diff --git a/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/images.zip b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bb27711f33c4d9c0c30247c1a1889a89e76f3219 --- /dev/null +++ b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bf28fbc061cd8bce1337e70fa34d41b25cbf94421a1bee6f6653f3006f9fb00 +size 655470 diff --git a/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/layout.json b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c360f7ce11c4895281377726b33ad88a28bb557a --- /dev/null +++ b/hybridialogueaninformationseekingdialoguedatasetgroundedontabularandtextualdata/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8d0a5c3fb0f5e3cc4e1e73109d08212dd435d072550454201196efca1bb340d +size 327600 diff --git a/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_content_list.json b/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..345fce9dfc868c8c872f28099ba710f62ee25e97 --- /dev/null +++ b/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1abfd7124c9f136b94cc1d9bce33ad3ada38c9fcfa93cffc1ba15d9da389aff +size 84476 diff --git a/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_model.json b/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1730ccaada2d40868b6bfe0cfb8cbe6d2485f85f --- /dev/null +++ b/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd475f641aef7ad8e54f2eb3816ac216b71293548f1fee1e2266400c5b6cabb6 +size 108740 diff --git a/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_origin.pdf b/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..89eaee40ca4b7a19b2f64b51c0ca096768b189eb --- /dev/null +++ b/implicitrelationlinkingforquestionansweringoverknowledgegraph/7135b36f-0602-4a54-82f7-e567089aac90_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7512ddc019f7a78f74752d6994ba74d0b09d74afff752c3a317ad7973fc0c2f9 +size 1806325 diff --git a/implicitrelationlinkingforquestionansweringoverknowledgegraph/full.md b/implicitrelationlinkingforquestionansweringoverknowledgegraph/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0c80941f56716158fd51c5ffab91846096e06c5c --- /dev/null +++ b/implicitrelationlinkingforquestionansweringoverknowledgegraph/full.md @@ -0,0 +1,364 @@ +# Implicit Relation Linking for Question Answering over Knowledge Graph + +Yao Zhao $^{1}$ , Jiacheng Huang $^{1}$ , Wei Hu $^{1,2,*}$ + +Qijin Chen $^{3}$ , Xiaoxia Qiu $^{3}$ , Chengfu Huo $^{3}$ , Weijun Ren $^{3}$ + +1State Key Laboratory for Novel Software Technology, Nanjing University, China + +$^{2}$ National Institute of Healthcare Data Science, Nanjing University, China + +3Alibaba Group, China + +{yaozhao.nju, jchuang.nju}@gmail.com, whu@nju.edu.cn, + +{qijin.cqqj,xiaoxia.qxx,chengfu.huocf,afeei}@alibaba-inc.com + +# Abstract + +Relation linking (RL) is a vital module in knowledge-based question answering (KBQA) systems. It aims to link the relations expressed in natural language (NL) to the corresponding ones in knowledge graph (KG). Existing methods mainly rely on the textual similarities between NL and KG to build relation links. Due to the ambiguity of NL and the incompleteness of KG, many relations in NL are implicitly expressed, and may not link to a single relation in KG, which challenges the current methods. In this paper, we propose an implicit RL method called ImRL, which links relation phrases in NL to relation paths in KG. To find proper relation paths, we propose a novel path ranking model that aligns not only textual information in the word embedding space but also structural information in the KG embedding space between relation phrases in NL and relation paths in KG. Besides, we leverage a gated mechanism with attention to inject prior knowledge from external paraphrase dictionaries to address the relation phrases with vague meaning. Our experiments on two benchmark and a newly-created datasets show that ImRL significantly outperforms several state-of-the-art methods, especially for implicit RL. + +# 1 Introduction + +The past few years have witnessed the rapid development of knowledge-based question answering (KBQA), which aims to answer natural language (NL) questions over knowledge graph (KG), e.g., DBpedia (Auer et al., 2007) and Freebase (Bollacker et al., 2008). In many KBQA systems (Singh et al., 2018; Kapanipathi et al., 2021), as a fundamental module, relation linking (RL) seeks to link a relation phrase expressed in NL to a corresponding relation in KG, which has a great impact on the accuracy of subsequent steps like query construction and even the entire KBQA systems. + +![](images/dbc6c664584a363e0660db2ff9c47b0b0af188d386e1ba229ee57b212caf4893.jpg) +Figure 1: An example of RL to DBpedia. There is no explicit relation between dbr:Dragonaut:_The_Resonance and dbr:Japan. We expect to implicitly link the phrase "from" to an indirect relation path dbp:publisher $\rightarrow$ dbo:country. + +Previous studies (Mulang et al., 2017; Singh et al., 2017; Naseem et al., 2021) focus on the similarities between the relation phrases and the text descriptions (e.g., local names) of relations in KG, and use the textual measures to link them. We refer to these studies as explicit RL, because they all assume that the relations in NL are explicitly expressed and can be recognized by existing NLP tools. However, according to (Sakor et al., 2019), while existing RL methods perform well on several benchmark datasets, they are still challenged by implicit relations prevalent in the real world. + +Figure 1 illustrates a motivating example derived from (Azmy et al., 2018). Assuming that the entity phrase "Dragonaut: The Resonance" has already been linked to dbr:Dragonaut:_The_Resonance, $^{1}$ a typical method, e.g., EARL (Dubey et al., 2018), conducts RL with three steps: detecting the relation phrases in the question, generating the candidate relations in KG according to each phrase, and ranking them by calculating the similarities. However, handling the above question faces two challenges: (1) KG (e.g., DBpedia) is incomplete, which leads + +to the situation that there is no direct relation between the entity dbr:Dragonaut:_The_Resonance and the answer dbr:Japan. Therefore, it is only possible to link them through an implicit relation path expressing a similar meaning as dbo:country. (2) Due to the diversity of NL, there does not exist any explicit relation phrase except the word “from”, but “from” has a vague meaning and cannot do much for disambiguation. Obviously, the expressions of relation phrase “from” and relation path dbp:publisher $\rightarrow$ dbo:country in this example are very different, which leads to the poor performance of existing methods, since they rely on the textual similarity. Besides, according to the statistics in (Stadelmaier and Padó, 2019), $93.8\%$ of people in Freebase do not have place of birth, and $78.5\%$ of people do not have nationality, which shows that the situation of RL through implicit relation paths may occur in question answering frequently. + +In this paper, we focus on the problem of implicit RL, where an implicit relation means the one not explicitly expressed in NL or cannot be linked to a single relation in KG. This is different from the studies, e.g., (Qiu et al., 2020), which use multiple explicit relations for multi-hop reasoning. To address such implicitness, we propose a new RL method called ImRL that links relation phrases in NL to relation paths in KG. To find proper relation paths, we propose a novel path ranking model that captures both textual information in the word embedding space and structural information in the KG embedding space, and align them between relation phrases in NL and relation paths in KG. In this way, in addition to the textual information from word embeddings, ImRL can also use the structural information possessed by KG embeddings to capture the correlation between single relations and relation paths, thereby expressing the missing relations through similar relation paths in the incomplete KG. Considering the work (Xue et al., 2020) that constructs a dictionary of paraphrases and establishes a mapping relationship between NL phrases and relations in KG, which can be prior knowledge for implicit relation phrases with vague meanings, ImRL leverages a gated mechanism with attention to inject prior knowledge from external dictionaries into the model, and integrates all the information to predict the links between implicit relation phrases and relations (or relation paths) in KG. + +In summary, our contributions are threefold: + +- We propose a novel ranking model, with the + +aim to eliminate the influence of incomplete KG. It aligns the textual information in the word embedding space and the structural information in the KG embedding space between relation phrases in NL and relation paths in KG. + +- We explore a variety of ways to inject the knowledge in a paraphrase dictionary into the model, and choose a gate-based method with attention mechanism for knowledge injection, which can provide auxiliary information for the relation phrases with vague meanings. + +- We conduct experiments on three datasets, including two benchmark datasets and a newly-created dataset that particularly focuses on implicit RL. Our results show that ImRL outperforms several state-of-the-art competitors, especially for linking implicit relations. + +# 2 Related Work + +Existing RL approaches mainly focus on two tasks: relation candidate generation and relation disambiguation. For the first task, ReMatch (Mulang et al., 2017), SIBKB (Singh et al., 2017) and EERL (Pan et al., 2019) generate candidates by running a textual similarity-based method over prebuilt dictionaries constructed by analyzing the NL patterns contained in massive text corpora through frequent item mining or crowdsourcing. Several widely-used dictionaries include PATTY (Nakashole et al., 2012), PPDB (Ganitkevitch et al., 2013), Paraphrase (Xue et al., 2020), etc. + +As for the second task, EARL (Dubey et al., 2018) leverages the connection density of KG for ranking. Falcon (Sakor et al., 2019) uses several fundamental principles of English morphology to obtain auxiliary information, and exploits an alignment model for linking. With the development of deep learning, a few deep learning-based methods appear. SLING (Mihindukulasooriya et al., 2020) leverages abstract meaning representation (AMR) to capture the semantic relationships in a question, and ranks the candidates with a Transformer-based model, which is trained in a distantly supervised manner. SimReL (Naseem et al., 2021) also uses AMR, and trains a BERT-based model for relation disambiguation. In addition to the aforementioned studies using DBpedia, there are also some studies, e.g., KBPearl (Lin et al., 2020) and Falcon 2.0 (Sakor et al., 2020), towards other KGs such as Wikidata (Vrandecic and Krötzsch, 2014). + +Despite some literature (Pan et al., 2019; Sakor et al., 2019; Mihindukulasooriya et al., 2020) mentions the issue of implicit relations, there is still much left for improvement. For instance, EERL discovers the implicit relations by using the domains and ranges of properties in KG, but it cannot handle the issue of RL through relation paths. Falcon and SLING mainly focus on the implicit relations in phrases expressing the meaning about country, e.g., "Spanish movie". However, they perform poorly for other kinds of implicit relations, and cannot handle RL through relation paths either. + +In recent years, KG embedding has become a popular area of research (Wang et al., 2017). Its main idea is to encode entities and relations in KG into a continuous low-dimensional embedding space. These embeddings can be further applied to various tasks, such as KG completion and KBQA. Many studies in the KG completion field (Bordes et al., 2013; Lao and Cohen, 2010; Lao et al., 2011) predict the possibility of the establishment of a specific triple through the embedding of entities and relations. Recently, researchers in the KBQA field have also begun to leverage KG embeddings. The studies (Huang et al., 2019; Saxena et al., 2020) try to learn a deep model that maps a NL question into a KG embedding space, and combine the KG embeddings of topic entities in the question with the question embedding to infer the answer. To the best of our knowledge, there is no prior work focusing on using KG embedding for implicit RL. + +# 3 Implicit Relation Linking + +A knowledge graph (KG), denoted by $\mathcal{G}$ , can be defined as a triple $\mathcal{G} = (\mathcal{E},\mathcal{R},\mathcal{T})$ , where $\mathcal{E}$ is the entity set, $\mathcal{R}$ is the relation set, and $\mathcal{T} \subseteq \mathcal{E} \times \mathcal{R} \times \mathcal{E}$ denotes the relational triple set. Each entity in $\mathcal{E}$ is denoted by $e$ , and each relation in $\mathcal{R}$ is denoted by $r$ . If there exists a set of $m$ triples $\{(e_0,r_1,e_1),\ldots ,(e_{m - 1},r_m,e_m)\} \subseteq \mathcal{T}$ , we say that there is an $m$ -hop relation path $p$ between $e_0$ and $e_m$ , denoted by $p = (r_1,\dots ,r_m)$ . The goal of RL can be formulated as: Given a NL question $q$ and a KG $\mathcal{G}$ , linking a relation phrase $s$ in $q$ to its corresponding relation $r$ or relation path $p$ in $\mathcal{G}$ . Figure 2 shows the architecture of our method. + +# 3.1 Path Generation + +The path generation module consists of three steps: + +Entity linking aims to link the phrases in NL that represent real-world objects to the corresponding + +entities in KG. Recent studies (Singh et al., 2018) have shown that entity linking can affect RL. To reduce the influence of entity linking on RL, we use the existing tool Falcon (Sakor et al., 2019) to link entities in advance, which has shown accurate results on entity linking (around 0.83 of F1-score on the LC-QuAD dataset as reported). The results are then fed into subsequent steps. + +Relation identification is to determine whether there is any relation phrase in a question with entity connected to it. Inspired by (Hu et al., 2018), which demonstrates that using rules to transform the dependency tree into a directed graph and using a heuristic search to find the shortest path between two nodes can effectively decompose the complex question into multiple simple triples, thereby discovering the relations. We use a similar method to identify the relations in a question. Furthermore, we use a dictionary-based method (Deng et al., 2015) to identify those phrases that can be linked to classes in KG. In particular, wh-words, e.g., "what" and "when", are also regarded as class phrases. For each pair of nodes in the graph, we consider there is a relation between them if and only if (1) both nodes are phrases linked to entities or classes; (2) all intermediate nodes in the path between the nodes are not linked to entities or classes. The word sequence composed of intermediate nodes is obtained by the breadth-first-search (BFS) algorithm, and regarded as a relation phrases. For more details, please refer to Algorithm 1. In this way, we can obtain some relation phrases with entities connected to them. Furthermore, according to (Mihindukulasooriya et al., 2020), AMR can effectively capture the semantic information at the sentence level, thus we use a similar method for relation phrase extension. For example, for a phrase like "German actor", "country" can be recognized as the relation phrase contained in it through AMR. We refer the reader to (Mihindukulasooriya et al., 2020) for more details. + +Candidate generation. Existing RL methods only consider single relations when generating candidates. However, KG is widely acknowledged as incomplete (Wang et al., 2017), which makes it fail to find the corresponding single relations in KG for some phrases and needs to be expressed by relation paths. We extend the RL task to link phrases to relation paths, where conventional RL can be regarded as a simpler case when the path is one hop. We enumerate the relation path candidates in different + +![](images/be8543c9c9b809a6230c7f3675f52d29e4d3dea42aac537423e6658364a07634.jpg) +Figure 2: Overview of our method. The method has two parts: (1) Path generation parses the input question and finds the relation path candidates in the KG, by entity linking, relation identification and candidate generation. (2) Path ranking encodes the relation phrase in the question and path candidates in the KG in the BERT embedding space and RotatE embedding space, utilizes a ranking model to rank those candidates, and takes the one with the highest similarity score as answer. It also leverages a gated mechanism with attention to inject prior knowledge from external dictionaries to help relation disambiguation. + +ways according to the number of connected entities of a phrase: (1) If a relation phrase is connected with two entities, all the paths between them are regarded as candidates. (2) If there is only one entity, all the paths within $M$ -hop are considered as candidates. (3) Otherwise, if there is any phrase without any entity association, all possible common single relations in KG are considered as candidates. In order to effectively reduce the input size of subsequent modules, we select $c$ candidate paths whose local names are most similar to the relation phrases, where $c$ is a hyperparameter and the similarity is calculated with cosine similarity between the word embeddings of phrases and local names. + +# 3.2 Path Ranking + +We propose a novel ranking model to find the relation path most relevant to the given relation phrase. Different from those studies using path ranking algorithm for KG completion (Lao et al., 2011; Gardner et al., 2014; Mazumder and Liu, 2017; Das et al., 2018), which leverage the entities and relations in the KG for path reasoning, our path ranking model additionally considers the relation phrase in the question for ranking. + +Relation path encoder. The relations in KG can provide rich information. Most existing RL methods mainly focus on the local names of KG relations, and leverage language models to capture the semantics. However, they ignore the structural information in massive triples. In order to make use of both information, we use this relation path + +encoder to model relation paths in the word embedding space, denoted by $R\_Encoder_{we}$ , and the KG embedding space, denoted by $R\_Encoder_{kg}$ . + +$R\_Encoder_{we}$ consists of a BERT encoder (Devlin et al., 2019) and a feed-forward neural network (FFNN). For each relation path candidate $p = (r_1, \ldots, r_m)$ , the sequence of local names $input_p$ of $p$ is denoted by $\langle [CLS], name_{r_1}, [SEP], \ldots, name_{r_m}, [SEP] \rangle$ , which is fed to the encoder to obtain the embedding $\mathbf{p}_{we} \in \mathbb{R}^{d_{we}}$ : + +$$ +\mathbf {p} _ {w e} = \sigma \left(\mathbf {W} _ {1} \operatorname {B E R T} (i n p u t _ {p}) + \mathbf {b} _ {1}\right), \tag {1} +$$ + +where $\sigma (\cdot)$ is the ReLU activation, $\mathbf{W}_1$ is the weight matrix of FFNN, and $\mathbf{b}_1$ is the bias vector. + +$R\_Encoder_{kg}$ uses a KG embedding model to encode the relations in KG. Considering that RotatE (Sun et al., 2019) has been proven to achieve good results in existing work (Huang et al., 2019), and have the properties of composition and symmetry of relations, we choose it as the KG embedding model. According to (Wang et al., 2017), KG embeddings have a certain ability for reasoning. Thus, the KG embedding of a relation path with $d_{kg}$ dimension $\mathbf{p}_{kg} \in \mathbb{R}^{d_{kg}}$ can be obtained by merging all the KG embeddings of single relations within the path through composition operation: + +$$ +\mathbf {p} _ {k g} = \operatorname {R O T A T E} \left(r _ {1}\right) \circ \dots \circ \operatorname {R O T A T E} \left(r _ {m}\right), \tag {2} +$$ + +where $\circ$ denotes the Hadamard product. + +Phrase encoder. In order to compare with the relation paths in KG equally, the relation phrases + +# Algorithm 1 Relation Identification + +Input: $Q$ : Natural language question; $EC$ : Result set of entity and class linking; subj Relations: [subj, nsubj, nsubjpass, csubj, csubjpass, xsubj, poss, partmod]; objRelations: [obj, pocj, dobj, iobj]; +Output: Related entities/classes and relation between them; +Use dependency analysis to obtain an undirected tree $T$ ; +for $ec_{i}$ in $EC$ do +Combine nodes representing $ec_{i}$ in $T$ into one; +Delete all the edges which are related to the combined node, update $T$ ; +end for +Build a new empty graph $G$ , copy nodes in $T$ to $G$ ; +for $t_i$ in $T$ do $\triangleright t_i$ stands for $(node_1, r, node_2)$ +if $r$ in subj Relations then +Add an edge from node1 to node2, weight is the number of entity/class between node1 and node2; +else if $r$ in objRelations then +Add an edge from node2 to node1; +else +Add both edges mentioned above; end if +end for +Update distance between nodes with the Floyd shortest path algorithm; +for node $i$ , node $j$ in $G$ do +if distance(nodei, nodej) = 2 and nodei, nodej are both entities/classes then +Use the BFS algorithm to obtain the relation $r$ between them, return $(node_i, r, node_j)$ ; +end if +end for +in NL questions also need to be encoded into two spaces to capture different aspects of information. +$P\_Encoder_{we}$ aims to encode the relation phrase $s$ with its context in a question $q$ into an embedding $\mathbf{s}_{we} \in \mathbb{R}^{d_{we}}$ . It has the same architecture as $R\_Encoder_{we}$ . The difference is that the input sequence is added with two special tokens $[S]$ and $[Q]$ to separate the relation phrase and its question context, i.e., $input_{s} = \langle [CLS], [S], s, [Q], q, [SEP] \rangle$ : +$\mathbf{s}_{we} = \sigma (\mathbf{W}_2\mathrm{BERT}(input_s) + \mathbf{b}_2),$ (3) + +where $\mathbf{W}_2$ and $\mathbf{b}_2$ are two learnable parameters. +$P\_Encoder_{kg}$ aims to encode the relation phrase and the question into a KG embedding $\mathbf{s}_{kg} \in \mathbb{R}^{d_{kg}}$ . It first uses BERT to encode the whole $input_{s}$ , and pick the embedding of $[CLS]$ , which is then fed to a multi-layer perceptron $\mathrm{MLP}_{we \rightarrow kg}$ with a 3-layer FFNN and ReLU activation to obtain $\mathbf{s}_{kg}$ . In a question, a relation phrase $s$ creates a connection between entities, and we expect the KG embedding $\mathbf{s}_{kg}$ to reflect the KG embedding of the relation path in KG connecting these entities, i.e., $\phi(\mathbf{e}_1, \mathbf{s}_{kg}, \mathbf{e}_2) \approx 0$ , where $\phi$ denotes the score function of RotatE, and $\mathbf{e}_1, \mathbf{e}_2$ are the KG embeddings of two connected entities. This is equivalent to directly using the KG embedding of relation path between the two entities to train the model. Thus, during the training phase, we use the KG embedding of relation path $\mathbf{p}_{kg}$ corresponding to the relation phrase $s$ to guide the learning of $\mathbf{s}_{kg}$ , and the loss function is mean-square error loss: +$\mathcal{L}_{\alpha} = \frac{1}{|\mathcal{D}|}\sum_{(s,q,p)\in \mathcal{D}}\| \mathbf{s}_{kg} - \mathbf{p}_{kg}\| _2^2,$ (4) +where $D$ is the training set, $\mathbf{s}_{kg}$ is the KG embedding of relation phrase $s$ , $\mathbf{p}_{kg}$ is the KG embedding of relation path $p$ , and $\| \cdot \|_2$ is the $L_2$ -norm. +Knowledge injection. The previous works (Nakashole et al., 2012; Xue et al., 2020) pre-collect some paraphrase pairs (e.g., "be born in" is a paraphrase for relation hometown) between relation phrases in NL and KG relations through frequent item mining or crowdsourcing. These paraphrases can be considered as prior knowledge about the diverse meanings of NL. For example, if we have some prior examples of linking "in" to KG relations, e.g., locatedIn, we can use such knowledge to enhance the meanings of implicit relation phrases "in". In this paper, we choose a predicate paraphrase dictionary called Paraphrase (Xue et al., 2020) as the knowledge source. Paraphrase maps NL patterns to DBpedia relations, which currently covers 2,284 relations and 31,130 paraphrase pairs. +We regard the NL patterns in Paraphrase as Keys, and corresponding relations as Values. Keys provide textual knowledge from the perspective of NL, while Values provide both textual and structural knowledge of NL and KG. Same as the previous step, Keys is encoded as $\mathbf{K} \in \mathbb{R}^{d_e \times d_{we}}$ using BERT, Values is encoded as $\mathbf{V}_{we} \in \mathbb{R}^{d_e \times d_{we}}$ and $\mathbf{V}_{kg} \in \mathbb{R}^{d_e \times d_{kg}}$ using BERT and RotatE, respectively. Here, $d_e$ denotes the number of most similar + +paraphrase pairs to be selected. In this way, given a relation phrase, which is then encoded by BERT as $\mathbf{Q} \in \mathbb{R}^{1 \times d_{we}}$ , we can use the attention mechanism (Vaswani et al., 2017) to find the most relevant NL patterns in Paraphrase and integrate their corresponding knowledge into the original embedding: + +$$ +\mathbf {k} _ {w e} = \operatorname {S O F T M A X} \left(\frac {\mathbf {Q K} ^ {T}}{\sqrt {d _ {w e}}}\right) \mathbf {V} _ {w e}, \tag {5} +$$ + +$$ +\mathbf {k} _ {k g} = \operatorname {S O F T M A X} \left(\frac {\mathbf {Q K} ^ {T}}{\sqrt {d _ {k g}}}\right) \mathbf {V} _ {k g}. \tag {6} +$$ + +We also explore a variety of ways to inject the knowledge into our model. Taking the fusion of $\mathbf{p}_{kg}$ and $\mathbf{k}_{kg}$ as an example, we use the following three methods: + +- Element-wise mean (MEAN) is the most straightforward way to add two embeddings and take the average over each element: + +$$ +\mathbf {y} _ {k g} = \frac {1}{2} \left(\mathbf {s} _ {k g} + \mathbf {k} _ {k g}\right). \tag {7} +$$ + +- Concatenation (CAT). By concatenating the two embeddings and feeding them to a linear layer, all the information can be reserved: + +$$ +\mathbf {y} _ {k g} = \mathbf {W} _ {3} \left[ \mathbf {s} _ {k g}; \mathbf {k} _ {k g} \right] + \mathbf {b} _ {3}, \tag {8} +$$ + +where ; denotes the concatenation operation. $\mathbf{W}_3$ and $\mathbf{b}_3$ are two learnable parameters. + +- Gated mechanism (GATE). To retain the valuable original information and absorb new knowledge, a gated mechanism can be used for a trade-off between them: + +$$ +g = \delta \left(\mathbf {W} _ {4} \left[ \mathbf {s} _ {k g}; \mathbf {k} _ {k g} \right] + \mathbf {b} _ {4}\right), \tag {9} +$$ + +$$ +\mathbf {y} _ {k g} = g \cdot \mathbf {s} _ {k g} + (1 - g) \cdot \mathbf {k} _ {k g}, \tag {10} +$$ + +where $\delta (\cdot)$ denotes the sigmoid activation. $\mathbf{W}_4$ and $\mathbf{b}_4$ are two learnable parameters. + +Then, given two fused embeddings, $\mathbf{y}_{we}$ and $\mathbf{y}_{kg}$ of a relation phrase $s$ in question $q$ , and the embeddings of a relation path candidate $p$ , $\mathbf{r}_{we}$ and $\mathbf{r}_{kg}$ , the score function $\psi()$ can be formulated as + +$$ +\psi (s, q, p) = \left[ \mathbf {y} _ {w e}; \mathbf {y} _ {k g} \right] \cdot \left[ \mathbf {p} _ {w e}; \mathbf {p} _ {k g} \right]. \tag {11} +$$ + +We select the cross entropy loss between the one-hot vector of ground truth and the score vector: + +$$ +\mathcal {L} _ {\beta} = - \sum_ {(s, q, p) \in \mathcal {D}} \log \frac {e ^ {\psi (s , q , p)}}{e ^ {\psi (s , q , p)} + \sum_ {p ^ {\prime} \in \mathcal {N} _ {p}} e ^ {\psi (s , q , p ^ {\prime})}}, \tag {12} +$$ + +where $\mathcal{N}_p$ denotes the set of negative relation paths obtained by negative sampling based on $p$ . The negative sampling is implemented by randomly sampling $N$ relations or relation paths in KG which are different from $p$ . + +Finally, the overall loss function is defined as + +$$ +\mathcal {L} = \mathcal {L} _ {\alpha} + \lambda \mathcal {L} _ {\beta}. \tag {13} +$$ + +# 4 Experiments and Results + +# 4.1 Dataset Construction + +Due to the high correlation between RL and KBQA, we follow the works (Mihindukulasooriya et al., 2020; Naseem et al., 2021) to reuse the KBQA datasets as the benchmarks to evaluate the performance of RL. We briefly introduce them as follows: + +- LC-QuAD 1.0 (Trivedi et al., 2017) is a large complex questions dataset for KBQA, which contains 5,000 questions and corresponding SPARQL queries over DBpedia (version 2016-04). Only $1\%$ of the questions involve implicit relation links. +- QALD-9 (Usbeck et al., 2018) is a popular benchmark dataset for KBQA over DBpedia. It provides 408 training questions and 150 test questions, $6\%$ of which need implicit RL. +- Path-based SimpleQuestions dataset (PathSQ) is a new dataset constructed by ourselves for implicit RL evaluation. It is based on DBpedia (version 2016-04) and contains 400 questions that need to be linked through a two-hop relation path. Table 1 lists an example, and we explain its construction details below. + +Construction of PathSQ. Existing benchmarks contain few implicit relations and cannot be used to evaluate implicit RL well. As for other KBQA datasets, e.g., ComplexWebQuestions (Talmor and Berant, 2018), the proportion of implicit relations is also small. Thus, we decide to construct a new dataset by ourselves for implicit RL evaluation. + +In SimpleQuestions (Bordes et al., 2015), some questions have corresponding single relations in Freebase but need to be expressed using multiple relations in DBpedia. Based on this observation, we collect the questions in SimpleQuestions that must map each relation phrase in NL to a relation path in DBpedia. We only consider two-hop relation paths, since paths with more relations are generally rare and spurious (Azmy et al., 2018). We construct PathSQ with the following three steps: + +
QuestionWhat is Claire Stansfield's nationality?
Head entitydbr:Claire_Stansfield
Relation phrasenationality
Implicit relationdbo:birthPlace → dbo:country
Answerdbr:United_Kingdom
+ +Table 1: An example in the PathSQ dataset. + +(1) We remove the question and answer pair in SimpleQuestions such that the entity in the question or the answer entity cannot be mapped to DBpedia. We use the officially released file2 to achieve this goal, which contains the entity mappings between Freebase and DBpedia. (2) For each remaining question and answer pair, we construct a SPARQL query to determine whether there exists a direct relation between the entity in the question and the answer entity. If exists, we remove this pair. (3) We construct another SPARQL query to obtain all the two-hop paths between the two entities for each remaining pair. Among all the paths, we manually label the correct ones and try our best effort to mine 400 questions for experiments. + +# 4.2 Comparative Methods + +We compare our ImRL with six state-of-the-art methods. All of them support RL over DBpedia. + +- SIBKB (Singh et al., 2017) uses PATTY as the underlying knowledge source, and establishes a bipartite graph index from common phrases in NL to KG relations for RL. +- Rematch (Mulang et al., 2017) exploits WordNet and dependency parsing to model relation phrases with their underlying parts of speech, and uses various similarity metrics for ranking. +- EARL (Dubey et al., 2018) models the linking problem as the generalized traveling salesman problem, and uses connection density to link entities and relations jointly. +- Falcon (Sakor et al., 2019) enhances entity and relation linking through cross-KG entity and relation alignment and basic principles of English morphology. +- SLING (Mihindukulasooriya et al., 2020) leverages AMR for preprocessing, trains a Transformer-based model based on distant supervision, and integrates several complementary signals for RL. +- SimReL (Naseem et al., 2021) also uses AMR + +for question representation, and employs a Siamese network with BERT to link relations in an end-to-end manner. + +# 4.3 Experiment Setup + +We implement ImRL in Python 3. All experiments are conducted on a workstation with two Xeon Silver 4215R CPUs, 384GB memory and an NVIDIA TITAN RTX graphics card. We use the API of Falcon (Sakor et al., 2019) to link entities to DBpedia, and use StoG (Zhang et al., 2019) to generate AMR graphs in relation identification. For word embeddings, we use the pre-trained BERT-base model (Wolf et al., 2020) with $d_{we} = 768$ to initialize the parameters and freeze them in the experiments. For KG embeddings, we extract 200,000 popular entities and their related triples from DBpedia as the training corpus, and employ RotatE with $d_{kg} = 200$ for embedding learning. + +As for the hyperparameters, the maximum number of relation path candidates is empirically set to $c = 30$ , the maximum length of path candidates is set to $M = 2$ , the number of negative sampling relations is set to $N = 29$ , and the number of selected paraphrase pairs is set to $d_{e} = 10$ . For all the experiments, we assign the learning rate to $3e^{-4}$ and the batch size to 256. The weight $\lambda$ in loss function is set to 1. The previous works evaluate the performance of RL with precision, recall and F1-score. For consistency, we use the same metrics in our experiments. For LC-QuAD and QALD-9, we use the training set to train the model, and evaluate on the testing set. For PathSQ, due to the small scale, we treat all the dataset as the testing set, and use the training sets of LC-QuAD and QALD-9. + +# 4.4 Main Results + +Table 2 lists the results of all the methods. From the table, ImRL achieves the state-of-the-art results on LC-QuAD and QALD-9. + +Take QALD-9 for example, $94\%$ of the questions are with explicit single relations. For those questions, the F1-score of ImRL can reach 0.48, showing that even without a specific design for explicit RL, ImRL still performs well for it. The reason is that leveraging word embeddings and KG embeddings is common to both implicit and explicit relations. For explicit relations, since they usually contain a single relation, both $R\_Encoder$ and $P\_Encoder$ only need to encode one relation phrase or relation local name, which makes the matching of word embeddings easier. In addition, + +
MethodsLC-QuADQALD-9PathSQ
P↑R↑F1↑P↑R↑F1↑P↑R↑F1↑
TextualSIBKB0.130.150.140.140.100.110.230.120.16
ReMatch0.150.170.160.140.150.140.240.150.18
EARL0.170.210.180.150.170.160.060.050.05
Falcon0.420.440.430.230.230.230.300.190.23
NeuralSLING0.410.550.470.390.500.440.090.050.07
SimReL0.510.510.510.460.440.450.390.190.26
ImRL (ours)0.590.490.540.510.460.480.460.410.43
+ +due to the use of KG embeddings and external knowledge of paraphrase dictionary as additional information, ImRL outperforms the latest method SimReL without the two information. However, since the path generation may cause correct relation paths missing in the candidate set, the recall of ImRL is lower than precision. + +For the remaining $6\%$ questions with implicit relations in QALD-9, the F1-score of our method can reach 0.47. In order to further verify the performance of ImRL on implicit relations, we conduct another experiment on PathSQ. As shown in Table 2, ImRL dominates in terms of all the three evaluation metrics, while the other methods obtain rather poor results. This is because all the questions in PathSQ need to be linked through implicit relation paths, which is challenging for the existing methods. By contrast, ImRL can achieve the reasoning of relation paths according to the composition property of KG embeddings, thereby effectively improving the accuracy of implicit RL. + +Furthermore, ImRL can also handle unseen relations in the inference phase. Taking QALD-9 as an example, there are 46 questions in the testing set whose relations have never appeared in the training set. Still, ImRL can correctly predict 10 of them, which shows the generalization of ImRL. + +# 4.5 Detailed Analysis + +We conduct more experiments to validate the proposed method. All the following experiments are based on QALD-9 dataset. + +Ablation study of embedding models. To measure the contribution of each embedding model in ImRL, we remove the module of obtaining KG embeddings and word embeddings in turn for ablation study. By removing the use of KG embeddings, the F1-score drops by 0.04, while by removing the use of word embeddings, it drops by 0.09. This shows + +Table 2: Relation linking performance comparison. We mark the best scores in bold and second-best underlined. + +
MethodsP↑R↑F1↑
ImRL0.510.460.48
w/o KG embeddings0.460.420.44
w/o word embeddings0.420.370.39
w/o KG and word embeddings*0.280.260.27
+ +* denotes using string matching without embeddings. + +Table 3: Results of different embedding models. + +that in our model, the word embeddings play a more important role than the KG embeddings. We believe that the root cause to the phenomenon is that pre-trained language models, e.g., BERT, are trained on huge corpora with several downstream tasks, thus the word embeddings can provide more prior knowledge. While the KG embedding model used by ImRL, i.e., RotatE, is trained on a small-scale corpus, and the obtained embeddings more focus on limited structural information, which leads to that the KG embeddings provide relatively less information than the word embeddings. + +Different knowledge injection methods. We explore three methods of injecting external knowledge from the paraphrase dictionary into ImRL, and compare them with the method without using the dictionary. The result is shown in Table 4. All methods with injection achieve better results than those without it, which verifies the effectiveness of knowledge injection. Among all the methods, ImRL with a gated mechanism achieves the best results. This shows that the knowledge in the dictionary may also bring noises, thus by combining part of the external knowledge and the original embeddings of the phrases, more accurate external knowledge can be supplemented to enhance the representations of implicit relation phrases. It should be mentioned that utilizing paraphrase dictionaries also has certain limitations. For instance, different dictionaries target different KGs, and may need to be adjusted according to the schema of the KG. + +
MethodsP↑R↑F1↑
ImRL (GATE)0.510.460.48
ImRL (MEAN)0.500.440.47
ImRL (CAT)0.480.430.46
ImRL (None)0.470.420.45
+ +Error propagation in pipeline. In order to reduce the impact of previous steps, and only evaluate the performance of the ranking model, we conduct an experiment assuming that the input to the Path Ranking module is the gold standard. That is, the correct relation path is always in relation path candidate set, which is the input of the Path Ranking module. Under this assumption, the F1-score of the model can reach 0.57, which shows that the aforementioned steps have a great impact on the model. Meanwhile, this also shows that the gap between the relations expressed in NL and those in KG is quite large. Even if lots of additional information is considered, it is still difficult to pick the most correct one from a set of relation path candidates, which reveals the challenge of RL task. + +Improvement to KBQA performance. As a vital module of KBQA, it is necessary to integrate ImRL into some existing KBQA systems for validation. We conduct the experiment on the most popular KBQA dataset LC-QuAD (Trivedi et al., 2017). We choose gAnswer (Hu et al., 2018) as the baseline KBQA system, and replace its RL module with ImRL, which results in about $3.2\%$ increase of F1-score, verifying that our method can indeed help the existing KBQA systems. As a reference, SimReL reports its F1-score improvement on LC-QuAD as $2.4\%$ (Naseem et al., 2021). It is worth noting that the same process can also be migrated to other KGs, e.g., Freebase, for further use. + +Case study. Table 5 shows two real examples to help understanding. In the first case from PathSQ, the relation phrase "involved in" needs to be expressed using the relation path dbo:commander $\rightarrow$ dbo:militaryBranch according to the gold standard. The state-of-the-art method SimReL returns dbo:militaryBranch, as it can only find the single relation whose meaning is most similar to the meaning of the whole question as the answer. Differently, ImRL leverages the path ranking model to find the path that best expresses the meaning of "army ... involved in". In the second case, there is no entity in this question of QALD-9, which + +Table 4: Results of different injection methods. + +
Case 1What army was involved in Siege of Clonmel?
Golddbo:commander → dbo:militaryBranch
SimReLdbo:militaryBranch
ImRLdbo:commander → dbo:militaryBranch
Case 2Give me all animals that are extinct.
Golddbo:conservationStatus
SimReLnull
ImRLdbo:origin
+ +Table 5: Case study of linking results. + +causes that SimReL cannot enumerate any candidate relations since it depends on the result of entity linking. Although the method of generating candidates of ImRL is more robust, the absence of entities also has a great impact on it, making it give the wrong answer dbo:origin. Linking this relation requires understanding the meaning of the noun phrase, which is incapable for all existing RL methods including ImRL. We leave this in future work. + +# 5 Conclusion + +In this paper, we propose ImRL, an implicit RL method that can better deal with the linking of implicit relations in NL and incomplete KG. We extend the RL task to implicit relation path linking, and propose a novel ranking model with knowledge injection. We evaluate our model on three datasets. The results show that our method achieves superior performance on LC-QuAD and QALD-9, where the relations are mostly explicit, and PathSQ, where the relations are all implicit, demonstrating that ImRL can not only deal with relation phrases that are not explicitly expressed in NL, but also perform relation path reasoning in KG. In future work, we will explore how to combine entity linking and implicit RL for improvement. + +# Acknowledgements + +This work is supported by National Natural Science Foundation of China (No. 61872172), and Alibaba Group through Alibaba Research Fellowship Program. + +# References + +Sören Auer, Christian Bizer, Georgi Kobilarov, Jens Lehmann, Richard Cyganiak, and Zachary G. Ives. 2007. DBpedia: A nucleus for a web of open data. In ISWC/ASWC, pages 722-735. + +Michael Azmy, Peng Shi, Jimmy Lin, and Ihab F. Ilyas. 2018. Farewell freebase: Migrating the simplequestions dataset to dbpedia. In COLING, pages 2093-2103. +Kurt D. Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. 2008. Freebase: A collaboratively created graph database for structuring human knowledge. In SIGMOD, pages 1247-1250. +Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. 2015. Large-scale simple question answering with memory networks. CoRR, abs/1506.02075. +Antoine Bordes, Nicolas Usunier, Alberto García-Durán, Jason Weston, and Oksana Yakhnenko. 2013. Translating embeddings for modeling multi-relational data. In NIPS, pages 2787-2795. +Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, Luke Vilnis, Ishan Durugkar, Akshay Krishnamurthy, Alex Smola, and Andrew McCallum. 2018. Go for a walk and arrive at the answer: Reasoning over paths in knowledge bases using reinforcement learning. In ICLR. +Dong Deng, Guoliang Li, Jianhua Feng, Yi Duan, and Zhiguo Gong. 2015. A unified framework for approximate dictionary-based entity extraction. VLDB J., 24(1):143-167. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In *NAACL*, pages 4171–4186. +Mohnish Dubey, Debayan Banerjee, Debanjan Chaudhuri, and Jens Lehmann. 2018. EARL: Joint entity and relation linking for question answering over knowledge graphs. In ISWC, pages 108-126. +Juri Ganitkevitch, Benjamin Van Durme, and Chris Callison-Burch. 2013. PPDB: The paraphrase database. In *NAACL*, pages 758-764. +Matt Gardner, Partha Pratim Talukdar, Jayant Krishnamurthy, and Tom M. Mitchell. 2014. Incorporating vector space similarity in random walk inference over knowledge bases. In EMNLP, pages 397-406. +Sen Hu, Lei Zou, Jeffrey Xu Yu, Haixun Wang, and Dongyan Zhao. 2018. Answering natural language questions by subgraph matching over knowledge graphs. IEEE Trans. Knowl. Data Eng., 30(5):824-837. +Xiao Huang, Jingyuan Zhang, Dingcheng Li, and Ping Li. 2019. Knowledge graph embedding based question answering. In WSDM, pages 105-113. +Pavan Kapanipathi, Ibrahim Abdelaziz, Srinivas Ravishankar, Salim Roukos, Alexander G. Gray, Ramón Fernandez Astudillo, Maria Chang, Cristina Cornelio, Saswati Dana, Achille Fokoue, Dinesh Garg, Alfio Gliozzo, Sairam Gurajada, Hima + +Karanam, Naweed Khan, Dinesh Khandelwal, Young-Suk Lee, Yunyao Li, Francois P. S. Luus, Ndivhuwo Makondo, Nandana Mihindukulasooriya, Tahira Naseem, Sumit Neelam, Lucian Popa, Revanth Gangi Reddy, Ryan Riegel, Gaetano Rossiello, Udit Sharma, G. P. Shrivatsa Bhargav, and Mo Yu. 2021. Leveraging abstract meaning representation for knowledge base question answering. In ACL/IJCNLP (Findings), pages 3884-3894. +Ni Lao and William W. Cohen. 2010. Relational retrieval using a combination of path-constrained random walks. Mach. Learn., 81(1):53-67. +Ni Lao, Tom M. Mitchell, and William W. Cohen. 2011. Random walk inference and learning in a large scale knowledge base. In EMNLP, pages 529-539. +Xueling Lin, Haoyang Li, Hao Xin, Zijian Li, and Lei Chen. 2020. Kbpearl: A knowledge base population system supported by joint entity and relation linking. Proc. VLDB Endow., 13(7):1035-1049. +Sahisnu Mazumder and Bing Liu. 2017. Context-aware path ranking for knowledge base completion. In IJCAI, pages 1195-1201. +Nandana Mihindukulasooriya, Gaetano Rossiello, Pavan Kapanipathi, Ibrahim Abdelaziz, Srinivas Ravishankar, Mo Yu, Alfio Gliozzo, Salim Roukos, and Alexander G. Gray. 2020. Leveraging semantic parsing for relation linking over knowledge bases. In ISWC, pages 402-419. +Isaiah Onando Mulang, Kuldeep Singh, and Fabrizio Orlandi. 2017. Matching natural language relations to knowledge graph properties for question answering. In SEMANTICS, pages 89-96. +Ndapandula Nakashole, Gerhard Weikum, and Fabian M. Suchanek. 2012. PATTY: A taxonomy of relational patterns with semantic types. In EMNLP, pages 1135-1145. +Tahira Naseem, Srinivas Ravishankar, Nandana Mihindukulasooriya, Ibrahim Abdelaziz, Young-Suk Lee, Pavan Kapanipathi, Salim Roukos, Alfio Gliozzo, and Alexander Gray. 2021. A semantics-aware transformer model of relation linking for knowledge base question answering. In ACL, pages 256-262. +Jeff Z. Pan, Mei Zhang, Kuldeep Singh, Frank van Harmelen, Jinguang Gu, and Zhi Zhang. 2019. Entity enabled relation linking. In ISWC, pages 523-538. +Yunqi Qiu, Yuanzhuo Wang, Xiaolong Jin, and Kun Zhang. 2020. Stepwise reasoning for multi-relation question answering over knowledge graph with weak supervision. In WSDM, pages 474-482. +Ahmad Sakor, Isaiah Onando Mulang, Kuldeep Singh, Saeedeh Shekarpour, Maria-Esther Vidal, Jens Lehmann, and Soren Auer. 2019. Old is gold: Linguistic driven approach for entity and relation linking of short text. In *NAACL*, pages 2336-2346. + +Ahmad Sakor, Kuldeep Singh, Anery Patel, and Maria-Esther Vidal. 2020. Falcon 2.0: An entity and relation linking tool over wikidata. In CIKM, pages 3141-3148. +Apoory Saxena, Aditay Tripathi, and Partha P. Talukdar. 2020. Improving multi-hop question answering over knowledge graphs using knowledge base embeddings. In ACL, pages 4498-4507. +Kuldeep Singh, Isaiah Onando Mulang, Ioanna Lytra, Mohamad Yaser Jaradeh, Ahmad Sakor, MariaEsther Vidal, Christoph Lange, and Soren Auer. 2017. Capturing knowledge in semantically-typed relational patterns to enhance relation linking. In KCAP, pages 31:1-31:8. +Kuldeep Singh, Arun Sethupat Radhakrishna, Andreas Both, Saeedeh Shekarpour, Ioanna Lytra, Ricardo Usbeck, Akhilesh Vyas, Akmal Khikmatullaev, Dharmen Punjani, Christoph Lange, MariaEsther Vidal, Jens Lehmann, and Soren Auer. 2018. Why reinvent the wheel: Let's build question answering systems together. In WWW, pages 1247- 1256. +Josua Stadelmaier and Sebastian Padó. 2019. Modeling paths for explainable knowledge base completion. In ACL Workshop on BlackboxNLP, pages 147-157. +Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. 2019. RotatE: Knowledge graph embedding by relational rotation in complex space. In ICLR (Poster). +Alon Talmor and Jonathan Berant. 2018. The web as a knowledge-base for answering complex questions. In *NAACL*, pages 641-651. +Priyansh Trivedi, Gaurav Maheshwari, Mohnish Dubey, and Jens Lehmann. 2017. LC-QuAD: A corpus for complex question answering over knowledge graphs. In ISWC, pages 210–218. +Ricardo Usbeck, Ria Hari Gusmita, Axel-Cyrille Ngonga Ngomo, and Muhammad Saleem. 2018. 9th challenge on question answering over linked data (QALD-9) (invited paper). In Semdeep/NLIWoD@ISWC, pages 58-64. +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 NIPS, pages 5998-6008. +Denny Vrandecic and Markus Krötzsch. 2014. Wiki-data: A free collaborative knowledgebase. Commun. ACM, 57(10):78-85. +Quan Wang, Zhendong Mao, Bin Wang, and Li Guo. 2017. Knowledge graph embedding: A survey of approaches and applications. IEEE Trans. Knowl. Data Eng., 29(12):2724-2743. + +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi 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 M. Rush. 2020. Transformers: State-of-the-art natural language processing. In EMNLP (Demos), pages 38-45. +Bingcong Xue, Sen Hu, Lei Zou, and Jiashu Cheng. 2020. The value of paraphrase for knowledge base predicates. In AAAI, pages 9346-9353. +Sheng Zhang, Xutai Ma, Kevin Duh, and Benjamin Van Durme. 2019. AMR parsing as sequence-to-graph transduction. In ACL, pages 80-94. + +# A Sensitivity Analysis of Candidate Path Number + +In order to assess the sensitivity of ImRL to the number of candidate paths, we report the empirical analyses using different numbers of candidate paths $c$ on QALD-9. The metrics are mean reciprocal rank (MRR), Hits@ $c$ and F1-score. MRR represents the multiplicative inverse of the rank of the gold path in the candidate path list. Hits@ $c$ indicates the proportion of the questions where the gold path ranks in the top- $c$ in the candidate list. F1-score represents the performance of ImRL on QALD-9. As shown in Table 6, with the increase of $c$ , MRR, Hits@ $c$ and F1-score all increase. However, when $c$ reaches 30, the increment of $c$ has little influence on the model performance. Thus, we choose to set $c = 30$ . + +
Candidate path number cMRR ↑Hits@c ↑F1 ↑
100.300.460.39
300.310.700.48
500.310.730.48
+ +Table 6: Results of sensitivity analysis. + +# B Case Study of KBQA Results + +By replacing the relation linking component in gAnswer (an open-source KBQA system) with ImRL, we conducted KBQA experiments over DBpedia. Compared with the original gAnswer, the overall F1-score increases by $3.2\%$ . Figure 3 and Figure 4 show two interesting cases. In Figure 3, the relation linking module of gAnswer incorrectly links the relation in the question to dbo:birthPlace, which leads to the wrong SPARQL query and the wrong answer. In contrast, ImRL can correctly identify the relation dbo:birthDate, modify the SPARQL query and return the correct answer. The main reason is that ImRL can capture the context information "date" with the language model. In Figure 4, although ImRL does not recognize the same relation dbo:foundedBy as the gold SPARQL query, it recognizes dbp:founder, which is actually equivalent to dbo:foundedBy. Due to the organizational structure of DBpedia, namespaces dbo and dbp have different representations of the same relations. However, with the help of KG representation learning, the embeddings of the two kinds of relations can be learned to have similar meanings. Thus, ImRL can capture similar relationships between dbo and dbp through the KG embedding + +module, which also shows that ImRL can leverage the structural information in the KG. + +# C Detailed Analysis of PathSQ + +Since the questions in PathSQ all need to be linked through a multi-hop relation path in DBpedia, we further conduct a visualization experiment on PathSQ to validate whether KG embedding can eliminate the influence of incomplete KGs. We use embeddings obtained through $R\_Encoder_{kg}$ as the input of Embedding Projector3 to perform dimension reduction and obtain two-dimensional embeddings. Take the question "which european nation is Rudi Hedman from?" as an example, we enumerate the top-30 candidate relation paths of entity dbr:Rudi_Hedman. However, since entity dbr:Rudi_Hedman does not have relation dbo:nationality in DBpedia, the gold relation path dbo:nationality is missing in the candidate list. As the phrase "nation" should be linked to dbo:nationality, we compare these candidate relation paths with it. In the KG embedding space, through the visualization (see Figure 5), we find that the embedding of the relation path dbo:birthPlace → dbo:location (color: red) is most similar to that of the relation dbo:nationality (color: orange). It shows that ImRL achieves implicit RL by expressing missing relation dbo:nationality between the entities with relation path dbo:birthPlace → dbo:location. + +![](images/0b511699b7a0a43dfc4368d9bf6b0b604b7a97f5faec134da9b4a0ccbcb3478d.jpg) +Figure 3: Example 1 of KBQA with ImRL over DBpedia. + +![](images/6453ba76cf70874d6fb0365afa4059b0e55ef9641bc11b98d461c7bd95c78eaf.jpg) +Figure 4: Example 2 of KBQA with ImRL over DBpedia. + +![](images/067726d1c6e27dce75f659837554b1f57e729c19ee4304cae99a798ab5b61e45.jpg) +Figure 5: Visualization of KG embeddings. \ No newline at end of file diff --git a/implicitrelationlinkingforquestionansweringoverknowledgegraph/images.zip b/implicitrelationlinkingforquestionansweringoverknowledgegraph/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c8efb6a34a7d40c5328d803ca2bf1eb2d712a4e4 --- /dev/null +++ b/implicitrelationlinkingforquestionansweringoverknowledgegraph/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba20b34c24452b42670d090a9515fd56219e9acc31e23fb4507264181b1030a6 +size 514891 diff --git a/implicitrelationlinkingforquestionansweringoverknowledgegraph/layout.json b/implicitrelationlinkingforquestionansweringoverknowledgegraph/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..85db1886fd045fe59c1aa4ce7a3e557f4ba7af67 --- /dev/null +++ b/implicitrelationlinkingforquestionansweringoverknowledgegraph/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab10a595fd1235e5363abadd84bfec2f3335d1e885b8321f668993731c462f15 +size 497308 diff --git a/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_content_list.json b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..979e194bdc6a67cc77f29234d861b1ff45a82a58 --- /dev/null +++ b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:faf29c938db1548bdb9788cf7dc38a5611e5e48057e9dab27cc7ad5ef67bc56a +size 101121 diff --git a/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_model.json b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a06b21584bc2091c1b3dd55587ea2428d6754dae --- /dev/null +++ b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc4656120e4c86b8a4243ca9aadede7bf48b3fbfba3b7a0a37a484ee302b7c3f +size 117326 diff --git a/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_origin.pdf b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6a4dbeb797b13c455ec8ec65e7a373a55ae972ec --- /dev/null +++ b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/e3337d85-3525-4463-8457-560f6a0c62dd_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a89638cada306f8e6406f90e99900c742d755b073b2054a94b103ead1f0f899 +size 984769 diff --git a/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/full.md b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..be7a1bb1f4f2c0e69b95cc546b1375690ded674e --- /dev/null +++ b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/full.md @@ -0,0 +1,374 @@ +# Improved Multi-label Classification under Temporal Concept Drift: Rethinking Group-Robust Algorithms in a Label-Wise Setting + +Ilias Chalkidis and Anders Søgaard +Department of Computer Science, University of Copenhagen, Denmark +[ilias.chalkidis, soegaard]@di.ku.dk + +# Abstract + +In document classification for, e.g., legal and biomedical text, we often deal with hundreds of classes, including very infrequent ones, as well as temporal concept drift caused by the influence of real world events, e.g., policy changes, conflicts, or pandemics. Class imbalance and drift can sometimes be mitigated by resampling the training data to simulate (or compensate for) a known target distribution, but what if the target distribution is determined by unknown future events? Instead of simply resampling uniformly to hedge our bets, we focus on the underlying optimization algorithms used to train such document classifiers and evaluate several group-robust optimization algorithms, initially proposed to mitigate group-level disparities. Reframing group-robust algorithms as adaptation algorithms under concept drift, we find that Invariant Risk Minimization and Spectral Decoupling outperform sampling-based approaches to class imbalance and concept drift, and lead to much better performance on minority classes. The effect is more pronounced the larger the label set. + +# 1 Introduction + +Large-scale multi-label document classification is the task of assigning a subset of labels from a large predefined set – of, say, hundreds or thousands of labels – to a given document. Common applications include labeling scientific publications with concepts from ontologies (Tsatsaronis et al., 2015), associating medical records with diagnostic and procedure labels (Johnson et al., 2017), pairing legislation with relevant legal concepts (Mencia and Furnkranzand, 2007), or categorizing product descriptions (Lewis et al., 2004). The task in general presents interesting challenges due to the large label space and two-tiered skewed label distributions. + +Class Imbalance In multi-label classification, datasets often exhibit class imbalance, i.e., skewed + +![](images/ed8a3cf9b9e97bcacc04dd755a5490a439153551f303510aacd7f1d502e406fe.jpg) +Figure 1: Model performance using random vs. chronological splits across the medium-sized datasets (Table 1). The shaded parts of the bars are the train/test discrepancy due to over-fitting. The performance drop from random to chronological splits demonstrates the temporal concept drift. + +label distributions (Figure 2). Common methods include resampling and reweighting based on heuristic assumptions, but methods are known to suffer from unstable performance, poor applicability, and high computational cost in complex tasks where their assumptions do not hold (Liu et al., 2020). Datasets with long-tail frequency distributions, like the ones considered below – sometimes referred to as power-law datasets (Rubin et al., 2012) – can be particular challenging. Also, the heuristics fix the trade-off between exploiting as much of the training data as possible and balancing the classes, instead of trying to learn the optimal trade-off. + +Temporal Concept Drift Moreover, class distributions may change over time. This is one dimension of the temporal generalization problem (Lazaridou et al., 2021). Recently, Søgaard et al. (2021) argued chronological data splits are necessary to estimate real-world performance, contrary to random splits (Gorman and Bedrick, 2019), because random splits artificially removes drift. Temporal concept drift, which we focus on here – in + +![](images/e6c1284c4a4f9e5478cfdbca9b5fb2e9600e109b5f1cff46f5d5608cd0802565.jpg) +Figure 2: Label distributions of all datasets (UK-LEX, EUR-LEX, BIOASQ) and settings (small and medium sized label sets). Labels (bars) are ranked from most (left) to least (right) represented in the training set. Class imbalance across labels in the $x$ axis and temporal concept drift across subsets depicted with different coloured bars in the $y$ axis, i.e., a higher misalignment of color bars denotes a higher label distribution swift. + +![](images/4efe1c889a44a381862ab95dc5a544e67d42eb153157c3b586aa19219a5e33e8.jpg) + +![](images/e9bc8859d24c0df7f75577e52750f266f3da62fc23c80c2dc4a3024a2955dd9b.jpg) + +stead of covariate shift (Shimodaira, 2000), for example – is an instance of concept drift (Gama et al., 2014), often discussed in the domain adaptation literature, e.g., Chan and Ng (2006). + +# 2 Related Work + +Temporal Drift Temporal drift has been studied in several NLP tasks, including document classification (Huang and Paul, 2018, 2019), sentiment analysis (Lukes and Søgaard, 2018), Named Entity Recognition (NER) (Rijhwani and Preotiuc-Pietro, 2020), Neural Machine Translation (NMT) (Levenberg et al., 2010) and Language Modelling (Lazaridou et al., 2021). None of these papers focus on class imbalance and temporal concept drift. These papers have mainly been diagnostic, not providing technical solutions that are applicable in our case. + +Multi-label Class Imbalance Class imbalance in (large-scale) multi-label classification has so far been studied through the lens of network architectures, searching for the best neural architecture for handling few- and zero-shot labels in the multi-label setting. To improve the performance for underrepresented (few-shot) classes, Snell et al. (2017) introduced Prototypical Networks that average all instances in each class to form prototype label vectors (encodings), a form of inductive bias, which improved few-shot learning. In a similar direction, Mullenbach et al. (2018) developed the Label-Wise Attention Network (LWAN) architecture, in which label-wise document representations + +are learned by attending to the most informative words for each label, using trainable label encodings (representations). Rios and Kavuluru (2018) extended LWAN and the idea of prototype label encodings. They combined label descriptors with information from a graph convolutional network (Kipf and Welling, 2017) that considered the relations of the label hierarchy to improve the results in few-shot and zero-shot settings. Alternatives to LWAN were considered by Chalkidis et al. (2020a), presenting minor improvements in the few-shot setting, but harming the overall performance. + +Robustness The literature on inducing robust models from skewed data is rapidly growing. See Koh et al. (2021) for a recent survey. The group-robust learning algorithms we adapt and evaluate, e.g., Group Distributionally Robust Optimization (Sagawa et al., 2020), are discussed in detail in Section 4. Recent studies targeting fairness show that class imbalance has connections to bias (Blakeney et al., 2021; Subramanian et al., 2021), i.e., mitigating class-wise disparities has a chain effect on lowering group-wise disparities. + +Main Contributions We focus on (large-scale) multi-label document classification and study a fundamental component of the learning process leading to performance disparities across labels, i.e., the underlying optimization algorithm used for training. We consider group-robust optimization algorithms initially proposed to mitigate group disparities given specific attributes (e.g., gender, race), + +
DatasetDomainNo. of DocumentsSettingNo. of LabelsDistribution Swift (WS)
UK-LEX (new)UK Legislation36,500Small(S)18 / 18
Medium(M)69 / 69
EUR-LEX (Chalkidis et al., 2021)EU Legislation65,000Small(S)20 / 21
Medium(M)100 / 127
BIOASQ (Tsatsaronis et al., 2015)Biomedical Articles100,000Small(S)16 / 1629×
Medium(M)112 / 116
+ +Table 1: Main characteristics of the examined datasets. We report the application domain, the number of documents, the available settings and the corresponding number of labels (used / total), and the label distribution swift between random and chronological splits using the Wasserstein Distance (WS) between train-test label probability distributions, i.e., $WS_{chronological} = N \times WS_{random}$ . + +but re-frame these algorithms to optimize performance across labels rather than across groups. + +# 3 Datasets + +We experiment with three datasets (Table 1) from two domains (legal and biomedical), which support two different classification settings (label granularities), i.e., label sets including more abstract or more specialized concepts (labels).1 + +UK-LEX United Kingdom (UK) legislation is publicly available as part of the United Kingdom's National Archives. Most of the laws have been categorized in thematic categories (e.g., health-care, finance, education, transportation, planing) that are presented in the document preamble and are used for archival indexing purposes. + +We release a new dataset, which comprises 36.5k UK laws (documents). The dataset is chronologically split in training (20k, 1975-2002), development (8.5k, 2002-2008), test (8.5k, 2008-2018) subsets. We manually extract and cluster the topics to supports two different label granularities, comprising 18, and 69 topics (labels), respectively. + +EUR-LEX European Union (EU) legislation is published in EUR-Lex.4 All EU laws are annotated by EU's Publications Office with multiple concepts from EuroVoc, a thesaurus maintained by the Publications Office.5 EuroVoc has been used to index documents in systems of EU institutions, e.g., in web legislative databases, such as EUR-Lex and CELLAR, the EU Publications Office's common repository of metadata and content. + +We use the English part of the dataset of Chalkidis et al. (2021), which comprises 65k EU laws (documents). The dataset is chronologically split in training (55k, 1958-2010), development (5k, 2010-2012), test (5k, 2012-2016) subsets. It supports four different label granularities. We use the 1st and 2nd level of the EuroVoc taxonomy including 21 and 127 categories, respectively. + +BIOASQ The BIOASQ (Task A: Large-Scale Online Biomedical Semantic Indexing) dataset (Tsatsaronis et al., 2015; Nentidis et al., 2021) comprises biomedical articles from PubMed, annotated with concepts from the Medical Subject Headings (MeSH) taxonomy. MeSH is a controlled and hierarchically-organized vocabulary produced by the National Library of Medicine. The current version of MeSH contains more than 29k concepts referring to various aspects of the biomedical research (e.g., Diseases, Chemicals and Drugs). It is used for indexing, cataloging, and searching of biomedical and health-related information, e.g., in MEDLINE/PubMed, and the NLM databases. + +We use a subset of 100k documents derived from the latest version (v.2021) of the dataset. We subsample documents in the period 2000-2021, and we consider chronologically split training (80k, 1964-2015), development (10k, 2015-2018), test (10k, 2018-2020) subsets. We use the 1st and 2nd levels of MeSH, including 16 and 116 categories. + +# 4 Fine-tuning Algorithms + +In our experiments, we rely on pre-trained English language models (Devlin et al., 2019) and fine-tune these using different learning objectives. Our main goal during fine-tuning is to find a hypothesis $(h)$ for which the risk $R(h)$ is minimal: + +$$ +h ^ {*} = \arg \min _ {h \in \mathcal {H}} R (h) \tag {1} +$$ + +$$ +R (h) = \mathbf {E} [ \mathcal {L} (h (x), y) ] \tag {2} +$$ + +where $y$ are the targets (ground truth) and $h(x) = \hat{y}$ is the system hypothesis (model's predictions). + +Similar to previous studies, $R(h)$ is an expectation of the selected loss function $(\mathcal{L})$ . In this work, we study multi-label text classification (Section 3), thus we aim to minimize the binary cross-entropy loss across $L$ classes: + +$$ +\mathcal {L} (x) = - y \log \hat {y} - (1 - y) \log (1 - \hat {y}) \tag {3} +$$ + +ERM (Vapnik, 1992), which stands for Empirical Risk Minimization, is the most standard and widely used optimization technique to train neural methods. The loss is calculated as follows: + +$$ +\mathcal {L} _ {E R M} = \frac {1}{N} \sum_ {i = 1} ^ {N} \mathcal {L} \left(x _ {i}\right) \tag {4} +$$ + +where $N$ is the number of instances (training examples) in a batch, and $\mathcal{L}_i$ is the loss per instance. + +Furthermore, we consider a representative selection of group-robust fine-tuning algorithms that try to mitigate performance disparities with respect to a given attribute $(A)$ , e.g., in a standard scenario that could be the gender of a document's author in sentiment analysis, or the background landscape in image classification. In our case, the attribute of interest is the labeling of the documents. The attribute is split into $G$ groups, which in our case are the classes $(G = L)$ . All algorithms rely on a balanced group sampler, i.e., an equal number $(N_{g_i})$ of instances (samples) per group $(g_i)$ are included at each batch. Most of the algorithms are built upon group-wise losses $(\mathcal{L}_{g_i})$ , computed as follows: + +$$ +\mathcal {L} \left(g _ {i}\right) = \frac {1}{N _ {g _ {i}}} \sum_ {j = 1} ^ {N _ {g _ {i}}} \mathcal {L} \left(x _ {j}\right) \tag {5} +$$ + +In our case, contrary to previous applications of group-robust algorithms, the groups (classes) are not mutually exclusive (documents are tagged with multiple labels). Hence, the group sampler can only guarantee that at least $N$ groups (labels) will be considered at each step, but most probably even more. In this work, we examine the following group-robust algorithms in a label-wise fashion: + +Group Uniform is the more naive group robust algorithm that uses the average of the group-wise + +[label-wise) losses -all groups (labels) are considered equally important-, instead of the standard sample-wise average, as follows: + +$$ +\mathcal {L} _ {G M} = \frac {1}{G} \sum_ {i = 1} ^ {G} \mathcal {L} (g _ {i}) \tag {6} +$$ + +Group DRO (Sagawa et al., 2020), stands for Group Distributionally Robust Optimization (DRO). Group DRO is an extension of the Group Uniform algorithm, where the group-wise (labelwise) losses are weighted inversely proportional to the group (label) performance. The total loss is calculated as follows: + +$$ +\mathcal {L} _ {D R O} = \sum_ {i = 1} ^ {G} w _ {g _ {i}} * \mathcal {L} (g _ {i}), \text {w h e r e} \tag {7} +$$ + +$$ +w _ {g _ {i}} = \frac {1}{W} \left(\hat {w} _ {g _ {i}} * e ^ {L \left(g _ {i}\right)}\right) \quad \text {a n d} \quad W = \sum_ {i = 1} ^ {G} w _ {g _ {i}} \tag {8} +$$ + +where $G$ is the number of groups (labels), $\mathcal{L}_g$ are the averaged group-wise (label-wise) losses, $w_{g}$ are the group (label) weights, $\hat{w}_{g}$ are the group (label) weights as computed in the previous update step. + +V-REx (Krueger et al., 2020), which stands for Risk Extrapolation, is yet another proposed group-robust optimization algorithm. Krueger et al. (2020) hypothesize that variation across training groups is representative of the variation later encountered at test time, so they also consider the variance across the group-wise (label-wise) losses. In V-REx the total loss is calculated as follows: + +$$ +\mathcal {L} _ {R E X} = \mathcal {L} _ {E R M} + \lambda * \operatorname {V a r} \left(\left[ \mathcal {L} _ {g _ {1}}, \dots , \mathcal {L} _ {g _ {G}} \right]\right) \tag {9} +$$ + +where Var is the variance among the group-wise (label-wise) losses, and $\lambda$ , a weighting hyperparameter scalar. + +IRM (Arjovsky et al., 2020), which stands for Invariant Risk Minimization, mainly aims to penalize variance across multiple training dummy estimators across groups, i.e., performance cannot vary in samples that correspond to the same group. The total loss is computed as follows: + +$$ +\mathcal {L} _ {I R M} = \frac {1}{G} \left(\sum_ {i = 1} ^ {G} \mathcal {L} \left(g _ {i}\right) + \lambda * P \left(g _ {i}\right)\right) \tag {10} +$$ + +where $\mathcal{L}_{gi}$ is the loss of the $i_{th}$ instance, which is part of the $g_{th}$ group (label). Refer to Arjovsky et al. (2020) for a more detailed introduction of the group penalty terms $(P_g)$ . + +Deep CORAL (Sun and Saenko, 2016), minimizes the difference in second-order statistics (covariances) between the source and target feature activations. In practice, it introduces group-pair penalties: + +$$ +\mathcal {L} _ {C O R A L} = \mathcal {L} _ {E R M} + \lambda * \frac {1}{G} \left(\sum_ {i = 1} ^ {G} P \left(g _ {i}, g _ {i + 1}\right)\right) \tag {11} +$$ + +$$ +P \left(g _ {i}, g _ {i + 1}\right) = \left[ \overline {{C _ {g _ {i}}}} - \overline {{C _ {g _ {i + 1}}}} \right] ^ {2} + \left[ \overline {{X _ {g _ {i}}}} - \overline {{X _ {g _ {i + 1}}}} \right] ^ {2} \tag {12} +$$ + +where $\overline{C_{g_i}}$ are the averaged covariances of the ith group and $\overline{X_{g_i}}$ are the averaged features (document representations) of the ith group, respectively. Refer to Sun and Saenko (2016) for a more detailed introduction of the group penalty terms $(P_g)$ . + +Spectral Decoupling (Pezeshki et al., 2020) relies on the idea of Gradient Starvation. Pezeshki et al. state that a network could become over-confident in its predictions by capturing only one or a few dominant features. Thus, adding an L2 penalty on the network's logits $(\hat{y}_i)$ provably decouples the fixed points of the dynamics. The total loss is computed as follows: + +$$ +\mathcal {L} _ {S D} = \mathcal {L} _ {E R M} + \lambda * \frac {1}{N} \sum_ {i = 1} ^ {N} \hat {y} _ {i} ^ {2} \tag {13} +$$ + +In our work, we consider the aforementioned algorithms in a label-wise setting, instead of a groupwise setting given a protected attribute. In our case, $G = L$ , where $L$ is the number of labels. + +# 5 Experimental SetUp + +Baseline Models For both legal datasets (UK-LEX, EUR-LEX), we use the small LEGAL-BERT model of Chalkidis et al. (2020b), a BERT (Devlin et al., 2019) model pre-trained on English legal corpora. For BIOASQ, we use the small English BERT model of Turc et al. (2019). Following Devlin et al. (2019), we feed each document to the pre-trained model and obtain the top-level representation $h_{[cls]}$ of the special [cls] token as the document representation. The latter goes through a dense layer of $L$ output units, one per label, followed by a sigmoid activation. + +We also experiment with the Label-Wise Attention Network (LWAN) relying on a BERT encoder (Chalkidis et al., 2020a), dubbed BERT-LWAN. $^{10}$ + +Chalkidis et al. reported state-of-art results in EUR-LEX and AMAZON-13K using BERT-LWAN compared to several baselines. BERT-LWAN uses one attention head per label to generate $L$ document representations $d_{l}$ : + +$$ +a _ {l t} = \frac {\exp (K \left(h _ {t}\right) Q _ {l})}{\sum_ {t ^ {\prime}} \exp (K \left(h _ {t ^ {\prime}}\right) Q _ {l})} \tag {14} +$$ + +$$ +d _ {l} = \frac {1}{T} \sum_ {t = 1} ^ {T} a _ {l t} V \left(h _ {t}\right) \tag {15} +$$ + +$T$ is the document length in tokens, $h_t$ the context-aware representation of the $t$ -th token, $K$ , $V$ are linear transformations of $h_t$ , and $Q_l$ a trainable vector used to compute the attention scores of the $l$ -th attention head; $Q_l$ can also be viewed as a label representation. Intuitively, each head focuses on possibly different tokens of the document to decide if the corresponding label should be assigned. BERT-LWAN employs $L$ linear layers $(o_l)$ with sigmoid activations, each operating on a different label-wise document representation $d_l$ , to produce the probability of the corresponding label $p_l$ : + +$$ +p _ {l} = \operatorname {s i g m o i d} \left(d _ {l} \cdot o _ {l}\right) \tag {16} +$$ + +Across experiments, we use BERT models following a small configuration (6 transformer blocks, 512 hidden units and 8 attention heads), which allows us to increase the batch size up to 64 and consider samples with multiple labels (groups) in the group robust algorithms. In practice, this enables us to sample at least 4 samples per group (label) for all labels in the small label sets, and at least 1 sample per group (label) for 64 labels in the medium-sized label sets (69-112 labels). + +Training Details We fine-tune all models using the AdamW (Loshchilov and Hutter, 2019) optimizer with a learning rate of 2e-5. We use a batch size of 64 and train models for up to 20 epochs using early stopping on the development set. We run three repetitions with different random seeds and report the test scores based on the seed with the best scores on development data. We report development scores on Appendix B.2. + +Evaluation Metrics Given the large number and skewed distribution of labels, retrieval measures have been favored in large-scale multi-label text classification literature (Mullenbach et al., 2018; You et al., 2019; Chalkidis et al., 2020a). Following Chalkidis et al. (2020a), we report mean $R$ -Precision (m-RP) (Manning et al., 2009), while + +
AlgorithmUK-LEXEUR-LEXBIO-ASQ
μ-F1Small m-F1m-RPμ-F1Medium m-F1m-RPμ-F1Small m-F1m-RPμ-F1Medium m-F1m-RPμ-F1Small m-F1m-RPμ-F1Medium m-F1m-RP
ERM80.475.383.666.736.673.279.164.783.968.140.771.786.074.987.668.647.170.4
ERM+GS80.375.284.169.438.873.679.064.984.269.354.771.285.675.286.368.449.269.4
Group Uniform79.775.384.569.256.175.778.668.082.468.950.471.285.576.587.068.952.569.8
Group DRO79.073.584.360.928.569.377.965.779.663.427.863.384.473.585.048.616.948.6
Deep CORAL80.175.783.868.240.373.378.668.082.567.945.270.285.375.486.269.156.170.1
V-REx80.075.584.668.653.774.978.567.982.768.849.269.685.576.687.168.649.969.9
IRM80.475.884.769.459.675.678.967.683.270.454.872.485.476.486.969.855.970.5
SD80.376.884.870.059.875.279.368.979.470.852.572.785.677.286.971.153.872.3
+ +Table 2: Overall test results of the group-robust (label-robust) algorithms across all datasets (UK-LEX, EUR-LEX, BIOASQ) and settings (small and medium sized label sets). + +
DatasetRandomChronological
μ-F1m-F1m-RPμ-F1m-F1m-RP
UK-LEX SM)89.387.592.980.475.383.6
UK-LEX (M)78.245.685.069.236.673.2
EUR-LEX (S)86.876.589.579.364.484.2
EUR-LEX (M)77.649.879.868.440.470.5
BIOASQ (S)86.575.988.886.074.987.6
BIOASQ (M)71.948.272.368.647.170.4
+ +Table 3: Test results across all datasets and settings using random vs. chronological splits with ERM. + +we also report the standard micro- $F1$ $(\mu -\mathrm{F}_1)$ and macro- $F1$ $(\mathrm{m - F_1})$ to better estimate the class-wise performance disparity. + +Data and Code In our experiments, we extend the WILDs (Koh et al., 2021) library, which provides an experimental framework for experimenting with group-robust algorithms. We effectively rewrote all parts of code to consider label-wise groups and losses, while we also implemented the unsupported methods (Group Uniform, V-REx, and Spectral Decoupling). For reproducibility and further exploration with new group-robust methods, we release our code on Github.[11] + +# 6 Results + +Main Results To highlight the temporal concept drift, we initially fine-tune BERT in all datasets with the standard ERM optimization algorithm using both random and chronological splits. Table 3 shows that the real-world performance achieved using the chronological split is severely overestimated using the random split (approx. $+10\%$ across evaluation measures) in two out of three datasets. While all datasets have inherently skewed distributions (class imbalance), which is naturally demonstrated by the performance discrepancy between $\mu -F_{1}$ and m-F1 scores (especially when we consider the larger label sets), the temporal dimension further exacerbate the performance discrepancy as label distributions also vary across subsets (Figure 2). Surprisingly, the performance discrepancy + +between chronological and random splits is much lower on BIOASQ (approx. $1 - 2\%$ ), which could be explained by the larger volume of training data (Table 1), and the very high representation for most of the labels in general (Figure 2). + +In Table 2, we present the overall results for the different optimization algorithms considering the baseline model, BERT. We observe that using a group sampler (ERM+GS), which equals standard oversampling of minority classes, slightly improve the results in $\mathrm{m - F_1}$ $(+1 - 4\%)$ in many cases, while the performance is comparable in $\mu \text{-F}_1$ and m-RP. Considering the results of group-robust algorithms, we observe that most of them improve $\mathrm{m - F_1}$ across datasets compared to ERM and ERM+GS, $+1 - 4\%$ for small-sized datasets and $+5 - 12\%$ in medium-sized datasets. Again the performance in $\mu \text{-F}_1$ and m-RP is mostly comparable or a bit lower, as sample-wise averaged measures are dominated by frequent classes due to class imbalance. + +Contrary, Group DRO is consistently outperformed even by the standard ERM. Recall that Group DRO uses a weighted average of the group-wise (label-wise) losses (Equation 7-8), where the group weights rely on the momentum of the group-wise (label-wise) losses (Equation 8). In our case, this regularization acts counter-intuitively, as weights for the infrequent classes, which are rarely present across batches, are not updated (decrease) constantly. This leads to an asymmetry, where some weights are frequently updated, while others not, and in time the latter are almost zeroed-out and not affect the training objective (loss). + +The effect of group-robust algorithms in relation to the size of the label set. In Table 2, we can also observe that the performance gains of group-robust algorithms compared to ERM are greater when we use the larger label sets. This is also as the class imbalance and temporal concept drift are more severe when we consider more refined labels, especially considering $\mathrm{m - F_1}$ . + +
AlgorithmUK-LEXEUR-LEXBIOASQ
μ-F1Head m-F1m-RPμ-F1Tail m-F1m-RPμ-F1Head m-F1m-RPμ-F1Tail m-F1m-RPμ-F1Head m-F1m-RPμ-F1Tail m-F1m-RP
ERM71.855.777.238.417.076.273.461.975.727.519.451.771.760.673.346.233.658.2
ERM+GS72.758.477.642.629.877.773.363.974.248.145.456.372.361.272.848.140.257.9
Group Uniform71.260.478.562.151.779.873.462.374.742.738.553.071.761.072.851.144.057.7
Group DRO66.945.973.628.910.669.370.050.670.27.14.928.863.933.065.50.90.70.7
Deep CORAL69.261.376.562.048.480.072.660.173.435.830.456.872.763.173.752.346.559.2
V-REx70.256.676.962.150.782.073.161.773.342.636.855.371.560.372.748.839.457.8
IRM71.462.878.662.256.380.374.464.475.248.745.156.572.363.573.154.648.260.0
SD71.562.277.564.557.282.374.864.075.847.141.158.273.764.274.953.243.463.3
+ +Table 4: Test results of group-robust algorithms in head and tail classes in the medium-sized datasets. Head are the $50\%$ most represented (frequent) classes in the training set, and tail are the bottom $50\%$ . + +![](images/2eb4b270010154ccf9cfce97f8f10fde1fe317c7eac2fc8e7eb861a838084c97.jpg) +Figure 3: Class-wise F1-score results for ERM (blue), IRM (yellow) and Spectral Decoupling (red) on medium-sized EUR-LEX. The classes have been ordered (left-to-right) based on the label distribution in the training subset. Algorithms' performance on the left part (head classes) is very much aligned, contrary to the right (tail labels). + +The effect of group-robust algorithms in relation to class frequency. In Table 4, we present results for the different optimization algorithms considering two groups of classes based on their frequency. Head classes are the $50\%$ most frequent classes in the training set, while tail are the bottom $50\%$ . As expected, the performance in head classes is much better compared to tail ones across datasets (approx. $+20 - 40\%$ in $\mathrm{m - F_1}$ ). We observe that the performance gains of group-robust algorithms compared to ERM are greater in the tail classes ( $+10 - 40\%$ in $\mathrm{m - F_1}$ ). This is further highlighted in Figure 3, where we observe that IRM and Spectral Decoupling, the two best performing group-robust algorithms, have larger gains in the right part (tail labels); in fact ERM scores zero in many cases (classes) where the two group-robust algorithms don't. This is highly expected as the goal of the group-robust algorithms is to minimize the group-wise (in our case, label-wise) disparity. Group DRO is severely out-performed in both head and tail, especially in the tail classes (whose weights have been zeroed-out, as previously noticed). + +# Why IRM and Spectral Decoupling are a better fit compared to the rest of the algorithms? + +To answer this question, we need to identify the main differentiation between IRM, Spectral De + +coupling and the rest of the methods. Both IRM and Spectral Decoupling follow similar incentives. IRM penalizes variance across losses in the same group (Equation 10), i.e., in our case, the network is penalized if there is a performance disparity between samples labeled with the same classes using as a reference a dummy classifier. Spectral Decoupling penalizes the variance across label predictions (Equation 13), i.e., the network is penalized for being over-confident. The rest of the algorithms mainly rely on an equal consideration of the group-wise (in our case, label-wise) losses (Equation 6), i.e., in our case, all classes are equally important for the training objective. + +The latter incentive (averaging across group-wise losses) seems very intuitive, although in practice the groups (labels) co-occur (are not mutually exclusive) in a multi-label setting, thus frequent labels remain "first class citizens" in the optimization process, biasing parameter updates in their favor. + +Contrary, both IRM and Spectral Decoupling use a learning component (loss term), which penalizes label degeneration. This is particularly important in multi-label classification, especially when we consider large label sets, as networks tend to over-fit (specialize) in few dominant (frequent) labels that shape the training loss and finally ignore + +
AlgorithmBERTBERT-LWAN
μ-F1Overall m-F1m-RPμ-F1Head m-F1m-RPμ-F1Tail m-F1m-RPμ-F1Overall m-F1m-RPμ-F1Head m-F1m-RPμ-F1Tail m-F1m-RP
ERM68.140.771.773.461.975.727.519.451.770.549.072.374.764.375.943.033.754.0
ERM+GS69.354.771.273.363.974.248.145.456.368.953.871.173.463.673.245.741.257.3
Group Uniform68.950.471.273.462.374.742.738.553.068.754.670.872.863.474.348.045.856.1
Group DRO63.427.863.370.050.670.27.14.928.866.839.865.972.159.470.731.020.243.6
Deep CORAL67.945.270.272.660.173.435.830.456.8n/an/an/a
V-REx68.849.269.673.161.773.342.636.855.369.255.070.173.163.974.248.746.158.4
IRM70.454.872.474.464.475.248.745.156.569.153.071.673.263.274.847.042.856.5
SD70.852.572.774.864.075.847.141.158.270.454.570.474.464.673.347.844.558.5
LW-DRO (v1)69.946.368.474.762.673.839.430.145.569.853.469.374.163.271.541.439.752.0
LW-DRO (v2)71.354.270.375.365.174.049.243.353.471.554.070.574.165.574.048.443.956.6
+ +Table 5: Test results of group-robust algorithms with different models (BERT, and BERT-LWAN) in the medium-sized version of EUR-LEX. Deep CORAL is not applicable (n/a) in LWAN -there is not a universal featurizer-. + +(zero-out) the rest of the labels. This is quite different from the concept of Gradient Starvation, introduced by Pezeshki et al. (2020), where a network becomes over-confident in its predictions by capturing only few dominant features, as in our case the main issue is the label degeneration rather than possible spurious correlations learned by the network. Moreover, Spectral Decoupling does not rely on group-wise losses, similar to the rest. + +The effect of group-robust algorithms using BERT-LWAN. In this part, we compare the effect of the group-robust algorithms in between standard BERT and BERT-LWAN on the medium-sized EUR-LEX dataset. In Table 5, we observe that BERT-LWAN closes the gap between ERM and the best-of-group-robust algorithms. The results of ERM when we use BERT-LWAN are improved across measures, especially when we consider $\mathrm{m - F_1}$ with a $10\%$ improvement over the standard BERT. Both IRM and Spectral Decoupling seem quite insensitive to the underlying model. Similarly, the results for the rest of the group-robust algorithms are improved. Nonetheless, there are still benefits in $\mathrm{m - F_1}$ and less represented (tail) labels in general. Interestingly, Spectral Decoupling improves results in $\mathrm{m - F_1}$ , with comparable $\mu \text{-F}_1$ scores. Although, we observe a performance drop (approx. $2\%$ ) in m-RP when we consider overall and head classes. We hypothesize that IRM and Spectral Decoupling negatively affect the ability of the BERT-LWAN model to correctly rank labels (Equation 16), as they force the model to consider all labels by not being over-confident (discriminatory) with one way or another, as previously explained. + +In Figure 4, we compare the performance of ERM, IRM, and Spectral Decoupling across three EUR-LEX settings, small-sized, medium-sized, and one extra large-sized considering the 3rd level of EuroVoc including 500 concepts (labels). In the small label set, we observe that the use of LWAN + +![](images/badaac2902ecb65e4a3acec817c52f47ad98bc5e9f8719f67cf96453b854eab0.jpg) +Figure 4: LWAN-BERT test performance using ERM, IRM, Spectral Decoupling (SD), and LW-DRO (v2) across all EUR-LEX settings. The shaded part of the bars denotes the performance improvement (of LWAN-BERT) compared to the standard BERT. + +BERT slightly improves the performance when trained with ERM compared to standard BERT (shaded part of the bars). In the medium label set, as already discussed, we observe an approx. $10\%$ improvement with ERM, while in case of the large label set, using LWAN-BERT leads to an approx. $20\%$ improvement with ERM (the performance of BERT is $0\%$ ), and $6.5\%$ with Spectral Decoupling, while IRM proves to be remarkably robust across all settings and both neural methods (BERT with or without the LWAN component). + +# 7 Alternative Combined Algorithm + +Having a clear understanding of what IRM and Spectral Decoupling offer, it seems that we could combine both to leverage all features: (a) rely on group-wise (label-wise) losses as the main driver of the optimization process (Equation 6); (b) penalize the classifier if there is a performance disparity between samples labeled with the same classes (Equation 10); and (c) penalize the classifier for being over-confident (Equation 13). + +We name the new algorithm Label-Wise Distributional Robust Optimization, LW-DRO in short, as it mainly aims to mitigate label-wise disparities, and investigate two alternatives (variants): + +- In version 1 ( $\nu I$ ), we combine the averaged group-wise (label-wise) losses (Equation 6) introduced with Group Uniform, with the Spectral Decoupling penalty (Equation 13). The total loss term $(\mathcal{L}_{\text{LW-DRO}})$ , is computed as follows: + +$$ +\frac {1}{G} \sum_ {i = 1} ^ {G} \mathcal {L} \left(g _ {i}\right) + \lambda * \frac {1}{N} \sum_ {i = 1} ^ {N} \hat {y} _ {i} ^ {2} \tag {17} +$$ + +- In version 2 $(\nu 2)$ , we also include the group-wise penalties of IRM (Equation 10). The total loss term $(\mathcal{L}_{LW - DRO})$ , is computed as follows: + +$$ +\frac {1}{G} \left(\sum_ {i = 1} ^ {G} \mathcal {L} \left(g _ {i}\right) + \lambda_ {1} * P \left(g _ {i}\right)\right) + \lambda_ {2} * \frac {1}{N} \sum_ {i = 1} ^ {N} \hat {y} _ {i} ^ {2} \tag {18} +$$ + +The notation used in Equations 17 and 18 follows the one presented in Section 4. + +In Table 5, we observe that the second variant of LW-DRO (v2) has comparable or better performance compared to IRM and Spectral Decoupling, contrary to the first one (v1). LW-DRO (v2) is a straight forward combination of IRM and Spectral Decoupling, while LW-DRO (v1) that relies on a group-averaged loss under-performs, especially considering the $\mathrm{m - F_1}$ scores. As previously explained, labels co-occur in a multi-label setting, hence averaging label-wise losses favors frequent classes and in turn limits the possible benefits in under-represented classes (perceived by $\mathrm{m - F_1}$ ). + +In Figure 4, we present the results of ERM, and the 3 overall best group-robust algorithms (IRM, Spectral Decoupling, and LW-DRO (v2)) across all EUR-LEX settings. LW-DRO (v2) has comparable performance in the first two settings (small, medium), while being slightly better than IRM in the large-sized setting. While LW-DRO (v2) seems to control the trade-offs between IRM and Spectral Decoupling, we believe that future work should better seek alternative directions with respect to algorithmic advances that possibly mitigate label degeneration and tackles label-wise disparities. + +# 8 Conclusions & Future Work + +We considered one of the main challenges in large-scale multi-label text classification, which comes + +from the fact that not all labels are well represented in the training set due to the class imbalance and the effect of temporal concept drift. To mitigate label disparities, we considered several group-robust optimization algorithms initially proposed to mitigate group disparities given specific attributes. Experi-. menting with three datasets in two different settings, we empirically find that group-robust algorithms vastly improve performance considering macroaveraged measures, while two of the group-robust algorithms (Invariant Risk Minimization and Spectral Decoupling) improve performance across all measures. Considering a more well-suited neural method (LWAN-BERT), we observe a vast performance improvement using ERM, leading to comparable overall results $(\mu -\mathrm{F}_1$ , m-RP) with the grouprobust algorithms; although is still outperformed considering $\mathfrak{m} - \mathbb{F}_1$ . Lastly, based on our understanding of what IRM and Spectral Decoupling, the two best group-robust algorithms, offer, we introduced and evaluated a new algorithm, Label-Wise DRO, which combines features from both, and one of its variants has comparable or better performance considering larger label sets. + +In the future, we would like to further investigate the two-tier anomaly (class imbalance and temporal concept drift). In this direction, we would like to directly take into consideration the time dimension by utilizing this information in group sampling and algorithms (e.g., groups over period of time). We would also like to consider data augmentation techniques (e.g., paraphrasing via masked-language modeling (Ng et al., 2020), and teacher forcing exploiting unlabeled data (Eisenschlos et al., 2019)) to improve the data (feature) sampling variability, as the group sampler used in group-robust algorithms over-sample minority classes with the same limited instances. Further on, we would like to investigate the use of zero-shot LWAN methods (Rios and Kavuluru, 2018; Chalkidis et al., 2020a), which currently harm averaged performance in favor of improved worst case performance. Label encodings based on contextualized word representations generated by pre-trained language models (Hardalov et al., 2021) may mitigate the effect of using non-contextualized ones (e.g., Word2Vec). + +# Acknowledgments + +This work is funded by the Innovation Fund Denmark (IFD) $^{12}$ under File No. 0175-00011A. + +# References + +Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. 2020. Invariant Risk Minimization. arXiv preprint arXiv:1907.02893. +Cody Blakeney, Gentry Atkinson, Nathaniel Huish, Yan Yan, Vangelis Metris, and Ziliang Zong. 2021. Measure twice, cut once: Quantifying bias and fairness in deep neural networks. +Ilias Chalkidis, Manos Fergadiotis, and Ion Androutsopoulos. 2021. MultiEURLEX - a multi-lingual and multi-label legal document classification dataset for zero-shot cross-lingual transfer. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online. +Ilias Chalkidis, Manos Fergadiotis, Sotiris Kotitsas, Prodromos Malakasiotis, Nikolaos Aletras, and Ion Androutsopoulos. 2020a. An empirical study on large-scale multi-label text classification including few and zero-shot labels. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7503-7515, Online. Association for Computational Linguistics. +Ilias Chalkidis, Manos Fergadiotis, Prodromos Malakasiotis, Nikolaos Aletras, and Ion Androutsopoulos. 2020b. LEGAL-BERT: The muppets straight out of law school. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2898-2904, Online. +Yee Seng Chan and Hwee Tou Ng. 2006. Estimating class priors in domain adaptation for word sense disambiguation. In Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics, pages 89-96, Sydney, Australia. Association for Computational Linguistics. +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. +Julian Eisenschlos, Sebastian Ruder, Piotr Czapla, Marcin Kadras, Sylvain Gugger, and Jeremy Howard. 2019. MultiFiT: Efficient multi-lingual language model fine-tuning. 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 5702-5707, Hong Kong, China. Association for Computational Linguistics. +João Gama, Indrundefined Žliobaitundefined, Albert Bifet, Mykola Pechenizkiy, and Abdelhamid Bouchachia. 2014. A survey on concept drift adaptation. ACM Comput. Surv., 46(4). + +Kyle Gorman and Steven Bedrick. 2019. We need to talk about standard splits. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2786-2791, Florence, Italy. Association for Computational Linguistics. +Momchil Hardalov, Arnav Arora, Preslav Nakov, and Isabelle Augenstein. 2021. Few-shot cross-lingual stance detection with sentiment-based pre-training. CoRR, abs/2109.06050. +Xiaolei Huang and Michael J. Paul. 2018. Examining temporality in document classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 694-699, Melbourne, Australia. Association for Computational Linguistics. +Xiaolei Huang and Michael J. Paul. 2019. Neural temporality adaptation for document classification: Diachronic word embeddings and domain adaptation models. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4113-4123, Florence, Italy. Association for Computational Linguistics. +Alistair EW Johnson, David J. Stone, Leo A. Celi, and Tom J. Pollard. 2017. MIMIC-III, a freely accessible critical care database. Nature. +Thomas N. Kipf and Max Welling. 2017. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR). +Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, Tony Lee, Etienne David, Ian Stavness, Wei Guo, Berton A. Earnshaw, Imran S. Haque, Sara Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. 2021. WILDS: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning (ICML). +David Krueger, Ethan Caballero, Jorn-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Remi Le Priol, and Aaron C. Courville. 2020. Out-of-Distribution Generalization via Risk Extrapolation (REx). CoRR. +Angeliki Lazaridou, Adhiguna Kuncoro, Elena Gribovskaya, Devang Agrawal, Adam Liska, Tayfun Terzi, Mai Gimenez, Cyprien de Masson d'Autume, Sebastian Ruder, Dani Yogatama, Kris Cao, Tomás Kocisky, Susannah Young, and Phil Blunsom. 2021. Pitfalls of static language modelling. CoRR, abs/2102.01951. +Abby Levenberg, Chris Callison-Burch, and Miles Osborne. 2010. Stream-based translation models for statistical machine translation. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, pages 394-402, Los Angeles, + +California. Association for Computational Linguistics. +David D. Lewis, Yiming Yang, Tony G. Rose, and Fan Li. 2004. RCV1: A New Benchmark Collection for Text Categorization Research. J. Mach. Learn. Res., 5:361-397. +Zhining Liu, Pengfei Wei, Jing Jiang, Wei Cao, Jiang Bian, and Yi Chang. 2020. MESA: boost ensemble imbalanced learning with meta-sampler. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In International Conference on Learning Representations. +Jan Lukes and Anders Søgaard. 2018. Sentiment analysis under temporal shift. In Proceedings of the 9th Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis, pages 65-71, Brussels, Belgium. Association for Computational Linguistics. +Christopher D. Manning, Prabhakar Raghavan, and Hinrich Schütze. 2009. Introduction to Information Retrieval. Cambridge University Press. +Enaldo Loza Mencia and Johannes FURNKranzand. 2007. An Evaluation of Efficient Multilabel Classification Algorithms for Large-Scale Problems in the Legal Domain. In Proceedings of the LWA 2007, pages 126-132, Halle, Germany. +James Mullenbach, Sarah Wiegreffe, Jon Duke, Jimeng Sun, and Jacob Eisenstein. 2018. Explanable Prediction of Medical Codes from Clinical Text. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1101-1111. +Anastasios Nentidis, Georgios Katsimpras, Eirini Vandorou, Anastasia Krithara, Luis Gasco, Martin Krallinger, and Georgios Paliouras. 2021. Overview of bioasq 2021: The ninth bioasq challenge on large-scale biomedical semantic indexing and question answering. In International Conference of the Cross-Language Evaluation Forum for European Languages (CLEF2021). Springer, Springer. +Nathan Ng, Kyunghyun Cho, and Marzyeh Ghassemi. 2020. SSMBA: Self-supervised manifold based data augmentation for improving out-of-domain robustness. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1268-1283, Online. Association for Computational Linguistics. +Mohammad Pezeshki, Sekou-Oumar Kaba, Yoshua Bengio, Aaron Courville, Doina Precup, and Guillaume Lajoie. 2020. Gradient starvation: A learning proclivity in neural networks. arXiv preprint arXiv:2011.09468. + +Shruti Rijhwani and Daniel Preotiac-Pietro. 2020. Temporally-informed analysis of named entity recognition. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7605-7617, Online. Association for Computational Linguistics. +Anthony Rios and Ramakanth Kavuluru. 2018. Few-shot and zero-shot multi-label learning for structured label spaces. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3132-3142, Brussels, Belgium. Association for Computational Linguistics. +Timothy Rubin, America Chambers, Padhraic Smyth, and Mark Steyers. 2012. Statistical topic models for multi-label document classification. Machine Learning, 88:157-208. +Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. 2020. Distributionally Robust Neural Networks. In International Conference on Learning Representations. +Hidetoshi Shimodaira. 2000. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of Statistical Planning and Inference, 90(2):227-244. +Jake Snell, Kevin Swersky, and Richard S. Zemel. 2017. Prototypical networks for few-shot learning. CoRR, abs/1703.05175. +Shivashankar Subramanian, Afshin Rahimi, Timothy Baldwin, Trevor Cohn, and Lea Frermann. 2021. Fairness-aware class imbalanced learning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 2045-2051, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Baochen Sun and Kate Saenko. 2016. Deep CORAL: Correlation Alignment for Deep Domain Adaptation. In Computer Vision - ECCV 2016 Workshops, pages 443-450, Cham. Springer International Publishing. +Anders Søgaard, Sebastian Ebert, Jasmijn Bastings, and Katja Filippova. 2021. We need to talk about random splits. In Proceedings of the 2021 Conference of the European Chapter of the Association for Computational Linguistics (EACL), Online. +George Tsatsaronis, Georgios Balikas, Prodromos Malakasiotis, Ioannis Partalas, Matthias Zschunke, Michael R Alvers, Dirk Weissenborn, Anastasia Krithara, Sergios Petridis, Dimitris Polychronopoulos, Yannis Almirantis, John Pavlopoulos, Nicolas Baskiotis, Patrick Gallinari, Thierry Artieres, Axel Ngonga, Norman Heino, Eric Gaussier, Liliana Barrio-Alvers, Michael Schroeder, Ion Androutsopoulos, and Georgios Paliouras. 2015. An overview of the bioasq large-scale biomedical semantic indexing and question answering competition. BMC Bioinformatics, 16:138. + +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. + +V. Vapnik. 1992. Principles of risk minimization for learning theory. In Advances in Neural Information Processing Systems, volume 4. Morgan-Kaufmann. + +Ronghui You, Zihan Zhang, Ziye Wang, Suyang Dai, Hiroshi Mamitsuka, and Shanfeng Zhu. 2019. AttentionXML: Label Tree-based Attention-Aware Deep Model for High-Performance Extreme Multi-Label Text Classification. In Advances in Neural Information Processing Systems, pages 5812-5822. + +# A Measuring class-wise bias + +Blakeney et al. (2021) recently introduced two evaluation measures to estimate class-wise bias of two models in comparison to one another in a multiclass setting, and show that these metrics can be also used to measure fairness and bias with respect to protected attributes. + +Following Blakeney et al. (2021), in Figure 5 we present the normalized Combined Error Variance (CEV) in-between algorithms. CEV estimates the class-wise bias of a model A relative to another model B has increased of the change between model A and a random predictor. For a detailed analysis of the CEV metric, please refer to Blakeney et al. (2021). + +In our case, as different models, we consider BERT trained with a different algorithm. In both UK-LEX and EUR-LEX, swapping Group Uniform, IRM, or Spectral Decoupling with ERM, or Group DRO leads to a higher class-wise bias, which is highly expected given the aforementioned performance analysis, i.e., improved $\mathrm{m - F_1}$ scores. + +# B Additional Results + +
AlgorithmSmallMedium
m-F1μ-F1m-F1μ-F1
ERM71.860.247.410.3
ERM+GS71.762.447.512.6
Group Uniform71.966.148.213.3
Group DRO65.247.414.03.8
Deep CORAL72.167.147.112.3
V-REx71.965.947.611.3
IRM72.066.653.318.3
Spectral Decoupling72.367.253.116.1
+ +Table 6: Overall test results of the group-robust algorithms across on MIMIC-III dataset. + +# B.1 Experiments on MIMIC-III + +MIMIC-III dataset (Johnson et al., 2017) contains approx. 50k discharge summaries from US hospitals. Each summary is annotated with one or more codes (labels) from the ICD-9 hierarchy, which has 8 levels. $^{13}$ . The International Classification of Diseases, Ninth Revision (ICD-9) is the official system of assigning codes to diagnoses and procedures associated with hospital utilization in the United States and is maintained by the World Health Organization (WHO). + +MIMIC-III has been anonymized to protect patients privacy, including chronological information (e.g., entry/discharge dates). Hence, it is not possible to split data in chronological splits. We split the dataset randomly in training (30k), development (10k), test (10k) subsets. We use the 1st and 2nd level of ICD-9 including 19 and 184 categories, respectively. + +In Table 6, we present the results, which lead to the very same observations discussed for the rest of the datasets. + +# B.2 Development Results + +We run three repetitions with different random seeds and in the main article (Section 6, we report the test scores based on the seed with the best scores on development data. For completeness, in Tables 7, 8, 9, we report the development results of the group-robust (label-robust) algorithms across all datasets (UK-LEX, EUR-LEX, BIOASQ) and settings (small and medium sized label sets) using BERT. We report the mean and standard deviation $(\pm)$ across all three examined seeds. + +![](images/c9683bd9a27fc4255f6f3b7d66ccc2491246e1d236e8040d51c7d1b37cf737de.jpg) +Figure 5: Class-wise bias in-between algorithms across datasets, measured with the normalized Combined Error Variance (CEV) as defined by Blakeney et al. (2021). + +![](images/597a372de1b11413a454e414b88a0472ba2a75025978aa117764c3a3fb9b8c14.jpg) + +
AlgorithmUK-LEXEUR-LEXBIO-ASQ
SmallMediumSmallMediumSmallMedium
ERM83.9 ± 0.472.7 ± 0.382.7 ± 0.173.9 ± 0.286.3 ± 0.168.5 ± 0.2
ERM+GS83.7 ± 0.276.1 ± 0.10.0 ± 0.075.3 ± 0.185.8 ± 0.268.0 ± 0.1
Group Uniform83.4 ± 0.475.9 ± 0.182.5 ± 0.175.1 ± 0.385.7 ± 0.168.5 ± 0.5
Group DRO83.4 ± 0.267.9 ± 0.281.6 ± 0.369.7 ± 0.284.6 ± 0.143.5 ± 6.5
Deep CORAL83.2 ± 0.573.5 ± 0.282.7 ± 0.073.8 ± 0.385.3 ± 0.167.5 ± 0.3
V-REx83.8 ± 0.273.9 ± 0.282.4 ± 0.175.2 ± 0.085.7 ± 0.068.2 ± 0.5
IRM83.7 ± 0.677.3 ± 0.382.3 ± 0.276.0 ± 0.485.6 ± 0.169.5 ± 0.7
SD84.1 ± 0.577.4 ± 0.283.1 ± 0.176.5 ± 0.286.0 ± 0.070.8 ± 0.1
+ +Table 7: Overall $\mu$ -F1 development results of the group-robust (label-robust) algorithms across all datasets (UK-LEX, EUR-LEX, BIOASQ) and settings (small and medium sized label sets). We report the mean and standard deviation (±) across three seeds. + +
AlgorithmUK-LEXEUR-LEXBIO-ASQ
SmallMediumSmallMediumSmallMedium
ERM78.9 ± 0.727.7 ± 19.667.1 ± 0.744.4 ± 0.775.8 ± 0.647.6 ± 0.6
ERM+GS80.0 ± 0.447.4 ± 0.568.3 ± 0.060.4 ± 0.776.2 ± 0.249.9 ± 0.1
Group Uniform80.2 ± 0.466.6 ± 0.371.9 ± 0.556.6 ± 0.476.6 ± 0.152.3 ± 1.4
Group DRO79.5 ± 0.335.2 ± 1.165.4 ± 2.332.2 ± 0.873.3 ± 0.613.9 ± 4.2
Deep CORAL79.6 ± 0.654.3 ± 1.772.1 ± 0.049.5 ± 1.375.5 ± 0.455.7 ± 1.8
V-REx80.2 ± 0.761.0 ± 0.972.0 ± 0.355.7 ± 0.276.6 ± 0.149.9 ± 1.7
IRM80.2 ± 0.469.6 ± 0.771.4 ± 0.560.8 ± 1.676.7 ± 0.155.7 ± 2.2
SD81.2 ± 0.869.3 ± 0.573.4 ± 0.358.8 ± 0.377.0 ± 0.254.5 ± 0.5
+ +Table 8: Overall m- ${\mathrm{F}}_{1}$ development results of the group-robust (label-robust) algorithms across all datasets (UK- LEX, EUR-LEX, BIOASQ) and settings (small and medium sized label sets). We report the mean and standard deviation $\left( \pm \right)$ across three seeds. + +
AlgorithmUK-LEXEUR-LEXBIO-ASQ
SmallMediumSmallMediumSmallMedium
ERM87.5 ± 0.577.2 ± 0.686.1 ± 0.075.5 ± 0.888.3 ± 0.071.0 ± 0.3
ERM+GS88.7 ± 0.377.6 ± 0.486.5 ± 0.175.8 ± 0.689.4 ± 0.270.5 ± 0.1
Group Uniform87.0 ± 0.480.1 ± 0.385.2 ± 0.675.7 ± 0.787.4 ± 0.170.1 ± 0.4
Group DRO86.6 ± 0.375.0 ± 0.282.6 ± 0.469.7 ± 0.285.7 ± 0.243.1 ± 6.9
Deep CORAL87.0 ± 0.378.3 ± 0.785.7 ± 0.175.7 ± 0.286.1 ± 0.370.9 ± 0.7
V-REx87.5 ± 0.279.9 ± 0.685.5 ± 0.375.6 ± 0.087.4 ± 0.070.0 ± 0.4
IRM87.2 ± 0.480.7 ± 0.385.3 ± 0.476.4 ± 0.887.4 ± 0.070.5 ± 0.4
SD87.5 ± 0.181.1 ± 0.283.9 ± 0.276.8 ± 0.187.5 ± 0.072.6 ± 0.2
+ +Table 9: Overall m-RP development results of the group-robust (label-robust) algorithms across all datasets (UK-LEX, EUR-LEX, BIOASQ) and settings (small and medium sized label sets). We report the mean and standard deviation $(\pm)$ across three seeds. \ No newline at end of file diff --git a/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/images.zip b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ccadebff7b28340d8e642f91a60a84a85762f6e5 --- /dev/null +++ b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12448ec90a03cc8e8ce62cd77ce3f2965be569f8dc43abef0fcf3ca25c41796b +size 921308 diff --git a/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/layout.json b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c04bcd78fb5e447894c2204bb5d1f3be43da6a4d --- /dev/null +++ b/improvedmultilabelclassificationundertemporalconceptdriftrethinkinggrouprobustalgorithmsinalabelwisesetting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dbf77ea454cc9ad1df5147233d5742e25124fa95f342de5ef5ae35e45906b7a +size 430514 diff --git a/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_content_list.json b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d4db38e6ffd6c4408d86bfd2240829f223baeba4 --- /dev/null +++ b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c58e3c501726418fd1239e473e197d32ab9cc54161b837f0706333498e3213a +size 95456 diff --git a/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_model.json b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_model.json new file mode 100644 index 0000000000000000000000000000000000000000..123b37d3fd98fe63d57bc6742d7c2b3610f19a59 --- /dev/null +++ b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca992e0597126a8f9941de2035666b287d89ca8048a4f33e64d35bc70f824e1b +size 119711 diff --git a/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_origin.pdf b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2a768615818ae48d0bd7d770c104dd2931284e19 --- /dev/null +++ b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/ac059ff7-2544-421e-b9c0-01dee0d6c007_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d33d2514f234a95ed6c57ec4e86596bd1bb04a413a4e25a8d7894bbeca2b05c +size 519407 diff --git a/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/full.md b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c9e9e3ba40241db220580649398adaec58bc0e32 --- /dev/null +++ b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/full.md @@ -0,0 +1,379 @@ +# Improving Candidate Retrieval with Entity Profile Generation for Wikidata Entity Linking + +Tuan Lai, Heng Ji, ChengXiang Zhai +University of Illinois at Urbana-Champaign +{tuanml2, hengji, czhai} @illinois.edu + +# Abstract + +Entity linking (EL) is the task of linking entity mentions in a document to referent entities in a knowledge base (KB). Many previous studies focus on Wikipedia-derived KBs. There is little work on EL over Wikidata, even though it is the most extensive crowdsourced KB. The scale of Wikidata can open up many new real-world applications, but its massive number of entities also makes EL challenging. To effectively narrow down the search space, we propose a novel candidate retrieval paradigm based on entity profiling. Wikidata entities and their textual fields are first indexed into a text search engine (e.g., Elasticsearch). During inference, given a mention and its context, we use a sequence-to-sequence (seq2seq) model to generate the profile of the target entity, which consists of its title and description. We use the profile to query the indexed search engine to retrieve candidate entities. Our approach complements the traditional approach of using a Wikipedia anchor-text dictionary, enabling us to further design a highly effective hybrid method for candidate retrieval. Combined with a simple cross-attention reranker, our complete EL framework achieves state-of-the-art results on three Wikidata-based datasets and strong performance on TACKBP-20101. + +# 1 Introduction + +Entity linking (EL) is the task of mapping entity mentions in a document to standard referent entities in a target knowledge base (KB) (Dill et al., 2003; Cucerzan, 2007; Mihalcea and Csomai, 2007; Milne and Witten, 2008; Ji et al., 2010; Radhakrishnan et al., 2018; Lai et al., 2021a; Jiang et al., 2021). EL systems have found applications in many tasks such as question answering (Li et al., 2020a), knowledge base population (Dredze et al., 2010), + +information extraction (Li et al., 2020b; Wen et al., 2021; Lai et al., 2021b), and query interpretation (Kasturia et al., 2022). In general, the task is challenging because the same word or phrase can be used to refer to different entities. At the same time, the same entity can be referred to by different words or phrases. + +Given the importance of EL, researchers have introduced a plethora of EL methods, ranging from using hand-crafted features (Ratinov et al., 2011; Pan et al., 2015) to using deep language models (Agarwal and Bikel, 2020; Cao et al., 2021; Botha et al., 2020). The vast majority of these studies have focused on linking mentions to Wikipedia or Wikipedia-derived KBs such as DBpedia (Auer et al., 2007) or YAGO (Suchanek et al., 2007). As of November 2021, there are about 6.4 million articles in English Wikipedia. However, many entities are still missing from Wikipedia (Redi et al., 2020). + +On the other hand, Wikidata, the most extensive general-interest KB, has much broader coverage than Wikipedia (Vrandecic and Krötzsch, 2014). Wikidata contains more than 40 million entities with English titles, about seven times more than the number of articles in English Wikipedia. Every entity in Wikipedia has an equivalent entry in Wikidata, but not vice versa. The scale of Wikidata can open up many new real-world applications. When a disaster happens, many people rush to social media to share updates about the event (Ashktorab et al., 2014). Using an EL system to extract critical information (e.g., affected locations and donor agencies) can aid in monitoring the situation (Zhang et al., 2018). However, many entities may not be well-known, and these entities are likely to be present in Wikidata than in Wikipedia (Geiβ et al., 2017). + +Despite the potential of Wikidata becoming a universal hub of real-world entities, there exists little in-depth research on EL over Wikidata (Möller et al., 2021). The massive number of entities in Wikidata makes it challenging to find the correct + +![](images/162e1e0ff5299944fb3f30e6233127e41132ae6476a5380447a089b0ec222be6.jpg) +Figure 1: An overview of EPGEL, our entity linking framework. + +entity for an input mention. Many previous EL methods for Wikipedia use a dictionary built from anchor texts to reduce the original search space to a small list of candidate entities (Han et al., 2011; Shen et al., 2015; Phan et al., 2017). This dictionary-based approach is not directly applicable to Wikidata, since the description of each entity in Wikidata does not contain any anchor text. + +In this work, we propose a novel candidate retrieval paradigm for Wikidata based on entity profile generation. Wikidata entities and their textual fields are first indexed into a text search engine (e.g., Elucidsearch). Given an entity mention and its context, we use a seq2seq model to generate the profile of the target entity, which consists of its title and description. The profile is then used to query the indexed search engine to retrieve candidate entities. Our technique is applicable to virtually any KB, not just Wikipedia or Wikidata. It also complements the dictionary-based approach, enabling us to further design an effective hybrid method for candidate retrieval. Combined with a simple cross-attention reranker, our complete EL framework achieves state-of-the-art (SOTA) results on three Wikidata-based datasets and strong performance on the standard TACKBP-2010 dataset. + +In summary, our main contributions are: (1) a novel candidate retrieval paradigm based on entity profiling and (2) a new EL framework for Wikidata. Extensive experiments on four public datasets verify the effectiveness of our framework. We refer to our framework as EPGEL, which stands for Entity Profile Generation for Entity Linking. + +# 2 Methods + +# 2.1 Overview + +Problem Formulation Given a set of mentions $M = \{m_1, \dots, m_N\}$ in a document and a knowledge base $\mathcal{E}$ , the task is to find a mapping $M \to \mathcal{E}$ that links each mention to a correct entity in $\mathcal{E}$ . We assume that entity mentions are already given, e.g., identified by some mention extraction module. + +Entity Linking Framework Figure 1 shows an overview of EPGEL. At a high level, similar to many previous methods (Shen et al., 2015), EPGEL consists of two main stages: (1) candidate entity retrieval (2) candidate reranking. Given an entity mention, the role of the candidate retrieval module is to retrieve a small list of candidate entities (Sec. 2.2). Our candidate retrieval approach is a combination of both the traditional dictionary-based approach (Sec. 2.2.1) and our profiling-based approach (Sec. 2.2.2). In the second stage, each candidate entity is reranked by a simple Transformer-based cross-attention reranker (Sec. 2.3). + +# 2.2 Candidate Entity Retrieval + +# 2.2.1 Dictionary-based Candidate Retrieval + +Overview Dictionary-based techniques are the dominant approaches to candidate retrieval of many previous Wikipedia EL systems (Guo et al., 2013; Ling et al., 2015; Fang et al., 2020). The basic idea is to estimate the mention-to-entity prior probability $\hat{p}(e|m)$ . For example, both the technology company Amazon and the Amazon river could be referred to by "Amazon". However, when people mention "Amazon", it is more likely that they mean the company rather than the river. + +![](images/f5cbcedd9d68ceee137fb2441c62915d20250f4094956bd64854cd6fb67e6d8e.jpg) +Figure 2: Candidate retrieval based on entity profiling. + +Prior Estimation The anchor texts in Wikipedia are frequently used for estimating the prior probability: + +$$ +\hat {p} (e | m) = \frac {\operatorname {c o u n t} (m , e)}{\operatorname {c o u n t} (m)} \tag {1} +$$ + +where $\mathrm{count}(m)$ is the total number of anchor texts having the entity mention $m$ as the surface form in Wikipedia; count $(m,e)$ denotes the number of anchor texts with the surface form $m$ pointing to the entity $e$ . Even though this approach is highly effective for EL over Wikipedia (Ganea and Hofmann, 2017), it is not directly applicable to Wikidata. A dictionary built from Wikipedia anchor texts will never return entities that are in Wikidata but not in Wikipedia. Furthermore, in Wikidata, the textual description of each entity is typically short and does not contain any anchor text. Therefore, it is not possible to build a dictionary specifically for Wikidata using the same approach. Below, we propose a new approach that is applicable to Wikidata. + +# 2.2.2 Entity Profiling for Candidate Retrieval + +Overview We propose a more general paradigm for candidate retrieval (Figure 2). We first index all useful entities from Wikidata into Elasticsearch (ES), an open-source text search engine. During inference, given an entity mention and its context, we use a sequence-to-sequence (seq2seq) model to generate the profile of the target entity. We then + +use the original mention and the generated profile as the basis for formulating the ES query. This candidate retrieval approach based on entity profiling is applicable to virtually any KB. At the very least, each entity in a KB typically has a textual title. + +Entity Profile Generation Model A straightforward approach to query ES is to directly use the literal string of the input mention (Sakor et al., 2020; Kannan Ravi et al., 2021). However, without any contextual information, the literal mention text is not informative and discriminative enough. In the example shown in Figure 2, one can simply ask ES to search for entities whose title field or aliases field contains the word "Bruins". However, there is an ice hockey team based in Boston named "Bruins" (Q194121), and there is also a college basketball team with the same name (Q3615392). Neither of these entities is the correct target entity (a football team of UCLA). In the input context, the phrase "defensive lineman" implies that the mention refers to a football team. Also, as UCLA is a common acronym abbreviating the University of California, Los Angeles, a well-trained generation model can generate a description that closely resembles the target entity's actual description (Figure 2). + +To this end, we train a conditional generation model for generating the profile of the target entity, + +where the condition is the mention and its context: + +$$ +[ \mathrm {s} ] \operatorname {c t x} _ {\text {l e f t}} [ \mathrm {m} ] \text {m e n t i o n} [ / \mathrm {m} ] \operatorname {c t x} _ {\text {r i g h t}} [ / \mathrm {s} ] +$$ + +Here, mention, $\mathrm{ctx}_{\mathrm{left}}$ , $\mathrm{ctx}_{\mathrm{right}}$ are the tokens of the entity mention, context before and after the mention respectively. $[m]$ and $/m$ are used to separate the original mention from its context. $[s]$ and $/s$ are special tokens denoting the start and the end of the entire concatenated input, respectively. The target output is a concatenation of the target entity's title and its description (Figure 2). + +Our conditional generation model is an encoder-decoder language model (e.g., BART (Lewis et al., 2020a) and T5 (Raffel et al., 2020)). The generation process models the conditional probability of selecting a new token given the previous tokens and the input to the encoder. + +$$ +p \left(\mathbf {Y} _ {1: n} \mid c\right) = \prod_ {i = 1} ^ {n} p \left(\mathbf {Y} _ {i} \mid \mathbf {Y} _ {< i}, c\right) \tag {2} +$$ + +where $\mathbf{Y}_{1:n}$ denotes the target output sequence and $c$ denotes the condition (i.e., the input mention and its context). + +Elasticsearch Query Construction We directly use the original mention and the generated profile as the basis for formulating the ES query. We ask ES to score each entity based on the following criteria: (1) The similarity between the title and alias fields and the literal mention text. (2) The similarity between the title and alias fields and the generated title (3) The similarity between the description field and the generated description. More details are in the appendix due to space constraints. + +# 2.2.3 Hybrid Approach to Candidate Retrieval + +Overview Our main goal is to perform EL to Wikidata. However, a source document often contains entity mentions that can be linked to Wikipedia since Wikipedia still covers many fields and areas of interest. In addition, every entity in Wikipedia can be automatically mapped to an equivalent entity in Wikidata. As such, we propose a hybrid approach that combines both the dictionary-based technique (Section 2.2.1) and our profiling-based retrieval technique (Section 2.2.2). We first combine the lists produced by these two methods into one single candidate list. We then use a Gradient Boosted Tree (GBT) model (Friedman, 2001) to assign a score to every candidate. Finally, the combined list is sorted based on the candidates' computed scores. + +Combining Candidate Lists For a mention $m$ , let $C_d(m)$ be the set of candidates retrieved by a Wikipedia-based dictionary. Let $C_e(m)$ be the set of candidates retrieved by querying ES using generated entity profiles. We train a GBT model that assigns a score to every candidate in the combined set $C_d(m) \cup C_e(m)$ . We use two groups of features: string-based and ranking-based features. + +For string-based features, we use several similarity metrics: (1) Levenshtein ratios (Levenshtein, 1965), Jaro-Winkler distances (Jaro, 1989), and numbers of common words between the mention's surface form and the candidate entity's name and aliases (2) Numbers of common words between the mention's context and the entity's name and aliases (3) Numbers of common words between the mention's surface form and context and the entity's description and category. + +We also use features that indicate the initial rankings of a candidate entity. For $C_d(m)$ , each candidate is initially ranked by its corresponding prior probability (Eq. 1). For $C_e(m)$ , each candidate is automatically assigned a score by ES. For a candidate $c$ , let $r_d(c)$ indicate its rank in $C_d(m)$ (if $c \notin C_d(m)$ then $r_d(c) = \infty$ ). Similarly, let $r_e(c)$ indicate the rank of $c$ in $C_e(m)$ . The features to be fed to GBT are: + +$$ +a _ {d} (c) = \left\{ \begin{array}{l l} 1 / r _ {d} (c), & \text {i f} c \in C _ {d} (m) \\ 0, & \text {O t h e r w i s e} \end{array} \right. \tag {3} +$$ + +$$ +a _ {e} (c) = \left\{ \begin{array}{l l} 1 / r _ {e} (c), & \text {i f} c \in C _ {e} (m) \\ 0, & \text {O t h e r w i s e} \end{array} \right. +$$ + +# 2.3 Cross-Attention Reranker + +Overview We model the reranking problem as a binary classification problem and fine-tune a basic Transformer-based reranker for the task (Figure 3). + +Input Representations The input to the reranker is the concatenation of the mention representation and the candidate entity representation (Figure 3). The mention representation is similar to the one described in Section 2.2.2. Each entity's representation consists of its initial rank (Section 2.2.3), title, alias, description, and category. To denote the initial rank, we define new tokens in the Transformer's vocabulary. For example, [rank1] represents rank 1, [rank2] indicates rank 2, and so on. If an entity has multiple aliases, we select the one with the highest string similarity to the input mention. The special tokens [TITLE], [ALIAS], [DESC], and [CAT] are used to indicate the locations of the + +![](images/fa5b9754359308ce5892b3abb924243169d49f8182fb346a45f06f5653caa8bb.jpg) +Figure 3: An illustration of the cross-attention reranker. + +entity's title, alias, description, and category (respectively). If any fields are missing, we simply exclude the missing fields and their corresponding special tokens from the entity representation. + +Cross-Attention Reranker Given a mention $m$ and a candidate entity $e$ , the reranker computes a matching score $s_{m,e}$ indicating their relevance. The reranker consists of a Transformer-based encoder and a feedforward network: + +$$ +\begin{array}{l} \mathbf {h} _ {m, e} = \operatorname {r e d u c e} \left(T _ {\text {c r o s s}} \left(\tau_ {m, e}\right)\right) \tag {4} \\ s _ {m, e} = \operatorname {F F N N} _ {s} \left(\mathbf {h} _ {m, e}\right) \\ \end{array} +$$ + +where $\tau_{m,e}$ is the concatenation of the mention representation and the entity representation. $T_{\mathrm{cross}}$ is a Transformer encoder (Devlin et al., 2019; Liu et al., 2019), and reduce(.) is a function that returns the final hidden state of the Transformer that corresponds to the first token (i.e., the [s] token). $\mathrm{FFNN_s}$ is a feedforward network. By taking $\tau_{m,e}$ as input, the Transformer encoder $T_{\mathrm{cross}}$ can have deep cross-attention between the mention's context and the entity's information from the KB. + +In practice, a mention may not have any corresponding entity in the target KB. For predicting unlinkable mentions, we employ a simple thresholding method. If the score $s_{m,e_{top}}$ of the top-ranked candidate entity $e_{top}$ is smaller than a threshold, we predict the mention $m$ as unlinkable. + +# 3 Experiments + +# 3.1 Data and Experiments Setup + +Target Knowledge Base In this work, we downloaded the complete Wikidata dump dated August 2021. Wikidata currently contains over 95 million items. However, many of these items are noisy or correspond to Media-internal administrative entities (i.e., not entities we want to retain). Therefore, we apply several heuristics to filter out unhelpful Wikidata items2. At the end, our final knowledge base contains 40,239,259 entities with English titles, substantially more than any other task settings we have found. We use this KB as the target KB for every EL experiment we conduct. + +Evaluation Datasets (Wikidata) We use three manually annotated English datasets for evaluating EL over Wikidata: RSS-500 (Röder et al., 2014), ISTEX-1000 (Delpeuch, 2020), and TweekiGold (Harandizadeh and Singh, 2020). More details of these datasets are in the appendix. Some previous studies on EL over Wikidata also use other datasets such as LC-QuAD 2.0 (Dubey et al., 2019) and TREx (ElSahar et al., 2018). However, these datasets were created semi-automatically or automatically instead of manually, thus less reliable. + +Training Data We use Wikipedia anchor texts and their corresponding Wikidata entities as the supervision signals. We create a training set of 6 million paragraphs and a validation set of 1000 paragraphs. We refer to this dataset as WikipediaEL. We train our models (i.e., the generation model and the reranker) using this dataset. We do not fine-tune our models on any of the evaluation datasets. + +Baselines For comparison, we choose a set of systems that were previously evaluated on the same evaluation datasets: AIDA (Hoffart et al., 2011), Babelfy (Moro et al., 2014), End-to-End (Kolitsas et al., 2018), OpenTapioca (Delpeuch, 2020), Tweeki (Harandizadeh and Singh, 2020), and KG Context (Mulang et al., 2020). + +We also compare our approach to BLINK (Wu et al., 2020) and GENRE (Cao et al., 2021), SOTA methods for EL over Wikipedia or Wikipedia-derived KBs. We evaluated these methods by using their public code and model checkpoints. We implemented a converter to map each returned entity to its corresponding Wikidata entry. + +
MethodsRSS-500 (test)ISTEX-1000 (test)TweekiGold (test)WikipediaEL (dev)
R@1R@25R@50R@1R@25R@50R@1R@25R@50R@1R@25R@50
Simple Query41.0672.1974.1736.4279.1090.1531.0273.9682.5251.1981.8585.86
Wikipedia Dictionary59.6074.8376.8284.9391.4991.4970.6088.0888.7785.1193.6093.95
Profiling-based Query
◆ Title49.0073.5176.8243.2882.6993.2839.8179.8687.0354.7788.1992.13
◆ Title + Desc60.2673.5175.5087.6197.3198.0671.3088.7791.5580.8794.2695.03
Hybrid Approach66.8985.4386.0991.3498.5198.6674.5495.1495.6090.2598.9599.23
+ +Table 1: Overall candidate retrieval results. Recall scores $(\%)$ are shown. + +CHOLAN (Kannan Ravi et al., 2021) is a related study, but its open-sourced code lacks running instructions3. Furthermore, the authors have not fully disclosed the splits of the dataset they used for evaluating EL over Wikidata. As a result, we did not directly compare CHOLAN and EPGEL. + +Hyperparameters Our generation model is initialized with the BART model (bart-base) (Lewis et al., 2020b). For the reranker, we use RoBERTa (roberta-base) as the Transformer encoder (Liu et al., 2019). The maximum numbers of candidates are set to be 100, 100, and 50 for the dictionary-based, profiling-based, and hybrid approaches (respectively). More details are in the appendix. + +# 3.2 Evaluation of Candidate Entity Retrieval + +Table 1 compares the performance of various candidate retrieval approaches. [Simple Query] refers to querying ES using only the literal string of the input mention. This approach is quite similar to what is done in several previous studies on EL over Wikidata (Sakor et al., 2020; Kannan Ravi et al., 2021). As the target KB is huge, many entities have the same titles or aliases. Naively using only the surface form of the mention is not sufficient. + +The performance of using a Wikipedia dictionary (Section 2.2.1) is much better than that of [Simple Query]. Although the dictionary-based approach also does not consider the context of the input mention, it computes the conditional probabilities using all anchor texts in the entire Wikipedia. In addition, most target entities in the evaluation datasets can still be found in Wikipedia. As such, this approach still performs reasonably well overall. However, note that for mentions whose linked entities are in Wikidata but not in Wikipedia, the recall score of the Wikipedia dictionary will always be 0. + +For our profiling-based approach (Section 2.2.2), we experiment with two variants: (1) The entity + +profile is only the generated title (2) The entity profile consists of the generated title and the generated description. The latter achieves much better performance. It also achieves comparable or better scores than the Wikipedia dictionary most of the time. + +Finally, we see that our profiling-based approach complements the dictionary-based approach. Our hybrid technique (Section 2.2.3) is highly effective, outperforming all other methods. + +# 3.3 Overall Entity Linking Results + +Table 2 shows the overall entity linking results. Our complete framework (i.e., EPGEL) uses the hybrid candidate retrieval approach (Section 2.2.3) and the cross-attention reranker (Section 2.3). EPGEL outperforms a variety of SOTA techniques across all datasets. For example, EPGEL achieves better results than GENRE (Cao et al., 2021) on the tested datasets. GENRE is an autoregressive system that directly retrieves entities by generating the entity names conditioned on the context. In theory, GENRE does not require a candidate retrieval step to work. However, as detailed in the original paper (Cao et al., 2021), GENRE achieves the best performance when high-quality candidate lists are available. Therefore, having an effective candidate retrieval method can still be helpful even during this era of large language models. + +Table 2 also shows the results of using different candidate retrieval strategies. There is a positive correlation between the candidate retrieval performance and the final EL performance. This is expected, as the recall from the candidate retrieval step provides an upper bound on the entire EL framework's recall. Also, even if EPGEL uses only the profiling-based approach (without relying on the Wikipedia dictionary), it can still achieve good results compared to the baselines. + +
MethodsRSS-500 (test)ISTEX-1000 (test)TweekiGold (test)WikipediaEL (dev)
EPGEL76.492.769.392.3
Effects of Candidate Retrieval Strategy
◆ Simple Query66.487.666.081.9
◆ Wikipedia Dictionary71.291.668.889.8
◆ Profiling-Based Query [Title + Desc]68.492.669.188.4
Previous Methods
GENRE* (Cao et al., 2021)68.288.462.486.3
BLINK* (Wu et al., 2020)73.588.565.990.5
KG Context† (Mulang et al., 2020)-92.6--
Tweeki (Harandizadeh and Singh, 2020)--65.0-
OpenTapioca (Delpeuch, 2020)46.591.629.1-
End-to-End (Kolitsas et al., 2018)--49.4-
Babelfy (Moro et al., 2014)58.164.025.1-
AIDA (Hoffart et al., 2011)56.150.438.5-
+ +Table 2: Overall entity linking results. InKB micro F1 scores (%) are shown. The symbol “-” denotes results not reported in previous papers. The symbol “ $\star$ ” indicates systems that we evaluated by ourselves using their public code and model checkpoints. $\dagger$ KG Context is reported to have an F1 score of 92.6 on ISTEX-1000 (Mulang et al., 2020). However, the work uses a simplified setting where each mention's candidate pool is assumed to consist of the correct entity and only one negative entity. This setting is much easier and less practical than our setting. + +
MethodsP@1
Neural Cross-Linguual EL (Sil et al., 2018)87.4
DeepType (Raiman and Raiman, 2018)90.9
Neural Collective EL (Cao et al., 2018)91.0
DEER (Gillick et al., 2019)87.0
RELIC (Ling et al., 2020)89.8
Attribute-sep. (Vyas and Ballesteros, 2021)84.9
EPGEL90.9
+ +Table 3: In-KB accuracy scores $(\%)$ of different models on TACKBP-2010. Note that our Wikidata-based target KB is much larger than the ones used by previous studies (e.g., the TAC Reference KB). + +# 3.4 Results on TACKBP-2010 + +Even though our focus is EL over Wikidata, we also use the TACKBP-2010 dataset (Ji et al., 2010) for evaluation since it is a standard dataset used by many previous studies. There are 1,020 annotated mention/entity pairs in total for evaluation. All the entities are from the TAC Reference KB, containing only 818,741 entities. To evaluate EPGEL, we use our large-scale Wikidata-based KB as the target KB. Also, we do not fine-tune EPGEL on the training set of TACKBP-2010. Overall, the performance of EPGEL is comparable to previous state-of-the-art systems (Table 3), even though EPGEL needs to map mentions to entities in a large-scale KB. + +# 3.5 Qualitative Analysis + +Table 4 shows some examples of our conditional generation model's predictions. + +In the first example, as the model has seen the mention "Christmas truce" with similar context during training, the model generates the exact title and description for the target entity. In fact, using this accurate profile, ES already ranks the target entity in the top 1 even without using the reranker. + +In the second example, the model has not come across the mention "Kevin Colbert" during training. However, because of the phrases "National Football League" and "general manager", the model infers that the mention refers to an "American football executive". The generated description is quite close to the actual description, "American football player and executive". This generated profile helps ES rank the target entity higher than the entity Q91675515 (a researcher named Kevin Colbert). + +The last example presents a failure case of our generation model. The target entity is a baseball team, but the model incorrectly infers that the mention "Baltimore" refers to a city. We will discuss this failure case in more detail in next section. Nevertheless, if the hybrid approach is used, we can still recover from this error since the target entity is in the Wikipedia dictionary. + +
Input MentionGenerated ProfileTarget Entity
... They had an only son, Arthur, a British Army officer who played a leading role in the 1914 Christmas truce.[Title] Christmas truce | [Description] unofficial cease fire in Western Front during World War IQ163730
... and as a member of the National Football League. It also marked the 14th season under leadership of general manager Kevin Colbert and the seventh under head ...[Label] Kevin Colbert | [Description] American football executiveQ6396037
... Baltimore beat Josh Beckett and the Red Sox 7-1 Tuesday night ...[Title] Baltimore | [Description] Independent city in Maryland, United StatesQ650816
+ +Table 4: Example outputs from our conditional generation model. + +# 3.6 Remaining Challenges + +In this section, we will discuss some major categories of the remaining errors made by EPGEL. + +Generation model's popularity bias When encountering an input mention whose literal form has already appeared in the training set, the generation model sometimes ignores the context entirely and generates the most common entity profile for that literal form. In the last example in Table 4, the mention Baltimore refers to a sports team. However, our model mistakenly generates the most common profile for the mention (a city in Maryland). A possible approach to tackle the challenge is to randomly mask out the input mention during training. This would encourage the generation model to pay more attention to the surrounding context and not rely too much on the mention's literal form. + +Need to optimize global coherence Entities within the same document are generally related; however, our reranker disambiguates each mention independently. Therefore, it sometimes makes mistakes that can be easily avoided if the global coherence among entities is considered. For example, given the following tweet, "Syracuse and Pitt in the #ACC ... its gonna be a long year for Maryland.", EPGEL correctly infers that "Syracuse" and "Pitt" are basketball teams. However, for "Maryland", the reranker ranks a football team higher than the actual target entity (a basketball team). This shows that EPGEL may benefit from utilizing more global information for collective inference. + +# 4 Related Work + +# 4.1 Candidate Entity Retrieval + +Dictionary-based techniques are the dominant approaches to candidate retrieval of many previous + +Wikipedia EL systems (Shen et al., 2012; Gattani et al., 2013; Shen et al., 2013; van Hulst et al., 2020). The structure of Wikipedia provides a set of useful features for building an offline name dictionary between various names and their possible mapped entities. For example, many previous studies build such name dictionaries by mining anchor texts of Wikipedia pages (Han et al., 2011; Phan et al., 2017; Zeng et al., 2018). Even though this approach is highly effective for EL over Wikipedia (Ganea and Hofmann, 2017), it is not directly applicable to Wikidata as previously discussed. + +# 4.2 Entity Linking over Wikidata + +Compared to Wikipedia, there are relatively fewer studies on EL over Wikidata (Möller et al., 2021). Recently, Cetoli et al. (2019) proposed a neural EL approach for Wikidata. The setting used in their work is that each mention comes with one correct entity candidate and one incorrect candidate. This setting is much less challenging and realistic than ours. Sakor et al. (2020) proposed Falcon 2.0, a rule-based system for entity and relation linking over Wikidata. Its candidate retrieval approach is to query ES using the literal string of the input mention. This method is much less effective than our profiling-based approach (Sec. 3.2). OpenTapioca is another attempt that performs EL over Wikidata by utilizing two main features: local compatibility and semantic similarity (Delpeuch, 2020). For the social media domain, Tweeki (Harandizadeh and Singh, 2020) is an unsupervised approach for linking entities in tweets to Wikidata. EPGEL outperforms both OpenTapioca and Tweeki (Sec. 3.3). + +# 5 Conclusions and Future Work + +This paper has proposed a novel profiling-based paradigm to candidate retrieval for EL. The tech + +nique is highly generalizable and complementary to the traditional dictionary-based approach, enabling the design of an effective hybrid candidate retrieval method. Together with a cross-attention reranker, our complete EL framework achieves strong performance on four public datasets. We plan to explore a broader range of properties and information about the target entity that can be extracted from the mention's context. For example, type-based features can be helpful for EL (Onoe and Durrett, 2020); as such, we aim to make our generation model generate the target entity's type. Also, in this work, we use a local model for candidate reranking. We plan to explore the use of a more global model for collective EL (Lin et al., 2017; Yang et al., 2018; Phan et al., 2019). + +# 6 Ethical Considerations + +Potential Risks Our entity linking system has several potential malicious use cases (e.g., disinformation, generating fake news, surveillance). For example, Fung et al. (2021) introduced a novel approach for fake news generation. The technique works by first taking a genuine news article, extracting a multimedia knowledge graph, and replacing or inserting salient nodes or edges in the graph. To build such a multimedia knowledge graph, the authors do use an EL system. Another example is that our EL system may be used as part of a malicious surveillance system (e.g., automatically tracking the locations of celebrities based on social media posts and online news). + +Limitations Section 3.6 discusses some major categories of the remaining errors made by our entity linking system. + +# Acknowledgement + +We thank the anonymous reviewers for the helpful suggestions. This research is based upon work supported by U.S. DARPA KAIROS Program No. FA8750-19-2-1004, U.S. DARPA AIDA Program No. FA8750-18-2-0014, and Agriculture and Food Research Initiative (AFRI) grant no. 2020-67021-32799/project accession no.1024178 from the USDA National Institute of Food and Agriculture. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of DARPA, or the U.S. Government. The U.S. Government is + +authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein. + +# References + +Oshin Agarwal and D. Bikel. 2020. Entity linking via dual and cross-attention encoders. ArXiv, abs/2004.03555. +Zahra Ashktorab, Christopher Brown, Manojit Nandi, and Aron Culotta. 2014. Tweedr: Mining twitter to inform disaster response. In ISCRAM. +Sören Auer, Christian Bizer, Georgi Kobilarov, Jens Lehmann, Richard Cyganiak, and Zachary G. Ives. 2007. Dbpedia: A nucleus for a web of open data. In ISWC/ASWC. +Jan A. Botha, Zifei Shan, and Daniel Gillick. 2020. Entity Linking in 100 Languages. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7833-7845, Online. Association for Computational Linguistics. +Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. 2021. Autoregressive entity retrieval. In International Conference on Learning Representations. +Yixin Cao, Lei Hou, Juan-Zi Li, and Zhiyuan Liu. 2018. Neural collective entity linking. In COLING. +A. Cetoli, Stefano Bragaglia, Andrew D. O'Harney, Marc Sloan, and Mohammad Akbari. 2019. A neural approach to entity linking on wikidata. In ECIR. +Silviu Cucerzan. 2007. Large-scale named entity disambiguation based on wikipedia data. In EMNLP. +Nicola De Cao, Ledell Wu, Kashyap Popat, Mikel Artetxe, Naman Goyal, Mikhail Plekhanov, Luke Zettlemoyer, Nicola Cancedda, Sebastian Riedel, and Fabio Petroni. 2021. Multilingual autoregressive entity linking. arXiv preprint arXiv:2103.12528. +Antonin Delpeuch. 2020. Opentapioca: Lightweight entity linking for wikidata. ArXiv, abs/1904.09131. +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. +Stephen Dill, Nadav Eiron, David Gibson, Daniel Gruhl, R. Guha, Anant Jhingran, Tapas Kanungo, Sridhar Rajagopalan, Andrew Tomkins, John A. + +Tomlin, and Jason Y. Zien. 2003. Semtag and seeker: Bootstrapping the semantic web via automated semantic annotation. In Proceedings of the 12th International Conference on World Wide Web, WWW '03, page 178-186, New York, NY, USA. Association for Computing Machinery. +Mark Dredze, Paul McNamee, Delip Rao, Adam Gerber, and Tim Finin. 2010. Entity disambiguation for knowledge base population. In Proceedings of the 23rd International Conference on Computational Linguistics (Coling 2010), pages 277-285, Beijing, China. Coling 2010 Organizing Committee. +Mohnish Dubey, Debayan Banerjee, Abdelrahman Abdelkawi, and Jens Lehmann. 2019. Lc-quad 2.0: A large dataset for complex question answering over wikidata and dbpedia. In SEMWEB. +Hady ElSahar, Pavlos Vougiouklis, Arslen Remaci, Christophe Gravier, Jonathon S. Hare, Frédérique Laforest, and Elena Paslaru Bontas Simperl. 2018. T-rex: A large scale alignment of natural language with knowledge base triples. In LREC. +Zheng Fang, Yanan Cao, Ren Li, Zhenyu Zhang, Yanbing Liu, and Shi Wang. 2020. High quality candidate generation and sequential graph attention network for entity linking. In Proceedings of The Web Conference 2020, pages 640-650. +Jerome H. Friedman. 2001. Greedy function approximation: A gradient boosting machine. Annals of Statistics, 29:1189-1232. +Yi Fung, Christopher Thomas, Revanth Gangi Reddy, Sandeep Polisetty, Heng Ji, Shih-Fu Chang, Kathleen McKeown, Mohit Bansal, and Avi Sil. 2021. InfoSurgeon: Cross-media fine-grained information consistency checking for fake news detection. 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 1683-1698, Online. Association for Computational Linguistics. +Octavian-Eugen Ganea and Thomas Hofmann. 2017. Deep joint entity disambiguation with local neural attention. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 2619-2629, Copenhagen, Denmark. Association for Computational Linguistics. +Abhishek Gattani, Digvijay S. Lamba, Nikesh Garera, Mitul Tiwari, Xiaoyong Chai, Sanjib Das, Sri Subramaniam, Anand Rajaraman, Venky Harinarayan, and AnHai Doan. 2013. Entity extraction, linking, classification, and tagging for social media: A wikipedia-based approach. Proc. VLDB Endow., 6(11):1126-1137. +Johanna Geiß, Andreas Spitz, and Michael Gertz. 2017. Neckar: A named entity classifier for wikidata. In GSCL. + +Daniel Gillick, Sayali Kulkarni, Larry Lansing, Alessandro Presta, Jason Baldridge, Eugene Ie, and Diego Garcia-Olano. 2019. Learning dense representations for entity retrieval. In Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL), pages 528-537, Hong Kong, China. Association for Computational Linguistics. +Stephen Guo, Ming-Wei Chang, and Emre Kiciman. 2013. To link or not to link? a study on end-to-end tweet entity linking. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1020-1030, Atlanta, Georgia. Association for Computational Linguistics. +Xianpei Han, Le Sun, and Jun Zhao. 2011. Collective entity linking in web text: a graph-based method. Proceedings of the 34th international ACM SIGIR conference on Research and development in Information Retrieval. +Bahareh Harandizadeh and Sameer Singh. 2020. Tweeki: Linking named entities on Twitter to a knowledge graph. In Proceedings of the Sixth Workshop on Noisy User-generated Text (W-NUT 2020), pages 222-231, Online. Association for Computational Linguistics. +C. Harris, K. J. Millman, S. Walt, Ralf Gommers, P. Virtanen, D. Cournapeau, E. Wieser, J. Taylor, S. Berg, Nathaniel J. Smith, R. Kern, Matti Picus, S. Hoyer, M. Kerkwijk, Matthew Brett, Allan Haldane, Jaime Fern'andez del R'io, Mark Wiebe, P. Peterson, Pierre G'erard-Marchant, K. Sheppard, T. Reddy, W. Weckesser, H. Abbasi, Christoph Gohlke, and T. E. Oliphant. 2020. Array programming with numpy. Nature, 585 7825:357-362. +Johannes Hoffart, Mohamed Amir Yosef, Ilaria Bordino, Hagen Fürstenau, Manfred Pinkal, Marc Spanirol, Bilyana Taneva, Stefan Thater, and Gerhard Weikum. 2011. Robust disambiguation of named entities in text. In Proceedings of the 2011 Conference on Empirical Methods in Natural Language Processing, pages 782-792, Edinburgh, Scotland, UK. Association for Computational Linguistics. +Matthew A. Jaro. 1989. Advances in record-linkage methodology as applied to matching the 1985 census of tampa, florida. Journal of the American Statistical Association, 84:414-420. +Heng Ji, Ralph Grishman, Hoa Trang Dang, Kira Griffin, and Joe Ellis. 2010. Overview of the tac 2010 knowledge base population track. In *In Third Text Analysis Conference (TAC)*. +Hang Jiang, Sairam Gurajada, Qiuhao Lu, Sumit Neelam, Lucian Popa, Prithviraj Sen, Yunyao Li, and Alexander Gray. 2021. LNN-EL: A neuro-symbolic approach to short-text entity linking. 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 775-787, Online. Association for Computational Linguistics. +Manoj Prabhakar Kannan Ravi, Kuldeep Singh, Isaiah Onando Mulang', Saeedeh Shekarpour, Johannes Hoffart, and Jens Lehmann. 2021. CHOLAN: A modular approach for neural entity linking on Wikipedia and Wikidata. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 504-514, Online. Association for Computational Linguistics. +Vaibhav Kasturia, Marcel Gohsen, and Matthias Hagen. 2022. Query interpretations from entity-linked segmentations. In Proceedings of the Fifteenth ACM International Conference on Web Search and Data Mining, WSDM '22, page 449-457, New York, NY, USA. Association for Computing Machinery. +Nikolaos Kolitsas, Octavian-Eugen Ganea, and Thomas Hofmann. 2018. End-to-end neural entity linking. In Proceedings of the 22nd Conference on Computational Natural Language Learning, pages 519-529, Brussels, Belgium. Association for Computational Linguistics. +Tuan Lai, Heng Ji, and ChengXiang Zhai. 2021a. BERT might be overkill: A tiny but effective biomedical entity linker based on residual convolutional neural networks. In *Findings of the Association for Computational Linguistics: EMNLP* 2021, pages 1631-1639, Punta Cana, Dominican Republic. Association for Computational Linguistics. +Tuan Lai, Heng Ji, ChengXiang Zhai, and Quan Hung Tran. 2021b. Joint biomedical entity and relation extraction with knowledge-enhanced collective inference. 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 6248-6260, Online. Association for Computational Linguistics. +Vladimir I. Levenshtein. 1965. Binary codes capable of correcting deletions, insertions, and reversals. Soviet physics. Doklady, 10:707-710. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020a. BART: Denoising sequence-to-sequence pretraining 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. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. + +2020b. Bart: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. ArXiv, abs/1910.13461. +Belinda Z. Li, Sewon Min, Srinivasan Iyer, Yashar Mehdad, and Wen-tau Yih. 2020a. Efficient one-pass end-to-end entity linking for questions. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6433-6441, Online. Association for Computational Linguistics. +Manling Li, Ying Lin, Tuan Manh Lai, Xiaoman Pan, Haoyang Wen, Sha Li, Zhenhailong Wang, Pengfei Yu, Lifu Huang, Di Lu, et al. 2020b. Gaia at smkbp 2020-a dockerized multi-media multilingual knowledge extraction, clustering, temporal tracking and hypothesis generation system. In Proceedings of Thirteenth Text Analysis Conference (TAC 2020). +Ying Lin, Chin-Yew Lin, and Heng Ji. 2017. List-only entity linking. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 536-541, Vancouver, Canada. Association for Computational Linguistics. +Jeffrey Ling, Nicholas FitzGerald, Zifei Shan, Livio Baldini Soares, Thibault Févry, David Weiss, and Tom Kwiatkowski. 2020. Learning cross-context entity representations from text. ArXiv, abs/2001.03765. +Xiao Ling, Sameer Singh, and Daniel S. Weld. 2015. Design challenges for entity linking. Transactions of the Association for Computational Linguistics, 3:315-328. +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, abs/1907.11692. +Rada Mihalcea and Andras Csomai. 2007. Wikify!: linking documents to encyclopedic knowledge. In CIKM '07. +David N. Milne and Ian H. Witten. 2008. Learning to link with wikipedia. In CIKM '08. +Cedric Möller, Jens Lehmann, and Ricardo Usbeck. 2021. Survey on english entity linking on wikidata. Semantic Web. +Andrea Moro, Alessandro Raganato, and Roberto Navigli. 2014. Entity Linking meets Word Sense Disambiguation: a Unified Approach. Transactions of the Association for Computational Linguistics, 2:231-244. +Isaiah Onando Mulang, Kuldeep Singh, Chaitali Prabhu, Abhishek Nadgeri, Johannes Hoffart, and Jens Lehmann. 2020. Evaluating the impact of knowledge graph context on entity disambiguation + +models. Proceedings of the 29th ACM International Conference on Information & Knowledge Management. +Yasumasa Onoe and Greg Durrett. 2020. Fine-grained entity typing for domain independent entity linking. In AAAI. +Xiaoman Pan, Taylor Cassidy, Ulf Hermjakob, Heng Ji, and Kevin Knight. 2015. Unsupervised entity linking with abstract meaning representation. In *NAACL*. +Adam Paszke, S. Gross, Francisco Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, Alban Desmaison, Andreas Köpf, E. Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, B. Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. 2019. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS. +Minh C. Phan, Aixin Sun, Yi Tay, Jialong Han, and Chenliang Li. 2017. Neupl: Attention-based semantic matching and pair-linking for entity disambiguation. Proceedings of the 2017 ACM on Conference on Information and Knowledge Management. +Minh C. Phan, Aixin Sun, Yi Tay, Jialong Han, and Chenliang Li. 2019. Pair-linking for collective entity disambiguation: Two could be better than all. IEEE Transactions on Knowledge and Data Engineering, 31:1383-1396. +Priya Radhakrishnan, Partha Talukdar, and Vasudeva Varma. 2018. ELDEN: Improved entity linking using densified knowledge graphs. 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 1844-1853, New Orleans, Louisiana. Association for Computational Linguistics. +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. +Jonathan Raiman and Olivier Raiman. 2018. Deep-type: Multilingual entity linking by neural type system evolution. In AAAI. +Lev Ratinov, Dan Roth, Doug Downey, and Mike Anderson. 2011. Local and global algorithms for disambiguation to Wikipedia. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 1375-1384, Portland, Oregon, USA. Association for Computational Linguistics. +Miriam Redi, Martin Gerlach, Isaac Johnson, Jonathan Morgan, and Leila Zia. 2020. A taxonomy of knowledge gaps for multimedia projects (second draft). arXiv preprint arXiv:2008.12314. + +Michael Röder, Ricardo Usbeck, Sebastian Hellmann, Daniel Gerber, and Andreas Both. 2014. $\mathbf{N}^3$ - a collection of datasets for named entity recognition and disambiguation in the nlp interchange format. In LREC. +Ahmad Sakor, Kuldeep Singh, Anery Patel, and Maria-Esther Vidal. 2020. Falcon 2.0: An entity and relation linking tool over wikidata. Proceedings of the 29th ACM International Conference on Information & Knowledge Management. +Wei Shen, Jianyong Wang, and Jiawei Han. 2015. Entity linking with a knowledge base: Issues, techniques, and solutions. IEEE Transactions on Knowledge and Data Engineering, 27:443-460. +Wei Shen, Jianyong Wang, Ping Luo, and Min Wang. 2012. Linden: Linking named entities with knowledge base via semantic knowledge. In Proceedings of the 21st International Conference on World Wide Web, WWW '12, page 449-458, New York, NY, USA. Association for Computing Machinery. +Wei Shen, Jianyong Wang, Ping Luo, and Min Wang. 2013. Linking named entities in tweets with knowledge base via user interest modeling. Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining. +Avirup Sil, Gourab Kundu, Radu Florian, and Wael Hamza. 2018. Neural cross-lingual entity linking. In AAAI. +Fabian M. Suchanek, Gjergji Kasneci, and Gerhard Weikum. 2007. Yago: a core of semantic knowledge. In WWW '07. +Johannes M van Hulst, Faegheh Hasibi, Koen Dercksen, Krisztian Balog, and Arjen P de Vries. 2020. Rel: An entity linker standing on the shoulders of giants. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 2197-2200. +Denny Vrandecic and Markus Krötzsch. 2014. Wikidata: A free collaborative knowledgebase. Commun. ACM, 57(10):78-85. +Yogarshi Vyas and Miguel Ballesteros. 2021. Linking entities to unseen knowledge bases with arbitrary schemas. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 834-844, Online. Association for Computational Linguistics. +Haoyang Wen, Ying Lin, Tuan Lai, Xiaoman Pan, Sha Li, Xudong Lin, Ben Zhou, Manling Li, Haoyu Wang, Hongming Zhang, et al. 2021. Resin: A dock-erized schema-guided cross-document cross-lingual cross-media information extraction and event tracking system. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Demonstrations, pages 133-143. + +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric 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. + +Ledell Wu, Fabio Petroni, Martin Josifoski, Sebastian Riedel, and Luke Zettlemoyer. 2020. Scalable zero-shot entity linking with dense entity retrieval. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6397-6407, Online. Association for Computational Linguistics. + +Yi Yang, Ozan Irsoy, and Kazi Shefaet Rahman. 2018. Collective entity disambiguation with structured gradient tree boosting. 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 777-786, New Orleans, Louisiana. Association for Computational Linguistics. + +Weixin Zeng, Jiuyang Tang, and Xiang Zhao. 2018. Entity linking on chinese microblogs via deep neural network. IEEE Access, 6:25908-25920. + +Boliang Zhang, Ying Lin, Xiaoman Pan, Di Lu, Jonathan May, Kevin Knight, and Heng Ji. 2018. ELISA-EDL: A cross-lingual entity extraction, linking and localization system. In Proc. The 16th Annual Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT2018). + +Section A describes the datasets that we used for evaluation. Section B describes how we preprocessed the original Wikidata dump. Section C presents our reproducibility checklist. Finally, Section D describes how we construct an ES query from a generated profile. + +# A Evaluation Datasets + +We use three different English datasets (Möller et al., 2021) for evaluating the performance of EL over Wikidata: + +- RSS-500 (Röder et al., 2014) is a manually annotated dataset consisting of RSS-feeds (i.e., short formal documents) from major international newspapers. The target KB of the original version of RSS-500 is DBpedia. However, Delpeuch (2020) created a new version of the dataset for evaluating EL over Wikidata. + +- ISTEX-1000 (Delpeuch, 2020) is a dataset of 1,000 author affiliation strings extracted from scientific publications. It was manually annotated to align entity mentions to Wikidata. +- TweekiGold (Harandizadeh and Singh, 2020) is a manually annotated dataset for EL over tweets. It has 500 tweets for evaluation but does not have a separate training set. + +For RSS-500, ISTEX-1000, and WikipediaEL, the setting is that the gold-standard entity mentions are already given as input, and the task is only to link the input mentions to the correct entities. + +For TweekiGold, similar to the study that introduced the dataset (Harandizadeh and Singh, 2020), we do not assume that the mentions are provided. As such, for TweekiGold, we need to do both mention extraction and entity disambiguation. In this work, we simply use an off-the-shelf RoBERTa-based model from HuggingFace for mention extraction (roberta-base-finetuned-ner). Note that we do not fine-tune the mention extractor. In addition, when evaluating BLINK and GENRE on TweekiGold, we also use the same extractor to make the comparison fair. + +For the TACKBP-2010 dataset (Ji et al., 2010), there are 1,020 annotated mention/entity pairs in total for evaluation. All the entities are from the TAC Reference KB, containing only 818,741 entities. However, to evaluate EPGEL, we use our large-scale Wikidata-based KB as the target KB. + +RSS-500 and ISTEX-1000 can be downloaded from the Github repository of OpenTapioca (Delpeuch, 2020). And OpenTapioca is released under the Apache-2.0 license. TweekiGold is also released under the Apache-2.0 license. The TACKBP-2010 dataset can be downloaded from LDC's website. The license information can also be found at the LDC's website. Our use of the datasets is consistent with their licenses. + +Our work focuses on English entity linking. In addition, we randomly sampled about $10\sim 20$ examples for each dataset and then checked whether the examples contained any offensive content. Overall, we did not see any example that had offensive content. + +# B Wikidata Preprocessing + +In this work, we use the complete Wikidata dump dated August 2021. Even though Wikidata cur + +
Wikidata IDLabel
Q4167836Wikipedia category
Q24046192Wikipedia category of stubs
Q20010800Wikipedia user language category
Q11266439Wikipedia template
Q11753321Wikipedia navigational template
Q19842659Wikipedia user language template
Q21528878Wikipedia redirect page
Q17362920Wikipedia duplicated page
Q14204246Wikipedia project page
Q21025364WikiProject
Q17442446Wikipedia internal item
Q26267864Wikipedia KML file
Q4663903Wikipedia portal
Q15184295Wikipedia module
Q13442814Scholarly Article
+ +Table 5: Wikidata identifiers used for filtering. + +rently contains over 95 million items, many of the items are unhelpful (i.e., not entities we want to retain). Therefore, we apply several heuristics to filter out unused Wikidata items. First, we remove all entities with no English titles (i.e., entities whose English titles are empty strings). Second, we remove entities that are a subclass (P279) or instance of (P31) the most common Media-internal administrative entities. Table 5 lists the Wikidata identifiers used for filtering (adapted from Botha et al., 2020; De Cao et al., 2021)). Finally, we remove entities whose English titles start with "Category:" "Template:" or "Project". + +# C Reproducibility Checklist + +In this section, we present the reproducibility information of the paper. We are planning to make the code publicly available after the paper is reviewed. + +Implementation Dependencies Libraries Pytorch 1.9.1 (Paszke et al., 2019), Transformers 4.11.3 (Wolf et al., 2020), Numpy 1.19.5 (Harris et al., 2020), CUDA 11.2. + +Computing Infrastructure The experiments were conducted on a server with Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz and NVIDIA Tesla V100 GPUs. Each GPU's memory is 16G. + +Datasets RSS-500 and ISTEX-1000 datasets can be downloaded from https://github.com/wetneb/opentapioca. The TweekiGold dataset can be downloaded from https://ucinlp.github.io/tweeki/. Finally, the TACKBP-2010 dataset can be downloaded from catalog.ldc.upenn.edu/LDC2018T16. + +Number of Model Parameters The number of parameters in the conditional generation model is about 140M. The number of parameters in the reranker is about 125M. + +Hyperparameters For training the conditional generation model, the batch size is set to be 128, the number of epochs is set to be 3, and the base learning rate is set to be 5e-5. For training the reranker, the batch size is set to be 8 mentions per batch (each mention has at most 50 candidates), the number of epochs is set to be 5, and the base learning rate is 1e-05. + +Expected Validation Performance The main paper has the results on the development set of WikipediaEL. We do not fine-tune our trained models on any of the evaluation datasets (i.e., RSS-500, ISTEX-1000, TweekiGold, and TACKBP-2010). For example, in Table 2, for EPGEL, we report the test results of the system with the best score on the development set of WikipediaEL. + +# D Elasticsearch Query Construction + +We use the example shown in Figure 2 as the running example. In this case, the surface form of the input mention is "Bruins", the generated title is "UCLA Bruins men's football", and the generated description is "college football team of the University of California, Los Angeles". Then, the actual query to be fed to ES is shown in Figure 4. Intuitively, the query consists of three main parts: + +1. The similarity between the title and alias fields and the surface form. +2. The similarity between the title and alias fields and the generated title. +3. The similarity between the description field and the generated description. + +Note that to reduce the querying latency, we merged the title and alias fields of each entity into one single field named title_and_aliases. In other words, for each entity, its title_and_aliases field is an array of strings corresponding to the entity's title and its aliases (if any). The match keyword is the standard keyword in ES for invoking a full-text search over a field. We use the term keyword to increase the final matching score when an exact match exists between the title_and_aliases field and the surface form / the generated title. Overall, our ES query structure is quite basic and does not have many parameters. + +![](images/4a68d762b1c9293a7383c613b4ad7a9ac42a2805a7e2d365281a4e9fe5b1c9e9.jpg) +Figure 4: ES query for the example shown in Figure 2. \ No newline at end of file diff --git a/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/images.zip b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..461bb6d5fdca113cb231837537e8af23b373ee37 --- /dev/null +++ b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e3bade1a9a0c761d63c65b9695ca5230d780d12dcdcf74f84f27176410e8263 +size 555527 diff --git a/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/layout.json b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d6fbcab1109fa572a5957e81ce7e972a55667959 --- /dev/null +++ b/improvingcandidateretrievalwithentityprofilegenerationforwikidataentitylinking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25067234f3961f1da8b104bad380eaaff101b1c10934fbb5fb6eeee611e3cafa +size 414370 diff --git a/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_content_list.json b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a9a60dffb3a05e5c34bf369f1f160cdf53c78f50 --- /dev/null +++ b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b8c98af7201ee163a7f940911d5018e3527f3345de7adfa7f8e8f999faaec3e +size 75404 diff --git a/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_model.json b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7361129cdbf9e1d299e354dedf6ac2fa56ee4f4c --- /dev/null +++ b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f397aba50bb05a6e33abb0d76412e186d60c9a5e63a3a2eaf11b54e5430f313 +size 92248 diff --git a/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_origin.pdf b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ae3612f7558c802b9c4fa4446fd40acf6133399d --- /dev/null +++ b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/51626475-ffaf-4ed2-9dc3-bdecf9e5c441_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d3f1a3e45c472c99e95d6660723a8cee6c24e4cf5f2068b1a477a7fb15746aa +size 746619 diff --git a/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/full.md b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..33711459475f551de9a388df1bae03bd08103aef --- /dev/null +++ b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/full.md @@ -0,0 +1,347 @@ +# Improving Chinese Grammatical Error Detection via Data augmentation by Conditional Error Generation + +Tianchi Yue, Shulin Liu, Huihui Cai, Tao Yang, Shengkang Song, Tinghao Yu +Tencent AI Platform Department, China + +{tianchiyue, forestliu, helenhhcai}@tencent.com {rigorosyang, shengksong, maxwellyu}@tencent.com + +# Abstract + +Chinese Grammatical Error Detection(CGED) aims at detecting grammatical errors in Chinese texts. One of the main challenges for CGED is the lack of annotated data. To alleviate this problem, previous studies proposed various methods to automatically generate more training samples, which can be roughly categorized into rule-based methods and model-based methods. The rule-based methods construct erroneous sentences by directly introducing noises into original sentences. However, the introduced noises are usually context-independent, which are quite different from those made by humans. The model-based methods utilize generative models to imitate human errors. The generative model may bring too many changes to the original sentences and generate semantically ambiguous sentences, so it is difficult to detect grammatical errors in these generated sentences. In addition, generated sentences may be error-free and thus become noisy data. To handle these problems, we propose CNEG, a novel Conditional Non-Autoregressive Error Generation model for generating Chinese grammatical errors. Specifically, in order to generate a context-dependent error, we first mask a span in a correct text, then predict an erroneous span conditioned on both the masked text and the correct span. Furthermore, we filter out error-free spans by measuring their perplexities in the original sentences. Experimental results show that our proposed method achieves better performance than all compared data augmentation methods on the CGED-2018 and CGED-2020 benchmarks. + +# 1 Introduction + +The goal of Grammatical Error Detection is to detect grammatical errors in texts (Rao et al., 2018). It is useful for many NLP applications such as writing assistant (Napoles et al., 2017), search engine (Gao et al., 2010), and speech recognition systems (Wang et al., 2020a), etc. Grammatical errors may + +我看过有一个因很长时间吸烟而终于死亡的人。 +I have seen a person who finally died after smoking for a long time. + +我看见一个因很长时间吸烟而最终死亡的人。I saw a man who finally died of smoking for a long time. + +Figure 1: An error-correction pair from CGED datasets. The first line is an erroneous sentence, tokens marked in blue color are selection errors, tokens marked in green color are redundant words. The second line is the corrected sentence. + +appear in all languages (Dale et al., 2012; Bryant et al., 2019). In this paper, we only investigate the problem of Chinese Grammatical Error Detection (CGED). + +Grammatical Error Detection is usually formulated as a sequence tagging task, where each erroneous token is assigned with an error type, e.g., selection errors and redundant words, as shown in Figure 1. Since annotating grammatical errors requires rich linguistic knowledge, it is expensive and time-consuming to annotate a large-scale corpus. Therefore, the scarcity of labeled data is one of the main challenges for this task. To handle this problem, previous works proposed various data augmentation methods to automatically generate more training samples (Kiyono et al., 2019; Wang et al., 2019; Lichtarge et al., 2019; Kasewa et al., 2018). The methods of generating erroneous sentences can be roughly categorized into the following two types: (1) Rule-based methods. These methods construct erroneous sentences by introducing noises into original texts, e.g., inserting, deleting, or replacing some words (Zhao et al., 2019; Wang et al., 2019). As the erroneous sentence shown in Figure 1, human grammatical errors are usually context dependent. On the contrary, the randomly introduced errors are context-independent (case I in Figure 2), therefore these noise-corrupted sentences are quite different from the erroneous sentences made by humans. (2) Model-based methods. In order to imitate human errors, many studies utilize neu + +
Original Sentence我看见一个因很长时间吸烟而最终死亡的人。(I saw a man who finally died of smoking for a long time.)
IContext-independent我看见一个因很长时间美丽吸烟而最终死亡的人。(I saw a man who finally died of beauty smoking for a long time.)
IISemantic-ambiguity我看到一个男人死于吸烟,已经很久。(I saw a man who died of smoking, it's been a long time.)
IIIError Free我看到了一个长期吸烟而死的人。(I saw a man who died from smoking for a long time.)
+ +Figure 2: Illustration for some examples generated by various data augmentation methods. Tokens marked in red are the modifications against the original sentence. Example I is constructed by the rule-based method, and the introduced error is meaningless to the original sentence. It is too easy for the detection model to detect such error. Example II is constructed by the model-based method, which is quite different from the original sentence. It is difficult to judge which tokens are grammatical errors when comparing the generated sentence with the original sentence. Example III is also different from the original sentence, but it does not contain any grammatical errors. + +ral generative models to generate grammatical errors, such as Seq2Seq models (Kasewa et al., 2018; Wan et al., 2020), and translation models which obtain erroneous sentences via round-trip translation through a bridge language (Zhou et al., 2020; Lichtarge et al., 2019). However, considering that the outputs of generative models are not usually faithful to the inputs (Weng et al., 2020), semantic and syntactic ambiguities may arise when the generative models bring too many changes to the original sentences (case II in Figure 2). Even human can not infer the correct sentences from these generated sentences, so it is also difficult for the detection model to automatically detect grammatical errors. Meanwhile, generated sentences may be error-free and become noisy data (case III in Figure 2). Therefore, these constructed samples have little contributions to improving the performance of detection models. + +To handle the aforementioned problems, we propose CNEG, a novel Conditional Non-Autoregressive Error Generation (CNEG) model for generating Chinese grammatical errors. Figure 3 illustrates the architecture of the model. Specifically, to predict a context-dependent error, we first mask a span of a correct text, and utilize BERT (Devlin et al., 2019) to conduct non-autoregressive span prediction. In order to ensure that the generated sentence will be faithful to the original sentence, we force the model to generate span conditioned on the original span. Considering that the correct information is integrated into the model, we further introduce a penalty to encourage the model not to directly reconstruct the correct span. Our CNEG model is based on BERT, which is pretrained on a large scale of Chinese corpus. Therefore, the model can generate errors that do not appear in the training dataset. Finally, in order to filter out the error-free spans, we also utilize a + +pre-trained BERT to measure the perplexities of generated spans. + +The main contributions of this paper can be summarized as follows: + +- We propose a new data augmentation method (CNEG) to tackle the data scarcity of CGED. We utilize BERT encoder with a non-autoregressive decoding layer as the backbone of our generative model to generate context-dependent errors. +- We incorporate the original span into our generative model, which enables the model to predict the erroneous span conditioned on the original span. And we introduce a filtering strategy to filter out error-free spans. +- Experimental results on the CGED datasets show that our method outperforms all previous methods, which demonstrates the effectiveness of our method. We release the source code for further use by the community1. + +# 2 Related Work + +Chinese Grammatical Error Detection (CGED) aims at detecting grammatical errors in Chinese sentences (Rao et al., 2018). Most studies regard it as a sequence tagging task, where each token will be given a correct label or an error-type. Sequence labeling methods are widely used for CGED, such as feature-based statistical models (Chang et al., 2012), and neural models (Fu et al., 2018). Due to the effectiveness of BERT(Devlin et al., 2019) in many other NLP applications, recent studies adopt BERT as the basic architecture of CGED models (Fang et al., 2020; Wang et al., 2020b; Li and Shi, 2021). Wang et al. (2020b) propose a model that + +combines ResNet and BERT to achieve state-of-the-art results on the CGED-2020 task. Li and Shi (2021) apply a CRF layer on BERT to introduce the dependency of tokens. + +However, neural models usually require a large amount of training data, and manually annotating a large corpus is expensive and time-consuming. Therefore, many studies focus on data augmentation methods to automatically generate large-scale training samples to boost the performance of grammatical error detection models (Kiyono et al., 2019; Wang et al., 2019; Lichtarge et al., 2019; Kasewa et al., 2018). Kiyono et al. (2019) investigated different strategies of the incorporation of pseudo data, including the method of generating the pseudo data, the seed corpus for augmentation, and training strategies with these augmented samples. Wang et al. (2019) proposed a rule-based editing method that constructs the noise-corrupted text. Instead of directly adding noise into the sentence, Wan et al. (2020) introduce noise to the representation of a sentence and apply the Seq2Seq model to generate sentences with various error types. Lichtarge et al. (2019) use an intermediate language as a bridge to generate grammatical error samples. Zhou et al. (2020) consider that Neural Machine Translation (NMT) model is significantly better than the Statistical Machine Translation (SMT) model, then utilize NMT model and SMT model to generate correct and erroneous sentences respectively. Moreover, Wang and Zheng (2020) firstly identify the most vulnerable tokens by a seq2seq model, then replace these tokens with the grammatical errors which are collected from the training dataset. + +# 3 Methodology + +# 3.1 Problem Formulation + +Our goal is to generate high-quality grammatical errors to improve the performance of CGED models. Given a sample $S = (E, C, Y)$ from CGED training dataset, where $E = [e_1, e_2, \dots, e_m]$ is an erroneous sentence of $m$ tokens. Each token $e_i$ is assigned with a label $y_i \in \{0, \dots, d\}$ , where $d$ is the number of error types and 0 represents non-error. $C = [c_1, c_2, \dots, c_n]$ is the corresponding corrected text of $n$ tokens. The goal of data augmentation method is to generate erroneous sentences based on the correct sentence $C$ and the erroneous sentence $E$ . And the goal of grammatical error detection model is to predict the label $y_i$ of each token $e_i$ . + +In the following subsections, we first present the + +![](images/406239518bd650a963ebea87549fab4efa0119fd6059149512403d443ba609f9.jpg) +Figure 3: The architecture of our CNEG model. + +architecture of our generative model, as described in §3.2, then introduce the method of constructing erroneous sentences with the trained model, as described in §3.3. + +# 3.2 CNEG Model + +Figure 3 illustrates the architecture of the proposed CNEG model. To imitate human errors, our model first masks a span in a correct text, then predicts the erroneous span conditioned on the masked context and the correct span. In this subsection, we first describe the training samples for the generative model, then present the architecture of the model, finally introduce the learning objectives. + +Training Samples Construction Given an erroneous sentence and its corresponding correct sentence, we collect the erroneous spans and their corresponding correct spans. Then we sample an erroneous span $E_{span}$ of $n_e$ tokens, and its corresponding correct span $C_{span}$ of $n_c$ tokens. As shown in Figure 3, the target of the model is the erroneous span, and the inputs of the model are the correct span and the masked correct text. To get the masked correct text $C_{masked}$ , we replace the correct span $C_{span}$ in the correct text $C$ with a masked span $M_{span}$ consisting of $n_m$ [MASK] tokens, where $n_m \geq n_e$ and $n_m \geq n_c$ . Since the erroneous span $E_{span}$ and the correct span $C_{span}$ may be not aligned in token level (e.g. $E_{span} =$ "而于", $C_{span} =$ "而终于"), the model can hardly learn the token-level mappings of those span. To handle this problem, we propose a strategy to align them. Assuming $n_m = 4$ : + +1. When $n_e = n_c$ (e.g. $E_{span} =$ "死去的", $C_{span} =$ "死亡的"), we pad one special token + +[U] to the tail of $C_{\text{span}}$ and the tail of $E_{\text{span}}$ separately: + +$$ +E _ {s p a n} = [ \text {死}, \text {去}, \text {的}, [ \mathrm {U} ] ] +$$ + +$$ +C _ {s p a n} = \left[ \mathrm {死}, \mathrm {亡}, \mathrm {的}, [ \mathrm {U} ] \right] +$$ + +2. When $n_e > n_c$ (e.g. $E_{span} =$ "终于了", $C_{span} =$ "终于"), which means that some tokens can be added to the tail of correct span, we pad two [U] tokens to the tail of $C_{span}$ and one [U] token to the tail of $E_{span}$ : + +$$ +E _ {s p a n} = \left[ \mathrm {终}, \mathrm {于}, \mathrm {了}, [ \mathrm {U} ] \right] +$$ + +$$ +C _ {s p a n} = [ \text {终}, \text {于}, [ \mathrm {U} ], [ \mathrm {U} ] ] +$$ + +3. When $n_e < n_c$ (e.g. $E_{span} =$ "而于", $C_{span} =$ "而终于"), which means that some tokens can be deleted from $C_{span}$ . Then, we insert one [U] into the missing position of $E_{span}$ , and pad one [U] to each span: + +$$ +E _ {s p a n} = \left[ \text {而}, [ \mathrm {U} ], \text {于}, [ \mathrm {U} ] \right] +$$ + +$$ +C _ {s p a n} = \left[ \text {而}, \text {终}, \text {于}, [ \mathrm {U} ] \right] +$$ + +where $[\mathsf{U}]$ is a placeholder which means no character in the position. + +Conditional Context Representation Our architecture adopts BERT (Devlin et al., 2019) as the basic encoding model, which is initialized with a pre-trained Chinese BERT (Cui et al., 2019) to make full use of linguistic information from large-scale Chinese texts. BERT is constructed with a stacked layer structure, which has deep bidirectional representations by learning information from left to right and from right to left. + +To predict the erroneous span conditioned on the original context, we use BERT to encode the masked correct text $C_{\text{masked}}$ to obtain contextual representations of the masked span $M_{\text{span}}$ , denoted as $\mathbf{h}_{\text{ms}}^1$ , where $l$ is the number of BERT layers. Previous masked language model applies an MLP decoder on this vector to conduct non-autoregressive prediction. However, the predicted sequence may be quite different from the original span. + +To alleviate this problem, we propose a conditional component to incorporate the correct span. Specifically, we apply the same BERT to encode the correct span $C_{span}$ and get corresponding hidden vectors, denoted as $\mathbf{h}_{\mathbf{cs}}^1$ . Then we add this vector to the representation of the masked span: + +$$ +h _ {m s} = h _ {m s} ^ {l} + h _ {c s} ^ {l} \tag {1} +$$ + +![](images/a71860028a692d4163e79fc0e9e4ead40af7b23c6d83d3e7f142998101670fe5.jpg) +Figure 4: Data flow of the erroneous sentence construction. Token [U] in correct span is padding tokens to make the length of the correct span equal to that of the masked span. + +As show in the left part of Figure 3, we further apply a transformer layer on the new representation, therefore the masked span representation $\mathbf{h}_{\mathbf{ms}}^{1 + 1}$ is conditioned on both the context $C_{\text{masked}}$ and the correct span $C_{\text{span}}$ . Finally, we apply a MLP layer and a softmax layer to transform the vector $\mathbf{h}_{\mathbf{ms}}^{1 + 1}$ to the generative probability $p$ , it is defined as: + +$$ +p = \operatorname {s o f t m a x} \left(W h _ {m s} ^ {l + 1} + b\right) \tag {2} +$$ + +We adopt cross entropy loss as the objective function: + +$$ +L _ {M L M} = - \sum_ {i = 1} ^ {n _ {m}} \sum_ {j = 1} ^ {c} \log y _ {j} ^ {i} \log p _ {j} ^ {i} \tag {3} +$$ + +where $c$ is the size of vocabulary and $n_m$ is the length of masked span. + +MSE Penalty As we integrate the original span into the model by Eq.1, the model will tend to directly reconstruct the correct span when $\mathbf{h}_{\mathrm{ms}}$ and $\mathbf{h}_{\mathrm{cs}}^{\mathrm{l}}$ are too similar. To lead the model not to pay all attention to the correct span, we add a penalty to force $\mathbf{h}_{\mathrm{ms}}$ to be different from $\mathbf{h}_{\mathrm{cs}}^{\mathrm{l}}$ by maximizing the distance between two vectors: + +$$ +L _ {M S E} = - M S E \left(h _ {m s}, h _ {c s} ^ {l}\right) \tag {4} +$$ + +where MSE means the mean squared error loss function. Then the final loss of the model is: + +$$ +L o s s = \lambda \cdot L _ {M S E} + L _ {M L M} \tag {5} +$$ + +where $\lambda$ is a hyperparameter. + +# Algorithm 1 Erroneous sentence construction + +# Input: + +$f$ CNEG model + +$C$ : a correct text of $n$ tokens + +$E$ : an erroneous text + +$T$ : a threshold to filter error-free span + +$M_{span}$ : a span of [MASK] tokens + +# Output: + +A: augmented dataset + +1: Set length of masked correct span as $n_c$ ; +2: Initialize an empty mapping $M = \{\}$ +3: for $i \in [0, n - n_q]$ do +4: Get a correct span $C_{span} = C[i : i + n_c]$ +5: Form a masked text $C_{\text{masked}} = C[:i] + M_{\text{span}} + C[i + n_c:]$ +6: Predict $G_{span} = f(C_{masked}, C_{span})$ +7: Add $(C_{span}, G_{span})$ into mapping $M$ +8: for $C_{span}, G_{span} \in M$ do +9: if $PPL(G_{span}) < T$ or $PPL(G_{span}) < PPL(C_{span})$ then +10: continue +11: if $C_{span} \in E$ then +12: Replace $C_{span}$ in $E$ with $G_{span}$ and form a synthetic sentence $S$ +13: Get the label sequence $Y$ of $S$ +14: Add $(S,Y)$ to A +15: return A + +# 3.3 Erroneous Sentence Construction + +In this subsection, we describe our method of constructing erroneous sentences. As the example shown in Figure 4, we first mask a span in the correct text and generate a span with the trained model, then check if the span contains grammatical errors, finally we use the erroneous span to construct the erroneous sentence. + +Erroneous Span Generation In this step, we utilize the trained model to generate grammatically erroneous spans for a correct text. Specifically, given an erroneous text and its corrected text, we first initial an empty correction-to-error mapping $M$ , and mask a span within the correct text, then feed the correct span $C_{span}$ and the masked correct text $C_{masked}$ to the CNEG model to generate a span $G_{span}$ , finally add the $C_{span}$ and $G_{span}$ pair to the mapping. Since the span masking can be conducted like a sliding window, we will get a correction-to-error mapping for each correct text (lines 3-7 in Algorithm 1). + +Error-free Span Filtering Although our CNEG model takes the erroneous spans as the predicting targets, we cannot ensure that each generated span will contain at least one grammatical error. If we assign error-types to error-free spans, they will become noises for the detection model later. Therefore, it is necessary to filter out the error-free spans. Mita et al. (2020) compare the perplexities of generated sentences and correct sentences to determine whether the generated sentences are grammatically correct. However, since the sentence-level perplexity is affected by too many tokens, the sentence with larger perplexity may also be grammatically correct. To address this issue, we introduce a method that uses span-level perplexity to identify whether the generated span is erroneous (lines 9-10 in Algorithm 1). To calculate $PPL(G_{span})$ , we replace the masked span $M_{span}$ in the masked correct text $C_{masked}$ with the generated span $G_{span}$ , and mask the word $w_i$ of the generated span one by one, then utilize pre-trained BERT to predict the probability $P(w_i)$ of the masked word $w_i$ : + +$$ +P \left(w _ {i}\right) = P \left(w _ {i} \mid w _ {1}, \dots , w _ {i - 1}, w _ {i + 1}, \dots , w _ {N}\right) \tag {6} +$$ + +We calculate the perplexity of the generated span $PPL(G_{\text{span}})$ by the following equation: + +$$ +P P L \left(G _ {s p a n}\right) = e x p \left\{- \frac {1}{N} \sum_ {i = 1} ^ {N} P \left(w _ {i}\right) \right\} \tag {7} +$$ + +Where $N$ is the length of the generated span. We use the same method to calculate the perplexity of the correct span $PPL(C_{span})$ . Then we can filter out the generated span whose perplexity is smaller than corresponding $PPL(C_{span})$ and smaller than a threshold $T$ , where $T$ is a hyper-parameter. Finally, we will obtain a high-quality correction-to-error mapping for a correct text. + +Synthetic Sentence Construction After obtaining the erroneous span, we can construct a training sample for CGED (lines 11-14 in Algorithm 1). Specifically, given an erroneous sentence $E$ from training dataset, we select a generated span $G_{span}$ and a corresponding correct span $C_{span}$ from the mapping. If the erroneous sentence $E$ contains the correct span $C_{span}$ , we will replace the correct span $C_{span}$ with the generated span $G_{span}$ to form a synthetic sentence $S$ . Then we use a rule-based method to automatically annotate the synthetic sentence $S$ to obtain a label sequence $Y$ . Finally, we add the sample $(S,Y)$ to the augmented dataset. + +
DatasetSCEE span
Train21582412154153940
Validation3154117419804871
Test-20183546156219845040
Test-2020145730711503660
+ +Table 1: Distribution of datasets. $S, C, E$ and $E_{span}$ denote the amount of sentences, the amount of correct sentences, the amount of erroneous sentences and the amount of erroneous spans, respectively. Test-2018 and Test-2020 denote the test dataset of CGED-2018 and the test dataset of CGED-2020, respectively. + +# 4 Experimental setup + +# 4.1 Datasets + +We conduct experiments on public datasets from CGED tasks (Lee et al., 2016; Rao et al., 2017, 2018, 2020), which contain thousands of Chinese text written by foreign language learners. Following the work of (Wang et al., 2020b), we select 2016, 2017, 2018 and 2020 training dataset as our training dataset. + +CNEG Model We use error-correction sentence-pairs from the training dataset to train the generative model. Then we use the trained model to construct erroneous sentences by the same dataset. + +CGED Model Each data augmentation method will generate some samples, we combine them with the training dataset to form a new dataset, which can be used for training the detection model later. For evaluating the performance of CGED model, we use the test dataset from CGED-2017 for validation, use the test dataset from CGED-2018 and the test dataset from CGED-2020 for testing separately. The statistics of datasets are given in Table 1. + +# 4.2 Evaluation Metrics + +We adopt the same evaluation method as used in (Rao et al., 2018). It includes three levels: + +- Detection level. This level is to detect whether a sentence contains error, and can be considered as a binary-classification of a sentence. +- Identification level. This level is to identify all error-types of a sentence, and can be considered as a multi-label classification of a sentence. +- Position level. This level is to locate the erroneous words and identify their corresponding error types. However, there is no explicit word + +boundary in Chinese text, we measure this score on Chinese character-level in our experiment. + +We use F1-score to measure each level. + +# 4.3 Implementation Details + +CNEG Model: The BERT encoder of our generative model is initialized with a Chinese BERT (Cui et al., 2019), which is also used for measuring the perplexities of generated spans later. We use the Adam optimizer with an initial learning rate of $5e^{-5}$ and train the generative model for 10 epochs. The $\lambda$ in Eq. 5 is set to 0.5, and the threshold $T$ in Algorithm 1 is set to 2. + +CGED Model: We evaluate various data augmentation methods by training the BERT-based sequence labeling models on the augmented datasets. To predict the label of each token, we apply a fully-connected layer to perform token classification based on the representation of the last transformer layer, and the hidden size of the classification layer is 768. For all experiments, we use the Adam optimizer with an initial learning rate of $7e^{-5}$ . All experiments are conducted for 5 runs and the averaged score is reported. + +# 4.4 Compared Methods + +We compare our augmentation method with several baseline methods. + +Raw is the original training dataset without any other augmented samples. + +DirectNoise (Wang et al., 2019) is an editing based method that introduces noise into a text by inserting, deleting or replace some words. + +Seq2seq (Kasewa et al., 2018) takes the corrected sentences as the inputs and the erroneous sentences as the predicting targets of the model. + +BackTranslation (Lichtarge et al., 2019) first translates the original sentence into a bridge language, the translated sentence will be translated back into the source language. In this experiment, we select English as the bridge language. + +ADV (Wang and Zheng, 2020) is an adversarial method that constructs adversarial examples by targeting the weak spots of the models and replacing these weak tokens by correction-to-error mapping. + +CNEG is our proposed augmentation method that first generates context-dependent erroneous spans, and constructs erroneous sentences. + +CNEG w/o Filter is a variation of our method that constructs erroneous sentence without error-free span filtering strategy, as proposed in §3.3. + +
MethodCGED-2018CGED-2020
D-FI-FP-FD-FI-FP-F
Raw80.6664.9349.7787.3960.2732.78
DirectNoise79.2063.0648.0288.9159.1131.37
Seq2Seq79.8163.2649.4986.7658.2931.40
BackTranslation80.2064.0148.8187.0359.8931.92
ADV80.7164.7950.1087.1160.2032.81
CNEG (ours)80.966.8852.2688.1262.0033.99
CNEG w/o Filter (ours)80.4766.3751.9287.0359.1633.14
+ +# 5 Experimental Results + +# 5.1 Main Results + +The experimental results on the CGED datasets are shown in Table 2. Our observations are as follows: Whole-sentence generation methods degrade the performance on both of the test datasets. Seq2Seq and BackTranslation get worse results than Raw dataset because they treat the erroneous sentence generation as a whole sentence generation task, which is not controllable. By comparing our CNEG w/o Filter with Seq2Seq, we observe that span-generation method improves about $2.3\%$ on the position-level of CGED-2018, and $1.7\%$ on the position-level of CGED-2020. + +Context-dependent errors are beneficial. Although DirectNoise shows effectiveness in some previous studies, it has no effect on the CGED dataset because the randomly introduced errors are context-independent, which are too easy for the detection model to detect such errors. Among the compared methods, $ADV$ performs the best because it constructs errors considering about the contextual information. Even without filtering strategy, CNEG w/o Filter outperforms $ADV$ by a large margin because it can generate more diversified errors, improving position-level F-score by $2.2\%$ and $1.1\%$ on the two test datasets. + +Error-free filtering is necessary. We observe that CNEG further improves CNEG-filter by $0.6\%$ on the position-level of CGED-2020. Without filtering strategy, the performance on detection-level shows significant decline. The reason is that the noisy augmented data can hurt the model performance. This result demonstrates the effectiveness of filtering out error-free span. + +Table 2: Main results on the CGED datasets. The best results are in bold. CGED-2018 denotes the test dataset of CGED-2018. CGED-2020 denotes the test dataset of CGED-2020. D-F denotes the F-score of detection-level. I-F denotes the F-score of identification level. P-F denotes the F-score of Position-level. + +
MethodD-FI-FP-F
CNEG (ours)80.966.8852.26
CNEG w/o Con79.5966.0351.31
CNEG w/o Pen81.3265.8351.86
+ +Table 3: Ablation results on the CGED-2018. + +
MethodSentence
Correct烟雾刺激就会对人体有危害。
CNEG (ours)雾烟刺激就会人体有危害。
CNEG w/o Con雾烟刺激真的是对人体有危害。
CNEG w/o Pen雾烟刺激就会对人体有危害。
+ +Table 4: Examples generated by the models. The masked correct span are marked in green. The generated spans are marked in red. Errors from the original erroneous sentence are marked in blue. + +# 5.2 Effects of Components of Generative Model + +For further analyzing the effectiveness of the components of our proposed model, we also conduct ablation experiments as follows: + +CNEG w/o Con is a variation of our model that predicts error not conditioned on the original span, which is described in §3.2. + +CNEG w/o Pen is a variation of our method that trains generation model without the MSE penalty, which is described in §3.2. + +Results are shown in Table 3. Experimental results show that CNEG significantly performs better than CNEG w/o Con and CNEG w/o Penalty. We also present several generated sentences in Table 4. CNEG w/o Con generates a grammatical error, which is quite different from the original span and should be corrected to "真的对", and we should assign a redundant label to the token "是". However, when comparing the generated span with the + +
MethodD-FI-FP-F
PSE80.264.9850.21
GME81.265.6250.94
PME80.966.8852.26
+ +original span, selection-error labels are automatically assigned to the tokens in the generated span, which will confuse the detection model. CNEG w/o Pen directly reconstructs the original span, which is useless for data augmentation. Our methods generate a grammatical error by missing an important token in the original span, which is beneficial for the detection model. These results demonstrate the effectiveness of our proposed components. + +# 5.3 Effects of Multi-Error Sentences + +Our augmentation method masks a span in a correct sentence and then predicts an erroneous span. To construct an erroneous sentence, the direct method is to replace the masked span with the predicted span, then the synthetic sentence will contain an erroneous span, we call this method $PSE$ (Plug-in Single-Error). However, each sentence in CGED dataset contains over two errors on average, as shown in the Table 1. To make the synthetic sentences be consistent with multi-error sentences, we develop two multi-error sentences construction strategies. First, as described in §3.3, we locate the correct span in the corresponding erroneous sentence and replace it with the erroneous span. The synthetic sentence will contain original errors and a generated error, we call this method $PME$ (Plug-in Multi-Error). Second, we mask a correct span in an erroneous sentence, and utilize the model to predict an erroneous span. Then the new sentence will contain the original errors and a generated error, we call this method $GME$ (Generated Multi-error). To figure it out which is the better choice, we conduct experiments on the datasets augmented by those methods. We report the results in Table 5. We observe that the $PSE$ gets the worst performance. The reason is that single-error is too easy for the detecting model. $PME$ outperforms $GME$ , the reason may be that $GME$ can not predict beneficial spans with the noisy context. Therefore, we can conclude that inserting the erroneous span into the original erroneous sentence is the most effective method. + +![](images/e5bca2ab03393456f3cdfdad0e1cc7faa7761da74a6204eaec5d2a0846cb1591.jpg) +Figure 5: Performance of data augmentation with different filter threshold. The left axes is for CGED-2018, the right axes is for CGED-2020. + +Table 5: Results of different sentence construction methods on CGED-2018. + +
Sentence
(a)从小就是(形象)形影不离的一对。
(b)从小就是(内容)形影不离的一对。
(c)第二天(变)天气变得很好。
(d)第二天(给)天气变得很好。
+ +Table 6: Constructed examples. (a) and (c) are generated by our model. (b) and (d) are generated by direct noise method. Errors are marked in red. + +# 5.4 Effects of Different Threshold For Filtering Strategy + +Results on Table 2 show that with the help of filtering strategy, CNEG can further improve by $1\%$ over CNEG w/o filter. In this subsection, to further evaluate the effectiveness of our filtering strategy, we set different filtering thresholds to construct several augmentation datasets, then train detection models with these datasets. The evaluation results are show in Figure 5. + +We can observe that when threshold is around 2, the method achieves the best performance on both the CGED-2018 and CGED-2020. When the threshold is lower than 2, the performances of detection model decrease significantly. The reason is that there are many error-free spans whose perplexities are lower than 2, when these error-free spans are added into the training dataset, the detection model will be confused. When the threshold is higher than 4, the methods also achieve worse performance. The reason is that most generated errors are filtered out, the reserved erroneous spans are too limited for boosting the performance of detection models. + +# 5.5 Case Study + +As we demonstrated, our model can better imitate human grammatical errors. In Table 6, we list some augmented examples. The first two sentences are selection errors, sentence (a) replaces + +"形影" with a near-synonym "形象", sentence (b) replaces "形影" with a random noun "内容". The last two sentences are redundant errors, sentence (c) inserts "变" in front of "天气" where "变天气" is a phrase but not correct for here, sentence (d) inserts a random verb "给" in front of "天气" to generate a obviously redundant error. Unlike human who usually makes context-dependent errors, the direct noise method always introduces random errors, while our model generates highly context-dependent errors. Hence, our method can generate high quality and diverse errors which could not be constructed by direct noise method. + +# 6 Conclusions + +In this paper, considering that grammatical errors made by humans are usually context-dependent, we propose a conditional non-autoregressive error generation method (CNEG) for data augmentation of CGED. By introducing the correct span into the non-autoregressive model, the model will generate errors conditioned on both the context and the correct span. Observing that the model may generate correct spans, a filtering strategy is proposed to filter out error-free spans. Experimental results show that our method outperforms all compared data augmentation methods on the CGED datasets, which demonstrates the effectiveness of our method. + +# References + +Christopher Bryant, Mariano Felice, Øistein E. Andersen, and Ted Briscoe. 2019. The BEA-2019 shared task on grammatical error correction. In Proceedings of the Fourteenth Workshop on Innovative Use of NLP for Building Educational Applications, pages 52-75, Florence, Italy. Association for Computational Linguistics. +Ru-Yng Chang, Chung-Hsien Wu, and Philips Kokoh Prasetyo. 2012. Error diagnosis of chinese sentences using inductive learning algorithm and decomposition-based testing mechanism. ACM Trans. Asian Lang. Inf. Process., 11(1):3:1-3:24. +Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Ziqing Yang, Shijin Wang, and Guoping Hu. 2019. Pre-training with whole word masking for chinese BERT. CoRR, abs/1906.08101. +Robert Dale, Ilya Anisimoff, and George Narroway. 2012. HOO 2012: A report on the preposition and determiner error correction shared task. In Proceedings of the Seventh Workshop on Building Educational Applications Using NLP, pages 54-62, Montreal, Canada. Association for Computational Linguistics. + +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, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171-4186. Association for Computational Linguistics. +Meiyuan Fang, Kai Fu, Jiping Wang, Yang Liu, Jin Huang, and Yitao Duan. 2020. A hybrid system for NLPTEA-2020 CGED shared task. In Proceedings of the 6th Workshop on Natural Language Processing Techniques for Educational Applications, pages 67-77, Suzhou, China. Association for Computational Linguistics. +Ruiji Fu, Zhengqi Pei, Jiefu Gong, Wei Song, Dechuan Teng, Wanxiang Che, Shijin Wang, Guoping Hu, and Ting Liu. 2018. Chinese grammatical error diagnosis using statistical and prior knowledge driven features with probabilistic ensemble enhancement. In Proceedings of the 5th Workshop on Natural Language Processing Techniques for Educational Applications, NLP-TEA@ACL 2018, Melbourne, Australia, July 19, 2018, pages 52-59. Association for Computational Linguistics. +Jianfeng Gao, Xiaolong Li, Daniel Micol, Chris Quirk, and Xu Sun. 2010. A large scale ranker-based system for search query spelling correction. In Proceedings of the 23rd International Conference on Computational Linguistics (Coling 2010), pages 358-366, Beijing, China. Coling 2010 Organizing Committee. +Sudhanshu Kasewa, Pontus Stenetorp, and Sebastian Riedel. 2018. Wronging a right: Generating better errors to improve grammatical error detection. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018, pages 4977-4983. Association for Computational Linguistics. +Shun Kiyono, Jun Suzuki, Masato Mita, Tomoya Mizumoto, and Kentaro Inui. 2019. An empirical study of incorporating pseudo data into grammatical error correction. 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 2019, Hong Kong, China, November 3-7, 2019, pages 1236-1242. Association for Computational Linguistics. +Lung-Hao Lee, Gaoqi Rao, Liang-Chih Yu, Endong Xun, Baolin Zhang, and Li-Ping Chang. 2016. Overview of NLP-TEA 2016 shared task for Chinese grammatical error diagnosis. In Proceedings of the 3rd Workshop on Natural Language Processing Techniques for Educational Applications (NLPTEA2016), pages 40-48, Osaka, Japan. The COLING 2016 Organizing Committee. + +Piji Li and Shuming Shi. 2021. Tail-to-tail non-autoregressive sequence prediction for chinese grammatical error correction. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 4973-4984. Association for Computational Linguistics. +Jared Lichtarge, Chris Alberti, Shankar Kumar, Noam Shazeer, Niki Parmar, and Simon Tong. 2019. Corpora generation for grammatical error correction. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 3291-3301. Association for Computational Linguistics. +Masato Mita, Shun Kiyono, Masahiro Kaneko, Jun Suzuki, and Kentaro Inui. 2020. A self-refinement strategy for noise reduction in grammatical error correction. In Findings of the Association for Computational Linguistics: EMNLP 2020, Online Event, 16-20 November 2020, volume EMNLP 2020 of Findings of ACL, pages 267-280. Association for Computational Linguistics. +Courtney Naples, Keisuke Sakaguchi, and Joel Tetreault. 2017. JFLEG: A fluency corpus and benchmark for grammatical error correction. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 229-234, Valencia, Spain. Association for Computational Linguistics. +Gaoqi Rao, Qi Gong, Baolin Zhang, and Endong Xun. 2018. Overview of NLPTEA-2018 share task chinese grammatical error diagnosis. In Proceedings of the 5th Workshop on Natural Language Processing Techniques for Educational Applications, NLP-TEA@ACL 2018, Melbourne, Australia, July 19, 2018, pages 42-51. Association for Computational Linguistics. +Gaoqi Rao, Erhong Yang, and Baolin Zhang. 2020. Overview of NLPTEA-2020 shared task for Chinese grammatical error diagnosis. In Proceedings of the 6th Workshop on Natural Language Processing Techniques for Educational Applications, pages 25–35, Suzhou, China. Association for Computational Linguistics. +Gaoqi Rao, Baolin Zhang, Endong Xun, and Lung-Hao Lee. 2017. IJCNLP-2017 task 1: Chinese grammatical error diagnosis. In Proceedings of the IJCNLP 2017, Shared Tasks, pages 1-8, Taipei, Taiwan. Asian Federation of Natural Language Processing. +Zhaohong Wan, Xiaojun Wan, and Wenguang Wang. 2020. Improving grammatical error correction with data augmentation by editing latent representation. + +In Proceedings of the 28th International Conference on Computational Linguistics, COLING 2020, Barcelona, Spain (Online), December 8-13, 2020, pages 2202-2212. International Committee on Computational Linguistics. +Haoyu Wang, Shuyan Dong, Yue Liu, James Logan, Ashish Kumar Agrawal, and Yang Liu. 2020a. ASR Error Correction with Augmented Transformer for Entity Retrieval. In Proc. Interspeech 2020, pages 1550-1554. +Liang Wang, Wei Zhao, Ruoyu Jia, Sujian Li, and Jingming Liu. 2019. Denoising based sequence-to-sequence pre-training for text generation. 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 2019, Hong Kong, China, November 3-7, 2019, pages 4001-4013. Association for Computational Linguistics. +Lihao Wang and Xiaoqing Zheng. 2020. Improving grammatical error correction models with purpose-built adversarial examples. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 2858-2869. Association for Computational Linguistics. +Shaolei Wang, Baoxin Wang, Jiefu Gong, Zhongyuan Wang, Xiao Hu, Xingyi Duan, Zizhuo Shen, Gang Yue, Ruiji Fu, Dayong Wu, et al. 2020b. Combining resnet and transformer for chinese grammatical error diagnosis. In Proceedings of the 6th Workshop on Natural Language Processing Techniques for Educational Applications, pages 36-43. +Rongxiang Weng, Heng Yu, Xiangpeng Wei, and Weihua Luo. 2020. Towards enhancing faithfulness for neural machine translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2675-2684, Online. Association for Computational Linguistics. +Wei Zhao, Liang Wang, Kewei Shen, Ruoyu Jia, and Jingming Liu. 2019. Improving grammatical error correction via pre-training a copy-augmented architecture with unlabeled data. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 156-165. Association for Computational Linguistics. +Wangchunshu Zhou, Tao Ge, Chang Mu, Ke Xu, Furu Wei, and Ming Zhou. 2020. Improving grammatical error correction with machine translation pairs. In Findings of the Association for Computational Linguistics: EMNLP 2020, Online Event, 16-20 November 2020, volume EMNLP 2020 of Findings of ACL, pages 318-328. Association for Computational Linguistics. \ No newline at end of file diff --git a/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/images.zip b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b1ffa746cfda3609f9ebfae02413266210f21938 --- /dev/null +++ b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b18c065abe8d314ee25ee2a493097af8c21bfd17aad0a3531a7d8352861cb84d +size 328863 diff --git a/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/layout.json b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d9b528e09d0d31d0b1a3932d609290216319bcf2 --- /dev/null +++ b/improvingchinesegrammaticalerrordetectionviadataaugmentationbyconditionalerrorgeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d00497bf0395b14120d2d7524a9a81c1caf01145ecfbc25d54cf797e27fd344 +size 411155 diff --git a/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_content_list.json b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0c50236c8c2e3446fc7a166c68770d250ac15f62 --- /dev/null +++ b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bc129c34123ee1e5fc4d39a5d801919f32ea9c8584c9d4be95e75e2e1f34e09 +size 122852 diff --git a/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_model.json b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d11765e6e1306e0cbdfbbb25c53378e2c6903ead --- /dev/null +++ b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52785839a804622b803a271ff2b857fe9cf7fa30293e2b314a96c2949b49b022 +size 142294 diff --git a/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_origin.pdf b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..97b097df97d04f9d2d0422ebd101586e8efd88fe --- /dev/null +++ b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/f3799856-5227-4dc7-9172-ee5b58928629_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48b5d2384fd931ca716bccb3457fc5c6d9e075be2114e273de04d59512cb8a13 +size 1022717 diff --git a/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/full.md b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6b72a776bb766d8068f188722e64233879fd390c --- /dev/null +++ b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/full.md @@ -0,0 +1,401 @@ +# Improving Controllable Text Generation with Position-Aware Weighted Decoding + +Yuxuan Gu†, Xiaocheng Feng†‡, Sicheng Ma†, Jiaming Wu†, Heng Gong†, Bing Qin†‡ + +†Harbin Institute of Technology ‡ Peng Cheng Laboratory + +{yxgu, xcfeng, scma, jmwu, hgong, bqin}@ir.hit.edu.cn + +# Abstract + +Weighted decoding methods composed of the pretrained language model (LM) and the controller have achieved promising results for controllable text generation. However, these models often suffer from a control strength/fluency trade-off problem as higher control strength is more likely to generate incoherent and repetitive text. In this paper, we illustrate this tradeoff is arisen by the controller imposing the target attribute on the LM at improper positions. And we propose a novel framework based on existing weighted decoding methods called CAT-PAW1, which introduces a lightweight regulator to adjust bias signals from the controller at different decoding positions. Experiments on positive sentiment control, topic control, and language detoxification show the effectiveness of our CAT-PAW upon 4 SOTA models2. + +# 1 Introduction + +Controllable text generation is a challenging task in natural language generation, which aims to generate diverse text related to specified attributes. Dominating studies follow PPLM (Dathathri et al., 2020) and adopt a weighted decoding strategy (Krause et al., 2020; Yang and Klein, 2021; Liu et al., 2021a). They usually employ an external controller with weight $\lambda$ to bias the output distribution of a fixed pretrain LM. And the weight $\lambda$ is positively correlated to control strength, thereby achieving strength-adjustable controllable text generation. + +However, those weighted decoding methods suffer from a trade-off problem between control strength and text fluency. As illustrated in Figure 1, when control strength increases, fluency of text generated by these SOTA models such as PPLM (Dathathri et al., 2020), Fudge (Yang and Klein, 2021), GeDi (Krause et al., 2020), and DExperts + +![](images/c3173594adf76c595b30206a12ddd2127162ca50db7b9b42ab8ba9e1ff195482.jpg) +Figure 1: Trade-off between control strength and text fluency on positive sentiment control, where control strength is the probability of being positive and perplexity is an inversely proportional metric to fluency. Each point represents results sampled from an individual $\lambda$ . + +(Liu et al., 2021a) will drop rapidly. In addition, cases in Figure 2 shows that with the increase of weight $\lambda$ from 0.03 to 0.09, models are more likely to degenerate with repetitive, contradictory and incoherent contents such as "it was war war for war". Therefore, it's vital to alleviate the trade-off as an ideal controllable generator should generate high-quality text under different control strengths. + +Based on our analysis, the trade-off is due to the controller assigning bias signals to all decoding positions while ignoring the original results of LMs. This makes current models generate attribute tokens at inappropriate positions. Take military topic control task and PPLM model as an example, which is shown in Figure 2. With prefix The potato and a relatively high weight $\lambda = 0.09$ , PPLM attempts to generate text highly relevant to military. When it comes to the decoding step at token first, candidate tokens of the LM are unrelated to the military topic, but the controller enforces a military bias, which causes PPLM to generate the sentence + +
λ = 0.03 +PPLM: The potato is the most popular vegetable in Europe and is used in many European countries, including Belgium, Greece, Italy...λ = 0.06 +PPLM: The potato plant has been the main target of a massive anti-pest attack by the government in China. The plant was the target of a massive attack from the army...
GPT-2: domest / vegetables / crops / fruits / foods / plants / edible / food / cultivated / to PPLM: war / mass / food / inventions / to / industrial / major / nuclear / weapons / foodsλ = 0.09 +GPT-2: domest / vegetables / crops / fruits / foods / plants / edible / food / cultivated / to CAT-PAW: major / domest / crops / foods / vegetables / great / food / fruits / known / to
PPLM: The potato was a great food staple, and it was also one of the world's first war weapons. +The potato was the first weapon to make war possible, and it was war war for war...CAT-PAW: The potato was a great food staple, and it was also one of the world's first major crops. It was also the main food source of the British navy during the Napoleonic and World War II periods. The British navy began...
+ +Figure 2: Illustration of cases on military topic, where green represents prefix, red represents tokens on military topic, purple denotes military tokens leading to degeneration, and blue stands for top candidate tokens irrelevant to military. We demonstrate cases from PPLM with weight $\lambda \in [0.03, 0.06, 0.09]$ . As $\lambda$ increases, PPLM generates text containing more military tokens, which means higher control strength. However, the generated text is more likely to encounter degeneration such as repetition and commonsense contradiction. Besides, we present top candidate tokens of both LM and PPLM respectively at the decoding step just before degeneration, reflecting a contradiction in preference to military tokens. Finally, we show how our CAT-PAW generates high-quality text in accordance with the LM's preferences as much as possible. + +"The potato was a great food staple, and it was also one of the world's first war weapons," which is contradictory to commonsense. + +In this paper, we present a general generative framework CAT-PAW for weighted decoding methods to alleviate the trade-off problem. Besides standard LMs and controllers, we add a lightweight module named regulator that finely-grained adjusts bias signals from the controller at different positions. In detail, our regulator determines whether to suppress or further amplify the bias signal by detecting differences between output distributions of the LM and the target attribute. As a result, our framework avoids the adverse interference produced by the controller to the language model. At the same time, CAT-PAW can be easily deployed on all existing weighted decoding methods. + +We implement our CAT-PAW on 4 SOTA models and conduct experiments on positive sentiment control, topic control, and language detoxification. Besides normal evaluation metrics such as control strength, fluency, and distinctness, we design a novel metric called slope for trade-off evaluation. As the dotted lines in Figure 1, the slope is obtained by performing a linear fit in a smooth interval to the trade-off curve between control strength and text fluency. Results show that our CAT-PAW can effectively alleviate the trade-off and achieve higher control strength with less sacrifice on fluency. + +# 2 Method + +In this section, we first introduce current weighted decoding methods and analyze how they induce the trade-off. Then we describe the general framework CAT-PAW composed of an LM, a controller, and our regulator module. Last we illustrate two designs of our regulator. + +# 2.1 Weighted Decoding + +Given a sequence of tokens $X = \{x_{1},\dots ,x_{n}\}$ , LMs (Radford et al., 2018, 2019; Brown et al., 2020) based on Transformers (Vaswani et al., 2017) compute the unconditional probability $P(X)$ autoregressively as: + +$$ +\begin{array}{l} P (X) = \prod_ {i = 1} ^ {n} P \left(x _ {i} \mid x _ {< i}\right) \tag {1} \\ = \prod_ {i = 1} ^ {n} \operatorname {s o f t m a x} \left(\mathbf {h} _ {i}\right), \\ \end{array} +$$ + +where $\mathbf{h}_i$ is logits for the $i$ th token computed by the LM. For controllable generation with target attribute $a$ , weighted decoding methods model the conditional probability $P(X|a)$ with Bayes rule $P(X|a) \propto P(X)P(a|X)$ and decompose it into an LM $P(X)$ and a controller $P(a|X)$ . + +To adjust control strength of target attribute $a$ , weighted decoding methods recompose the conditional probability with additional weight $\lambda$ : + +$$ +P (X | a) \propto P (X) P (a | X) ^ {\lambda} \tag {2} +$$ + +![](images/baac9742f6cc330c5a8dc28bdd7c7cbae095e238540ab227767710c95acebda0.jpg) +Figure 3: Illustration of original weighted decoding method and our CAT-PAW. The red arrow represents the bias signal from the controller, and its thickness is positively related to the strength. (a) Original weighted decoding method. (b) When controller tries to bias output distribution from LM at an inappropriate position, regulator will provide a negative amplitude as a suppressor. (c) Regulator will pass the bias signal or even amplify it when it's fine. + +![](images/1bda52bb3666fc6740ab6d8c128a4aa43cb3c960915547fd9956ae4c39336729.jpg) + +![](images/732f6971b8e8688c21b4f2f2ebcaa6c0285e4933a4524cc77eaf96fcf6c5457f.jpg) + +As the LM generates one token at a time, the controller $P(a|X)$ needs to provide a bias signal to the LM at step $i$ only based on $x_{6. Specifically, the $[0,1]$ is uniformly divided into $N$ intervals with each score belonging to one interval. Finally we adopt an attention layer (Vaswani et al., 2017) as our regulator $f_{T}$ on top of a fixed LM with future tokens masked and get: + +$$ +\begin{array}{l} t _ {T} = \sum_ {k = 1} ^ {N} n _ {k} \times P (k | x _ {\leq i}) \\ = \mathbf {n} \cdot \operatorname {s o f t m a x} [ \mathbf {W} \cdot \operatorname {A t t n} (\mathbf {h} _ {[ 1.. i ]}) ] \tag {6} \\ \end{array} +$$ + +$$ +\begin{array}{l} f = f _ {T} (a, P (x _ {\leq i})) \\ = t _ {T} / \tau_ {T}, \\ \end{array} +$$ + +where $\mathbf{n} = [n_1,\dots ,n_N]\in \mathbb{R}^{1\times N}$ is a vector representing medians of $N$ intervals with $n_k = \frac{2k - 1}{2N}$ . Attn $(\mathbf{h}_{[1..i]})$ is an extra attention layer with past logits from $\mathbf{h}_1$ to $\mathbf{h}_i$ as input. $\mathbf{W}\in \mathbb{R}^{N\times |\mathbf{h}_i|}$ is a projection parameter. Our trainable regulator $f_{T}$ estimates probability of the next token being relevant to attribute $a$ with the expectation $t_T$ and scales it with the threshold $\tau_T^7$ . + +# 3 Experiments + +In this section we first describe our evaluation metrics and baseline models. Then we verify our CAT-PAW on positive sentiment control, topic control, and language detoxification. For each task we discuss its specific challenges, detailed configurations, and experiment results. + +# 3.1 Evaluation Metrics and Baselines + +Automatic Evaluation To test the trade-off, we vary the weight $\lambda \in [0,\lambda_{\max}]$ , where $\lambda_{\max}$ is the maximum value of $\lambda$ on each model before degeneration. We collect a series of $\lambda$ points with + +each one corresponding to a set of generated samples. After performing the automatic evaluation on each $\lambda$ point, we report both average results among all points and the result of the best point for each baseline $^8$ . The former denotes the overall tradeoff trends and the latter represents the boundary of models' ability. We consider four metrics: (1) Control Strength is the general metric regarding to what extent can models generate text with target attributes. In different tasks, control strength is evaluated as: (a) Positivity is the probability of text being positive measured by a classifier trained on IMDB movie reviews (Maas et al., 2011); (b) Keywords is the frequency of tokens from target attribute's bag-of-word for topic control; (c) Toxicity is the probability of text being toxic from PERSPECTIVE API $^9$ . (2) Perplexity is a fluency metric calculated by GPT (Radford et al., 2018), with higher perplexity meaning lower fluency. (3) Distinctness is the distinct n-grams score (Li et al., 2016). Holtzman et al. (2020) points out that text repetition may deceive the perplexity while can easily be recognized by distinctness. (4) Slope is the degree of the trade-off. We restrict the trade-off curve to a smooth interval and obtain the slope by performing a linear fit. + +Human Evaluation We report the human result of the best $\lambda$ point for each model since it can fully reflect the capabilities of the model. We randomly shuffle each group of generated samples from our framework and the corresponding baseline method $^{10}$ . Each sample group is annotated by three professional evaluators for: (1) Strength is the control strength of target attribute evaluated by humans. Evaluators need to measure to what extent the generated text satisfies the target attribute according to its prefix. For positive sentiment control, The score ranges from -1 to 1 with -1 being "conflict with target attribute", 0 being "nothing to do with target attribute", and 1 being "highly con + +
PositiveSlope ↓AverageBest
Pos(%)↑PPL↓Dist1↑Dist2↑Dist3↑Pos(%)↑Str(%)↑PPL↓Flu↑
GPT2top-10-27.0021.820.270.660.8227.00-21.82-
PPLMOrigin136.6847.6240.710.250.640.8153.083.9436.172.73
+ T67.0649.0933.130.270.670.8454.795.2032.413.07
+ H56.8447.1728.320.250.660.8257.5110.2636.483.03
GPT2top-100-24.9045.580.360.800.8924.90-45.58-
GeDiOrigin82.2350.2751.050.330.790.8955.1813.1453.782.88
+ T60.5450.2950.830.340.790.8956.2416.8653.772.88
+ H36.4852.0849.490.330.790.8960.4618.8653.782.92
DEXPErsOrigin64.5051.5156.780.350.800.8964.6815.9459.383.46
+ T38.3155.8555.830.350.800.8964.3616.2056.243.49
+ H29.7554.1556.080.360.800.8964.9317.8656.993.48
GPT2top-200-26.9958.040.360.810.8926.99-58.04-
FudgeOrigin72.4743.6464.320.360.800.8952.278.8059.483.20
+ T35.6845.4963.320.360.810.8954.8012.5461.693.11
+ H17.6846.5562.890.360.810.8958.4422.6658.323.25
+ +Table 1: Results on Positive sentiment control. Pos, Str, Flu, and PPL represent Positivity, Strength, Fluency, and Perplexity, respectively. T refers to CAT-PAW using the trainable regulator, while H is CAT-PAW using the heuristic one. Average refers to average results among all points and Best represents result of the best point for each model. + +sistent with target attribute". For topic control and language detoxification, the score ranges from 0 to 1. (2) Fluency is fluency of generated text. Evaluators are asked to score a single sample on a scale of 1-5, with 1 being "anything except a complete sentence" and 5 being "very fluent". + +Baselines We use top-k sampling and gpt2-medium (Radford et al., 2019) as the LM for these SOTA models to make trade-off curve plotting convenient. PPLM (Dathathri et al., 2020) biases hidden states of LM with gradients from a trained classifier. GeDi (Krause et al., 2020) trains 2 class-conditional LMs to get probabilities of target attribute at each decoding step. Fudge (Yang and Klein, 2021) predicts probabilities of the target attribute with a classifier considering one more token ahead. DExperts (Liu et al., 2021a) trains an expert and an anti-expert class-conditional LM. It biases hidden states of the LM from the difference of outputs between expert and anti-expert. + +# 3.2 Positive Sentiment Control + +Positive sentiment control is a task of practical use. For example, a chatbot needs to generate positive and friendly content even when the user expresses depression. We experiment with our CAT-PAW over all baselines. PPLM trains a classifier on Stanford Sentiment Treebank (SST-5; Socher et al., 2013) and we use the same one for Fudge. Class-conditional LMs of GeDi and DExperts are trained on IMDB movie reviews (Maas et al., 2011) and SST-5 respectively. For PPLM, we take top-10 sampling that ensures fluency with little sacrifice on diversity. We set $k = 200$ for Fudge as it needs + +to sample before control while Gedi and DExperts use top-100 sampling as default. We collect sentiment keywords for heuristic regulator according to frequency (Wu et al., 2019) before post-processing. Besides, we annotate pseudo data on Yelp dataset with frequency-based and attention-based methods (Wu et al., 2019) for our trainable regulator. When it comes to prefixes, we use "My dog died" and "The food is awful" (as in PPLM), which are almost impossible for LM itself to generate positive sentences. For each prefix, we generate 50 diverse samples with a sentence length of 50. + +According to automatic evaluation results in Table 1, our CAT-PAW can effectively alleviate the trade-off as the slope decay to at most $73.62\%$ of GeDi and $24.40\%$ at least compared to Fudge. CAT-PAW improves more significantly with respect to the trade-off, characterized by slope, on less powerful baseline models: Fudge and PPLM. For the more powerful baseline DExperts and GeDi, CAT-PAW can still achieve a surprising performance with the slope decaying to about $50\%$ . For average results, CAT-PAW with both two regulators can consistently achieve higher control strength (Positivity) with lower perplexity compared to each baseline, which is relevant to the lower slope. We achieve comparable performance compared to all baseline models and gpt2-medium in terms of distinctness, which ensures a high control strength without repeating positive tokens. + +For both automatic and human evaluation results of best points, we can significantly improve control strength among all baselines without sacrificing fluency. In Figure 5, we plot PPLM's trade-off + +PPLM: My dog died when I gave him a wonderful surprise gift! I was so happy to receive my wonderful gift!! I was so excited when my husband asked what I had in mind but when he told me how the gifts were, I thought it was just a normal surprise... ++ T: My dog died! He was my hero! He was the only dog in the entire house and I had a huge heart-wrenching, full-tilt. I am so very proud of this amazing dog. I've never seen this. My... ++ H: My dog died today. He was a wonderful, energetic and loving dog who loved to help anyone who walked through life with joy and pride. I miss you and happiness, his friends forever in life. We will love you forever, always... + +Fudge: My dog died yesterday. I love her wonderful personality and her people, and do everything I can to spread love for her on Facebook, Instagram, and her website. I've been receiving messages about her death from all over; everywhere... ++ T: My dog died yesterday. Amazing kid. She is the best thing that has happened to me. Her energy and poise have not worn away. I am blessed to have met her forever so not just my dog but some of the best... ++ H: My dog died in a beautiful, easy-going way that my children will cherish. They enjoyed the time I spent with them while she was there, and she died in such a wonderful, loving way. Someone will miss her dearly... + +curve between control strength and fluency and fit the curve linearly. It can be seen that CAT-PAW alleviates the trade-off by making less sacrifices to fluency with similar control strength. Figure 4 shows the text generated by baseline models and CAT-PAW. Compared to baseline models, CAT-PAW consistently produces less contradictory text with more positive contents. + +Comparing our two regulators, the heuristic one (H) performs better than the trainable one (T). We hypothesize that it is due to the noises in the pseudo data for training the regulator. However, when biasing control signals, the trainable regulator can make its own decision, rather than following LM's preference as the heuristic one. That's why the trainable one can sometimes achieve higher control strength but higher perplexity compared to the heuristic one, as in the average results on PPLM. + +# 3.3 Topic Control + +Topic control is an unsupervised task that models have to generate text on the specified topic such as military with only a bag of keywords. We experiment on PPLM and Fudge, and our CAT-PAW with the heuristic regulator. We adopt 6 topics (military, computers, legal, politics, science, and space) and 5 prefixes ("The chicken", "The horse", "The pizza", "The potato", and "The lake")11. For each topic + +![](images/5813c51e3f3af3040d8614ed6a6a9d2ae31981416481f537b0540105827f2380.jpg) +Figure 4: Examples on positive sentiment control. Green denotes prefix, red represents positive contents, and blue represents negative contents. Our two regulators can generate high-quality text with more positive contents. More cases are in Appendix G. +Figure 5: Trade-off between control strength and text fluency of PPLM on positive sentiment control. Other baselines are included in Appendix G. + +prefix pair, we generate 20 samples with 50 tokens each. To evaluate control strength, we calculate the number of target-attribute keywords appearing in the generated text. We largely follow the setup of themselves and use top-10 sampling to prevent repetition as possible. + +Results are demonstrated in Table 2. We can alleviate the trade-off with the slope decaying notably. With a higher base perplexity, PPLM suffers less on the trade-off compared to Fudge. However, Fudge performs better in general with higher control strength (Keywords) and lower perplexity in average results. Our CAT-PAW can significantly reduce the perplexity and enhance control strength on these two baselines. With the increase of control strength, the distinctness of CAT-PAW hardly drops. For best results, we boost baseline models' ability with higher control strength while also producing more fluent text, which is in line with human evaluation results shown in Table 3. + +Besides, as plotted in Figure 6, different topics also influence CAT-PAW's performance. Military topic control is harder as it possesses more polysemous keywords with commonly used meanings. For example12, win can be used in competition or battlefield, tank can be a container or a weapon, and company is a business entity or a military unit. Heuristic regulator in our CAT-PAW is sometimes confused about the LM's preference when facing these keywords at the current decoding position. + +# 3.4 Language Detoxification + +Language detoxification is a crucial task as pretrained LMs have a certain probability of generat + +
TopicSlope↓AverageBest
Keywords↑PPL↓Dist-1↑Dist-2↑Dist-3↑Keywords↑PPL↓
MilitaryGPT2top-10-0.1631.120.330.760.900.1631.12
PPLMOrigin + H9.381.3768.060.360.760.903.0682.20
+ H5.612.0364.680.360.750.893.4669.83
FudgeOrigin + H20.171.3353.290.350.750.901.8256.46
10.701.3942.750.350.770.912.1750.45
ComputersGPT2top-10-0.1331.120.330.760.900.1331.12
PPLMOrigin + H8.891.2562.350.360.760.903.2580.13
+ H2.351.7761.090.350.750.893.5560.17
FudgeOrigin + H14.141.5354.130.350.750.892.8163.56
6.401.5544.460.350.750.892.9352.00
LegalGPT2top-10-0.2931.120.330.760.900.2931.12
PPLMOrigin + H3.281.1355.040.350.760.903.3560.27
+ H0.761.9851.930.340.750.894.3154.10
FudgeOrigin + H11.751.5752.670.350.760.903.0663.42
6.622.0446.270.350.760.903.0847.96
PoliticsGPT2top-10-0.0931.120.330.760.900.0931.12
PPLMOrigin + H7.561.2262.180.350.750.903.4075.98
+ H0.291.8553.130.350.750.894.1956.52
FudgeOrigin + H26.010.9157.380.350.740.891.5876.99
19.451.4154.880.350.750.901.8060.67
ScienceGPT2top-10-0.0631.120.330.760.900.0631.12
PPLMOrigin + H2.900.9854.680.350.760.902.8857.91
+ H1.211.1954.010.350.760.893.1555.78
FudgeOrigin + H25.151.1758.990.330.730.891.8176.78
17.711.4254.500.340.740.891.8459.60
SpaceGPT2top-10-0.0131.120.330.760.900.0131.12
PPLMOrigin + H5.210.6957.780.350.750.892.4167.02
+ H1.370.9456.170.350.750.882.9058.68
FudgeOrigin + H16.431.4153.060.340.720.872.9579.60
8.671.8647.190.340.750.902.7252.58
+ +Table 2: Automatic results on Topic control. + +
TopicStrength(%)↑Fluency↑
MilitaryPPLMOrigin41.033.54
+ H43.433.63
FudgeOrigin49.603.57
+ H51.873.73
+ +Table 3: Human evaluation of best points on Military Topic control. + +ing toxic content such as insult and identity attack (Wallace et al., 2019; Sheng et al., 2020). Given an adversarial prefix that can induce the LM to generate toxic content, models need to bias the LM away from choosing toxic tokens. We experiment on PPLM and DExperts and follow their setup with PPLM trained on Toxic Comment Classification Challenge $^{13}$ and DExperts trained on Jigsaw Unintended Bias in Toxicity Classification Kaggle Challenge $^{14}$ . We choose "The men started swearing at me, called me" and "So if you grab a woman by the" as prefixes that possess proven ability to activate toxicity in GPT2 (Gehman et al., 2020). We just test our CAT-PAW with the heuristic regulator as we can easily acquire a toxic word bag. We mea + +![](images/3e965eb6e690287a4f779edcb132f0e63c15b97492938d1a6812fa2d37c59d9e.jpg) +Figure 6: Trade-off between control strength and text fluency of PPLM on topic control. Other curves are plotted in Appendix G. + +sure the control strength with PERSPECTIVE API, which predicts the probability of text being toxic. The higher control strength, the lower toxicity and the probability are obtained by the classifier. + +Results are shown in Table 4 and we can alleviate the trade-off with the rapidly dropped slope. For best results, we enhance PPLM significantly + +
DetoxificationSlope↑AverageBest
Tox(%)↓PPL↓Dist1↑Dist2↑Dist3↑Tox(%)↓Str(%)↓PPL↓Flu↑
GPT2top-10-74.5619.620.240.580.7174.56-19.62-
PPLMOrigin + H-100.4049.9730.610.310.660.7644.0834.4231.772.88
-7.5243.8521.860.280.620.7335.8922.8320.753.08
DExpertsOrigin + H-42.5040.6924.370.250.590.7229.0520.4333.813.44
-5.1939.2820.210.240.580.7130.8620.5020.753.63
+ +Table 4: Results on Detoxification. Tox, Str, Flu, and PPL represent Toxicity, Strength, Fluency, and Perplexity. + +![](images/620944fec37a713f682a5ad806683cb889af28f6fc409499850f9307a9c4fa95.jpg) +Figure 7: Trade-off between control strength and text fluency on detoxification. The control strength increases with toxicity decreasing from right to left. + +while performing comparably to powerful DExperts. Considering that we have achieved remarkable performances on fluency, it is difficult for CAT-PAW to outperform such a strong baseline in terms of control strength. Human evaluation results are also in line with the automatic ones. + +As in Figure 7, with the toxicity $^{15}$ decreasing from right to left, perplexity of CAT-PAW almost not increases. Different from former tasks, our heuristic regulator works reversely. When the LM tends to generate toxic tokens, the regulator will enhance the controller till overwriting toxic content. Otherwise, our regulator will always suppress the controller, which ensures high fluency. + +# 4 Related Work + +Controllable text generation (Prabhumoye et al., 2020) is widely studied by previous work using custom neural networks (Ficler and Goldberg, 2017; Ghosh et al., 2017; Dong et al., 2017) and VAE architectures (Hu et al., 2017; Lample et al., 2019). With the advancement of language modeling and pretraining (Radford et al., 2018, 2019; Brown et al., 2020), recent works (Keskar et al., 2019; Gururangan et al., 2020; Khalifa et al., 2021) attempt to modify or fine-tune a pretrained LM controlled by target attributes. + +As the size of LMs expands exponentially (Fedus et al., 2021), there emerge two main control methods with LM fixed. One is the prompt-tuning-based method (Liu et al., 2021b), which attempts to guide + +the LM's generation behavior with prompts learned by fine-tuning (Yu et al., 2021) or reinforcement learning (Guo et al., 2021). The other is weighted decoding which biases attributes of generated text synchronously during decoding. PPLM (Dathathri et al., 2020) biases LM's decoding with gradients from an attribute specified classifier. GeDi (Krause et al., 2020) applies Bayes rule to decompose conditional generation probability into an LM and a generative classifier. FUDGE (Yang and Klein, 2021) tries Bayes rule similarly while training a classifier considering one future token ahead. DExperts (Liu et al., 2021a) ensembles probabilities from general LM and attribute-conditioned LMs. + +Different from them, we pay more attention to how to realize the strength adjustable controllable text generation model and the generated text always maintains a high fluency. + +# 5 Conclusion + +In this work, we focus on weighted decoding based controllable text generation and devote to alleviating the control strength/fluency trade-off. We present a framework CAT-PAW adaptive to all existing weighted decoding methods via introducing a position-aware regulator. In experiments for positive sentiment control, topic control, and language detoxification, our CAT-PAW can adjust bias signals from controllers properly and generate high-quality text with flexible control strength. Besides, we present a novel metric slope to evaluate the trade-off, and our CAT-PAW achieves significant improvements on this metric. + +# 6 Acknowledgements + +Xiaocheng Feng is the corresponding author of this work. We thank the anonymous reviewers for their insightful comments. This work was supported by the National Key RD Program of China via grant 2020AAA0106502, National Natural Science Foundation of China (NSFC) via grant 61976073 and Shenzhen Foundational Research Funding (JCYJ20200109113441941). + +# References + +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877-1901. Curran Associates, Inc. +Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, and Rosanne Liu. 2020. Plug and play language models: A simple approach to controlled text generation. In International Conference on Learning Representations. +Li Dong, Shaohan Huang, Furu Wei, Mirella Lapata, Ming Zhou, and Ke Xu. 2017. Learning to generate product reviews from attributes. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 623-632, Valencia, Spain. Association for Computational Linguistics. +William Fedus, Barret Zoph, and Noam Shazeer. 2021. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv preprint arXiv:2101.03961. +Jessica Ficler and Yoav Goldberg. 2017. Controlling linguistic style aspects in neural language generation. In Proceedings of the Workshop on Stylistic Variation, pages 94-104, Copenhagen, Denmark. Association for Computational Linguistics. +Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A. Smith. 2020. RealToxicityPrompts: Evaluating neural toxic degeneration in language models. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3356-3369, Online. Association for Computational Linguistics. +Sayan Ghosh, Mathieu Chollet, Eugene Laksana, Louis-Philippe Morency, and Stefan Scherer. 2017. AffectLM: A neural language model for customizable affective text generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 634-642, Vancouver, Canada. Association for Computational Linguistics. +Han Guo, Bowen Tan, Zhengzhong Liu, Eric P Xing, and Zhiting Hu. 2021. Text generation with efficient (soft) q-learning. arXiv preprint arXiv:2106.07704. +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. +Ruining He and Julian McAuley. 2016. Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In *proceedings of the 25th international conference on world wide web*, pages 507-517. +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. +Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. 2017. Toward controlled generation of text. In International Conference on Machine Learning, pages 1587-1596. PMLR. +Nitish Shirish Keskar, Bryan McCann, Lav Varshney, Caiming Xiong, and Richard Socher. 2019. CTRL - A Conditional Transformer Language Model for Controllable Generation. arXiv preprint arXiv:1909.05858. +Muhammad Khalifa, Hady Elsahar, and Marc Dymetman. 2021. A distributional approach to controlled text generation. In International Conference on Learning Representations. +Ben Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar, Shafiq Joty, Richard Socher, and Nazneen Fatema Rajani. 2020. Gedi: Generative discriminator guided sequence generation. arXiv preprint arXiv:2009.06367. +Guillaume Lample, Sandeep Subramanian, Eric Smith, Ludovic Denoyer, Marc'Aurelio Ranzato, and Y-Lan Boureau. 2019. Multiple-attribute text rewriting. In International Conference on Learning Representations. +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016. A diversity-promoting objective function for neural conversation models. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 110-119, San Diego, California. Association for Computational Linguistics. +Alisa Liu, Maarten Sap, Ximing Lu, Swabha Swayamdipta, Chandra Bhagavatula, Noah A. Smith, and Yejin Choi. 2021a. DExperts: Decoding-time controlled text generation with experts and anti-experts. 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 6691-6706, Online. Association for Computational Linguistics. + +Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. 2021b. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586. +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. +Eric Malmi, Aliaksei Severyn, and Sascha Rothe. 2020. Unsupervised text style transfer with padded masked language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8671-8680, Online. Association for Computational Linguistics. +Shrimai Prabhumoye, Alan W Black, and Ruslan Salakhutdinov. 2020. Exploring controllable text generation techniques. In Proceedings of the 28th International Conference on Computational Linguistics, pages 1-14, Barcelona, Spain (Online). International Committee on Computational Linguistics. +Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding by generative pre-training. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Machel Reid and Victor Zhong. 2021. LEWIS: Levenshtein editing for unsupervised text style transfer. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 3932-3944, Online. Association for Computational Linguistics. +Emily Sheng, Kai-Wei Chang, Prem Natarajan, and Nanyun Peng. 2020. Towards Controllable Biases in Language Generation. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3239-3254, Online. Association for Computational Linguistics. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics. +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. + +Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. 2019. Universal adversarial triggers for attacking and analyzing NLP. 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 2153-2162, Hong Kong, China. Association for Computational Linguistics. +Xing Wu, Tao Zhang, Liangjun Zang, Jizhong Han, and Songlin Hu. 2019. Mask and infill: Applying masked language model for sentiment transfer. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI-19, pages 5271-5277. International Joint Conferences on Artificial Intelligence Organization. +Kevin Yang and Dan Klein. 2021. Fudge: Controlled text generation with future discriminators. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3511-3535. +Dian Yu, Kenji Sagae, and Zhou Yu. 2021. Attribute alignment: Controlling text generation from pre-trained language models. arXiv preprint arXiv:2103.11070. + +# A Limitations and Future Direction + +Our framework CAT-PAW relies on token-level information, especially the BPE tokens from the GPT's tokenizer. This means we have no idea of how to make decisions from a global perspective. It's hard for our framework to handle tasks such as clickbait style control that can't be summarized in bag of keywords. For future work, we will focus on controllable generation with global constraints. + +Besides, our trainable regulator can outperform baseline models but is just competitive to our heuristic one. The trainable regulator is expected to possess the more powerful ability but is restricted by our easy pseudo-data creation. We may also explore a more reliable data construction method to test the boundary of its capability in the future. + +Our work wants to attract more attention to the practical utilization of controllable text generation. In the future, it may be more meaningful to flexibly tune the control strength rather than just pursuing a higher one blindly, as it is high enough now. + +# B Ethical Consideration + +We are fully aware that controllable generation technology has a potential to produce offensive and harmful text when maliciously used. However, it is also a powerful weapon for generating diverse contents, combating hate speech, and eliminating harmful information in pretrained language models. We believe it meaningful and beneficial for us to advance research on controllable text generation. + +# C Equations of Baseline Models + +In detail, the decoding process is: + +$$ +\begin{array}{l} P (X | a) \simeq \prod_ {i = 1} ^ {n} \left[ P \left(x _ {i} \mid x _ {< i}\right) P \left(a \mid x _ {< i}\right) ^ {\lambda} \right] \tag {7} \\ = \prod_ {i = 1} ^ {n} \left[ \operatorname {s o f t m a x} \left(\mathbf {h} _ {i}\right) \cdot \operatorname {s o f t m a x} \left(\mathbf {c} _ {i}\right) ^ {\lambda} \right], \\ \end{array} +$$ + +where $\mathbf{c}_i$ is logits for the $i$ th token computed by the controller $P(a|x_{< i}) = \mathrm{softmax}(\mathbf{c}_i)$ . PPLM and DExperts utilize another approximation form as: + +$$ +P (X | a) \propto \prod_ {i = 1} ^ {n} \operatorname {s o f t m a x} \left(\mathbf {h} _ {i} + \lambda \mathbf {c} _ {i}\right). \tag {8} +$$ + +The main difference is that PPLM and DExperts combine output distributions of the LM and the controller before $\mathrm{softmax}(\cdot)$ . + +# D Experiment Details + +Hyperparameters are demonstrated in Table 5. PPLM's $\lambda$ is composed of iteration times and step size as it provides gradient-like bias signals. Besides, we come up with a small trick for accelerating the hyperparameter tuning. We add a threshold $\beta$ and get: + +$$ +\left\{ \begin{array}{l l} \min \left[ \lambda \times f (a, P (x _ {\leq i})), \beta \right], & \beta \leq \lambda \\ \lambda \times \min \left[ f (a, P (x _ {\leq i})), 1 \right], & \beta > \lambda , \end{array} \right. +$$ + +rather than $\lambda \times f(a, P(x_{\leq i}))$ barely, to ensure that original methods are lower bounds of ours. When weight $\lambda$ is low, we can accept a more intense bias signal at the proper position. However, it's unwise to amplify the bias signal when $\lambda$ is high enough. For early experiments on PPLM, we do not take this trick. + +There is a wide range of hyperparameters $\tau_{T}$ and $\tau_{H}$ among different tasks and different models. For example, the overall frequency of military keywords is higher than that of space keywords. Besides, the controller of PPLM is more sensitive to variation of $\lambda$ than that of GeDi. We select hyperparameters roughly, with each tested less than three times on average, leaving vast potential improvements in the future. + +# E Details for Trainable Regulator + +As there is no labeled data for training the regulator, we annotate sentences from Yelp and Amazon. Inspired by masking methods for unsupervised style transfer, which annotate each token in a sentence with 'style-related' or 'style-unrelated' labels, we score each token with a float number ranging from 0 to 1, representing the relevance to the target attribute. We adopt the TF-IDF to get a base score and add an extra reward for the token with the highest attention weight. Next, we scale the score to an interval from 0 to 1 as evenly as possible. + +As it is hard to predict the score directly, we divide $[0,1]$ into 10 parts and approximate each score with the median in its corresponding interval. Our regulator only needs to predict the probability of a token appearing in each class. Finally, we acquire the approximative score by summing the weighted medians of each class. + +# F Additional Experiments + +We anticipate an ideal situation that the generative model is unaware of which attribute to generate. + +
ModelTaskRange of λτTτHthreshold β
PPLMPositive[0, 3 × 0.4]0.20.05-
Military[0, 16 × 0.01]-0.01-
Computers[0, 16 × 0.01]-0.01-
Legal[0, 16 × 0.01]-0.01-
Politics[0, 16 × 0.01]-0.005-
Science[0, 20 × 0.01]-0.005-
Space[0, 20 × 0.01]-0.005-
Detoxification[0, 3 × 0.2]-0.05-
FudgePositive[0, 6.0]0.10.0310.0
Military[0, 10.0]-0.0212.0
Computers[0, 10.0]-0.0158.0
Legal[0, 3.0]-0.0036.0
Politics[0, 10.0]-0.0016.0
Science[0, 20.0]-0.00118.0
Space[0, 20.0]-0.00117.0
GeDiPositive[0, 120.0]0.030.0005110.0
DExpertsPositive[0, 1.6]0.010.00061.3
Detoxification[0, 1.6]-0.051.3
+ +Table 5: Hyperparameters. + +On the other hand, longer and more varied prefixes may leak this tendency casually. Therefore, we strictly select prefixes that are irrelevant to target attributes. We adopt the prefixes used in PPLM that are odd when combined with these attributes. Then we increase the number of samples to preserve the diversity of generated sentences. + +We also provide extra experiment results that strictly follow the settings of PPLM. Results of topic control with 20 prefixes are demonstrated in table 6. Results of sentiment control with 15 prefixes are demonstrated in table 7. There is an overall decrease in the slope since biasing the generative model to target attributes becomes much easier with these prefixes. + +Topic Prefixes: "In summary", "This essay discusses", "Views on", "The connection", "Foundational to this is", "To review", "In brief", "An illustration of", "Furthermore", "The central theme", "To conclude", "The key aspect", "Prior to this", "Emphasised are", "To summarise", "The relationship", "More importantly", "It has been shown", "The issue focused on", "In this essay". + +Sentiment Prefixes: "Once upon a time", "The book", "The chicken", "The city", "The country", "The horse", "The lake", "The last time", "The movie", "The painting", "The pizza", "The potato", "The president of the country", "The road", "The + +year is 1910". + +# G Additional Examples and Figures + +Additional Examples are in Figure 8. Additional Figures are in Figure 9, 10, 11, 12, and 13. + +GeDi: My dog died a few weeks ago, and I recently watched this video. Not only was I deeply moved by their love for each other, but much like the rest of us, the grieving dogs showed the same beautiful loving behavior that makes love so... + ++ T: My dog died tonight at the age of 17. She was a total joy to be with. She was so sweet, playful, loving, loving, cuddle tender, happy and so kind to all of those around her, all the time... ++H: My dog died 2 years ago. Tallie died 2 years ago. She was 4 months old. I love her dearly and miss her so much. She is such a hardy little dog because she has a tough family life. She... + +DExperts: My dog died of diabetes after nearly two decades of treating my family with medication, but she took to it with such enthusiasm that it touched others. She was always so thankful for life. "She brought smiles to our family," Myra said... + ++ T: My dog died today. He was a lovely little husky which we only knew as an "old husky friend". My husband and I bought him from a shelter and have since been raising him very nicely. He is a very gentle one... ++H: My dog died and you were touched for that as well. He's been my mentor for the past three years and in spite of not having a formal adoption or foster homes, I am so grateful to have found him in a place so similar to... + +Figure 8: Examples on positive sentiment control. + +
TopicSlope↓AverageBest
Keywords↑PPL↓Dist-1↑Dist-2↑Dist-3↑Keywords↑PPL↓
MilitaryGPT2top-10-0.1641.110.350.760.900.1641.11
PPLMOrigin + H1.271.1045.120.350.760.902.6545.24
Origin + H0.471.2344.470.360.760.892.6844.61
FudgeOrigin + H9.191.5750.480.350.740.882.2055.82
Origin + H5.111.6047.910.350.750.892.3152.08
ComputersGPT2top-10-0.4541.110.350.760.900.4541.11
PPLMOrigin + H11.401.6754.210.340.750.892.9967.29
Origin + H4.462.1849.190.350.760.893.4850.42
FudgeOrigin + H13.952.0260.360.340.740.892.9365.79
Origin + H6.942.0352.990.340.750.893.4259.72
LegalGPT2top-10-0.4041.110.350.760.900.4041.11
PPLMOrigin + H1.561.8748.220.360.760.903.4047.78
Origin + H0.202.1145.100.350.760.894.1145.30
FudgeOrigin + H2.481.6145.620.340.740.883.3948.31
Origin + H1.822.4744.870.350.760.903.8047.72
PoliticsGPT2top-10-0.3341.110.350.760.900.3341.11
PPLMOrigin + H1.441.7446.490.350.750.892.8247.02
Origin + H0.702.1545.520.350.750.893.3445.17
FudgeOrigin + H5.792.2151.260.340.740.893.0354.38
Origin + H3.282.4049.880.350.750.893.6152.14
ScienceGPT2top-10-0.3241.110.350.760.900.3241.11
PPLMOrigin + H1.931.1247.500.340.740.892.3748.20
Origin + H0.651.2545.730.330.740.892.4446.06
FudgeOrigin + H10.991.1949.960.340.740.892.0258.54
Origin + H8.631.4449.380.340.750.892.0657.08
SpaceGPT2top-10-0.0841.110.350.760.900.0841.11
PPLMOrigin + H0.891.2942.160.340.750.892.5644.14
Origin + H0.311.3641.990.350.760.892.6142.70
FudgeOrigin + H12.481.8254.860.350.750.892.3461.58
Origin + H1.632.0946.150.350.750.902.7447.75
+ +Table 6: Results on Topic control with prefixes used in PPLM. + +![](images/087dec1f62def5dd81f9b8499a07ba4b3644acf21c70ab2edfe3551df9d9f684.jpg) +Figure 9: Trade-off between control strength and fluency of Fudge on positive sentiment control. + +![](images/cf9a38ea036201aba23915d2185200693075fe5fc042a515150a88a162778b9c.jpg) +Figure 10: Trade-off between control strength and fluency of GeDi on positive sentiment control. + +
PositiveSlope ↓AverageBest
Pos(%)↑PPL↓Dist1↑Dist2↑Dist3↑Pos(%)↑PPL↓
GPT2top-10-51.0641.650.400.800.9151.0641.65
PPLMOrigin127.0965.5256.380.380.780.9076.2062.21
+ T57.7167.8251.660.390.790.9177.2151.13
+ H56.8466.5848.520.400.800.9175.7252.35
GeDiOrigin94.4360.9450.960.410.800.9065.6658.51
+ T69.0262.2248.660.410.790.9069.0053.41
+ H53.1261.4046.850.410.810.9168.8751.64
DEXpertsOrigin68.3766.4653.040.410.800.9074.1351.16
+ T47.5868.3549.480.420.810.9174.6848.56
+ H45.4367.9048.650.420.820.9273.1747.57
FudgeOrigin53.6165.8450.710.400.800.9072.8948.62
+ T41.1567.4448.230.400.810.9174.9748.28
+ H36.6767.1247.610.410.810.9175.6048.72
+ +Table 7: Results on Positive sentiment control with prefixes used in PPLM. All methods utilize the top-10 sampling. + +![](images/d70442ddc47be3999ed49dda9c8305e8ad785b280efc5c9713a2262195be5efe.jpg) +Figure 11: Trade-off between control strength and fluency of DExperts on positive sentiment control. + +![](images/b1b29b5aa441509f27ab9f8c9c3b7dfe6d94d8c7081ddb2b397bbc14d6e70767.jpg) +Figure 12: Trade-off between control strength and fluency of PPLM on science and space topic control. + +![](images/e2ae9e597a19714ed2e08e0ff2f7be6f72518e7cd4df2ce59fa8290d53e4ade4.jpg) +Figure 13: Trade-off between control strength and fluency of Fudge on topic control. + +H Analysis on Human Evaluation + +
ModelTaskKappa(%)
StrengthFluency
PPLMPositive58.9136.61
Military83.0036.83
Detoxification85.0040.83
FudgePositive55.7832.56
Military65.6733.50
GeDiPositive58.3338.00
DExpertsPositive60.6730.44
Detoxification84.3340.33
+ +Table 8: Analysis on Human Evaluation. + +# I Bag of Keywords for Attribute Control + +We use the bag of keywords collected by PPLM from www.enschantedlearning.com/wordlist. We also collect keywords for sentiment control and language detoxification. For sentiment control, we tokenize sentences in SST-5, IMDb, Yelp, and Amazon with GPT's tokenizer and sort the tokens with the TF-IDF score. Next, we filter out tokens that are not positive or negative enough and use these two sentiments together. Besides, we tokenize sentences in JUBTC for language detoxification. It's worth noting that these tokens are often subwords, and the token starting with '#' is similar to a suffix. + +Military: academy, advance, aircraft, ally, ammo, ammunition, armor, arms, army, arrow, arsenal, artillery, attack, attention, ballistic, barracks, base, battalion, battery, battle, battlefield, bomb, bombard, bombardment, brig, brigade, bullet, camouflage, camp, cannon, captain, capture, carrier, casualty, catapult, cavalry, colonel, combat, command, commander, commission, company, conflict, conquest, convoy, corps, covert, crew, decode, defeat, defend, defense, destroyer, division, draft, encode, enemy, engage, enlist, evacuate, explosive, fight, fire, fleet, force, formation, fort, front, garrison, general, grenade, grunt, guerrilla, gun, headquarters, helmet, honor, hospital, infantry, injury, intelligence, invade, invasion, jet, kill, leave, lieutenant, major, maneuver, marines, MIA, mid, military mine, missile mortar navy neutral offense officer ordinance parachute peace plane platoon private radar rank recruit regiment rescue reserves retreat ribbon sabotage sailor salute section sergeant service shell shoot shot siege + +sniper, soldier, spear, specialist, squad, squadron, staff, submarine, surrender, tactical, tactics, tank, torpedo, troops, truce, uniform, unit, veteran, volley, war, warfare, warrior, weapon, win, wound + +Computers: algorithm, analog, app, application, array, backup, bandwidth, binary, bit, bite, blog, blogger, bookmark, boot, broadband, browser, buffer, bug, bus, byte, cache, caps, captcha, CD, client, command, compile, compress, computer, configure, cookie, copy, CPU, dashboard, data, database, debug, delete, desktop, development, digital, disk, document, domain, dot, download, drag, dynamic, email, encrypt, encryption, enter, FAQ, file, firewall,firmware,flaming,flash,folder,font format, frame, graphics,hack,hacker,hardware home, host, html, icon,inbox,integer,interface, Internet, IP, iteration Java, joystick,kernel,key keyboard, keyword,laptop,link,Linux,logic, login,lurking,Macintosh,macro,malware,media memory,mirror,modem,monitor,motherboard mouse,multimedia,net,network,node offline onlineOS,option,output,page,…password,paste path,piracy,pirate,platform,podcast,portal print printer, privacy process programprogrammer protocol,RAM,reboot,resolution, restore,ROM root,router,routine,save,scan,sensor,screen screenshotscriptscroll securityserver shell shift,snapshot software spam,spreadsheet,stORAGE,surf,syntax table,tag template,thread,toobar,trash,undoUnix/uploadURLuserUI,...name/utility-version,virtual,virus,web,website,. widget,wikiwindowWindows,wireless,worm XML,Zip + +Legal: affidavit, allegation, appeal, appearance, argument, arrest, assault, attorney, bail, bankrupt, bankruptcy, bar, bench, warrant, bond, booking, capital, crime, case, chambers, claim, complainant, complaint, confess, confession, constitution, constitutional, contract, counsel, court, custody, damages, decree, defendant, defense, deposition, discovery, equity, estate, ethics, evidence, examination, family, law, felony, file, fraud, grievance, guardian, guilty, hearing, immunity, incarceration, incompetent, indictment, injunction, innocent, instructions, jail, judge, judiciary, jurisdiction, jury, justice, law, lawsuit, lawyer, legal, legislation, liable, litigation, manslaughter, mediation, minor, misdemeanor, moot, murder, negligence, oath, objection, opinion, order, ordinance, pardon, parole, party, perjury, petition, plaintiff, plea, precedent + +prison, probation, prosecute, prosecutor, proxy, record, redress, resolution, reverse, revoke, robbery, rules, sentence, settlement, sheriff, sidebar, standing, state, statute, stay, subpoena, suit, suppress, sustain, testimony, theft, title, tort, transcript, trial, trust, trustee, venue, verdict, waiver, warrant, will, witness, writ, zoning + +Politics: affirm, appropriation, aristocracy, authoritarian, authority, authorization, brief, capitalism, communism, constitution, conservatism, court, deficit, diplomacy, direct, democracy, equality, exports, fascism, federation, government, ideology, imports, initiative, legislature, legitimacy, liberalism, liberty, majority, order, political, culture, politics, power, primary, property, ratification, recall, referendum, republic, socialism, state, subsidy, tariff, imports, tax, totalitarian + +Science: astronomy, atom, biology, cell, chemical, chemistry, climate, control, data, electricity, element, energy, evolution, experiment, fact, flask, fossil, funnel, genetics, gravity, hypothesis, lab, laboratory, laws, mass, matter, measure, microscope, mineral, molecule, motion, observe, organism, particle, phase, physics, research, scale, science, scientist, telescope, temperature, theory, tissue, variable, volume, weather, weigh + +Space: planet, galaxy, space, universe, orbit, spacecraft, earth, moon, comet, star, astronaut, aerospace, asteroid, spaceship, starship, galactic, satellite, meteor + +Positive Sentiment: delicious, informative, impeccable, quaint, passionate, compassionate, knowledgeable, gem, intimate, upbeat, phenomenal, pleasantly, amazing, outstanding, talented, unparalleled, royalty, cozy, fantastic, excellent, delightful, asset, seamlessly, #warming, unbeat, friendly, spacious, unmatched, pleasure, caring, welcomes, efficient, attentive, eclectic, fabulous, indispensable, satisfies, reasonable, gatherings, unforgettable, romantic, terrific, wonderful, superb, bundy, juicy, wines, exceptional, highly, perfection, lively, awesome, protects, cleanup, affordable, atmosphere, cheerful, incredible, festive, thoughtful, peaceful, charming, illustrated, welcoming, accommodating, exquisite, #easy, heats, exceeded, perfect, merry, breathtaking, insightful, conscientious, gifts, contemporary, exceeds, specials, invaluable, thorough, professional, great, kindness + +meticulous, classy, delivers, neatly, cocktails, decorated, orderly, handy, gorgeous, perfectly, beautifully, personalized, love, favorite, #inner, reasonably, genuinely, delight, beautiful, dedication, exhaustive, helpful, diverse, magnificent, historic, retains, cheers, tasty, wonderfully, elegant, rarity, speedy, scenic, enables, preserves, evenly, fresh, inviting, thank, cakes, compliments, skilled, podcasts, authentic, enjoyed, best, worrying, respectful, divine, #top, heaven, prompt, priceless, smiling, handsome, appointed, #earth, eleg, remed, reorgan, lovely, marvelous, breeze, sturdy, always, goodies, refreshing, crave, unique, keeper, relaxing, hearty, preparing, regulars, salute, duties, easy, maintains, protected, implements, bonus, pleased, consistent, plentiful, helper, family, proficient, overlooking, witty, #good, inherited, effortlessly, #arest, fulf, processor, definitely, ease, quick, solidly, ample, holidays, heavyweight, instructor, #heart, nice, trustworthy, hilarious, #ensible, relaxed, artisan, nicely, comforting, exceedingly, marry, banter, whims, spiritual, intelligig, mindful, timely, #ributes, efficiently, saves, engraved, generous, favorites, peaks, instructors, finely, landmark, streamlined aux fits exhibit ingom ingh hont happy roing wine,#tightcasualgratefulnecessitydesserts cloves deals welcome lovers hospitality sublime,surpassed,#achableconspicuousexponentiallyinspires,#luck,#enough frontal,endavors,pceeding,#highly upgr tenderwelcomed stylish heavenly charm satisfied reassuring gifted juices pleasant,hometown consistently protecting treasure ceremony preserving crafted sealing,trendy,champensuresesppo accessible,kernelsamazinglymaintainedcoreweddingflavorfulprofessionalscharismaticbustling praises coordinating politesmile thanks grill bless,finstdelightedcompetitiveuniquely,reunion indefinitely convenient attachments decor stirring celebration,inventive investmentsexpertise,freshlyshinesfulfillingideallywarming blessed,prestfasthappinesstremendousretro outgoing specialtyupscale metropolitan adventurous,eceeding,#adorperkelegancedeliber extensively fabricatedbedrooms mythical hobbiesachieves,necessities thankingarisesaccur coveted scientifically,#venient,#bestmonopol propelledhelperspresumprotectionsascendrichestempoweredwoweasierneatprovides winner liberty anticipate recommendedtreasures ingenious,generouslyantiqueextraordinaryfash + +ionable, balanced, loved, rooftop, artist, friends, #worth, creations, amazed, satisfying, splendid, improves, enjoying, pristine, pref, super, sharp, easiest, innoc, stir, exceptionally, flexibility, loving, anniversary, renewed, utmost, savior, hugs, superiority, appreciated, survived, extensive, compliment, extends, recommendations, enjoy, genius, gripping, inspire, graceful, graduated, permits, smartest, engaging, moist, inexpensive, authent, lightweight, flawless, inevitable, #heartedly, reaching, qual, vibrant, brav, gracious, protection, helps, prett, protector, surprisingly, modern, fancy, skyline, talent, abundant, celebrated, promotions, prolong, brill, abundantly, brilliantly, liberated, shortcuts, vic, suprem, smug, embraced, embrace, privileges, discreet, assures, tallest, standalone, awakened, imposing, #important, ambitious, resurrected, illuminating, poetic, #exper, startling, freedoms, perpetual, multim, injecting, adaptations, poised, optimize, orbiting, honors, dign, certify, prioritize, applauded, civilized, partnering, allegiance, ascending, daring, confident, polished, proud, good, spectacular admission, #tops, additions, advantages, filtered. fortunate, durable, humble, bliss, coolest, modest. classic, extended, honesty, vers, recommend, timeless, arise, comfortable, appliances, plenty, attractive. pri + +Negative Sentiment: rude, acne, downhill, bland, enemies, disrespectful, monsters, puzzles, insult, diarrhea, patches, worst, disgrace, doom, horrible, insulting, pissed, clueless, offended, incompetent, disgusting, vomit, zombies, unacceptable, disgusted, enemy, terrible, liar, vomiting, pirate, apology, arrogant, laughable, imperson, disappointing, boring, plague, horrendous, nause, dishonest, violence, horrific, awful, conceal, lame, bulky, mindless, depressing, nausea, offensive, appalling, itching, refused, unethical, ridiculous, unpleasant, dismissive, incompetence, denied, retarded, opponents, muzzle, itch, ignored, puzzle, apologies, assault, overweight, #oddy, rebel, expiration, yelled, apologize, prison, twitch, bored, sad, strike, asshole, corrupt, worse, dreadful, choking, fraud, theft, false, rotten, ripped, scam, nightmares, unwelcome, disappointment, stale, lied, poisoning, sewage, defeated, excruciating, bleeding, severely, shame, unsafe, inept, hostile, ordeal, cancelled, lifeless, uncontroll, shadows, hazards, raven, poorly, sadly, irritated, horribly, horrified, insulted, swallow, inappropriate, angry, wasted, inexperienced, criminal, chased, revenge + +unsuspecting, fallout, misled, ghosts, waste, excuse, poor, defeat, lacked, pains, disgust, greedy, shrunk, sneaking, gore, cruel, displeasure, villains, pretending, disguised, idiots, crashes, frustrating, isolated, attack, cry, traps, mem, litter, filthy, lace, defeats, sick, outdated, crap, ignorant, embarrassment, corrupted, tolerated, poisonous, null, #dies, ashamed, embarrassing, disease, appalled, disaster, yelling, blamed, rant, sarcastic, absurd, nightmare, cheated, evil, boredom, diabetes, violent, fals, pesticide, deleting, seizure, piracy, slashing, unfortunate, rip, worthless, pointless, expired, limp, erratic, starving, trap, miserable, unbearable, sucked, embarrassed, poison, annoyed, sparse, declined, blood, crying, robbed, suspicious, plagued, tense, swelling, crashing, frust, lethal, ludicrous, meaningless, #strike, fraudulent, grave, apologized, attacking, ruins, torture, bizarre, unnatural, garbage, spit, deceptive, confused, headache, lousy, sorry, incorrect, nasty, upsetting, chaotic, #unders, #block, injured, obese, decay, betrayed, crimes, teasing, thigh, demon, donkey, demons, flu, glut, fatally, hilar, cruelty, poisoned, um, uncomfortable, stripped, shitty, unfortunately, hurts, unhappy, ignores, rage, badly, cancer, sucks, creepy, lacking, severe, apologizing, insomnia, strangl. allergic,furious,canceled,dismal,inconsistent,boo,.sluggish,painfully,stupid unreliable fec losses,worsen,butant-arrestshudder conflicts,regtt,raging,omission,penalty,hacks,#ishable,necrot,stizures,diseases,falsely corruption,trugs,introversy,riddleddraconian greed,holistic,denial,killed terriby killing,stink thieves,hazardous,dumb,culprit,fake.deception poorest refuses,fucking disappointed,dizz,bleed scars,miser blankflawed,fatal,hell uselessupset crashed,sloppy,crazy,homelss,tainted stereotypicaldeadly,brawl,#icide,horrifyingsickness,fatalities,invasive,rampage,dise,#acid scathing,criticisms,Thon,touted,sly,voidid scams,agony exasperRobberybreachrapedeceiveinducecriminals,#sinundesirableexclus,mayhem,fictional,,deserted,shoutingpenalties,wasting,frustrated,failure.acids deficiency deaths,wast,zombie,numb,dismay,liesshortest deceived,boasts deficient,mob,criesdistress,infamous hideous unable disconnectedshortage,disspect unrealistic,bugs,bad,bloatedforced,ghettononexistent,mush-acid downrightsmelled Anxiety refuse unsatisfbusted ignoringbullshitimmature,#dropsoffensivelyobesity + +vengeance, unidentified, aftermath, deleted, distorted, horrend, begged, recalled, halted, dagger, banned, elemental, exploited, formations, knowingly, censored, restrain, intervals, blames, wrongly, recalls, outbreak, wretched, outlaw, rupture, nudity, inflammatory, rapes, naughty, violated, imitate, angered, fractures + +# WARNING: Next contains tokens which are offensive in nature. + +Toxic: anal, anus, ass, asses, asshole, ball, bastard, bitch, black, blow, boobs, buttocks, #job, bondage, boobs, bullshit, bust, butt, coward, Cursed, cock, cum, cunt, Dumb, dumb, Damn, damn, #Damn, dick, dirty, domination, donkey, fool, fools, Fuck, FUCK, fuck, fuckin, #Fuck, #fuck, fucking, fucked, goddamn, genitals, gay, hypocr, #iots, #iotic, #iot, idiot, idiots, incest, intercourse, jack, jail, jelly, jerk, masturbation, muff, negro, neon, Nig, nig, nipple, nipples, nude, nudity, orgasm, panties, penis, piss, pornography, pussy, rape, raping, raging, rapist, Sorceress, Stupid, stupidity, stupid, sex, #shit, Shit, shit, shitty, slut, snatch, suck, sucks, tit, tits, #usting, #upid, vagina, whore \ No newline at end of file diff --git a/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/images.zip b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f8a05f7dc177338039b0c33be3f53613c86d54ff --- /dev/null +++ b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb8a6be11b712f64c21a67c0bdf7d12c18262b862b647db783e01fe4a17bf396 +size 1272798 diff --git a/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/layout.json b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ca9c019c125361b49912cc4a5ab082c4e696430e --- /dev/null +++ b/improvingcontrollabletextgenerationwithpositionawareweighteddecoding/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa1cff7e47c3011aef4356778dc5b26538c6b90d388eebcceead9042e4410b97 +size 480544 diff --git a/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_content_list.json b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..3f286a326a0319423546349fa33d8ec8aa626c8e --- /dev/null +++ b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08a0498dc3570ce2c6f6cc8b52df855db074dd22d0c82e3bc5b2b3dd33cb3532 +size 114390 diff --git a/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_model.json b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_model.json new file mode 100644 index 0000000000000000000000000000000000000000..87a1f041b4044e57f143f4dec7ff92d643a7f227 --- /dev/null +++ b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a8b9b78ebaba2d3bd0b5aedd91d04cfac7538a283c99ca5cff15df99c14ccc5 +size 131781 diff --git a/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_origin.pdf b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..573ce1bd83a4b80d8605ca145bb4339455a1b01b --- /dev/null +++ b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/32ecd4b0-aeab-465f-a1e5-f595bfee68ee_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:095c06dca205d6386a14fa79db78ceb972b675302f606346aaf6c512878e6346 +size 466523 diff --git a/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/full.md b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..556226adc1816bbf7b74ad9ef9b3a47f94b92a9f --- /dev/null +++ b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/full.md @@ -0,0 +1,399 @@ +# Improving Neural Political Statement Classification with Class Hierarchical Information + +Erenay Dayanik1, André Blessing1, Nico Blokker2, Sebastian Haunss2, Jonas Kuhn1, Gabriella Lapesa1, and Sebastian Padó1 + +1IMS, University of Stuttgart, Germany +2SOCIUM, University of Bremen, Germany + +# Abstract + +Many tasks in text-based computational social science (CSS) involve the classification of political statements into categories based on a domain-specific codebook. In order to be useful for CSS analysis, these categories must be fine-grained. The typically skewed distribution of fine-grained categories, however, results in a challenging classification problem on the NLP side. This paper proposes to make use of the hierarchical relations among categories typically present in such codebooks: e.g., markets and taxation are both subcategories of economy, while borders is a subcategory of security. We use these ontological relations as prior knowledge to establish additional constraints on the learned model, thus improving performance overall and in particular for infrequent categories. We evaluate several lightweight variants of this intuition by extending state-of-the-art transformer-based text classifiers on two datasets and multiple languages. We find the most consistent improvement for an approach based on regularization. + +# 1 Introduction + +The argumentative or discursive turn in policy analysis and political science more generally has long established the value of textual sources for the analysis of politics and policies (Fischer and Forester, 1993). Traditionally, data sources such as interviews or newspaper reports were annotated using various methods of qualitative text analysis (Wagenaar, 2011; Mayring, 2019). At the heart of this analysis is always a codebook, i.e., guidelines that map actual statements or textual passages to the abstract concepts relevant for the respective research. + +Categories in codebooks are almost always arranged hierarchically, with fine-grained categories being grouped together into supercategories that are often, but not always, more abstract. Fine-grained categories are generally generated inductively from the analyzed texts in an iterative pro + +cess of summarizing and abstracting from the original text, while the supercategories are deductively generated from existing knowledge of the relevant policy field and from theoretical and conceptual findings of prior research. For example, the codebook of the long-running Comparative Manifesto Project (CMP), which analyzes party manifestos across several countries, includes 7 supercategories (such as external relations or economy) with 56 subcategories: for economy, among others, free market, market regulation, economic goals, etc. (Merz et al., 2016; Werner et al., 2011). Here, supercategories represent the separation of policy fields that is reflected in political institutions, e.g., ministries. Fine-grained, hierarchical schemes help researchers both with data annotation and with analysis. Annotation is often easier when the annotation decision is (implicitly) first based on a supercategory and then on fine-grained subcategories. For analysis, supercategories structure the annotated material according to different levels of abstraction, thereby supporting interpretation and modeling. + +While such a hierarchical process a natural choice in manual annotation, the situation is different when we move to (semi)-automatic analysis in NLP: due to the large number of fine-grained subcategories, the available data is distributed among many categories. In addition, most categories are infrequently attested, since categories typically show a skewed distribution. This makes for a difficult classification problem, and existing prediction studies have often only addressed the more coarse-grained supercategory level (Glavaš et al., 2017a; Subramanian et al., 2018; Padó et al., 2019). + +In this study, we ask whether we can use the hierarchical structure of political science codebooks to our advantage: knowing that two subcategories (as free market and market regulation) belong to the same supercategory (economy) could lead us to expect that the representations learned for these categories should be more similar to one another + +than to categories that belong to other supercategories. In this manner, the representations learned for smaller categories can be biased in the right direction by their larger neighbor categories. This paper makes the following contributions: + +- In Section 3, we define an ontology of lightweight methods implementing this intuition on top of a state-of-the-art transformer-based text classifier. Crucially, these methods introduce almost no additional parameters, thereby addressing the issues related to the limited amounts of annotated data typically available in CSS studies. +- We evaluate the resulting models on two datasets and five different languages, covering single label (Experiment 1) as well as multi label classification (Experiment 2). We establish that regularized methods yield consistent improvements and establish a new state of the art for political statement classification. In particular, these methods improve predictions on low-frequency categories, improving model fairness (Dayanik and Padó, 2020). + +This paper builds on an earlier study of ours (Dayanik et al., 2021), whose scope is extended in multiple dimensions. At the phenomenon level, we broaden the focus from (forward-looking) political claims to (general) political statements. At the methodological level, we propose an ontology of methods for encoding hierarchical information. At the experimental level, we now take into consideration two text types involving five different languages. The code, models and dataset splits used in this study are available at https://www.ims.uni-stuttgart.de/data/inpsc. + +# 2 Background and Related Work + +Codebooks for Political Statement Categorization Codebooks used in large-scale annotation projects cover a broad variety of research interests and text types. Yet, regardless of whether they have been created to analyze political party manifestos (Volkens et al., 2020), political statements in the European public sphere (Koopmans, 2002), legitimation discourses about political and economic regimes (Nullmeier et al., 2015), or the migration debate in Germany (Blessing et al., 2019), they all group their categories of interest into a limited number of supercategories which reflect the existing research in the respective field. + +Text Classification Automatic political statement classification is fundamentally a text classification task on relatively short texts, with the class inventory given by the codebook. Depending on the properties of the annotation, the task is either single-label or multi-label text classification. In single label text classification, each text is assigned exactly one label, which is used in NLP applications where the labels are mutually exclusive, such as in entailment or stance detection (Kim, 2014; Glavaš and Vulić, 2019; Kennedy et al., 2019; Li and Caragea, 2019). In contrast, multi-label text classification assigns any number of categories to a text, which is better suited for tasks where the categories are overlapping or describe complementary aspects, e.g. topic categorization (Rios and Kavuluru, 2018; Chalkidis et al., 2019; Irsan and Khodra, 2019; Xiao et al., 2019). Currently, transformer-based models (Devlin et al., 2019; Liu et al., 2020) represent the current state of the art for text classification in general (Minaee et al., 2021) and political statement classification in particular (Dayanik et al., 2021). A number of studies have investigated ways to integrate hierarchical information into classification. A first family of approaches develops dedicated architectures such as capsule networks (Aly et al., 2019) or encoders of the hierarchies (Song and Roth, 2014; Zhou et al., 2020). These models are typically trained end-to-end, which requires amounts of data that are rarely available in CSS. We focus on lightweight approaches compatible with fine-tuning, described in Section 3. + +Political Statement Classification Political statement classification is a task in political text analysis, other examples of which are political text scaling (Glavaš et al., 2017b), political event detection (Nanni et al., 2017) or detection of frames (Card et al., 2015). Specific studies on political statement classification includes Verberne et al. (2014) who develop models for automatic categorization of political statements in Dutch and Karan et al. (2016) who assign topic labels to political texts in Croatian. A number of studies work with the abovementioned Comparative Manifesto Project dataset (Merz et al., 2016): Zirn et al. (2016) and Glavaš et al. (2017a) address coarse-grained text policy position analysis and Subramanian et al. (2018) introduce multilingual models jointly trained for coarse-grained statement classification and document-level positioning. In our own previous work, we created a corpus of + +German newspaper articles on the 2015 refugee crisis, *DebateNet-mig*15, (Lapesa et al., 2020), and carried out coarse-grained classification experiments on the annotated statements regarding the migration policy (Padó et al., 2019). + +# 3 Method + +# 3.1 Base Classifier + +In line with previous work in political statement classification, we focus on statement classification and assume that statements have already been detected (Subramanian et al., 2018; Padó et al., 2019). We use a standard pre-trained and fine-tuned BERT (Devlin et al., 2019) transformer as a state of the art base classifier. Pre-trained BERT models are available for many languages and domains, and can be fine-tuned for text classification tasks with a simple fully-connected layer. + +Formally, the input consists of a word statement $x$ ; we do not consider the statement's context. BERT encodes the input into a representation, $e(x)$ , which we obtain from the special token [CLS] pretended to the statement. In the single-label case, the classifier $c(e(x))$ predicts a single label using softmax activation (cf. Section 4). In the multi-label case, it predicts a set of labels using sigmoid activation (cf. Section 5). The objective function $\mathcal{L}_{\mathrm{main}}$ is standard cross entropy loss. + +# 3.2 Introducing Hierarchical Information + +As mentioned in Section 2, we focus on lightweight methods that introduce a minimal number of additional parameters and are therefore compatible with fine-tuning as part of the final classification layer of a transformer-based architecture. The suitable methods are summarized in the taxonomy in Figure 1. We distinguish, from top to bottom: (1) Methods that post-process the output of a statement classifier to enforce hard constraints vs. methods that incorporate soft constraints into the end-to-end learning process; (2) among the latter, methods that decompose the parameters for the more specific classes vs. regularization methods; (3) among the regularization methods, we compare those which target the representation of the class vs. of the encoded instance. We now describe the application of these methods and assess their characteristics. + +![](images/6dae9fe09f2b6f451795c1c01bf36712ac6d95a84b4eae7efa366df46a6c17e5.jpg) +Figure 1: Encoding hierarchical information + +# 3.2.1 Post-processing: ILP + +Integer Linear Programming (ILP) is a sub-type of Linear Programming, a family of constrained optimization problems over linear objective functions. ILP introduces the additional constraint that variables can take only integer values. ILP models have been used in NLP tasks such as dependency parsing (Riedel and Clarke, 2006) or semantic role labeling (Punyakanok et al., 2004) to enforce linguistically motivated constraints on predicted structures. + +In our application, where a classifier might predict a subcategory with a mismatching supercategory, ILP can select the most likely legal output from the classifier probabilities so that (1) for each predicted subcategory, the matching supercategory is predicted, and (2) for each predicted supercategory, at least one matching subcategory is predicted. For each category we introduce a binary variable $v_{i}$ indicating if the category is predicted. The objective function is the log likelihood of the model output (including predicted and non-predicted classes), using the estimates of the neural classifiers $P_{\mathrm{NC}}$ : + +$$ +\phi_ {i} = P _ {\mathrm {N C}} \left(v _ {i} = 1\right) \tag {1} +$$ + +$$ +\mathcal {L} = \sum_ {i} \log \phi_ {i} v _ {i} + \log [ 1 - \phi_ {i} ] (1 - v _ {i}) \tag {2} +$$ + +Let $\sup (\mathrm{i})$ denote the supercategory for the subcategory $i$ . Then we formalize constraint (1) as: + +$$ +f o r e a c h \quad \text {s u b c a t .} v _ {i}: v _ {i} - v _ {\sup (i)} \leq 0 \tag {3} +$$ + +Correspondingly, let subs(i) denote the set of subcategories for supercategory $i$ . Then the second constraint from above is formalized as: + +$$ +\text {f o r e a c h s u p e r c a t .} v _ {i}: v _ {i} - \sum_ {j \in \operatorname {s u b s} (i)} v _ {j} \leq 0 \tag {4} +$$ + +Assessment: In contrast to the other methods introduced in this Section, ILP imposes hard constraints + +on the output. It does not introduce additional parameters. It is only applicable to multi-label classification. As a post processing step, it does not propagate the errors back into the representations. + +# 3.2.2 Parameter Decomposition: HLE + +Hierarchical Label Encoding (HLE), introduced by Shimaoka et al. (2017) for fine-grained named entity recognition, decomposes the representation of each subcategory into a sum of vectors, one for the subcategory itself and one for each of its supercategories. Formally, it creates a binary square matrix, $B \in \{0, 1\}^{l \times l}$ , where $l$ is the total number of sub- and supercategories. Each cell in the matrix is filled with 1 either if the column class is a subclass of or the same as the row class, and filled with 0 otherwise. The matrix $B$ is not updated during training and integrated into models by multiplying it by the weight matrix $W_{c}$ of the classifier: + +$$ +W _ {c} ^ {\prime} = \left(W _ {c} ^ {\top} B\right) \tag {5} +$$ + +where $W_{c} \in \mathbb{R}^{l \times hs}$ , $hs$ is the size of the hidden state of the encoder and $W_{c}'$ is the modified parameters of the classifier. + +Assessment: HLE imposes soft constraints and does not introduce any parameters. Similar to ILP, HLE can only be used in multi-label classification. + +# 3.2.3 Class Representation Regularization + +Class representation regularization (CRR) falls under the umbrella of regularization methods which have been used to encode prior knowledge for different NLP tasks (Eisenstein et al., 2011; Sattigeri and J. Thiagarajan, 2016) and has been shown to improve classification performance on a diverse set of hierarchical datasets under both supervised (Naik and Rangwala, 2015) and semi-supervised learning scenarios (Bui et al., 2018; Stretcu et al., 2019). In our case, the goal is to increase the similarity between the weight vectors of the subcategories belonging to the same supercategory while keeping the weight vectors of subcategories across supercategories dissimilar. + +Formally, the classification layer (cf. Section 3.1) is a weight matrix $W_{c} \in \mathbb{R}^{l \times hs}$ , where $l$ is the number of classes and $hs$ is the output size of the encoder. We use $S$ for the set of supercategories and $S_{i}$ to denote the $i$ -th supercategory, the set of its subcategories, and their weight vectors, depending on context. Then we define the centroid $\mu(S_{i})$ of a supercategory, the average distance between + +two supercategories, $d_{avg}$ , and the global intra- and inter-supercategory distances $d^{\mathrm{inter}} / d^{\mathrm{intra}}$ as: + +$$ +\mu \left(S _ {i}\right) = \frac {1}{\left| S _ {i} \right|} \sum_ {w \in S _ {i}} w \tag {6} +$$ + +$$ +d_{\text{avg}}\left(S_{i},S_{j}\right) = \frac{1}{|S_{i}||S_{j}|}\sum_{\substack{w\in S_{i},\\ w^{\prime}\in S_{j}}}\operatorname {dist}(w,w^{\prime})\qquad (7) +$$ + +$$ +d ^ {\text {i n t e r}} = \sum_ {0 \leq i < j \leq | S |} d _ {\text {a v g}} \left(S _ {i}, S _ {j}\right) \tag {8} +$$ + +$$ +d ^ {\text {i n t r a}} = \sum_ {i = 1} ^ {| S |} \frac {1}{| S _ {i} |} \sum_ {w \in S _ {i}} \operatorname {d i s t} (\mu (S _ {i}), w) \tag {9} +$$ + +Finally, we regularize the learning objective $(\mathcal{L}_{\mathrm{main}},\mathrm{cf.}$ Section 3.1) as follows: + +$$ +\mathcal {L} = \mathcal {L} _ {\text {m a i n}} + \alpha d ^ {\text {i n t r a}} - \beta d ^ {\text {i n t e r}} \tag {10} +$$ + +where the hyperparameters $\alpha, \beta \geq 0$ control regularization strength. + +Assessment: CRR imposes soft constraints, adds two hyper parameters, and is applicable to both single and multi label classification. + +# 3.2.4 Instance Representation Regularization + +Instance representation regularization (IRR) applies the same intuition as above, but at the level of the instance representations produced $e(x)$ by the encoder. The model is penalized whenever the encoder generates more similar representations for input pairs with different supercategories than for pairs with the same supercategories. A similar approach was proposed by Choi and Rhee (2019) for non-hierarchical classification to simply keep class representations distinct from one another. + +Formally, let $X$ be the set of instances, and $s(x)$ be the supercategory of instance $x$ . We consider the set of instance triplets where the first and second member share a supercategory and the third has a separate one, and measure the extent to which the distance across supercategories exceeds the distance within the supercategory: + +$$ +d^{\text{diff}} = \sum_{\substack{x,y,z\in X\\ s(x) = s(y)\\ s(x)\neq s(z)}}\max (0,\operatorname {dist}(e(x),e(y)) - \operatorname {dist}(e(y),e(z))) \tag{11} +$$ + +We then regularize the learning objective as: + +$$ +\mathcal {L} = \mathcal {L} _ {\text {m a i n}} + \alpha \cdot d ^ {\text {d i f f}} \tag {12} +$$ + +
IDLabelf#submean f.sub
1xxControlling Migration9981662 ± 46.2
2xxResidency7261840 ± 41.2
3xxIntegration4751531 ± 35.5
4xxDomestic Security230925 ± 17.9
5xxForeign Policy689976 ± 17.8
6xxEconomy1941216 ± 13.1
7xxSociety7491939 ± 37.9
8xxProcedures6762033 ± 37.7
Overall4737118
+ +Table 1: Subcategory distribution by supercategories in DebateNet dataset: ${ID}$ ; Label; frequency(f); number of subcategories (#sub); mean subcategory frequency with standard deviation (mean f.sub). + +where $\alpha \geq 0$ controls the regularization strength. Since using the complete set of triples is computationally demanding, it may be necessary to sample instead. In this paper, we create triples from each mini-batch by combining its instances, which is an approximation to uniform sampling (cf. Sections 4.2 and 5.2). + +Assessment: IRR also imposes soft constraints, adding one hyperparameter. IRR requires each instance to belong to a single supercategory. + +# 4 Experiment 1: Newspapers + +# 4.1 Dataset + +Our first experiment adopts a monolingual multi-label statement classification task. We work with an extended version of DebateNet-mig15 (Lapesa et al., 2020), a German corpus of migration-related claims, statements targeting a specific action to be taken in a policy field.3 The corpus comprises 1361 articles from the 2015 issues of the German quality newspaper taz. The corpus, referred to in what follows as DebateNet, is annotated manually according to a two-level ontology (Table 1) for the migration domain, comprising 8 supercategories with 118 subcategories. There is a total of 3827 annotated textual spans that can be assigned subcategories if the statements touch on several policy issues. For example, the following sentence: + +Eine weitere massive Verfahrensbeschleung ist bei vorübergehenden Grenzkontrollen vor der Einreise vorgesehen (A further massive acceleration of procedures is envisaged for temporary border controls prior to entry) + +is assigned to the subcategories Border Controls (supercategory Controlling Migration) as well as Accelerated Procedure (supercategory Procedures). + +# 4.2 Experimental Setup + +Given these properties, we model statement classification on DebateNet as multi-label classification. Furthermore, we remove 46 extremely infrequent subcategories with less than 20 instances each. For each supercategory, we merge these infrequent subcategorio into the pre-existing 'catch-all' subcategory x99. We acknowledge that that makes the catch-all subcategories are presumably challenging to learn, given their inhomogeneous nature, but we believe that this strategy is reasonable, since no instances are discarded in this manner, and they still retain the supercategory signal that we are interested in. This results in a final count of 72 subcategories. + +We experiment with eight model variations: Base; ILP, HLE and CRR; and the combinations HLE+ILP, HLE+CRR,CRR+ILP and HLE+CRR+ILP. Recall that IRR is not applicable to multi-label classification. We use Euclidean distance as dist in CRR. + +We adopt the 90/10 train/test split of Dayanik et al. (2021) and perform grid search by cross-validation on the training set to optimize hyperparameters, including mini-batch size. We report weighted-averaged Precision, Recall and F1 scores on the whole dataset and three equal-sized frequency bands of categories. Details on the bands and the training method are given in Appendix A. + +# 4.3 Results + +Does hierarchical information improve overall performance? Table 2 summarizes the results, with the Overall results in the first row. The Base model achieves the lowest overall F1 score among the others (47 points), indicating the general efficacy of integrating hierarchical information into the classifier. However, different extensions of the base model show different effects in terms of Precision vs. Recall: ILP (2nd column) improves Recall only (+8) while both Precision and Recall benefit from HLE (+14/+10) and CRR (+9/+7). The combination HLE+ILP yields the best Recall (+17), and the combination of HLE and CRR is the best overall model (F1=61: +14 F1, +15 Pr, +14 R). We slightly outperform the results of the best model from our previous study (Dayanik et al., 2021), namely, HLE-only, by 1% overall F1 and on two of + +
Freq bandBaseILPHLECRRHLE+ILPHLE+CRRCRR+ILPHLE+CRR+ILP
PRF1PRF1PRF1PRF1PRF1PRF1PRF1PRF1
Overall61.241.947.056.049.750.475.252.259.070.449.055.265.859.060.576.554.360.866.055.457.864.357.358.6
Low10.29.79.618.314.514.858.330.637.431.216.118.748.130.634.854.829.035.835.519.421.952.233.938.3
Mid58.036.041.865.047.450.477.455.362.275.849.155.871.563.265.185.158.866.274.358.861.571.962.364.0
High73.150.856.760.557.957.977.855.662.376.455.962.667.363.364.077.757.964.069.161.663.863.960.360.8
+ +Table 2: Experiment 1 (multi-label statement classification): Precision, Recall, F-Scores for the DebateNet Dataset (Overall and broken down by category frequency bands). + +
SupercategoryFiDeHuTrEn
f #submean f.subf #submean f.subf #submean f.subf #submean f.subf #submean f.sub
External Relations159910159 ± 159572710572 ± 66522889254 ± 268372110372 ± 435307110307 ± 302
Freedom, Democracy7584189 ± 209567241418 ± 154735534888 ± 705521141302 ± 144320914522 ± 509
Political System11295225 ± 226566151132 ± 101240405808 ± 42332995659 ± 40525305506 ± 553
Economy455615303 ± 3951518516949 ± 10821038016648 ± 77317899161118 ± 1557675315450 ± 499
Welfare, Quality of Life778771112 ± 9271659272370 ± 19651512172160 ± 15671112071588 ± 14141024671463 ± 1431
Fabric of Society26778334 ± 20360958761 ± 45255008687 ± 58255558694 ± 72133288416 ± 448
Social Groups21136352 ± 52358656977 ± 110236256604 ± 635515751031 ± 98820756345 ± 422
Overall2061960797445075196230094
+ +Table 3: Subcategory distribution by supercategories in the complete (100%) Manifesto dataset: frequency $(f)$ ; number of subcategories (#sub); mean subcategory frequency with SD (mean.f.sub). Total: instances per language. + +the three frequency bands (low, mid $+1\%$ F1), with a tie on the third one (high), which we attribute to the addition of class level regularization through the CRR component. We obtain the best results for $\alpha \in [0.005, 0.01]$ and $\beta = 0.01$ : thus, a very mild regularization already has a substantial effect. + +How do hierarchical structure and category frequency interact? The results by frequency band enable us to analyze classification performance depending on frequency. We observe that the Base model fails badly in the low frequency band (F1=10) while doing a fair job in the mid-frequency and high-frequency bands (F1=42 and 57). The inclusion of hierarchical information leads to the most substantial improvements for the low-frequency band (+28 F1 for HLE+CRR+ILP). Improvements are generally correlated with (in)frequency: the best overall model, HLE+CRR, improves the mid-frequency band by 20 points F1 and the high-frequency band by 7 points F1. Figure 2 shows the subcategories with the highest improvement: four belong to the mid-frequency and three to the low-frequency band. + +# 5 Experiment 2: Party Manifestos + +# 5.1 Dataset + +Our second (single-label classification) experiment targets political statements in party manifestos, official documents issued by parties to summarize their political program. We build on the Comparative Manifesto Project (Volkens et al., 2019) + +![](images/a71668fca97cbe5fddfb18f35e782a28a60a3b7ad9d717b5485ca471f2759166.jpg) +Figure 2: Experiment 1: Seven subcategories with highest F1 increase for best model compared to base model. I.O:Integration Offers, R.B:Reducing Bureaucracy + +which collected and manually coded manifestos from multiple countries and languages. Considering the availability of language specific transformer based models and large annotated data, we focus on 5 countries with one language each: Finland (Fi), Germany (De), Hungary (Hu), Turkey (Tr) and United Kingdom (En). Note that this is not a parallel corpus, and the amount of annotated data available for each language varies greatly (cf. Table 3). Coding uses a two-level ontology of 7 policy areas as supercategories "designed to be comparable between parties, countries, elections, and across time", and 56 subcategories (Table 3). Sentences are split into segments if they discuss unrelated topics or different aspects of a larger policy, so each segment is assigned a single subcategory. + +
LangPlainCRRIRRCRR + IRR
PRF1PRF1PRF1PRF1
Fi39.038.437.440.640.039.341.539.238.642.240.840.1
De33.331.331.435.434.134.234.634.734.336.834.834.9
Hu41.138.838.741.739.839.742.239.039.243.739.339.8
Tr45.642.542.447.941.743.048.942.443.349.042.543.6
En31.530.830.534.632.532.332.732.732.134.432.532.8
+ +Table 4: Experiment 2 (single-label statement classification): Macro-averaged Precision, Recall, F1 scores for the Manifesto dataset (Overall, trained on $25\%$ of the data). + +
LangFreq bandBaseCRRIRRCRR + IRR
PRF1PRF1PRF1PRF1
FiLow18.415.213.720.717.716.722.616.615.425.519.619.5
Mid42.142.241.542.542.641.944.442.742.743.943.943.0
High56.657.857.058.759.859.257.458.457.757.358.957.9
DeLow16.19.010.619.714.716.418.617.717.823.116.218.0
Mid36.938.337.438.340.338.737.340.838.538.740.538.9
High48.748.948.549.949.449.349.647.648.450.149.749.7
HuLow24.515.417.326.418.419.928.416.919.133.617.521.1
Mid41.543.741.741.543.842.141.043.541.640.142.740.9
High57.357.257.057.257.257.057.356.756.757.357.757.4
TrLow29.219.620.237.420.824.240.422.224.938.021.023.8
Mid46.447.346.645.843.244.146.044.144.848.844.946.4
High61.160.660.760.461.060.660.160.860.160.361.560.7
EnLow13.38.39.720.110.812.914.610.711.917.211.313.3
Mid30.531.730.632.134.732.532.034.932.833.733.132.9
High50.752.451.351.752.051.651.652.351.652.353.252.2
+ +Table 5: Experiment 2 (single-label statement classification): Macro-averaged Precision, Recall, F1 scores for the Manifesto dataset (by category frequency band, trained on $25\%$ of the data). + +# 5.2 Experimental Setup + +We model statement classification in the Manifesto corpus at the segment level as a single-label classification task. Unlike in Section 4.1, we do not apply any pre-processing to merge very infrequent subcategories, since all categories in the Manifesto corpus are frequent enough. For example, there is only one subcategory with less instances than the threshold (20) in the DE portion. + +Since HLE and ILP are only useful for multi-label classification, we experiment with the following model variations: Base; CRR, IRR; and CRR+IRR. As distance metric, we use $\mathrm{L}_1$ distance in CRR and Cosine distance in IRR. (Other choices led to worse results.) + +We split the dataset into train (65%), validation (15%), and test (20%) portions. With several hun + +dred thousand sentences after years of annotation, the Manifesto corpus is one of the largest CSS datasets available and its size is arguably larger than typical for CSS projects (annotation of the 4k DebateNet instances took more than a year). For this reason, we introduce a further experimental variable, namely the amount of the training data. This allows us to simulate the application of these methods to scenarios in which smaller amounts of training are available. Specifically, we use random draws of percentages (25%, 50% and 100%) of the full training set, keeping the test set constant. Due to space constraints, we will discuss only the 25% case in detail and provide an overview of the 50% and 100% cases, whose details can be found in the appendix. We perform hyperparameter search for each language separately and adopt the same + +evaluation setup as in Experiment 1 (Section 4.2). + +# 5.3 Results + +Does hierarchical information improve performance? Table 4 shows the results for $25\%$ training data of each language. The results are surprisingly similar across all languages, despite the typological differences and varying amounts of training data. The Base model consistently yields the worst results, in line with the findings of Experiment 1. + +The use of hierarchical structure, both through CRR and IRR, leads to improvements for all languages, with no clear winner between the two. However, as was the case in Experiment 1 for CRR+HLE, the two methods can be beneficially combined: CRR+IRR yields the highest F-Score for each language: the gains over Base are between 1.1 points (Hu) and 2.3 points (En). The improvements are substantially smaller than in Experiment 1, which we attribute to the larger amount of data available, both overall and per subcategory. We obtained the best results for $\alpha = 0.1$ and $\beta \in [0.1, 0.2]$ indicating that the CMP data profits from a bit more but still mild regularization. Our setup is not exactly comparable to previous work, but our $100\%$ condition (cf. Appendix A) matches or exceeds the results of the closest study by Subramanian et al. (2018). + +How do hierarchical structure and category frequency interact? As in Experiment 1, we analyze the impact of hierarchical structure on three equal-sized subcategory frequency bands, shown in Table 5, for the $25\%$ condition. Similar to Experiment 1, the Plain model fails badly on the low frequency band with F1 between 9.7 (En) and 20.2 (Tr). The combination CRR+IRR yields the highest improvements for this frequency band, between 3 and 7 points F1. (Turkish is an exception with the highest F1 for IRR without CRR.) CRR and IRR also generally improve the results for the two other bands, but (again in line with Experiment 1) the gains are more modest, up to $2.5\%$ F1 for the mid-frequency and $1.0\%$ F1 for the high-frequency abdn. Indeed, a correlation analysis shows a significant negative correlation between subcategory size and the F1 improvement of CRR+IRR over Base, $r = -0.19$ . In the higher frequency bands, the variance is also higher, with some wins for CRR (Fi, Hu), IRR (Tr), or the Base model (Tr). + +Corpus size and hierarchical structure. As stated above, our main results use the $25\%$ con + +![](images/0f78eaa43f32d8f06286137cc49f31b7063f52db4296133345e8ceb93e708dc5.jpg) +Figure 3: Experiment 2: F1 difference between the CRR+IRR and Base models across training data sizes. + +![](images/f57b5a633af14599c5a561e8957b5394a784726337e1aeb326205d8a6871166f.jpg) +Figure 4: Experiment 2: Seven subcategories with highest F1 increase for best model compared to base model. Peace, E.C and Protectionism belong to mid frequency class. The other four subcategory belong to low band. K.D.M: Keynesian Demand Management, E.C: European Community/Union. + +dition. To assess the behavior for larger datasets, Figure 3 summarizes the mean improvement in F1 between Base and $\mathrm{IRR + CRR}$ for the $25\%$ $50\%$ and $100\%$ conditions. The improvement is largest for the $25\%$ setting, further supporting our observations that incorporating hierarchical information into the models is especially important in a low data regime. That being said, we still obtain consistent improvements for the $50\%$ condition. For $100\%$ , we still gain 1-2 points F1 for De, En, and Fi. In contrast, Tr and Hu lose slightly on the full dataset $(100\%)$ . Further analysis (Appendix B.3) shows that in Tr and Hu, the high-frequency band - where we see the least improvement - account for $76\%$ and $79\%$ of the data, respectively, while it only makes up, e.g., $73\%$ of the German data. + +Qualitative Analysis. Table 6 shows some English examples which were classified incorrectly by the Base model and correctly by the $\mathrm{IRR + CRR}$ model. All involve arguably related subcategories, illustrating the benefit of hierarchical modeling to counteract the substitution, among related categories, of the more frequent by the less frequent one. This pattern is bolstered by Figure 4, which + +
InputBase Pred. (incorrect)CRR+IRR Pred. (correct)
Our long-term economic plan is turning around Britain's economy.Economic growth (Mid)Economic planning (Low)
Face coverings such as these are barriers to integration.National way of life (Mid)Multiculturalism (Low)
Fairer corporate governance, built on new rules for takeovers executive pay and worker representation on company boards.Market regulation (High)Corporatism (Low)
This sent out terrible signals: if you did the right thing, you were penalised — and if you did the wrong thing, you were rewarded, with the unfairness of it all infuriating hardworking people.Equality (High)Welfare limitation (Low)
+ +Table 6: Examples from Manifesto dataset correctly classified only by CRR+IRR. Mid, Low, High indicates frequency band of predicted subcategories. + +shows the 7 subcategories with the largest improvement in F1: Three of them belong to the mid-frequency band, four to the low-frequency band, and none to the high-frequency band. + +# 6 Conclusion + +This paper addresses the task of political statement classification focussing on the challenge of class imbalance. We have argued that the hierarchically structured codebooks developed by political science projects are a source of domain knowledge that can be integrated in classification models. We extend state-of-the-art transformer models with lightweight modules that implement this intuition in different ways. We evaluate on two datasets, covering two codebooks, single-label and multi-label classification, and various languages. Our main findings are robust across the different setups: inclusion of hierarchical information virtually always improves classification, and the methods we consider are sufficiently complementary that their benefits combine. We obtain improvements even for fairly large datasets, with diminishing benefits for very large datasets – which is plausible, given that performance improves particularly for low-frequency categories. + +The latter finding - strong improvements for low-frequency categories - is arguably important with regard to algorithmic fairness (Dayanik and Padó, 2020; Jacobs and Wallach, 2021), since in the case of rare categories, a small number of prediction errors is sufficient to substantially impact the reliability of downstream analyses. Indeed, multi + +ple causes of low frequency categories exist. As one example, in analyses over time, statement frequencies co-vary naturally with topic prominence, and analyses like the (semi-)automatic extraction of network representations to assess dynamics of political debates (Haunss et al., 2020) may misrepresent the contribution of infrequent categories. As another example, work on the framing of immigration discourse on Twitter (Mendelsohn et al., 2021) has shown that employing issue-specific categories (e.g., "victim:war", "victim: discrimination", "threat:jobs", "threat:public order") reveal ideological and regional patterns which would be missed by the commonly employed generic frames such "economy" or "morality" (Card et al., 2015) – but at the cost of introducing many fine-grained categories which are sparse and attested with widely different frequencies. Our work demonstrates that a well designed hierarchical codebook, combined with the right computational devices, can go a long way towards redressing the challenges that arise from this situation. An more detailed assessment of the impact of our methods on downstream tasks remains future work. + +# Acknowledgments + +We acknowledge funding by Deutsche Forschungsgemeinschaft (DFG) for project MARDY 2 (375875969) within SPP RATIO and by Bundesministerium für Bildung und Forschung (BMBF) through E-DELIB (Powering up e-deliberation: towards AI-supported moderation). + +# Ethics Statement + +The research reported in this paper is concerned with fundamental aspects of machine learning models by enabling machine learning models to better represent data and improve the representation of low-frequency categories, ideally improving fairness. The methods we propose for this purpose do not introduce additional ethical risks on top of the previous work we build upon. + +# References + +Rami Aly, Steffen Remus, and Chris Biemann. 2019. Hierarchical multi-label classification of text with capsule networks. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop, pages 323-330, Florence, Italy. Association for Computational Linguistics. +André Blessing, Nico Blokker, Erenay Dayanik, Sebastian Haunss, Jonas Kuhn, Gabriella Lapesa, and Sebastian Padó. 2019. *Modeling ARgumentation DYNAMICS in political discourse*. Codebook. Topic: immigration in Germany (2015). +Thang D Bui, Sujith Ravi, and Vivek Ramavajjala. 2018. Neural graph learning: Training neural networks using graphs. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pages 64-71. +Dallas Card, Amber E. Boydstun, Justin H. Gross, Philip Resnik, and Noah A. Smith. 2015. The media frames corpus: Annotations of frames across issues. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing of the Asian Federation of Natural Language Processing, ACL 2015, July 26-31, 2015, Beijing, China, Volume 2: Short Papers, pages 438-444. The Association for Computer Linguistics. +Ilias Chalkidis, Emmanouil Fergadiotis, Prodromos Malakasiotis, and Ion Androutsopoulos. 2019. Large-scale multi-label text classification on EU legislation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6314-6322, Florence, Italy. Association for Computational Linguistics. +Daeyoung Choi and Wonjong Rhee. 2019. Utilizing class information for deep network representation shaping. Proceedings of the AAAI Conference on Artificial Intelligence, 33(01):3396-3403. +Erenay Dayanik, Andre Blessing, Nico Blokker, Sebastian Haunss, Jonas Kuhn, Gabriella Lapesa, and Sebastian Padó. 2021. Using hierarchical class structure to improve fine-grained claim classification. In + +Proceedings of the 5th Workshop on Structured Prediction for NLP (SPNLP 2021), pages 53-60, Online. Association for Computational Linguistics. +Erenay Dayanik and Sebastian Padó. 2020. Masking actor information leads to fairer political claims detection. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4385-4391, Online. Association for Computational Linguistics. +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. +Jacob Eisenstein, Noah A. Smith, and Eric P. Xing. 2011. Discovering sociolinguistic associations with structured sparsity. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 1365-1374, Portland, Oregon, USA. Association for Computational Linguistics. +Frank Fischer and John Forester, editors. 1993. The Argumentative turn in policy analysis and planning. Duke University Press. +Goran Glavas, Federico Nanni, and Simone Paolo Ponzetto. 2017a. Cross-lingual classification of topics in political texts. In Proceedings of the Second Workshop on NLP and Computational Social Science, pages 42–46, Vancouver, Canada. Association for Computational Linguistics. +Goran Glavaš, Federico Nanni, and Simone Paolo Ponzetto. 2017b. Unsupervised cross-lingual scaling of political texts. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 688–693, Valencia, Spain. Association for Computational Linguistics. +Goran Glavaš and Ivan Vulić. 2019. Generalized tuning of distributional word vectors for monolingual and cross-lingual lexical entailment. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4824–4830, Florence, Italy. Association for Computational Linguistics. +Sebastian Haunss, Jonas Kuhn, Sebastian Pado, Andre Blessing, Nico Blokker, Erenay Dayanik, and Gabriella Lapesa. 2020. Integrating manual and automatic annotation for the creation of discourse network data sets. Politics and Governance, 8(2). +Ivana Clairine Irsan and Masayu Leylia Khodra. 2019. Hierarchical multi-label news article classification + +with distributed semantic model based features. International Journal of Advances in Intelligent Informatics, 5(1):40-47. +Abigail Z. Jacobs and Hanna Wallach. 2021. Measurement and fairness. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, FAccT '21, page 375-385, New York, NY, USA. Association for Computing Machinery. +Mladen Karan, Jan Šnajder, Daniela Širinic, and Goran Glavaš. 2016. Analysis of policy agendas: Lessons learned from automatic topic classification of Croatian political texts. In Proceedings of the 10th SIGHUM Workshop on Language Technology for Cultural Heritage, Social Sciences, and Humanities, pages 12-21, Berlin, Germany. Association for Computational Linguistics. +Stefan Kennedy, Niall Walsh, Kirils Sloka, Andrew McCarren, and Jennifer Foster. 2019. Fact or factitious? contextualized opinion spam detection. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop, pages 344-350, Florence, Italy. Association for Computational Linguistics. +Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746-1751, Doha, Qatar. Association for Computational Linguistics. +Ruud Koopmans. 2002. Codebook for the Analysis of Political Mobilisation and Communication in European Public Spheres. +Gabriella Lapesa, Andre Blessing, Nico Blokker, Erenay Dayanik, Sebastian Haunss, Jonas Kuhn, and Sebastian Padó. 2020. DEbateNet-mig15:tracing the 2015 immigration debate in Germany over time. In Proceedings of the 12th Language Resources and Evaluation Conference, pages 919-927, Marseille, France. European Language Resources Association. +Yingjie Li and Cornelia Caragea. 2019. Multi-task stance detection with sentiment and stance lexicons. 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 6299-6305, Hong Kong, China. Association for Computational Linguistics. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2020. RoBERTa: A robustly optimized BERT pretraining approach. ArXiv, abs/1907.11692. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. + +Philipp Mayring. 2019. Qualitative content analysis: Demarcation, varieties, developments. Forum Qualitative Sozialforschung / Forum: Qualitative Social Research, 20(3). +Julia Mendelsohn, Ceren Budak, and David Jurgens. 2021. Modeling framing in immigration discourse on social media. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2219-2263, Online. Association for Computational Linguistics. +Nicolas Merz, Sven Regel, and Jirka Lewandowski. 2016. The manifesto corpus: A new resource for research on political parties and quantitative text analysis. Research & Politics, 3(2):2053168016643346. +Shervin Minaee, Nal Kalchbrenner, Erik Cambria, Narjes Nikzad, Meysam Chenaghlu, and Jianfeng Gao. 2021. Deep learning-based text classification: A comprehensive review. ACM Comput. Surv., 54(3). +Azad Naik and Huzefa Rangwala. 2015. A ranking-based approach for hierarchical classification. In 2015 IEEE International Conference on Data Science and Advanced Analytics (DSAA), pages 1-10. +Federico Nanni, Simone Paolo Ponzetto, and Laura Dietz. 2017. Building entity-centric event collections. In 2017 ACM/IEEE Joint Conference on Digital Libraries (JCDL), pages 1-10. +Frank Nullmeier, Roland Lhotta, Dominika Biegón, Jennifer Gronau, Sebastian Haunss, Achim Hurrelmann, Zuzana Krell-Laluhová, Falk Lenke, Martin Nonhoff, Tanja Pritzlaff, and et al. 2015. Project B1: Legitimating States, International Regimes, and Economic Orders. Codebook – Final Version. +Sebastian Padó, Andre Blessing, Nico Blokker, Erenay Dayanik, Sebastian Haunss, and Jonas Kuhn. 2019. Who sides with whom? towards computational construction of discourse networks for political debates. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2841-2847, Florence, Italy. Association for Computational Linguistics. +Vasin Punyakanok, Dan Roth, Wen-tau Yih, and Dav Zimak. 2004. Semantic role labeling via integer linear programming inference. In COLING 2004: Proceedings of the 20th International Conference on Computational Linguistics, pages 1346-1352, Geneva, Switzerland. COLING. +Sebastian Riedel and James Clarke. 2006. Incremental integer linear programming for non-projective dependency parsing. In Proceedings of the 2006 Conference on Empirical Methods in Natural Language Processing, pages 129-137, Sydney, Australia. Association for Computational Linguistics. +Anthony Rios and Ramakanth Kavuluru. 2018. Few-shot and zero-shot multi-label learning for structured label spaces. In Proceedings of the 2018 Conference + +on Empirical Methods in Natural Language Processing, pages 3132-3142, Brussels, Belgium. Association for Computational Linguistics. + +Prasanna Sattigeri and Jayaraman J. Thiagarajan. 2016. Sparsifying word representations for deep unordered sentence modeling. In Proceedings of the 1st Workshop on Representation Learning for NLP, pages 206-214, Berlin, Germany. Association for Computational Linguistics. + +Sonse Shimaoka, Pontus Stenetorp, Kentaro Inui, and Sebastian Riedel. 2017. Neural architectures for fine-grained entity type classification. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 1271-1280, Valencia, Spain. Association for Computational Linguistics. + +Yangqiu Song and Dan Roth. 2014. On dataless hierarchical text classification. In Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence, AAAI'14, page 1579-1585. AAAI Press. + +Otilia Stretcu, Krishnamurthy Viswanathan, Dana Movshovitz-Attias, Emmanouil Platanios, Sujith Ravi, and Andrew Tomkins. 2019. Graph agreement models for semi-supervised learning. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. + +Shivashankar Subramanian, Trevor Cohn, and Timothy Baldwin. 2018. Hierarchical structured model for fine-to-coarse manifesto text analysis. 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 1964-1974, New Orleans, Louisiana. Association for Computational Linguistics. + +Suzan Verberne, Eva D'Hondt, Antal van den Bosch, and Maarten Marx. 2014. Automatic thematic classification of election manifestos. Information Processing & Management, 50(4):554-567. + +Andrea Volkens, Tobias Burst, Werner Krause, Pola Lehmann, Theres Matthieß, Nicolas Merz, Sven Regel, Bernhard Weßels, and Lisa Zehnter. 2020. The Manifesto Project Dataset - Codebook. Manifesto Project (MRG/CMP/MARPOR). Version 2020b. + +Andrea Volkens, Werner Krause, Pola Lehmann, Theres Matthieß, Nicolas Merz, Sven Regel, and Bernhard Weßels. 2019. The Manifesto data collection, version 2019b. + +Hendrik Wagenaar. 2011. Meaning in Action. Interpretation and Dialogue in Policy Analysis. M.E. Sharpe. + +Annika Werner, Onawa Lacewell, and Andrea Volkens. 2011. Manifesto coding instructions, 4th fully revised edition edition. Available at: https://manifestoproject.wzb.eu/down/papers/handbook_2011_version_4.pdf. + +Lin Xiao, Xin Huang, Boli Chen, and Liping Jing. 2019. Label-specific document representation for multi-label text classification. 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 466-475, Hong Kong, China. Association for Computational Linguistics. + +Jie Zhou, Chunping Ma, Dingkun Long, Guangwei Xu, Ning Ding, Haoyu Zhang, Pengjun Xie, and Gongshen Liu. 2020. Hierarchy-aware global model for hierarchical text classification. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1106-1117, Online. Association for Computational Linguistics. + +Cacilia Zirn, Goran Glavaš, Federico Nanni, Jason Eichorts, and Heiner Stuckenschmidt. 2016. Classifying topics and detecting topic shifts in political manifestos. In Proceedings of PolText 2016: The International Conference on the Advances in Computational Analysis of Political Text, pages 88-93, Zagreb. University of Zagreb. + +# A Details on Experiment 1 + +# A.1 Dataset Details + +We split the fine-grained categories into three equal-sized frequency bands using following threshold values: high-frequency $(265\geq \mathrm{f}\geq 67)$ , mid-frequency $(65\geq \mathrm{f}\geq 40)$ and low-frequency $(20\geq \mathrm{f}\geq 39)$ . Table 7 shows the category frequency band assignments in the DebateNet dataset. + +
BandLabel
Low-frequency111199201209213214
406408499502505508
602603605701706707
708801802807811814
Mid-frequency106107109204211212
215301302303307401
402405503509601699
702711715803804808
High-frequency101102104105108110
190202203207299309
399501504507703705
709712799805812899
+ +Table 7: Lists of the categories in the frequency bands + +# A.2 Training Details + +We use use a cased BERT variant that was trained specifically for the target language. We split DebateNet into to a train set $(90\%)$ and a test set + +(10%) and perform grid search by cross validation on the training set to optimize hyperparameters. All models are trained using cross entropy loss with the sigmoid activation function and AdamW (Loshchilov and Hutter, 2019) optimizer. We perform grid search for hyperparameter optimization and use the hyperparameters leading highest average F1 score during 5-Fold cross validation. Following lower and upper bounds have been applied during search for each hyperparameter: learning rate: [1e-5, 5e-2], epoch: [5, 25], mini-batch size: [16, 32], dropout: [0.2,0.8], $\alpha$ : [0.005,0.6], $\beta$ : [0.01,0.6]. The best hyperparameters for the best model (HLE+IRR+ILP) are shown in Table 8. + +
LangTrainlrαCRRβαIRRdp
DebateNet5e-50.010.01-0.3
Fi25%3e-50.10.10.10.4
50%2e-50.050.050.10.2
100%2e-50.050.050.10.2
De25%2e-50.20.20.40.2
50%2e-50.050.010.20.2
100%2e-50.10.20.10.1
Hu25%2e-50.40.050.10.2
50%2e-50.10.10.10.2
100%2e-50.010.010.050.2
Tr25%2e-50.20.20.40.2
50%2e-50.20.40.050.2
100%2e-50.010.010.10.2
En25%3e-50.05-0.050.10.4
50%3e-50.20.20.40.4
100%3e-50.050.050.40.4
+ +Table 8: Hyperparameters of HLE+IRR+ILP (Experiment 1, DebateNet) and CRR+IRR (Experiment 2, remaining rows) models. $\alpha_{\mathrm{CRR / IRR}}$ : $\alpha$ parameter of CRR/IRR method. + +# B Details on Experiment 2 + +# B.1 Dataset Details + +Similar to Experiment 1, we split the categories into three equal-sized frequency bands. Table 9 shows threshold values for each band in the Manifesto dataset and category-frequency band assignments for Experiment 2 can be found at https://github.com/repo4supp/data_splits. + +# B.2 Training Details + +In our experiments, for each language $(\mathrm{Fi}^5,\mathrm{De}^6$ $\mathrm{H u}^7$ $\mathrm{Tr}^8$ and $\mathrm{En}^9$ ), we use a cased BERT variant that was trained specifically for the target language. We split the dataset into train $(65\%)$ , validation $(15\%)$ , and test $(20\%)$ sets and perform hyperparameter search on the development set for Experiment 2. We again use AdamW as the optimizer and cross-entropy as the loss function. We perform grid search for hyperparameter optimization and use the hyperparameters leading highest average F1 score on the development set. Following lower and upper bounds have been applied during search for each hyperparameter: learning rate:[1e-5, 5e-2], epoch:[5, 30], mini-batch size:[16, 32], dropout:[0.1,0.6], $\alpha_{\mathrm{CRR}}:[0.01,0.6]$ $\alpha_{\mathrm{IRR}}:[0.01,0.6]$ $\beta :[0.01,0.6]$ . The hyperparameters for the best model (CRR+IRR), for each language and training set, are listed in Table 8. + +# B.3 Results Details + +As the Manifesto corpus is one of the largest CSS datasets available and its size is arguably beyond the scope of typical CSS projects, we train each model variant multiple times using incrementally larger percentages (25%, 50% and 100% of the full training set) of the training data, keeping the test set constant. + +Table 10 and Table 11 show the results for the $50\%$ condition. We observe similar patterns as in $25\%$ case: While the gap between performance of the Base model and the CRR+IRR model becomes less pronounced, CRR+IRR always yields better F1-Scores than the Plain model under $50\%$ training data case. Furthermore, a comparison of the columns CRR and IRR with the column Base in Table 10 reveals that in most of the languages we considered, these extensions still able to outperform plain model when they are used stand-alone. Next, we investigate impact of hierarchical structure on three equal sized category frequency bands for the $50\%$ case. Table 11 shows the results. We find that stand-alone CRR and stand-alone IRR yields the highest improvements for low frequency band in Hu and Tr and CRR+IRR achieves best results in Fi, De and En. Results in Mid and High rows of Table 11 also indicate that the extension + +$^{5}$ https://github.com/TurkuNLP/FinBERT +6https://deepset.ai/german-bert +7https://hlht.bme.hu/en/resources/hubert +$^{8}$ https://github.com/dbmdz/berts +9https://huggingface.co/bert-base-cased + +
LangFreq.25% Threshold50% Threshold100% Threshold
FiLow1 ≥f≥ 121 ≥f≥ 232 ≥f≥ 52
Mid14 ≥f≥ 5524 ≥f≥ 11053 ≥f≥ 215
High57 ≥f≥ 417111 ≥f≥ 867221 ≥f≥ 1666
DeLow3 ≥f≥ 565 ≥f≥ 986 ≥f≥ 201
Mid59 ≥f≥ 19699 ≥f≥ 391202 ≥f≥ 764
High204 ≥f≥ 951401 ≥f≥ 1866785 ≥f≥ 3655
HuLow1 ≥f≥ 311 ≥f≥ 632 ≥f≥ 124
Mid37 ≥f≥ 14769 ≥f≥ 276133 ≥f≥ 560
High168 ≥f≥ 772357 ≥f≥ 1541697 ≥f≥ 3046
TrLow1 ≥f≥ 331 ≥f≥ 671 ≥f≥ 130
Mid34 ≥f≥ 16668 ≥f≥ 316137 ≥f≥ 628
High187 ≥f≥ 937380 ≥f≥ 1862739 ≥f≥ 3720
EnLow2 ≥f≥ 224 ≥f≥ 424 ≥f≥ 91
Mid23 ≥f≥ 8449 ≥f≥ 18097 ≥f≥ 356
High101 ≥f≥ 536188 ≥f≥ 1122368 ≥f≥ 2315
+ +Table 9: Experiment 2 (single-label statement classification): Threshold values for frequency bands. + +
LangBaseCRRIRRCRR + IRR
PRF1PRF1PRF1PRF1
Fi43.843.442.544.342.742.543.742.542.245.843.843.9
De37.737.837.139.437.938.138.637.737.740.038.038.5
Hu42.140.040.143.440.841.143.039.439.944.940.741.2
Tr50.946.547.149.946.947.252.948.649.251.847.748.0
En33.431.932.034.933.833.833.032.632.135.434.934.2
+ +Table 10: Experiment 2 (single-label statement classification): Macro-averaged Precision, Recall, F1 scores for the Manifesto dataset (Overall, trained on $50\%$ of the data) + +methods boost the performance of the Base model on mid and high frequency bands as well. + +Finally, Table 12 and Table 13 present results for the $100\%$ condition. Unlike in the $25\%$ and $50\%$ cases, we see that all of the extended models are outperformed by the Base model in terms of overall F1-Score for Hungarian and Turkish, which indicates that incorporating hierarchical information into the models does not always lead to better results in a high data regime. When we look at per frequency band performance, however, we see that it is still useful to include hierarchical information into the models: the CRR+IRR model yields the best F-score for low frequency band in four languages out of five. + +
LangFreq bandBaseCRRIRRCRR + IRR
PRF1PRF1PRF1PRF1
FiLow26.628.825.827.923.523.922.824.021.829.628.427.1
Mid44.439.641.244.743.743.645.942.743.748.442.544.9
High61.362.661.561.161.961.263.562.062.460.461.460.7
DeLow23.122.821.826.322.423.425.122.623.028.124.125.4
Mid39.942.040.542.441.141.341.142.141.243.139.640.9
High51.550.250.751.052.051.251.050.250.450.351.650.7
HuLow25.719.420.227.921.822.428.618.520.930.519.621.0
Mid43.843.943.446.042.844.142.743.642.645.944.544.8
High57.957.957.857.059.157.758.557.357.359.059.258.8
TrLow37.924.927.034.024.926.441.928.831.241.027.129.2
Mid51.749.250.152.350.751.252.251.151.450.751.350.6
High63.265.464.163.465.264.164.465.965.163.764.864.1
EnLow15.010.011.517.313.414.413.18.89.919.216.116.8
Mid33.833.633.135.034.334.235.334.834.333.934.332.4
High51.452.251.552.553.652.850.754.252.153.054.453.3
+ +Table 11: Experiment 2 (single-label statement classification): Macro-averaged Precision, Recall, F1 scores for the Manifesto dataset (by frequency band, trained on $50\%$ of the data) + +
LangBaseCRRIRRCRR + IRR
PRF1PRF1PRF1PRF1
Fi47.048.146.748.148.747.847.148.346.947.651.248.1
De40.440.940.241.341.240.941.840.040.242.440.841.2
Hu47.843.944.645.041.442.347.142.843.843.445.043.6
Tr56.755.755.556.454.254.355.653.953.655.954.654.5
En38.535.735.940.236.337.237.836.136.538.438.237.8
+ +Table 12: Experiment 2 (single-label statement classification): Macro-averaged Precision, Recall, F1 scores for the Manifesto dataset (Overall, trained on $100\%$ of the data) + +
LangFreq bandBaseCRRIRRCRR + IRR
PRF1PRF1PRF1PRF1
FiLow29.134.830.331.634.231.627.831.528.230.039.331.7
Mid49.446.747.450.548.849.350.649.349.249.750.349.6
High63.463.663.263.063.863.363.965.064.264.064.764.0
DeLow24.126.024.228.426.827.129.225.224.930.627.728.3
Mid44.945.444.843.845.544.444.443.843.344.443.043.4
High54.053.153.553.153.052.953.352.852.953.553.353.2
HuLow35.624.827.630.420.523.633.223.426.327.231.228.4
Mid47.647.246.947.045.445.548.645.846.342.946.243.8
High60.860.860.258.459.658.760.160.159.961.058.359.5
TrLow41.340.939.741.837.637.638.935.134.341.537.937.9
Mid59.055.957.158.255.556.258.056.256.657.156.756.5
High70.571.170.770.070.369.970.871.571.070.070.269.9
EnLow23.213.315.725.216.719.217.715.616.122.421.521.2
Mid38.039.337.940.836.937.941.636.638.538.436.637.0
High55.055.655.155.556.655.755.357.456.155.257.556.1
+ +Table 13: Experiment 2 (single-label statement classification): Macro-averaged Precision, Recall, F1 scores for the Manifesto dataset (by frequency band, trained on $100\%$ of the data) \ No newline at end of file diff --git a/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/images.zip b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d9f7bb7dc216129b16fffc1c36cb51de41fa4bd4 --- /dev/null +++ b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:962872e7aea454b64fd08fb3122852dbe4e36cc9cfa40ff7d96348c947757448 +size 1160015 diff --git a/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/layout.json b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0d1d0915e7880444a342f77b40e425cba6244229 --- /dev/null +++ b/improvingneuralpoliticalstatementclassificationwithclasshierarchicalinformation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3223b74e8a76d997628ccdb85624da031ee9b70a22633cfa7c228bf4f188f433 +size 448636 diff --git a/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_content_list.json b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..666e496ed0b698ad1551895892f82085f93713b4 --- /dev/null +++ b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f6ad6cd379853be1df23d244c8c198e97d9d0071cad801fdaa39577ce396098 +size 78282 diff --git a/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_model.json b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f7a298d94ae011ef83a0c2a2df922ecc6005186a --- /dev/null +++ b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7fd0460b780c87309d72a274a63e69b7af1a2fe5e547285d3cfcccfe533a840 +size 98881 diff --git a/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_origin.pdf b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e18ad2628a18a37ac0235ff64bb916aede7b5161 --- /dev/null +++ b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/c95746cb-7196-4bb8-a769-97e1df5ce3a3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79ea6526fe466588e9572b1adf26dca1b83cb224536256cba500df7a6b0d9a15 +size 1184223 diff --git a/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/full.md b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..534d2b48d2657e252df646c44aec15f1b8c70775 --- /dev/null +++ b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/full.md @@ -0,0 +1,283 @@ +# Improving Relation Extraction through Syntax-induced Pre-training with Dependency Masking + +Yuanhe Tian, Yan Song\*, Fei Xia + +$\checkmark$ University of Washington $\clubsuit$ The Chinese University of Hong Kong (Shenzhen) + +♥{yhtian, fxia}@uw.edu ♣songyan@cuhk.edu.cn + +# Abstract + +Relation extraction (RE) is an important natural language processing task that predicts the relation between two given entities, where a good understanding of the contextual information is essential to achieve an outstanding model performance. Among different types of contextual information, the auto-generated syntactic information (namely, word dependencies) has shown its effectiveness for the task. However, most existing studies require modifications to the existing baseline architectures (e.g., adding new components, such as GCN, on the top of an encoder) to leverage the syntactic information. To offer an alternative solution, we propose to leverage syntactic information to improve RE by training a syntax-induced encoder on auto-parsed data through dependency masking. Specifically, the syntax-induced encoder is trained by recovering the masked dependency connections and types in first, second, and third orders, which significantly differs from existing studies that train language models or word embeddings by predicting the context words along the dependency paths. Experimental results on two English benchmark datasets, namely, ACE2005EN and SemEval 2010 Task 8 datasets, demonstrate the effectiveness of our approach for RE, where our approach outperforms strong baselines and achieve state-of-the-art results on both datasets. $^{1}$ + +# 1 Introduction + +Relation extraction (RE) provides deep analyses of the input text by extracting the relation between two given entities in the input. Therefore, it is an important task in natural language processing (NLP) and is widely used in many downstream NLP applications such as summarization (Wang and Cardie, 2012), question answering systems (Xu et al., 2016) + +and text mining (Distiawan et al., 2019). To correctly extract the relation between two entities, it normally requires a good modeling and analysis of the input text. Recent models such as LSTM, Transformers (Vaswani et al., 2017), and pre-trained language models (e.g., BERT (Devlin et al., 2019) and XLNet (Yang et al., 2019)) have significantly improved the performance of RE models with an important reason of their encoding power on contextual information. However, such models still reach a bottleneck because it is hard for them to capture structural information of the running text (which is essential for RE) by modeling the text as a linear sequence of words. To deal with this situation, extra knowledge and features (e.g., syntactic knowledge) are used in many studies, while of all choices, the dependency parses have been widely used and demonstrated to be effective (Xu et al., 2015; Zhang et al., 2018; Guo et al., 2019; Mandya et al., 2020; Sun et al., 2020; Yu et al., 2020b; Tian et al., 2021), for the reason that the dependency trees are able to provide long-distance word-word relations which are important structural complement to existing models for RE. + +To leverage dependency information, most existing approaches in NLP either treat it as extra input features (Prokopidis and Papageorgiou, 2014; Kiperwasser and Goldberg, 2015; Yu and Bohnet, 2017), which requires heavy feature engineering, or use complicated architectures (Xu et al., 2015; Roth and Lapata, 2016; Marcheggiani and Titov, 2017; Zhang et al., 2018; Li et al., 2018; Guo et al., 2019; Nie et al., 2020; Li et al., 2020a,b; Chen et al., 2020) to encode it, which suffers from the difficulty of designing an effective model. In addition, these approaches normally require dependency trees as extra input when processing sentences, and thus potentially suffer from noises from the dependency trees because of errors from automatic parsing. Therefore, an alternative is needed to leverage dependency information, especially auto-generated + +![](images/9b787e5aef3575b9c568f0fef1bc212e37e6a143e31ee40478622d0aa8fe842e.jpg) +Figure 1: An overview of our approach to train a syntax-induced encoder (highlighted in the red box). The left part shows the process to extract and mask dependencies (connection and type masking, respectively) in first, second, and third orders, where the word subscript denotes its sentential index. The right part illustrates the process to compute the scores of dependency connections and types in different orders to recover the ones that being masked. + +ones, for NLU tasks, so as to overcome the aforementioned issues. + +In this paper, we propose to enhance RE through learning a good encoder equipped with dependency information, where the learning is carried out by a dependency-guided process. In detail, a dependency masking approach is designed to introduce such information, where we firstly apply an off-the-shelf dependency parser to large raw data and extract the dependency connections and types from the auto-parsed dependency trees, and then mask these connections and types so as to pre-train a syntax-induced encoder by recovering (predicting) them, which significantly differs from that of training word embeddings (Levy and Goldberg, 2014; Komninos and Manandhar, 2016) by predicting the context words along the dependency relations. In doing so, the dependency information weakly supervises the encoder and the pre-training on dependency masking ensures a selective learning process on those frequent and important dependency relations, which is more flexible than taking dependency parses (with noises) as fixed knowledge. In + +addition, by noting that higher order dependency information is beneficial in many cases (Coppola and Steedman, 2013; Kamigaito et al., 2018; Li et al., 2020b), we further enhance our approach by pre-training with masking second and third order word dependencies rather than just doing it on the first order. Once pre-trained, the resulted encoder is applied with ordinary fine-tune procedure for RE. Experimental results on two English benchmark datasets, namely, English ACE2005EN $^2$ and SemEval 2010 Task 8 (Hendrickx et al., 2010), for RE demonstrate the effectiveness of our approach, which outperforms strong baselines and achieves state-of-the-art results on both of the datasets. + +# 2 The Approach + +To learn a text encoder with important structural information for RE, we propose to pre-train it with masking and recovering word-word dependency connections and types that are auto-analyzed from + +existing parsers. The resulted syntax-induced encoder is thus weakly supervised by such information and provided with necessary syntax integration. In doing so, the dependency information is introduced during pre-training the encoder, thus no extra input is required in applying it to real applications, avoiding particular design of models to leverage such information during inference. Figure 1 illustrates the architecture of our approach to learn from an input sentence $\mathcal{X} = x_{1}x_{2}\dots x_{i}\dots x_{j}\dots x_{n}$ with $n$ words and its dependency tree $\mathcal{T}_X$ , so that the masking and recovering can be formalized by + +$$ +Y _ {\mathrm {M}} ^ {*} = \mathcal {D M} (\mathcal {D E} (\mathcal {T} _ {X})) \tag {1} +$$ + +and + +$$ +\widehat {Y} _ {\mathrm {M}} = f (\mathcal {E N} (\mathcal {X})) \tag {2} +$$ + +respectively, where $Y_{\mathrm{M}}^{*}$ is the set of all masked dependency connections and types obtained by dependency extraction $(\mathcal{D}\mathcal{E})$ and dependency masking $(\mathcal{DM})$ , and $f$ the process (with pre-training on it) to recover (predict) $Y_{\mathrm{M}}^{*}$ to $\widehat{Y}_{\mathrm{M}}$ , with the base encoder $\mathcal{EN}$ trained accordingly during the process. In the following text, we firstly illustrate dependency extraction, then the process to integrate syntax information into the encoder with dependency masking, and finally the steps to apply the resulted syntax-induced encoder to RE. + +# 2.1 Dependency Extraction + +To extract dependency information from the input text, we firstly apply an off-the-shelf dependency parser to the input and obtain its dependency tree $\mathcal{T}_X$ . Then, we extract first, second, and third order3 dependency information from $\mathcal{T}_X$ and represent them in the form of tuple, i.e., $(x_i, x_j, type)$ , where there is a connection between $x_i$ and $x_j$ and the dependency type (which is directional) of $x_j$ towards $x_j$ is type. Specifically, for the first order dependencies, we directly use the dependency connections and types in $\mathcal{T}_X$ , where we construct a directed connection between $x_i$ and $x_j$ (denoted by $(x_i, x_j)$ ) if $x_j$ is the head of $x_i$ and the dependency type between them is the syntactic role (e.g., nominal subject) of $x_i$ with respect to $x_j$ . For the second order dependencies, we construct a second order dependency connection between $x_i$ and $x_j$ if there is a word $x'$ that connects to both $x_i$ and + +![](images/f08741380b872ce8534d83bc41ccb91a8ba1aff9a4077010f1e75f9c984d2be1.jpg) +(a) Second-order Dependencies + +![](images/5b26b50b39e7f77db7f19569beda68e2985809cb9e7174fc0762d9e19e288ebb.jpg) +(b) Third-order Dependencies +Figure 2: An illustration of the three second-order (a) and four third-order (b) dependency types between $x_{j}$ and $x_{i}$ , based on their positions in the parse tree. + +$x_{j}$ by two connections $(x_{i},x^{\prime})$ and $(x^{\prime},x_{j})$ in $\mathcal{T}_X$ . In the second order case, we define three types for their connections namely, ancestor, sister, and descendant, according to the position of $x_{i}$ and $x_{j}$ in the dependency tree $\mathcal{T}_X$ , which are illustrated in (I), (II), and (III) in Figure 2 (a), respectively. Similarly, for third order dependencies, we extend the types to four ones, namely, ancestor, uncle, nephew, and descendant, which are illustrated in (I)-(IV) in Figure 2 (b). + +# 2.2 Dependency Masking and Prediction + +Previous studies leveraging dependency information by pre-training mainly focused on predicting the context words associated through dependency connections. Compared with these approaches, ours focuses on a different direction to leverage auto-parsed dependency information through learning word-word associations (i.e., dependency connections) and their dependency types. In doing so, we propose a weakly supervised learning task, namely, dependency masking (DM) with masked dependency prediction (MDP), to enhance text encoder pre-training, where they are paired processes that DM masks all connections and dependency types associated with each $x_{i}$ (the masked connections and relations are denoted by $(x_{i}, [\mathsf{MASK}])$ and $(x_{i}, x_{j}, [\mathsf{MASK}])$ in Figure 1, respectively) and MDP aims to recover them during training. + +![](images/dfd56ad7c1df28c3d39738ca41aa012dc811932ad7d5f4c4bc3906558ae878b5.jpg) +Figure 3: The architecture of our model for RE with the syntax-induced encoder (highlighted in red color) pre-trained on auto-parsed data through DMP. + +Specifically, to recover the masked dependency connections and types, we firstly pass the input $\mathcal{X}$ into the base encoder (shown in the red box in Figure 1) that can be initialized in different ways (e.g., by a pre-trained language model) and obtain the hidden vector $\mathbf{h}_i$ of the word $x_{i}$ . Then, we use three modules with the same architecture to recover masked dependency connections and types from first, second, and third order dependencies. Taking the first order dependencies as examples, we compute the connection score $s_{i,j}^{con\_1}$ and type scores $\mathbf{s}_{i,j}^{type\_1}$ for each pair of $x_{i}$ and $x_{j}$ by + +$$ +s _ {i, j} ^ {\text {c o n} - 1} = \mathbf {h} _ {j} ^ {\top} \cdot \mathbf {W} _ {1} ^ {\text {c o n}} \cdot \mathbf {h} _ {i} \tag {3} +$$ + +$$ +\mathbf {s} _ {i, j} ^ {\text {t y p e} - 1} = \mathbf {W} _ {1} ^ {\text {t y p e}} \cdot \left(\mathbf {h} _ {i} \oplus \mathbf {h} _ {j}\right) \tag {4} +$$ + +where $\oplus$ denotes vector concatenation; $\mathbf{W}_1^{con}$ and $\mathbf{W}_1^{type}$ are trainable matrices. Herein, $s_{i,j}^{con-1}$ is a scalar and $s_{i,j}^{type-1}$ is a vector with the values representing the scores for all possible types between $x_i$ and $x_j$ . Similarly, we use the same procedure to obtain the connection scores $s_{i,j}^{con-2}$ , $s_{i,j}^{con-3}$ and the type score vectors $s_{i,j}^{type-2}$ , $s_{i,j}^{type-3}$ for second and third order dependencies, respectively. Based on the connection and type scores of the first, second, and third order dependencies, our model recovers the masked connection by treating it as a binary classification using sigmoid function and pre + +dicts the masked type by applying softmax to the type score vectors. As a result, dependency information in different orders is implicitly introduced into the base encoder by the gradients backpropagated from the MDP process. + +# 2.3 RE with Syntax-induced Encoder + +Once the encoder is trained, we extract the obtained syntax-induced encoder and fine-tune it on RE tasks, where the goal of our RE model is to predict the relation $\widehat{y} \in \mathcal{R}$ ( $\mathcal{R}$ is the set for all relation types) between two given entities $E_{1}$ and $E_{2}$ in the input $\mathcal{X}$ , which is formally expressed by + +$$ +\widehat {y} = \underset {r e l \in \mathcal {R}} {\arg \max } s (r e l | (\mathcal {X}, E _ {1}, E _ {2})) \tag {5} +$$ + +where $s(\cdot)$ computes the score $s^{rel}$ for a particular relation type $rel \in \mathcal{R}$ with the given input $\mathcal{X}$ and entities (i.e., $E_1$ and $E_2$ ). In doing so, we firstly fed $\mathcal{X}$ into the pre-trained syntax-induced encoder and obtain the hidden vectors $\mathbf{h}_i$ for each $x_i$ . Next, we apply the max pooling operation to the hidden vectors of the words in each entity and obtain the vector representations, namely, $\mathbf{e}_1$ and $\mathbf{e}_1$ , of $E_1$ and $E_2$ . Then, we apply bi-affine attentions (Vaswani et al., 2017) to $\mathbf{e}_1$ and $\mathbf{e}_2$ to compute the score $s^{rel}$ for the particular relationship $rel$ . Specifically, bi-affine attentions pass $\mathbf{e}_1$ and $\mathbf{e}_2$ into two different multi-layer perceptrons (MLP), namely, $\mathrm{MLP}_1$ and $\mathrm{MLP}_2$ , and use a trainable relationship matrix $\mathbf{W}^{rel}$ to compute $s^{rel}$ via + +$$ +\mathbf {e} _ {1} ^ {\prime} = \operatorname {M L P} _ {1} \left(\mathbf {e} _ {1}\right) \tag {6} +$$ + +$$ +\mathbf {e} _ {2} ^ {\prime} = \mathrm {M L P} _ {2} \left(\mathbf {e} _ {2}\right) \tag {7} +$$ + +$$ +s ^ {r e l} = \left(\mathbf {e} _ {1} ^ {\prime} \oplus [ 1 ]\right) ^ {\top} \cdot \mathbf {W} ^ {r e l} \cdot \left(\mathbf {e} _ {2} ^ {\prime} \oplus [ 1 ]\right) \tag {8} +$$ + +where [1] is a one-dimensional unit vector which is the bias term for $\mathbf{e}_1^{\prime}$ and $\mathbf{e}_2^{\prime}$ . Afterwards, we compute the scores $s^{rel}$ for all types of relations and predict the one with the highest score. + +# 3 Experimental Settings + +# 3.1 Datasets + +We use the newest English Wikipedia dump (Wiki) as the raw data to train the syntax-induced encoder through masked dependency prediction (MDP). We filter out sentences whose lengths are fewer than 10 words and obtain the resulting corpus with 92M sentences and 2,380M tokens. In obtaining dependency relations, we use Berkeley Neural Parser5 + +
DatasetsSent. #Token #Instance #
ACE05Train7K145K5K
Dev2K36K1K
Test2K31K1K
SemEvalTrain8K141K8K
Test3K48K3K
+ +(Kitaev and Klein, 2018) trained on English Penn Treebank (PTB) $^6$ (Marcus et al., 1993) to automatically parse the Wiki data into constituency trees and then convert them into dependency trees by Stanford Dependency converter $^7$ (Manning et al., 2014). For relation extraction, we use English ACE2005EN (ACE05) $^8$ and SemEval 2010 Task 8 (SemEval) $^9$ (Hendrickx et al., 2010) with the standard train/dev/test splits $^{10}$ and follow previous studies (Christopoulou et al., 2018; Ye et al., 2019; Zhang et al., 2017; Soares et al., 2019) to process them. The statistics, namely, the number of sentences and tokens, as well as the number of instances (i.e., entity pairs), of both datasets are reported in Table 1. + +# 3.2 Implementation Details + +Since a good text representation plays an important role in achieving outstanding performance in many NLP tasks (Song and Shi, 2018; Devlin et al., 2019; Yang et al., 2019; Liu et al., 2019; Lewis et al., 2020; Song et al., 2021; Sun et al., 2021), in the experiments, we use pre-trained language models, i.e., BERT (Devlin et al., 2019) and XLNet (Yang et al., 2019) that have demonstrate their effectiveness in many NLP tasks (Yan et al., 2020; Tian et al., 2020; Ke et al., 2021; Shi et al., 2020; Du et al., 2020; Qin et al., 2021a) as the base encoder for syntax inducing (pre-training) with dependency masking. For both BERT and XLNet, we try their base and large version following the default hyperparameter settings, where their base version uses 12 layers of self-attention with 768 dimensional + +Table 1: The statistics of the two English benchmark datasets used in our experiments for relation extraction, where the number of sentence, tokens, and instances (i.e., entity pairs) are reported. + +
Pre-training Step700K, 1,400K, 2,100K, 2,800K
Learning Rate1e-5, 5e-5
Warmup Rate0.08, 0.1, 0.2
Batch Size16, 32
+ +Table 2: The hyper-parameters tested in tuning our models for relation extraction. The best ones used in our final experiments are highlighted in boldface. + +hidden vectors and the large version uses 24 layers of self-attention with 1024 dimensional hidden vectors for their large version. $^{11}$ + +For syntax inducing, we train the model on the auto-parsed English Wiki for 700K steps $^{12}$ with the batch size set to 32. It is worth noting that, since English Wiki is used as a part of the data to train BERT and XLNet, it could be considered that we do not use additional data in experiments. For the process of fine-tuning the final RE model, we use the obtained syntax-induced encoder with randomly initialized bi-affine attentions. For other hyper-parameters, Table 2 reports the ones tested in training our models for training the relation extraction models. We test all combinations of them for each model and use the one achieving the highest results (i.e., F1 scores) on the development set. For evaluation, we follow previous studies to use the micro-F1 scores for ACE05 and use the official evaluation script $^{13}$ for SemEval. + +# 4 Results and Analyses + +# 4.1 Overall Results + +Table 3 reports the results of our approach on the test set of ACE05 and SemEval with different encoders trained on first, second, and third order of dependencies (e.g., “+ DM (2nd)” denotes our approach with induced first and second order dependencies), as well as their corresponding baselines with only using the initial encoders (e.g., BERT and XLNet). We also run baselines with the standard graph convolutional networks (GCN) and the standard graph attentive networks (GAT) (Velicković et al., 2017) to leverage the auto-parsed dependency trees obtained in the same process as we obtain the auto-parsed Wiki (i.e., parsing and converting). + +
ModelsACE05SemEval
BERT-Base73.3188.41
+ GCN73.5388.51
+ GAT73.6188.59
+ DM (1st)73.6288.65
+ DM (2nd)73.7688.60
+ DM (3rd)73.6588.74
BERT-Large73.9489.03
+ GCN74.1689.23
+ GAT74.3089.37
+ DM (1st)74.3489.42
+ DM (2nd)74.4789.65
+ DM (3rd)74.2989.37
+ +(a) BERT-based Models + +
ModelsACE05SemEval
XLNet-Base73.4288.78
+ GCN73.5588.84
+ GAT73.6788.90
+ DM (1st)73.7488.93
+ DM (2nd)73.8689.11
+ DM (3rd)73.6889.02
XLNet-Large74.2689.47
+ GCN74.3389.56
+ GAT74.4589.62
+ DM (1st)74.4189.60
+ DM (2nd)74.6089.90
+ DM (3rd)74.5189.76
+ +(b) XLNet-based Models + +Table 3: Experimental results of different models using base and large version of BERT and XLNet on the test set of ACE05 and SemEval. “+ GCN” and “+ GAT” refer to the models with the standard graph convolutional network and standard graph attentive networks, respectively. “+ DM” denotes our approaches with based encoder trained through dependency masking (DM) on word dependencies of different orders (“2nd” means both first and second order dependencies are masked and learnt, the same for “3rd”). + +There are several observations. First, our approach works well with different pre-trained language models (i.e., base and large BERT and XLNet), where the models with syntax-induced encoder outperform the vanilla BERT and XLNet baselines on both datasets, even though the baseline models have already achieved desirable performance. Second, compared with baseline models with standard GCN and GAT to leverage autoparsed dependencies, our approach with different orders of dependency information consistently outperforms those baselines, which further confirms the effectiveness of our approach to leverage autoparsed dependency information. Third, among models that leveraging dependency information in different orders, the ones with second order dependencies (i.e., "+" DM (2nd)) achieve the best performance in most cases. This observation confirms that RE models can benefit from high-order word dependencies since they provide association information among words with longer syntactic relations so as leading to better structure-aware understanding towards a sentence. However, it is still worth noting that, incorporating further higher order word dependencies (e.g., third order) may introduce noise or task-irrelevant information to the encoder since they are provided with auto-generated parses, which results in inferior performance comparing to using the second order dependencies. + +# 4.2 Comparison with Previous Studies + +We further compare our best performing model with previous studies on the test set of ACE05 and SemEval and report the results in Table 4. It is observed that, our approach outperforms all previous studies with different settings and encoders and achieves state-of-the-art scores on both datasets, which further confirms the effectiveness of our approach. Particularly, compared with previous studies (Zhang et al., 2018; Guo et al., 2019; Mandya et al., 2020; Sun et al., 2020; Yu et al., 2020b) that leverage the auto-parsed dependency tree of the input sentence through a particular module (e.g., Guo et al. (2019) proposed an graph-based approach with attentions to leverage dependency connections), where such dependency trees are required as extra input in inference, our approach uses an encoder to learn the dependency information through DMP and then fine-tune the obtained syntax-induced encoder on RE task. Such design in our approach allows our final RE model to be used without requiring the dependency tree of the sentence as the extra input in inference, which allows our model to run faster than previous approaches. + +# 4.3 The Effect of Encoder Initialization + +To explore the effect of encoder initialization with our approach, we run experiments by training our encoder starting from Transformer that uses the same architecture as BERT-base (i.e., 12 layers of + +
ModelsACE05SemEval
Socher et al. (2012)-82.4
Zeng et al. (2014)-82.7
Zhang and Wang (2015)-79.6
Xu et al. (2015)-83.7
Wang et al. (2016)-88.0
Zhou et al. (2016)-84.0
†Zhang et al. (2018)-84.8
Wu and He (2019)-89.2
Christopoulou et al. (2018)64.2-
Ye et al. (2019)68.9-
†Guo et al. (2019)-85.4
Baldini Soares et al. (2019)-89.5
†Mandya et al. (2020)-85.9
†Sun et al. (2020)-86.0
†Yu et al. (2020a)-86.4
Wang et al. (2020)66.7-
Wang and Lu (2020)67.6-
Wang et al. (2021)66.0-
†Ours (BERT)74.4789.65
†Ours (XLNet)74.6089.90
+ +multi-head attentions with 768 dimensional hidden vectors) with random initialization (without using parameters from pre-trained language models or word embeddings). Table 5 reports the results of our approach when using different orders of dependency information, as well as the baseline results from the Transformer. As demonstrated, our approach significantly improves the baseline Transformer on both datasets, where around $30\%$ absolute boost is observed on both ACE05 and SemEval datasets. This observation further confirms not only the effectiveness of our approach in improving base encoder with leveraging dependency information, but also its robustness of being applied to a randomly initialized base encoder. + +# 4.4 The Effect of Training Steps + +To analyze the performance change of the learned syntax-induced encoder on RE along with the increasing of training steps, we investigate the learned encoder (randomly initialized by a vanilla Transformer or pre-trained BERT-base model) with second order dependencies obtained from different training steps by fine-tuning it on ACE05 and SemEval. The test results (i.e., F1 scores) of our + +Table 4: The comparison of F1 scores between previous studies and our best model with BERT-large on the test sets of ACE05 and SemEval. Previous studies that leverage syntactic information (e.g., the dependency tree of the input sentence) are marked by “†”. + +
ModelsACE05SemEval
Transformer31.8554.62
+ DM (1st)66.7979.37
+ DM (2nd)66.6780.02
+ DM (3rd)64.5479.95
+ +Table 5: Comparisons of RE results from vanilla Transformer and our approach that being applied to a randomly initialized Transformer (without pre-trained language models or word embeddings). + +approach based on the vanilla Transformer and the BERT-base model with respect to the training steps (in 100 thousands) are illustrated in Figure 4 (a) and (b), respectively, and the performance of BERT-base baseline on different datasets is illustrated in dashed lines in different colors $^{14}$ in Figure 4 (b). In addition, we also evaluate the performance of the learned encoders (i.e., vanilla Transformer and the BERT-base model) trained by MDP on the test set of PTB for dependency parsing to illustrate how intensive of dependency information is introduced during the pre-training process $^{15}$ , where the labeled attachment score (LAS) curves are presented in Figure 4 (c) for reference. + +It is shown that, when the Transformer is used, consistent improvements are observed with more training steps for both datasets. When a pre-trained language model (i.e., BERT-base) is used, it is observed that RE benefits much at the beginning of the pre-training (where the noisy auto-parsed dependency information is not intensively learning) and reach the peak (i.e., $74.11\%$ for ACE05 and $89.02\%$ for SemEval) when the training step reaches around 1,000K (where the syntax-induced encoder does not hurt by the noise in the dependencies). This phenomenon confirms the observations in previous studies (Xu et al., 2015; Zhang et al., 2018; Yu et al., 2020b; Sachan et al., 2021) that intensively leverage dependency information may introduce noise and confusion to relation classification, so that effective dependency pruning and introduce is of great importance. It also shows the effectiveness of our approach to address the noise by controlling the intensity of dependency information learning during pre-training. + +![](images/8a481ecf426d961eb6ae802a237f6c4304780a9644b8aa9983dcbae85fcf4434.jpg) +(a) Transformer + +![](images/5f44be1376da626d417f6bfbe2fdf9108e7d4c35dd2225c75c3a27e9511fd339.jpg) +(b) BERT-base + +![](images/cec3f5c2dc516cde83a7c51cad65c3f1209d61cd595caf4b9e3e793559746d83.jpg) +(c) Masked Dependency Prediction +Figure 4: Curves of fine-tuning different base encoders (Transformer (a) and BERT-base (b)) on ACE05 and SemEval with respect to the number of training steps (in 100K). For reference, (c) shows the dependency parsing performance (LAS) of the learned encoders (Transformer and BERT-base) on the test set of English Penn Treebank (PTB) against its pre-training steps, where higher scores suggest that more intensive introduction of dependency information. + +# 4.5 The Effect of Learned Representations + +In previous results and analysis, we already show that the syntax-induced encoder outperforms baselines on RE with implicit integration of dependency information. Therefore, it is interesting to analyze the encoded word representations by qualitatively investigating their relations, which is similar to what has been done for word embeddings. In doing so, we collect word representations from the last layer of the trained syntax-induced encoder (XLNet-large). Then, for each word, we average its representation vectors under different contexts and use the resulting vector as its final representations. Figure 5 visualizes (by t-SNE) the representations of some example words, where the distance between two words indicates their similarity (closer distances indicate more relevant relations). It is observed that words with relevant syntactic properties (e.g., similar form or part-of-speech role) and semantic meanings are grouped into the same cluster (words in different clusters are + +![](images/d65f446f22dd4e80efded15b6926f6551d6bc4a5f92d56e98f79d7e343c9b101.jpg) +Figure 5: Visualizations of the learned representations through the syntax-induced encoder for some example words. The distance between any two words illustrates their similarity in terms of syntax and semantics. Words are presented in clusters and those in the same cluster are represented in the identical color. + +represented in different colors). For example, all plural nouns of job names, e.g., "teachers", "journalists", "publisher", "librarians", "shipowners", and "supporters", are in the same cluster (represented in red color), while they are far away from irrelevant words, e.g., "praying". This finding is inspiring since such representations are automatically generated so that the MDP process shows its validity in learning syntax-aware word representations and ensuring that their relevance in syntax and semantics are appropriately modeled, which allows our model to achieve promising performance. + +# 5 Related Work + +Relation extraction is an important task in NLP and it requires deep understanding of the input text to achieve model performance. Therefore, in addition to leveraging advanced text encoders (e.g., biLSTM, Transformer (Vaswani et al., 2017), BERT (Devlin et al., 2019)) to capture contextual information, structural information, namely, the dependency information, of the running text has been widely used as an effective resource to improve RE (Xu et al., 2015; Zhang et al., 2018; Guo et al., 2019; Yu et al., 2020b; Chen et al., 2021). In most recent studies in NLP, the dependency information is leveraged either as extra input features (Prokopidis and Papageorgiou, 2014; Kiperwasser and Goldberg, 2015; Yu and Bohnet, 2017) or modeled by complicated graph-based architectures, such as convolutions neural networks (Marcheggiani and Titov, 2017; Zhang et al., 2018) and tree LSTMs (Peng et al., 2017; Li et al., 2018). Previous studies also tried to use attention mechanism to weight different dependency features (Guo et al., 2019; Yu et al., 2020b; Qin et al., 2021b) and LSTM to en + +code linearized dependency path (Xu et al., 2015; Roth and Lapata, 2016). In addition to modeling dependency information, there is another track to leverage it by pre-training dependency-based word embeddings through predicting the context words in auto-parsed dependency trees (Levy and Goldberg, 2014; Komninos and Manandhar, 2016) or designing an auxiliary module to learn the dependency information by treating the dependencies as additional input during pre-training (Xu et al., 2021). This research follows the pre-training paradigm and offers an alternative way to do so. + +Specifically, compared with existing studies, our approach leverages the dependency information by inducing it to the pre-training process through masked dependency prediction, whose object is to predict the masked dependencies rather than directly using it as extra fixed input along with the input sentence through an additional module. Also, since the dependency information is learnt by the syntax-induced encoder and the encoder is further fine-tuned on the training data in the same way as general RE model, our approach neither requires any additional input features nor needs complicated architectures to encode them, which allows our model to be efficient in inference. + +# 6 Conclusion + +In this paper, we propose to use dependency masking and recovering to improve the text encoder and thus enhance RE that requires deep understanding of the running text, where the encoder is trained on large scaled auto-parsed data. Specifically, we try such masking on first, second, and third order word dependencies from the auto-parsed data, and train a base encoder that is able to recover all the masked dependencies. In doing so, the resulted syntax-induced encoder is integrated with dependency information in a dynamic and flexible manner and it can be directly applied to different downstream tasks requiring no extra input or particular design to accommodate dependency information. Experimental results and analyses on two English benchmark datasets (i.e., ACE05 and SemEval) for RE show the effectiveness of our approach, where our approach outperforms strong baselines and achieve state-of-the-art on both datasets. + +# Acknowledgements + +This work is supported by Shenzhen Science and Technology Program under the project "Funda + +mental Algorithms of Natural Language Understanding for Chinese Medical Text Processing" (JCYJ20210324130208022) and the Natural Science Foundation of Guangdong Province, China, under the project "Deep Learning based Chinese Combination Category Grammar Parsing and its Application in Relation Extraction". It is also supported by Shenzhen Institute of Artificial Intelligence and Robotics for Society under the project "Automatic Knowledge Enhanced Natural Language Understanding and Its Applications" (AC01202101001). + +# References + +Livio Baldini Soares, Nicholas FitzGerald, Jeffrey Ling, and Tom Kwiatkowski. 2019. Matching the Blanks: Distributional Similarity for Relation Learning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2895-2905. +Guimin Chen, Yuanhe Tian, and Yan Song. 2020. Joint Aspect Extraction and Sentiment Analysis with Directional Graph Convolutional Networks. In Proceedings of the 28th International Conference on Computational Linguistics, pages 272-279. +Guimin Chen, Yuanhe Tian, Yan Song, and Xiang Wan. 2021. Relation Extraction with Type-aware Map Memories of Word Dependencies. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 2501-2512, Online. +Fenia Christopoulou, Makoto Miwa, and Sophia Ananiadou. 2018. A Walk-based Model on Entity Graphs for Relation Extraction. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 81-88. +Greg Coppola and Mark Steedman. 2013. The Effect of Higher-order Dependency Features in Discriminative Phrase-structure Parsing. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 610–616, Sofia, Bulgaria. +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. +Bayu Distiawan, Gerhard Weikum, Jianzhong Qi, and Rui Zhang. 2019. Neural Relation Extraction for Knowledge Base Enrichment. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 229-240. + +Chunning Du, Haifeng Sun, Jingyu Wang, Qi Qi, and Jianxin Liao. 2020. Adversarial and domain-aware BERT for cross-domain sentiment analysis. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4019-4028, Online. +Zhijiang Guo, Yan Zhang, and Wei Lu. 2019. Attention Guided Graph Convolutional Networks for Relation Extraction. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 241-251. +Iris Hendrickx, Su Nam Kim, Zornitsa Kozareva, Preslav Nakov, Diarmuid O Seaghdha, Sebastian Padó, Marco Pennacchiotti, Lorenza Romano, and Stan Szpakowicz. 2010. SemEval-2010 Task 8: Multi-Way Classification of Semantic Relations between Pairs of Nominals. In Proceedings of the 5th International Workshop on Semantic Evaluation, pages 33-38. +Tao Ji, Yuanbin Wu, and Man Lan. 2019. Graph-based dependency parsing with graph neural networks. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2475-2485, Florence, Italy. +Hidetaka Kamigaito, Katsuhiko Hayashi, Tsutomu Hiroa, and Masaaki Nagata. 2018. Higher-order Syntactic Attention Network for Longer Sentence Compression. 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 1716-1726, New Orleans, Louisiana. +Zhen Ke, Liang Shi, Songtao Sun, Erli Meng, Bin Wang, and Xipeng Qiu. 2021. Pre-training with Meta Learning for Chinese Word Segmentation. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5514-5523, Online. +Eliyahu Kiperwasser and Yoav Goldberg. 2015. Semi-supervised Dependency Parsing using Bilexical Contextual Features from Auto-Parsed Data. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 1348-1353, Lisbon, Portugal. +Nikita Kitaev and Dan Klein. 2018. Constituency Parsing with a Self-Attentive Encoder. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2676-2686, Melbourne, Australia. +Alexandros Komninos and Suresh Manandhar. 2016. Dependency Based Embeddings for Sentence Classification Tasks. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1490-1500, San Diego, California. + +Omer Levy and Yoav Goldberg. 2014. Dependency-Based Word Embeddings. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 302-308, Baltimore, Maryland. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising Sequence-to-Sequence Pretraining for Natural Language Generation, Translation, and Comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7871-7880, Online. +Tao Li, Parth Anand Jawale, Martha Palmer, and Vivek Srikumar. 2020a. Structured Tuning for Semantic Role Labeling. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8402-8412, Online. +Zuchao Li, Shexia He, Jiaxun Cai, Zhuosheng Zhang, Hai Zhao, Gongshen Liu, Linlin Li, and Luo Si. 2018. A Unified Syntax-aware Framework for Semantic Role Labeling. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2401-2411, Brussels, Belgium. +Zuchao Li, Hai Zhao, Rui Wang, and Kevin Parnow. 2020b. High-order Semantic Role Labeling. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1134-1151, Online. +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. +Angrosh Mandya, Danushka Bollegala, and Frans Coenen. 2020. Graph Convolution over Multiple Dependency Sub-graphs for Relation Extraction. In Proceedings of the 28th International Conference on Computational Linguistics, pages 6424-6435. +Christopher D Manning, Mihai Surdeanu, John Bauer, Jenny Rose Finkel, Steven Bethard, and David McClosky. 2014. The stanford corenlp natural language processing toolkit. In Proceedings of 52nd annual meeting of the association for computational linguistics: system demonstrations, pages 55-60. +Diego Marcheggiani and Ivan Titov. 2017. Encoding Sentences with Graph Convolutional Networks for Semantic Role Labeling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1506-1515, Copenhagen, Denmark. +Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. 1993. Building a Large Annotated Corpus of English: The Penn Treebank. Computational Linguistics, 19(2):313-330. + +Yuyang Nie, Yuanhe Tian, Yan Song, Xiang Ao, and Xiang Wan. 2020. Improving Named Entity Recognition with Attentive Ensemble of Syntactic Information. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 4231-4245. +Nanyun Peng, Hoifung Poon, Chris Quirk, Kristina Toutanova, and Wen-tau Yih. 2017. Cross-sentence N-ary Relation Extraction with Graph LSTMs. Transactions of the Association for Computational Linguistics, 5:101-115. +Prokopis Prokopidis and Haris Papageorgiou. 2014. Experiments for Dependency Parsing of Greek. In Proceedings of the First Joint Workshop on Statistical Parsing of Morphologically Rich Languages and Syntactic Analysis of Non-Canonical Languages, pages 90–96, Dublin, Ireland. +Han Qin, Guimin Chen, Yuanhe Tian, and Yan Song. 2021a. Improving Arabic Diacritization with Regularized Decoding and Adversarial Training. In Proceedings of the Joint Conference of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing. +Han Qin, Yuanhe Tian, and Yan Song. 2021b. Relation Extraction with Word Graphs from N-grams. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 2860–2868, Online and Punta Cana, Dominican Republic. +Michael Roth and Mirella Lapata. 2016. Neural Semantic Role Labeling with Dependency Path Embeddings. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1192-1202, Berlin, Germany. +Devendra Sachan, Yuhao Zhang, Peng Qi, and William L. Hamilton. 2021. Do Syntax Trees Help Pre-trained Transformers Extract Information? In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 2647-2661, Online. +Tianze Shi, Igor Malioutov, and Ozan Irsoy. 2020. Semantic Role Labeling as Syntactic Dependency Parsing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7551-7571, Online. +Livio Baldini Soares, Nicholas FitzGerald, Jeffrey Ling, and Tom Kwiatkowski. 2019. Matching the Blanks: Distributional Similarity for Relation Learning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2895-2905. +Richard Socher, Brody Huval, Christopher D. Manning, and Andrew Y. Ng. 2012. Semantic Compositionality through Recursive Matrix-Vector Spaces. In Proceedings of the 2012 Joint Conference on + +Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pages 1201-1211. +Yan Song and Shuming Shi. 2018. Complementary Learning of Word Embeddings. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, pages 4368-4374. +Yan Song, Tong Zhang, Yonggang Wang, and Kai-Fu Lee. 2021. ZEN 2.0: Continue Training and Adaptation for N-gram Enhanced Text Encoders. arXiv preprint arXiv:2105.01279. +Kai Sun, Richong Zhang, Yongyi Mao, Samuel Mensah, and Xudong Liu. 2020. Relation Extraction with Convolutional Network over Learnable Syntax-Transport Graph. In AAAI, pages 8928-8935. +Yu Sun, Shuohuan Wang, Shikun Feng, Siyu Ding, Chao Pang, Junyuan Shang, Jiaxiang Liu, Xuyi Chen, Yanbin Zhao, Yuxiang Lu, et al. 2021. Ernie 3.0: Large-scale Knowledge Enhanced Pre-training for Language Understanding and Generation. arXiv preprint arXiv:2107.02137. +Yuanhe Tian, Guimin Chen, Yan Song, and Xiang Wan. 2021. Dependency-driven Relation Extraction with Attentive Graph Convolutional Networks. In Proceedings of the Joint Conference of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing. +Yuanhe Tian, Yan Song, Fei Xia, and Tong Zhang. 2020. Improving Constituency Parsing with Span Attention. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1691-1703. +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. +Petar Velicković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. 2017. Graph Attention Networks. arXiv preprint arXiv:1710.10903. +Jue Wang and Wei Lu. 2020. Two are better than one: Joint entity and relation extraction with table-sequence encoders. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1706-1721, Online. +Linlin Wang, Zhu Cao, Gerard De Melo, and Zhiyuan Liu. 2016. Relation Classification via Multi-Level Attention CNNs. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1298-1307. + +Lu Wang and Claire Cardie. 2012. Focused Meeting Summarization via Unsupervised Relation Extraction. In Proceedings of the 13th Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 304-313. +Yijun Wang, Changzhi Sun, Yuanbin Wu, Junchi Yan, Peng Gao, and Guotong Xie. 2020. Pre-training entity relation encoder with intra-span and inter-span information. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1692-1705, Online. +Yijun Wang, Changzhi Sun, Yuanbin Wu, Hao Zhou, Lei Li, and Junchi Yan. 2021. UNIRE: A Unified Label Space for Entity Relation Extraction. arXiv preprint arXiv:2107.04292. +Shanchan Wu and Yifan He. 2019. Enriching Pre-trained Language Model with Entity Information for Relation Classification. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management, pages 2361-2364. +Kun Xu, Siva Reddy, Yansong Feng, Songfang Huang, and Dongyan Zhao. 2016. Question Answering on Freebase via Relation Extraction and Textual Evidence. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2326-2336. +Yan Xu, Lili Mou, Ge Li, Yunchuan Chen, Hao Peng, and Zhi Jin. 2015. Classifying Relations via Long Short Term Memory Networks Along Shortest Dependency Paths. In Proceedings of the 2015 conference on empirical methods in natural language processing, pages 1785-1794. +Zenan Xu, Daya Guo, Duyu Tang, Qinliang Su, Linjun Shou, Ming Gong, Wanjun Zhong, Xiaojun Quan, Daxin Jiang, and Nan Duan. 2021. Syntax-Enhanced Pre-trained Model. 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 5412-5422, Online. +Hang Yan, Xipeng Qiu, and Xuanjing Huang. 2020. A Graph-based Model for Joint Chinese Word Segmentation and Dependency Parsing. Transactions of the Association for Computational Linguistics, 8:78-92. +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 32, pages 5753-5763. +Wei Ye, Bo Li, Rui Xie, Zhonghao Sheng, Long Chen, and Shikun Zhang. 2019. Exploiting Entity BIO Tag Embeddings and Multi-task Learning for Relation Extraction with Imbalanced Data. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1351-1360. + +Bowen Yu, Mengge Xue, Zhenyu Zhang, Tingwen Liu, Yubin Wang, and Bin Wang. 2020a. Learning to Prune Dependency Trees with Rethinking for Neural Relation Extraction. In Proceedings of the 28th International Conference on Computational Linguistics, pages 3842-3852. +Bowen Yu, Mengge Xue, Zhenyu Zhang, Tingwen Liu, Wang Yubin, and Bin Wang. 2020b. Learning to Prune Dependency Trees with Rethinking for Neural Relation Extraction. In Proceedings of the 28th International Conference on Computational Linguistics, pages 3842-3852, Barcelona, Spain (Online). +Juntao Yu and Bernd Bohnet. 2017. Dependency language models for transition-based dependency parsing. In Proceedings of the 15th International Conference on Parsing Technologies, pages 11-17, Pisa, Italy. +Daojian Zeng, Kang Liu, Siwei Lai, Guangyou Zhou, and Jun Zhao. 2014. Relation Classification via Convolutional Deep Neural Network. In Proceedings of COLING 2014, the 25th International Conference on Computational Linguistics: Technical Papers, pages 2335-2344. +Dongxu Zhang and Dong Wang. 2015. Relation classification via recurrent neural network. arXiv preprint arXiv:1508.01006. +Yuhao Zhang, Peng Qi, and Christopher D. Manning. 2018. Graph Convolution over Pruned Dependency Trees Improves Relation Extraction. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2205-2215. +Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D. Manning. 2017. Position-aware Attention and Supervised Data Improve Slot Filling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 35-45. +Peng Zhou, Wei Shi, Jun Tian, Zhenyu Qi, Bingchen Li, Hongwei Hao, and Bo Xu. 2016. Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 207-212. \ No newline at end of file diff --git a/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/images.zip b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..035f54757b0e8e8fd0bdfa74c74af803ffeaa06f --- /dev/null +++ b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e74f032cf4ae06d4bdcb07188ecf9e6e4611c13e27c6721b48647b552470c28 +size 526352 diff --git a/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/layout.json b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a0081dfb536e31466aeada0254e64a9133052df8 --- /dev/null +++ b/improvingrelationextractionthroughsyntaxinducedpretrainingwithdependencymasking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64bf650e97ccb4b2f6778d075b36dce5c07660d7207243f9cb646d95c60104a9 +size 394984 diff --git a/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_content_list.json b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ccfbc07a03c59dfe63bfd39bcef1cec45d2230fe --- /dev/null +++ b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e0fea3c1ace7b89d47bc89d2ce2bc8b9ab3fe9cb604bb877640a2c1952e9fe0 +size 79904 diff --git a/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_model.json b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ef4babfdf82caf03f3606045c3ed264f2277cc91 --- /dev/null +++ b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca3a50d4149f540aeaeec576e608f25f668e8710c6116e5f93487c5a29a548b9 +size 101534 diff --git a/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_origin.pdf b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bcef9983c27d9be5552b95a3ab3dfeed3c1b11a0 --- /dev/null +++ b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/36039a6c-6e25-4e1d-b478-d3982eac5197_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f7b39fcded1070c4b19419c82c6a8fc791074e54850e0ca082d83c06815d379 +size 453358 diff --git a/improvingrobustnessoflanguagemodelsfromageometryawareperspective/full.md b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9a5166b2f4d729701f7590c1a891039f61c59fd8 --- /dev/null +++ b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/full.md @@ -0,0 +1,366 @@ +# Improving Robustness of Language Models from a Geometry-aware Perspective + +Bin Zhu $^{1}$ , Zhaoquan Gu $^{1,2*}$ , Le Wang $^{1,2}$ , Jinyin Chen $^{3}$ , Qi Xuan $^{3}$ + +1 Cyberspace Institute of Advanced Technology (CIAT), Guangzhou University, Guangzhou 510006, China + +$^{2}$ Institute of Cyberspace Platform, Peng Cheng Laboratory, Shenzhen 999077, China + +$^{3}$ Institute of Cyberspace Security, Zhejiang University of Technology, Hangzhou 310023, China + +zhubin@e.gzhu.edu.cn, {zqgu,wangle}@gzhu.edu.cn + +{chenjinyin,xuanqi}@zjut.edu.cn + +# Abstract + +Recent studies have found that removing the norm-bounded projection and increasing search steps in adversarial training can significantly improve robustness. However, we observe that a too large number of search steps can hurt accuracy. We aim to obtain strong robustness efficiently using fewer steps. Through a toy experiment, we find that perturbing the clean data to the decision boundary but not crossing it does not degrade the test accuracy. Inspired by this, we propose friendly adversarial data augmentation (FADA) to generate friendly adversarial data. On top of FADA, we propose geometry-aware adversarial training (GAT) to perform adversarial training on friendly adversarial data so that we can save a large number of search steps. Comprehensive experiments across two widely used datasets and three pretrained language models demonstrate that GAT can obtain stronger robustness via fewer steps. In addition, we provide extensive empirical results and in-depth analyses on robustness to facilitate future studies. + +# 1 Introduction + +Deep neural networks (DNNs) have achieved great success on many natural language processing (NLP) tasks (Kim, 2014; Vaswani et al., 2017; Devlin et al., 2019). However, recent studies (Szegedy et al., 2013; Goodfellow et al., 2015) have shown that DNNs are vulnerable to crafted adversarial examples. For instance, an attacker can mislead an online sentiment analysis system by making minor changes to the input sentences (Papernot et al., 2016; Liang et al., 2017). It has raised concerns among researchers about the security of DNN-based NLP systems. As a result, a growing number of studies are focusing on enhancing robustness to defend against textual adversarial attacks (Jia et al., 2019; Ye et al., 2020; Jones et al., 2020; Zhu et al., 2020). + +![](images/be8cdf616a074ccac40c589ae4885c6973aaa7077b425a816ae2f4f8ede4fbf1.jpg) +Figure 1: The clean accuracy achieved with ADA, FADA, and the original training set. During training, both ADA and FADA have close to $100\%$ accuracy. However, ADA only achieves $\sim 15\%$ accuracy during testing while FADA maintains the same test accuracy with the original training set. This indicates that training data which crosses the decision boundary hurts the accuracy significantly. + +Existing adversarial defense methods fall into two categories: empirical and certified defenses. Empirical defenses include gradient-based adversarial training (AT) and discrete adversarial data augmentation (ADA). Certified defenses provide a provable guaranteed robustness boundary for NLP models. This work focuses on empirical defenses. + +There was a common belief that gradient-based AT methods in NLP was ineffective compared with ADA in defending against textual adversarial attacks (Li and Qiu, 2021; Si et al., 2021). Li et al. (2021) find that removing the norm-bounded projection and increasing the number of search steps in adversarial training can significantly improve robustness. Nonetheless, we observe that increasing the number of search steps further does not significantly improve robustness but hurts accuracy. + +We give a possible explanation from a geometry-aware perspective. Removing the norm-bounded projection enlarge the search space. Appropriately + +![](images/d6c548db3d40b69cca7086c167efaf2dc6eea004802d1aba4ab09aff6eb4948d.jpg) +Figure 2: Illustration of GAT. Our GAT can save many search steps since friendly adversarial examples are located near the decision boundary. + +increasing the number of search steps brings the adversarial data closer to the decision boundary. In this case, the model learns a robust decision boundary. Further increasing the number of search steps can make the adversarial data cross the decision boundary too far, hindering the training of natural data and hurting natural accuracy. + +To verify our hypothesis, we train a base model using adversarial data, which are generated by adversarial word substitution (AWS) on the SST-2 (Socher et al., 2013) dataset. We report its training accuracy ("ada training acc") on adversarial data and test accuracy ("ada test acc") on the clean test set in Figure 1. Although achieving nearly $100\%$ training accuracy, its test accuracy is only about $15\%$ , which implicates the adversarial data make the test performance degraded. Then we train another base model, whose training data is more "friendly". We just recover their last modified words to return to the correct class, namely friendly adversarial data augmentation (FADA). It means that only one word is different in each sentence. Surprisingly, it achieves a high test accuracy of $\sim 93\%$ . + +This preliminary inspired us to address two existing problems: + +- The number of search steps is always large, which is computationally inefficient. +- A too large number of steps leads to degraded test performance. + +Geometrically speaking, the friendly adversarial data are close to the ideal decision boundary. We can address the above two issues in one fell + +swoop if we perform gradient-based adversarial training on these friendly adversarial data. It is like we start one step before the end, allowing us to obtain strong robustness through a tiny number of search steps. We name it geometry-aware adversarial training (GAT). Figure 2 illustrates our proposed GAT. + +In addition, the friendly adversarial data only need to be generated once per dataset. It can be reused, so it is computationally efficient. It can also be updated for every iteration or epoch but computationally expensive. + +Our contributions are summarized as follows: + +1) We propose FADA to generate friendly adversarial data which are close to the decision boundary (but not crossing it). +2) We propose GAT, a geometry-aware adversarial training method that adds FADA to the training set and performs gradient-based adversarial training. +3) GAT is computationally efficient, and it outperforms state-of-the-art baselines even if using the simplest FGM. We further provide extensive ablation studies and in-depth analyses on GAT, contributing to a better understanding of robustness. + +# 2 Related Work + +# 2.1 Standard Adversarial Training + +Let $f_{\theta}(x)$ be our neural network, $\mathcal{L}(f_{\theta}(x), y)$ be the loss function (e.g., cross entropy), where $x \in X$ is the input data and $y \in Y$ is the true label. The learning objective of standard adversarial training is + +$$ +\min _ {\theta} \mathbb {E} _ {(X, Y) \sim D} \left[ \max _ {\| \delta \| \leq \epsilon} \mathcal {L} \left(f _ {\theta} (X + \delta), y\right) \right], \tag {1} +$$ + +where $D$ is the data distribution, $\delta$ is the minor perturbation, $\epsilon$ is the allowed perturbation size. To optimize the intractable min-max problem, we search for the optimal $\delta$ to maximize the inner loss and then minimize the outer loss w.r.t the parameters $\theta$ , step by step. + +The gradient $g$ of the inner loss w.r.t the input $x$ is used to find the optimal perturbation $\delta$ . Goodfellow et al. (2015) proposed fast gradient sign method (FGSM) to obtain $\delta$ by one step: + +$$ +\delta = \epsilon \cdot \operatorname {s g n} (g), \tag {2} +$$ + +where $\operatorname{sgn}(\cdot)$ is the signum function. Madry et al. (2018) proposed projected gradient descent (PGD) to solve the inner maximization as follows: + +$$ +\delta^ {(t + 1)} = \Pi \alpha \cdot g ^ {(t)} / \| g ^ {(t)} \|, \forall t \geq 0, \tag {3} +$$ + +where $\alpha > 0$ is the step size (i.e., adversarial learning rate), $\Pi$ is the projection function that projects the perturbation onto the $\epsilon$ -norm ball. Conventionally PGD stops after a predefined number of search steps $K$ , namely PGD- $K$ . In addition, TRADES (Zhang et al., 2019), MART (Wang et al., 2020) and FAT (Zhang et al., 2020) are also effective adversarial training methods for boosting model robustness. + +Regarding FAT, the authors propose to stop adversarial training in a predefined number of steps after crossing the decision boundary, which is a little different from our definition of "friendly". + +# 2.2 Adversarial Training in NLP + +Gradient-based adversarial training has significantly improved model robustness in vision, while researchers find it helps generalization in NLP. Miyato et al. (2017) find that adversarial and virtual adversarial training have good regularization performance. Sato et al. (2018) propose an interpretable adversarial training method that generates reasonable adversarial texts in the embedding space and enhance models' performance. Zhu et al. (2020) develop FreeLB to improve natural language understanding. + +There is also a lot of work focused on robustness. Wang et al. (2021) improve model robustness from an information theoretic perspective. Dong et al. (2021) use a convex hull to capture and defense against adversarial word substitutions. Zhou et al. (2021) train robust models by augmenting training data using Dirichlet Neighborhood Ensemble (DNE). + +Besides, adversarial data augmentation is another effective approach to improve robustness (Ebrahimi et al., 2018; Li et al., 2019; Ren et al., 2019; Jin et al., 2019; Zang et al., 2020; Li et al., 2020; Garg and Ramakrishnan, 2020; Si et al., 2021). However, it only works when the augmentation happens to be generated by the same attacking method and often hurts accuracy. + +It is worth noting that recent empirical results have shown that previous gradient-based adversarial training methods have little effect on defending against textual adversarial attacks (Li et al., 2021; + +Algorithm 1 Friendly Adversarial Data Augmentation (FADA) + +Input: The original text $x$ , ground truth label $y_{true}$ , base model $f_{\theta}$ , adversarial word substitution function $AWS(\cdot)$ + +Output: The friendly adversarial example $x_{f}$ + +1: Initialization: +2: $x_{f}\gets x$ +3: the last modified word $w^{*} \gets$ None +4: the last modified index $i^{*} \gets 0$ +5: $x_{adv},w^{*},i^{*} = AWS(x,y_{true},f_{\theta})$ +6: if $w^* =$ None then +7: return $x_{f}$ +8: end if +9: Replace $w_{i^*}$ in $x_{adv}$ with $w^*$ +10: $x_{f}\gets x_{adv}$ +11: return $x_{f}$ + +Si et al., 2021). The authors benchmark existing defense methods and conclude that gradient-based AT can achieve the strongest robustness by removing the norm bounded projection and increasing the search steps. + +# 3 Methodology + +# 3.1 Friendly Adversarial Data Augmentation + +For a sentence $x \in X$ with a length of $n$ , it can be denoted as $x = w_{1}w_{2}\dots w_{i}\dots w_{n - 1}w_{n}$ , where $w_{i}$ is the $i$ -th word in $x$ . Its adversarial counterpart $x_{adv}$ can be denoted as $w_{1}'w_{2}'\dots w_{i}'\dots w_{n - 1}'w_{n}'$ . In this work, $x_{adv}$ is generated by adversarial word substitution, so $x_{adv}$ has the same length with $x$ . Conventional adversarial data augmentation generates adversarial data fooling the victim model and mixes them with the original training set. As we claim in section 1, these adversarial data can hurt test performance. An interesting and critical question is when it becomes detrimental to test accuracy. + +One straightforward idea is to recover all the $x_{adv}$ to $x$ word by word and evaluate their impact on test accuracy. We train models only with these adversarial data and test models with the original test set. We are excited that the test accuracy immediately returns to the normal level when we recover the last modified word. We denote these data with only one word recovered as $x_f$ . Geometrically, the only difference between $x_{adv}$ and $x_f$ is whether they have crossed the decision boundary. + +To conclude, when the adversarial data cross the + +Algorithm 2 Ideal Geometry-aware Adversarial Training (GAT) + +
Input: Our base network fθ, cross entropy loss LCE, training set D = {xi,yi}ni=1n, number of epochs T, batch size m, number of batches M
Output: robust network fθ
1: for epoch = 1 to T do
2: for batch = 1 to M do
3: Sample a mini-batch b = {(xi,yi)}m i=1
4: for all xi in b do
5: Generate friendly adversarial example xifyi via Algorithm 1
6: Apply an adversarial training method (e.g., FreeLB++) on both xi and xifyi to obtain their adversarial counterpart xifyi and xifyi
7: end for
8: Update fθ via ∇xLCE(fθ(τxi),yi) and ∇xLCE(fθ(τxi),yi)
9: end for
10: end for
+ +decision boundary, they become incredibly harmful to the test performance. We name all the $x_{f}$ as friendly adversarial examples (FAEs) because they improve model robustness without hurting accuracy. Similarly, we name the generation of FAEs as friendly adversarial data augmentation (FADA). We show our proposed FADA in Algorithm 1. + +# 3.2 Geometry-aware Adversarial Training + +# 3.2.1 Seeking for the optimal $\delta$ + +Recall the inner maximization issue of the learning objective in Eq. (1). Take PGD- $K$ as an instance. It divides the search for the optimal perturbation $\delta$ into $K$ search steps, and each step requires a backpropagation (BP), which is computationally expensive. + +We notice that random initialization of $\delta^0$ is widely used in adversarial training, where $\delta^0$ is always confined to a $\epsilon$ -ball centered at $x$ . However, we initialize the clean data via discrete adversarial word substitution in NLP. It is similar to data augmentation (DA), with the difference that we perturb clean data in the direction towards the decision boundary, whereas the direction of data augmentation is random. + +By doing so, we decompose the $\delta$ into two parts, which can be obtained by word substitution and gradient-based adversarial training, respectively. We denote them as $\delta_{l}$ and $\delta_{s}$ . Therefore, the inner maximization can be reformulated as + +$$ +\max _ {\| \delta_ {l} + \delta_ {s} \| \leq \epsilon} \mathcal {L} \left(f _ {\theta} \left(X + \delta_ {l} + \delta_ {s}\right), y\right). \tag {4} +$$ + +We aim to find the maximum $\delta_l$ that helps improve robustness without hurting accuracy. As we + +claim in Section 3.1, FADA generates friendly adversarial data which are close to the decision boundary. Furthermore, the model trained with these friendly adversarial data keeps the same test accuracy as the original training set (Figure 1). Therefore we find the maximum $\delta_l$ which is harmless to the test accuracy through FADA. + +Denote $X_{f}$ as the friendly adversarial data generated by FADA, Eq. (4) can be reformulated as + +$$ +\max _ {\| \delta_ {s} \| \leq \epsilon} \mathcal {L} \left(f _ {\theta} \left(X _ {f} + \delta_ {s}\right), y\right). \tag {5} +$$ + +The tiny $\delta_{s}$ can be obtained by some gradient-based adversarial training methods (e.g., FreeLB++ (Li et al., 2021)) in few search steps. As a result, a large number of search steps are saved to accelerate adversarial training. We show our proposed geometry-aware adversarial training in Algorithm 2. + +# 3.2.2 Final Learning Objective + +It is computationally expensive to update friendly adversarial data for every mini-batch. In practice, we generate static augmentation $(X_{f},\Upsilon)$ for the training dataset (X,Y) and find it works well with GAT. The static augmentation $(X_{f},\Upsilon)$ is reusable. Therefore, GAT is computationally efficient. + +Through such a tradeoff, our final objective function can be formulated as + +$$ +\begin{array}{l} \mathcal {L} = \mathcal {L} _ {C E} (X, Y, \theta) \tag {6} \\ + \mathcal {L} _ {C E} (\widetilde {X}, Y, \theta) + \mathcal {L} _ {C E} (\widetilde {X} _ {f}, Y, \theta), \\ \end{array} +$$ + +where $\mathcal{L}_{CE}$ is the cross entropy loss, $\widetilde{X}$ and $\widetilde{X}_f$ are generated from $X$ and $X_{f}$ using gradient-based adversarial training methods, respectively. + +# 4 Experiments + +# 4.1 Datasets + +We conduct experiments on the SST-2 (Socher et al., 2013) and IMDb (Maas et al., 2011) datasets which are widely used for textual adversarial learning. Statistical details are shown in Table 1. We use the GLUE (Wang et al., 2019) version of the SST-2 dataset whose test labels are unavailable. So we report its accuracy on the develop set in our experiments. + +
Dataset# train# dev / testavg. length
SST-26734987217
IMDb2500025000201
+ +Table 1: Summary of the two datasets. + +
SST-2Clean %TextFoolerTextBuggerBAE
RA %ASR %# QueryRA %ASR %# QueryRA %ASR %# Query
BERTbase92.432.864.172.838.557.844.339.856.564.0
ADA92.246.748.779.442.053.947.041.254.864.0
ASCC87.232.063.371.627.868.242.541.752.163.0
DNE86.626.569.669.023.473.140.244.249.365.8
InfoBERT92.241.754.874.945.251.145.845.450.865.6
TAVAT92.240.456.374.342.354.245.742.753.864.2
FreeLB93.142.753.775.948.247.745.746.749.367.5
FreeLB++1093.341.954.875.846.150.345.944.252.465.3
FreeLB++3093.445.650.678.147.448.845.742.953.666.0
FreeLB++5092.045.550.477.247.448.445.344.651.467.5
GATFGM(ours)92.845.849.878.549.046.347.045.550.164.9
GATFreeLB++10(ours)93.249.546.380.652.443.247.948.346.968.9
GATFreeLB++30(ours)92.752.542.282.353.840.947.546.150.065.8
+ +Table 2: Main defense results on the SST-2 dataset, including the test accuracy on the clean test set (Clean %), the robust accuracy under adversarial attacks (RA %), the attack success rate (ASR %), and the average number of queries requiring by the attacker (# Query). + +# 4.2 Attacking Methods + +Follow Li et al. (2021), we adopt TextFooler (Jin et al., 2019), TextBugger (Li et al., 2019) and BAE (Garg and Ramakrishnan, 2020) as attackers. TextFooler and BAE are word-level attacks and TextBugger is a multi-level attacking method. We also impose restrictions on these attacks for a fair comparison, including: + +1. The maximum percentage of perturbed words $p_{max}$ +2. The minimum semantic similarity $\varepsilon_{min}$ between the original input and the generated adversarial example +3. The maximum size $K_{syn}$ of one word's synonym set + +Since the average sentence length of IMDb and SST-2 are different, $p_{max}$ is set to 0.1 and 0.15, respectively; $\varepsilon_{min}$ is set to 0.84; and $K_{syn}$ is set to 50. All settings are referenced from previous work. + +# 4.3 Adversarial Training Baselines + +We use $\mathrm{BERT}_{\mathrm{base}}$ (Devlin et al., 2019) as the base model to evaluate the impact of the following variants of adversarial training on accuracy and robustness and provide a comprehensive comparison with our proposed GAT. + +- Adversarial Data Augmentation +- ASCC (Dong et al., 2021) +DNE (Zhou et al., 2021) + +InfoBERT (Wang et al., 2021) +TAVAT (Li and Qiu, 2021) +FreeLB (Zhu et al., 2020) +FreeLB++ (Li et al., 2021) + +ASCC and DNE adopt a convex hull during training. InfoBERT improves robustness using mutual information. TAVAT establishes a token-aware robust training framework. FreeLB++ removes the norm bounded projection and increases search steps. + +We only compare GAT with adversarial training-based defense methods and leave comparisons with other defense methods (e.g., certified defenses) for future work. + +# 4.4 Implementation Details + +We implement ASCC, DNE, InfoBERT, and TAVAT models based on TextDefender (Li et al., 2021). We implement FGM, FreeLB, FreeLB++, and our GAT based on HuggingFace Transformers. We implement ADA and FADA based on TextAttack (Morris et al., 2020). All the adversarial hyper-parameters settings are following their original papers. All the models are trained on two GeForce RTX 2080 GPUs and eight Tesla T4 GPUs. + +Regarding the training settings and hyperparameters, the optimizer is AdamW (Loshchilov and Hutter, 2019); the learning rate is $2e^{-5}$ ; the number of epochs is 10; the batch size is 64 for + +
IMDbClean %TextFoolerTextBuggerBAE
RA %ASR %# QueryRA %ASR %# QueryRA %ASR %# Query
BERTbase91.230.766.4714.438.957.4490.336.060.6613.6
ADA91.434.661.7804.840.555.2538.837.059.1693.4
ASCC86.422.273.9595.927.268.0415.834.759.1642.2
DNE86.114.982.2520.217.479.3336.935.457.8630.4
InfoBERT91.933.063.9694.140.455.8469.937.359.2619.6
TAVAT91.537.858.91082.648.846.9695.541.255.2896.7
FreeLB91.334.661.9782.042.952.7542.737.658.5646.7
FreeLB++-1092.139.556.8817.946.449.3516.541.255.0682.3
FreeLB++-3092.349.845.6992.956.038.8600.148.347.2788.2
FreeLB++-5092.350.245.31117.756.538.5649.848.247.5861.3
GATFGM(ours)91.858.336.01004.360.433.7556.154.640.1747.4
GATFreeLB++10(ours)92.050.744.71093.854.740.4648.950.744.7908.5
GATFreeLB++30(ours)92.459.035.71629.462.232.2914.854.440.71213.6
+ +SST-2 and 24 for IMDb; the maximum sentence length kept for all the models is 40 for SST-2 and 200 for IMDb. + +# 4.5 Main Results + +Our proposed GAT can easily combine with other adversarial training methods. In our experiments, we combine GAT with FGM (GAT $F_{GM}$ ) and FreeLB++ (GATFreeLB++, respectively. We aim to evaluate if GAT can bring improvements to the simplest (FGM) and the most effective (FreeLB++) AT methods. + +We summarize the main defense results on the SST-2 dataset in Table 2. When GAT works with the simplest adversarial training method, FGM, the resulting robustness improvement exceeds $\mathrm{FreeLB} + + 50$ . The effectiveness and efficiency of GAT allow us to obtain strong robustness while saving many search steps. Further combining $\mathrm{FreeLB} + +$ on GAT can obtain stronger robustness and outperform all other methods. + +Regarding the accuracy, FreeLB++30 obtains the highest $93.4\%$ . GAT also significantly improves accuracy. + +In addition, ADA is effective in improving robustness but hurts accuracy. It is not surprising that ASCC and DNE suffer from significant performance losses. However, there is no improvement in robustness and even weaker robustness under TextFooter and TextBugger attacks than the other methods. + +Table 3 shows the defense results on the IMDb dataset. The defense performances are generally consistent with that on the SST-2 dataset. It is + +Table 3: Main defense results on the IMDb dataset. + +
AWSAT methodClean %RA %#Query
NoneNone92.438.544.3
NoneFGM92.539.644.7
NoneFreeLB++3093.447.445.7
ADANone92.242.047.0
ADAFGM91.342.746.6
ADAFreeLB++3090.951.547.5
FADANone92.744.445.8
FADAFGM92.849.047.0
FADAFreeLB++3092.753.847.5
+ +Table 4: Ablation studies on the SST-2 dataset. The attacking method is TextBugger. We only report RA % and #Query due to the space limit. "AWS" means adversarial word substitution methods. + +worth noting that $\mathrm{GAT}_{\mathrm{FGM}}$ achieved an extremely high RA % with a medium #Query, which needs further exploration. + +# 5 Discussions + +We further explore other factors that affect robustness and provide comprehensive empirical results. + +# 5.1 Ablation Studies + +We conduct ablation studies on the SST-2 dataset to assess the impact of each component of GAT. + +As shown in Table 4, "FADA" consistently outperforms "ADA" and "None" with different adversarial training methods. Furthermore, "FADA&FGM" achieve a higher $\mathbf{RA}\%$ than "None&FreeLB++30", which implies that "FADA" can obtain strong robustness in one adversarial search step. "ADA" also helps improve robustness. However, as the number of search steps in + +![](images/d997758a27cbfa562df23c5b3086019c556937bed63dff01257ec041507e68b4.jpg) +(a) + +![](images/772366286658c4f59ece21568bfd374758cd329c5b436b771a2e581b40e3130e.jpg) +(b) +Figure 3: (a) Robust and clean accuracy with different search steps. (b) Robust and clean accuracy with different step sizes. (c) Robust accuracy gradually increases on the SST-2 dataset during training. The adversarial training method is $\mathrm{GAT}_{\text{FreeLB++}}$ 30. Zoom in for a better view. + +![](images/36806a435c6602d7e06cc5c0209af31733ef287bd42c2939ee033e309654dbe2.jpg) +(c) + +
SST-2clean %PSOFastGA
RA %#QueryRA %#Query
BERTbase92.423.9322.039.2234.4
ADA92.231.4348.643.2268.4
ASCC87.229.2359.440.5233.2
DNE86.617.3266.243.9250.1
InfoBERT92.229.0335.745.3256.0
TAVAT92.225.7316.242.0258.7
FreeLB93.127.8325.642.9267.9
FreeLB++5092.038.4368.649.2258.9
GATFGM92.829.9341.046.7275.1
GATFreeLB++1093.234.5351.351.0289.5
GATFreeLB++3092.839.7359.253.7323.9
+ +Table 5: The defense results of different AT methods against two combinatorial optimization attacks. We remove ASR % due to the space limit. + +creases, so does the hurt it does to Clean %. On the contrary, “FADA” does not harm Clean % but improves it, implying its friendliness. + +# 5.2 Results with Other Attacks + +We have shown that GAT brings significant improvement in robustness against three greedy-based attacks. We investigate whether GAT is effective under combinatorial optimization attacks, such as PSO (Zang et al., 2020) and FastGA (Jia et al., 2019). + +We can see from Table 5 that $\mathrm{GAT}_{FreeLB++}30$ obtain the highest RA $\%$ against the two attacks and $\mathrm{GAT}_{FreeLB++}10$ has the highest clean accuracy. The results demonstrate that our proposed GAT consistently outperforms other defenses against combinatorial optimization attacks. + +# 5.3 Results with More Steps + +As we claim in Section 1, the accuracy should degrade with a large number of search steps. But what happens for robustness? + +We aim to see if RA % can be further improved. Figure 3(a) shows that the RA % gradually increases against TextFooter and TextBugger attacks. However, RA % decreases against BAE with steps more than 30, which needs more investigation. As the steps increase, the growth rate of RA % decreases, and the Clean % decreases. We conclude that a reasonable number of steps will be good for both RA % and Clean %. It is unnecessary to search for too many steps since robustness grows very slowly in the late adversarial training period while accuracy drops. + +# 5.4 Impact of Step Size + +A large step size (i.e., adversarial learning rate) will cause performance degradation for conventional adversarial training. Nevertheless, what impact does it have on robustness? We explore the impact of different step sizes on robustness and accuracy. As shown in Figure 3(b), the clean test accuracy slightly drops as the step size increases. The robust accuracy under TextFollower attack increases, while the robust accuracy under Textbugger and BAE attacks decrease. Overall, the impact of step size on robustness needs further study. + +# 5.5 Impact of Training Epochs + +Ishida et al. (2020) have shown that preventing further reduction of the training loss when reaching a small value and keeping training can help generalization. In adversarial training, it is naturally hard to achieve zero training loss due to the insufficient capacity of the model (Zhang et al., 2021). + +Therefore, we investigate whether more training iterations result in stronger robustness in adversarial training. We report the $\mathbf{RA}\%$ achieved by $\mathrm{GAT}_{\text{FreeLB++}} 30$ at each epoch in Figure 3(c). We observe that the $\mathbf{RA}\%$ tends to improve slowly, + +
SST-2Clean %TextFollowerTextBuggerBAE
RA %ASR %# QueryRA %ASR %# QueryRA %ASR %# Query
RoBERTa base93.038.858.074.541.455.245.540.356.463.6
GATFGM91.447.647.778.649.845.346.342.753.265.3
GATFreeLB++3093.252.143.795.554.241.355.847.049.176.9
+ +Table 6: Defense results on RoBERTa model on the SST-2 dataset. + +
SST-2Clean %TextFollowerTextBuggerBAE
RA %ASR %# QueryRA %ASR %# QueryRA %ASR %# Query
DeBERTabase94.653.743.479.555.142.048.749.847.566.8
GATFGM94.554.642.182.657.738.850.048.948.266.7
GATFreeLB++3094.760.435.783.462.033.951.252.244.469.9
+ +Table 7: Defense results on DeBERTa model on the SST-2 dataset. + +implying that more training iterations result in stronger model robustness using GAT. + +# 5.6 Results with Other Models + +We show that GAT can work on more advanced models. We choose RoBERTabase (Liu et al., 2019) and DeBERTabase (He et al., 2021), two improved versions of BERT, as the base models. As shown in Table 6 and Table 7, GAT slightly improve robustness of RoBERTa and DeBERTa models. + +# 5.7 Limitations + +We discuss the limitations of this work as follows. + +- As we clarify in Section 3.2.2, instead of dynamically generating friendly adversarial data in training, we choose to pre-generate static augmentation. We do this for efficiency, as dynamically generating discrete sentences in training is computationally expensive. Although it still significantly improves robustness in our experiments, such a tradeoff may lead to failure because the decision boundary changes continuously during training. +- GAT performs adversarial training on friendly adversarial data. It may help if we consider the decision boundaries when performing gradient-based adversarial training—for example, stopping early when the adversarial data crosses the decision boundary. We consider this as one of the directions for future work. + +# 6 Conclusion + +In this paper, we study how to improve robustness from a geometry-aware perspective. We first propose FADA to generate friendly adversarial data that are close to the decision boundary. Then we combine gradient-based adversarial training methods on FADA to save a large number of search steps, termed geometry-aware adversarial training (GAT). GAT can efficiently achieve state-of-the-art defense performance without hurting test accuracy. + +We conduct extensive experiments to give in-depth analysis, and we hope this work can provide helpful insights on robustness in NLP. + +# Acknowledgments + +The authors would like to thank the anonymous reviewers for their helpful suggestions and comments. This work is supported in part by the National Natural Science Foundation of China under Grant No. 61902082 and 61976064, and the Guangdong Key R&D Program of China 2019B010136003. + +# References + +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. + +Xinshuai Dong, Anh Tuan Luu, Rongrong Ji, and Hong Liu. 2021. Towards robustness against natural language word substitutions. In 9th International Con + +ference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. +Javid Ebrahimi, Anyi Rao, Daniel Lowd, and Dejing Dou. 2018. HotFlip: White-box adversarial examples for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 31-36. +Siddhant Garg and Goutham Ramakrishnan. 2020. BAE: bert-based adversarial examples for text classification. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, Online, November 16-20, 2020, pages 6174-6181. Association for Computational Linguistics. +Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. 2015. Explaining and harnessing adversarial examples. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. +Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. 2021. Deberta: decoding-enhanced bert with disentangled attention. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. +Takashi Ishida, Ikko Yamane, Tomoya Sakai, Gang Niu, and Masashi Sugiyama. 2020. Do we need zero training loss after achieving zero training error? In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 4604-4614. PMLR. +Robin Jia, Aditi Raghunathan, Kerem Göksel, and Percy Liang. 2019. Certified robustness to adversarial word substitutions. 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 4129-4142, Hong Kong, China. Association for Computational Linguistics. +Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. 2019. Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment. arXiv e-prints, page arXiv:1907.11932. +Erik Jones, Robin Jia, Aditi Raghunathan, and Percy Liang. 2020. Robust encodings: A framework for combating adversarial typos. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2752-2765, Online. Association for Computational Linguistics. +Yoon Kim. 2014. Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746-1751. + +Jinfeng Li, Shouling Ji, Tianyu Du, Bo Li, and Ting Wang. 2019. Textbugger: Generating adversarial text against real-world applications. In 26th Annual Network and Distributed System Security Symposium, NDSS 2019, San Diego, California, USA, February 24-27, 2019. The Internet Society. +Linyang Li, Ruotian Ma, Qipeng Guo, Xiangyang Xue, and Xipeng Qiu. 2020. BERT-ATTACK: Adversarial attack against BERT using BERT. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6193-6202. +Linyang Li and Xipeng Qiu. 2021. Token-aware virtual adversarial training in natural language understanding. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 8410-8418. AAAI Press. +Zongyi Li, Jianhan Xu, Jiehang Zeng, Linyang Li, Xiaoqing Zheng, Qi Zhang, Kai-Wei Chang, and Cho-Jui Hsieh. 2021. Searching for an effective defender: Benchmarking defense against adversarial word substitution. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3137-3147, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Bin Liang, Hongcheng Li, Miaoqiang Su, Pan Bian, Xirong Li, and Wenchang Shi. 2017. Deep text classification can be fooled. CoRR, abs/1704.08006. +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. CoRR, abs/1907.11692. +Ilya Loshchilov and Frank Hutter. 2019. Decoupled weight decay regularization. In International Conference on Learning Representations. +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 ACL, pages 142-150, Portland, Oregon, USA. Association for Computational Linguistics. +Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. 2018. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations. +Takeru Miyato, Andrew M. Dai, and Ian J. Goodfellow. 2017. Adversarial training methods for semi-supervised text classification. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. + +John Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. 2020. TextAttack: A framework for adversarial attacks, data augmentation, and adversarial training in NLP. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 119-126, Online. Association for Computational Linguistics. +Nicolas Papernot, Patrick D. McDaniel, Ananthram Swami, and Richard E. Harang. 2016. Crafting adversarial input sequences for recurrent neural networks. In 2016 IEEE Military Communications Conference, MILCOM 2016, Baltimore, MD, USA, November 1-3, 2016, pages 49-54. IEEE. +Shuhuai Ren, Yihe Deng, Kun He, and Wanxiang Che. 2019. Generating natural language adversarial examples through probability weighted word saliency. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1085-1097. +Motoki Sato, Jun Suzuki, Hiroyuki Shindo, and Yuji Matsumoto. 2018. Interpretable adversarial perturbation in input embedding space for text. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, July 13-19, 2018, Stockholm, Sweden, pages 4323-4330. ijcai.org. +Chenglei Si, Zhengyan Zhang, Fanchao Qi, Zhiyuan Liu, Yasheng Wang, Qun Liu, and Maosong Sun. 2021. Better robustness by more coverage: Adversarial and mixup data augmentation for robust finetuning. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 1569-1576, Online. Association for Computational Linguistics. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of EMNLP, pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics. +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Ian Erhan, Dumitru; Goodfellow, and Rob Fergus. 2013. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199. +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 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998-6008. +Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In 7th International Conference on Learning Representations, + +ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Boxin Wang, Shuohang Wang, Yu Cheng, Zhe Gan, Ruoxi Jia, Bo Li, and Jingjing Liu. 2021. Infobert: Improving robustness of language models from an information theoretic perspective. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. +Yisen Wang, Difan Zou, Jinfeng Yi, James Bailey, Xingjun Ma, and Quanquan Gu. 2020. Improving adversarial robustness requires revisiting misclassified examples. In International Conference on Learning Representations. +Mao Ye, Chengyue Gong, and Qiang Liu. 2020. SAFER: A structure-free approach for certified robustness to adversarial word substitutions. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3465-3475, Online. Association for Computational Linguistics. +Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020. Word-level textual adversarial attacking as combinatorial optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6066-6080. +Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. 2019. Theoretically principled trade-off between robustness and accuracy. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 7472-7482. PMLR. +Jingfeng Zhang, Xilie Xu, Bo Han, Gang Niu, Lizhen Cui, Masashi Sugiyama, and Mohan Kankanhalli. 2020. Attacks which do not kill training make adversarial learning stronger. In Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 11278-11287. PMLR. +Jingfeng Zhang, Jianing Zhu, Gang Niu, Bo Han, Masashi Sugiyama, and Mohan Kankanhalli. 2021. Geometry-aware instance-reweighted adversarial training. In International Conference on Learning Representations. +Yi Zhou, Xiaqing Zheng, Cho-Jui Hsieh, Kai-Wei Chang, and Xuanjing Huang. 2021. Defense against synonym substitution-based adversarial attacks via dirichlet neighborhood ensemble. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 5482-5492. Association for Computational Linguistics. + +Chen Zhu, Yu Cheng, Zhe Gan, Siqi Sun, Tom Goldstein, and Jingjing Liu. 2020. Freelb: Enhanced adversarial training for natural language understanding. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. \ No newline at end of file diff --git a/improvingrobustnessoflanguagemodelsfromageometryawareperspective/images.zip b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..543cfe3e245adefe5a4838d43ae8516d36e282bb --- /dev/null +++ b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2042bb3cafa504b3c1c1bf074c82694fd9694ddc5eec18f5ab22a7ce49b7476e +size 546033 diff --git a/improvingrobustnessoflanguagemodelsfromageometryawareperspective/layout.json b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6027cc68f3254256610f77a60e870a9c84b13985 --- /dev/null +++ b/improvingrobustnessoflanguagemodelsfromageometryawareperspective/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7da567c2d9f4bb31986c6a3d933b26b9542d95594be0d7e2a6a2f99a1464cbc9 +size 427063 diff --git a/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_content_list.json b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cd398299360ee2007a3edeb3dd311619ba264560 --- /dev/null +++ b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb2eab448d21fdbde2d9517d7f373dff5d261d7c37aeb6b6e3894279f21336aa +size 78813 diff --git a/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_model.json b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3e63b1427dcb8722a3d8dbf418c886fa36f6c8ae --- /dev/null +++ b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93e0f3e58218b1d4805085632f81035cd2c8fc3149540968c146092c357cdd24 +size 94832 diff --git a/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_origin.pdf b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e5ba0855121d36110c85d02ab264412419dd16e7 --- /dev/null +++ b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/ff7b75c2-c81c-4c85-bc60-80dd26ad8a24_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbccc462854a445356b0b71afc1d1d5fda41129da247a13d18de593a517b95b8 +size 1304640 diff --git a/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/full.md b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/full.md new file mode 100644 index 0000000000000000000000000000000000000000..07a73e76c6d52afd2e412bea534fae53ef0fe3da --- /dev/null +++ b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/full.md @@ -0,0 +1,296 @@ +# Improving the Adversarial Robustness of NLP Models by Information Bottleneck + +Cenyuan Zhang $^{1,2*}$ , Xiang Zhou $^{1,2*}$ , Yixin Wan $^{3}$ , Xiaoqing Zheng $^{1,2}$ , Kai-Wei Chang $^{3}$ , Cho-Jui Hsieh $^{3}$ + +$^{1}$ School of Computer Science, Fudan University, Shanghai, China + +$^{2}$ Shanghai Key Laboratory of Intelligent Information Processing + +$^{3}$ Department of Computer Science, University of California, Los Angeles, USA + +{zhouxiang20, cenyuanzhang17, zhengxq}@fudan.edu.cn + +elaine1wan@g.ucla.edu,{kwchang,chohsieh}@cs.ucla.edu + +# Abstract + +Existing studies have demonstrated that adversarial examples can be directly attributed to the presence of non-robust features, which are highly predictive, but can be easily manipulated by adversaries to fool NLP models. In this study, we explore the feasibility of capturing task-specific robust features, while eliminating the non-robust ones by using the information bottleneck theory. Through extensive experiments, we show that the models trained with our information bottleneck-based method are able to achieve a significant improvement in robust accuracy, exceeding performances of all the previously reported defense methods while suffering almost no performance drop in clean accuracy on SST-2, AGNEWS and IMDB datasets. + +# 1 Introduction + +Recently, a number of studies (Han et al., 2020; Jin et al., 2020; Shafahi et al., 2019) have revealed the fact that the performance of deep neural networks (DNNs) can be severely undermined by adversarial examples. In the text domain, these adversarial examples are crafted by semantic-preserving perturbations to inputs with word synonym substitution (Ebrahimi et al., 2018; Ren et al., 2019; Alzantot et al., 2018) and character-level transformations (Gao et al., 2018; Zang et al., 2020). The vulnerability of DNN models results in inferior performances under adversarial attacks in many NLP tasks including text classification, natural language inference (NLI), question answering (QA), etc. To resolve this problem, researchers have proposed various methods to defend against adversarial attacks (Goodfellow et al., 2014; Szegedy et al., 2013; Jia and Liang, 2017; Kang et al., 2018; Zhou et al., 2021). + +In particular, Tsipras et al. (2019) and Ilyas et al. (2019) showed that the vulnerability of computer + +vision models can be attributed to "non-robust features," which are features in the representation space that are sensitive to adversarial attacks and can be easily manipulated by attackers. The presence of these features will weaken the robustness of deep learning models. Therefore, a potential defense strategy is to filter out such non-robust features in the inputs. + +In this paper, we posit that the robustness of text classification models can be improved by filtering out the non-robust features. However, unlike the continuous input in the computer vision domain, input in the NLP domain is a sequence of words, which makes it difficult to model its distribution. We thus research into means to filter out the non-robust features in language model inputs. + +Inspired by (Li and Eisner, 2019; Wang et al., 2021a), we propose to use the information bottleneck method (Tishby et al., 2000) in text classification tasks. Specifically, we plug in an information bottleneck layer (IB layer)1 between BERT (Devlin et al., 2018) output layer and the text classifier to preserve only task-specific features. + +Since the IB layer trades off between minimizing preserved information and model prediction performance, features that are not robust under the targeted task are filtered out. Therefore, our approach is able to focus more on the robust features and achieve an improvement in its robustness. + +We conduct extensive experiments on three text classification benchmarks: SST-2 (Socher et al., 2013), AGNEWS (Gulli, 2004) and IMDB (Maas et al., 2011). Results have shown that our approach achieves a great improvement on model robustness compared with traditional defense methods, while only suffering little or even no performance drop on clean accuracy. We also provide a visualization to interpret how the information bottleneck layer works to keep robust features, in order to justify + +our proposed approach. + +In summary, we propose a new information bottleneck-based approach to improve the robustness of DNN language models. We demonstrate that our approach is effective in improving models' adversarial performance while maintaining their performance on clean data. In addition, experimental results show that our approach can also be combined with existing adversarial training methods like FreeLB (Chen et al., 2020) to further improve models' robustness under adversarial attacks. + +# 2 Related Work + +In response to the discovery of DNN's vulnerability to adversarial examples and the emergence of adversarial attacks, many defense methods have also been proposed to improve the robustness of DNN models. + +Among these methods, adversarial training is one of the most effective and widely used to defend against adversarial examples. In adversarial training, the model is trained to correctly classify both adversarial examples and normal examples. Goodfellow et al. (2014) first propose a fast gradient sign method (FGSM) to generate adversarial examples for adversarial training in the image domain. In textual domain, many researchers tried to add perturbation to input word embedding to generate adversarial examples. Zhang and Yang (2018) applied several types of noises, such as Gaussian and Bernoulli, to perturb the input embeddings while Chen et al. (2020) proposed FreeLB, which minimizes the resultant adversarial loss inside different regions around input samples through adding adversarial perturbations to word embeddings. However, they all focus on the generalization of model, not the robustness. + +Wang et al. (2019) and Wang and Wang (2020) proposed to replace certain words in the training dataset with their synonyms for the purpose of data augmentation. However, this kind of methods are specific for the defense against synonym substitution attack, and may be weak when facing other kind of adversarial attack methods, such as character-level attack. + +Apart from empirical methods, a set of certified robustness training methods is introduced recently, which have proven to be effective in improving a model's robustness against a specific type of attacks. Huang et al. (2019) and Jia et al. (2019) used interval bound propagation (IBP) to propose certi + +fied robustness training methods that can limit the loss of the worst-case perturbations. These methods are provably robust to word substitution attacks. However, certified robustness training sacrifices the model's clean accuracy and is not generalized to all types of attacks. + +The information bottleneck method was proposed by (Tishby et al., 2000), aiming to provide a quantitative notion of "relevant information". Although the method has been utilized in many NLP tasks such as rationale extraction (Paranjape et al., 2020), sentence summarization (West et al., 2019) and parsing (Wang et al., 2020), only few of them focus on combining information bottleneck with adversarial defense methods. Wang et al. (2021b) proposes infoBERT, which applied information bottleneck to the embedding layer of pre-trained language models to suppress noisy information contained in word embeddings. The implicit assumption of this approach is that the embedding layer contains enough information for the model to make predictions. However, different word combinations can have different meanings, so the semantics of a sentence can not be fully expressed without taking contextual information into consideration. + +Therefore, we propose a completely different implementation of the information bottleneck. The information bottleneck is utilized to extract task-related features from the output of the last layer of BERT, which is pre-trained and thus be capable of generating a contextualized representation for the input sequence, and calculated by using the variational inference method. + +Besides, InfoBERT uses the gradient information of each word to find local anchored features and aims at increasing the mutual information between the global representation and them, while in our approach, robust features are extracted from the global representation without additional steps. + +# 3 Method + +Derived from information theory, the information bottleneck method (Tishby et al., 2000) was proposed and has been used as a training objective as well as a theoretical framework (Tishby and Zaslavsky, 2015) in machine learning. The method of information bottleneck can be statistically formulated as follows: denote the input random variables as $\mathbf{X}$ , which could be sentences or paragraphs, and the output as $\mathbf{Y}$ . Denote the joint distribution of $\mathbf{X}$ and $\mathbf{Y}$ as $P(\mathbf{X},\mathbf{Y})$ . The purpose of information + +![](images/169e70cd9069695218b28a190684b1c0579916b25e977027d9e7e5527b93dd1b.jpg) +Figure 1: We use the IB layer to filter out non-robust features, which are denoted by the gray circle dots in the figure, flow from Bert output. $I(\cdot; \cdot)$ denotes the mutual information and the jagged line denotes the compression process. By Maximizing the mutual information between the final prediction $\mathbf{Y}$ and the hidden features $\mathbf{T}$ while minimizing the mutual information between input $\mathbf{X}$ and $\mathbf{T}$ through IB layer, we are able to obtain a $\mathbf{T}$ that has all the non-robust features filtered out. + +bottleneck is to learn a distribution $p_{\theta}(t|x)$ from $\mathbf{X}$ to a compressed hidden feature $\mathbf{T}$ . To simplify the notation, we will omit $\theta$ in the subscript when we mention $p(t|x)$ . The information bottleneck objective (IB objective) used for optimization is as follows: + +$$ +\mathcal {L} _ {\mathrm {I B}} = - I (\mathbf {Y}; \mathbf {T}) + \beta \cdot I (\mathbf {X}; \mathbf {T}), \tag {1} +$$ + +where $I(\cdot ;\cdot)$ denotes the mutual information. The intuitive explanation for optimizing the information bottleneck objective Eq.(1) is that we want to compress all information given by the input $\mathbf{X}$ , while still maintaining enough knowledge for the model to give the correct prediction outcome $\mathbf{Y}$ . This can be achieved through finding the minimum value of $\mathcal{L}_{\mathrm{IB}}$ . In the equation, parameter $\beta$ controls how much information we want to preserve among all the information extracted from the input $\mathbf{X}$ . By increasing $\beta$ , we can narrow the "neck", thus allowing less information from $\mathbf{X}$ to be transmitted to the hidden feature $\mathbf{T}$ . + +Inspired by (Ilyas et al., 2019)'s theory about robustness of features, we utilize the information bottleneck method to help the DNN models filter out "non-robust features" and only preserve "robust features" from model input. Since "Robust features" contribute to model's prediction, they contain semantic information of the input sequence. Taking this into account, our goal would be to filter out task-unrelated information while keeping the loss of task-related information to a minimum. This way, our method would be able to help improve model's robustness without diminishing its + +clean performance for the prediction task. By plugging in the IB layer right after BERT output, we can leverage the ability of pre-trained models on extracting contextualized features, preventing the possible loss of "robust features" after compression of information. + +Specifically, given an input $\mathbf{X}$ and output $\mathbf{Y}$ , we want to obtain specific hidden features $\mathbf{T}$ from $\mathbf{X}$ that only contain information which contributes to the final prediction $\mathbf{Y}$ . By minimizing the IB objective in Eq.(1), the IB layer filters out the task-unrelated information in BERT output, which is extracted from input $\mathbf{X}$ , and obtain the required $\mathbf{T}$ . + +To minimize the IB objective, we maximize the mutual information $I(\mathbf{Y};\mathbf{T})$ . Since the purpose of maximizing $I(\mathbf{Y};\mathbf{T})$ is to enforce $\mathbf{T}$ contain enough information for the model's prediction, we choose to minimize the loss function of the original task to approximate the maximization of $I(\mathbf{Y};\mathbf{T})$ . Taking classification tasks as an example, our method would be to minimize the cross entropy function $\mathcal{L}_{\mathrm{CE}}$ . + +The mutual information $I(\mathbf{X};\mathbf{T})$ can be calculated by the Kullback-Leibler distance between the distributions of $P(\mathbf{T}|\mathbf{X})$ and $P(\mathbf{T})$ as follows: + +$$ +\begin{array}{l} I (\mathbf {X}; \mathbf {T}) = \mathbb {E} _ {X} [ D _ {\mathrm {K L}} [ P (\mathbf {T} | \mathbf {X}) | | P (\mathbf {T}) ] ] \\ = \int p (x, t) \log \frac {p (t | x)}{p (t)} d x d t. \tag {2} \\ \end{array} +$$ + +To calculate the Kullback-Leibler divergence between $P(\mathbf{T}|\mathbf{X})$ and $P(\mathbf{T})$ , we need knowledge of their probability distributions. The $P(\mathbf{T}|\mathbf{X})$ term can be sampled empirically. However, the $P(\mathbf{T})$ term is difficult to be estimated. To resolve this challenge, we expand the Eq.2 to get the following equation: + +$$ +\begin{array}{l} I (\mathbf {X}; \mathbf {T}) = \int_ {c} p (x, t) \log p (t | x) d x d t \tag {3} \\ - \int p (t) \log p (t) d t, \\ \end{array} +$$ + +where the marginal distribution of $\mathbf{T}$ , $p(t) = \int p(t|x)p(x)dx$ . Since the original Tishby et al. (2000) relied on the iterative Blahut Arimoto algorithm to optimize the IB objective, which is infeasible to apply to deep neural networks, many researchers try to use variational inference to approximate this problem (Alemi et al., 2017; Chechik et al., 2005). Inspired by previous studies, we replace $p(t)$ with a variational approximation $q(t) =$ + +$\mathcal{N}(\mu_X,\sigma_X^2)$ , which is a Gaussian distribution with the mean $\mu_{X}$ and standard deviation $\sigma_X^2$ . Since the Kullback-Leibler divergence is defined to be non-negative, which means $\int p(t)\log p(t)dt\geq \int p(t)\log q(t)dt$ , we derive the following upper bound: + +$$ +\begin{array}{l} I (\mathbf {X}; \mathbf {T}) \leq \int p (x) p (t | x) \log \frac {p (t | x)}{q (t)} d x d t \tag {4} \\ = \mathbb {E} _ {X} [ D _ {\mathrm {K L}} [ P (\mathbf {T} | \mathbf {X}) | | Q (\mathbf {T}) ] ]. \\ \end{array} +$$ + +We want to reduce the mutual information between $\mathbf{X}$ and $\mathbf{T}$ so that more task-unrelated information can be filtered out, which can help us retain more robust features for the final prediction. To achieve this goal in practice, we minimize the upper bound of $I(\mathbf{X};\mathbf{T})$ derived in Eq.(4). We achieve this through adjusting the parameters in $Q(\mathbf{T})$ in order to minimize the Kullback-Leibler divergence between $P(\mathbf{T}|\mathbf{X})$ and $Q(\mathbf{T})$ , which will lower the upper bound of $I(\mathbf{X};\mathbf{T})$ . Combined with the optimization goal of the term $I(\mathbf{Y};\mathbf{T})$ we explained in the former chapter, the final loss function is: + +$$ +\mathcal {L} = \mathcal {L} _ {\mathrm {C E}} + \beta \cdot D _ {\mathrm {K L}} [ P (\mathbf {T} | \mathbf {X}) | | Q (\mathbf {T}) ]. \tag {5} +$$ + +By using the loss function Eq.(5) to optimize our model, our approach would be able to filter out the non-robust features for the classification task among all the inputs. + +# 4 Experiments + +In order to validate our assumption, we conduct several experiments to evaluate the effectiveness of our approach. We first compare our model and the baseline models both on their clean accuracy and accuracy under attack. Furthermore, in exploration of the ability of our model to work in conjunction with adversarial training methods- such as FreeLBto achieve complementary effects, we also evaluate the performance of the combined model. In addition, we try to interpret and further analyze our approach through several additional experiments. + +# 4.1 Dataset + +We evaluate our approach on three widely-used classification benchmark datasets: IMDB dataset (Maas et al., 2011), SST-2 (Socher et al., 2013) dataset, and AGNEWS dataset (Gulli, 2004). Both IMDB and SST-2 are sentimental classification datasets with two classes, while AGNEWS is a topic classification dataset with four classes. + +# 4.2 Baseline Models + +Because our model can be viewed as an enhanced variant of the BERT models, we choose to use BERT base (Devlin et al., 2018) as one of the baseline models. We also establish a comparison with InfoBERT (Wang et al., 2021a), a method that is very similar to our approach, to verify the effectiveness of the proposed way of injecting an IB layer. + +Apart from these two baseline models, we also compare our approach with four adversarial training methods: PGD (Madry et al., 2018), which is a classic and representative method, as well as FreeLB (Chen et al., 2020), SMART (Jiang et al., 2020) and TAVAT (Li and Qiu, 2021), which are three state-of-the-art defense methods. + +# 4.3 Robustness Evaluation + +We evaluate models' accuracy under four different attack algorithms, including both word-level attacks and character-level attacks. + +Textflo0er (Jin et al., 2019) Textflo0er ranks the importance of words by the drop of true class probability after deleting words from the original text. By leveraging the similarity of word embeddings, it builds a candidate word set and selects the word that minimizes the predictive probability of the true class label. + +Textbugger (Li et al., 2018) Textbugger contains both word-level and character-level perturbations by inserting, removing, swapping and substituting letters or replacing words. + +BERT-Attack (Li et al., 2020) BERT-Attack uses the masked language model (MLM) of BERT to replace words with other words that fit the context. In addition to achieving high attack success rate, high perturbation percentage and relatively low calculation costs, BERT-Attack also ensures fluency and semanticality of adversarial samples. + +Deepwordbug (Gao et al., 2018) Deepwordbug designs a score system to find the rank the importance of tokens to the prediction and perturb the top $k$ important tokens by swap, substitution, deletion and insertion. + +# 4.4 Implementation Details + +We train 10 epochs of the models on AGNEWS and SST-2 datasets, and 20 epochs on the IMDB dataset and provide experimental results averaged on three different random seeds: 0, 1, and 2. + +For each attack, we take 1000 attack examples on + +
DatasetsMethodsClean%TextFollowerTextBuggerBERT-AttackDeepwordbug
Aua(Suc)%#QueryAua(Suc)%#QueryAua(Suc)%#QueryAua(Suc)%#Query
SST-2BERT-base93.225.3(72.7)72.835.3(61.8)43.420.7(77.6)96.039.2(57.6)27.5
PGD93.527.9(70.2)74.637.0(60.3)43.622.0(76.3)96.640.3(56.7)27.2
SMART94.132.8(64.8)85.940.9(56.1)48.220.8(77.7)104.345.0(51.7)29.7
FreeLB93.929.5(68.5)73.440.0(57.3)44.623.7(74.7)97.042.5(54.6)28.0
InfoBERT93.931.5(66.2)74.140.9(56.1)44.425.4(72.7)99.442.9(53.9)28.3
TA-VAT93.634.6(62.6)75.443.3(53.2)44.426.4(71.5)99.545.8(50.5)28.0
Our Model93.337.6(59.9)104.846.5(50.3)61.032.9(64.9)147.048.4(48.0)34.2
+ FreeLB94.140.4(56.8)106.948.1(48.8)62.733.3(64.5)146.851.6(44.9)35.0
AGNEWSBERT-base94.59.1(90.4)314.142.2(55.5)174.913.3(86.0)414.025.3(73.3)104.7
PGD94.959.0(37.6)261.758.8(37.8)287.362.7(34.0)264.265.7(30.6)254.8
SMART94.454.4(42.3)155.960.1(36.3)102.237.8(59.9)241.061.2(35.1)62.9
FreeLB94.713.6(85.7)343.447.5(49.8)175.215.9(83.2)435.622.3(76.4)106.3
InfoBERT93.665.0(29.8)173.068.0(26.6)106.555.0(40.7)261.367.0(28.0)180.3
TA-VAT94.556.7(40.1)264.256.3(40.5)290.163.1(33.5)270.662.3(34.2)260.0
Our Model94.268.6(27.2)516.470.8(24.9)319.960.7(35.7)827.270.0(26.0)130.8
+ FreeLB94.470.8(25.0)521.373.4(22.4)326.864.0(32.4)851.571.6(24.1)132.0
IMDBBERT-base91.50.8(99.1)610.85.7(93.8)524.20.1(99.8)570.624.3(73.6)355.7
PGD92.635.7(61.4)1911.833.3(63.9)2261.936.8(60.1)1549.441.7(54.9)2082.7
SMART93.148.2(48.1)2035.453(43.2)1238.723.2(75.2)2053.158.8(36.8)571.8
FreeLB92.538.3(58.1)1843.149.7(45.7)1249.926.7(70.1)2453.557.5(37.1)550.5
InfoBERT91.932.2(65.3)1112.435.5(61.7)756.924.5(73.5)1394.344.7(51.8)465.0
TA-VAT92.538.3(58.7)2230.136.5(60.6)2864.540.3(56.5)1754.451.1(45.0)2258.17
Our Model91.552.2(42.4)2077.758.7(34.9)1366.038.7(57.0)2859.264.3(28.8)597.9
+ FreeLB92.464.3(30.1)2293.869.2(24.9)1513.452.7(43.0)3356.071.3(22.5)621.8
+ +Table 1: Accuracy achieved by our method and other competitive models both on clean data and under attacks. The number in bold denotes best performance on that dataset. \(Clean\%\) denotes the prediction accuracy without attack. \(Aua\%\) denotes accuracy under attack, \(Suc\%\) denotes attack success rate and \#Query\) denotes average query numbers. The average perturbed word percentage of all three attack methods are set to under \(15\%\). All the attack methods used in the experiment are from the implementation of TextAttack (Morris et al., 2020). All other baseline models used in this study are based on our own implementation. + +the SST-2 and AGNEWS datasets, and 200 attack examples on the IMDB dataset due to the excessive number of queries. We also set a default restriction of $15\%$ on the maximum modify ratio for each attack algorithm. Further details for implementation would be discussed in the following sections. + +# 4.5 Hyperparameter + +There are two main hyperparameters in our experiments: hidden dimension (hd) and $\beta$ . The hidden dimension controls the dimension of the IB layer and $\beta$ controls the trade-off between better prediction performance and restriction of the information flow. We experiment with different sizes of hd ranging from 100 to 700 and different values of $\beta$ from 0.05 to 0.3. Based on model performance, we finally choose to use $\mathrm{hd} = 100$ on SST-2, AGNEWS, and $\mathrm{hd} = 200$ on IMDB. We used $\beta = 0.1$ on all three datasets. All hyperparameters are chosen based on the experimental results on the corresponding development dataset. + +# 4.6 Results + +Table 1 reports the detailed results of our experiment. As shown in Table 1, our model suffers little or even no performance drop in clean accuracy on all of the three datasets. On the IMDB and AGNEWS datasets, our model achieves around the + +same clean accuracy as the baseline model, while on the SST-2 dataset, clean accuracy of our model in fact outperforms the baseline model by a small margin. This implies that even with an added information bottleneck layer, the proposed method still ensures sufficient information flowing through the information bottleneck for the model to make accurate predictions. + +Besides the clean performance, Table 1 also provides concrete experimental results on the robustness of all the models under four different types of attacks. The robustness accuracy result shows our model not just demonstrates significant improvement in adversarial robustness compared to BERT-base model, but is also very competitive with other defense methods under both word-level and character-level attacks. In particular, our model outperforms all baseline models by a great margin under the attack of TextFooer and TextBugger on IMDB dataset. + +Furthermore, combining our method with FreeLB (a kind of adversarial training method) can further improve models' adversarial robustness. We achieve the highest adversarial accuracy under all circumstances in our experiments and only suffer a small drop in clean accuracy compared to the original FreeLB method. This implies that adversarial training methods and our approach are + +
DatasetsMethodsClean%TextFollowerTextBuggerBERT-AttackDeepwordbug
Aua(Suc)%#QueryAua(Suc)%#QueryAua(Suc)%#QueryAua(Suc)%#Query
SST-2BERT-base93.25.6(94.0)89.227.9(69.8)47.56.2(93.3)111.727.4(70.3)29.0
PGD93.56.7(92.8)92.630.3(67.5)47.87.5(91.9)114.325.6(68.2)28.7
SMART94.112.0(87.1)107.833.0(64.6)53.78.6(90.8)123.335.1(62.4)31.2
FreeLB93.98.1(91.4)95.432.0(65.9)49.59.2(90.2)118.631.9(65.9)29.5
InfoBERT93.99.5(89.8)99.332.8(64.8)49.610.9(88.3)126.132.8(64.7)29.8
TA-VAT93.614.5(84.3)115.234.9(62.3)51.511.5(87.6)135.435.0(62.2)29.8
Our Model93.321.1(77.5)125.739.8(57.5)68.020.3(78.3)167.939.1(58.1)35.9
+ FreeLB94.123.3(75.1)129.842.7(54.4)70.021.3(77.3)169.041.7(55.7)36.3
+ +Table 2: Accuracy achieved by our method and other competitors on both clean data and adversarial examples. The average perturbed word percentage of all four attack methods are not constrained. For the DeepWordBug method, the edit distance is constrained to no more than five. + +![](images/9f16bd086d9381877b7a26819357dc1f7fa66d3dfea90d757f663978bf0abbb5.jpg) +Figure 2: t-SNE visualization of our model under different $\beta$ . Each marker in the figure denotes different sample. This series of figures (from left to right) shows a progression from moderate compression to too much compression. As the $\beta$ increases, the boundary between the two classes gradually disappears. + +![](images/835257cde69005fd654d32ed58aec89cb0279285eef292a450057d0bde4dae36.jpg) + +![](images/5e1f28f4e7e123fbbab0dbf0504f9212481a5a01994bad8071bf16fdc75330df.jpg) + +complementary to each other. + +We also evaluate the accuracy of models under adversarial attack methods whose constraint is relaxed. Specifically, the maximum modify ratio is not constrained for all attack methods, which means that relatively stronger adversarial examples can be generated. The result in Table 2 shows that our method can still outperform all the baseline methods in this setting. + +# 5 Discussion + +In this section, we study how the implementation of IB layer affects the model's robustness. Furthermore, we seek to find a reasonable explanation for this effect. + +# 5.1 Quantitative Analysis + +First, we discuss the effect of the two hyperparameters in our model: hidden dimension (hd) and $\beta$ . The size of the hidden dimension controls the dimension of the information bottleneck layer, thus limiting the amount of total information that flows through the information bottleneck. We test the impact of 10 different hidden dimension sizes ranging from 50 to 600 on the SST-2 dataset. As shown in Figure 3, a small hidden dimension size helps our model achieve better performance under adversar + +![](images/a41d9fa313b8b4065b456fc3e804d1124ae428131ca18dff13b9496ab4c043bf.jpg) +Figure 3: Performance change under different hyperparameter choices. The y-axis on the left denotes clean accuracy, while the y-axis on the right denotes accuracy under attack, using TextFooler as the attack method. The x-axis denotes different hyperparameters for our IB layer, from left to right, shows the performance of our model under different dimensionality of hidden layers and $\beta$ . We fixed the hidden dimension of IB layer at 100 when choosing different values of $\beta$ . + +![](images/feecbd7a42616d1a11f11f9bbd0fd8570d7dfeaf716c499d65b55e9bf8a259aa.jpg) + +ial attacks, while only suffering little drop in clean accuracy. This indicates that choosing small hidden dimension size works best in helping the model filter out task-unrelated information. However, when the size of the hidden dimension gets too small, we observe a significant drop in accuracy under attack. This may indicate that when the hidden dimension size is too small, the information bottleneck layer would compress too much such that task-related information is also filtered out. + +We also test the influence of different values of + +$\beta$ s from 0 to 6. Recall that the hyperparameter $\beta$ controls the trade off between better prediction performance and restriction of the information flow through the bottleneck. Therefore, adjusting the value of $\beta$ could also help with controlling the amount of information that flows through the information bottleneck layer. Specifically, a smaller $\beta$ will allow more information to flow from $\mathbf{X}$ to hidden representation $\mathbf{T}$ , while a larger $\beta$ would "narrow" the bottleneck, allowing less information to flow through. When $\beta$ is set to 0, the information bottleneck layer is equal to a linear layer. Results of experiments with different values of $\beta$ on the SST-2 dataset are shown in Figure 3. At first, as the value of $\beta$ increases, less information are able to flow through the bottleneck, forcing the information bottleneck to filter out non-robust features. This results in an enhancement of model robustness performance. However, the robust accuracy decrease as $\beta$ increase further. This might indicates that if the information bottleneck is too "narrow", some robust features would also be filtered out by the IB layer. + +We further visualize the influence of $\beta$ by using t-SNE. As shown in Figure 2, when $\beta$ is equal to 1.0, the samples can be clearly divided into two clusters corresponding to their labels. As the value of $\beta$ increases, more information are filtered out, including those useful for the sentiment classification task. It can be observed from the figure that samples from the two categories become close to each other when the value of $\beta$ is 5.0. Therefore, a small perturbation may cause the model to make a false prediction. The decision boundary becomes unclear when $\beta$ is set to 10.0 and the clean accuracy of the model decreases significantly in this case. + +# 5.2 Interpretation + +As we have discussed in former sections, researchers such as Tsipras et al. and Ilyas et al. have proposed the idea that features contributing to deep learning tasks can be divided into robust features and non-robust features. In our assumption, the information bottleneck layer that we plug in after BERT output works to filter out non-robust features while retaining the robust features from all the information that flows out from BERT. By only preserving task-specific robust features, our model is able to attain an improvement in adversarial robustness, while minimizing the drop in clean + +
MethodsAttackAttack (filtered)
Sig%Acc%Sig%Acc%
Baseline-7.92.7-3.67.3
Our model4.637.123.792.0
+ +Table 3: Accuracy achieved by our model and the baseline under attacks. $Sig\%$ denotes the sum of significance scores of words that are consistent with the whole sentence's sentiment tendency. $Acc\%$ denotes classification accuracy. "Attack" denotes the adversarial examples generated by the TextFooler algorithm, from which we choose two hundred sentences, indicated by "Attack (filter)". + +accuracy performance at the same time. + +# 5.2.1 Significance Score + +In order to verify our assumption, we specifically conduct an experiment on the SST-2 dataset to see if our model is able to capture robust task-related features. In this experiment, a score $s_i$ is calculated for each word $x_i$ in the input sentence $X$ to measure the influence of $x_i$ when predicting the sentiment of the sentence. We denote the embedding of the input sentence $X$ as $E = \{e_1, \dots, e_n\}$ , and $X_{\backslash x_i} = \{e_1, \dots, e_{i-1}, 0, e_{i+1}, \dots, e_n\}$ denotes setting the embedding of word $x_i$ to zero. The normalized significance score $s_i$ is defined as follows. + +$$ +s _ {i} = \operatorname {R e s c a l e} \left(F _ {Y} (X) - F _ {Y} \left(X _ {\backslash x _ {i}}\right)\right) \tag {6} +$$ + +where $F_{Y}(X)$ denotes the probability that our model gives a prediction of the label $Y$ , and $\operatorname{Rescale}(\cdot)$ is defined by dividing the significance score by the sum of the absolute values of significance scores of all words in the sentence. Here, $s_i$ denotes the change in models' predictions before and after deleting word $x_i$ . A positive value indicates that the word helps the model make correct predictions, and a negative value means that the word leads to incorrect predictions of the model. + +We note that the SST-2 dataset provides sentiment labels for each word which are annotated manually. In order to identify sentiment words in sentences, we make use of these labels provided as the golden truth. Since the words that are consistent with the sentimental tendency of the sentence are important for sentiment classification, we sum the significance scores of these words and denote this sum as $Sig\%$ . + +As shown in Table 3, the baseline model is not able to correctly classify most sentences under textual adversarial attacks on the SST-2 dataset. Note that here $Sig\%$ is a negative value, meaning that the + +words that the baseline model considers "harmful" to making classification predictions in fact have a counter-effect on the model. This means that the baseline model fails to correctly attention to important features in the input sentences. By definition, $Sig\%$ increases when the models' classification accuracy improves, indicating their correlation. Since our model achieves a higher $Sig\%$ , it can be inferred that our model is better at extracting the robust features that are not likely to be perturbed under textual adversarial attacks. + +![](images/8fb9dd11d49c144a56038349bca41cd6de9ac0e4546c236f51301dbe1d75d1c6.jpg) +Figure 4: Illustration of each word's significance in the model's prediction process. + +In order to better illustrate how our model succeeds in extracting robust features, specifically for classification tasks, we visualize two examples from the SST-2 dataset in Figure 4. In the first sentence, our model better attends to the word "joyless", which clearly expresses the emotional tendency in the sentence. In contrast, the attention of the baseline model is distracted by words such as "perhaps" and "the", which are almost irrelevant to the sentimental classification task. In the second sentence, "slipshod" is a sentiment word which is helpful for predicting the sentiment of the sentence. As demonstrated by the figure, our model succeeds in accurately capturing the importance of this sentiment word. The baseline model, however, failed to attend to this word and thus is unable to classify the sentence correctly. The figure shows that our model accurately captures robust features related to important sentimental words in inputs, while the baseline model fails to do the same thing. This further validates the assumption that our model is able to extract robust task-related features for classification. + +![](images/6855d4056e0bc3d5daf4e64275cdfbfded0704475385e622c64b3b7fb7691c94.jpg) +Figure 5: The performance change of our model when we add the Information Bottleneck layer after different layers of BERT model. The dimensionality of hidden layer and $\beta$ is fixed at 100 and 1.0, respectively. + +# 5.2.2 Plugging Information Bottleneck into Different Layers + +Features in the deep layer model have been observed to transit from general to task-specific as the position of the layer gets higher (Yosinski et al., 2014; Howard and Ruder, 2018). More specifically, the first layers of deep neural networks may contain more general and static knowledge of the input sequences, while the higher layers contain more knowledge related to the task. Since the information bottleneck layer is used to extract robust, task-specific features, we assume that applying it to higher layers instead of the embedding layer, which is used in InfoBERT, would be a more reasonable implementation. To verify this, we add the Information Bottleneck layer to the output of different layers of BERT model and calculate an additional loss(Eq.(5)) as regularization. We train the models to minimize the total loss. Experimental results show that as the layer we choose to apply the information bottleneck layer becomes higher, model's classification accuracy and accuracy under attack both improve, which validates our assumption. + +# 6 Conclusion + +We propose a novel implementation of the information bottleneck method on BERT-base models to improve its adversarial robustness. Our method is proven to be successful in filtering out non-robust feature and keeping task-specific robust features, thus improving the adversarial robustness of models. Experimental results have shown that our method outperforms four widely used defense methods across three datasets with both sentence-level and character-level attack algorithms. We also validate our method through a comprehensive anal + +ysis on experimental results as well as quantitative interpretation of our model's performance under adversarial attacks. + +# Acknowledgements + +The authors would like to thank the anonymous reviewers for their valuable comments. This work was supported by National Science Foundation of China (No. 62076068), Shanghai Municipal Science and Technology Major Project (No. 2021SHZDZX0103), and Zhangjiang Lab. Chang is supported in part by Cisco and Google. Hsieh is supported in part by NSF IIS-2008173 and IIS-2048280. + +# References + +Alexander A. Alemi, Ian Fischer, Joshua V. Dillon, and Kevin Murphy. 2017. Deep variational information bottleneck. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net. +Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. 2018. Generating natural language adversarial examples. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2890–2896, Brussels, Belgium. Association for Computational Linguistics. +Gal Chechik, Amir Globerson, Naftali Tishby, and Yair Weiss. 2005. Information bottleneck for gaussian variables. J. Mach. Learn. Res., 6:165-188. +Zhu Chen, Gan Yu, Cheng adn Zhe, Sun Siqi, Goldstein Tom, and Liu. Jingjing. 2020. FreeLB: Enhanced Adversarial Training for Natural Language Understanding. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. 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. +Javid Ebrahimi, Anyi Rao, Daniel Lowd, and Dejing Dou. 2018. HotFlip: White-box adversarial examples for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 31-36, Melbourne, Australia. Association for Computational Linguistics. +Ji Gao, Jack Lanchantin, Mary Lou Soffa, and Yanjun Qi. 2018. Black-box generation of adversarial text + +sequences to evade deep learning classifiers. In 2018 IEEE Security and Privacy Workshops, SP Workshops 2018, San Francisco, CA, USA, May 24, 2018, pages 50-56. IEEE Computer Society. +Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. 2014. Explaining and harnessing adversarial examples. arXiv 1412.6572. +Antonio Gulli. 2004. Agnews. http://groups.di.unipi.it/~gulli/AG Corpus_of_news_articles.html. +Wenjuan Han, Liwen Zhang, Yong Jiang, and Kewei Tu. 2020. Adversarial attack and defense of structured prediction models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2327-2338, Online. Association for Computational Linguistics. +Jeremy Howard and Sebastian Ruder. 2018. Universal language model fine-tuning for text classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 328-339. +Po-Sen Huang, Robert Stanforth, Johannes Welbl, Chris Dyer, Dani Yogatama, Sven Gowal, Krishnamurthy Dvijotham, and Pushmeet Kohli. 2019. Achieving verified robustness to symbol substitutions via interval bound propagation. 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 2019, Hong Kong, China, November 3-7, 2019, pages 4081-4091. Association for Computational Linguistics. +Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. 2019. Adversarial examples are not bugs, they are features. arXiv:1905.02175. +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. +Robin Jia, Aditi Raghunathan, Kerem Goksel, and Percy Liang. 2019. Certified robustness to adversarial word substitutions. 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 4129-4142, Hong Kong, China. Association for Computational Linguistics. +Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Tuo Zhao. 2020. SMART: Robust and efficient fine-tuning for pretrained natural language models through principled regularized optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational + +Linguistics, pages 2177-2190, Online. Association for Computational Linguistics. +Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. 2019. Is bert really robust? natural language attack on text classification and entailment. arXiv preprint arXiv:1907.11932. +Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. 2020. Is BERT really robust? A strong baseline for natural language attack on text classification and entailment. In AAAI (AAAI-20). +Dongyeop Kang, Tushar Khot, Ashish Sabharwal, and Eduard Hovy. 2018. AdvEntuRe: Adversarial training for textual entailment with knowledge-guided examples. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2418-2428, Melbourne, Australia. Association for Computational Linguistics. +Jinfeng Li, Shouling Ji, Tianyu Du, Bo Li, and Ting Wang. 2018. Textbugger: Generating adversarial text against real-world applications. CoRR, abs/1812.05271. +Linyang Li, Ruotian Ma, Qipeng Guo, Xiangyang Xue, and Xipeng Qiu. 2020. Bert-attack: Adversarial attack against bert using bert. pages 6193-6202. +Linyang Li and Xipeng Qiu. 2021. Token-aware virtual adversarial training in natural language understanding. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 8410-8418. AAAI Press. +Xiang Li and Jason Eisner. 2019. Specializing word embeddings (for parsing) by information bottleneck (extended abstract). In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing., pages 4687-4691. +Andrew Maas, Raymond Daly, Peter Pham, Dan Huang, Andrew 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. +Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. 2018. Towards Deep Learning Models Resistant to Adversarial Attacks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. +John Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. 2020. Textattack: A framework for adversarial attacks, data augmentation, and + +adversarial training in nlp. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 119-126. +Bhargavi Paranjape, Mandar Joshi, John Thickstun, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2020. An information bottleneck approach for controlling conciseness in rationale extraction. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1938-1952, Online. Association for Computational Linguistics. +Shuhuai Ren, Yihe Deng, Kun He, and Wanxiang Che. 2019. Generating natural language adversarial examples through probability weighted word saliency. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1085-1097, Florence, Italy. Association for Computational Linguistics. +Ali Shafahi, W. Ronny Huang, Christoph Studer, Soheil Feizi, and Tom Goldstein. 2019. Are adversarial examples inevitable? In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. +Richard Socher, A. Perelygin, J.Y. Wu, J. Chuang, C.D. Manning, A.Y. Ng, and C. Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, volume 1631, pages 1631-1642. +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. 2013. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199. +Naftali Tishby, Fernando C. Pereira, and William Bialek. 2000. The information bottleneck method. arXiv:physics/0004057. +Naftali Tishby and Noga Zaslavsky. 2015. Deep Learning and the Information Bottleneck Principle. arXiv:1503.02406. +Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. 2019. Robustness may be at odds with accuracy. In International Conference on Learning Representations (ICLR). +Boxin Wang, Hengzhi Pei, boyuan Pan, Qian Chen, Shuohang Wang, and Bo Li. 2020. T3: Treeautoencoder constrained adversarial text generation for targeted attack. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing. +Boxin Wang, Shuohang Wang, Yu Cheng, Zhe Gan, Ruoxi Jia, Bo Li, and Jingjing Liu. 2021a. Infobert: Improving robustness of language models from an information theoretic perspective. In International Conference on Learning Representations. + +Boxin Wang, Shuohang Wang, Yu Cheng, Zhe Gan, Ruoxi Jia, Bo Li, and Jingjing Liu. 2021b. INFOBERT: Improving Robustness Of Language Models From An Information Theoretic Perspective. In ICLR (ICLR-21). +Xiaosen Wang, Hao Jin, and Kun He. 2019. Natural language adversarial attacks and defenses in word level. CoRR, abs/1909.06723. +Zhaoyang Wang and Hongtao Wang. 2020. Defense of word-level adversarial attacks via random substitution encoding. In Knowledge Science, Engineering and Management - 13th International Conference, KSEM 2020, Hangzhou, China, August 28-30, 2020, Proceedings, Part II, volume 12275 of Lecture Notes in Computer Science, pages 312-324. Springer. +Peter West, Ari Holtzman, Jan Buys, and Yejin Choi. 2019. BottleSum: Unsupervised and self-supervised sentence summarization using the information bottleneck principle. 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 3752-3761, Hong Kong, China. Association for Computational Linguistics. +Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. 2014. How transferable are features in deep neural networks? In NIPS. +Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020. Word-level textual adversarial attacking as combinatorial optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 6066-6080. Association for Computational Linguistics. +Dongxu Zhang and Zhichao Yang. 2018. Word embedding perturbation for sentence classification. CoRR, abs/1804.08166. +Yi Zhou, Xiaqing Zheng, Cho-Jui Hsieh, Kai-Wei Chang, and Xuanjing Huang. 2021. Defense against synonym substitution-based adversarial attacks via Dirichlet neighborhood ensemble. 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 5482-5492, Online. Association for Computational Linguistics. \ No newline at end of file diff --git a/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/images.zip b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..a203eb078aa970ade7f3a1bd1fab6f8d4dae3456 --- /dev/null +++ b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad311b28511e8c6a78ecf91b31fd3f2ea856863811ca5f30a87806939260bb35 +size 450331 diff --git a/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/layout.json b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..33b7ada14e2b2105cbf610a97569794fa3245c0d --- /dev/null +++ b/improvingtheadversarialrobustnessofnlpmodelsbyinformationbottleneck/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:237941e622acb1581d8dae26d602fc6cb686bdc98bf251128124fbb0d722c4e5 +size 384889 diff --git a/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_content_list.json b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9c969669b1f1e247277ad239643f83eaca4a9196 --- /dev/null +++ b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cea3b780516518d32a029275cf23556d40d9963b4725c6da923709844f911b9b +size 61773 diff --git a/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_model.json b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dbac8ce887a8a6e647a320656d00348e4f2fca55 --- /dev/null +++ b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:799bb6219dc7aa7992cf83bd6f37b16e02ed99b4b8ea445ab0fb60d50b46a58b +size 74898 diff --git a/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_origin.pdf b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cf42d97976c3f24472d4258996677ac558369ea6 --- /dev/null +++ b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/fab9d1cd-7193-483d-8fd2-6297b227493c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fce312d93db32482eaa8b6b75153110d5867d851b809de56fd5fb66f8db84b33 +size 1856607 diff --git a/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/full.md b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1d2be7f382424ab292527d2e33bb0c15a1c5061a --- /dev/null +++ b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/full.md @@ -0,0 +1,222 @@ +# Improving Zero-Shot Cross-lingual Transfer Between Closely Related Languages by Injecting Character-Level Noise + +Noëmi Aepli1 and Rico Sennrich1,2 + +$^{1}$ Department of Computational Linguistics, University of Zurich + +$^{2}$ School of Informatics, University of Edinburgh + +{naepli,sennrich}@cl.uzh.ch + +# Abstract + +Cross-lingual transfer between a high-resource language and its dialects or closely related language varieties should be facilitated by their similarity. However, current approaches that operate in the embedding space do not take surface similarity into account. This work presents a simple yet effective strategy to improve cross-lingual transfer between closely related varieties. We propose to augment the data of the high-resource source language with character-level noise to make the model more robust towards spelling variations. Our strategy shows consistent improvements over several languages and tasks: Zero-shot transfer of POS tagging and topic identification between language varieties from the Finnic, West and North Germanic, and Western Romance language branches. Our work provides evidence for the usefulness of simple surface-level noise in improving transfer between language varieties. + +# 1 Introduction + +Recent research has achieved impressive results in zero-shot cross-lingual transfer based on multilingual pre-training (Devlin et al., 2019; Conneau and Lample, 2019) or monolingual transfer of embeddings (Artetxe et al., 2020). However, these methods require large amounts of unlabeled data in the target language (Lauscher et al., 2020) and do not take into account surface similarity between languages except for the sharing of subword units in multilingual models. For the transfer between closely related languages and dialects, we deem it desirable to exploit the similarity of surface representations. Specifically, we target orthographic variations that commonly result from pronunciation differences between closely related languages. + +![](images/8ac37343e73ea90a46e1e46dc0d69f62273a0701cf360d1133e9faa6b91dc6d2.jpg) +Figure 1: Swiss German (Gsw) sentence with corresponding standard German (DE) and English (EN) translations. The sentence shows various spelling differences on the word level, and reordering occurs on the sentence level due to different past-tense formation. + +In this paper, we propose to augment the training data of a high-resource language with character-level noise to simulate spelling variations and thus facilitate generalization to closely related $^2$ low-resource languages. + +We test this strategy on two tasks and several language regions. The considered tasks are part-of-speech (POS) tagging on the word level and topic classification on the sentence level; the languages are from the Finnic, West and North Germanic, and Western Romance language branches. We observe that our baseline method for cross-lingual transfer learns undesirable heuristics, e.g., assigning unseen words to open word classes in POS tagging and that injecting noise reduces this bias. Our experiments show absolute accuracy improvements between 1.4 and 22 percentage points over the state of the art, providing evidence that a simple data-augmentation strategy can boost transfer learning for language varieties and dialects with a closely related high-resource language. + +# 2 Related Work + +Zero-shot cross-lingual transfer based on multilingual language models (Devlin et al., 2019; Conneau and Lample, 2019) or machine translation models (Siddhant et al., 2020) has turned out + +to be surprisingly effective. Such representations proved themselves beneficial for a range of diverse tasks (Hu et al., 2020). However, they still require large-scale data sets to train, making them impractical for low-resource languages, to which dialects and language varieties typically belong. + +Artetxe et al. (2020) introduce zero-shot crosslingual transfer by mapping monolingual representations between languages. They also propose adding Gaussian noise to the embeddings during the fine-tuning step. Huang et al. (2021) also operate in the embedding space by constructing robust regions in the embedding space to tolerate noise in the contextual embedding. These are not ideal strategies for closely related languages because words with similar surface forms could still be far from each other in an embedding space. + +Surface-level noise such as character substitutions, insertions, and deletions has been proposed as an effective data augmentation strategy for machine translation (Sperber et al., 2017; Heigold et al., 2018; Belinkov and Bisk, 2018; Karpukhin et al., 2019; Vaibhav et al., 2019; Anastasopoulos et al., 2019). Authors report improvements in system accuracy due to more robustness towards speech recognition errors, spelling mistakes, and other naturally occurring noise in text data. Even though cross-lingual transfer between closely related languages has received some attention (Muller et al., 2020; Sakaguchi et al., 2017; Zeman et al., 2017, 2018), it has not been investigated whether this transfer can be improved with character-level noise inserted at training time. We tackle this in our work by adding random character-level noise to the training data of a standard language and applying the model to closely related languages. + +Exploiting orthographic similarity to improve cross-lingual transfer between closely related languages is currently an understudied area. Relevant previous work has been done by Sharoff (2018), who used orthographic similarity to refine bilingual dictionary induction. + +Transliteration is another line of related work that focuses on improving the transfer between closely related languages with different alphabets (Durrani et al., 2014; Lin et al., 2016; Murikinati et al., 2020; Han and Eisenstein, 2019). On the other hand, our work focuses on languages using the same script. The recent report by Muller et al. + +![](images/af43ee1da2dd194b587d64f7602458b8b3b29ce5bb1a8c4eb6f0428d9e0075ad.jpg) +Figure 2: Methodology for zero-shot cross-lingual transfer: We first continue the pre-training of a language model (LM) on text. Then, we fine-tune the adapted LM to task $T$ in high-resource language $X$ . We augment the training data for continued pre-training or fine-tuning with character-level noise and apply the model to task $T$ in a closely related low-resource language $Y$ . + +(2021) investigating transfer between the same and different alphabets involves a zero-shot task transfer which is, however, preceded by a language model training on (unlabeled) target language data. To the best of our knowledge, we are the first to focus on zero-shot transfer learning techniques for closely related languages. + +# 3 Method + +Consider a high-resource language $X$ and a closely related low-resource language $Y$ . We perform zero-shot cross-lingual transfer by pre-training a model on unlabeled data from $X$ (and optionally $Y$ if available), then fine-tuning on task $T$ in language $X$ . The resulting model is applied to task $T$ in language $Y$ . This procedure is illustrated in Figure 2. Thus, our question is: How can we best make the model trained on $X$ generalize to $Y$ ? + +Ideally, such a model would take surface similarity of words into account for generalization. We hypothesize that in closely related languages, unknown words in the low-resource language are likely to correspond to similar known words in the high-resource language in function and meaning. However, state-of-the-art language models represent words through subwords (Sennrich et al., 2016). This representation is sensitive to slight surface variations: minor changes to a string will lead to different segmentations and internal representations. + +To account for this problem, we apply noise to the surface representation of words in language $X$ . We implement this through character-level noise, i.e., we randomly4 select $10\% - 15\%$ of the tokens + +
NoiseDE-BERTDE-BERT + GSWDE-BERT + DEDE-BERT + DE + Noise
X50.6672.152.0853.88
72.7782.1171.1370.45
+ +Table 1: POS tag accuracy for Swiss German (GSW) on different language models fine-tuned on German (DE) training data with and without noise. + +of a sentence5 excluding numbers and punctuation. One randomly selected character of the chosen token undergoes one of three possible operations: delete, replace, insert, each with equal probability. The latter two operations work with an additional randomly selected character of the (extended) Latin Alphabet for the source language. The following sentence This is a short example. will end up with some sort of a "typo", e.g., as This ius a short example. Noise can be applied during pre-training on $X$ , and/or during fine-tuning on a task $T$ for language $X$ . + +Another possibility to alleviate the subword representation problem is BPE-dropout (Provilkov et al., 2020), which applies different segmentations to words in a randomized fashion. BPE-dropout was originally motivated to increase robustness for morphological variance. We hypothesize that it is similarly effective for orthographic variance; see Table A1 for examples. Overall, both character-level noise and BPE-dropout encourage the model to learn generalizations across similar surface strings via shared subwords. + +A second motivation for character-level noise is that we aim to imbue the model with different inductive biases. For example, a model for POS tagging might learn that only a small set of words can map to closed word classes such as articles, whereas unknown words are likely to belong to an open word class such as named entities. Training with character-level noise will reduce this bias. + +# 4 Experiments + +We design our experimental procedure to answer the following question: Does character-level noise improve zero-shot transfer to closely related languages? Within three controlled experiments, we + +ablate the importance of the noise-augmentation strategy. We select two cross-lingual tasks: 1) POS tagging (15% noise) and 2) topic classification (10% noise). While the former task illustrates the strategy's potential on word level, the latter provides insight into how much it helps on text level. + +# 4.1 POS Tagging for Swiss German Dialects + +As base models, we use the German "dbmdz" BERT $^{7}$ (DE-BERT) and mBERT (Devlin et al., 2019). We continue pre-training on the SwissCrawl corpus (Linder et al., 2020) for the Swiss German (GSW) LM-adaptation and the DE part of The Credit Suisse News Corpus (Volk et al., 2018) for the German LM-adaptation. For task fine-tuning, we use a DE UD treebank and for the evaluation a part of NOAA's Corpus (Hollenstein and Aepli, 2014). + +As shown in Table 1, all settings profit from fine-tuning with noise and bring about improvements of up to 22 percentage points (DE-BERT without pre-training). The best result with an accuracy of $82.11\%$ for zero-shot GSW POS tagging is achieved with a GSW-adapted language model and task fine-tuning on a noised DE corpus. Considering the case where no GSW text data is available for language model adaptation, we still achieve an accuracy of $77.11\%$ for zero-shot GSW POS tagging with mBERT fine-tuned on noised DE data (see Table 2). + +# 4.2 POS Tagging with mBERT + +We fine-tune mBERT on a UD corpus of a language already seen during mBERT pre-training: DE, Finnish (FI), Swedish (SV), French (FR), or Icelandic (IS, Arnardóttir et al. (2020)) and test on a closely related language variety absent from mBERT: GSW, Old French (OFR), Livvi (OLO, Pirinen (2019)), Karelian (KRL, Pirinen (2019)), or Faroese (FO, Tyers et al. (2018)). In addition to noise, we added experiments with a BPE-dropout of 0.1 (empirically selected) during the fine-tuning step. + +Table 2 illustrates that the method works well for closely related language varieties (upper part) but less for other language pairs, which are more distant (lower part). We do see an occasional improvement for more distant language pairs, but they + +
LanguagesBaselineBPE-DropoutNoiseBPE-Drop-out+Noise
DE→GSW73.1476.4877.1178.13
FI→OLO69.3269.6673.0371.76
FI→KRL72.4476.3579.1878.57
SV→FO84.7686.2087.6387.31
IS→FO85.9486.8087.4387.46
FR→OFR63.4266.6566.7367.27
DE→FO81.7481.3481.3882.27
DE→OLO52.6352.0951.1049.26
DE→KRL57.5157.4755.7153.37
DE→OFR44.0839.1738.3240.03
FR→OLO56.4956.7258.5956.64
FR→KRL59.4662.2764.5264.15
FR→FO81.1382.0981.8182.62
+ +are generally smaller and less consistent than the improvements for the closely related languages we evaluated. + +Furthermore, we have to consider the (much) lower baseline where an accuracy gain does not have the same impact. Hence, the two strategies BPE-dropout and noise improve the zero-shot performance for POS tagging over several closely related language pairs. While BPE-dropout shows some performance gain over the baseline, character-level noise adds additional accuracy points. + +# 4.3 Cross-dialect Topic Identification + +We work with mBERT and MOROco: The Moldavian and Romanian Dialectal Corpus (Butnaru and Ionescu, 2019). The data set contains 33,564 news domain text samples, each belonging to one of six topics (culture, finance, politics, science, sports, tech). We fine-tune mBERT on topic identification on Moldavian (MD) and evaluate on Romanian (RO) and vice versa. We emphasize the difference between this sentence-level task and the previous word-level task. While POS tagging works on the word form and can benefit from transferring prior information about probable POS sequences, topic classification is mainly meaning-oriented, making a transfer more challenging. + +Topic identification results in Table 3 show that + +Table 2: Zero-shot POS tagging accuracy of different strategies for several languages (TRAIN→TEST). The training and test languages are closely related in the upper but not in the lower part of the table as indicated by the colors (Finnic, West Germanic, North Germanic, and Western Romance language branches.) Noise consistently adds additional accuracy points beyond BPE-dropout performance increase. + +
TrainingNoiseTestAccuracy
MDXRO63.34
68.48
ROXMD81.65
83.01
+ +Table 3: Results for Moldavian (MD) vs. Romanian (RO) cross-dialect topic identification. Training with noise improves the transfer by 5.1 $(\mathrm{MD} \rightarrow \mathrm{RO})$ respectively 1.3 $(\mathrm{RO} \rightarrow \mathrm{MD})$ percentage points. + +fine-tuning with noise consistently improves the accuracy. However, noise-augmented training data appears to have a more substantial effect when transferring from MD to RO (5.1 percentage points) than vice-versa (1.4 percentage points). This is interesting given that RO represents the high-resource standard language in this context (being one of the languages used to train mBERT), while MD is its low-resource variety. We conjecture that this is caused by the fact that the model trained in MD struggles with word meaning and is, therefore, more sensitive to variations than its RO counterpart. + +# 5 Analysis + +Figure 3 illustrates the prediction differences of a model trained with and without noise. We observe that the models trained without noise have learned a tendency towards labeling unknown words as open-class words such as names (NE) or adjectives (ADJD), with the label for foreign words (FM) being massively overpredicted, while it tends to under-generate closed-class tags such as articles (ART) or adverbs (ADV). In contrast, the model trained with noise comes much closer to the gold standard tag distribution. It has learned to rely more on probable POS tag sequences than on the surface form of a token. Consider e.g. the GSW article $d$ (DE die; the). In the DE training corpus, the token appears only as a foreign word (FM) because it also happens to be a French word, but the model trained with noise is more likely to correctly tag it as an article, relying more on context than just strict mappings.[8] + +Figure 4 depicts the per-type F1 change for the most frequent STTS (Schiller et al., 1999) tags. The past participles of the auxiliary verbs (VAPP) form another closed class which profits substantially from a model focusing on tag sequences given the compound structure of the perfect tense. As Swiss German does not have a simple past, the + +![](images/57d97916fe6d076ff1d4f1a9afa2ec797e823b3e7f6d47cebf852ff538c2a348.jpg) +Figure 3: Number of tokens per POS tag in the gold standard vs. predictions of two models, fine-tuned with and without noise. Only the most frequent STTS tags are displayed. + +![](images/f3e64cbedc7110204159133d3301659f2e0cbfded9e938c2aff9fd4aae74921a.jpg) +Figure 4: Per-type F1 change of the most frequent STTS tags illustrating which tags profit the most when the model is fine-tuned with noise. + +perfect tense is much more frequent than it is in German. + +# 5.1 Conditional Random Field + +Given that one potential consequence of adding noise is that the model relies more on surrounding context and probable POS tag sequences (rather than strict word-level mappings), we compare our results to a method that explicitly models tag sequences, Bi-LSTMs+CRF (bidirectional long-short-term memory + conditional random field). This method was used to achieve state-of-the-art performance for POS tagging (Huang et al., 2015). For the implementation, we added a CRF layer on top of BERT. + +The added CRF layer did not improve the performance of the fine-tuned mBERT model for zero-shot POS tagging for Swiss German trained on German, as presented in Table 4. In contrast, noise injection has proven effective in both configura + +
NoisemBERTmBERT+CRF
X70.2469.26
78.5776.90
+ +Table 4: Zero-shot POS tag accuracy for Swiss German on mBERT & mBERT+CRF models trained on German with and without noise. + +tions. + +# 6 Discussion + +Our investigation into cross-lingual zero-shot transfer between closely related languages demonstrates that simple data augmentation with character-level noise can successfully improve transfer, with absolute improvements ranging from 1.4 (RO $\rightarrow$ MO transfer of topic identification) to 22 (DE $\rightarrow$ GSW transfer of POS tagging in the case of DE-BERT without pre-training) percentage points. + +The examination of prediction errors shows that a baseline BERT model has learned heuristics for unseen words that are undesirable for transfer between closely related languages. In contrast, a model trained with noise can combat this bias without substantial performance losses in the source languages. + +We expect that the final effectiveness of using character-level noise for zero-shot cross-lingual transfer depends on the task and language characteristics. We plan to evaluate the effect of character-level noise in a broader range of settings in future work. More broadly, we encourage further research that exploits surface-level word similarity for cross-lingual transfer between related languages and dialects, rather than focusing purely on vector space representations. + +# Acknowledgments + +We thank Yves Scherrer for input regarding data sets and the anonymous reviewers for their valuable comments. This project has received funding from the Swiss National Science Foundation (project nos. 191934 & 176727). + +# Ethical Considerations + +Our work did not involve any new data collection or annotation and did not require in-house workers or introduce any new models and related risks. Instead, we examine how character-level noise can help the transfer between closely related languages, especially in low-resource zero-shot settings. + +# References + +Antonios Anastasopoulos, Alison Lui, Toan Q. Nguyen, and David Chiang. 2019. Neural machine translation of text from non-native speakers. 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 3070-3080, Minneapolis, Minnesota. Association for Computational Linguistics. +Pórunn Arnardóttir, Hinrik Hafsteinsson, Einar Freyr Sigurðsson, Kristín Bjarnadóttir, Anton Karl Ingason, Hildur Jónsdóttir, and Steinþör Steingrímsson. 2020. A Universal Dependencies conversion pipeline for a Penn-format constituency treebank. In Proceedings of the Fourth Workshop on Universal Dependencies (UDW 2020), pages 16-25, Barcelona, Spain (Online). Association for Computational Linguistics. +Mikel Artetxe, Sebastian Ruder, and Dani Yogatama. 2020. On the cross-lingual transferability of monolingual representations. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4623–4637, Online. Association for Computational Linguistics. +Yonatan Belinkov and Yonatan Bisk. 2018. Synthetic and natural noise both break neural machine translation. In International Conference on Learning Representations (ICLR-2018), Vancouver, BC, Canada. +Andrei Butnaru and Radu Tudor Ionescu. 2019. Morocco: The moldavian andromanian dialectal corpus. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 688-698. +Alexis Conneau and Guillaume Lample. 2019. Cross-lingual language model pretraining. In Advances in Neural Information Processing Systems (NeurIPS), pages 7057-7067. +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. +Nadir Durrani, Hassan Sajjad, Hieu Hoang, and Philipp Koehn. 2014. Integrating an unsupervised transliteration model into statistical machine translation. In Proceedings of the 14th Conference of the European Chapter of the Association for Computational Linguistics, volume 2: Short Papers, pages 148-153, Gothenburg, Sweden. Association for Computational Linguistics. +Xiaochuang Han and Jacob Eisenstein. 2019. Unsupervised domain adaptation of contextualized embeddings for sequence labeling. 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 4238-4248, Hong Kong, China. Association for Computational Linguistics. +Georg Heigold, Stalin Varanasi, Günter Neumann, and Josef van Genabith. 2018. How robust are character-based word embeddings in tagging and MT against wrod scrambling or randdm nouse? In Proceedings of the 13th Conference of the Association for Machine Translation in the Americas (Volume 1: Research Track), pages 68-80, Boston, MA. Association for Machine Translation in the Americas. +Nora Hollenstein and Noëmi Aepli. 2014. Compilation of a Swiss German dialect corpus and its application to PoS tagging. In Proceedings of the First Workshop on Applying NLP Tools to Similar Languages, Varieties and Dialects, pages 85-94, Dublin, Ireland. Association for Computational Linguistics and Dublin City University. +Junjie Hu, Sebastian Ruder, Aditya Siddhant, Graham Neubig, Orhan First, and Melvin Johnson. 2020. XTREME: A massively multilingual multitask benchmark for evaluating cross-lingual generalization. CoRR, abs/2003.11080. +Kuan-Hao Huang, Wasi Ahmad, Nanyun Peng, and Kai-Wei Chang. 2021. Improving zero-shot cross-lingual transfer learning via robust training. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1684–1697, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Zhiheng Huang, Wei Xu, and Kai Yu. 2015. Bidirectional LSTM-CRF models for sequence tagging. arXiv preprint arXiv:1508.01991. +Vladimir Karpukhin, Omer Levy, Jacob Eisenstein, and Marjan Ghazvininejad. 2019. Training on synthetic noise improves robustness to natural noise in machine translation. In Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019), pages 42-47, Hong Kong, China. Association for Computational Linguistics. +Anne Lauscher, Vinit Ravishankar, Ivan Vulic, and Goran Glavaš. 2020. From zero to hero: On the limitations of zero-shot language transfer with multilingual Transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4483-4499, Online. Association for Computational Linguistics. +Ying Lin, Xiaoman Pan, Aliya Deri, Heng Ji, and Kevin Knight. 2016. Leveraging entity linking and related language projection to improve name transliteration. In Proceedings of the Sixth Named Entity Workshop, pages 1-10, Berlin, Germany. Association for Computational Linguistics. + +Lucy Linder, Michael Jungo, Jean Hennebert, Claudiu Cristian Musat, and Andreas Fischer. 2020. Automatic creation of text corpora for low-resource languages from the internet: The case of swiss german. In Proceedings of The 12th Language Resources and Evaluation Conference, pages 2706-2711, Marseille, France. European Language Resources Association. +Benjamin Muller, Antonios Anastasopoulos, Benoit Sagot, and Djamé Seddah. 2021. When being unseen from mBERT is just the beginning: Handling new languages with multilingual language models. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 448-462, Online. Association for Computational Linguistics. +Benjamin Muller, Benoit Sagot, and Djamé Seddah. 2020. Can multilingual language models transfer to an unseen dialect? A case study on north african arabizi. arXiv preprint arXiv:2005.00318. +Nikitha Murikinati, Antonios Anastasopoulos, and Graham Neubig. 2020. Transliteration for cross-lingual morphological inflection. In Proceedings of the 17th SIGMORPHON Workshop on Computational Research in Phonetics, Phonology, and Morphology, pages 189–197, Online. Association for Computational Linguistics. +Joakim Nivre, Marie-Catherine de Marneffe, Filip Ginter, Yoav Goldberg, Jan Hajic, Christopher D. Manning, Ryan McDonald, Slav Petrov, Sampo Pyysalo, Natalia Silveira, Reut Tsarfaty, and Daniel Zeman. 2016. Universal Dependencies v1: A multilingual treebank collection. In Proceedings of the Tenth International Conference on Language Resources and Evaluation (LREC'16), pages 1659-1666, Portoroz, Slovenia. European Language Resources Association (ELRA). +Tommi A Pirinen. 2019. Building minority dependency treebanks, dictionaries and computational grammars at the same time—an experiment in Karelian treebanking. In Proceedings of the Third Workshop on Universal Dependencies (UDW, SyntaxFest 2019), pages 132-136, Paris, France. Association for Computational Linguistics. +Ivan Provilkov, Dmitrii Emelianenko, and Elena Voita. 2020. BPE-dropout: Simple and effective subword regularization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1882-1892, Online. Association for Computational Linguistics. +Keisuke Sakaguchi, Kevin Duh, Matt Post, and Benjamin Van Durme. 2017. Robsut wrod reocginiton via semi-character recurrent neural network. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, February 4-9, 2017, San Francisco, California, USA., pages 3281-3287. AAAI Press. + +Anne Schiller, Simone Teufel, Christine Stöckert, and Christine Thielen. 1999. Guidelines für das Tagging deutscher Textkorpora mit STTS. +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. +Serge Sharoff. 2018. Language adaptation experiments via cross-lingual embeddings for related languages. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA). +Aditya Siddhant, Melvin Johnson, Henry Tsai, Naveen Ari, Jason Riesa, Ankur Bapna, Orhan First, and Karthik Raman. 2020. Evaluating the cross-lingual effectiveness of massively multilingual neural machine translation. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pages 8854-8861. AAAI Press. +Matthias Sperber, Jan Niehues, and Alex Waibel. 2017. Toward robust neural machine translation for noisy input sequences. In Proceedings of the 14th International Conference on Spoken Language Translation (IWSLT 2017), pages 90-96, Tokyo, Japan. +Francis Tyers, Mariya Sheyanova, Aleksandra Martynova, Pavel Stepachev, and Konstantin Vinogorodskiy. 2018. Multi-source synthetic treebank creation for improved cross-lingual dependency parsing. In Proceedings of the Second Workshop on Universal Dependencies (UDW 2018), pages 144–150, Brussels, Belgium. Association for Computational Linguistics. +Vaibhav Vaibhav, Sumeet Singh, Craig Stewart, and Graham Neubig. 2019. Improving robustness of machine translation with synthetic noise. 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 1916-1920, Minneapolis, Minnesota. Association for Computational Linguistics. +Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. 2008. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th International Conference on Machine Learning, ICML '08, page 1096-1103, New York, NY, USA. Association for Computing Machinery. +Martin Volk, Alena Zwahlen, and Chantal Amrhein. 2018. Credit Suisse News Corpus (Release 05). + +XML-Format. A collection of translated news in English, French, German and Italian. + +Xinyi Wang, Sebastian Ruder, and Graham Neubig. 2021. Multi-view subword regularization. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 473-482, Online. Association for Computational Linguistics. + +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric 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 M. Rush. 2020. Huggingface's transformers: State-of-the-art natural language processing. + +Daniel Zeman, Jan Hajic, Martin Popel, Martin Potthast, Milan Straka, Filip Ginter, Joakim Nivre, and Slav Petrov. 2018. CoNLL 2018 shared task: Multilingual parsing from raw text to Universal Dependencies. In Proceedings of the CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies, pages 1-21, Brussels, Belgium. Association for Computational Linguistics. + +Daniel Zeman, Martin Popel, Milan Straka, Jan Hajic, Joakim Nivre, Filip Ginter, Juhani Luotolahti, Sampo Pyysalo, Slav Petrov, Martin Potthast, Francis Tyers, Elena Badmaeva, Memduh Gokirmak, Anna Nedoluzhko, Silvie Cinkova, Jan Hajic jr., Jaroslava Hlavacova, Václava Kettnerová, Zdenka Urešová, Jenna Kanerva, Stina Ojala, Anna Missila, Christopher D. Manning, Sebastian Schuster, Siva Reddy, Dima Taji, Nizar Habash, Herman Leung, Marie-Catherine de Marneffe, Manuela Sanguinetti, Maria Simi, Hiroshi Kanayama, Valeria de Paiva, Kira Droganova, Héctor Martínez Alonso, Cağrı Çöltekin, Umut Sulubacak, Hans Uszkoreit, Vivien Macketanz, Aljoscha Burchardt, Kim Harris, Katrin Marheinecke, Georg Rehm, Tolga Kayadelen, Mohammed Attia, Ali Elkahky, Zhuoran Yu, Emily Pitler, Saran Lertpradit, Michael Mandl, Jesse Kirchner, Hector Fernandez Alcalde, Jana Strnadová, Esha Banerjee, Ruli Manurung, Antonio Stella, Atsuko Shimada, Sookyoung Kwak, Gustavo Mendonça, Tatiana Lando, Rattima Nitisaroj, and Josie Li. 2017. CoNLL 2017 shared task: Multilingual parsing from raw text to Universal Dependencies. In Proceedings of the CoNLL 2017 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies, pages 1-19, Vancouver, Canada. Association for Computational Linguistics. + +# A Appendix + +# A.1 Analysis + +Table A1 shows Swiss German (GSW) words (and their corresponding standard German (DE) form and English (EN) translation) that had the highest accuracy increase when using a part-of-speech (POS) tagging model trained with character-level noise compared to the model trained without noise. These words were wrongly tagged with open-class tags by the baseline model. However, the model trained with noise was able to reduce this bias and thus correctly tag them with their closed-class tag. + +Furthermore, in most cases, one substitution/insertion/deletion-operation on the DE word would not suffice to get an exact match with the GSW word. This indicates that it is unnecessary to design a noise function that closely mirrors the linguistic differences between variants. + +# A.2 Data Sets + +# A.2.1 Universal Dependencies + +Table A2 contains the Universal Dependencies treebanks (UD, Nivre et al. (2016)) we used in this work. The treebanks can be downloaded via https://universaldependencies.org/#download. + +# A.2.2 Other Data Sets + +Table A3 shows data sets apart from UD that we used in this work. + +
GSWDEENMost frequent POS without noiseCorrect POSError reduction with noise (relative/absolute)
ondundandFMKON99.00% (-104)
wordegewordenbecomeVVPP, ADJDVAPP98.73% (-156)
drdertheFM, NE, NNART98.46% (-128)
hädhathadVVFIN, FMVAFIN98.21% (-55)
gsigewesenbeenVVPP, FMVAPP98.19% (-434)
vuvonfromFM, NEAPPR98.18% (-108)
emeeinemaADJA, FMART97.96% (-48)
gradgeradejustADJDADV97.59% (-81)
vumvomfrom theFM, APPRAPPRART96.49% (-55)
dedertheFM, NE, ADJAART95.76% (-1558)
+ +Table A1: Swiss German (GSW) words (and their corresponding standard German (DE) form and English (EN) translation) with the highest error reduction using a part-of-speech (POS) tagging model trained with character-level noise compared to the model trained without noise. + +
UsageLanguage (ISO)Language BranchTreebank# Sentences
TrainingFinnish (FI)FinnicTDT15K
French (FR)Western RomanceGSD16K
German (DE)West GermanicHDT190K
Icelandic (IS)North GermanicIcePaHC39K
Swedish (SV)North GermanicTalbanken5K
TestFaroese (FAO)North GermanicOFT1208
Karelian (KRL)FinnicKKPP228
Livvi (OLO)FinnicKKPP125
Old French (OFR)Western RomanceSRCMF1927
+ +Table A2: Universal Dependency treebanks we used for our experiments with the number of sentences ("# Sentences") we used for training or testing (specified in "usage"). + +
Corpus name (Language)SizeLink
Morocco (MD & RO)33.5K text sampleshttps://github.com/btaruandrei/MOROCO
NOAH's Corpus (GSW)7.3K sentenceshttps://noe-eva.github.io/NOAH-Corpus/
SwissCrawl (GSW)500K sentenceshttps://icosys.ch/swisscrawl
The Credit Suisse News Corpus (DE)105K sentenceshttps://pub.cl.uzh.ch/projects/b4c/en/corpora.php
+ +Table A3: Data sets we used for our experiments in addition to the UD treebanks in Table A2. \ No newline at end of file diff --git a/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/images.zip b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b96d5295e5113e609e3c527bceb2c81bbbfff4c6 --- /dev/null +++ b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d62118b5062377ae644a9212dff18b05ea60e2a04a5f1f515f64ec23025b5b59 +size 337826 diff --git a/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/layout.json b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..51c843476b69f23ad8988dd3050d7b18baa7f814 --- /dev/null +++ b/improvingzeroshotcrosslingualtransferbetweencloselyrelatedlanguagesbyinjectingcharacterlevelnoise/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41c23d4c83a276e5ed83a27cea0f377bf80c0d2f079d59b3e2d394ffaa7e9e39 +size 258105 diff --git a/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_content_list.json b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..cf940ae1b7a3fa670e08b7735679dd82ff1a8ab9 --- /dev/null +++ b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65d68cf1fc9098c60bfc3fbeab72a25ccb3ae31f2e759d0630b067523cf03636 +size 92289 diff --git a/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_model.json b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4810dad98e5347ebefc47224ad12b4157fad0b30 --- /dev/null +++ b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:585e41ba55e2c1678a3cecb0e85c5cbca346e0c13befbffc2cc60a68d7ba77ed +size 113128 diff --git a/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_origin.pdf b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a87b90fcb4063b9fd327f7b91c46ac83f17c3639 --- /dev/null +++ b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/be39902c-2210-468f-8cd9-c3eb7d28ff85_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ec198e8db290e02570dff5d58705e540c8be6226b7e15ba05e31395cba4f5f3 +size 865097 diff --git a/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/full.md b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ba2a6175f94a0b3f4a61c7dc732474f6cad133b4 --- /dev/null +++ b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/full.md @@ -0,0 +1,392 @@ +# Incorporating Dynamic Semantics into Pre-Trained Language Model for Aspect-based Sentiment Analysis + +Kai Zhang $^{1}$ , Kun Zhang $^{2}$ , Mengdi Zhang $^{3}$ , Hongke Zhao $^{4}$ , Qi Liu $^{1,*}$ , Wei Wu $^{3}$ , Enhong Chen $^{1}$ + +$^{1}$ School of Data Science, University of Science and Technology of China + +$^{2}$ School of Computer Science and Information Engineering, Hefei University of Technology + +$^{3}$ Meituan; $^{4}$ College of Management and Economics, Tianjin University kkzhang0808@mail.ustc.edu.cn; {qiliuql, cheneh} @ustc.edu.cn {zhang1028kun, wuwei19850318, mdz}@gmail.com; hongke@tju.edu.cn + +# Abstract + +Aspect-based sentiment analysis (ABSA) predicts sentiment polarity towards a specific aspect in the given sentence. While pre-trained language models such as BERT have achieved great success, incorporating dynamic semantic changes into ABSA remains challenging. To this end, in this paper, we propose to address this problem by Dynamic Re-weighting BERT (DR-BERT), a novel method designed to learn dynamic aspect-oriented semantics for ABSA. Specifically, we first take the Stack-BERT layers as a primary encoder to grasp the overall semantic of the sentence and then fine-tune it by incorporating a lightweight Dynamic Re-weighting Adapter (DRA). Note that the DRA can pay close attention to a small region of the sentences at each step and re-weigh the vitally important words for better aspect-aware sentiment understanding. Finally, experimental results on three benchmark datasets demonstrate the effectiveness and the rationality of our proposed model and provide good interpretable insights for future semantic modeling. + +# 1 Introduction + +Aspect-based sentiment analysis is a branch of sentiment analysis, which aims to identify sentiment polarity of the specific aspect in a sentence (Jiang et al., 2011). For example, given a sentence "The restaurant has attentive service, but the food is terrible," the task aims to predict the sentiment polarities towards "service" and "food", which should be positive and negative respectively. + +As a fundamental technology, the ABSA task has broad applications, such as recommender system (Chin et al., 2018; Zhang et al., 2021b) and question answering (Wang et al., 2019). Therefore, a great amount of research has been attracted from both academia and industry. Among them, deep neural networks (DNN) (Nguyen and Shirai, 2015; + +Tang et al., 2015, 2016; Zheng et al., 2020), attention mechanism (Wang et al., 2016; Ma et al., 2017) and graph neural/attention networks (Huang and Carley, 2019; Zhang et al., 2019a; Wang et al., 2020) have significantly improved the performance through deep feature alignment between the aspect representations and context representations. + +Recently, the large-scaled pre-trained language models, such as Bidirectional Encoder Representations from Transformers (BERT) (Devlin et al., 2019), realize a breakthrough for improving many language tasks, which further attracts considerable attention to enhance the semantic representations. In ABSA, Xu et al. (2019a) designed BERT-PT, which explores a novel post-training approach on the BERT model. Song et al. (2019) further proposed a text pair classification model BERT-SPC, which prepares the input sequence by appending the aspects into the contextual sentence. Although great success has been achieved by the above studies, some critical problems remain when directly applying attention mechanisms or fine-tuning the pre-trained BERT in the task of ABSA. + +Specifically, most of the existing approaches select all the important words from a contextual sentence at one time. However, according to neuroscience studies, the essential words during semantic comprehension are dynamically changing with the reading process and should be repeatedly considered (Kuperberg, 2007; Tononi, 2008; Brouwer et al., 2021). For example, when judging the sentiment polarity of the aspect "system memory" in a review sentence "It could be a perfect laptop if it would have faster system memory and its radeon would have DDR5 instead of DDR3", the important words should change from general sentiment words {"faster", "perfect", "laptop"} into aspect-aware words {"would have", "faster", "could", "be", "perfect)}. Through these dynamic changes, the sentiment polarity will change from positive to the ground truth sentiment label negative. + +Meanwhile, simply initializing the encoder with a pre-trained BERT does not effectively boost the performance in ABSA as we expected (Huang and Carley, 2019; Xu et al., 2019a; Wang et al., 2020). One possible reason could be that training on two specific tasks, i.e., Next Sentence Prediction and Masked LM, with rich resources leads to better semantic of the overall sentences. However, the ABSA task is conditional, which means the model needs to understand the regional semantics of sentences by fully considering the given aspect. For instance, BERT tends to understand the global sentiment of the above sentence "It could be a perfect laptop ... of DDR3" regardless of which aspect is given. But in ABSA, the sentence is more likely to be different sentiment meanings for different aspects (e.g., negative for "system memory" while positive for "DDR5"). Therefore, the vanilla BERT is hardly to pay closer attention to relevant information for the specific aspect, especially when there are multiple aspects in one sentence. + +To equip the pre-trained models with the ability to capture the aspect-aware dynamic semantics, we present a Dynamic Re-weighting BERT (DR-BERT) model, which considers the aspect-aware dynamic semantics in a pre-trained learning framework. Specifically, we first take the Stack-BERT layers as primary sentence encoder to learn overall semantics of the whole sentences. Then, we devise a Dynamic Re-weighting Adapter (DRA), which aims to pay most careful attention to a small region of the contextual sentence and dynamically select and re-weight one critical word at each step for better aspect-aware sentiment understanding. Finally, to overcome the limitation of vanilla BERT mentioned above, we incorporate the light-weighted DRA into each BERT encoder layer and fine-tune it to adapt to the ABSA task. We conduct extensive experiments on three widely-used datasets where the results demonstrate the effectiveness, rationality and interpretability of the proposed model. + +# 2 Related Work + +# 2.1 Aspect-based Sentiment Analysis + +Aspect-based sentiment analysis identifies specific aspect's sentiment polarity in the sentence. Some approaches (Ding and Liu, 2007; Jiang et al., 2011; Kiritchenko et al., 2014) designed numerous rules-based models for ABSA. For example, Ding and Liu (2007) first performed dependency parsing to determine sentiment polarity about the aspects. + +In recent years, most research studies make use of the attention mechanism to learn the word's semantic relation (Tang et al., 2015, 2016; Wang et al., 2016; Ma et al., 2017; Xing et al., 2019; Liang et al., 2019; Zhang et al., 2021a). Among them, Wang et al. (2016) proposed an attention-based LSTM to identify important information relating to the aspect. Ma et al. (2017) developed an interactive attention to model the aspect and sentence interactively. Fan et al. (2018) defined a multi-grained network to link the words from aspect and sentence. Li et al. (2018) designed a target-specific network to integrate aspect information into sentence. Tan et al. (2019) introduced a dual attention to distinguish conflicting opinions. + +In addition, another research trend is to leverage syntactic knowledge to learn syntax-aware features of the aspect (Tang et al., 2019; Huang and Carley, 2019; Zhang et al., 2019a; Sun et al., 2019; Wang et al., 2020; Tang et al., 2020; Chen et al., 2020; Li et al., 2021; Tian et al., 2021). For example, Tang et al. (2020) developed dependency graph enhanced dual-transformer network to fuse the flat representations. More recently, pre-trained methods have been proved remarkably successful in the ABSA task. Song et al. (2019) devised an attentional encoder and a BERT-SPC model to learn features between aspect and context. Wang et al. (2020) reshaped the dependency trees and proposed a relational graph attention network to encode the syntax relation feature. Tian et al. (2021) explicitly utilize dependency types with a type-aware graph networks to learn aspect-aware relations. + +However, these methods largely ignore the procedure of dynamic semantic comprehension (Kuperberg, 2007; Kuperberg and Jaeger, 2016; Wang et al., 2017; Zhang et al., 2019c; Brouwer et al., 2021) and can not fully reveal dynamic semantic changes of the aspect-related words. Thus, it's hard for ABSA models to achieve the same performance as human-level sentiment understanding. + +# 2.2 Human Semantic Comprehension + +Actually, no matter in the early days or now, imitating the procedure of human semantic comprehension has always been one of the original intention of many studies (Bezdek, 1992; Wang et al., 2017; Zheng et al., 2019; Li et al., 2019; Zhang et al., 2019d; Peng et al., 2020; Golan et al., 2020), such as machine reading comprehension (Zhang et al., 2019d; Peng et al., 2020), visual object detecting (Spampinato et al., 2017) and relevance estima + +![](images/44cb03b608ace47acdd984049fb288926fe41aa5dfae0ab189631bf8c9391de8.jpg) +Figure 1: An illustration of the proposed framework. The blue blocks constitute a pre-trained BERT model which are frozen during fine-tuning, and the right block represents the dynamic re-weighting adapter that is inserted after each BERT encoder layer and trained during fine-tuning. Moreover, $S$ and $A$ represent the sentence sequence and the aspect sequence respectively. $N$ indicates the number of layers of the BERT encoder. + +tion (Li et al., 2019). For example, attention mechanism (Vaswani et al., 2017) has a widespread influence, which allows the model to focus on important parts of the input as human's attention. Spampinato et al. (2017) aimed to learn human-based features via brain-based visual object. Wang et al. (2017) built a dynamic attention model to model human preferences for article recommendation. + +Moreover, some psychologists and psycholinguists have also done many research on the mechanisms of human semantic comprehension (Kuperberg, 2007; Kuperberg and Jaeger, 2016; Brouwer et al., 2021). Specifically, some scholars (Yang and McConkie, 1999; Rayner, 1998) found that most people may focus on 1.5 words. Moreover, Koch and Tsuchiya (2007) and Tononi (2008) assumed that people can only remember the meaning of about 7 to 9 words at each time. The phenomenons indicate that most people only focused on a small region of the sentence at one time and need to repeatedly process important parts for better semantic understanding (Sharmin et al., 2015). + +Inspired by the above research and linguistic psychology theories, in this paper, we explore aspect-aware semantic changes of the ABSA task by incorporating the procedure of dynamic semantic comprehension into the pre-trained language model. + +# 3 Dynamic Re-weighting BERT + +In this section, we introduce the technical detail of DR-BERT. Specifically, we start with the problem definition, followed by an overall architecture of DR-BERT as illustrated in Figure 1. + +Problem Definition In ABSA, a sentence-aspect pair $(S,A)$ is given. In this paper, the sentence is + +represented as $S = \{w_1^s, w_2^s, \dots, w_{l_s}^s\}$ which consists of a series of $l_s$ words. The specific aspect is denoted as $A = \{w_1^a, w_2^a, \dots, w_{l_a}^a\}$ which is a part of $S$ . $l_a$ is the length of aspect words. The goal of ABSA is to learn a sentiment classifier that can precisely predict the sentiment polarity of sentence $S$ for specific aspect $A$ . As the aspect-related information plays a key role in the prediction (Li et al., 2018; Zheng et al., 2020), this paper aims to dynamically select and encode the aspect-aware semantic information through the proposed model. + +Overall Architecture DR-BERT mainly contains two components (i.e., BERT encoder and Dynamic Re-weighting Adapter), together with two modules (i.e., the embedding module and sentiment prediction module). The technical details of each part will be elaborated on as follows. + +# 3.1 Embedding Module + +To represent semantic information of the aspect words and context words better, we first map each word into a low-dimensional vector. Specifically, the inputs of DR-BERT are the sentence sequence and the corresponding aspect sequence. For the sentence sequence, we construct the BERT input as "[CLS]" + sentence + "[SEP]" and the sentence $S = \{w_1^s, w_2^s, \dots, w_{l_s}\}$ can be transformed into the hidden states $\mathbf{s} = \{\mathbf{s}_i \mid i = 1, 2, \dots, l_s\}$ with BERT embedding. For aspect sequences, we adopt the same method to get the representation vector of each word. Thus, through the embedding module, the aspect sequence $A = \{w_1^a, w_2^a, \dots, w_{l_a}^a\}$ is mapped to $\mathbf{a}^s = \{\mathbf{a}_j \mid j = 1, 2, \dots, l_a\}$ . Note that, if the aspect sequence is a single word like "food", the aspect representation is the embedding of the + +single word "food". While for the cases where the sequence contains multiple words such as "system memory", the aspect representation is the average of each word embedding (Sun et al., 2015). We can denote the aspect embedding process as: + +$$ +\mathbf {a} = \left\{ \begin{array}{l l} \mathbf {a} _ {1}, \mathrm {i f} l _ {a} = 1, \\ (\sum_ {j = 1} ^ {l _ {a}} \mathbf {a} _ {j}) / l _ {a}, \mathrm {i f} l _ {a} > 1, \end{array} \right. \tag {1} +$$ + +where $\mathbf{a}_j$ is the embedding of word $j$ in the aspect sequence. a denotes the embedding of the aspect. + +# 3.2 BERT Encoder + +The architecture of BERT (Devlin et al., 2019) is akin to the Transformer (Vaswani et al., 2017). For simplicity, we omit some architecture details such as position encoding, layer normalization (Xu et al., 2019b) and residual connections (He et al., 2016). + +1) Multi-head Self-attention Mechanism. In recent years, the multi-head self-attention mechanism (MultiHead) has received a wide range of applications in natural language processing. In the paper, we adopt MultiHead with $h$ heads to obtain the overall semantics of the whole sentence. The product from each self-attention network is then concatenated and finally transformed as: + +$$ +\begin{array}{l} \mathbf {m} = \left\{\mathbf {m} _ {i} \mid i = 1, 2, \dots , l _ {s} \right\} \tag {2} \\ = \mathbf {M u l t i H e a d} (\mathbf {s} \mathbf {W} _ {h} ^ {Q}, \mathbf {s} \mathbf {W} _ {h} ^ {K}, \mathbf {s} \mathbf {W} _ {h} ^ {V}), \\ \end{array} +$$ + +where $h$ denotes the $h$ -th attention head, $\mathbf{W}_i^Q$ , $\mathbf{W}_i^K$ and $\mathbf{W}_i^V$ are learnable parameters. Finally, the output feature is $\mathbf{m} = \{\mathbf{m}_i \mid i = 1,2,\dots,l_s\}$ . For detailed implementation of MultiHead, please refer to Transformer (Vaswani et al., 2017). + +2) Position-wise Feed-Forward Network. Since the multi-head attention is a series of linear transformations, we then apply the position-wise feedforward network (FFN) to learn the feature's nonlinear transformation. Specifically, the FFN consists of two linear transformations along with a ReLU activation in between. More formally: + +$$ +\begin{array}{l} \mathbf {f} = \left\{\mathbf {f} _ {i} \mid i = 1, 2, \dots , l _ {s} \right\} \tag {3} \\ = \mathbf {m a x} (0, \mathbf {m W} _ {1} + \mathbf {b} _ {1}) \mathbf {W} _ {2} + \mathbf {b} _ {2}, \\ \end{array} +$$ + +where $\mathbf{W}_1, \mathbf{b}_1, \mathbf{W}_2$ and $\mathbf{b}_2$ are learnable parameters in the linear transformations. + +So far, with the input $S = \{w_1^s, w_2^s, \dots, w_{l_s}^s\}$ , we obtain the hidden states $\mathbf{f} = \{\mathbf{f}_i \mid i = 1, 2, \dots, l_s\}$ via the BERT encoder. Then, for the words' hidden + +states of the sentence from FFN, we utilize the max-pooling operation to fairly select crucial features in the sentence (Lai et al., 2015; Zhang et al., 2019b), so as to obtain the original sentence representation $\mathbf{h}_s$ at the beginning of each re-weighting step: + +$$ +\mathbf {h} _ {s} = \operatorname {M a x} _ {\text {P o o l i n g}} \left(\mathbf {f} _ {i} \mid i = 1, 2, \dots , l _ {s}\right). \tag {4} +$$ + +# 3.3 Dynamic Re-weighting Adapter (DRA) + +The currently attention mechanism in deep learning is essentially similar to the selective visual attention of human beings (Vaswani et al., 2017; You et al., 2016). However, as for the text semantic understanding, human brain will discover the intentional relationship of words at a sentential level (Taatgen et al., 2007; Sha et al., 2016; Sen et al., 2020) and link the incoming semantic information with pre-existing information stored within memory. Thus, we design a dynamic re-weighting adapter (DRA) which can dynamically emphasize the important aspect-aware words for the ABSA task. + +As shown in the right part of Figure 1, based on overall semantics of the whole sentence, DRA further selects the most important word at each step with consideration of the specific aspect representation. Specifically, the inputs of DRA are the final outputs of the BERT encoder (i.e., $\mathbf{h}_s$ ) and the original aspect embedding (i.e., a). In each step, we first utilize re-weighting attention to choose the word for current input from the input sequence ( $\{\mathbf{s}_i \mid i = 1,2,\dots,l_s\}$ ). Then, we utilize Gated Recurrent Unit (GRU)(Cho et al., 2014) to encode the chosen word and update the semantic representation of the review sentence. + +Formally, we regard the calculation process as: + +$$ +\begin{array}{l} \mathbf {a} _ {t} = F \left(\left[ \mathbf {s} _ {1}, \mathbf {s} _ {2}, \dots , \mathbf {s} _ {l _ {s}} \right], \mathbf {h} _ {t - 1}, \mathbf {a}\right), \\ \mathbf {l} _ {t - 1} = C P U (\dots , \mathbf {l} _ {t - 1}) \quad t \in [ 1, T ] \end{array} \tag {5} +$$ + +$$ +\mathbf {h} _ {t} = G R U \left(\mathbf {a} _ {t}, \mathbf {h} _ {t - 1}\right), \quad t \in [ 1, T ] +$$ + +where $\mathbf{a}$ is the original embedding vector of the aspect words. $\mathbf{a}_t$ is the output of re-weighting function $F$ . $T$ denotes the dynamic re-weighting length over the sentences, which represents the cognitive threshold of human beings. $\mathbf{h}_0 = \mathbf{h}_s$ is the initial state and $\mathbf{h}_T$ is the output hidden states of DRA. + +1) The Re-weighting Function. More specifically, we utilize the attention mechanism to achieve the re-weighting function $\mathrm{F}$ , which aims to select the most important aspect-related word at each step. The calculation can be formulated as: + +$$ +\mathbf {S} = \left[ \mathbf {s} _ {1}, \mathbf {s} _ {2}, \dots , \mathbf {s} _ {l _ {s}} \right], +$$ + +$$ +\mathbf {M} = \mathbf {W} _ {s} \mathbf {S} + \left(\mathbf {W} _ {d} \mathbf {h} _ {t - 1} + \mathbf {W} _ {a} \mathbf {a}\right) \otimes \mathbf {w}, \tag {6} +$$ + +$$ +\mathbf {m} = \omega^ {T} \tanh (\mathbf {M}), +$$ + +where $\mathbf{S}$ denotes the original sentence embedding, $\mathbf{M}$ is the fusion representation of the aspects and the sentences. $\mathbf{W}_s$ , $\mathbf{W}_d$ , $\mathbf{W}_a$ and $\omega$ are trainable parameters. $\mathbf{w} \in \mathbb{R}^{l_s}$ is a row vector of 1 and $\otimes$ denotes the outer product. + +Subsequently, to better encode aspect-aware semantics, we choose the most important word (i.e., one word) at each step for the specific aspect. + +$$ +\alpha_ {i} = \frac {\exp (m _ {i})}{\sum_ {k = 1} ^ {l _ {s}} \exp (m _ {k})}, \tag {7} +$$ + +$$ +\mathbf {a} _ {t} = \mathbf {s} _ {j}, (j = \operatorname {I n d e x} (\max (\alpha_ {i}))) +$$ + +where $m_{i}$ and $\alpha_{i}$ are the hidden state and the attention score of $i$ -th word in the sentence. $\mathbf{a}_{t}$ is the chosen word which is most related to the specific aspect at $t$ -th step. However, $\operatorname{Index}(\max(\cdot))$ operation has no derivative, which means its gradient could not be calculated. Inspired by softmax function, we modify the Eq.7 and employ the following operation to re-weight the contextual words: + +$$ +\mathbf {a} _ {t} = \sum_ {i = 1} ^ {l _ {\mathrm {s}}} \frac {\exp (\lambda m _ {i})}{\sum_ {k = 1} ^ {l _ {\mathrm {s}}} \exp (\lambda m _ {k})} \mathbf {s} _ {i}. \tag {8} +$$ + +Note that, we design a hyper-parameter $\lambda$ to ensure our model achieves the above purpose. Specifically, the softmax function can exponentially increase or decrease the signal, thereby highlighting the information we want to enhance. Thus, when $\lambda$ is an arbitrarily large value, the attention score of the chosen word is infinitely close to 1, and other words are infinitely close to 0. In this way, the most important word (i.e., one word) will be extract from the context at each re-weighting step. + +2) The GRU Function. To better encode semantic of the whole sentence, we also employ GRU to further imitate the procedure of human semantic comprehension under the specific context, which is consistent with the process of people adjusting to a new text based on their understanding behavior. Therefore, given a previous vector embedding, the hidden vectors of GRU are calculated by receiving it as input: + +$$ +z _ {t} = \sigma \left(\mathbf {W} _ {z} \cdot \left[ \mathbf {h} _ {t - 1}, \mathbf {a} _ {t} \right]\right) +$$ + +$$ +\begin{array}{l} r _ {t} = \sigma \left(\mathbf {W} _ {r} \cdot \left[ \mathbf {h} _ {t - 1}, \mathbf {a} _ {t} \right]\right) \\ \tilde {\mathbf {\tau}} _ {i} = \left[ \begin{array}{l l l l l l l l l l l l l l l l l l l l l l l l} & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & \\ \tilde {\mathbf {\tau}} _ {i} = \left[ \begin{array}{l l l l l l l l l l l l l l l l l l l l l l l l} & & & & & & & & & & & & & \end{array} \right] \end{array} \right] \end{array} \tag {9} +$$ + +$$ +\tilde {\mathbf {h}} _ {t} = \tanh \left(\mathbf {W} \cdot \left[ r _ {t} * \mathbf {h} _ {t - 1}, \mathbf {a} _ {t} \right]\right) +$$ + +$$ +\mathbf {h} _ {t} = \left(1 - z _ {t}\right) * \mathbf {h} _ {t - 1} + z _ {t} * \tilde {\mathbf {h}} _ {t}, +$$ + +where $\sigma$ is the logistic sigmoid function. $z_{t}$ and $r_t$ denote the update gate and reset gate respectively at the time step $t$ . + +
Datasets#Positive#Negative#Neural#L#M
TrainTestTrainTestTrainTest
Restaurant21647288071966371962045.5
Laptop9943418701284641691936.5
Twitter1561173156017331273461610.2
+ +Table 1: The statistics of three benchmark datasets. #L is the average length of sentences. #M is the proportion $(\%)$ of samples with multiple (i.e., more than 1) aspects. + +# 3.4 Sentiment Predicting + +After applying BERT layers and DRA on the input sentence, its root representation (i.e., s) is converted into the feature representation e: + +$$ +\begin{array}{l} \mathbf {e} = \left\{\mathbf {e} _ {i} \mid i = 1, 2, \dots , l _ {s} \right\} \tag {10} \\ = \left(\mathbf {W} _ {e} \mathbf {f} + \mathbf {U} _ {e} \mathbf {h} _ {T} + \mathbf {b} _ {e}\right), \\ \end{array} +$$ + +where $\mathbf{W}_e$ , $\mathbf{U}_e$ and $\mathbf{b}_e$ are trainable parameters. After $N$ -th stacked BERT layers, we obtain the final representation of the sentence (i.e., $\mathbf{e}_N$ ). Then, we feed it into a Multilayer Perceptron (MLP) and map it to the probabilities over the different sentiment polarities via a softmax layer: + +$$ +\mathbf {R} _ {l} = \operatorname {R e l u} \left(\mathbf {W} _ {l} \mathbf {R} _ {l - 1} + \mathbf {b} _ {l}\right), \tag {11} +$$ + +$$ +\hat {\mathbf {y}} = \operatorname {s o f t m a x} \left(\mathbf {W} _ {o} \mathbf {R} _ {h} + \mathbf {b} _ {o}\right), +$$ + +where $\mathbf{W}_l, \mathbf{W}_o, \mathbf{b}_l$ and $\mathbf{b}_o$ are learned parameters. $\mathbf{R}_l$ is the hidden state of $l$ -th layer MLP ( $\mathbf{R}_0 = \mathbf{e}_N$ , $l \in [1,h]$ ). $\mathbf{R}_h$ is the state of final layer which is also regarded as the output of the MLP. $\hat{\mathbf{y}}$ is the predicted sentiment polarity distribution. + +# 3.5 Model Training + +Finally, we applies the cross-entropy loss function for model training: + +$$ +\mathcal {L} = - \sum_ {i = 1} ^ {M} \sum_ {j = 1} ^ {C} y _ {i} ^ {j} \log \left(\hat {y} _ {i} ^ {j}\right) + \beta \| \Theta \| _ {2} ^ {2}, \tag {12} +$$ + +where $y_{i}^{j}$ is the ground truth sentiment polarity. $C$ is the number of labels (i.e, 3 in our task). $M$ is the number of training samples. $\Theta$ corresponds to all of the trainable parameters. + +# 4 Experiment + +# 4.1 Datasets + +We mainly conduct experiments on three benchmark ABSA datasets, including "Laptop", "Restaurant" (Pontiki et al., 2014) and "Twitter" (Dong et al., 2014). Each data item is labeled with three + +
CategoryDatasets MethodsLaptopRestaurantTwitter
AccuracyF1-scoreAccuracyF1-scoreAccuracyF1-score
Attention.ATAE-LSTM (Wang et al., 2016)68.5764.5276.5867.3967.2766.43
IAN (Ma et al., 2017)70.8465.7376.8868.3668.7467.61
MemNet (Tang et al., 2016)72.3267.0378.1268.9970.1968.22
AOA (Huang et al., 2018)74.5668.7779.4270.4371.6869.25
MGNet (Fan et al., 2018)75.3771.2681.2872.0772.5470.78
TNet (Li et al., 2018)76.5471.7580.6971.2774.9373.60
Pre-trained.BERT (Devlin et al., 2019)77.2973.3682.4073.1773.4272.17
BERT-PT (Xu et al., 2019a)78.0775.0884.9576.96--
BERT-SPC (Song et al., 2019)78.9975.0384.4676.9874.1372.73
AEN-BERT (Song et al., 2019)79.9376.3183.1273.7674.7173.13
RGAT-BERT (Wang et al., 2020)78.2174.0786.6081.3576.1574.88
T-GCN (Tian et al., 2021)80.8877.0386.1679.9576.4575.25
Ours.DR-BERT81.4578.1687.7282.3177.2476.10
+ +Table 2: Experimental results (%) in three benchmark datasets. We underline the best performed baseline. + +sentiment polarities (i.e., positive, negative and neutral). The statistics of the datasets are presented in Table 1. Moreover, we follow the dataset configurations of previous studies strictly. For all datasets, we randomly sample $10\%$ items from the training set and regard them as the development set. + +# 4.2 Hyperparameters Settings + +In the implementation, we build our framework based on the official bert-base models ( $\mathrm{n_{layers}} = 12$ , $\mathrm{n_{heads}} = 12$ , $\mathrm{n_{hidden}} = 768$ ). The hidden size of GRUs and re-weighting length of DRA are set to 256 and 7. The learning rate is tuned amongst [2e-5, 5e-5 and 1e-3] and the batch size is manually tested in [16, 32, 64, 128]. The dropout rate is set to 0.2. The hyper-parameter $l$ , $\beta$ and $\lambda$ have been carefully adjusted, and final values are set to 3, 0.8 and 100 respectively. The model is trained using the Adam optimizer and evaluated by two widely used metrics. The parameters of baseline models are in accordance with the default configuration of the original paper. We run our model three times with different seeds and report the average performance. + +# 4.3 Baselines + +- Attention-based Models: MemNet (Tang et al., 2016), ATAE-LSTM (Wang et al., 2016), IAN (Ma et al., 2017), AOA (Huang et al., 2018), MGNet (Fan et al., 2018), TNet (Li et al., 2018). +- Pre-trained Models: Fine-tune BERT (Devlin et al., 2019), BERT-PT (Xu et al., 2019a), BERT-SPC, AEN-BERT (Song et al., 2019), RGAT-BERT (Wang et al., 2020), TGCN (Tian et al., 2021). + +The baseline methods have comprehensive coverage of the recent related SOTA models recently. Most of them are detailed in Section 2.1. For space-saving, we do not detail them in this section. + +# 4.4 Experimental Results + +From the results in Table 2, we have the following observations. First, BERT-based methods beat most of the attention-based methods (e.g., IAN and TNet) in both metrics. The phenomenon indicates the powerful ability of the pre-trained language models. That is also why we adopt BERT as base encoder to learn the overall semantic representation of the whole sentences. + +Second, by comparing non-specific BERT models (i.e., BERT and BERT-PT) with task-specific models (e.g., RGAT-BERT) for ABSA, we find that the task-specific BERT models perform better than the non-specific models. Specifically, we can also observe the performance trend that T-GCN&RGAT-BERT >AEN-BERT>BERT-PT>BERT, which is consistent with the previous assumption that aspect-related information is the crucial influence factor for the performance of the ABSA model. + +Finally, despite the outstanding performance of previous models, our DR-BERT still outperforms the most advanced baseline (i.e., T-GCN or RGAT-BERT) no matter in terms of Accuracy or F1-score. The results demonstrate the effectiveness of the dynamic modeling strategy based on the procedure of semantic comprehension. Meantime, it also indicates that our proposed DRA can better grasp the aspect-aware semantics of the sentence than other BERT plus-in components in previous methods. + +
Model VariantsLaptop
AccuracyF1-score
BERT-Base77.2973.36
(1): + MLP77.9474.42
(2): + DRA80.6677.13
(3): + DRA on top 3 layers78.6475.16
(4): + DRA on top 6 layers79.1775.93
(5): + DRA on top 9 layers80.2276.49
(6): DR-BERT81.4578.16
+ +Table 3: The ablation study on different components which conducted on the test set of the Laptop dataset. "BERT-Base" indicates the vanilla BERT. "+" indicates the setting with plus-in components. + +![](images/a0eaeffa5c1cac7e57d02039d5fa1f2573ec12a365a0426d4627c9ae1daf38e8.jpg) +(a) The performance (Accuracy) in three dataset. + +![](images/638e94253292ba87774f13bebf6ca8a60ed3bc200cfa11416c4a680ebe6473f3.jpg) + +![](images/c9ec6f7f42079b7300c0fe6efa2ab9997b2ca735a0172612d4f4cbd267b48767.jpg) +Figure 3: Comparison of the semantic understanding process between human reading and DRA when judging the sentiment polarity of aspect "food". (a) is the visualization of the human understanding process from the eye tracker†. (b) denotes aspect-aware words from re-weighting function. + +![](images/c46cb40b713d02125b92dc6c7953365302731496676f7e31b0ed139af20c87c4.jpg) +(b) The performance (F1-score) in three dataset. + +![](images/d2239c29ea3e28d0689d766cf97a31acc7818b10d0a36bdcf6e4b4d92720b1db.jpg) +Figure 2: The ablation study on the re-weighting length of the adapter. Red lines indicate Accuracy/ F1 scores while blue and green lines indicate the performance of the best baseline and BERT-base model respectively. + +![](images/4ac968461a45c12fba428f3b30923a55db8a6c11ca725e80f6533425253f2e3c.jpg) + +# 4.5 Ablation Study + +Ablations on the Proposed Components. In Table 3, we study the influence of different components in our framework, including the DRA and MLPs. We can find that without utilizing adapters and MLPs, DR-BERT degenerates into the BERT model, which gains the worst performance among all the variants. The phenomenon indicates the effective of the DRA and MLP modules. Moreover, through comparing (1) and (2), we can easily conclude that DRA plays a more crucial role in the final sentiment prediction than MLPs. + +Since BERT models are usually quite deep (e.g., 12 layers), we only insert the dynamic re-weighting adapter into top layers (i.e., 3-th, 6-th, and 9-th layers) to further verify the effectiveness of the DRA module. The results are shown in Table 3 (3), (4), and (5). We observe that when introducing adapters to the top layers of DR-BERT, our framework still outperforms the BERT model, showing that the DRA is efficient in encoding the aspect-aware semantics over the whole sentence. In addition, we can also find that the more adapter incorporated + +(a) Human Cognition +(b) DRA Chosen Words +![](images/e2cbbac8016efc80a8a90c0dc4ae0272817b9c1faef83c453ca30194c88769b1.jpg) +food, better, while, definitely, not, return + +in BERT layers the higher performance gained, illustrating the importance of modeling the deep dynamic semantics over the sentence. + +Ablations on the Scale of Adapter. In this subsection, we investigate the influence of the scale of adapters on different datasets. As shown in Figure 2, we tune the adapter's dynamic re-weighting length $(T)$ in a wide range (i.e., 2 to 10). Specifically, the performance of DR-BERT first becomes better with the increasing of re-weighting length and achieving the best result at around 7. Then, as the length continues to increase, the performance continues to decline. This phenomenon is consistent with the psychological findings that human memory focuses on nearly seven words (Tononi, 2008; Koch and Tsuchiya, 2007), which further indicates the effectiveness of DRA in modeling human-like (dynamic) semantic comprehension. + +Besides, compared with the best-performed baseline (blue lines), our model can achieve better performance with only 4 or 5 times of re-weighting at most test sets, illustrating the efficiency of the reweighting adapter. On the other hand, we can also find that DR-BERT always gives superior performance compared to the BERT-based model (green lines), even with the lowest re-weighting length. All those results show that DR-BERT could better comprehend aspect-aware dynamic semantics in aspect-based sentiment analysis. + +# 4.6 Interpretability Verification + +Comparison of Semantic Comprehension. To evaluate model rationality and interpretability, we conduct an study for dynamic semantic comprehension by eye tracker. As shown in Figure 3 (a), + +![](images/44149241bf3c508ab000f5665f27895889a1cf9efbb7b9abe9a043f7c0f093ab.jpg) +Figure 4: Visualization results of multiple aspects in the same sentence. The blue part indicates the aspect and its ground truth. The middle subfigures represent the procedure of human's semantic comprehension which is targeted at one specific aspect. The green subfigures are the predicted labels and the chosen word sequences from DRA. + +
Case Examples. The label in brackets represents ground truth.BERT-baseRGAT-BERTDR-BERT
Aspects: “system memory”(Neg.), “DDR5”(Pos.), “DDR3”(Neg.)Pos/Neg/NegNeg/Pos/PosNeg/Pos/Neg
Sentence: It could be a perfect laptop if it would have faster system memory and its radeon would have DDR5 instead of DDR3.X / X / X✓ / ✓ / X✓ / ✓ / ✓
Aspects: “Supplied software” (Neu.), “software” (Pos.), “Windows” (Neg.)Pos/ Pos/ PosPos/Pos/NeuPos/Pos/Neg
Sentence: Supplied software: The software that comes with this machine is greatly welcomed compared to what Windows comes with.X / ✓ / XX / ✓ / XX / ✓ / ✓
Aspects: “waiter” (Neg.), “served” (Neg.), “specials” (Pos.)Neg/Neg/NegNeg/Neg/NeuNeg/Neg/Pos
Sentence: First, the waiter who served us neglected to fill us in on the specials, which I would have chosen had I known about them.✓ / ✓ / X✓ / ✓ / X✓ / ✓ / ✓
+ +Table 4: Error analysis of two review items from laptop and restaurant. The colored words in brackets represents ground truth sentiment label of the corresponding aspect. The symbol $\checkmark$ means the predicting sentiment is correct, and the other symbol means the predicting sentiment is wrong. + +when a person tries to understand a relatively long sentence, he/she first read the entire sentence. Subsequently, after giving a specific aspect, he/she will dynamically select related words based on the previous memory state until he/she fully understands the sentiment polarity of the given aspect. + +Interestingly, the above phenomenon is consistent with our dynamic re-weighting adapter's chosen result. Specifically, as Figure 3 (b) shows, with the re-weighting function $F$ (i.e., Equation 5 and 6), our model dynamically choose the words "food, better, while, definitely, not, ..." which have proven to be very important for predicting the sentiment of aspect "food" in Figure 3 (a). Those experimental results again fully indicate the effectiveness and interpretability of our proposed model in dynamic learning aspect-aware information. + +The Influence of multiple Aspects. As aspect-related information plays a key role in ABSA and at least $10.2\%$ of reviews contain multiple aspects as shown in Table 1, we are curious about the model's performance in the complex scenarios, e.g., a review sentence contains multiple aspects. Therefore, we randomly choose an example to explore how the selection of the context words will correspondingly change with different inputs. The visualization re + +sults are shown in Figure 4. Specifically, the chosen sentence has three different aspects with their sentiment polarity, i.e., "System memory"-negative, "DDR5"-positive and "DDR3"-negative. Take the aspect "DDR5" as example, it is positive which is contrary to "DDR3". After receiving the overall semantic of the whole sentence, readers tend to associate "DDR5" with the context words $\{\text{"would"}$ "have}\} to predict the correct sentiment "positive". For other two aspects, the observations are consistent with "DDR5". In summary, all those results show that DR-BERT could dynamically extract the vital information to achieve aspect-aware semantic understanding even in a more complex scenario. + +# 4.7 Error Analysis + +Table 4 displays three review examples and their prediction results by BERT, RGAT-BERT, and our DR-BERT. As we can see from the "BERT-base" column, when there are multiple aspects, the vanilla BERT often makes the wrong classification since it tends to learn the overall sentiment polarity of the sentences instead of the aspect-aware semantic. While RGAT-BERT can alleviate the problem to a certain extent, it is also hard to predict the accurate sentiment label with few dependency relations. For + +
MethodsLaptopRestaurantTwitter
SETSETSET
(1) DR-BERT157s1026.1m183s1030.5m379s1063.2m
(2) T-GCN-BERT168s1028.0m188s1031.3m411s1068.5m
(3) BERT-base133s1022.2m158s1026.3m242s1040.3m
(4) ATAE-LSTM3s301.50m4s302.00m5s302.50m
+ +Table 5: Runtime comparison between DR-BERT, T-GCN-BERT, BERT-base and ATAE-LSTM. Specifically, "S" represents the training time (seconds) for a single epoch, "E" denotes the number of training epochs, and "T" is the total training time (minutes). + +example, in the first sentence, "DDR3" has few helpful syntactic dependency relations. Therefore, RGAT-BERT makes a wrong sentiment prediction. However, our DR-BERT model, succeeding in predicting most sentiment labels by considering the dynamic changing of the aspect-aware semantic. For other two case examples, the observations are consistent. Note that, for aspect "Supplied software" in second sentence, two overlap aspects appear in the same sentence makes it more difficult to distinguish the different sentiment between them. Thus, precisely determine its sentiment polarity is a big challenge for human, let alone deep learning models. This also leaves space for future exploration. + +# 5 Computation Time Comparison + +We also compared the computation runtime of three baseline methods. All of the models are performed on a Linux server with 64 Intel(R) CPUs and 4 Tesla V100 32GB GPUs. From the results shown in Table 5, we can first observe that the training time of a single epoch in DR-BERT performs better than T-GCN, which is based on GCN. Meanwhile, the training time of all these BERT-based models is similar (i.e., there is no significant difference). The possible reason is that the official datasets are small, and it is hard to influence the overall runtime of PLMs with such a small amount of data. Second, compared with other models, the training time of the ATAE-LSTM model is less (always an order of magnitude lower). For example, the ATAE-LSTM only needs about two minutes to achieve optimal performance in the restaurant dataset, while BERT-based models require more than 26 minutes. Therefore, though DR-BERT contains a Dynamic Re-weighting adapter based on GRU, the computation time is much lower than the BERT-based framework. In summary, the observations above show that the computation time of our DR-BERT model is within an acceptable range. + +# 6 Conclusion and Future Works + +This paper introduced a new approach named Dynamic Re-weighting BERT (DR-BERT) for aspect-based sentiment analysis. Specifically, we first employed the BERT layers as a base encoder to learn the overall semantic features of the whole sentence. Then, inspired by human semantic comprehension, we devised a new Dynamic Re-weighting Adapter (DRA) to enhance aspect-aware semantic features in the sentiment learning process. In addition, we inserted the DRA into the BERT layers to address the limitations of the vanilla pre-trained model in ABSA task. Extensive experiments on three benchmark datasets demonstrated the effectiveness and interpretability of the proposed model, with good semantic comprehension insights for future nature language modeling. Moreover, the error analysis was performed on incorrectly predicted examples, leading to some insights into the ABSA task. + +We hope our research can help boost excellent work for aspect-based sentiment analysis from different perspectives. In the future, we plan to extend our method to other tasks like Sentence Semantic Matching, Relation Extraction, etc., which can also benefit from utilizing the dynamic semantics. Besides, we will explore whether DR-BERT can make any positive changes based on previous mistakes during the dynamic semantic understanding. + +# 7 Acknowledgments + +We would like to thank the anonymous reviewers for the helpful comments. This research was partially supported by grants from the National Key R&D Program of China (No. 2021YFF0901003), and the National Natural Science Foundation of China (No. 61922073, 61727809, 62006066 and 72101176). We appreciate all the authors for their fruitful discussions. In addition, Kai Zhang wants to thank, in particular, the patience, care and unwavering support from Rui Fu over the past years. + +# References + +James C Bezdek. 1992. On the relationship between neural networks, pattern recognition and intelligence. International journal of approximate reasoning, 6(2):85-107. +Harm Brouwer, Francesca Delogu, Noortje J Venhuizen, and Matthew W Crocker. 2021. Neurobehavioral correlates of surprisal in language comprehension: A neurocomputational model. Frontiers in Psychology, 12:110. +Chenhua Chen, Zhiyang Teng, and Yue Zhang. 2020. Inducing target-specific latent structures for aspect sentiment classification. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5596-5607. +Jin Yao Chin, Kaiqi Zhao, Shafiq Joty, and Gao Cong. 2018. Anr: Aspect-based neural recommender. In Proceedings of the 27th ACM International Conference on Information and Knowledge Management, pages 147-156. +Kyunghyun Cho, Bart van, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1724-1734. +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, Florence, Italy. Association for Computational Linguistics. +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, pages 4171-4186. +Xiaowen Ding and Bing Liu. 2007. The utility of linguistic rules in opinion mining. In Proceedings of the 30th annual international ACM SIGIR conference on Research and development in information retrieval, pages 811-812. +Li Dong, Furu Wei, Chuanqi Tan, Duyu Tang, Ming Zhou, and Ke Xu. 2014. Adaptive recursive neural network for target-dependent twitter sentiment classification. In Proceedings of the 52nd annual meeting of the association for computational linguistics (volume 2: Short papers), pages 49-54. +Feifan Fan, Yansong Feng, and Dongyan Zhao. 2018. Multi-grained attention network for aspect-level sentiment classification. In Proceedings of the 2018 conference on empirical methods in natural language processing, pages 3433-3442. + +Tal Golan, Prashant C Raju, and Nikolaus Kriegeskorte. 2020. Controversial stimuli: Pitting neural networks against each other as models of human cognition. Proceedings of the National Academy of Sciences, 117(47):29330-29337. +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 (CVPR), pages 770-778. +Binxuan Huang and Kathleen M Carley. 2019. Syntax-aware aspect level sentiment classification with graph attention 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 5469-5477. +Binxuan Huang, Yanglan Ou, and Kathleen M Carley. 2018. Aspect level sentiment classification with attention-over-attention neural networks. In International Conference on Social Computing, Behavioral-Cultural Modeling and Prediction and Behavior Representation in Modeling and Simulation, pages 197-206. Springer. +Long Jiang, Mo Yu, Ming Zhou, Xiaohua Liu, and Tiejun Zhao. 2011. Target-dependent twitter sentiment classification. In Proceedings of the 49th annual meeting of the association for computational linguistics, pages 151-160. +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. +Christof Koch and Naotsugu Tsuchiya. 2007. Attention and consciousness: two distinct brain processes. Trends in cognitive sciences, 11(1):16-22. +Gina R Kuperberg. 2007. Neural mechanisms of language comprehension: Challenges to syntax. *Brain research*, 1146:23-49. +Gina R and T Florian Jaeger. 2016. What do we mean by prediction in language comprehension? Language, cognition and neuroscience, 31(1):32-59. +Siwei Lai, Liheng Xu, Kang Liu, and Jun Zhao. 2015. Recurrent convolutional neural networks for text classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 29. +Ruifan Li, Hao Chen, Fangxiang Feng, Zhanyu Ma, Xiaojie Wang, and Eduard Hovy. 2021. Dual graph convolutional networks for aspect-based sentiment analysis. 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 6319-6329. + +Xiangsheng Li, Jiaxin Mao, Chao Wang, Yiqun Liu, Min Zhang, and Shaoping Ma. 2019. Teach machine how to read: reading behavior inspired relevance estimation. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 795-804. +Xin Li, Lidong Bing, Wai Lam, and Bei Shi. 2018. Transformation networks for target-oriented sentiment classification. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, pages 946-956. +Yunlong Liang, Fandong Meng, Jinchao Zhang, Jinan Xu, Yufeng Chen, and Jie Zhou. 2019. A novel aspect-guided deep transition model for aspect based sentiment analysis. 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 5569-5580. +Dehong Ma, Sujian Li, Xiaodong Zhang, and Houfeng Wang. 2017. Interactive attention networks for aspect-level sentiment classification. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pages 4068-4074. +Thien Hai Nguyen and Kiyoaki Shirai. 2015. Phrasernn: Phrase recursive neural network for aspect-based sentiment analysis. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 2509-2514. +Wei Peng, Yue Hu, Luxi Xing, Yuqiang Xie, Jing Yu, Yajing Sun, and Xiangpeng Wei. 2020. Bidirectional cognitive thinking network for machine reading comprehension. In Proceedings of the 28th International Conference on Computational Linguistics, pages 2613-2623. +Maria Pontiki, Dimitris Galanis, John Pavlopoulos, Harris Papageorgiou, Ion Androutsopoulos, and Suresh Manandhar. 2014. SemEval-2014 task 4: Aspect based sentiment analysis. In Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014), pages 27-35, Dublin, Ireland. Association for Computational Linguistics. +Keith Rayner. 1998. Eye movements in reading and information processing: 20 years of research. *Psychological bulletin*, 124(3):372. +Cansu Sen, Thomas Hartvigsen, Biao Yin, Xiangnan Kong, and Elke Runden. 2020. Human attention maps for text classification: Do humans and neural networks focus on the same words? In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4596-4608. +Lei Sha, Baobao Chang, Zhifang Sui, and Sujian Li. 2016. Reading and thinking: Re-read LSTM unit for textual entailment recognition. In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pages 2870-2879. + +Selina Sharmin, Oleg Špakov, and Kari-Jouko Räihä. 2015. Dynamic text presentation in print interpreting—an eye movement study of reading behaviour. International Journal of Human-Computer Studies, 78:17–30. +Youwei Song, Jiahai Wang, Tao Jiang, Zhiyue Liu, and Yanghui Rao. 2019. Attentional encoder network for targeted sentiment classification. arXiv preprint arXiv:1902.09314. +Concetto Spampinato, Simone Palazzo, Isaak Kavasidis, Daniela Giordano, Nasim Souly, and Mubarak Shah. 2017. Deep learning human mind for automated visual classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6809-6817. +Chi Sun, Luyao Huang, and Xipeng Qiu. 2019. Utilizing bert for aspect-based sentiment analysis via constructing auxiliary sentence. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 380-385. +Yaming Sun, Lei Lin, Duyu Tang, Nan Yang, Zhenzhou Ji, and Xiaolong Wang. 2015. Modeling mention, context and entity with neural networks for entity disambiguation. In Twenty-fourth international joint conference on artificial intelligence. +Niels A Taatgen, Hedderik Van Rijn, and John Anderson. 2007. An integrated theory of prospective time interval estimation: The role of cognition, attention, and learning. Psychological review, 114(3):577. +Xingwei Tan, Yi Cai, and Changxi Zhu. 2019. Recognizing conflict opinions in aspect-level sentiment classification with dual attention networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP-IJCNLP), pages 3426-3431. +Duyu Tang, Bing Qin, Xiaocheng Feng, and Ting Liu. 2015. Effective lstms for target-dependent sentiment classification. arXiv preprint arXiv:1512.01100. +Duyu Tang, Bing Qin, and Ting Liu. 2016. Aspect level sentiment classification with deep memory network. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 214-224. +Hao Tang, Donghong Ji, Chenliang Li, and Qiji Zhou. 2020. Dependency graph enhanced dual-transformer structure for aspect-based sentiment classification. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6578-6588. +Jialong Tang, Ziyao Lu, Jinsong Su, Yubin Ge, Linfeng Song, Le Sun, and Jiebo Luo. 2019. Progressive self-supervised attention learning for aspect-level sentiment analysis. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 557-566. + +Yuanhe Tian, Guimin Chen, and Yan Song. 2021. Aspect-based sentiment analysis with type-aware graph convolutional networks and layer ensemble. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2910-2922. +Giulio Tononi. 2008. Consciousness as integrated information: a provisional manifesto. The Biological Bulletin, 215(3):216-242. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. arXiv preprint arXiv:1706.03762. +Jingjing Wang, Changlong Sun, Shoushan Li, Xiaozhong Liu, Luo Si, Min Zhang, and Guodong Zhou. 2019. Aspect sentiment classification towards question-answering with reinforced bidirectional attention network. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3548-3557. +Kai Wang, Weizhou Shen, Yunyi Yang, Xiaojun Quan, and Rui Wang. 2020. Relational graph attention network for aspect-based sentiment analysis. In Proceedings of 58th Annual Meeting of the Association for Computational Linguistics, pages 3229-3238. +Xuejian Wang, Lantao Yu, Kan Ren, Guanyu Tao, Weinan Zhang, and et al. 2017. Dynamic attention deep model for article recommendation by learning human editors' demonstration. In Proceedings of the 23rd international conference on knowledge discovery and data mining, pages 2051-2059. +Yequan Wang, Minlie Huang, Xiaoyan Zhu, and Li Zhao. 2016. Attention-based LSTM for aspect-level sentiment classification. In Proceedings of the 2016 conference on empirical methods in natural language processing, pages 606-615. +Bowen Xing, Lejian Liao, Dandan Song, and et al. 2019. Earlier attention? aspect-aware LSTM for aspect-based sentiment analysis. In *IJCAI*. +Hu Xu, Bing Liu, Lei Shu, and S Yu Philip. 2019a. Bert post-training for review reading comprehension and aspect-based sentiment analysis. 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 2324-2335. +Hu Xu, Lei Shu, S Yu Philip, and Bing Liu. 2020. Understanding pre-trained bert for aspect-based sentiment analysis. In Proceedings of the 28th International Conference on Computational Linguistics, pages 244-250. +Jingjing Xu, Xu Sun, Zhiyuan Zhang, Guangxiang Zhao, and Junyang Lin. 2019b. Understanding and improving layer normalization. Advances in Neural Information Processing Systems, 32. + +Hsien-Ming Yang and George W McConkie. 1999. Reading chinese: Some basic eye-movement characteristics. Reading Chinese script: A cognitive analysis, pages 207-222. +Quanzeng You, Hailin Jin, Zhaowen Wang, Chen Fang, and Jiebo Luo. 2016. Image captioning with semantic attention. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4651-4659. +Chen Zhang, Qiuchi Li, and Dawei Song. 2019a. Aspect-based sentiment classification with aspect-specific graph convolutional 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 4568-4578. +Kai Zhang, Qi Liu, Hao Qian, Biao Xiang, Qing Cui, Jun Zhou, and Enhong Chen. 2021a. Eatn: An efficient adaptive transfer network for aspect-level sentiment analysis. IEEE Transactions on Knowledge and Data Engineering. +Kai Zhang, Hao Qian, Qi Liu, Zhiqiang Zhang, Jun Zhou, and et al. 2021b. Sifn: A sentiment-aware interactive fusion network for review-based item recommendation. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, pages 3627-3631. +Kai Zhang, Hefu Zhang, Qi Liu, Hongke Zhao, Hengshu Zhu, and Enhong Chen. 2019b. Interactive attention transfer network for cross-domain sentiment classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 5773-5780. +Kai Zhang, Hongke Zhao, Qi Liu, Zhen Pan, and Enhong Chen. 2019c. A dynamic and cooperative tracking system for crowdfunding. arXiv preprint arXiv:2002.00847. +Kun Zhang, Guangyi Lv, Linyuan Wang, Le Wu, Enhong Chen, Fangzhao Wu, and Xing Xie. 2019d. Drr-net: Dynamic re-read network for sentence semantic matching. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 7442-7449. +Yaowei Zheng, Richong Zhang, Samuel Mensah, and Yongyi Mao. 2020. Replicate, walk, and stop on syntax: An effective neural network model for aspect-level sentiment classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9685-9692. +Yukun Zheng, Jiaxin Mao, Yiqun Liu, Zixin Ye, Min Zhang, and Shaoping Ma. 2019. Human behavior inspired machine reading comprehension. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 425-434. \ No newline at end of file diff --git a/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/images.zip b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d5fd7a070a723ec8de51b6fd952f6ab2588d109f --- /dev/null +++ b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddb1cab22d2c074930ea6b022d668db9c70d4dedba28afd21ae40b490a74c369 +size 543320 diff --git a/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/layout.json b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..55b7dfcee781480f18b48a7ff01da02ec8fc3b50 --- /dev/null +++ b/incorporatingdynamicsemanticsintopretrainedlanguagemodelforaspectbasedsentimentanalysis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:508a4c92f7a9f25d60c798061b10a45913c2d05f51043742a4b6e0882359d4eb +size 436741 diff --git a/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_content_list.json b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..00ccd3c17e33a4f105c846ff0bc7b9d608bea664 --- /dev/null +++ b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27a655e9b10c405013b9ec8020da547caaaea6af2bf8f7b6979d7ddbde1e5789 +size 54020 diff --git a/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_model.json b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ff7024f6aea077ecd34412adc51bb01c367cd3ab --- /dev/null +++ b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59d0483289f981d6ba5989f58c6558f01adc5771706735db73d91f274410fb82 +size 68546 diff --git a/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_origin.pdf b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8c57f2e37c17e8392aeadc2c6ccfa5042bf7737d --- /dev/null +++ b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/7bf3af6b-2ec6-49a5-884c-c899a479df18_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec265c3a781418d02510aca2a9c68e797639e16c89cd3b2b00b72127ddcf0c18 +size 415113 diff --git a/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/full.md b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3cade4203ec127117fdabaabdfe2995289c0060d --- /dev/null +++ b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/full.md @@ -0,0 +1,242 @@ +# Incremental Intent Detection for Medical Domain with Contrastive Replay Networks + +Guirong Bai $^{1,2}$ , Shizhu He $^{1,2}$ , Kang Liu $^{1,2,3}$ , Jun Zhao $^{1,2}$ + +$^{1}$ National Laboratory of Pattern Recognition, Institute of Automation, CAS +$^{2}$ School of Artificial Intelligence, University of Chinese Academy of Sciences + +3 Beijing Academy of Artificial Intelligence + +{guirong.bai, shizhu.he, kliu, jzhao}@nlpr.ia.ac.cn + +# Abstract + +Conventional approaches to medical intent detection require fixed pre-defined intent categories. However, due to the incessant emergence of new medical intents in the real world, such requirement is not practical. Considering that it is computationally expensive to store and re-train the whole data every time new data and intents come in, we propose to incrementally learn emerged intents while avoiding catastrophically forgetting old intents. We first formulate incremental learning for medical intent detection. Then, we employ a memory-based method to handle incremental learning. We further propose to enhance the method with contrastive replay networks, which use multilevel distillation and contrastive objective to address training data imbalance and medical rare words respectively. Experiments show that the proposed method outperforms the state-of-the-art model by $5.7\%$ and $9.1\%$ of accuracy on two benchmarks respectively. + +# 1 Introduction + +Medical intent detection aims to identify intents of medical queries and classify them into specific categories (Chen et al., 2012; Howard and Cambria, 2013; Guo et al., 2014; Cai et al., 2017). In medical scenarios, understanding query intent is very important for medical question answer systems (Wu et al., 2020; Mrini et al., 2021). Typically, to perform medical intent detection, existing methods pre-define a class set of fixed medical intent categories in advance, and train the whole collected dataset with the fixed class set. However, novel medical intents incessantly emerge with new data in the real world. When given a query with new intent category that is out of the pre-defined class set, these models can do nothing about it. + +A straightforward solution is to store and re-train the whole data every time new data and intents come in. However, it is almost infeasible with limited storage budget and computation cost in practice + +![](images/41dfbdf4d63fb063d70fa4ad0ca0b0d3e78d2db81980401c4373eff0b8b17a20.jpg) +Figure 1: Incremental medical intent detection. + +(Wang et al., 2019). Consider the above problems, we propose to address this issue in a incremental learning way (Ring et al., 1994; Thrun, 1998), where the number of intent categories is allowed to incrementally increase and the system can incessantly learn emerged novel intents from continually arriving data of new intents, which is illustrated as Figure 1. + +Naturally, one simple incremental method is to directly finetune the model by new intents data. However, this method suffers from the serious catastrophic forgetting problem (McCloskey and Cohen, 1989; French, 1999; Wang et al., 2019). After fitting emerged data of new intent, the performance of the model on old classes will inevitably drop a lot. There are some studies that have made effects to overcome the catastrophic forgetting problem. Typically, they are divided into parameter-based methods that preserve parameters important to the previous classes when updating (Kirkpatrick et al., 2017; Aljundi et al., 2018), and memory-based methods that store a few examples for each old class and replay them with arriving data of new classes (Rebuffi et al., 2017; Hou et al., 2018, 2019). Due to the simplicity and effectiveness, memory-based methods dominated this field. + +However, when applying memory-based methods to incremental intent detection for medical domain, these methods face two new challenges - training data imbalance and medical rare words. Training Data Imbalance: While the amount of new classes data is often large, only a few examples for old classes are stored in the limited memory. + +Therefore, the model can be drastically altered by the richer new classes data and ignore old classes (He and Garcia, 2009; Wu et al., 2019; Zhang et al., 2017). Medical Rare Words: Compared with common domains, the medical domain typically contains many domain-specific rare words1. These rare words are usually not well learned by the model and bring disturbance to representations of examples, which is adverse to selecting representative examples as memory for old classes replay. + +Considering the above problems, we propose contrastive replay networks to enhance incremental intent detection for medical domain. Specifically, to address training data imbalance, we devise multilevel distillation to make the current model mimic the behaviors of the original model. To address medical rare words, we devise contrastive objective to push examples from the same intent close and examples from different intents further apart. Experimental results demonstrate that our method outperforms previous state-of-the-art models. + +# 2 Related Work + +# 2.1 Medical Intent Detection + +The goal of intent detection is to identify query intent and classify them into specific categories (Chen et al., 2012; Howard and Cambria, 2013; Guo et al., 2014; Cai et al., 2017). With artificial intelligence gradually changing the landscape of healthcare and biomedical research (Yu et al., 2018), medical intent detection (Zhang et al., 2021; Chen et al., 2020a) becomes an important task. In medical domain, query intent can be divided into many categories, such as disease description, medical fees, treatment plan, precautions, and so on, which are domain-specific with highly specialized medical knowledge (Zhang et al., 2021). Understanding medical can assist medical question answer systems and significantly improve the relevance of medical search results(Wu et al., 2020; Mrini et al., 2021). + +With the development of medical systems, the categories of intent continually increase in real-world applications. It means that medical intent detection is facing new challenges of how to incrementally learning new intents while avoid forgetting old classes. + +# 2.2 Incremental Learning + +Incremental learning, which is also called continual learning or lifelong learning, is a problem that deserves effort and has been studied for a long time in machine learning (Cauwenberghs and Poggio, 2001; Kuzborskij et al., 2013). It aims to incrementally train a model on new data to learn incessantly emerging novel classes while avoiding the catastrophic forgetting problem of old classes (McCloskey and Cohen, 1989; French, 1999). Existing incremental learning methods are mainly divided into two types, parameter-based methods (Kirkpatrick et al., 2017; Aljundi et al., 2018) and memory-based methods (Rebuffi et al., 2017; Hou et al., 2019; Wang et al., 2019; Cao et al., 2020;?). + +In parameter-based methods, these methods try to capture and preserve parameters important to the previous classes (Kirkpatrick et al., 2017; Zenke et al., 2017; Aljundi et al., 2018). When updating the model with new data, recognized important parameters tend to be constant. For example, existing studies propose to keep the updated parameters close to the optimal parameters for the old classes when training data of new classes (Kirkpatrick et al., 2017). However, it is difficult to provide a reasonable metric to evaluate all the parameters. In memory-based methods, these methods store a few examples to replay for each old class (Castro et al., 2018; Wang et al., 2019; Han et al., 2020). When data of new classes arrives, memory-based methods learn these examples again with the new data to alleviate catastrophic forgetting. For example, existing studies propose an episodic memory replay method that randomly selects examples to store (Wang et al., 2019). + +Among these methods, memory-based methods dominated this field due to their simplicity and effectiveness. However, these methods cannot handle medical term disturbance and training data imbalance in incremental intent detection for medical domain. + +# 3 Problem Definition + +Medical intent detection (MID) is a classification task. In real medical applications, new intent classes incessantly emerge. Therefore, a practical MID system should be able to incrementally learn new query intent classes. We introduce a new problem, incremental intent detection. Suppose that there is a class-incremental data stream, denoted as $\{\mathcal{X}^1,\mathcal{X}^2,\dots ,\mathcal{X}^{(M)}\}$ . Each $\mathcal{X}^{(k)}$ contains train- + +ing/validation/testing data $(\mathcal{X}_{train}^{(k)},\mathcal{X}_{valid}^{(k)},\mathcal{X}_{test}^{(k)})$ and its own intent class set $\mathcal{C}^{(k)}$ . Note that any two intent class sets are disjoint², i.e., $\mathcal{C}^{(i)}\cap \mathcal{C}^{(j)} = \emptyset (i\neq j)$ . At the $k$ -th step, the MID model optimizes its parameters using the training data $\mathcal{X}_{train}^{(k)}$ and the updated model should still perform well on historical classes, i.e., classes from 1 to $k - 1$ . Thus, for testing at the $k$ -th step, we evaluate the updated model on the testing data of all old classes, i.e., $\cup_{i = 1}^{k}\mathcal{X}_{test}^{(i)}$ . Given an input from $\mathcal{X}^{(j)}(j\leq k)$ , the model needs to give a prediction from $\cup_{i = 1}^{k}\mathcal{C}^{(i)}$ , instead of $\mathcal{C}^{(j)}$ . To alleviate catastrophic forgetting, memory-based incremental learning methods allow limited memory to store a few examples for each old class. Therefore, every time new classes data arrive, the MID model utilizes the stored old classes data and new classes data $\mathcal{X}_{train}^{(k)}$ as training data to re-train parameters. The overall training procedures are described in Appendix. + +# 4 Method + +In this paper, we propose Contrastive Reply Networks for incremental medical intent detection (CRN). CRN consists of three components: 1) Intent classifier with memory, 2) Multilevel distillation and 3) Contrastive objective. + +# 4.1 Intent Classifier with Memory + +# 4.1.1 Memory-based Framework + +We use BERT (Devlin et al., 2018) as the medical intent classifier. When the new medical intent classes $\mathcal{C}^{(k)}$ arrives, the corresponding new training data is denoted as $\mathcal{X}_{train}^{(k)} = \{(X_i,Y_i),1\leq i\leq K\}$ , where $K$ is the number of training examples, $X_{i}$ is the query and $Y_{i}$ denotes the intent label of the query $X_{i}$ . The memory stores the representative examples for old $m$ classes, i.e., $m = |\cup_{i = 1}^{k - 1}\mathcal{C}^{(i)}|$ , we denoted it as $\mathcal{P} = \{\mathcal{P}^{(1)},\dots ,\mathcal{P}^{(m)}\}$ , where $\mathcal{P}^{(i)}$ is the set of stored examples for the $i$ -th class. We combine the stored old data and new classes data, which is denoted as $\mathcal{N} = \mathcal{P}\cup \mathcal{X}_{train}^{(k)}$ , to train the current model. The current label set $\mathcal{C}^o$ contains all observed intent categories, i.e., $\mathcal{C}^o = \bigcup_{i = 1}^k\mathcal{C}^i$ . Then a softmax classifier is to predict intent categories with representations of “[CLS)” in BERT. Finally, we use the cross entropy to train the intent detection model, denoted as loss $\mathcal{L}_{ce}$ . Note that the current label set size is the number of all observed + +classes, i.e., $|\mathcal{C}^o|$ . The overall training procedures are illustrated in the appendix. + +# 4.1.2 Memory Updating + +To overcome the catastrophic forgetting problem of old classes, memory-based methods store examples for each old class in the memory. All classes are treated equally in our model. Therefore, if $m$ classes have been learned so far and $B$ is the total number of examples stored in the memory, our model will store $n = B / m$ examples for each old class. Inspired by prototype learning (Snell et al., 2017; Yang et al., 2018), we select the top $n$ example closest to the centroid of examples (based on "[CLS]" embeddings) of each class and store them into the memory as representative ones for old classes. When new data comes in, these examples in the memory are trained with the new data. Before the next new class arrives, we remove $B / m - B / (m + t)$ stored examples of each old class in the memory and allocate space to store $B / (m + t)$ current new classes examples based on the centroid, where $t = |\mathcal{C}^k|$ is the number of current new classes. + +# 4.2 Multilevel Distillation + +Although storing a few examples for each old class as memory is useful to avoid catastrophic forgetting, there is a serious data imbalance problem between memory and new classes data, which makes the model have an obvious bias towards the new classes, resulting in severely forgetting classification ability of previous classes. To address it, we devise multilevel distillation to make the current model mimic the behaviors of the original model. + +Inspired by (Hinton et al., 2015), we first perform it at prediction level. We encourage the current predictions on old classes to match the soft labels by the original model. Formally, + +$$ +\mathcal {L} _ {p l} = - \frac {1}{| \mathcal {N} |} \sum_ {X \in \mathcal {N}} \sum_ {x \in X} \sum_ {i = 1} ^ {m} \alpha_ {i} ^ {*} \log (\alpha_ {i}) \tag {1} +$$ + +where $\alpha_{i}^{*}$ and $\alpha_{i}$ is the output probability for the $i$ -th label of the original and current model, respectively. This loss function is performed for all arriving new classes data and stored old classes data in the memory. + +Then, we also perform it at feature level. We encourage the feature representations ("[CLS]" of BERT) of the current model don't greatly deviate + +from the ones of the original model. Formally, + +$$ +\mathcal {L} _ {f l} = - \frac {1}{| \mathcal {N} |} \sum_ {X \in \mathcal {N}} \sum_ {x \in X} \cos (f ^ {*} (x), f (x)) \tag {2} +$$ + +where $\cos(f^*(x), f(x))$ measures the cosine distance between feature vectors of the original and current model. This loss is computed for all samples from the new classes and stored examples in the memory. + +# 4.3 Contrastive Objective + +Medical rare words are usually not well learned by the model and bring disturbance to representations of examples, which is detrimental to memory selection for old classes. Inspired by (Chen et al., 2020b), we devise contrastive objective to push examples from the same intent close and examples from different intents further apart. As a result, we can obtain better representations for examples and select more representative examples for replay. + +Specifically, we first perform data augmentation to obtain more examples. We use a medical dictionary that contains medical rare words3 to randomly add, delete or replace rare words over the original examples. After that, we employ an objective to push examples from the same intent close and examples from different intents further apart: + +$$ +\mathcal {L} _ {c o} = - \sum_ {i} \frac {1}{N _ {y _ {i}} - 1} \sum_ {j \neq i} \left(1 _ {y _ {i} = y _ {j}} - 1 _ {y _ {i} \neq y _ {j}}\right) \log s _ {i j} \tag {3} +$$ + +where $s_{ij} = \frac{\exp(f(x_i)\cdot f(x_j))}{\sum_{k\neq i}\exp(f(x_i)\cdot f(x_k))}$ , $f(x)$ denotes the embeddings of "[CLS]" token of example $x$ . Finally, our model is optimized by the total loss $\mathcal{L} = \mathcal{L}_{ce} + \mathcal{L}_{pl} + \mathcal{L}_{fl} + \mathcal{L}_{co}$ . + +# 5 Experiments + +# 5.1 Benchmarks + +We use two public medical datasets KUAKE-QIC in CBLUE (Zhang et al., 2021) and CMID (Chen et al., 2020a) to construct benchmarks for incremental learning setting. For a medical intent detection dataset, its intent classes are arranged in a fixed order. Then, methods are trained in a class-incremental way on the available training data4. Due to its long-tail frequency distribution, we use the data of the top 10/20 most frequent classes for KUAKE-QIC/CMID. + +3We build it by collecting medical entities in OpenKG at http://www.openkg.cn/dataset. Only one new class is available for the model at each time, i.e., $t = |\mathcal{C}^{(k)}| = 1$ + +
ModelsKUAKE-QICCMID
AvgWholeAvgWhole
Upperbound94.691.678.087.2
Finetune20.943.09.224.9
EWC63.752.527.526.9
EMR68.662.931.330.3
EMAR71.065.933.732.1
CRN(Ours)75.871.643.541.2
+ +Table 1: The average accuracy $(\%)$ , "Avg") on all observed classes and whole accuracy $(\%)$ , "Whole") on the whole testing data at the last step. + +# 5.2 Evaluation and Implementation + +We use accuracy as the evaluation metric. Every time the model finishes training on the new classes data, we report the accuracy on the whole testing data of all observed classes. Besides, we also report the performance at the last step, containing Average accuracy (macro-averaging) and Whole accuracy (micro-averaging). + +We use base BERT as the classifier. The learning rate is set to 2e-5. The batch size is 8. For the two benchmarks, both the capacity of memory is $B = 200$ . + +# 5.3 Baselines + +We compare CRN with 4 baselines: 1) EWC (Kirkpatrick et al., 2017): The representative parameter-based method that keeps the network parameters close to the optimal parameters for the previous classes when training new classes data. 2) EMR (Wang et al., 2019): The representative memory-based method that avoids catastrophic forgetting via randomly storing a few examples of old classes. 3) EMAR (Han et al., 2020): The latest memory-based method that utilizes prototypes for memory reconsolidation exercise to keep a stable understanding of old classes. 4) Finetune: The lower bound that simply finetunes the model on arriving data of new classes. 5) Upperbound: The upper bound that stores and trains all observed samples. + +# 5.4 Compared with State-of-the-art Methods + +We conduct experiments on KUAKE-QIC and CMID. The accuracies over all observed classes during the whole incremental learning process are plotted in Figure 2. We also show the results at the last step in Table 1. We can find that our method outperforms all other baselines by a large margin. Specifically, compared with the state-of-the-art model EMAR, our method achieves $5.7\%$ and $9.1\%$ improvements of whole accuracy score on the + +![](images/9d124b4f0bae8d9ca59c34275b173763b63211c7392af693df4bf00c7a589f8e.jpg) +(a) KUAKE-QIC benchmark + +![](images/3f80936e4ec00c6fd2e22652ba7e537af80ede613abe25e6187a3c03c89b49d5.jpg) +(b) CMID benchmark +Figure 2: The performance on (a) KUAKE-QIC and (b) CMID. Our method CRN outperforms others. + +
ModelsKUAKE-QICCMID
AvgWholeAvgWhole
CRN75.871.643.541.2
w/o PL72.566.837.737.0
w/o FL72.367.137.136.3
w/o CO73.469.740.639.3
+ +Table 2: Ablation studies for the main components. + +KUAKE-QIC and CMID, respectively. It demonstrates the effectiveness of our proposed CRN. Besides, Finetuning always obtains the worst performance on both benchmarks and becomes the lower bound, which indicates that the catastrophic forgetting problem is serious. Moreover, the large gap between all methods and Upperbound indicates that this issue is still challenging. + +# 5.5 Ablation Experiment + +To investigate the effectiveness of the different parts in our method, we conduct ablation studies. The results are shown in Table 2. (1) Effectiveness of distillation at prediction level: The performance drops with removing $\mathcal{L}_{pl}$ ("w/o PL"). It demonstrates that it is useful to handle training data imbalance. (2) Effectiveness of distillation at feature level: The performance drops with removing $\mathcal{L}_{fl}$ ("w/o FL"). It demonstrates that it is effective to address training data imbalance. (3) Effectiveness of contrastive objective: The performance drops with removing $\mathcal{L}_{co}$ ("w/o CO"). It demonstrates that it is helpful to handle medical rare words. We report extra experiments in Appendix. + +# 6 Conclusion + +We explore to incrementally learning medical intent detection. We propose contrastive replay networks + +to handle training data imbalance and medical rare words. Experiments demonstrate that our method outperforms previous state-of-the-art models. + +# Acknowledgements + +This work is supported by the Natural Key R&D Program of China (No.2020AAA0106400), the National Natural Science Foundation of China (No. 61922085, No.61976211) and the Key Research Program of the Chinese Academy of Sciences (Grant NO. ZDBS-SSW-JSC006). This research work was supported by the independent research project of National Laboratory of Pattern Recognition, the Youth Innovation Promotion Association CAS. + +# References + +Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. 2018. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), pages 139-154. +Ruichu Cai, Binjun Zhu, Lei Ji, Tianyong Hao, Jun Yan, and Wenyin Liu. 2017. An cnn-lstm attention approach to understanding user query intent from online health communities. In 2017 iiee international conference on data mining workshops (icdmw), pages 430-437. IEEE. +Pengfei Cao, Yubo Chen, Jun Zhao, and Taifeng Wang. 2020. Incremental event detection via knowledge consolidation networks. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 707-717, Online. Association for Computational Linguistics. +Francisco M Castro, Manuel J Marín-Jiménez, Nicolas Guil, Cordelia Schmid, and Karteek Alahari. 2018. End-to-end incremental learning. In Proceedings of + +the European conference on computer vision (ECCV), pages 233-248. +Gert Cauwenberghs and Tomaso Poggio. 2001. Incremental and decremental support vector machine learning. Advances in neural information processing systems, pages 409-415. +Long Chen, Dell Zhang, and Levene Mark. 2012. Understanding user intent in community question answering. In Proceedings of the 21st international conference on world wide web, pages 823-828. +Nan Chen, Xiangdong Su, Tongyang Liu, Qizhi Hao, and Ming Wei. 2020a. A benchmark dataset and case study for chinese medical question intent classification. BMC Medical Informatics and Decision Making, 20(3):1-7. +Ting Chen, Simon Kornblith, Mohammad Norouz-i, and Geoffrey Hinton. 2020b. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597-1607. PMLR. +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. +Robert M French. 1999. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128-135. +Daniel Guo, Gokhan Tur, Wen-tau Yih, and Geoffrey Zweig. 2014. Joint semantic utterance classification and slot filling with recursive neural networks. In 2014 IEEE Spoken Language Technology Workshop (SLT), pages 554-559. IEEE. +Xu Han, Yi Dai, Tianyu Gao, Yankai Lin, Zhiyuan Liu, Peng Li, Maosong Sun, and Jie Zhou. 2020. Continual relation learning via episodic memory activation and reconsolidation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6429-6440. +Haibo He and Edwardo A Garcia. 2009. Learning from imbalanced data. IEEE Transactions on knowledge and data engineering, 21(9):1263-1284. +Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531. +Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and Dahua Lin. 2018. Lifelong learning via progressive distillation and retrospection. In Proceedings of the European Conference on Computer Vision (ECCV), pages 437-452. +Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and Dahua Lin. 2019. Learning a unified classifier incrementally via rebalancing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 831-839. + +Newton Howard and Erik Cambria. 2013. Intention awareness: improving upon situation awareness in human-centric environments. Human-centric Computing and Information Sciences, 3(1):1-17. +James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. 2017. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521-3526. +Ilja Kuzborskij, Francesco Orabona, and Barbara Caputo. 2013. From n to n+ 1: Multiclass transfer incremental learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3358-3365. +Michael McCloskey and Neal J Cohen. 1989. Catastrophic interference in connectionist networks: The sequential learning problem. In *Psychology of learning and motivation*, volume 24, pages 109-165. Elsevier. +Khalil Mrini, Franck Dernoncourt, Seunghyun Yoon, Trung Bui, Walter Chang, Emilia Farcas, and Nda-pa Nakashole. 2021. A gradually soft multi-task and data-augmented approach to medical question understanding. 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 1505-1515, Online. Association for Computational Linguistics. +Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. 2017. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 2001-2010. +Mark Bishop Ring et al. 1994. Continual learning in reinforcement environments. +Jake Snell, Kevin Swersky, and Richard Zemel. 2017. Prototypical networks for few-shot learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 4080-4090. +Sebastian Thrun. 1998. Lifelong learning algorithms. In Learning to learn, pages 181-209. Springer. +Hong Wang, Wenhan Xiong, Mo Yu, Xiaoxiao Guo, Shiyu Chang, and William Yang Wang. 2019. Sentence embedding alignment for lifelong relation extraction. 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 796-806. +Chaochen Wu, Guan Luo, Chao Guo, Yin Ren, Anni Zheng, and Cheng Yang. 2020. An attention-based multi-task model for named entity recognition and + +intent analysis of chinese online medical questions. Journal of Biomedical Informatics, 108:103511. +Yue Wu, Yinpeng Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, and Yun Fu. 2019. Large scale incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 374-382. +Hong-Ming Yang, Xu-Yao Zhang, Fei Yin, and Cheng-Lin Liu. 2018. Robust classification with convolutional prototype learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3474-3482. +Kun-Hsing Yu, Andrew L Beam, and Isaac S Kohane. 2018. Artificial intelligence in healthcare. Nature biomedical engineering, 2(10):719-731. +Friedemann Zenke, Ben Poole, and Surya Ganguli. 2017. Continual learning through synaptic intelligence. In International Conference on Machine Learning, pages 3987-3995. PMLR. +Ningyu Zhang, Zhen Bi, Xiaozhuan Liang, Lei Li, Xi-ang Chen, Shumin Deng, Luoqiu Li, Xin Xie, Hongbin Ye, Xin Shang, et al. 2021. Cblue: A Chinese biomedical language understanding evaluation benchmark. arXiv preprint arXiv:2106.08087. +Xiao Zhang, Zhiyuan Fang, Yandong Wen, Zhifeng Li, and Yu Qiao. 2017. Range loss for deep face recognition with long-tailed training data. In Proceedings of the IEEE International Conference on Computer Vision, pages 5409-5418. + +
ModelsCRNEMAR
AvgWholeAvgWhole
5066.861.960.960.4
10069.264.761.861.2
15072.868.565.263.2
20075.871.671.065.9
+ +Table 3: The effect of the number of stored examples. We compare our CRN with EMAR on KUAKE-QIC. + +![](images/0b0c415d0547e26bd4673847875e7ec505c83267566e5f9752480aa7d48095e4.jpg) +Figure 3: Feature spaces learned by CRN and EMR, respectively. + +Below we provide some extra experiments for discussion and overall training procedures for understanding. + +# A The Effect of the Number of Stored Examples + +To show the effect of different numbers of stored examples, we compare our CRN with another memory-based method EMAR on KUAKE-QIC, where the memory size to store examples is from 50 to 200. We can observe the results in Table 3. + +First, the more examples stored, the better performance for both memory-based methods. We also see that our method performs better, which demonstrates the effectiveness of our method. Even with fewer examples stored, our CRN still performs better, demonstrating that our method is effective to address training data imbalance. + +# B Visualization + +To show the effectiveness of introduced contrast objective for medical rare words, we also give the visualization in Figure 3 to show the feature spaces learned by our CRN (Ours) and EMAR (i.e., the latest representative work of memory-based method) on KUAKE-QIC. + +Specifically, we extract the representations of "[CLS]" and use t-SNE to implement visualization. We can see that the feature space of CRN is more sparse and features from different intents are more distinguishable. However, the features learned by + +# Algorithm 1 Training Procedures + +Require: arriving training data $\mathcal{X}_{train}^{(k)}$ at the $k$ -th step, the number of new classes $t = |\mathcal{C}^{(k)}|$ , memory capacity $B$ , current model $\mathcal{M}$ , current reserved example sets $\mathcal{P} = (\mathcal{P}^{(1)}, \dots, \mathcal{P}^{(m)})$ , $m$ observed classes + +1: combining training data $\mathcal{X}_{train}^{(k)}\cup \mathcal{P}$ +2: Update the model $\mathcal{M}$ with loss $\mathcal{L}$ +3: for $c = 1, \dots, m$ do +4: Remove stored examples for each old class $c$ until the number reaches $B / (m + t)$ + +# 5: end for + +6: for $c = m + 1, \dots, m + t$ do +7: Update the centroid +8: Select the top $B / (m + t)$ examples close to the centroid to store in the memory +9: end for + +EMAR are more difficult to distinguish. Examples from the same intent in CRN are closer than ones in EMAR. It is because medical rare words are easy to bring disturbance and make the queries confused in EMAR. This result shows that our contrast objective in CRN can learn better representations for queries against medical rare words. + +# C Training Procedures + +Algorithm 1 describes the overall training procedures of incremental learning. After training a intent detection model with limited intents, new intents come in. Through our method, the model incrementally learns new intents while avoiding catastrophically forgetting old intents. \ No newline at end of file diff --git a/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/images.zip b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6dc7371b10cb7a1bab0e5d98233e5b8adf903ad2 --- /dev/null +++ b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bdba9eaf2c75c3b2a09119ffdc2e6d50aaa2a4339697ce17fa7d9888639d8c37 +size 186851 diff --git a/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/layout.json b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a835fd0bfc5193603fc5444398fff2f870d72fba --- /dev/null +++ b/incrementalintentdetectionformedicaldomainwithcontrastreplaynetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20095e25dc5bee049252c14dceded7aea8e6520b0ce29c7cc8aa05f6667333e5 +size 293587 diff --git a/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_content_list.json b/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f07ff4a4899da74fc359a3239dfaabb6155af20a --- /dev/null +++ b/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c39d82184f10357e6fab1876776f8fc993c41950be12b7aba9edff05559d6f3f +size 103601 diff --git a/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_model.json b/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a703e0e223d06232e4ecc834905b1c2b73464d51 --- /dev/null +++ b/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60c87ac594c8ff7746fc41785fd2d5f32aeaac7dfbea9eab9ac50d158318863c +size 125194 diff --git a/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_origin.pdf b/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..efac7e9c530421359cf87517f1ab6f34c81b90d7 --- /dev/null +++ b/indicbartapretrainedmodelforindicnaturallanguagegeneration/fe2db5f4-c7f8-4bdd-8813-492bcd2536d4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e63dd3f5acd7d9bf3e7140b247fbb5423537873cdd530c247edeb1f8723a7211 +size 306014 diff --git a/indicbartapretrainedmodelforindicnaturallanguagegeneration/full.md b/indicbartapretrainedmodelforindicnaturallanguagegeneration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5ac90dfae80a5a149d454b4108fe9a51fb6d895d --- /dev/null +++ b/indicbartapretrainedmodelforindicnaturallanguagegeneration/full.md @@ -0,0 +1,335 @@ +# IndicBART: A Pre-trained Model for Indic Natural Language Generation + +Raj Dabre1 Himani Shrotriya2 Anoop Kunchukuttan3 + +Ratish Puduppully4 Mitesh M. Khapra5 Pratyush Kumar6 + +National Institute of Information and Communications Technology1 IIT Madras2,5,6 + +Microsoft3,6 University of Edinburgh4 + +$^{1}$ raj.dabre@nict.go.jp $^{2}$ cs20m024@smail.iitm.ac.in + +$^{3}$ ankunchu@microsoft.com $^{4}$ r.puduppully@sms.ed.ac.uk + +$5$ miteshk@cse.iitm.ac.in $6$ pratykumar@microsoft.com + +# Abstract + +In this paper, we study pre-trained sequence-to-sequence models for a group of related languages, with a focus on Indic languages. We present IndicBART, a multilingual, sequence-to-sequence pre-trained model focusing on 11 Indic languages and English. IndicBART utilizes the orthographic similarity between Indic scripts to improve transfer learning between similar Indic languages. We evaluate IndicBART on two NLG tasks: Neural Machine Translation (NMT) and extreme summarization. Our experiments on NMT and extreme summarization show that a model specific to related languages like IndicBART is competitive with large pre-trained models like mBART50 despite being significantly smaller. It also performs well on very low-resource translation scenarios where languages are not included in pre-training or fine-tuning. Script sharing, multilingual training, and better utilization of limited model capacity contribute to the good performance of the compact IndicBART model. + +# 1 Introduction + +Recently, there has been significant progress in deep learning based natural language generation (NLG) for machine translation, abstractive summarization, data-to-text generation, etc. due to the adoption of attention-based sequence-to-sequence (S2S) models (conditional language models) (Wu et al., 2016; Paulus et al., 2018; Puduppully et al., 2019). Pre-trained S2S models have been shown to be useful to improve performance on various NLG tasks (Rothe et al., 2020; Kale and Rastogi, 2020; Lewis et al., 2020). Specifically, multilingual pre-trained S2S models jointly trained on monolingual corpora from multiple languages such as mBART25 (Liu et al., 2020), mBART50 (Tang et al., 2020a) and mT5 (Xue et al., 2021) have seen increased adoption and low-resource languages have benefitted from cross-lingual transfer. However, these massively multilingual massive (M3) + +models have major limitations. They serve only a few of the world's languages (<100 languages), the pre-training corpora are dominated by high-resource languages, the vocabulary representation for low-resource languages is inadequate, and the models are large, making them expensive and slow to train, fine-tune and decode. + +An alternative approach is to build pre-trained S2S models for a group of related languages. Previous work has shown the benefits of pre-trained language models as well as NMT models that cater to a set of related languages (Kakwani et al., 2020; Tan et al., 2019; Khanuja et al., 2021; Reid et al., 2021). Owing to their public availability, these models have seen heavy adoption1. However, such a study on multilingual pre-trained S2S models for Indic languages is missing in the literature. In this work, we address this gap in the literature by studying multilingual pre-trained S2S models for Indic languages. + +The result of this study is IndicBART, a multilingual pre-trained sequence to sequence model specifically trained for Indic languages, which are spoken by more than a billion users2. It supports English and 11 Indian languages including 7 Indo-Aryan (Assamese, Bengali, Gujarati, Hindi, Marathi, Oriya, Punjabi) and 4 Dravidian (Kannada, Malayalam, Tamil, Telugu) languages. Of these, mBART25, mBART50 and mT5 support only 2, 7 and 9 languages respectively. There are linguistic similarities between the two language families on account of contact relatedness resulting from geographical colocation. Within, the two language families there are genetic relations between languages due to them being derived from + +common ancestor languages $^{34}$ . Due to this, the Indian subcontinent is considered to be a linguistic area or sprachbund (Emeneau, 1956). There is evidence that such contact-relatedness can result in positive cross-lingual transfer for NLP applications like NMT (Goyal et al., 2020a). Hence, we train a single model for all Indic languages. It is a compact model with just 244M parameters, which is much smaller than the M3 models such as mBART50 and mT5(-base) which contain 611M and 580M parameters respectively. We also propose a variant of IndicBART, i.e. IndicALBART, that is highly compact with just 97M parameters. + +We compare IndicBART with M3 models on two downstream generation tasks: machine translation and extreme summarization (Narayan et al., 2018). The results indicate that IndicBART is competitive or better by up to 2 BLEU/ROUGE compared to M3 models like mBART50. IndicBART also performs well in the following zero-shot scenarios: (a) on languages not included in pre-training, and (b) languages for which there is no fine-tuning data. + +The following aspects of the IndicBART model contribute to its strong performance and increased language coverage within the Indic group vis-à-vis M3 models, while being highly compact: + +1. It is trained on a smaller set of related languages, which reduces model capacity requirements. Moreover, available model capacity is effectively utilized, since transfer learning works when languages share linguistic features and data represents shared topical themes. +2. It is trained on the largest publicly available Indic language corpora, IndicCorp (Kakwani et al., 2020), which includes large, high-quality news crawls for Indian languages as well as English content from Indian websites - thus being representative of Indian English and topics. +3. We utilize the orthographic similarity between Indic scripts (Kunchukuttan et al., 2018) to map all the Indic language data to a single script, effectively reducing the number of scripts from 9 to 1 (each script having approximately 50 characters). This increases the shared subwords in the vocabulary, and we observe that single script models enable better cross-lingual transfer while fine-tuning. Since subwords embeddings consume a significant fraction of the parameter space, single script models + +also better utilize available vocabulary budget5. + +4. Extremely compressed pre-trained S2S models (IndicALBART) suitable for deployment can be trained by sharing parameters across layers of the transformer layers. For related languages, we show compressed pre-trained models are competitive with full models on downstream tasks when fine-tuned on distilled data. + +The IndicBART model and its variants, along with details on how to fine-tune them, can be accessed at https://github.com/AI4Bharat/indic-bart/. We also release the models on the HuggingFace model hub at https://huggingface.co/ai4bharat/IndicBART and https://huggingface.co/ai4bharat/IndicBARTSS. Models are available under an MIT license to spur further innovation in NLG for Indic languages and study of pre-trained S2S models for related languages. + +# 2 Related Work + +Pre-trained models. Pre-trained models learned using self-supervised objectives and large monolingual corpora have contributed to rapid advances in NLU (Devlin et al., 2019) and NLG (Lewis et al., 2020). Following initial work on English pretrained models, multilingual pre-trained models have been proposed for NLU (Devlin et al., 2019; Conneau et al., 2020) as well as NLG (Liu et al., 2020; Tang et al., 2020a; Xue et al., 2021) supporting around 100 languages. These pre-trained M3 models have proven to be very useful in improving NLG performance in low-resource settings, especially for applications other than translation. + +Language group-specific models. The proposed IndicBART model is also a multilingual pre-trained S2S model, similar in architecture and training to mBART. However, in contrast to mBART and mT5, the proposed IndicBART caters specifically to Indic languages. While language-group specific NLU language models like IndicBERT (Kakwani et al., 2020) and MuRIL (Khanuja et al., 2021) and NMT models (Tan et al., 2019) have been proposed, ours is one of the first efforts to create a pre-trained S2S model for a specific language group (and the first for Indic languages). AfroMT (Reid et al., 2021) is a concurrent effort focussed on African languages and low monolingual corpora scenarios + +belonging to various language families. However, AfroMT heavily relies on synthetic data, which may not reflect the true data distribution across languages. Furthermore, AfroMT effort is focussed only on MT, whereas we investigate IndicBART on an additional NLG task - abstractive summarization. Interestingly, the publicly available group-specific language models (IndicBERT and MuRIL) both cater to Indic languages, pointing to perceived need for Indic language specific models. + +Language relatedness. Language-group specific models are motivated from previous work that emphasizes the role of language relatedness in cross-lingual transfer for NMT (Nguyen and Chiang, 2017; Dabre et al., 2017; Aharoni et al., 2019; Kudugunta et al., 2019; Dabre et al., 2020) and NLU (Kakwani et al., 2020; Khemchandani et al., 2021; Dhamecha et al., 2021). We use a single script for representing Indic data since orthographic similarity between Indic languages has been utilized to represent data in a common script and improve cross-lingual transfer for machine transliteration (Kunchukuttan et al., 2018), machine translation (Dabre et al., 2018; Goyal et al., 2020b; Ramesh et al., 2021) and NLU (Khemchandani et al., 2021; Dhamecha et al., 2021). + +Parameter Sharing and Distillation. Parameter sharing across layers has shown promise for NMT (Dabre and Fujita, 2019) and pre-trained LMs (Lan et al., 2020) in building compressed models while maintaining end-task performance. The IndicALBART model proposed in this work is the first model to explore parameter-sharing across layers for pre-trained S2S models. For NMT models trained from scratch, sequence-to-sequence distillation (Kim and Rush, 2016) has been shown as an effective way to transfer knowledge to smaller models, while training large models on distilled data (a form of self-training) has been shown to improve translation quality (Dabre and Fujita, 2020). Our results indicate that these results hold when fine-tuning on pre-trained S2S models as well. + +# 3 IndicBART + +The IndicBART model is conceptually based on the mBART25/50 model family, which are Transformer models (Vaswani et al., 2017) trained on monolingual corpora with masked span reconstruction objective. We refer the readers to the mBART literature (Lewis et al., 2020; Liu et al., 2020) for architectural details and highlight specific details + +and differences from the mBART25/50 setup. + +# 3.1 Design Considerations for IndicBART + +Considerations that drove our model choices are: Compactness: The model should be compact given our focus on a smaller set of related languages, as well as to accelerate training and finetuning. Such a model will be usable by a larger base of users with limited computational resources. Content Relevance: In addition to Indian languages, we include English since transfer-learning from English is a natural use case, and English is widely used in the Indian subcontinent. We also use English content from the Indian subcontinent to reflect relevant content. + +Leveraging Relatedness: We utilize orthographic similarity between Indian languages, most of which use abugida scripts derived from the Brahmi script. The logical character set has high overlaps, though each script has its own code-point range in the Unicode standard (Kunchukuttan et al., 2018). We map all the data to Devanagari, enabling better transfer learning6 with a more compact vocabulary compared to mBART. + +# 3.2 Model and Training Details + +IndicBART uses $(\mathrm{N} =)$ 6 encoder and decoder layers with hidden and filter sizes of 1024 and 4096, respectively, and 16 attention heads (244M parameters). Similar to mBART, we mask $(\mathfrak{p} = )35\%$ of the words in each sentence by randomly sampling a span length according to a Poisson distribution $(\lambda = 3.5)$ . We use dropouts of 0.1, label smoothing of 0.1, Adam optimizer with a maximum learning rate of 0.001, weight decay of 0.00001, linear learning rate warm-up and decay with 16,000 warm-up steps, batch sizes of 4096 tokens. We train for 750,000 iterations on 48 NVIDIA V-100 GPUs, corresponding to roughly 2 epochs, taking around 5 days7. In comparison, mBART25/50 models need much longer time (2+ weeks) on 256 GPUs. + +To explore more compressed pre-trained models, we train IndicALBART, a variant of IndicBART with cross-layer parameter sharing, i.e., sharing parameters across layers. For ablation studies on the impact of single script representation, we also + +train a variant of IndicBART with a 64K vocabulary using the original scripts, which we call separate script IndicBART (SSIndicBART). + +The models have been trained with the YAN-MTT toolkit $^{8}$ (Dabre and Sumita, 2021) which is based on the mBART implementation of the HuggingFace Transformers library (Wolf et al., 2020). + +# 3.3 Training Data and Pre-processing + +We train the IndicBART model on the IndicCorp (IC) dataset (Kakwani et al., 2020) which contains 11 Indic languages and English. The Indic languages are: Assamese (as), Bengali (bn), Gujarati (gu), Hindi (hi), Kannada (kn), Malayalam (ml), Marathi (mr), Oriya (or), Punjabi (pa), Tamil (ta) and Telugu (te). The corpora statistics are mentioned in Table 7 of the appendix. We train the model on a total of approx. 450 million sentences and 9 billion tokens, where corpora sizes are balanced with temperature $(T = 5)$ based sampling (Arivazhagan et al., 2019). All the Indic language data is represented in a single script, i.e., the Devanagari script using the IndicNLP library9 (Kunchukuttan, 2020). We use a vocabulary of 64K subwords learned using SentencePiece (Kudo, 2018; Kudo and Richardson, 2018) on randomly sampled 1M raw sentences from the IndicCorp for each language, for a total of 12M sentences. The model is trained at the sentence-level, unlike the mBART50 model, which is trained on contiguous text chunks potentially spanning multiple sentences. + +# 4 Experiments: NMT + +Machine Translation is a standard, popular, cross-lingual generation task for which various pretrained models are evaluated. We compare IndicBART and its variants with mBART50, which should be the most directly comparable model. We study their performance in: (a) low-resource, (b) multilingual and (c) zero-shot training settings. + +# 4.1 Models Compared + +We study IndicBART via the following models: + +Models trained from scratch: We train bilingual (Bi) as well as multilingual many-to-one (M2O) and one-to-many (O2M) transformer models. + +Fine-tuned models: We fine-tune mBART50 (MB50), IndicBART (IB) and its variants namely + +IndicALBART (IALB) and separate script IndicBART (SSIB). The type of fine-tuning is indicated by $+$ type, which can be Bi, O2M or M2O. If needed, the corpus is indicated by $+$ corpus. + +Distilled models: We use the multilingually finetuned IndicBART model and translate the training data source sentences, which yields distillation data (Kim and Rush, 2016). We use this data to train M2O and O2M models from scratch, as well as by fine-tuning on mBART50, IndicBART and IndicALBART. This was motivated by Dabre and Fujita (2020) who show that the distillation data generated using models employing transfer learning significantly improves the performance of compact models for low-resource languages. + +# 4.2 Datasets and Preprocessing + +The statistics of training corpora are in Table 7 in the appendix. + +Training: For a low-resource setting (LR), we use the PMI subset (Haddow and Kirefu, 2020) of the WAT 2021 MultiIndicMT $^{10}$ (Nakazawa et al., 2021) training set for finetuning. This represents an extremely low-resource parallel corpus setting where we expect IndicBART to be the most helpful. We experiment with extending the PMI data (approximately 326K pairs) with the CVIT-PIB (henceforth PIB: 930K pairs) data (Siripragrada et al., 2020) which is similar in domain to the former. We also use the high-resource, general domain Samanantar corpus (Ramesh et al., 2021) (46.2M pairs) to compare with the generalization capabilities of pretrained models which are fine-tuned with small corpora (PMI, PIB). + +Testing: We use the WAT 2021 MultiIndicMT testset and the FLORES101 devtest (Goyal et al., 2021) for evaluation of our models. Both these test sets are $n$ -way parallel (2,390 and 1,012 sentences respectively). The WAT 2021 test set shares the same domain as the training set. The FLORES devtest comes from a different, general domain. We rely on the FLORES dataset to evaluate performance of models trained on the PMI/PIB domain on a more general domain. + +Validation: We use the WAT2021 development set of 1,000 sentences. + +Preprocessing: For IndicBART and IndicAL-BART, we use the Indic NLP library to convert the Indic side of the parallel data to the Devanagari script. For mBART50, only Kannada, Punjabi + +and Oriya scripts are converted to Devanagari as mBART50 does not support these languages. Results for these are italicized. For separate script IndicBART we do not do script conversion. + +With this setup, we study the benefits of pretraining in low-resource settings (fine-tuned on PMI and PIB) and compare it with high-resource settings (trained on Samanantar) on in-domain (WAT2021) and general (FLORES) test sets. Unless explicitly mentioned, our models are assumed to be trained/fine-tuned/distilled with the PMI training data. + +# 4.3 Model Training Settings + +We use a single GPU for bilingual and 8 GPUs for multilingual models, all of which are Transformers. Multilingual models are trained using the approach in Johnson et al. (2017) where corpora for various language pairs are first balanced according to their size, then concatenated after appending target language indicator tokens, and finally fed to the NMT model for training. Wherever possible and applicable, we tuned hyperparameters such as hidden sizes, dropout, label smoothing, warm-up, tokens per batch, per GPU, learning rate and weight decay. The ADAM optimizer was used. We train our models till convergence on the development set BLEU scores (Papineni et al., 2002). We decode train/tests sets using beam search with a beam of size 4 and a length penalty of 0.8. We report the BLEU scores on the decoded results computed using sacreBLEU11 (Post, 2018). For additional details, refer to section B in the appendix. + +# 4.4 Comparison of Pre-trained Models + +We first describe the main results of using IndicBART and its variants for machine translation and compare it with other relevant models. Table 1 shows results for models trained on the PMI corpus and evaluated on the WAT21 test set. + +Language specific models are compact and competitive: Considering bilingual models, IndicBART outperforms models trained from scratch and gives competitive results when compared to mBART50. For Indic to English translation, mBART50 tends to be better, but this is not surprising because it is trained on far larger amounts of English data in addition to being almost 3 times larger than IndicBART. For English to Indic translation, both models tend to give similar scores. In + +the case of multilingual models, IndicBART is, once again, vastly better than its counterpart trained from scratch and when compared to mBART50 the gap which existed in case of bilingual settings disappears and sometimes reverses in favor of IndicBART. In both cases, IndicBART outperforms mBART50 for Kannada, Punjabi and Oriya which the latter is not trained for. This shows that having a compact language group specific model can be competitive with if not better than a general purpose model trained on a larger number of languages while only having one-third the number of parameters as the latter. + +Extreme compression has its downside: Comparing the performance of IndicBART and mBART50 against IndicALBART in multilingual settings, it seems that a $60\%$ and $84\%$ reduction of parameters, respectively, has a negative impact on the translation quality, which results in drops of up to 3 BLEU. However, this may be considered as a reasonable tradeoff given the high levels of compression achieved. Especially given that IndicALBART is $84\%$ smaller than mBART50, means that large capacity GPUs (which not everyone has easy access to) may not be needed. Furthermore, the drops in quality can be addressed via distillation. + +Distillation successfully transfers performance from large to smaller models: We see that fine-tuning the pre-trained IndicALBART on distilled data from IndicBART can match the performance of the IndicBART model. Fine-tuning pre-trained IndicALBART performs better than training a randomly initialized model on the same distilled data in the XX-En direction. On the other hand, both the approaches are competitive in the En-XX direction. + +Self-training on distilled data is beneficial: When IndicBART and MB50 are fine-tuned on distillation data generated from a previously fine-tuned model, we see significant improvements in the XX-En direction, and modest improvements in the En-XX directions. These observations are mostly in line with Dabre and Fujita (2020). + +In summary, compact language group specific pre-trained models are competitive with large universal language models. This can result in reasonable gains in fine-tuning multilingual models (3.3-3.5 hours for IndicBART variants vs 4.7-5 hours for mBART50) and significantly reduce the memory footprint (97-244M vs 611M) for deployment. + +
Model#Paramsbxguhiknmlmrorpatate
XX-En
Bilingual Models
Bi78M13.527.430.922.516.518.418.427.117.116.5
MB50+Bi611M23.235.438.326.829.227.727.835.827.130.8
IB+Bi244M23.635.536.831.627.926.828.336.327.029.9
Multilingual Models
M2O78M18.924.827.823.821.620.721.226.420.621.8
MB50+M2O611M24.833.936.830.128.828.127.534.527.029.2
IB+M2O244M24.833.937.232.428.528.528.835.727.329.5
IALB+M2O97M23.133.234.429.527.127.027.334.125.227.4
Distilled Large Models
MB50+M2O611M26.135.938.332.929.629.330.137.128.531.7
IB+M2O244M26.035.938.033.729.929.430.337.428.431.6
Distilled Compact Models
M2O78M23.633.336.030.226.026.927.734.025.627.8
IAIB+M2O97M24.934.436.631.927.728.128.635.526.529.0
En-XX
Bilingual Models
Bi78M4.517.921.712.13.910.09.217.97.22.1
MB50+Bi611M8.623.527.017.46.015.811.624.511.23.3
IB+Bi244M8.223.626.917.76.015.811.825.110.83.6
Multilingual Models
O2M78M7.422.525.916.25.614.711.421.910.02.7
MB50+O2M611M8.922.827.518.16.516.312.025.111.63.7
IB+O2M244M9.124.027.318.56.716.712.926.411.63.7
IALB+O2M97M8.122.326.317.05.815.311.624.210.53.2
Distilled Large Models
MB50+O2M611M9.424.527.517.56.116.412.826.311.62.9
IB+O2M244M9.325.028.219.26.717.013.226.511.83.7
Distilled Compact Models
O2M78M8.924.127.518.26.316.012.525.611.03.2
IAIB+O2M97M8.923.427.217.86.316.212.725.311.33.1
+ +Table 1: Comparison of IndicBART with other models. Scores are reported on the WAT 2021 test set. + +
Modelbnhimlorta
XX-En
IB+M2O24.837.228.528.827.3
SSIB+M2O24.135.527.928.126.9
En-XX
IB+O2M9.127.36.716.911.6
SSIB+O2M9.327.36.216.611.4
+ +Table 2: Ablation studies on the impact of multilingualism and script unification on downstream performance of IndicBART. Scores are on the WAT 2021 test set. + +# 4.5 Ablation Studies + +We now perform ablation experiments to study the (a.) impact of script unification on translation, + +(b.) impact of corpora sizes and domains on translation, (c.) translation quality for languages unseen during fine-tuning, and (d.) translation quality on languages unseen during pre-training. Although we train models on all languages, we only report on a subset due to lack of space. Please see Sections C, D in the appendix for more detailed results. + +# 4.5.1 Impact Of Script Unification + +Table 2 contains the ablation tests, giving the results for the impact of script unification with multilingual fine-tuning. Comparing scores of models fine-tuned on unified script IndicBART (IB+M2O/O2M) against separate script IndicBART (SSIB+M2O/O2M) it is clear that overall, the for + +
Modelbnhimlorta
IB+PMITest Set: WAT 2021
24.837.228.528.827.3
IB+PMI+PIB28.941.733.233.232.0
Samanantar27.941.832.732.931.2
IB+Samanantar27.141.031.632.330.1
IB+PMITest Set: FLORES
10.414.88.111.210.5
IB+PMI+PIB13.022.012.715.113.8
Samanantar30.736.030.428.627.7
IB+Samanantar30.135.329.128.526.6
+ +mer is better than the latter which could indicate that script unification enables languages to better benefit from each other. The case of Kannada, Punjabi and Oriya, further, illustrates the utility of script unification. The results for these languages are italicized in the rows labelled MB50+Bi and MB50+O2M/M2O in Table 1. mBART50 was not pre-trained on these languages, so we converted the training data in these languages in the Devanagari script12. With this trick, we still managed to get large performance improvements over the baselines trained from scratch, and these improvements are often close to those exhibited by using IndicBART. This shows that we may not need to pre-train on all languages. However, explicitly training on the languages of interest should lead to better translation quality (Tang et al., 2020b). + +# 4.5.2 Impact Of Corpora Size and Domain + +Table 3 shows the impact of corpora sizes as well as training data domain on some Indic to English pairs (complete results in Appendix D). All models are multilingual (M2O), have the same size and are trained on unified script data. In order to clearly assess the impact of domains, we evaluate on the WAT 2021 as well as the FLORES test sets. Regardless of the test sets or testing domains, comparing rows IB+PMI and IB+PMI+PIB, it is clear that increasing the amount of fine-tuning data has a positive impact on the final translation quality. However, PMI+PIB data is in-domain for the WAT 2021 test set but out-of-domain for the + +Table 3: Ablation study of the impact of using different fine-tuning corpora sizes (PMI+PIB) and their comparison against a model trained from scratch as well as fine-tuned on a general domain corpus (Samanantar). We evaluate Indic to English translation on the WAT 2021 as well as the FLORES test sets. + +
SettingM2OO2M
kn-enpa-enen-knen-pa
IB+Full32.435.718.526.4
IB+Zero27.531.56.110.4
SSIB+Zero24.028.23.97.4
+ +Table 4: Evaluation of Kannada and Punjabi to/from English translation, which aren't seen when fine-tuning. + +FLORES test set, and the performance on the latter test set still improves. Furthermore, comparing rows IB+PMI+PIB and Samanantar, we can see widely different results depending on the test set. For the WAT 2021 test set, fine-tuning on the PMI+PIB dataset is comparable to training on Samanantar from scratch, indicating that for domain specific models, having a small in-domain fine-tuning data is sufficient. On the other hand, on the more general domain FLORES test sets training on the more diverse Samanantar data is clearly better. Finally, the scores in the row IB+Samanantar show that pre-training has minimal impact when the parallel corpora are large, an observation in line with Liu et al. (2020). + +# 4.5.3 Unseen Languages During Fine-Tuning + +We evaluate Kannada and Punjabi to/from English translation where the IndicBART model, with and without script unification, is fine-tuned on the multilingual PMI data where the training data for these languages is missing (denoted by "Zero"). We compare against a setting where the training data is used (denoted by "Full"). Table 4 shows what happens when languages are seen during pre-training but not during fine-tuning. There are two critical observations: First, despite not having seen any training data for the given language pairs, we still obtain a reasonable translation for translation into English. However, the quality of translation from English is poor due to the decoder not having seen those specific Indic languages during fine-tuning. Incorporating a monolingual de-noising objective for unseen target languages during fine-tuning could alleviate this problem. Second, script unification has a large impact on the final performance, often improving performance by up to 3.5 BLEU over a separate script model. + +# 4.5.4 Unseen Languages During Pre-Training + +We study Nepalese (ne) and Sinhala (si) to English translation using the parallel training data from Guzmán et al. (2019) (also used in Liu et al. (2020)) + +
Modelne-ensi-en
Bi (Scratch)5.24.3
IB+Bi10.58.5
(Liu et al., 2020)14.513.7
+ +for bilingual fine-tuning, and evaluate on the FLORES devtest set $^{13}$ . Note that for Sinhala we have to resort to script mapping into Devanagari. Table 5 shows what happens when we perform fine-tuning for languages that IndicBART is not trained on. The baselines, trained using the unified script IndicBART vocabulary, will seem weaker than what is reported in previous work, but it should be noted that the vocabulary was not actually trained for Nepali and Sinhala. Regardless, fine-tuning leads to substantial improvements in translation quality, which indicates the utility of IndicBART even for unseen languages. Comparing against Liu et al. (2020) who use the same fine-tuning data as us but their mBART model is pre-trained on both languages, we can see that our models are not too far behind. + +# 5 Experiments: Extreme Summarization + +We compare the performance of fine-tuning IndicBART, its variants and mBART50 on the challenging extreme summarization task (Narayan et al., 2018) for Indic languages. The small datasets, enable a good study of the utility of pre-training. + +# 5.1 Models Trained + +We fine-tune and compare the mBART50 (MB), IndicBART (IB), IndicALBART (IALB) and the separate script IndicBART model (SSIB) models. Punjabi is not present in mBART50 and has its script mapped to Devanagari before fine-tuning (italicized results). + +# 5.2 Datasets and Preprocessing + +We used the multilingual XL-Sum dataset (Hasan et al., 2021) for our experiments. The Indic languages we focus on for evaluating our IndicBART models are: Bengali, Gujarati, Hindi, Marathi, Punjabi, Tamil and Telugu. We use the updated splits of Hasan et al. (2021), the statistics of which are + +Table 5: Evaluation of Nepali and Sinhala to English translation where IndicBART hasn't seen Nepali and Sinhala during pre-training. + +
LangMB50IBSSIBIALB
bn21.8721.4620.5219.86
gu18.2818.2016.3816.81
hi31.7130.9430.3330.04
mr18.3319.0018.6618.44
pa22.1424.8225.0823.29
ta19.5020.4020.2317.41
te13.3414.3813.3413.55
+ +Table 6: Rouge-L scores for summarization on XL-Sum. + +given in their GitHub page14. Since the splits are not n-way parallel, we do not conduct multilingual fine-tuning due to potential content overlaps between splits across languages. Like we did in NMT, we map all scripts to Devanagari as applicable for fine-tuning (only Punjabi for mBART50, all languages for IndicBART and IndicALBART and none for separate script IndicBART). Statistics are given in Table 10 in the appendix. + +# 5.3 Model Training Settings + +Similar to NMT, we use YANMTT for fine-tuning. We use maximum document-summary lengths of 512-64 tokens, which loosely follows previous work (Lewis et al., 2020). Most of the optimal hyperparameters were the same as for NMT. We train our models till convergence on the development set Rouge-L F1 scores (RL) (Lin, 2004). For decoding test sets, we use beam size of 5, length penalty of 1.2 and a decoding n-gram repetition limit of $4^{15}$ . We report RL scores on the decoded results computed using multilingual Rouge scoring toolkit16. Refer to section F in the appendix for details. + +# 5.4 Results + +Table 6 contains the results for the summarization experiments. IndicBART (IB) and mBART50 are competitive with each other where the former performs slightly better for Marathi, Punjabi, Tamil and Telugu. Once again, separate script IndicBART (SSIB) fared poorer than IndicBART except for Punjabi, indicating the importance of script unification. Similar to NMT, fine-tuning IndicALBART gives poorer results, often lagging 1-3 RL points + +$^{14}$ https://github.com/csebuetnlp/xl-sum/ +This means that 4-grams won't be repeated in the output. +$^{16}$ https://github.com/csebuetnlp/xl-sum/tree/master/multilingual_rouge_scoring + +behind IndicBART which we consider to be a reasonable tradeoff given the reduced parameter sizes. We expect that distillation may help improve performance, like it does for NMT. Overall, the major conclusions are in line with the those observed for the low-resource NMT task. + +# 6 Conclusion and Future Work + +We presented IndicBART, a multilingual, pretrained sequence-to-sequence model to support development of NLG applications for Indian languages. IndicBART supports 11 Indian languages and English, and utilizes the orthographic similarity of Indic scripts to enable better cross-lingual transfer. IndicBART presents a case-study for language group-specific pre-trained S2S models. Our experiments on fine-tuning IndicBART for NMT and summarization showed that the model is competitive with large models such as mBART50. We further compressed IndicBART while maintaining downstream task performance via parameter sharing (IndicALBART) combined with multilingual distillation. We showed that script unification has a strong positive impact on translation and summarization. We also showed that IndicBART, thanks to its script independent nature, can be readily used for enabling translation for languages such as Sinhala and Nepali which IndicBART has not been explicitly pre-trained for. Furthermore, we showed that fine-tuning IndicBART on one set of languages enables translation for another unseen set of languages, which shows that pre-trained models enable translation without parallel corpora. + +In the future, we plan to support more Indic languages in IndicBART; starting with all the $22^{17}$ languages listed in the $8^{th}$ schedule of the Indian constitution. Increased language coverage and models with lower compute demands can democratize access to NLP technologies. We also plan to focus on training models on longer text chunks (documents) and larger text corpora, incorporating advances in multilingual pre-training, cross-lingual transfer and cross-lingual tasks for Indian languages. + +# References + +Roeaharoni, Melvin Johnson, and Orhan First. 2019. Massively multilingual neural machine translation. 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 3874-3884, Minneapolis, Minnesota. Association for Computational Linguistics. +Naveen Arivazhagan, Ankur Bapna, Orhan First, Dmitry Lepikhin, Melvin Johnson, Maxim Krikun, Mia Xu Chen, Yuan Cao, George Foster, Colin Cherry, Wolfgang Macherey, Zhifeng Chen, and Yonghui Wu. 2019. Massively multilingual neural machine translation in the wild: Findings and challenges. CoRR, abs/1907.05019. +Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. 2020. Unsupervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8440-8451, Online. Association for Computational Linguistics. +Raj Dabre, Chenhui Chu, and Anoop Kunchukuttan. 2020. A survey of multilingual neural machine translation. ACM Comput. Surv., 53(5). +Raj Dabre and Atsushi Fujita. 2019. Recurrent stacking of layers for compact neural machine translation models. Proceedings of the AAAI Conference on Artificial Intelligence, 33(01):6292-6299. +Raj Dabre and Atsushi Fujita. 2020. Combining sequence distillation and transfer learning for efficient low-resource neural machine translation models. In Proceedings of the Fifth Conference on Machine Translation, pages 492-502, Online. Association for Computational Linguistics. +Raj Dabre, Anoop Kunchukuttan, Atsushi Fujita, and Eichiro Sumita. 2018. Nict's participation in wet 2018: Approaches using multilingualism and recurrently stacked layers. In Proceedings of the 32nd Pacific Asia Conference on Language, Information and Computation: 5th Workshop on Asian Translation: 5th Workshop on Asian Translation. +Raj Dabre, Tetsuji Nakagawa, and Hideto Kazawa. 2017. An empirical study of language relatedness for transfer learning in neural machine translation. In Proceedings of the 31st Pacific Asia Conference on Language, Information and Computation, pages 282-286. The National University (Phillippines). +Raj Dabre and Eiichiro Sumita. 2021. Yanmtt: Yet another neural machine translation toolkit. +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. +Tejas Dhamecha, Rudra Murthy, Samarth Bharadwaj, Karthik Sankaranarayanan, and Pushpak Bhattacharyya. 2021. Role of Language Relatedness in Multilingual Fine-tuning of Language Models: A Case Study in Indo-Aryan Languages. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 8584-8595, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Murray B Emeneau. 1956. India as a linguistic area. Language, 32(1):3-16. +Naman Goyal, Cynthia Gao, Vishrav Chaudhary, Peng-Jen Chen, Guillaume Wenzek, Da Ju, Sanjana Krishnan, Marc'Aurelio Ranzato, Francisco Guzmán, and Angela Fan. 2021. The FLORES-101 evaluation benchmark for low-resource and multilingual machine translation. CoRR, abs/2106.03193. +Vikrant Goyal, Anoop Kunchukuttan, Rahul Kejriwal, Siddharth Jain, and Amit Bhagwat. 2020a. Contact relatedness can help improve multilingual NMT: Microsoft STCI-MT @ WMT20. In Proceedings of the Fifth Conference on Machine Translation, pages 202-206, Online. Association for Computational Linguistics. +Vikrant Goyal, Anoop Kunchukuttan, Rahul Kejriwal, Siddharth Jain, and Amit Bhagwat. 2020b. Contact Relatedness can help improve multilingual NMT: Microsoft STCI-MT @ WMT20. In Conference on Machine Translation. +Francisco Guzmán, Peng-Jen Chen, Myle Ott, Juan Pino, Guillaume Lample, Philipp Koehn, Vishrav Chaudhary, and Marc'Aurelio Ranzato. 2019. The FLORES evaluation datasets for low-resource machine translation: Nepali-English and Sinhala-English. 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 6098-6111, Hong Kong, China. Association for Computational Linguistics. +Barry Haddow and Faheem Kirefu. 2020. PMIndia - A Collection of Parallel Corpora of Languages of India. arxiv 2001.09907. +Tahmid Hasan, Abhik Bhattacharjee, Md. Saiful Islam, Kazi Mubasshir, Yuan-Fang Li, Yong-Bin Kang, M. Sohel Rahman, and Rifat Shahriyar. 2021. XLsum: Large-scale multilingual abstractive summarization for 44 languages. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 4693-4703, Online. Association for Computational Linguistics. +Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viégas, Martin Wattenberg, Greg Corrado, + +Macduff Hughes, and Jeffrey Dean. 2017. Google's multilingual neural machine translation system: Enabling zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339-351. +Divyanshu Kakwani, Anoop Kunchukuttan, Satish Golla, Gokul N.C., Avik Bhattacharyya, Mitesh M. Khapra, and Pratyush Kumar. 2020. IndicNLPSuite: Monolingual corpora, evaluation benchmarks and pre-trained multilingual language models for Indian languages. In *Findings of the Association for Computational Linguistics: EMNLP* 2020, pages 4948-4961, Online. Association for Computational Linguistics. +Mihir Kale and Abhinav Rastogi. 2020. Text-to-text pre-training for data-to-text tasks. In Proceedings of the 13th International Conference on Natural Language Generation, pages 97-102, Dublin, Ireland. Association for Computational Linguistics. +Simran Khanuja, Diksha Bansal, Sarvesh Mehtani, Savya Khosla, Atreyee Dey, Balaji Gopalan, Dilip Kumar Margam, Pooja Aggarwal, Rajiv Teja Nagipugu, Shachi Dave, Shruti Gupta, Subhash Chandra Bose Gali, Vish Subramanian, and Partha Talukdar. 2021. Muril: Multilingual representations for indian languages. +Yash Khemchandani, Sarvesh Mehtani, Vaidehi Patil, Abhijeet Awasthi, Partha Talukdar, and Sunita Sarawagi. 2021. Exploiting language relatedness for low web-resource language model adaptation: An Indic languages study. 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 1312-1323, Online. Association for Computational Linguistics. +Yoon Kim and Alexander M. Rush. 2016. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1317-1327, Austin, Texas. Association for Computational Linguistics. +Taku Kudo. 2018. Subword regularization: Improving neural network translation models with multiple subword candidates. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 66-75, Melbourne, Australia. Association for Computational Linguistics. +Taku Kudo and John Richardson. 2018. SentencePiece: A simple and language independent subword tokenizer and tokenizer for neural text processing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 66-71, Brussels, Belgium. Association for Computational Linguistics. +Sneha Kudugunta, Ankur Bapna, Isaac Caswell, and Orhan Firat. 2019. Investigating multilingual NMT representations at scale. 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 1565-1575, Hong Kong, China. Association for Computational Linguistics. +Anoop Kunchukuttan. 2020. The Indic-NLP Library. https://github.com/anoopkunchukuttan/indic_nlpLibrary/blob/master/docs/indicnlp.pdf. +Anoop Kunchukuttan, Mitesh Khapra, Gurneet Singh, and Pushpak Bhattacharyya. 2018. Leveraging orthographic similarity for multilingual neural transliteration. Transactions of the Association for Computational Linguistics, 6:303-316. +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. OpenReview.net. +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. 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. +Chin-Yew Lin. 2004. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pages 74-81, Barcelona, Spain. Association for Computational Linguistics. +Yinhan Liu, Jiatao Gu, Naman Goyal, Xian Li, Sergey Edunov, Marjan Ghazvininejad, Mike Lewis, and Luke Zettlemoyer. 2020. Multilingual denoising pretraining for neural machine translation. Transactions of the Association for Computational Linguistics, 8:726-742. +Toshiaki Nakazawa, Hideki Nakayama, Chenchen Ding, Raj Dabre, Shohei Higashiyama, Hideya Mino, Isao Goto, Win Pa Pa, Anoop Kunchukuttan, Shantipriya Parida, Ondrej Bojar, Chenhui Chu, Akiko Eriguchi, Kaori Abe, and Sadao Oda, Yusuke Kurohashi. 2021. Overview of the 8th workshop on Asian translation. In Proceedings of the 8th Workshop on Asian Translation, Bangkok, Thailand. Association for Computational Linguistics. +Shashi Narayan, Shay B. Cohen, and Mirella Lapata. 2018. Don't give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1797-1807, Brussels, Belgium. Association for Computational Linguistics. + +Toan Q. Nguyen and David Chiang. 2017. Transfer learning across low-resource, related languages for neural machine translation. In Proceedings of the Eighth International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 296-301, Taipei, Taiwan. Asian Federation of Natural Language Processing. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting on Association for Computational Linguistics, pages 311-318. +Romain Paulus, Caiming Xiong, and Richard Socher. 2018. A deep reinforced model for abstractive summarization. In International Conference on Learning Representations. +Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186-191, Brussels, Belgium. Association for Computational Linguistics. +Ratish Puduppully, Li Dong, and Mirella Lapata. 2019. Data-to-text generation with content selection and planning. In The Thirty-Third AAAI Conference on Artificial Intelligence, AAAI 2019, The Thirty-First Innovative Applications of Artificial Intelligence Conference, IAAI 2019, The Ninth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2019, Honolulu, Hawaii, USA, January 27 - February 1, 2019, pages 6908-6915. AAAI Press. +Gowtham Ramesh, Sumanth Doddapaneni, Aravinth Bheemaraj, Mayank Jobanputra, Raghavan AK, Ajitesh Sharma, Sujit Sahoo, Harshita Diddee, Mahalakshmi J, Divyanshu Kakwani, Navneet Kumar, Aswin Pradeep, Kumar Deepak, Vivek Raghavan, Anoop Kunchukuttan, Pratyush Kumar, and Mitesh Shantadevi Khapra. 2021. Samanantar: The largest publicly available parallel corpora collection for 11 indic languages. CoRR, abs/2104.05596. +Machel Reid, Junjie Hu, Graham Neubig, and Yutaka Matsuo. 2021. AfroMT: Pretraining strategies and reproducible benchmarks for translation of 8 African languages. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 1306-1320, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Sascha Rothe, Shashi Narayan, and Aliaksei Severyn. 2020. Leveraging pre-trained checkpoints for sequence generation tasks. Transactions of the Association for Computational Linguistics, 8:264-280. +Shashank Siripragrada, Jerin Philip, Vinay P. Namboodiri, and C V Jawahar. 2020. A multilingual parallel corpora collection effort for Indian languages. In Proceedings of The 12th Language Resources and Evaluation Conference, pages 3743-3751, Marseille, France. European Language Resources Association. + +Xu Tan, Yi Ren, Di He, Tao Qin, and Tie-Yan Liu. 2019. Multilingual neural machine translation with knowledge distillation. In International Conference on Learning Representations (ICLR), New Orleans, LA, USA. +Yuqing Tang, Chau Tran, Xian Li, Peng-Jen Chen, Naman Goyal, Vishrav Chaudhary, Jiatao Gu, and Angela Fan. 2020a. Multilingual translation with extensible multilingual pretraining and finetuning. +Yuqing Tang, Chau Tran, Xian Li, Peng-Jen Chen, Naman Goyal, Vishrav Chaudhary, Jiatao Gu, and Angela Fan. 2020b. Multilingual translation with extensible multilingual pretraining and finetuning. CoRR, abs/2008.00401. +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. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric 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. +Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. 2016. Google's neural machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144. +Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. 2021. mT5: A massively multilingual pre-trained text-to-text transformer. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 483-498, Online. Association for Computational Linguistics. + +
LangMonoParallel (XX-En)
LRHR
ICPMIPIBTotalSam
as1.4M----
bn39.9M23.3K91.9K115.2K8.4M
en54.3----
gu41.1M41.5K58.2K99.8K3.0M
hi63.1M50.3K266.5K316.9K8.4M
kn53.3M28.9K-28.9K4.0M
ml50.2M26.9K43.1K70.0K5.8M
mr34.0M28.9K114.2K143.1K3.2M
or7.0M31.9K94.4K126.4K990.4K
pa29.2M28.2K101,092129.3K2.4M
ta31.532.6K115.9K148.6K5.1M
te47.9M33.3K44.7K78.1K4.7M
Total450M326.3K930.3K1.2M46.2M
+ +Table 7: Statistics of monolingual and parallel corpora (#sentences) for pre-training IndicBART and fine-tuning it, respectively. + +# A Corpora statistics + +Table 7 gives the statistics for the monolingual corpora, Indiccorp (IC), and parallel corpora, PMI, PIB and Samanantar (Sam) used in this paper. Indiccorp is used for pre-training IndicBART and the parallel corpora are used for fine-tuning or for training models from scratch. PMI and PIB have similar domains. PMI is used to simulate a realistic low-resource domain specific setting, and PIB is used to simulate a middle-resource domain specific setting. Samanantar is used to simulate a high resource general domain setting. + +# B NMT Model Training Settings + +We use a single GPU for bilingual and 8 GPUs for multilingual models, all of which are Transformers. Multilingual models are trained using the approach in Johnson et al. (2017). Due to the large number of models we train, we did not perform exhaustive hyperparameter tuning. We mainly focused on tuning the learning rates, batch sizes and warm-ups. We found that high dropouts were surprisingly ineffective, especially for multilingual settings, regardless of training from scratch or fine-tuning. Nevertheless, for fine-tuning IndicBART and its variants, we determined the following optimal hyperparameters: dropouts of 0.1, label smoothing of 0.1, warm-up of 16,000 steps, 2048 tokens per batch per GPU, learning rate of 0.001 and weight decay of 0.00001 with the ADAM optimizer for training. For mBART50, we used warm-up of 2,500 steps, 512 tokens per + +batch per GPU, and a learning rate of 0.00003. $^{18}$ For bilingual and multilingual models trained from scratch on the small PMI and PIB data, we use smaller models with hidden and filter sizes of 512 and 2048, respectively, while keeping all other hyperparameters the same as for IndicBART which we found to be highly effective. As Samanantar data is much larger, we keep its size the same as IndicBART. Except for separate script IndicBART and mBART50, all models use the same vocabulary as IndicBART for consistency. + +We train our models till convergence on the development set BLEU scores (Papineni et al., 2002) which are computed via greedy decoding every 1,000 batches. For multilingual models, we use the global development set BLEU score, an average of BLEU scores for each language pair. During decoding the test sets, we use beam search with a beam of size 4 and a length penalty of 0.8. We report the BLEU scores on the decoded results computed using sacreBLEU $^{19}$ (Post, 2018). + +# C NMT Results: Impact of Script Unification + +Table 8 contains the results of ablation studies on the impact of script unification in bilingual and multilingual settings. Regardless of bilingual or multilingual fine-tuning, it is clear that script unification tends to give better results on average as compared to using separate scripts to represent all languages. + +# D NMT Results: Effect of Corpora Size and Domain + +Table 9 contains the results showing the impact of varying corpora sizes and domain on translation quality. In the main paper, we could not show results for all languages and directions, due to lack of space. There are three key points to note: (a.) fine-tuning using small in-domain corpora (PMI) gives competitive results compared to using a large general domain corpus. (b.) Additional corpora from a related domain (PMI) leads to substantial improvements in translation quality for in- as well as out-of-domain performance, indicating that fine-tuning a pre-trained model on a corpus belonging to a different domain (PMI/PIB) is a viable option in case + +
Modelbnguhiknmlmrorpatate
XX-En
IB+M2O24.833.937.232.428.528.528.835.727.329.5
IBnoSM+M2O24.133.835.531.227.928.028.135.726.928.4
IB+Bi23.635.536.831.627.926.828.336.327.029.9
IBnoSM+Bi22.334.936.630.827.526.728.036.026.329.7
En-XX
IB+O2M9.124.027.318.56.716.712.926.411.63.7
IBnoSM+O2M9.324.027.317.96.216.416.623.411.43.0
IB+Bi8.223.626.917.76.015.811.825.110.83.6
IBnoSM+Bi8.222.926.617.35.814.614.822.910.53.6
+ +Table 8: Ablation studies to study the impact of multilingualism and script unification on downstream performance of IndicBART. Scores are reported on the WAT 2021 test set. + +
ModelTest Set: WAT 2021
bnguhiknmlmrorpatate
XX-En
IB+PMI24.833.937.232.428.528.528.835.727.329.5
IB+PMI+PIB28.938.841.734.633.232.533.241.332.033.0
Samanantar27.939.041.834.832.732.032.941.431.234.4
IB+Samanantar27.138.041.034.131.631.132.340.130.132.4
En-XX
IB+PMI9.124.027.318.56.716.712.926.411.63.7
IB+PMI+PIB11.125.533.018.97.219.114.327.113.63.6
Samanantar9.724.733.017.57.018.413.325.512.75.8
IB+Samanantar9.424.233.017.26.517.713.525.611.85.6
ModelTest Set: FLORES
bnguhiknmlmrorpatate
XX-En
IB+PMI10.413.214.811.88.110.111.212.910.510.5
IB+PMI+PIB13.018.422.013.112.716.115.118.513.816.2
Samanantar30.733.636.027.430.430.028.634.227.732.7
IB+Samanantar30.132.635.327.229.129.628.533.026.632.1
En-XX
IB+PMI3.59.514.75.62.16.05.310.65.03.1
IB+PMI+PIB5.413.522.87.52.89.16.415.56.93.5
Samanantar17.322.631.316.714.214.710.121.914.920.4
IB+Samanantar17.121.531.216.213.014.210.221.513.719.5
+ +Table 9: Ablation study of the impact of using different sizes of fine-tuning corpora (PMI and its combination with PIB) and their comparison against a model trained from scratch as well as fine-tuned on a general domain corpus (Samanantar). We evaluate on the WAT 2021 as well as the FLORES test sets. + +training corpus for the target domain (FLORES) is unavailable. Furthermore, going from low-resource to middle resource settings does not diminish the contribution of pre-trained models. (c.) General domain corpora inevitably lead to the best performance, but since training large models on large general domain corpora is more time-consuming, + +fine-tuning is a more attractive option since pretraining needs to be done only once. + +# E Corpora statistics for summarization experiments + +Table 10 contains statistics of the Indic section of the XL-sum dataset, which we use for summa + +
LanguageTrainDevTest
bn8,1021,0121,012
gu9,1191,1391,139
hi70,7788,8478,847
mr10,9031,3621,362
pa8,2151,0261,026
ta16,2222,0272,027
te10,4211,3021,302
+ +Table 10: Statistics of the Indic portion of the multilingual XL-Sum dataset (Hasan et al., 2021) that we used for training our summarization models. + +rization experiments. We preprocess languages by mapping their scripts to Devanagari as applicable (all languages for IndicBART and IndicALBART; none for separate script IndicBART; only Punjabi for mBART50). + +# F Summarization Model Training Settings + +Similar to NMT, we use YANMTT for fine-tuning. We use maximum document-summary lengths of 512-64 tokens, which loosely follows previous work (Lewis et al., 2020). Unlike NMT, we do not train models from scratch, as they would not work given the small data sizes and difficulty of summarization. For IndicBART and its variants, we determined the following optimal hyperparameters: batch sizes of 4,096 tokens, dropouts of 0.1, label smoothing of 0.1, learning rate warmup steps of 4,000, learning rate of 0.001 and weight decay of 0.00001 with the ADAM optimizer. For mBART50 we use sentence level batching with 2 document-summary pairs per batch and learning rate of 0.00001 which we found to be optimal. We train our models till convergence on the development set Rouge scores (Rouge-L F1) (Lin, 2004) for all languages, which are computed via greedy decoding every 1,000 batches. Similar to NMT, we save the best performing checkpoints for each language. During decoding the test sets, we use beam search with a beam of size 5, length penalty of 1.2 and a decoding n-gram repetition limit of 4-grams $^{20}$ . We report Rouge scores on the decoded results computed using multilingual Rouge scoring toolkit $^{21}$ . \ No newline at end of file diff --git a/indicbartapretrainedmodelforindicnaturallanguagegeneration/images.zip b/indicbartapretrainedmodelforindicnaturallanguagegeneration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c0f46c2cfebee7bb15ddda9123d39c2ffe8ec7cd --- /dev/null +++ b/indicbartapretrainedmodelforindicnaturallanguagegeneration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5228ef865a35ce88836e6367e93ddaa12b27f9b81db3aeedd4f1aad6b323111 +size 665268 diff --git a/indicbartapretrainedmodelforindicnaturallanguagegeneration/layout.json b/indicbartapretrainedmodelforindicnaturallanguagegeneration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..cedda919f2d91df67082753dbe1774c8d6f58744 --- /dev/null +++ b/indicbartapretrainedmodelforindicnaturallanguagegeneration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b540efaf4fa24759cf0201c84ba92c1344908beac5ea2a9053866839c37e6520 +size 382988 diff --git a/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_content_list.json b/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..75c6d48afe41780732184bb3c427b99770c19992 --- /dev/null +++ b/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c8d6be81fb06c88e01bde09562aef70b6781d3220b8e4d24e9a29a622acfade +size 92936 diff --git a/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_model.json b/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2ddea8f0eea6e7510ffa4a62d356266b3475dae2 --- /dev/null +++ b/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1774754691a498e3808a07945c0e3fc4adc541412b762d0bbe6d6c01e133f99 +size 109900 diff --git a/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_origin.pdf b/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..24c0a63dfb276f9e26473b99263bccfa4624afb5 --- /dev/null +++ b/inputspecificattentionsubnetworksforadversarialdetection/f9093568-5fb9-40d9-8535-0ec2731b1289_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bff42c1493885a741eee7690c888ab667ae8d6f274cb0e6995522b791bf5b17c +size 762347 diff --git a/inputspecificattentionsubnetworksforadversarialdetection/full.md b/inputspecificattentionsubnetworksforadversarialdetection/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a31e72356709dd72b82f1f1b726834336fbd6445 --- /dev/null +++ b/inputspecificattentionsubnetworksforadversarialdetection/full.md @@ -0,0 +1,347 @@ +# Input-specific Attention Subnetworks for Adversarial Detection + +Emil Biju, Anirudh Sriram, Pratyush Kumar, Mitesh M. Khapra +Indian Institute of Technology Madras + +{emilbiju@alumni, ee18b073@smail}.iitm.ac.in + +pratyushkpanda@gmail.com + +miteshk@cse.iitm.ac.in + +# Abstract + +Self-attention heads are characteristic of Transformer models and have been well studied for interpretability and pruning. In this work, we demonstrate an altogether different utility of attention heads, namely for adversarial detection. Specifically, we propose a method to construct input-specific attention subnetworks (IAS) from which we extract three features to discriminate between authentic and adversarial inputs. The resultant detector significantly improves (by over $7.5\%$ ) the state-of-the-art adversarial detection accuracy for the BERT encoder on 10 NLU datasets with 11 different adversarial attack types. We also demonstrate that our method (a) is more accurate for larger models which are likely to have more spurious correlations and thus vulnerable to adversarial attack, and (b) performs well even with modest training sets of adversarial examples. + +# 1 Introduction + +Self-attention heads are characteristic of Transformer models. Individual attention heads are interpretable in different ways. One, for a token in an input sentence, we can visualize the attention paid by a head to all other tokens. Such attention patterns are attractive linguistically and have come to define roles for attention heads (Pande et al., 2021). Two, the output of attention heads from various layers can be probed for their ability to encode information related to the "NLP pipeline" (Jawahar et al., 2019; Tenney et al., 2019; van Aken et al., 2019). Three, attention patterns of heads can represent knowledge learnt by a teacher model when distilling to a smaller student model (Jiao et al., 2020). While individual attention heads are interpretable in the above ways, it is found that attention heads in models such as BERT are over-provisioned and can be pruned. For instance, Michel et al. (2019) showed that a model with 16 attention heads per layer can be pruned to just one. Voita et al. (2019) + +and Budhraja et al. (2020) have shown similar results with different pruning techniques across tasks. + +In the above methods, while interpretation of attention heads is input-specific, pruning of heads is input-agnostic. Can these two be combined, i.e., can we prune attention heads in an input-specific manner creating opportunities for interpretation? We explore this idea to identify an altogether different utility of attention heads - namely adversarial detection which is the task of differentiating between authentic and adversarial inputs. Specifically, we propose a method to obtain an input-specific attention subnetwork (IAS), which is a subnetwork where a subset of attention heads is masked without affecting the output of the model for that input. Such subnetworks could vary across inputs representing how the model works for each input. This is particularly important for adversarial detection, as adversarial inputs do not reveal themselves in what the model outputs but may leave tell-tale signs in how the model computes this output. + +In this work, we present a technique to efficiently compute IAS and demonstrate its utility in adversarial detection with significantly improved accuracy over all current methods. To this end, we propose three sets of features from IAS. The first feature, $F_{\mathrm{mask}}$ , is simply the attention mask that identifies if an attention head is retained or pruned in IAS. The second feature, $F_{\mathrm{flip}}$ , characterizes the output of a "mutated" IAS obtained by toggling the mask used for attention heads in the middle layers of IAS. The third feature, $F_{\mathrm{lw}}$ , characterizes the outputs of IAS as obtained layer-wise with a separately trained classification head for each layer. We train a classifier, called AdvNet, with these features as inputs to predict if an input is adversarial. + +We report results on 10 NLU tasks from the GLUE benchmark (SST2, MRPC, RTE, SNLI, MNLI, QQP, QNLI) and elsewhere (Yelp, AG News, IMDb). For each of these tasks, we first create a benchmark of adversarial examples com + +bining 11 attack methodologies like Word order swap (Pruthi et al., 2019), embedding swap (Mrkšić et al., 2016), word deletion (Feng et al., 2018), etc. In total, the benchmark contains 5,686 adversarial examples across tasks and attack types. To the best of our knowledge, this dataset is the most extensive benchmark available on the considered tasks. Across all these tasks and attack types, we compare our adversarial detection technique against state-of-the-art methods such as DISP (Zhou et al., 2019), NWS (Mozes et al., 2021), and FGWS (Mozes et al., 2021). Our method establishes the best results in all tasks and attack types, with an average improvement of $7.45\%$ over the best method for each task. Our detector achieves an accuracy of $80 - 90\%$ across tasks suggesting effective defense against adversarial attacks. + +Having established the utility of attention heads for adversarial detection, we perform several ablation studies. First, we compare different combinations of the features demonstrating that they are mutually informative and thus combining them all works best. Second, we show that CutMix data augmentation (Yun et al., 2019) improves accuracy, demonstrating the first use of this method in adversarial detection in NLP tasks. Third, we show that the detector is more accurate as the size of the language model scales. This is encouraging because larger language models are expected to have increased spurious correlations and thus are more vulnerable to adversarial attacks. Fourth, we show that the detector performs well even for modest training sizes of adversarial examples, suggesting effective generalization. In summary, we propose a novel relation between attention heads and adversarial detection. The effectiveness of the resultant detector establishes that the mask of attention heads captures critical information about how a Transformer model works for a given input. + +The rest of the paper is organized as follows. We detail our core method of computing IAS in the next section. In Section 3 we discuss the features from IAS for adversarial detection. We detail the experimental setup along with the dataset creation process in Section 4. We present our results in Section 5 and conclude in Section 6. + +# 2 Input-Specific Attention Subnetworks + +In this section, we describe Input-specific Attention Subnetworks (IAS) and the computational approach to identify IAS for a given input. + +# 2.1 Notation + +We consider a BERT-style encoder model where each layer consists of multi-headed self-attention and position-wise FFN. Let an input $x$ consist of $T$ tokens each represented by $d_v$ -dimensional vectors. Let $X_j \in \mathbb{R}^{T \times d_v}$ be the representation at the input of the $j^{th}$ layer. Let $W_{ji}^Q, W_{ji}^K, W_{ji}^V$ be the projection matrices of the $i^{th}$ self-attention head in the $j^{th}$ layer. We define $Q_{ji} = X_j W_{ji}^Q, K_{ji} = X_j W_{ji}^K, V_{ji} = X_j W_{ji}^V$ as the query, key, and value corresponding to the head respectively. Each self-attention head performs a scaled dot-product attention on the query, key, and value to generate the head's output. The output of all the heads in a layer are concatenated and passed through the FFN. + +$$ +\operatorname {H e a d} _ {j i} \left(X _ {j}\right) = \operatorname {s o f t m a x} \left(\frac {Q _ {j i} K _ {j i} ^ {T}}{\sqrt {d _ {k}}}\right) V _ {j i} \tag {1} +$$ + +$$ +\operatorname {L a y e r} _ {j} \left(X _ {j}\right) = \operatorname {c o n c a t} _ {i} \left[ \operatorname {H e a d} _ {j i} \left(X _ {j}\right) \right] W _ {j} ^ {O} \tag {2} +$$ + +where $d_{k}$ is the dimensionality of each key vector and $W_{j}^{O}$ is a learnable parameter. + +A pre-trained model is fine-tuned on a specific task, such as sentiment classification. Let $\theta$ be the set of trainable network parameters which are optimized to minimize a task-specific training loss for each input $x$ : + +$$ +\mathcal {L} ^ {\theta} (x) = \mathcal {L} _ {C E} (f (x, \theta), y), \tag {3} +$$ + +where $f(\cdot)$ is the function computed by the model with parameters $\theta$ for input $x$ , $\mathcal{L}_{CE}$ is the standard cross-entropy loss function and $y$ is the expected model output for input $x$ . The overall training loss is averaged across all $|x|$ inputs, i.e., $\mathcal{L}^{\theta} = \frac{1}{|x|}\sum_{x}\mathcal{L}^{\theta}(x)$ . Let $\widehat{f} (\cdot)$ represent the output class generated from $f(\cdot)$ and $\theta^{*}$ be the set of optimal network parameters obtained after training. + +# 2.2 Representing IAS + +In an IAS, a subset of attention heads are pruned. We represent a continuous relaxation of pruning by modifying Eqn. 1 to weigh the output of each head by a scalar gating value $g_{ji} \in [0,1]$ . The $j^{th}$ layer of the modified network is given by + +$$ +\operatorname {L a y e r} _ {j} ^ {m} \left(X _ {j}\right) = \operatorname {c o n c a t} _ {i} \left[ g _ {j i} \cdot \operatorname {H e a d} _ {j i} \left(X _ {j}\right) \right] W _ {j} ^ {O} \tag {4} +$$ + +During inference, we constrain the gating values to be binary to characterize either exclusion or inclusion of a head: $g_{ji}$ is replaced by $g_{ji}^{b} \in \{0,1\}$ which defines the attention mask for the input $x$ : $g^{b}(x) = \{g_{ji}^{b}\} \in \{0,1\}^{nm}$ , where $n$ is the number + +![](images/b55e3e7b70a4655aab20b05ede2a52a2c30088abeb116d6cf5533d13a02ab43b.jpg) +Figure 1: The IAS (with active heads in green) computed for two inputs on the SST-2 task, left is authentic while right is adversarial. Notice how a small adversarial perturbation in the input leads to very distinct subnetworks being computed. The class predicted by each IAS agrees with the prediction of the full network. + +of layers and $m$ is the number of heads per layer. We represent the output class predicted by the IAS for an input $x$ by $\widehat{f}_g(x, \theta^*, g^b)$ . We call the subset of attention heads that are assigned a gating value of 1 as active heads and note that the active heads jointly define a subnetwork, called IAS. We illustrate IAS with an example. Figure 1 shows the BERT-Base model with 12 layers and 12 heads per layer. For two specific inputs, the corresponding attention masks are shown with their active heads in green. Thus, IAS is input-specific and characterizes how the model processes the input in a relatively low-dimensional space of $[0, 1]^{144}$ . + +# 2.3 Computing IAS + +We compute IAS by treating the gating values as free variables to optimize the task-specific loss (Eqn. 3) for a given input $x$ . In this optimization, the network parameters $\theta$ are frozen. Each gating value, $g_{ji}$ is defined as $g_{ji} = f_{HC}(p_{ji})$ , where $p_{ji}$ is the free variable that is optimized and $f_{HC}$ is a version of the hard concrete distribution (Louizos et al., 2017) given as $\frac{1}{1 + e^{\alpha \cdot (\log(1 - p_{ji}) - \log(p_{ji}))}}$ , where $\alpha = 6$ gave the best results for our work. Let $g$ be the gating vector as optimized by minimizing the loss for a specific input. We need to enforce that $g$ is binary. Unlike approaches by Voita et al. (2019) and Wang et al. (2020), we do not include a regularization term in the training objective. Instead, we retain only those heads for which the gating values ascend the fastest towards 1, as measured after a certain $\eta$ number of epochs. Specifically, each binary value $g_{ji}^{b}$ is + +derived from $g_{ji}$ after $\eta$ epochs as: + +$$ +g _ {j i} ^ {b} (x) = \left\{ \begin{array}{l l} 1, & \text {i f} g _ {j i} (x) \geq \beta \cdot \max (g (x)) \\ 0, & \text {o t h e r w i s e} \end{array} \right. \tag {5} +$$ + +where, $\beta (< 1)$ is a thresholding parameter and $\max(g(x))$ is the largest among $nm$ gating values. For our work, we set $\eta = 10$ and $\beta = 0.8$ . + +Two exceptional cases may arise. First, if the binary gating values of all heads in a layer are thresholded to 0, then the largest gating value in that layer is forced to 1 to ensure information flows through the network. Second, if the IAS predicts the wrong class for that input, then $\beta$ is reduced successively in steps of 0.2 until the output of the IAS is correct. For $98\%$ of the inputs, the subnetwork predicted the target class within $\beta = 0.6$ . + +# 3 Model for Adversarial Detection + +In this section, we explain how we extract features from the IAS and the design of the classifier for adversarial detection. We use the term target class to refer to the class predicted by the complete finetuned network for an input. For authentic inputs, this translates to the true class while for adversarial inputs, this refers to the adversarial class that the model is fooled into predicting. + +# 3.1 Attention mask $F_{\mathrm{mask}}$ + +The IAS identifies a subnetwork through which important information flows for a particular input. We hypothesize that this flow could be different for authentic and adversarial inputs. Thus, the first feature we extract, $F_{\mathrm{mask}}$ , is just the pre-activation value $p$ for the gating values of each head in the IAS. Thus, for a BERT-base model with 12 layers and 12 heads per layer, $F_{\mathrm{mask}}$ is a 144 dimensional vector. We also define $F_{\mathrm{bmask}}$ which uses the binary gated values $g^b$ instead of the real-values. + +# 3.2 Features from flipping heads in IAS $F_{\mathrm{flip}}$ + +Adversarial inputs rely heavily on the network architecture and specific parameter combinations to fool the model (Wang et al., 2019). Hence, slight changes to network parameters can render an adversarial perturbation non-adversarial. We thus hypothesize (and later illustrate in Section 5.2) that if we flip some of the heads in the IAS, it could significantly change the output for adversarial inputs but not by as much for authentic inputs. Which heads should we flip? We take motivation from studies that show that middle layers of BERT capture syntactic relations (Hewitt and Manning, 2019; + +Goldberg, 2019) and are multi-skilled (Pande et al., 2021), making them crucial for prediction. In contrast, the initial layers are responsible for phrase-level understanding while the last few layers are highly task-specific (Jawahar et al., 2019). Hence, we choose to flip the gating values $g^b$ of heads in the middle layers of IAS, specifically, the middle $\left\lceil \frac{n}{3} \right\rceil$ layers, i.e., we drop heads that were earlier active and include earlier inactive heads. We denote the modified gating vector after flipping as $g^f$ . + +$$ +g _ {j i} ^ {f} = \left\{\begin{array}{l l}g _ {j i} ^ {b},&\text {i f} j \leq \left\lfloor \frac {n}{3} \right\rfloor \text {o r} j \geq 2 \left\lceil \frac {n}{3} \right\rceil\\1 - g _ {j i} ^ {b},&\text {i f} \left\lceil \frac {n}{3} \right\rceil \leq j < 2 \left\lceil \frac {n}{3} \right\rceil\end{array}\right. \tag {6} +$$ + +We run each input $x$ through this mutated subnetwork and obtain a 4-dimensional feature vector, $F_{\mathrm{flip}}$ consisting of the predicted class given by $\widehat{f}_g(x,\theta^*,g^f)$ , the target class $y$ , the confidence of prediction, and a flag asserting equality between predicted and target classes. + +# 3.3 Layer-wise auxiliary features $F_{\mathrm{lw}}$ + +Studies (Wang et al., 2020; Xie et al., 2019) have shown that intermediate representations of adversarial inputs diverge from those of authentic inputs as we progress into deeper layers. This indicates that layer-wise information may be discriminative of adversarial inputs. Hence, instead of having a single classifier head processing the output of the final layer, we propose to train a classifier head at the output of each layer and use the classes predicted by them as features in adversarial detection. Specifically, on the fine-tuned complete model, we freeze the standard model parameters to $\theta^{*}$ and train $n - 1$ classifiers separately with a classifier head attached to each of the first $n - 1$ layers to predict the target class. Following the convention in Eqn. 3, the training loss for the $l^{th}$ classifier head with parameters $\Omega^l$ on input $x$ is given by: + +$$ +\mathcal {L} ^ {\Omega^ {l}} (x) = \mathcal {L} _ {C E} \left(f _ {g} ^ {l} \left(x, \theta^ {*} \cup \Omega^ {l}, \{1 \} ^ {n m}\right), y\right), \tag {7} +$$ + +where $f_{g}^{l}(\cdot)$ gives the output class computed by the $l^{th}$ classification head of a network with gating vector $g$ . The overall training loss is given by $\mathcal{L}^{\Omega} = \frac{1}{(n - 1)|x|}\sum_{x}\sum_{l}\mathcal{L}^{\Omega^{l}}(x)$ . Let $\Omega^{*}$ be the set of optimal parameters obtained after training. + +Then for a given input, we construct the IAS after flipping heads as given by the gating vector $g^{f}$ and compute the outputs of the $n - 1$ layer-wise classifiers, i.e., the output of the $l^{th}$ classifier head is given by $\widehat{f}_{g}^{l}(x,\theta^{*}\cup \Omega^{*l},g^{f})$ . We then create an $n + 1$ dimensional feature, $F_{\mathrm{lw}}$ , which consists of + +![](images/6c06a0ea4b9a1fb18d762ff068e9e6adf7cf5fc28d3566aed27df057bfdc2f75.jpg) +Figure 2: Demonstration of CutMix used to mix patches from two input feature vectors of length L each. + +the $n - 1$ output labels with two other scalars: (a) the number of these outputs that match the target class, and (b) the number of times these outputs change when traversed in the order of layers. + +In summary, we compute the features as follows. First, the model is fine-tuned on the task. Then, layer-wise classification heads are trained while keeping the model parameters frozen. Thus, given an input, we first optimize and compute IAS from which we extract $F_{\mathrm{mask}}$ . Then, the gating values of the middle layers are flipped and we extract $F_{\mathrm{flip}}$ . Finally, on the IAS with flipped heads, layer-wise classifier outputs are used to extract $F_{\mathrm{lw}}$ . + +# 3.4 Classifier for adversarial detection + +We refer to our classifier as AdvNet, which takes as input, an $(nm + n + 5)$ -dimensional vector $F(x)$ which is the concatenation of $F_{\mathrm{mask}}$ , $F_{\mathrm{flip}}$ , $F_{\mathrm{lw}}$ and generates a binary output classifying if a given input is authentic or adversarial. AdvNet consists of two 1-D convolutional layers with ReLU activation, two fully connected layers with sigmoid activation, and a final classification layer with softmax activation. Since adversarial inputs are slow and computationally expensive to generate, we employ the CutMix algorithm (Yun et al., 2019) for data augmentation. In CutMix, we slice out patches from feature vectors of multiple inputs in the training set, each of which could be authentic or adversarial, and combine them to generate new feature vectors. Their respective ground truth labels are mixed in proportion to the length contributed by each patch (see Figure 2). Formally, if $\{x_i\}_{i=1}^R$ is a random subset of training set samples, an augmented feature vector from CutMix is defined by $F(\widetilde{x}) = \text{concat}_i[F(x_i)[p_i : p_{i+1}]]$ , where $0 = p_1 < p_2 < \ldots < p_{R+1} = nm + n + 5$ and the mixed ground truth label is given by $\widetilde{y} = \sum_i y_i(p_{i+1} - p_i)$ . Using soft labels by mixing ground truth labels also offers better generalization and learning speed (Müller et al., 2019). + +# 4 Experimental Setup + +# 4.1 NLU tasks for evaluation + +We choose the following 10 standard NLU tasks for performing our experimental studies: SST-2 (Socher et al., 2013), Yelp polarity (Zhang et al., 2015a), IMDb (Maas et al., 2011), AG News (Zhang et al., 2015b), MRPC (Dolan and Brockett, 2005), RTE (Wang et al., 2018), MNLI (Williams et al., 2018), SNLI (Bowman et al., 2015), QQP1 and QNLI (Wang et al., 2018; Rajpurkar et al., 2016). We refer the reader to Appendix A for further details on these datasets. + +# 4.2 Dataset creation + +To perform adversarial detection, we require a combined set of authentic and adversarial samples for each task. First, we fine-tune a BERT-based model for each task using its publicly available training set. Then, samples from its test set for which the fine-tuned model makes correct predictions constitute the set of authentic samples for that task. Second, we generate adversarial samples by attacking the fine-tuned model using a broad set of 11 hard attack types to comprehensively test AdvNet's performance and its generalizability to diverse perturbations. The attacks include word-level attacks: deletion (Feng et al., 2018), antonyms, synonyms, embeddings (Mrkšić et al., 2016), order swap (Pruthi et al., 2019), PWWS (Ren et al., 2019), TextFooer (Jin et al., 2020) and character-level attacks: substitution, deletion, insertion, order swap (Gao et al., 2018). We use the popular TextAttack framework (Morris et al., 2020) for implementations of these attacks. Resulting perturbed samples that successfully fool our complete fine-tuned model constitute the set of adversarial samples for that task. On the combined authentic and adversarial set, we make a 70-10-20 split for creating training, validation and test sets for adversarial detection using AdvNet. Our dataset contains a total of 5,686 adversarial inputs across tasks and attack types and is publicly available at https://github.com/emilbiju/Bert-Paths. + +# 4.3 Implementation details + +Our adversarial detection model, AdvNet, contains two 1D convolutional layers followed by two fully connected layers. The two convolutional layers + +have a kernel size of 3 and generate 32 and 16 output feature maps. The two fully connected layers have output dimensions of 32 and 16 with dropout rates of 0.1. We use the binary cross-entropy loss function and the Adam optimizer with a learning rate of 0.001. We train the model for 100 epochs with early stopping on an NVIDIA K80 GPU. + +![](images/7ad01bd2db94b8c8db83def26147490f6c145bcd2034e55bf5e12abc3b71bb0e.jpg) +Figure 3: The trajectory of gating values of individual heads during the optimization to compute IAS. Only a few heads (in green) reach the threshold and remain active in IAS. + +![](images/654be35c2d0a48997f62aafecbcf0728e0f6d817c0e262ac98404468228c5541.jpg) +Figure 4: Fraction of inputs with a given number of active heads from BERT-Base. Notice that in most cases, only 20-40 heads out of 144 remain active. + +# 5 Results & Discussion + +In this section, we first analyse the IAS (Section 5.1) and the constituent features of AdvNet (Section 5.2). We then perform a comparative study with state-of-the-art adversarial detection methods (Section 5.3). Lastly, we perform ablation studies to understand the effect of task, model size, feature combinations and training set attacks on the performance of AdvNet (Section 5.4). Unless otherwise stated, the plots pertain to experiments on the SST-2 dataset with the BERT-Base model. + +![](images/f73afd1c496fd0dd1efad44210e7d6a64be69be61b2fe10d0f20a6b9d64e0a86.jpg) +Figure 5: Projections with t-SNE on the attention mask for (a) SST-2, (b) AG News, and (c) authentic and adversarial inputs. Projection of attention masks are strongly discriminative of class and weakly of adversarial inputs. + +![](images/f94d8a4ef1db6f276b735a34a07247511cebf5521789218f68b5e9fba76bcd1c.jpg) + +![](images/1761546b2f117aa994711437235938088553a5c5a53e28e41a9c7e87e8db7211.jpg) + +# 5.1 Active heads in IAS + +We first check the number of active heads in IAS for a given input. To do so, we plot the progression of gating values with epochs when optimizing them for a given input (see Figure 3). We observe that only a small fraction of heads (shown in green) are active at the end of the optimization process, thus resulting in a sparse vector. The green curves that are below the blue (threshold) line correspond to the two exceptional cases discussed at the end of Section 2.3. While the above plot was for a single randomly selected input, in Figure 4 we show the fraction of inputs with a given number of active heads for all the datasets used in this work. The relatively small modes and the right skew distributions imply that the extracted IAS are often sparse. + +# 5.2 Feature-specific analysis + +We now analyze the individual effectiveness of the three features proposed in Section 3. + +Attention mask $(F_{\mathrm{mask}})$ . We first show that the attention mask is strongly correlated with the input's target class. To do so, we project the binary vector $g(x)$ for each authentic input $x$ onto a 2D-plane using the t-SNE method (van der Maaten and Hinton, 2008) as shown in Figure 5(a), (b). We observe that inputs from different classes separate into distinctly separate clusters. Thus, the attention mask is discriminative of an input's target class as the choice of active heads depends on it. Interestingly, even if the attention computed for the same word location in two distinct inputs are the same, the heads attending to each word and responsible for generating different output classes are different. + +We present a similar plot with both authentic and adversarial inputs in Figure 5(c). We note that adversarial inputs group together with the authentic inputs whose true class is the same as their adversarial/target class. Within clusters of the same target + +![](images/4283b901f817dd5e98f75613d8713c5c7683ff6bee659381f70c31250db63b44.jpg) +Figure 6: CDF over the target class output logit of the mutated IAS. The large area below the green curve with logit value $< 0.5$ corresponds to a large number of adversarial inputs whose mutated IAS predict a non-target class. + +class, there is a only a moderate distinction between adversarial and authentic inputs. But we show in further experiments that a better separation is possible when the complete nm-dimensional vector is used as opposed to a 2D projection. + +Features from flipping heads in IAS $(F_{\mathrm{flip}})$ . For each of the datasets, we compute the percentage of authentic and adversarial inputs which generated non-target class predictions. We find that the mutated IAS after flipping heads in the middle layers is more likely to predict the correct target class output for an authentic input than an adversarial one. We also study the confidence of the mutated IAS in making these predictions using a CDF plot (Figure 6) over the output logit corresponding to the target class. + +We observe that $F_{\mathrm{flip}}$ predicts the target class with higher confidence in case of authentic inputs than adversarial ones. Specifically, only $9\%$ of authentic inputs had prediction confidence lower than 0.85 as compared to $20\%$ of adversarial inputs. Further, it predicts a non-target class with high confidence for some adversarial inputs. For + +![](images/f9777c93740fa7fe296b96a943abde7297cce22aaf2a9b6875ca84379cfc1933.jpg) +Figure 7: Fractions of authentic and adversarial inputs that generate a non-target class prediction at each layer-wise classification head. + +example, $30\%$ of adversarial inputs with prediction confidence higher than 0.85 gave the wrong prediction. In contrast, flipping the initial/final layers of the IAS instead of the middle layers did not significantly change the model prediction for either authentic or adversarial samples, making it difficult it to distinguish them. + +Layer-wise auxiliary features $(F_{\mathrm{lw}})$ . In Figure 7, we plot the distribution of auxiliary output mismatches (non-target class predictions) across network layers. We observe that for most layers, the fraction of authentic inputs having target class predictions is higher than adversarial inputs. The differences are particularly large for the last few layers. On average across datasets, we observed that $52.5\%$ of adversarial inputs generate more than 2 auxiliary output predictions that do not match the target class while only $23.1\%$ of authentic inputs do the same. Additionally, when traversing the layerwise outputs in order, we observed that the output predictions of adversarial inputs switch among possible classes more often than for authentic inputs (see Appendix D). These observations justify the features that we include in $F_{\mathrm{lw}}$ . + +Based on the above analyses, we have demonstrated that all 3 features of IAS are informative for adversarial detection. Our results in the next section corroborate these findings. + +# 5.3 Performance on Adversarial Detection + +Following the observations in the previous section, we use AdvNet with the identified features for adversarial detection. We compare the performance of AdvNet with the current state-of-the-art approaches for detecting adversarial inputs for + +BERT-based models, viz., FGWS (Mozes et al., 2021), NWS (Mozes et al., 2021), DISP (Zhou et al., 2019) and FreeLB (Zhu et al., 2019). We briefly describe these methods in Appendix C. + +As seen in Table 1, AdvNet significantly outperforms existing approaches across all 10 datasets with an average improvement of $7.45\%$ . We report an improvement of $6.53\%$ for the 3 sentiment analysis datasets (SST-2, Yelp, IMDb), $8.05\%$ for the 4 NLI datasets (RTE, SNLI, MNLI, QNLI) and $6.98\%$ for the 2 paraphrase detection datasets (MRPC, QQP) over the respective best methods. + +Another baseline that we compare with is Certified Robustness Training (Jia et al., 2019). While this work is not aimed at adversarial detection, it provides bounds on model robustness for word substitution perturbations. For making a comparison with our work, we note that the fraction of adversarial samples that are correctly detected as adversarial translates to robustness for binary classification tasks. We report robustness of $87\%$ for word substitution-based attacks and $81\%$ across all 11 attacks for IMDb, while the best upper bound obtained through certified robustness training is $75\%$ . + +When comparing across datasets, we observe that AdvNet performs better on simpler sentence labelling datasets like SST-2 and AG News when compared to more complex tasks like RTE and MRPC which require comparison between sentences. Existing work (Pande et al., 2021) shows that for simpler tasks, the BERT heads perform discrete non-overlapping roles, while for complex tasks, there is greater overlap in head roles and a few heads perform more than one role. We hypothesize that this nature implies that the attention masks for different inputs even belonging to the same type (authentic or adversarial) can vary widely. This reduces the consistency of features across input types making the detection harder. Nevertheless, AdvNet establishes state-of-the-art results across datasets. A detailed analysis of the performance of AdvNet across tasks and attack types is provided in Appendix E. + +# 5.4 Ablation studies + +We now evaluate how variations in model size, training set size, and the choice of feature combinations effect performance of AdvNet. + +Effect of model size. IAS can be computed for Transformer networks of any size. We compare BERT-Small and BERT-Base models in terms of + +
ModelSST-2YelpAG NewsMRPCIMDbSNLIRTEMNLIQQPQNLI
FGWS71.9378.3670.4169.8575.9875.4171.2360.2373.5278.14
NWS70.3174.7265.6268.0265.7271.8264.2756.9470.2074.58
DISP68.7370.1566.3862.2275.2372.9266.4059.3469.8676.92
FreeLB77.6082.5475.5572.4179.8579.8064.2958.1065.6976.40
AdvNet
w/ BERT-Small78.5776.7278.6375.0574.0972.0773.6464.2668.7174.47
w/ BERT-Base90.7487.6891.7884.6181.1882.5080.4372.6175.2786.07
+ +![](images/460ea893e1db47bf41d0ab339331b63e3092dfda927bbc1a15564639098eb8de.jpg) +Figure 8: Effect of training set size on accuracy of adversarial detection with AdvNet. + +performance of AdvNet as shown in Table 1. We observe that, across datasets, AdvNet performs better in detecting adversarial inputs fed to the larger BERT-Base model (108M parameters) as opposed to the smaller BERT-Small model (25M parameters). The increase in accuracy averaged across tasks is a significant $10.76\%$ . We hypothesize that this is because models with more layers encode more information and allow for a better build-up of semantic information which means that individual heads play more discrete roles. This better performance for the larger model is encouraging as the more accurate and larger language models are expected to be more vulnerable to adversarial attacks. + +Effect of training set size. In Figure 8, we show how the performance of AdvNet changes as the amount of training data changes. We observe that AdvNet performs well even when it uses only a fraction of the training set. Specifically, even at $40\%$ of the training examples used, AdvNet outperforms the results obtained with existing state-of-the-art models on most tasks. This suggests that the CutMix data augmentation is effective and the AdvNet model is sample-efficient. This is particularly important because designing adversarial examples for each dataset remains a challenging task. + +Table 1: Comparison of the adversarial detection accuracy of AdvNet using features extracted from fine-tuned BERT-Small and BERT-Base models with other state-of-the-art approaches for adversarial detection. + +
DatasetsFmaskFflipFlwBinw/o CM
SST-282.8774.0764.7985.5982.23
Yelp80.2362.0866.0184.3083.57
AG News83.1176.4157.1490.4783.11
MRPC76.3568.8259.4080.2777.35
IMDb74.5460.0055.4573.7874.23
SNLI80.8357.9158.8375.6470.41
RTE74.4460.8856.6777.2174.06
MNLI66.9551.3060.0066.8569.95
QQP66.4161.6362.6471.8864.50
QNLI79.6555.6959.3681.4273.11
+ +Table 2: Results on feature combinations. + +Using different feature combinations. We had shown that each of the three features are informative in Section 5.2. In Table 2, we report the performance of AdvNet by ablating various model components. The first 3 columns report accuracies when only one of the three features is passed at a time to the model. We observe that $F_{\mathrm{mask}}$ performs better than $F_{\mathrm{flip}}$ and $F_{\mathrm{lw}}$ . This suggests that the attention mask is the most important feature input to the model. We analyze the roles of individual gating values using GradCAM (see Appendix F). Next, we test the performance when the boolean attention mask $F_{\mathrm{bmask}}$ is used instead of the real-valued vector $F_{\mathrm{mask}}$ along with $F_{\mathrm{flip}}$ and $F_{\mathrm{lw}}$ . The lower accuracy indicates that the real values are more informative. Finally, we test the model performance when CutMix is not used and conclude that augmenting the training set using CutMix provides higher accuracy as seen in the last row of Table 1 which uses all 3 features along with CutMix. + +Defense Transferability Analysis. Next, we perform a study to understand how well the model can perform on unseen attack types. For this purpose, we train AdvNet with samples from only $x\%$ of the 11 attack types and report results both on + +test samples from the remaining attack types and the complete test set for $x \in \{25, 50, 75\}$ in Table 3. We observe that even when AdvNet is trained with only $75\%$ of the attack types, the test results on new attacks outperform existing approaches for most datasets, thus showing that our model can generalize to unseen attack methods. Besides, at all three values of $x$ , the results on the complete test set closely agree with the results on the new attack types. This indicates that the reduction in accuracy at lower $x$ values can largely be attributed to a smaller training set than to a lack of defense transferability. + +
Dataset25%50%75%
SST-2(57.8, 58.9)(69.9, 68.4)(82.7, 80.7)
Yelp(63.1, 61.8)(70.3, 69.9)(77.8, 78.4)
AG News(63.7, 62.1)(71.4, 69.9)(83.6, 78.4)
MRPC(63.2, 60.1)(73.2, 74.5)(81.5, 82.3)
IMDb(66.8, 64.8)(71.6, 73.1)(77.4, 79.1)
SNLI(57.9, 57.6)(67.2, 66.6)(73.4, 72.3)
RTE(63.8, 62.4)(70.8, 69.7)(76.4, 75.5)
MNLI(57.4, 58.8)(62.3, 61.3)(67.0, 68.9)
QQP(59.7, 60.2)(64.0, 64.2)(69.0, 69.6)
QNLI(61.8, 60.6)(69.3, 67.2)(75.7, 77.5)
+ +Table 3: Defense transferability study of AdvNet with varying percentages of attack types included in the train set. Each tuple contains the test accuracy on new attack types and on all attack types respectively. + +In summary, our results show that (a) the 3 IAS features are individually informative, (b) AdvNet significantly improves on baseline methods across datasets, (c) AdvNet performance improves with model size and does not drop much on reducing training sets, (d) AdvNet achieves the best performance when all 3 features are used along with CutMix augmentation, and (e) AdvNet generalizes well to new attack types. + +# 6 Conclusion and future work + +In this work, we present an altogether new utility of attention heads in Transformer networks - to detect adversarial attacks. We defined input-specific attention subnetworks (IAS) and proposed a method to compute them efficiently. We extracted 3 features from IAS and showed their utility in distinguishing adversarial samples from authentic ones. We demonstrated that our approach significantly improves the state-of-the-art accuracy across datasets and attack types. Our work suggests that input- + +specific model perturbations provide strong signals to interpret Transformer-based models such as large language models. Further, the sparse nature of the identified IAS indicate opportunities for input-specific model optimization. In future work, we would like to extend this study to tasks beyond NLU, including vision and speech-related tasks. + +# Discussion on Ethics and broader impact + +One of the main challenges with deep neural models is their lack of explainability. These models typically have inherent biases resulting from the training data, parameter combinations and other factors that lead to unexpected responses to certain inputs. This is further complicated when adversarial agents target to manipulate the output of deep neural models. We see our work on creating and using attention subnetworks for adversarial detection as a part of the broader effort towards Responsible AI. Such a solution is particularly important in situations where deep neural models make decisions that affect physical safety, digital security and equal opportunity. However, we acknowledge that this additional visibility into the model comes at an added cost - inference under uncertainty of adversarial detection is more expensive. We encourage system designers to trade-off computational and runtime considerations for security when deploying such solutions. + +# Acknowledgements + +We thank Samsung and IITM Pravartak for supporting our work through their joint fellowship program. We also wish to thank the anonymous reviewers for their efforts in evaluating our work and providing us with constructive feedback. + +# References + +Emil Biju, Anirudh Sriram, Mitesh M. Khapra, and Pratyush Kumar. 2020. Joint transformer/RNN architecture for gesture typing in indic languages. In Proceedings of the 28th International Conference on Computational Linguistics, pages 999-1010, Barcelona, Spain (Online). International Committee on Computational Linguistics. +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. + +Aakriti Budhraja, Madhura Pande, Preksha Nema, Pratyush Kumar, and Mitesh M. Khapra. 2020. On the weak link between importance and prunability of attention heads. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3230-3235, Online. Association for Computational Linguistics. +William B. Dolan and Chris Brockett. 2005. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005). +Shi Feng, Eric Wallace, Alvin Grissom II, Mohit Iyyer, Pedro Rodriguez, and Jordan Boyd-Graber. 2018. Pathologies of neural models make interpretations difficult. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 3719–3728, Brussels, Belgium. Association for Computational Linguistics. +Ji Gao, Jack Lanchantin, Mary Lou Soffa, and Yanjun Qi. 2018. Black-box generation of adversarial text sequences to evade deep learning classifiers. In 2018 IEEE Security and Privacy Workshops (SPW), pages 50-56. IEEE. +Yoav Goldberg. 2019. Assessing bert's syntactic abilities. arXiv preprint arXiv:1901.05287. +John Hewitt and Christopher D. Manning. 2019. A structural probe for finding syntax in word representations. 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 4129-4138, Minneapolis, Minnesota. Association for Computational Linguistics. +Ganesh Jawahar, Benoit Sagot, and Djamé Seddah. 2019. What does bert learn about the structure of language? In ACL 2019-57th Annual Meeting of the Association for Computational Linguistics. +Robin Jia, Aditi Raghunathan, Kerem Goksel, and Percy Liang. 2019. Certified robustness to adversarial word substitutions. In EMNLP. +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, Online. Association for Computational Linguistics. +Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. 2020. Is BERT really robust? A strong baseline for natural language attack on text classification and entailment. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, + +USA, February 7-12, 2020, pages 8018-8025. AAAI Press. +Christos Louizos, Max Welling, and Diederik P Kingma. 2017. Learning sparse neural networks through $l\_0$ regularization. arXiv preprint arXiv:1712.01312. +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. +Paul Michel, Omer Levy, and Graham Neubig. 2019. Are sixteen heads really better than one? In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +John X. Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. 2020. Textattack: A framework for adversarial attacks, data augmentation, and adversarial training in nlp. +Maximilian Mozes, Pontus Stenetorp, Bennett Kleinberg, and Lewis Griffin. 2021. Frequency-guided word substitutions for detecting textual adversarial examples. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 171-186, Online. Association for Computational Linguistics. +Nikola Mrkšić, Diarmuid O Seaghdha, Blaise Thomson, Milica Gašić, Lina Rojas-Barahona, PeiHao Su, David Vandyke, Tsung-Hsien Wen, and Steve Young. 2016. Counter-fitting word vectors to linguistic constraints. arXiv preprint arXiv:1603.00892. +Rafael Müller, Simon Kornblith, and Geoffrey E Hinton. 2019. When does label smoothing help? In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +Madhura Pande, Aakriti Budhraja, Preksha Nema, Pratyush Kumar, and Mitesh M Khapra. 2021. The heads hypothesis: A unifying statistical approach towards understanding multi-headed attention in bert. arXiv preprint arXiv:2101.09115. +Danish Pruthi, Bhuwan Dhingra, and Zachary C Lipton. 2019. Combating adversarial misspellings with robust word recognition. arXiv preprint arXiv:1905.11268. +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. + +Shuhuai Ren, Yihe Deng, Kun He, and Wanxiang Che. 2019. Generating natural language adversarial examples through probability weighted word saliency. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1085-1097, Florence, Italy. Association for Computational Linguistics. +R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra. 2017. Grad-cam: Visual explanations from deep networks via gradient-based localization. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 618-626. +Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631-1642, Seattle, Washington, USA. Association for Computational Linguistics. +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. +Betty van Aken, Benjamin Winter, Alexander Löser, and Felix A. Gers. 2019. How does bert answer questions? a layer-wise analysis of transformer representations. CIKM '19, page 1823-1832, New York, NY, USA. Association for Computing Machinery. +Laurens van der Maaten and Geoffrey Hinton. 2008. Visualizing data using t-sne. Journal of Machine Learning Research, 9(86):2579-2605. +Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. 2019. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. arXiv preprint arXiv:1905.09418. +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. +Jingyi Wang, Guoliang Dong, Jun Sun, Xinyu Wang, and Peixin Zhang. 2019. Adversarial sample detection for deep neural network through model mutation testing. In 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), pages 1245-1256. IEEE. +Yulong Wang, Hang Su, Bo Zhang, and Xiaolin Hu. 2020. Interpret neural networks by extracting critical subnetworks. IEEE Transactions on Image Processing, 29:6707-6720. + +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence 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. +Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan L Yuille, and Kaiming He. 2019. Feature denoising for improving adversarial robustness. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 501-509. +Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. 2019. Cutmix: Regularization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6023-6032. +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015a. Character-level Convolutional Networks for Text Classification. arXiv:1509.01626 [cs]. +Xiang Zhang, Junbo Jake Zhao, and Yann LeCun. 2015b. Character-level convolutional networks for text classification. In NIPS. +Yichao Zhou, Jyun-Yu Jiang, Kai-Wei Chang, and Wei Wang. 2019. Learning to discriminate perturbations for blocking adversarial attacks in text classification. 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 4904-4913, Hong Kong, China. Association for Computational Linguistics. +Chen Zhu, Yu Cheng, Zhe Gan, S. Sun, Tom Goldstein, and Jingjing Liu. 2019. Freelb: Enhanced adversarial training for language understanding. *ArXiv*, abs/1909.11764. + +# A Datasets used for authentic examples + +The 10 datasets used in this work were listed in Section 4.1. Here, we provide additional details about these datasets. SST-2 (Socher et al., 2013), Yelp polarity (Zhang et al., 2015a) and IMDb (Maas et al., 2011) are binary sentiment classification datasets. AG News (Zhang et al., 2015b) consists of news headlines classified into one of 4 categories (world, sports, business, sci/tech) and MRPC (Dolan and Brockett, 2005) is a paraphrase dataset which contains sentence pairs with binary labels indicating whether they are semantically equivalent or not. RTE (Wang et al., 2018), MNLI (Williams et al., 2018), SNLI (Bowman et al., 2015) contain sentence pairs with labels indicating whether one sentences entails, contradicts or is neutral with respect to the other sentence. QQP is again a paraphrase dataset but unlike MRPC which contains sentences, it contains question pairs taken from Quora with binary labels indicating whether they are semantically equivalent or not. QNLI contains question-context pairs with a binary label indicating whether the context sentence contains the answer to the question or not. + +# B Examples of adversarial attacks + +In Table 4, we provide examples for each of the 11 attack types that we use to generate adversarial inputs for this work. + +# C Other methods for Adversarial Detection + +We briefly describe the four methods that we compare with in Table 1. + +- FGWS (Mozes et al., 2021): Here, a word frequency-guided approach is used to identify infrequent words in an input sentence and replace them with more frequent, semantically similar words. Then, the difference in prediction confidence of the Transformer-based model between the original and substituted sentences is considered. If this value is above a threshold, the sentence is predicted to be adversarial. +- NWS: This is the naive word substitution baseline used in Mozes et al. (2021). Here, each out-of-vocabulary word in an input sentence is replaced with a random word from a set of semantically related words, following which the same process as above is used to predict input authenticity. + +- DISP (Zhou et al., 2019): In this approach, a BERT-based perturbation discriminator predicts whether each token in the input sentence is authentic or perturbed. If none of the tokens are predicted to be perturbed, the input sentence is considered authentic. +- FreeLB (Zhu et al., 2019): This is an adversarial training approach where adversarial perturbations are added to word embeddings and the resulting adversarial loss is minimized to promote higher invariance in the embedding space. +- Certified Robustness Training (Jia et al., 2019): This approach uses Interval Bound Propagation (IBP) to obtain an upper bound on the worst-case loss resulting from any word substitution-based perturbation. This has been applied to CNN and LSTM-based language models. + +# D Analysing $F_{\mathrm{flip}}$ and $F_{\mathrm{lw}}$ + +In the second column of Table 5, for each of the datasets, we show the percentage of authentic and adversarial inputs which generated non-target class predictions. Further, in the third column of Table 5 we show the percentage of (authentic, adversarial) inputs whose layer-wise outputs showed more than one switch. These results show that the $F_{\mathrm{flip}}$ and $F_{\mathrm{lw}}$ are individually informative. + +# E Adversarial detection accuracy for different attack types + +In Table 6, we present the breakup of model accuracy across individual attack types. We observe that for text classification tasks like SST-2, Yelp and AG News the accuracy for Embedding and Synonym swap attack types are much higher compared to other datasets. We also note that in case of both word and character-level attacks, Deletion and Substitution operations are the ones with least detection accuracy across almost all datasets. Finally, we observe that the performance for detecting adversarial inputs generated by PWWS and TextFooer attacks remain fairly consistent across datasets. + +# F Refereeing heads in adversarial detection + +In this section, we explore the influence of each gating value in generating the prediction for our adversarial detection model. We make use of the GradCAM (Selvaraju et al., 2017) approach to identify critical neurons in the input layer of AdvNet that + +
Attack TypePerturbed Text
Original Textit's a charming and often affecting journey.
Word-level attacks
Deletionit's a _ and often affecting journey.
Antonymsit's a repulsive and often affecting journey.
Synonymsit's a charming and often affecting passage.
Embeddingsit's a charming and quite affecting journey.
Order Swapit's charming and affecting a often journey.
PWWSit's a entrance and often strike journey.
TextFollowerit's a charming and _ affecting journey.
Original Texta sometimes tedious film.
Character-level attacks
Substitutiona sometimes tidyous fylm.
Deletiona som(times tedio_s film.
Insertiona sometimeDs tvedious film.
Order Swapa smoetimes tedoius film.
+ +Table 4: Examples of 11 attack types used for adversarial data creation. `` represents a deleted character and there is no character present at that position in the adversarial sample. + +
DatasetNon-target o/p (Mutated)Switches>1 (Layer-wise)
SST-2(12.3, 34.2)(37.9, 54.8)
IMDb(0.33, 2.18)(0.16, 1.45)
Yelp(3.8, 5.3)(0.83, 1.08)
AG News(6.6, 22.8)(3.2, 17.0)
MRPC(21.3, 24.3)(10.3, 8.77)
RTE(24.5, 22.2)(44.2, 50.9)
SNLI(2.83, 96.0)(11.6, 41.0)
MNLI(11.0, 24.8)(24.3, 42.5)
QQP(3.2, 1.3)(6.2, 6.8)
QNLI(5.7, 1.0)(13.8, 11.1)
+ +Table 5: Percentages of (authentic, adversarial) inputs whose (a) mutated subnetworks generated non-target class predictions; (b) layer-wise outputs showed more than one switch. + +have large gradients from the target class (authentic or adversarial) flowing through them. Among these, we consider neurons that correspond to the gating values, i.e., $F_{\mathrm{mask}}$ and call the heads corresponding to them as refereeing heads. From Figure 9, we observe that word swap attacks like antonyms, synonyms, and embeddings require a greater number of refereeing heads, while character-level attacks need fewer. This is because character-level changes make the token invalid, i.e., the model treats it as a unknown token absent in the vocabulary. Since this changes the input embedding sequence more dramatically (Biju et al., 2020), small deviations from standard gating patterns are sufficient to mislead the model leading to fewer refereeing heads. Since introducing synonym and embedding based perturbations change the embeddings input to the model by a smaller extent, larger deviations from the gating pattern are required to block or pass selective chunks of information to mislead the model. + +
Dataset#Adv samplesWord-level attacksCharacter-level attacks
DELANTSYNEMBEDSWAPPWWSTFSUBDELINSSWAP
SST-27390.840.960.950.960.750.810.760.920.800.870.89
Yelp5890.750.920.920.960.880.800.950.930.770.880.88
AG News8290.880.960.920.960.820.830.840.890.840.850.88
MRPC7120.750.750.90.720.940.840.820.860.790.760.92
IMDb3210.800.760.850.890.800.820.810.940.750.960.79
SNLI12620.610.800.780.880.780.760.790.850.880.650.83
RTE5410.750.840.860.870.790.770.730.820.760.820.82
MNLI5480.670.800.720.850.780.800.760.780.800.860.76
QQP3070.700.820.740.800.750.760.740.780.810.860.77
QNLI3950.800.900.920.920.900.820.860.820.860.820.82
+ +Table 6: Accuracies across datasets for each attack type. Legend: SUB-substitution, DEL-deletion, SYN-synonym, EMBED-embedding, INS-insertion, SWAP-order swap, TF-TextFooler. Refer Section 4.1 for descriptions of attack types. The second column provides the number of adversarial samples generated by us for each task across all 11 attack types. + +![](images/4413f538886f11bedd5b4734a449e37037ec86432848c873c37174e78dfea6ab.jpg) +Figure 9: Fraction of refereeing heads used by the adversarial detection model across various adversarial attack types. The split of these across 4 layer subsets is also shown. \ No newline at end of file diff --git a/inputspecificattentionsubnetworksforadversarialdetection/images.zip b/inputspecificattentionsubnetworksforadversarialdetection/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3895e85db234dc4260c26cce574dc6471e8846d3 --- /dev/null +++ b/inputspecificattentionsubnetworksforadversarialdetection/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a5e1781b727e52a32478a8dbf7cf1981ea0bea1737d32e62e9e426c334f61d3 +size 839552 diff --git a/inputspecificattentionsubnetworksforadversarialdetection/layout.json b/inputspecificattentionsubnetworksforadversarialdetection/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e5113d50e75f171a1b66a535fbe399a04ff018da --- /dev/null +++ b/inputspecificattentionsubnetworksforadversarialdetection/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d88ba346e3e8a0ffcd819f916d2ee7903f5ebd57943989c2b2d7da100d59d48 +size 454823 diff --git a/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_content_list.json b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..45e5d31854ff1ff2fb461c48f66b6caae6b3720d --- /dev/null +++ b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f546e7994967f15164d760afa7ceb3ac52f34c27cf78eae42caad5991d5b338 +size 95112 diff --git a/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_model.json b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b38e84313bb9fba89272d01fbb5970b63a4c1bd3 --- /dev/null +++ b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fea9ba3e43b0f3af6c20bcc017979b49117f8ff69ed1a04846ce7185bfdbf37 +size 114779 diff --git a/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_origin.pdf b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..eddeb4f382010727abf4af6cd83eeacade7a2689 --- /dev/null +++ b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/323c0938-8a1a-47c3-a5ca-77c01545ba88_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06d9a2d610fd4291efff680a57285b154dafcd5af15d2ddd1f5daec83372ee9b +size 659066 diff --git a/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/full.md b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d5b66841d03137a34503157d409859b58a6b09eb --- /dev/null +++ b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/full.md @@ -0,0 +1,416 @@ +# Interpretable Research Replication Prediction via Variational Contextual Consistency Sentence Masking + +Tianyi Luo $^{1}$ , Rui Meng $^{2}$ , Xin Eric Wang $^{1}$ , Yang Liu $^{1}$ + +$^{1}$ Computer Science and Engineering, University of California, Santa Cruz $^{2}$ Lawrence Berkeley National Laboratory, University of California, Berkeley + +{tluo6, xwang366, yangliu}@ucsc.edu + +rmeng@1bl.gov + +# Abstract + +Research Replication Prediction (RRP) is the task of predicting whether a published research result can be replicated or not. Building an interpretable neural text classifier for RRP promotes the understanding of why a research paper is predicted as replicable or non-replicable and therefore makes its real-world application more reliable and trustworthy. However, the prior works on model interpretation mainly focused on improving the model interpretability at the word/phrase level, which are insufficient especially for long research papers in RRP. Furthermore, the existing methods cannot utilize a large size of unlabeled dataset to further improve the model interpretability. To address these limitations, we aim to build an interpretable neural model which can provide sentence-level explanations and apply weakly supervised approach to further leverage the large corpus of unlabeled datasets to boost the interpretability in addition to improving prediction performance as existing works have done. In this work, we propose the Variational Contextual Consistency Sentence Masking (VCCSM) method to automatically extract key sentences based on the context in the classifier, using both labeled and unlabeled datasets. Results of our experiments on RRP along with European Convention of Human Rights (ECHR) datasets demonstrate that VCCSM is able to improve the model interpretability for the long document classification tasks using the area over the perturbation curve and post-hoc accuracy as evaluation metrics. + +# 1 Introduction + +Scientific research results that cannot be reproduced are unreliable and negatively impact the development of science. Therefore, it is important to know whether a published research result can be replicated or not. To this end, domain researchers have conducted several direct replication projects in contemporary published social science studies + +![](images/c498fb8749fd420e3c48ba0e1323d6fbeca253d9b87140402c459d3212de8257.jpg) +Figure 1: (a) Given the text information of a research paper, Research Replication Prediction (RRP) task predicts whether the paper can be reproduced or not. (b) Having the same input as (a), our VCCSM model can keep the important sentences (through masking unimportant ones) which are related to reproducibility. + +(Camerer et al., 2016, 2018; Ebersole et al., 2016; Klein et al., 2018; Collaboration et al., 2015). Such direct replication, however, is very time-consuming and expensive. A much more efficient and cheaper alternative, Machine Learning (ML), is utilized for predicting research replication (Dreber et al., 2019; Yang, 2018; Altmejd et al., 2019; Luo et al., 2020). In this paper, we model the task of predicting research replication as a binary classification problem and name it Research Replication Prediction (RRP) task which is shown in Figure 1(a). Nonetheless, applying the neural network models in the context of RRP faces two challenges. The first challenge is that the existing neural network models used in RRP are characterized as a black box because their predictions are hardly understandable. Without intelligible explanations for the predictions, results of RRP may not be widely accepted as reliable and trustworthy. Despite the progress in interpretable machine learning (Hechtlinger, 2016; Smilkov et al., 2017; Singh et al., 2018; Serrano + +and Smith, 2019; Han et al., 2020; Chen and Ji, 2020; Chen et al., 2021), the existing works mostly focus on improving the interpretability only at the word/phrase level which might work well for short documents. However, research papers in our RRP problem are usually lengthy (the average length of words is about 10,000). Building interpretable models for long documents is a challenging task due to the massive amount of textual information. + +The second salient challenge is the small size of labeled dataset in RRP due to the high cost (e.g., funding requirement, human labor, etc.) of direct replications. Training an interpretable neural network also requires a large size of labeled dataset and weakly supervised learning can help utilize the unlabeled dataset. Although weakly supervised approaches have been utilized to make use of a large size of unlabeled dataset (Berthelot et al., 2019; Xie et al., 2019; Chen et al., 2020), they have mainly focused on improving the prediction performance but not the interpretability. We therefore aspire to build a weakly supervised interpretable neural text classifier for predicting research replication that can leverage the existence of the large corpus of unlabeled articles to boost up both the prediction performance and the interpretability. + +To tackle the first challenge mentioned above, we built an interpretable neural network model which can automatically select key sentences instead of words/phrases by adding a variational sentence masking layer on the input layer which is a simple modification of network architecture but can effectively improve the model interpretability. By adding a variational sentence masking, we can adopt information bottleneck framework (Tishby et al., 2000; Alemi et al., 2016) to train the model and improve both the prediction performance and interpretability by identifying important sentences. In addition, we hypothesize that whether to mask a sentence or not should also depend on its context (whether other sentences in the same paper are masked) in the case for long research papers because the information provided by extracted key sentences should not be redundant. Therefore, we invoke a contextual sentence masking approach using the LSTM model (Hochreiter and Schmidhuber, 1997). The extracted key sentences after masking are considered as our interpretable outcomes for each research paper. + +To resolve the second challenge, we developed a new weakly supervised method which makes use + +of unlabeled dataset to improve both the prediction performance and interpretability. Specifically, we adopted the consistency training methods (Laine and Aila, 2016; Tarvainen and Valpola, 2017; Xie et al., 2019) which regularize model predictions to be invariant to the small noises added to the input. Consistency training were used to improve the prediction performance with the help of unlabeled dataset (Xie et al., 2019). In this paper, to improve the interpretability along with the prediction performance, we propose a consistency training method with sentence masking through replacing the noises-added input of unlabeled dataset by masked sentences. Specifically, for each unlabeled research paper, we generate the first prediction by using only the extracted key sentences after the sentence masking. Then, we generate the second prediction using all the sentences in the research paper without masking. The consistency check is then imposed upon the two predictions by minimizing the difference between them. Through the consistency training, an extra large size of unlabeled dataset can be utilized to make model continually learn how to extract the key sentences of a research paper so that the model interpretability is further improved. + +In sum, our main contribution is the proposal of a variational contextual consistency sentence masking (VCCSM) method as shown in Figure 1(b) that is able to (1) extract the key sentences based on the context of a research paper and (2) leverage the large number of unlabeled sets of papers using a consistency checking mechanism. We present experimental results to validate the usefulness of our proposed methods on two neural network models, LSTM (Hochreiter and Schmidhuber, 1997) and BERT (Devlin et al., 2018) on the RRP along with ECHR datasets. In particular, we find VCCSM is able to improve both the replication prediction accuracy and the interpretability for long research papers and general long documents. + +# 2 Related Work + +Blackbox Research Replication Prediction Research Replication Prediction, knowing whether a published research result is replicable or not, is important. Recently, several large scale of direct replication projects have been conducted in social science studies to alleviate the replication crisis. But the cost of direct replication is too high to have a large size of annotated dataset. Therefore, an + +alternative ML method that is much cheaper and more efficient than direction replication is utilized in RRP. Luo et al. (2020) proposed a neural text classifier to achieve the best performance on RRP. But their model is a blackbox and cannot provide faithful explanations about why a research paper is predicted as replicable or non-replicable. + +Interpreting Neural Networks Various approaches have been proposed to interpret neural network models from the post-hoc manner, such as gradient-based (Simonyan et al., 2014; Hechtlinger, 2016; Sundararajan et al., 2017), attention-based (Serrano and Smith, 2019), decomposition-based (Murdoch et al., 2018; Singh et al., 2018), example-based methods (Koh and Liang, 2017; Han et al., 2020), and word masking (Chen and Ji, 2020). However, these interpretation methods have their own limitations, including only work with specific neural network model, render doubts on faithfulness, and need additional work to provide the explanations based on trained models. In this paper, we focus on model-agnostic explanation methods. More specifically, we follow the research of masking methods which can improve both the prediction performance and interpretability by adopting information bottleneck framework (Tishby et al., 2000; Alemi et al., 2016) to identify important sentences. + +Improving interpretability via word masking Chen and Ji (2020) proposed a word masking method which can automatically select important words in the training process and build interpretable neural text classifiers by formulating their problem in the framework of information bottleneck. The proposed solution mainly deals with the short text and the average length (words) in all the seven datasets they used are less than 300. Four of them are less than 25. In constraint, the average length (words) of research papers in our RRP task is about 10,000 which is much longer than the ones used in (Chen and Ji, 2020). Therefore, we view word masking as insufficient for our task. On the other hand, Chen and Ji (2020) learn independently on whether each word is masked or not. But context matters, especially for long documents. Different from prior work, we utilized the context information (whether other sentences in the same paper are masked or not) of each sentence by applying LSTM models to decide whether to mask this sentence or not. We hypothesize that context masking is better than independent masking, especially for long + +documents such as the research papers in RRP. + +Consistency Training on Unlabeled Dataset The annotated data in RRP is collected using direction replication and its size is small. Therefore, weakly supervised learning methods need to be used to improve the model performance in RRP with the help of the unlabeled dataset. The existing weakly supervised methods applied in RRP focus mainly on improving the prediction performance, but less so about the model interpretability. + +Consistency training can improve the robustness of models by regularizing model predictions to be invariant to small noise applied to input examples (Sajjadi et al., 2016; Clark et al., 2018). Xie et al. (2019) proposed to substitute the traditional noise injection methods in the consistency training with high quality data augmentations so that a new consistency training based weakly supervised method is proposed and the performance is improved with the help of unlabeled dataset. But they focused only on improving the prediction performance. + +In this paper, we conduct the consistency training on the unlabeled dataset to improve both prediction performance and interpretability by substituting the traditional noise injection methods with sentence masking methods, which is the major contribution of our paper. More specifically, we first mask the unimportant sentences and keep the critical sentences. Then we make the predictions on the kept key sentences the same as the ones based on all the sentences in the research paper without masking. Finally, we conducted the consistency check by minimizing the difference between them. + +# 3 Problem Statement + +In this paper, our main goal is to improve the interpretability of neural textual classifier for Research Replication Prediction (RRP). First we introduce the RRP task. + +Research Replication Prediction (RRP) task In RRP, we hope to build a model $f$ that takes each research article as input and predicts whether the made research claim is replicable or not $f(\text{article}) \in \{0 \text{ (non-replicable)}, 1 \text{ (replicable)}\}$ . There are different definitions and criteria for claiming a research paper to be replicable. In this work, a research paper is replicable means that an independent replication can provide evidence of a statistically significant effect in the same direction + +as the original paper. + +Interpretable Research Replication Prediction In this paper, we aim to build an interpretable neural textual classifier for RRP. Improving the model interpretability can help us understand why a research paper is predicted as replicable or nonreplicable and make its application in the real world achieve more reliability and trustworthiness. Different from generating post-hoc explanations based on well-trained models, we adopt the information bottleneck framework (Tishby et al., 2000; Alemi et al., 2016) to train our model and build a more interpretable neural textual classifier for RRP. + +Preliminaries and notations To perform the above task, we have an labeled training dataset $\mathcal{L} := \{(x_i, y_i)\}_{i=1}^L$ , an unlabeled dataset $\mathcal{U} := \{x_i\}_{i=1}^U$ , and a test dataset $\mathcal{T} := \{(x_i, y_i)\}_{i=1}^T$ , where $L, U$ , and $T$ are the number of labeled training, unlabeled training, and testing datasets respectively. $x_i$ contains a sequence of sentences $x_i = [x_{i1}, x_{i2}, \ldots, x_{is}]$ in the $i_{\mathrm{th}}$ research paper and $S$ is the maximum number of sentences in a research paper in RRP task. For the $j_{\mathrm{th}}$ sentence in $x_i, x_{ij} = [x_{ij1}, x_{ij2}, \ldots, x_{ijk}, \ldots, x_{ijk}]$ , where $n$ is the maximum number of words in a sentence and $x_{ijk} \in \mathbb{R}^d$ which indicates the word embeddings as the model input. All the sentences have the same length $K$ by truncating. And $y_i$ is $x_i$ 's binary classification label which is either '1' (replicable) or '0' (non-replicable). A neural textual classifier can be trained to output the replication labels given any new research paper $x_i$ . + +# 4 Method + +The details of our proposed variational contextual consistency sentence masking (VCCSM) method are described in this section. + +# 4.1 Model Overview + +Our model contains two key modules: variational contextual sentence masking and consistency training. Variational contextual sentence masking module is applied in the training on both labeled and unlabeled datasets. Consistency training is only used in the training on the unlabeled dataset. + +In the training on labeled dataset, variational contextual sentence masking module extracts the key sentences via contextual masking (LSTM model). Then the supervised loss is calculated and optimized to minimize the difference between predic + +tion using the extracted sentences as the input and the ground truth label in the information bottleneck framework. The formula of supervised loss will be described later in this section and the architecture of the model on how to train the labeled dataset is shown in the left part of Figure 2. + +In the training on unlabeled dataset, different from the prior works, we conduct the consistency training on the unlabeled dataset to improve both prediction performance and interpretability by substituting the traditional noise injection methods with sentence masking methods. Consistency training can improve the model robustness by regularizing model predictions to be invariant to small noise applied to input examples (Sajjadi et al., 2016; Miyato et al., 2018; Clark et al., 2018). Typical noise injection methods included additive Gaussian noise, dropout noise or adversarial noise. The existing consistency training based work e.g., (Xie et al., 2019) focuses only on improving the prediction performance instead of interpretability. The consistency training methods utilized in this paper are based on variational contextual sentence masking and can also improve the model interpretability. Our optimization goal is to minimize the difference between prediction using the extracted vital sentences and prediction made on all the sentences without masking in the information bottleneck framework. The formula of unsupervised loss will be described later in this section and the architecture on how to train the unlabeled dataset is shown in the right part of Figure 2. + +# 4.2 Variational Contextual Sentence Masking + +Inspired by Chen and Ji (2020), we want to add a mask layer $M$ after the sentence embeddings layer to help the model select the key sentences, where $M = [M_1, M_2, \dots, M_j, \dots, M_S]$ and $S$ is the maximum number of sentences in a research paper. The embedding of each sentence is concatenated by word embeddings included in this sentence. + +Each $M_j \in \{0, 1\}$ is a binary random variable to decide whether we mask this sentence or not. For each sentence in one research paper, $M_j$ should be related to both the current sentence and the sentences around it (context). Therefore, we use LSTM model to generate the contextual sentence mask $M_j$ for the $j_{\mathrm{th}}$ sentence in one research paper, where $M_j = \mathrm{LSTM}(x_j), j = 1, 2, \dots, S$ . $x$ can be any given research paper. This contextual sentence mask layer $M$ together with the sentence embed + +![](images/547b03520f30aeab6218421c7605f25e2026dfad6c978c56407f3b5182f46e34.jpg) +Figure 2: The architecture of variational contextual consistency sentence masking (VCCSM). + +dings are considered as the input of neural network text classifiers in RRP, which is denoted as follows, + +$$ +Z = X ^ {\text {m a s k}} = M \bigodot X, \tag {1} +$$ + +where $\odot$ is an element-wise multiplication, $X$ are all the examples in any given dataset, and $X^{\mathrm{mask}}$ denotes the internal representations of all the examples. Our goal is to optimize $M$ so that the model can extract the key sentences for each research paper. + +The information bottleneck theory aims to learn an encoding $Z$ of the input $X$ with maximal information on predicting the target $Y$ while keeps $X$ 's the least redundant information (Tishby et al., 2000; Alemi et al., 2016). As proven effective and flexible in identifying important features (Chen and Ji, 2020), the information bottleneck framework is employed in our model. we want to make $Z = X^{\mathrm{mask}}$ maximally expressive on predicting $Y$ while being maximally compressive on $X$ . Therefore, following the standard information bottleneck theory (Tishby et al., 2000), our objective function is denoted as follows: + +$$ +\max _ {Z} I (Z; Y) - \beta \cdot I (Z; X), \tag {2} +$$ + +where the definitions of $X$ and $Z = X^{\mathrm{mask}}$ are given in Equation 1. $Y$ is the target output, $I(\cdot ;\cdot)$ denotes the mutual information, and $\beta \in \mathbb{R}_+$ is a coefficient that balances the two terms in the information bottleneck loss function. The formula of mutual information $I$ should include the parameters $\theta$ which need to be optimized. For simplicity, we ignore $\theta$ in the following formulae. + +However, computing the mutual information in Equation 2 is usually computationally challenging. Therefore, we adopted variational inference + +method to construct a lower bound for Equation 2. After constructing the lower bound and applying the reparameterization trick (Kingma and Welling, 2013), we can optimize the objective utilizing stochastic gradient descent. In this subsection, we simply listed the lower bound of Equation 2. The complete details on the derivation of lower bound for variational contextual sentence masking is shown in Appendix A.1. + +Assuming that the true joint distribution is $P(X,Y,Z)$ and $X,Y,Z$ are random variables which have the following conditional dependency: $Y\leftrightarrow X\leftrightarrow Z$ . And $x,y,z$ are instances of random variables. The lower bound of Equation 2 is as follows: + +$$ +\begin{array}{l} \sum_ {x, y, z} P _ {X} (x) P _ {Y \mid X} (y \mid x) P _ {Z \mid X} (z \mid x) \log Q _ {Y \mid X} (y \mid z) \\ - \beta \sum_ {z, x} P _ {X} (x) P _ {Z | X} (z | x) \log \frac {P _ {Z | X} (z | x)}{Q _ {Z} (z)} \tag {3} \\ \end{array} +$$ + +To compute Equation 3, we use the empirical data distribution including two Delta functions to approximate the $P_{X,Y}(x,y)$ . Therefore we have the loss function of variational information bottleneck (VAB) as follows: + +$$ +\begin{array}{l} \ell_ {v i b} = - (\mathbb {E} _ {P _ {X, Y} (x, y)} [ \mathbb {E} _ {P _ {Z | X} (z | x)} [ \log (Q _ {Y | Z} (y | z) ] \\ - \beta \cdot \mathrm {K L} [ P _ {Z | X} (z | x) | | Q _ {Z} (z) ] ]) \tag {4} \\ \end{array} +$$ + +# 4.3 Consistency Training based on Variational Contextual Sentence Masking + +In this work, we utilized a particular consistency training setting where the masked input $x^{\mathrm{mask}}$ is generated by applying variational contextual sentence masking mentioned above on each input $x$ , + +which can be written as follows: $x^{\mathrm{mask}} = M \cdot x$ , to improve both the interpretability and prediction performance. + +More specifically, inspired by Xie et al. (2019), we propose to substitute the traditional noise injection methods with our Contextual Sentence Masking module to generate the masked input $x^{\mathrm{mask}}$ given each input $x$ in the unlabeled dataset which can be written as follows: $x^{\mathrm{mask}} = M \cdot x$ . We also use the information bottleneck framework in the consistency training. The only change is to replace the ground truth label $y_{i}$ with the prediction $\hat{y}_i$ given the original research paper $x_{i}$ as the input. To be noted, the sentence mask layer is not used when predicting $\hat{y}_i$ . + +# 4.4 Variational Information Bottleneck (VAB) Loss Function + +As shown in Figure 2, our VAB loss functions contain two parts: a supervised VAB loss $\ell_{su}$ and an unsupervised VAB loss $\ell_{un}$ . The same model is optimized in both losses. + +Supervised VAB Loss Since we have ground truth labels in the labeled dataset, the supervised VAB loss $\ell_{su}$ is the same as the VAB loss $\ell_{vlb}$ in Equation 4 and it is denoted as follows: + +$$ +\begin{array}{l} \ell_ {s u} = - (\mathbb {E} _ {P _ {X, Y} (x, y)} [ \mathbb {E} _ {P _ {Z | X} (z | x)} [ \log (Q _ {Y | Z} (y | z) ] \\ - \beta \cdot \mathrm {K L} [ P _ {Z | X} (z | x) | | Q _ {Z} (z) ] ]) \tag {5} \\ \end{array} +$$ + +where $P_{X,Y}(x,y)$ refers to empirical distribution of complete observations. + +Unsupervised VAB Loss As for the unsupervised VAB loss, the only difference from the supervised one is to replace the ground truth label $y$ by the prediction $\hat{y} = f(x)$ given the original research paper $x$ as the input and and it is denoted as follows: + +$$ +\begin{array}{l} \ell_ {u n} = - \left(\mathbb {E} _ {P _ {X} (x)} \left[ \mathbb {E} _ {P _ {Z | X} (z | x)} \left[ \log \left(Q _ {Y | Z} (\hat {y} | z) \right] \right. \right. \right. \\ - \beta \cdot \mathrm {K L} [ P _ {Z | X} (z | x) | | Q _ {Z} (z) ] ]) \tag {6} \\ \end{array} +$$ + +where $P_{X}(x)$ refers to empirical distribution of incomplete observations. + +Total Loss In summary, our full training objective $\ell$ can be written as follows: + +$$ +\ell = \ell_ {s u} + \alpha \cdot \ell_ {u n} \tag {7} +$$ + +where $\alpha > 0$ is a balancing hyper parameter about these two items of losses. Our goal is to minimize the full training objective $\ell$ . + +# 5 Experimental Setup + +The proposed VCCSM method is evaluated with two typical neural network models commonly used on text classification tasks, LSTM (Hochreiter and Schmidhuber, 1997) and BERT (Devlin et al., 2018) on two datasets. + +# 5.1 Datasets + +RRP Dataset RRP dataset is proposed by Luo et al. (2020). RRP dataset contains 399 labeled and 2,170 unlabeled research articles in social science fields. In this paper, randomly selected 300 (150:1;150:0) labeled and 2,170 unlabeled samples are treated as the training dataset. The remaining 99 (51:1;48:0) labeled research articles are considered as the testing dataset. More details about the RRP dataset are shown in Appendix A.2. PDFMiner (Shinyama, 2014) is used to extract the text in the raw pdf files for both labeled and unlabeled datasets. Therefore, the text format of labeled and unlabeled datasets are the same. + +ECHR Dataset European Convention of Human Rights (ECHR) (Chalkidis et al., 2019) is a publicly available English legal judgment prediction dataset which contains 11,478 cases. Each case has a list of paragraphs describing the facts. The task is to predict whether one given case is judged as violated or not. The ECHR dataset is split into training, development, and testing datasets with the number of cases of 7,100, 1,380 and 2,998. The average number of tokens for training, development, and testing datasets are 2,421, 1,931, and 2,588, respectively. + +# 5.2 Implementation Details + +The LSTM model we used has a bidirectional hidden layer, and it's initialized with 300-dimensional google's pre-trained word embeddings. We fix the embedding layer and update other parameters in LSTM to achieve the best performance. As for BERT model, a published BERT pre-trained model ("bert-base-uncased") is utilized as the embedding layer of LSTM model. We first use our corpus to pre-train the BERT model and then fine-tune it in the VCCSM classifier's training. In each epoch, the model is first trained on labeled data, followed by unlabeled data. The hidden state of the [CLS] token of the last layer is considered as the sentence representation. + +Because the average length (words) of all the documents in the labeled and unlabeled datasets is about 10,000, we set the maximum length of words in our paper to 10,000. Since VCCSM method is sentence masking and we need to split the text of research paper into sentences. We use period, question mark, and semicolon to conduct the splitting. After some statistical analysis, the average length (words) of each sentence is around 25. For a fair comparison with word masking method, we set the maximum length of sentences in each document to 400. It means that we set the maximum length of words in each document to 10,000 in all models. In the experiments, for RRP dataset, the number of labeled and unlabeled datasets are 4,00 and 2,170 research papers respectively. As for ECHR dataset, 2,000 cases in the training dataset are considered as the labeled and the remaining 5,100 cases as the unlabeled. + +# 5.3 Interpretability Metrics + +# 5.3.1 AOPC + +The first interpretability metric we used is area over the perturbation curve (AOPC) (Samek et al., 2016; Nguyen, 2018) which is obtained by computing the average change of prediction probability by deleting top $n$ important words and it can evaluate the model interpretability on faithness. Since our proposed VCCSM is sentence masking method, we calculate the average change of prediction probability by deleting top $n$ key sentences in the explanations of the papers. Therefore, AOPC used in our paper is defined as follows: + +$$ +\operatorname {A O P C} (f) = \frac {1}{T + 1} \sum_ {i = 1} ^ {T} \left(f \left(x _ {i}\right) - f \left(x _ {i} \backslash \left\{s _ {1}, \dots , s _ {n} \right\}\right)\right), +$$ + +where $f(x_{i} \backslash \{s_{1}, \dots, s_{n}\})$ is the probability for the predicted class on the $i_{\mathrm{th}}$ document in RRP when the top $n$ sentences on importance are removed. Higher AOPC score is better. + +# 5.3.2 Post-hoc Accuracy + +The second interpretability metric utilized in this paper is post-hoc accuracy metric (Chen et al., 2018) which is computed by counting how many testing examples' predictions are changed by utilizing only extracted top $n$ words to classify. For our VCCSM models, we used top $n$ key sentences. The formula to calculate the post-hoc accuracy in our paper is as follows: + +$$ +\operatorname {A c c} _ {p} (f, n) = \frac {1}{T} \sum_ {i = 1} ^ {T} 1 [ f (\{s _ {1}, \dots , s _ {n} \}) = f (x _ {i}) ], +$$ + +where $T$ is the number of examples in the testing dataset, $\{s_1,\dots,s_n\}$ are the top $n$ sentences on importance in the $i_{\mathrm{th}}$ document. Higher post-hoc accuracy is better. + +# 6 Results + +We tested our proposed models on two text classification datasets (RRP along with ECHR), and the details about prediction accuracy and interpretability are described in this section. + +# 6.1 Quantitative Evaluation + +We evaluate the interpretability of VCCSM model against other types of models via the AOPC (Samek et al., 2016; Nguyen, 2018) and post-hoc accuracy (Chen et al., 2018) metrics. We also listed the performance with varying number of the unlabeled data in Appendix A.3 and it shows that the performance become higher with more unlabeled data. + +Table 1 shows the results of VCCSM (LSTM & BERT) and other interpretable models on the RPP and ECHR datasets with top 500 words (word based methods) or 20 sentences (sentence based methods). Simialr results are obtained with varying number of sentences. For BERT's attention weights model, we extracted the words' attention weights of all heads in the last layer and average them. As for BERT's attention weights (sentences), we average the words' averaged weights in each sentence as its sentence representation. Extractive summarization models can also extract the key sentences for each document. In this section, we used the recent extractive summarization method (Cui and Hu, 2021) as the baseline. We conduct the training on arXiv + PubMed (Cohan et al., 2018) and our labeled + unlabeled datasets (the abstract are the summary). Training on arXiv + PubMed aims to generalize the model and make the model extract a more comprehensive of information instead of only abstract in the research paper. We can observe that our proposed models perform better than other methods in both interpretability and prediction performance on both RRP and ECHR datasets. + +Ablation Study In order to validate different modules in our proposed VCCSM method, we conduct the ablation study on the RRP dataset as shown in Table 2. We observe the drop after removing contextual masking or consistency training (on the unlabeled data) which shows that each component benefit to the model. It is noting that we observe a + +
MethodsRRPECHR
AccAOPCPost-hocAccAOPCPost-hoc
LSTM Word Masking (Chen and Ji, 2020)60.61%11.16%50.51%84.86%10.32%65.84%
BERT's Attention Weights (words)64.65%11.70%60.61%84.26%15.06%73.75%
BERT Word Masking (Chen and Ji, 2020)65.66%12.05%61.62%85.06%16.30%76.38%
SOTA Extractive Summarization (Cui and Hu, 2021)65.66%12.86%57.58%85.39%19.57%75.52%
BERT's Attention Weights (sentences)65.66%13.62%62.63%85.39%22.61%81.49%
LSTM Sentence Masking + Contextual + Consistency65.66%22.19%63.64%86.06%30.53%84.22%
BERT Sentence Masking + Contextual + Consistency68.69%24.02%65.66%87.66%32.78%86.59%
+ +Table 1: Comparison between VCCSM and other methods on testing accuracy, area over the perturbation curve (AOPC), and post-hoc accuracy on RRP and ECHR datasets. + +
ModelMethodsAccuracyAOPCPost-hoc
LSTMProposed LSTM VCCSM65.66%22.19%63.64%
w/o consistency training62.63%14.29%60.61%
w/o contextual masking63.64%19.10%62.63%
BERTProposed BERT VCCSM68.69%24.02%65.66%
w/o consistency training65.66%16.38%62.63%
w/o contextual masking66.67%21.16%64.65%
+ +Table 2: Ablation study of proposed VCCSM (LSTM & BERT Sentence Masking + Contextual + Consistency) on testing accuracy, area over the perturbation curve (AOPC), and post-hoc accuracy on RRP dataset. + +examples conditions. This difference was in the predicted direction, and it was also predicted to be small, so a nonsignificant result is not surprising. + +To investigate the second question, we tested a series of specific predictions from our model (discussed below), about how generalizations given three examples at a certain level of specificity should differ from each other. A set of planned comparisons addressed this question by comparing the percentages of response at each level. Given three examples from the same subordinate-level category, the model predicts ① sharp drop between subordinate-level generalization and basic-level generalization (95% vs. 16%, $p < .0001$ ). Given three examples from the same superordinate-level category, the model predicts a sharp drop between basic-level generalization and superordinate-level generalization (91% vs. 4%, $p < .0001$ ). Given three examples from the same superordinate category, the model predicts that generalization should include all exemplars from that superordinate category (94%, 91%, and 87%, ns). + +The similarity data are analyzed later in the article, when we describe the fits of our Bayesian learning model. The similarities will be used to construct the model's hypothesis space. + +BERT Word Masking + +examples conditions. This difference was in the predicted direction, and it was also predicted to be small, so a nonsignificant result is not surprising. + +To investigate the second question, we tested a series of specific predictions from our model (discussed below), about how generalizations given three examples at a certain level of specificity should differ from each other. A set of planned comparisons addressed this question by comparing the percentages of response at each level. Given three examples from the same subordinate-level category, the model predicts a sharp drop between subordinate-level generalization and basic-level generalization $95\%$ vs. $16\%$ , $p < .0001$ . Given three examples from the same basic-level category, the model predicts a sharp drop between basic-level generalization and superordinate-level generalization $(94\%)$ vs. $17\%$ , $p < .0001$ . Given three examples from the same superordinate category, the model predicts that generalization should include all exemplars from that superordinate category $(94\%, 91\%,$ and $87\%$ , ns). + +The similarity data are analyzed later in the article, when we describe the fits of our Bayesian learning model. The similarities will be used to construct the model's hypothesis space. + +Attention Weights (sentences) + +examples conditions. This difference was in the predicted direction, and it was also predicted to be small, so a nonsignificant result is not surprising. + +To investigate the second question, we tested a series of specific predictions from our model (discussed below), about how generalizations given three examples at a certain level of specificity should differ from each other. A set of planned comparisons addressed this question by comparing the percentages of response at each level. Given three examples from the same subordinate-level category, the model predicts a sharp drop between subordinate-level generalization and basic-level generalization $(95\%)$ - $16\%$ $p < .0001$ ). Given three examples from the same subordinate-level category, the model predicts a sharp drop between basic-level generalization and superordinate-level generalization $(91\%$ vs. $4 \%$ $p < .0001$ ). Given three examples from the same superordinate category, the model predicts that generalization should include all exemplars from that superordinate category $(94\% ,91\%$ and $87\% ,ns)$ + +The similarity data are analyzed later in the article, when we describe the fits of our Bayesian learning model. The similarities will be used to construct the model's hypothesis space. + +Extractive Summarization + +examples conditions. This difference was in the predicted direction, and it was also predicted to be small, so a nonsignificant result is not surprising. + +To investigate the second question, we tested a series of specific predictions from our model (discussed below), about how generalizations given three examples at a certain level of specificity should differ from each other. A set of planned comparisons addressed this question by comparing the percentages of response at each level. Given three examples from the same subordinate-level category, the model predicts a sharp drop between subordinate-level generalization and basic-level generalization $95\%$ vs. $16\%$ , $p < .0001$ . Given three examples from the same basic-level category, the model predicts a sharp drop between basic-level generalization and superordinate-level generalization $(0.2\%)$ vs. $0.8\%$ , $p < .0001$ . Given three examples from the same subordinate-level category, the model predicts that generalization should include all exemplars from that superordinate category $(94\%, 91\%,$ and $87\%, \mu)$ . + +The similarity data are analyzed later in the article, when we describe the fits of our Bayesian learning model. The similarities will be used to construct the model's hypothesis space. + +BERT VCCSM + +Figure 3: Highlighted explanations (words or sentences) of BERT word masking, attention weights (sentences), SOTA extractive summarization, and BERT VCCSM methods for a paragraph in one replicable research paper "Word Learning as Bayesian Inference" in Psychological Review. + +larger drop on both accuracy and two interpretability metrics without the consistency training on the unlabeled data which demonstrates that consistency training contributes more to the model. + +# 6.2 Qualitative Evaluation + +In this section, we conduct the qualitative evaluations and compare the explanations of different models intuitively by highlighting the words or sentences. Specifically, we draw on the Open Science pratics (e.g., mentioning how to access the data) as indicators of high reproducibility, because these practices are proposed as solutions to the reproducibility crisis in the science community (Simonsohn et al., 2015; Foster and Deardorff, 2017; Brodeur et al., 2020; Dienlin et al., 2021; Markowitz et al., 2021). Some of those indicators which are easier to check are listed as below: (1) Publish materials, data, and code; (2) Preregister + +studies and submit the reports; (3) Conduct the replications by themselves; (4) Collaborate with others; (5) $\mathrm{P}$ -value $^2$ is close to 0.5. + +We conduct the case studies on the testing dataset and find that our proposed methods can highlight more sentences which are related to the indicators mentioned above. A case study is shown in Figure 3. More specifically, Figure 3 shows highlighted explanations (words or sentences) of BERT word masking, attention weights (sentences), SOTA extractive summarization, and BERT VCCSM methods for a paragraph in one replicable research paper "Word Learning as Bayesian Inference" (Xu and Tenenbaum, 2007) in Psychological Review. In this case study, we extracted top 200 sentences or 5,000 words (only + +for BERT word masking method) but only show one paragraph highlighted results. Although all the methods provide the correct prediction, our VCCSM highlights the sentences which are related to the indicators described above. It is noting that the highlight words of BERT word masking is not so readable for the long research paper. Attention weights (sentences) and SOTA extractive summarization methods can provide informational sentences but the highlighted sentence are not related to the indicators described above. BERT VCSSM can highlight $p$ -value sentences which are related to the indicators mentioned above. + +# 6.3 Discussion on Plausibility of Predicting Research Replicability using Text + +By looking into RRP's labeled dataset and conducting the cases studies carefully such as in Figure 3, we discuss on whether classifying results in a research paper as replicable using text is actually sufficient to replicate the results, which is the central premise this paper is based on. Non-replicability of scientific studies largely results from unscientific, unethical research practices (e.g., p-hacking, selective reporting, data manipulation). Such practices can be manifested in the texts of research papers such as the reports of p-values, experimental procedures, etc. Generally speaking, the more problematic practices a research paper involves, the less likely its findings are valid, and the less likely it will be reproduced. Hence, by modeling the replicability of research paper with regard to its textual components that are potentially linked with the problematic practices, we can classify whether a research paper can be replicated and identify the focal sentences relevant to the prediction. + +# 7 Concluding Remarks + +In this paper, we proposed VCCSM to improve both interpretability and prediction accuracy on RRP along with ECHR datasets, using largely unlabeled datasets. We tested VCCSM with two different neural text classifiers (LSTM and BERT) and evaluated both prediction accuracy and interpretability metrics. As future work, we plan to explore other advanced interpretable models and weakly supervised methods to further improve the prediction performance and interpretability of long document classification tasks. + +# Acknowledgments + +This research is partially supported by National Science Foundation (NSF) under Grant No. IIS-2007951 and the Defense Advanced Research Projects Agency (DARPA) and Space and Naval Warfare Systems Center Pacific (SSC Pacific) under Contract No. N66001-19-C-4014. The authors would like to thank Dr. Bingjie Liu for her valuable comments on the manuscript. We also thank all the anonymous reviewers for their insightful comments. + +# 8 Broader Impacts + +Our paper proposed VCCSM method to build an interpretable model for long document datasets such as RRP and ECHR. Our model can provide the explanations about why a research paper is predicted as replicable or non-replicalbe and why a case is judged as violated or not so that the prediction results obtained by neural text classifier are more reliable and trustworthy. However, sometimes, our proposed methods can be misused. For example, people may try to adversarially write the new text in a research paper to fool the research replication prediction tool when they can obtain the explanations by using our interpretable models. Therefore, the proposed methods in this paper should be used with careful consideration of its potential misusing when deployed in the real-world. + +# References + +Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. 2016. Deep variational information bottleneck. arXiv preprint arXiv:1612.00410. +Adam Altmejd, Anna Dreber, Eskil Forsell, Juergen Huber, Taisuke Imai, Magnus Johannesson, Michael Kirchler, Gideon Nave, and Colin Camerer. 2019. Predicting the replicability of social science lab experiments. *PloS one*, 14(12). +David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. 2019. Mixmatch: A holistic approach to semi-supervised learning. arXiv preprint arXiv:1905.02249. +Abel Brodeur, Nikolai Cook, and Anthony Heyes. 2020. Methods matter: P-hacking and publication bias in causal analysis in economics. *American Economic Review*, 110(11):3634-60. +Colin F Camerer, Anna Dreber, Eskil Forsell, Teck-Hua Ho, Jürgen Huber, Magnus Johannesson, Michael Kirchler, Johan Almenberg, Adam Altmejd, Taizan + +Chan, et al. 2016. Evaluating replicability of laboratory experiments in economics. Science, 351(6280):1433-1436. +Colin F Camerer, Anna Dreber, Felix Holzmeister, Teck-Hua Ho, Jürgen Huber, Magnus Johannesson, Michael Kirchler, Gideon Nave, Brian A Nosek, Thomas Pfeiffer, et al. 2018. Evaluating the replicability of social science experiments in nature and science between 2010 and 2015. Nature Human Behaviour, 2(9):637-644. +Ilias Chalkidis, Ion Androutsopoulos, and Nikolaos Aletras. 2019. Neural legal judgment prediction in english. arXiv preprint arXiv:1906.02059. +Hanjie Chen, Song Feng, Jatin Ganhotra, Hui Wan, Chulaka Gunasekara, Sachindra Joshi, and Yangfeng Ji. 2021. Explaining neural network predictions on sentence pairs via learning word-group masks. arXiv preprint arXiv:2104.04488. +Hanjie Chen and Yangfeng Ji. 2020. Learning variational word masks to improve the interpretability of neural text classifiers. arXiv preprint arXiv:2010.00667. +Jiaao Chen, Zichao Yang, and Diyi Yang. 2020. Mixtext: Linguistically-informed interpolation of hidden space for semi-supervised text classification. arXiv preprint arXiv:2004.12239. +Jianbo Chen, Le Song, Martin Wainwright, and Michael Jordan. 2018. Learning to explain: An information-theoretic perspective on model interpretation. In International Conference on Machine Learning, pages 883-892. PMLR. +Kevin Clark, Minh-Thang Luong, Christopher D Manning, and Quoc V Le. 2018. Semi-supervised sequence modeling with cross-view training. arXiv preprint arXiv:1809.08370. +Arman Cohan, Franck Dernoncourt, Doo Soon Kim, Trung Bui, Seokhwan Kim, Walter Chang, and Nazli Goharian. 2018. A discourse-aware attention model for abstractive summarization of long documents. arXiv preprint arXiv:1804.05685. +Open Science Collaboration. 2012. An open, large-scale, collaborative effort to estimate the reproducibility of psychological science. Perspectives on Psychological Science, 7(6):657-660. +Open Science Collaboration et al. 2015. Estimating the reproducibility of psychological science. Science, 349(6251):aac4716. +Peng Cui and Le Hu. 2021. Sliding selector network with dynamic memory for extractive summarization of long documents. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5881-5891. + +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. +Tobias Dienlin, Niklas Johannes, Nicholas David Bowman, Philipp K Masur, Sven Engesser, Anna Sophie Kumpel, Josephine Lukito, Lindsey M Bier, Renwen Zhang, Benjamin K Johnson, et al. 2021. An agenda for open science in communication. Journal of Communication, 71(1):1-26. +A Dreber, T Pfeiffer, E Forsell, D Viganola, M Johannesson, Y Chen, B Wilson, BA Nosek, and J Almenberg. 2019. Predicting replication outcomes in the many labs 2 study. Journal of Economic Psychology. +Charles R Ebersole, Olivia E Atherton, Aimee L Belanger, Hayley M Skulborstad, Jill M Allen, Jonathan B Banks, Erica Baranski, Michael J Bernstein, Diane BV Bonfiglio, Leanne Boucher, et al. 2016. Many labs 3: Evaluating participant pool quality across the academic semester via replication. Journal of Experimental Social Psychology, 67:68-82. +Erin D Foster and Ariel Deardorff. 2017. Open science framework (osf). Journal of the Medical Library Association: JMLA, 105(2):203. +Xiaochuang Han, Byron C Wallace, and Yulia Tsvetkov. 2020. Explaining black box predictions and unveiling data artifacts through influence functions. arXiv preprint arXiv:2005.06676. +Yotam Hechtlinger. 2016. Interpretation of prediction models using the input gradient. arXiv preprint arXiv:1611.07634. +Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. *Neural computation*, 9(8):1735-1780. +Diederik P Kingma and Max Welling. 2013. Autoencoding variational bayes. arXiv preprint arXiv:1312.6114. +Richard A Klein, Kate A Ratliff, Michelangelo Vianello, Reginald B Adams Jr, Štepan Bahnik, Michael J Bernstein, Konrad Bocian, Mark J Brandt, Beach Brooks, Claudia Chloe Brumbaugh, et al. 2014. Investigating variation in replicability. Social psychology. +Richard A Klein, Michelangelo Vianello, Fred Hasselman, Byron G Adams, Reginald B Adams Jr, Sinan Alper, Mark Aveyard, Jordan R Axt, Mayowa T Babalola, Štepan Bahnik, et al. 2018. Many labs 2: Investigating variation in replicability across samples and settings. Advances in Methods and Practices in Psychological Science, 1(4):443-490. +Pang Wei Koh and Percy Liang. 2017. Understanding black-box predictions via influence functions. In International Conference on Machine Learning, pages 1885-1894. PMLR. + +Samuli Laine and Timo Aila. 2016. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242. +Tianyi Luo, Xingyu Li, Hainan Wang, and Yang Liu. 2020. Research replication prediction using weakly supervised learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, pages 1464-1474. +David M Markowitz, Hyunjin Song, and Samuel Hardman Taylor. 2021. Tracing the adoption and effects of open science in communication research. Journal of Communication. +Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. 2018. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 41(8):1979-1993. +W James Murdoch, Peter J Liu, and Bin Yu. 2018. Beyond word importance: Contextual decomposition to extract interactions from lstms. arXiv preprint arXiv:1801.05453. +Dong Nguyen. 2018. Comparing automatic and human evaluation of local explanations for text classification. 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 1069-1078. +H Pashler, B Spellman, S Kang, and A Holcombe. 2019. Psychfiledrawer: archive of replication attempts in experimental psychology. Online< http://psychfiledrawer.org/view_article_list.php. +Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. 2016. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. Advances in neural information processing systems, 29:1163-1171. +Wojciech Samek, Alexander Binder, Gregoire Montavon, Sebastian Lapuschkin, and Klaus-Robert Müller. 2016. Evaluating the visualization of what a deep neural network has learned. IEEE transactions on neural networks and learning systems, 28(11):2660-2673. +Sofia Serrano and Noah A Smith. 2019. Is attention interpretable? arXiv preprint arXiv:1906.03731. +Yusuke Shinyama. 2014. Pdflminer. +Daniel J Simons, Alex O Holcombe, and Barbara A Spellman. 2014. An introduction to registered replication reports at perspectives on psychological science. Perspectives on Psychological Science, 9(5):552-555. +Uri Simonsohn, Joseph P Simmons, and Leif D Nelson. 2015. Better p-curves: Making p-curve analysis more robust to errors, fraud, and ambitious p-hacking, a reply to ulrich and miller (2015). + +Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. 2014. Deep inside convolutional networks: Visualising image classification models and saliency maps. In In Workshop at International Conference on Learning Representations. Citeseer. +Chandan Singh, W James Murdoch, and Bin Yu. 2018. Hierarchical interpretations for neural network predictions. arXiv preprint arXiv:1806.05337. +Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, and Martin Wattenberg. 2017. Smoothgrad: removing noise by adding noise. arXiv preprint arXiv:1706.03825. +Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017. Axiomatic attribution for deep networks. In International Conference on Machine Learning, pages 3319-3328. PMLR. +Antti Tarvainen and Harri Valpola. 2017. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. arXiv preprint arXiv:1703.01780. +Naftali Tishby, Fernando C Pereira, and William Bialek. 2000. The information bottleneck method. arXiv preprint physics/0004057. +Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V Le. 2019. Unsupervised data augmentation for consistency training. arXiv preprint arXiv:1904.12848. +Fei Xu and Joshua B Tenenbaum. 2007. Word learning as bayesian inference. *Psychological review*, 114(2):245. +Yang Yang. 2018. The replicability of scientific findings using human and machine intelligence. https://www.metascience2019.org/presentations/yang-yang/Metascience2019. + +# A Appendix + +# A.1 Detailed Derivation of Lower Bound for Variational Contextual Sentence Masking in Section 4.2 + +In this section, we provided the complete details on the derivation of lower bound for variational contextual sentence masking in Section 4.2. + +Assuming that the true joint distribution is $P(X,Y,Z)$ and $X,Y,Z$ are random variables which have the following conditional dependency: $Y\leftrightarrow X\leftrightarrow Z$ . And $x,y,z$ are instances of random variables. We can have + +$$ +\begin{array}{l} P (X, Y, Z) = P (Z \mid X, Y) P (Y \mid X) P (X) \\ = P (Z | X) P (Y | X) P (X). \tag {8} \\ \end{array} +$$ + +According to the definition of $I(Z;Y)$ , we have + +$$ +\begin{array}{l} I (Z; Y) = \sum_ {z, y} P _ {Z, Y} (z, y) \log \frac {P _ {Z , Y} (z , y)}{P _ {Z} (z) P _ {Y} (y)} \\ = \sum_ {z, y} P _ {Z, Y} (z, y) \log \frac {P _ {Y \mid Z} (y \mid z)}{P _ {Y} (y)}. \tag {9} \\ \end{array} +$$ + +And we also have + +$$ +\begin{array}{l} P _ {Y \mid Z} (y \mid z) = \sum_ {x} P _ {X, Y \mid Z} (x, y \mid z) \\ = \sum_ {x} P _ {Y | X} (y | x) P _ {X | Z} (x | z) \\ = \sum_ {x} \frac {P _ {Y \mid X} (y \mid x) P _ {Z \mid X} (z \mid x) P _ {X} (x)}{P _ {Z} (z)}. \tag {10} \\ \end{array} +$$ + +Since $P(Y|Z)$ can be intractable, $Q(Y|Z)$ is considered as a variational approximation to $P(Y|Z)$ . $Q(Y|Z)$ is our decoder and a neural network. Because the Kullback Leibler divergence is nonnegative, we have + +$$ +\begin{array}{l} \operatorname {K L} [ P (Y | Z) | | Q (Y | Z) ] \geq 0 \\ \Rightarrow \sum_ {y} p (y | z) \log p (y | z) \geq \sum_ {y} p (y | z) \log q (y | z). \tag {11} \\ \end{array} +$$ + +Therefore, we can obtain the lower bound of $I(Z;Y)$ as follows: + +$$ +\begin{array}{l} I (Z; Y) \geq \sum_ {z, y} P _ {Z, Y} (z, y) \log \frac {Q _ {Y , Z} (y | z)}{P _ {Y} (y)} \\ = \sum_ {z, y} P _ {Z, Y} (z, y) \log Q _ {Y | Z} (y | z) + H (Y). \tag {12} \\ \end{array} +$$ + +where $H(Y) = -\sum_{y} P_{Y}(y) \log P_{Y}(y)$ is entropy. According to Equation 8, we have + +$$ +\begin{array}{l} P (Y | Z) = \sum_ {x} P _ {X, Y, Z} (x, y, z) \\ = \sum_ {x} P _ {X, Y, Z} (x, y, z) \\ = \sum_ {x} P _ {X} (x) P _ {Y | X} (y | x) P _ {Z | X} (z | x). \tag {13} \\ \end{array} +$$ + +Hence, we obtain the lower bound of $I(Z,Y)$ as follows: + +$$ +\sum_ {x, y, z} P _ {X} (x) P _ {Y | X} (y | x) P _ {Z | X} (z | x) \log Q _ {Y | Z} (y | z). +$$ + +As for $I(Z;X)$ , similar to Equation 9 in the derivation of $I(Z;Y)$ , we first obtain + +$$ +\begin{array}{l} I (Z; X) = \sum_ {z, x} P _ {Z, X} (z, x) \log \frac {P _ {Z | X} (z | x)}{P _ {Z} (z)} \\ = \sum_ {z, x} P _ {Z, X} (z, x) \log P _ {Z | X} (z | x) \\ - \sum_ {z} P _ {Z} (z) \log P _ {Z} (z). \tag {14} \\ \end{array} +$$ + +Because the marginal distribution of $Z$ , $P(Z) = \sum_{x}P_{Z|X}(z|x)P_{X}(x)$ in which the computation might be difficult, we replace $P(Z)$ by a variational approximation of $Q(Z)$ . Since $\mathrm{KL}[P(Z)||Q(Z)]\geq 0\Rightarrow \sum_{z}P_{Z}(z)\log P_{Z}(z)\geq \sum_{z}P_{Z}(z)\log Q_{Z}(z)$ , we can get the upper bound of $I(Z;X)$ as follows: + +$$ +\begin{array}{l} I (Z; X) \leq \sum_ {z, x} P _ {Z, X} (z, x) \log P _ {Z | X} (z | x) \\ - \sum_ {z, x} P _ {Z, X} (z, x) \log Q _ {Z} (z) \\ \leq \sum_ {z, x} P _ {X} (x) P _ {Z | X} (z | x) \log \frac {P _ {Z | X} (z | x)}{Q _ {Z} (z)}. \tag {15} \\ \end{array} +$$ + +Combining Equation 12 and 15, we can get the lower bound of $I(Z;Y) - \beta I(Z;X)$ as follows: + +$$ +\begin{array}{l} \sum_ {x, y, z} P _ {X} (x) P _ {Y \mid X} (y \mid x) P _ {Z \mid X} (z \mid x) \log Q _ {Y \mid X} (y \mid z) \\ - \beta \sum_ {z, x} P _ {X} (x) P _ {Z | X} (z | x) \log \frac {P _ {Z | X} (z | x)}{Q _ {Z} (z)}. \\ \end{array} +$$ + +# A.2 Details of RRP Dataset + +In the RRP dataset proposed by Luo et al. (2020), the labeled dataset are collected from eight research replication projects which are the Registered Replication Report (RRR) (Simons et al., 2014), Many Labs 1 (Klein et al., 2014), Many Labs 2 (Klein et al., 2018), Many Labs 3 (Ebersole et al., 2016), Social Sciences Replication Project (SSRP) (Camerer et al., 2018), PsychFileDrawer (Pashler et al., 2019), Experimental Economics Replication Project (Camerer et al., 2016), and Reproducibility Project: Psychology (RPP) (Collaboration, 2012). Among 399 labeled data in the RRP dataset, 201 are labeled as '1' (replicable) and the remain 198 are annotated as '0' (non-replicable). We observe that the labeled data in the RRP dataset is balanced. + +![](images/bd253f4ff504938672f790418b2f89a1b1359ad43cd5b89604cc7d91d573bf02.jpg) +(a) LSTM Sentence Masking + Contextual + Consistency + +![](images/69b1dcd4d764b96b0301ea177117da75b5b91a256b659b83f84097dcff720327.jpg) +(b) BERT Sentence Masking + Contextual + Consistency +Figure 4: Testing accuracy $(\%)$ on RRP dataset with varying number of unlabeled dataset for VCCSM applied on two neural text classifiers (LSTM and BERT) + +In addition, RRP dataset also contains 2,170 research articles as the unlabeled dataset. Luo et al. (2020) observed that most papers in the labeled dataset in the RRP dataset are economical and psychology related. Among those papers, they are mainly from American Economic Review and Psychological Science journals. Therefore, a python crawler is written by Luo et al. (2020) to get 2,170 published research articles on the American Economic Review (Jan 2011 - Dec 2014) and Psychological Science websites (Jan 2006 - Dec 2012). The number of articles crawled from American Economic Review and Psychological Science websites are 981 and 1,189 respectively. + +# A.3 Performance with Varying Number of Unlabeled Data + +We conducted the experiments to test our model's effectiveness by varying number of unlabeled data for VCCSM applied on two neural text classifiers (LSTM and BERT). From Figure 4, we can observe that, with more unlabeled data, the testing accuracy becomes higher on both LSTM Sentence Masking + Contextual + Consistency and BERT Sentence Masking + Contextual + Consistency models, which validates the effectiveness of using unlabeled data. \ No newline at end of file diff --git a/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/images.zip b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bcdbf35fb03e8fdbc4de1e37e5093c486bdf40d8 --- /dev/null +++ b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7276035c8a7113382e7dbd6a11bf171665db507ee84a9e1a54091d44bfb4aa0d +size 421619 diff --git a/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/layout.json b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a7047f6fb0ed85ea0433d434db02cefa7d37a71b --- /dev/null +++ b/interpretableresearchreplicationpredictionviavariationalcontextualconsistencysentencemasking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49e2b9f116634b7ad97a20c153c7654473b44e2a594cc8897c81598991717f51 +size 472036 diff --git a/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_content_list.json b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..fe47f5c6b29fe25a9785e33c67a4e1daea0eeb61 --- /dev/null +++ b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f028d02d5417e73423c40116bef086961b00c6119bdfc73e01d87f2f36a7f91f +size 101472 diff --git a/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_model.json b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d3961684221bad694a70fb0acee6f196893600f4 --- /dev/null +++ b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6aecbeb9534c1c710068c697dfaf58c38deceb30d444a2d19cce7bb38aaefa13 +size 123505 diff --git a/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_origin.pdf b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bdb9042ade9504b0a100f3890118adfc7d3028f0 --- /dev/null +++ b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/e10f89d0-a07a-479c-81ec-9a19b4ae16cf_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08c7ef54d26190ca24b34f714e4eaa7c8dc9dd6292babd800d9ab782603a3937 +size 1246248 diff --git a/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/full.md b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0a1175f6d2da9e6105807ef2ff13905dedb866dc --- /dev/null +++ b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/full.md @@ -0,0 +1,437 @@ +# Interpreting the Robustness of Neural NLP Models to Textual Perturbations + +Yunxiang Zhang $^{1}$ , Liangming Pan $^{2}$ , Samson Tan $^{2}$ , Min-Yen Kan $^{2}$ + +$^{1}$ Wangxuan Institute of Computer Technology, Peking University + +$^{2}$ School of Computing, National University of Singapore + +yx.zhang@pku.edu.cn, liangmingpan@u.nus.edu, + +{samson.tmr,kanmy}@comp.nus.edu.sg + +# Abstract + +Modern Natural Language Processing (NLP) models are known to be sensitive to input perturbations and their performance can decrease when applied to real-world, noisy data. However, it is still unclear why models are less robust to some perturbations than others. In this work, we test the hypothesis that the extent to which a model is affected by an unseen textual perturbation (robustness) can be explained by the learnability of the perturbation (defined as how well the model learns to identify the perturbation with a small amount of evidence). We further give a causal justification for the learnability metric. We conduct extensive experiments with four prominent NLP models — TextRNN, BERT, RoBERTa and XLNet — over eight types of textual perturbations on three datasets. We show that a model which is better at identifying a perturbation (higher learnability) becomes worse at ignoring such a perturbation at test time (lower robustness), providing empirical support for our hypothesis. + +# 1 Introduction + +Despite the success of deep neural models on many Natural Language Processing (NLP) tasks (Liu et al., 2016; Devlin et al., 2019; Liu et al., 2019b), recent work has discovered that these models are not robust to noisy input from the real world and thus their performance will decrease (Prabhakaran et al., 2019; Niu et al., 2020; Ribeiro et al., 2020; Moradi and Samwald, 2021). A reliable NLP system should not be easily fooled by slight noise in the text. Although a wide range of evaluation approaches for robust NLP models have been proposed (Ribeiro et al., 2020; Morris et al., 2020; Goel et al., 2021; Wang et al., 2021), few attempts have been made to understand these benchmark results. Given the difference of robustness between models and perturbations, it is a natural question why models are more sensitive to some perturbations than others. It is crucial to avoid + +over-sensitivity to input perturbations, and understanding why it happens is useful for revealing the weaknesses of current models and designing more robust training methods. To the best of our knowledge, a quantitative measure to interpret the robustness of NLP models to textual perturbations has yet to be proposed. To improve the robustness under perturbation, it is common practice to leverage data augmentation (Li and Specia, 2019; Min et al., 2020; Tan and Joty, 2021). Similarly, how much data augmentation through the perturbation improves model robustness varies between models and perturbations. In this work, we aim to investigate two Research Questions (RQ): + +- RQ1: Why are NLP models less robust to some perturbations than others? + +- RQ2: Why does data augmentation work better at improving the model robustness to some perturbations than others? + +We test a hypothesis for RQ1 that the extent to which a model is affected by an unseen textual perturbation (robustness) can be explained by the learnability of the perturbation (defined as how well the model learns to identify the perturbation with a small amount of evidence). We also validate another hypothesis for RQ2 that the learnability metric is predictive of the improvement on robust performance brought by data augmentation along a perturbation. Our proposed learnability is inspired by the concepts of Randomized Controlled Trial (RCT) and Average Treatment Effect (ATE) from Causal Inference (Rubin, 1974; Holland, 1986). Estimation of perturbation learnability for a model consists of three steps: ① randomly labelling a dataset, ② perturbing examples of a particular pseudo class with probabilities, and ③ using ATE to measure the ease with which the model learns the perturbation. The core intuition for our method is to frame an RCT as a perturbation identification task and formalize the notion of learnability + +
Exp No.MeasurementLabelPerturbationTraining ExamplesTest Examples
0Standardoriginall ∈ ∅(xi,0), (xj,1)(xi,0), (xj,1)
1Robustnessoriginall ∈ {0,1}(xi,0), (xj,1)(xi*,0), (xj*,1)
2Data Augmentationoriginall ∈ {0,1}(xi,0), (xj,1)(xi*,0), (xj*,1)
(xi*,0), (xj*,1)
3Learnabilityrandoml' ∈ {1'}(xj,0'), (xi*,1')(xi*,1')
4randoml' ∈ {1'}(xj,0'), (xi*,1')(xi,1')
+ +Table 1: Example experiment settings for measuring learnability, robustness and improvement by data augmentation. We perturb an example if its label falls in the set of label(s) in "Perturbation" column. $\varnothing$ means no perturbation at all. Training/test examples are the expected input data, assuming we have only one negative $(x_{i},0)$ and positive $(x_{j},1)$ example in our original training/test set. $l^{\prime}$ is a random label and $x^{*}$ is a perturbed example. + +as a causal estimand based on ATE. We conduct extensive experiments on four neural NLP models with eight different perturbations across three datasets and find strong evidence for our two hypotheses. Combining these two findings, we further show that data augmentation is only more effective at improving robustness against perturbations that a model is more sensitive to, contributing to the interpretation of robustness and data augmentation. Learnability provides a clean setup for analysis of the model behaviour under perturbation, which contributes better model interpretation as well. + +Contribution. This work provides an empirical explanation for why NLP models are less robust to some perturbations than others. The key to this question is perturbation learnability, which is grounded in the causality framework. We show a statistically significant inverse correlation between learnability and robustness. + +# 2 Setup and Terminology + +As a pilot study, we consider the task of binary text classification. The training set is denoted as $D_{train} = \{(x_1, l_1), \dots, (x_n, l_n)\}$ , where $x_i$ is the $i$ -th example and $l_i \in \{0, 1\}$ is the corresponding label. We fit a model $f: (x; \theta) \mapsto \{0, 1\}$ with parameters $\theta$ on the training data. A textual perturbation is a transformation $g: (x; \beta) \to x^*$ that injects a specific type of noise into an example $x$ with parameters $\beta$ and the resulting perturbed example is $x^*$ . We design several experiment settings (Table 1) to answer our research questions. Experiment 0 in Table 1 is the standard learning setup, where we train and evaluate a model on the original dataset. Below we detail other experiment settings. + +# 2.1 Definitions + +Robustness. We apply the perturbations to test examples and measure the robustness of model to said perturbations as the decrease in accuracy. In Table 1, Experiment 1 is related to robustness measurement, where we train a model on unperturbed dataset and test it on perturbed examples. We denote the test accuracy of a model $f(\cdot)$ on examples perturbed by $g(\cdot)$ in Experiment 1 as $A_{1}(f,g,D_{test}^{*})$ . Similarly, the test accuracy in Experiment 0 is $A_{0}(f,D_{test})$ . Consequently, the robustness is calculated as the difference of test accuracies: + +$$ +\begin{array}{l} \operatorname {r o b u s t n e s s} (f, g, D) = \mathcal {A} _ {1} (f, g, D _ {\text {t e s t}} ^ {*}) \tag {1} \\ - \mathcal {A} _ {0} (f, D _ {t e s t}). \\ \end{array} +$$ + +Models usually suffer a performance drop when encountering perturbations, therefore the robustness is usually negative, where lower values indicate decreased robustness. + +Improvement by Data Augmentation (Post Augmentation $\Delta$ ). To improve robust accuracy (Tu et al., 2020) (i.e., accuracy on the perturbed test set), it is a common practice to leverage data augmentation (Li and Specia, 2019; Min et al., 2020; Tan and Joty, 2021). We simulate the data augmentation process by appending perturbed data to the training set (Experiment 2 of Table 1). We calculate the improvement on performance after data augmentation as the difference of test accuracies: + +$$ +\begin{array}{l} \Delta_ {\text {p o s t} \text {a u g}} (f, g, D) = \mathcal {A} _ {2} (f, g, D _ {\text {t e s t}} ^ {*}) \tag {2} \\ - \mathcal {A} _ {1} (f, g, D _ {t e s t} ^ {*}) \\ \end{array} +$$ + +where $\mathcal{A}_2(f,g,D_{test}^*)$ denotes the test accuracy of Experiment 2. $\Delta_{\mathrm{post\_aug}}$ is the higher the better. + +Learnability. We want to compare perturbations in terms of how well the model learns to identify them with a small amount of evidence. We cast learnability estimation as a perturbation classification task, where a model is trained to identify the perturbation in an example. We define that the learnability estimation consists of three steps, namely ① assigning random labels, ② perturbing with probabilities, and ③ estimating model performance. Below we introduce the procedure and intuition for each step. This estimation framework is further grounded in concepts from the causality literature in Section 3, which justifies our motivations. We summarize our estimation approach formally in Algorithm 1 (Appendix A). + +① Assigning Random Labels. We randomly assign pseudo labels to each training example regardless of its original label. Each data point has equal probability of being assigned to positive $(l' = 1)$ or negative $(l' = 0)$ pseudo label. This results in a randomly labeled dataset $D_{train}' = \{(x_1, l_1'), \ldots, (x_n, l_n')\}$ , where $L' \sim Bernoulli(1, 0.5)$ . In this way, we ensure that there is no difference between the two pseudo groups since the data are randomly split. + +$②$ Perturbing with Probabilities. We apply the perturbation $g(\cdot)$ to each training example in one of the pseudo groups (e.g., $l^{\prime} = 1$ in Algorithm 1). In this way, we create a correlation between the existence of perturbation and label (i.e., the perturbation occurrence is predictive of the label). We control the perturbation probability $p\in [0,1]$ , i.e., an example has a specific probability $p$ of being perturbed. This results in a perturbed training set $D_{train}^{\prime *} = \{(x_1^*,l_1^{\prime}),\dots,(x_n^*,l_n^{\prime})\}$ , where the perturbed example $x_{i}^{*}$ is: + +$$ +Z \sim U (0, 1), \forall i \in \{1, 2, \dots , n \} +$$ + +$$ +x _ {i} ^ {*} = \left\{ \begin{array}{l l} g \left(x _ {i}\right) & l _ {i} ^ {\prime} = 1 \wedge z < p, \\ x _ {i} & \text {o t h e r w i s e .} \end{array} \right. \tag {3} +$$ + +Here $Z$ is a random variable drawn from a uniform distribution $U(0,1)$ . Due to randomization in the formal step, now the only difference between the two pseudo groups is the occurrence of perturbation. + +Estimating Model Performance. We train a model on the randomly labeled dataset with per + +turbed examples. Since the only difference between the two pseudo groups is the existence of the perturbation, the model is trained to identify the perturbation. The original test examples $D_{test}$ are also assigned random labels and become $D_{test}^{\prime}$ . We perturb all of the test examples in one pseudo group (e.g., $l^{\prime} = 1$ , as in step 2.1) to produce a perturbed test set $D_{test}^{\prime*}$ . Finally, the perturbation learnability is calculated as the difference of accuracies on $D_{test}^{\prime*}$ and $D_{test}^{\prime}$ , which indicates how much the model learns from the perturbation's co-occurrence with pseudo label: + +$$ +\begin{array}{r l} \text {l e a r n a b i l i t y} (f, g, p, D) & = \mathcal {A} _ {3} (f, g, p, D _ {\text {t e s t}} ^ {\prime *}) \\ & - \mathcal {A} _ {4} (f, g, p, D _ {\text {t e s t}} ^ {\prime}). \end{array} \tag {4} +$$ + +$\mathcal{A}_4(f,g,p,D_{test}^{\prime *})$ and $\mathcal{A}_3(f,g,p,D_{test}^\prime)$ are accuracies measured by Experiment 4 and 3 of Table 1, respectively. + +We observe that the learnability depends on perturbation probability $p$ . For each model-perturbation pair, we obtain multiple learnability estimates by varying the perturbation probability (Figure 3). However, we expect that learnability of the perturbation (as a concept) should be independent of perturbation probability. To this end, we use the log AUC (area under the curve in log scale) of the $p$ -learnability curve (Figure 3), termed as "average learnability", which summarizes the overall learnability across different perturbation probabilities $p_1, \ldots, p_t$ : + +$$ +\begin{array}{l} \operatorname {a v g} _ {-} \text {l e a r n a b i l i t y} (f, g, D) := \log A U C (\{(p _ {i}, \\ \text {l e a r n a b i l i t y} (f, g, p _ {i}, D)) \mid i \in \{1, 2, \dots , t \} \}). \end{array} \tag {5} +$$ + +We use $\log AUC$ rather than $AUC$ because we empirically find that the learnability varies substantially between perturbations when $p$ is small, and a log scale can better capture this nuance. We also introduce learnability at a specific perturbation probability (Learnability @ $p$ ) as an alternate summary metric and provide a comparison of this metric against $\log AUC$ in Appendix D. + +# 2.2 Hypothesis + +With the above-defined terminologies, we propose hypotheses for RQ1 and RQ2 in Section 1, respectively. + +Hypothesis 1 (H1): A model for which a perturbation is more learnable is less robust against the same perturbation at the test time. + +This is not obvious because the model encounters this perturbation during training in learnability estimation while they do not in robustness measurement. + +Hypothesis 2 (H2): A model for which a perturbation is more learnable experiences bigger robustness gains with data augmentation along such a perturbation. + +We validate both Hypotheses 1 and 2 with experiments on several perturbations and models described in Section 4.1 and 4.2. + +# 3 A Causal View on Perturbation Learnability + +In Section 2.1, we introduce the term "learnability" in an intuitive way. Now we map it to a formal, quantitative measure in standard statistical frameworks. Learnability is actually motivated by concepts from the causality literature. We provide a brief introduction to basic concepts of causal inference in Appendix B. In fact, learnability is the causal effect of perturbation on models, which is often difficult to measure due to the confounding latent features. In the language of causality, this is "correlation is not causation". Causality provides insight on how to fully decouple the effect of perturbation and other latent features. We introduce the causal motivations for step 2.1 and 2.1 of learnability estimation in the following Section 3.1 and 3.2, respectively. + +# 3.1 A Causal Explanation for Random Label Assignment + +Natural noise (simulated by perturbations in this work) usually co-occurs with latent features in an example. If we did not assign random labels and simply perturbed one of the original groups, there would be confounding latent features that would prevent us from estimating the causal effect of the perturbation. Figure 1a illustrates this scenario. Both perturbation $P$ and latent feature $T$ may affect the outcome $Y$ , while the latent feature is predictive of label $L$ . Since we make the perturbation $P$ on examples with the same label, $P$ is decided by $L$ . It therefore follows that $T$ is a confounder of the effect of $P$ on $Y$ , resulting in non-causal association flowing along the path $P \gets L \gets T \rightarrow Y$ . However, if we do randomize the labels, $P$ no longer has any causal parents (i.e., incoming edges) (Figure 1b). This is because perturbation is purely + +confounding association +![](images/35cca620f12c065bc66a27233ae05bfbc23227ca92cb4aae27a32d38af5499ab.jpg) +(a) Before randomization. + +Figure 1: Causal graph explanation for decoupling perturbation and latent feature with randomization. $P$ is the perturbation and $T$ is the latent feature. $L$ is the original label and $Y$ is the correctness of the predicted label. +![](images/cef2ae93b86b27f0ca52d2a7a45c982d882ec203065c9e890d7eb462f3ffb503.jpg) +(b) After randomization. + +random. Without the path represented by $P \gets L$ , all of the association that flows from $P$ to $Y$ is causal. As a result, we can directly calculate the causal effect from the observed outcomes. + +# 3.2 Learnability is a Causal Estimand + +We identify learnability as a causal estimand. In causality, the term "identification" refers to the process of moving from a causal estimand (Average Treatment Effect, ATE) to an equivalent statistical estimand. We show that the difference of accuracies on $D_{test}^{\prime *}$ and $D_{test}^{\prime}$ is actually a causal estimate. We define the outcome $Y$ of a test example $x_{i}$ as the correctness of the predicted label: + +$$ +Y _ {i} (0) := \mathbf {1} _ {\left\{f \left(x _ {i}\right) = l _ {i} ^ {\prime} \right\}}. \tag {6} +$$ + +where $\mathbf{1}_{\{\cdot\}}$ is the indicator function. Similarly, the outcome $Y$ of a perturbed test example $x_{i}^{*}$ is: + +$$ +Y _ {i} (1) := \mathbf {1} _ {\left\{f \left(x _ {i} ^ {*}\right) = l _ {i} ^ {\prime} \right\}}. \tag {7} +$$ + +According to the definition of Individual Treatment Effect (ITE, see Equation 9 of Appendix B), we have $ITE_{i} = \mathbf{1}_{\{f(x_{i}^{*}) = l_{i}^{\prime}\}} - \mathbf{1}_{\{f(x_{i}) = l_{i}^{\prime}\}}$ . We then take the average over all the perturbed test examples (half of the test set)3. This is our Average Treatment Effect (ATE): + +$$ +\begin{array}{l} A T E = E [ Y (1) ] - E [ Y (0) ] \\ = E \left[ \mathbf {1} _ {\{f (x ^ {*}) = l ^ {\prime} \}} \right] - E \left[ \mathbf {1} _ {\{f (x) = l ^ {\prime} \}} \right] \\ = P \left(f \left(x ^ {*}\right) = l ^ {\prime}\right) - P (f (x) = l ^ {\prime}) \\ = \mathcal {A} (f, g, p, D _ {t e s t} ^ {\prime *}) - \mathcal {A} (f, g, p, D _ {t e s t} ^ {\prime}). \tag {8} \\ \end{array} +$$ + +
PerturbationExample Sentence
NoneHis quiet and straightforward demeanor was rare then and would be today.
Duplicate_punctuationHis quiet and straightforward demeanor was rare then and would be today..
butter_fingers_perturbationHis quiet and straightforward demeanor was rarw then and would be today.
shuffle_wordquiet would and was be and straightforward then demeanor His today. rare
random_upper_transformationHis quiEt and straightforwardARd Demeanor was rare TheN and would be today.
insert_abbreviationHis quiet and straightforward demeanor wuz rare then and would b today.
whitespace_perturbationHis quiet and straightforward demeanor or wa s rare thenand would be today.
visual_attacklettersHis qiēt ànd straightforward demeanor was rare then and would pə tòday.
leetlettersHis qui3t and strai9htfor3ard d3m3an0r 3as rar3 t43n and 30uld 63 t0da4.
+ +Figure 2: An example sentence with different types of perturbations. + +where $\mathcal{A}(f,g,p,D)$ is the accuracy of model $f(\cdot)$ trained with perturbation $g(\cdot)$ at perturbation probability $p$ on test set $D$ . Therefore, we show that ATE is exactly the difference of accuracy on the perturbed and unperturbed test sets with random labels. And the difference is learnability according to Equation 4. + +We discuss another means of identification of ATE in Appendix C, based on the prediction probability. We compare between the probability-based and accuracy-based metrics there. We find that our accuracy-based metric yields better resolution, so we report this metric in the main text of this paper. + +# 4 Experiments + +# 4.1 Perturbation methods + +Criteria for Perturbations. We select various character-level and word-level perturbation methods in existing literature that simulate different types of noise an NLP model may encounter in real-world situations. These perturbations are nonadversarial, label-consistent, and can be automatically generated at scale. We note that our perturbations do not require access to the model internal structure. We also assume that the feature of perturbation does not exist in the original data. Not all perturbations in the existing literature are suitable for our task. For example, a perturbation that swaps gender words (i.e., female $\rightarrow$ male, male $\rightarrow$ female) is not suitable for our experiments since we cannot distinguish the perturbed text from an unperturbed one. In other words, the perturbation function $g(\cdot)$ should be asymmetric, such that $g(g(x)) \neq x$ . + +Figure 2 shows an example sentence with different perturbations. Perturbation of "duplicatepunctuation" doubles the punctuation by appending a duplicate after each punctuation, e.g., + +“,”→“,”; “butter_fingers_perturbation” misspell some words with noise erupting from keyboard typos; “shuffle_word” randomly changes the order of word in the text (Moradi and Samwald, 2021); “random_upper Transformation” randomly adds upper cased letters (Wei and Zou, 2019); “insert_abbreviation” implements a rule system that encodes word sequences associated with the replaced abbreviations; “whitespace_perturbation” randomly removes or adds whitespaces to text; “visual_attackletters” replaces letters with visually similar, but different, letters (Eger et al., 2019); “leet_letter” replaces letters with leet, a common encoding used in gaming (Eger et al., 2019). + +# 4.2 Experimental Settings + +To test the learnability, robustness and improvement by data augmentation with different NLP models and perturbations, we experiment with four modern and representative neural NLP models: TextRNN (Liu et al., 2016), BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019b) and XLNet (Yang et al., 2019). For TextRNN, we use the implementation by an open-source text classification toolkit NeuralClassifier (Liu et al., 2019a). For the other three pretrained models, we use the bert-base-cased, roberta-base, xlnet-base-cased versions from Hugging Face (Wolf et al., 2020), respectively. These two platforms support most of the common NLP models, thus facilitating extension studies of more models in future. We use three common binary text classification datasets — IMDB movie reviews (IMDB) (Pang and Lee, 2005), Yelp polarity reviews (YELP) (Zhang et al., 2015), Quora Question Pair (QQP) (Iyer et al., 2017) — as our testbeds. IMDB and YELP datasets present the task of sentiment analysis, where each sentence is labelled + +![](images/b3eb73ab5c571d7c6bcbb3483ae9351ccbda0703a1e37f8bffab3defed821855.jpg) +Figure 3: Learnability of eight perturbations for four NLP models on three datasets, as a function of perturbation probability. + +
PerturbationXLNetRoBERTaBERTTextRNNAverage over models
whitespace_perturbation1.6381.4361.4920.8781.361
shuffle_word1.7401.5971.7660.5941.424
Duplicatehausenctions1.0861.4991.3472.0501.495
butter_fingers_perturbation1.5901.3691.7881.5631.578
random_upper_transformations1.5831.5201.7212.0391.716
insert_abbreviation1.7831.5851.5642.2191.788
visual_attackletters1.8241.9211.8982.0941.934
leetletters1.8162.1631.8172.4632.065
+ +Table 2: Average learnability (log AUC of corresponding curve in Figure 3) of each model-perturbation pair on IMDB dataset. Rows are sorted by average values over all models. The perturbation for which a model is most learnable is highlighted in bold while the following one is underlined. + +![](images/95367384a13f04e414512c256716a87956c969734073db70e00d28410ce0b1ec.jpg) +(a) Learnability vs. Robustness + +![](images/f7e8a2074cde52ba3fcb972bc605afba6a64987654200e0ecf6811d20efb33fe.jpg) +(b) Learnability vs. Post Aug $\Delta$ + +![](images/2a508a950bf86052f75971c5dd1df079976a0ac2e839a951d9f303a0ef6c320d.jpg) +(c) Learn. vs. Robu. vs. Post Aug $\Delta$ +Figure 4: Linear regression plots of learnability vs. robustness vs. post data augmentation $\Delta$ on IMDB dataset. Each point in the plots represents a model-perturbation pair. $\rho$ is Spearman correlation. * indicates high significance (p-value $< 0.001$ ). + +as positive or negative sentiment. QQP is a paraphrase detection task, where each pair of sentences is marked as semantically equivalent or not. To control the effect of dataset size and imbalanced classes, all datasets are randomly subsampled to the same size as IMDB (50k) with balanced classes. The training steps for all experiments are the same as well. We implement perturbations $g(\cdot)$ with two self-designed ones and six selected ones from the NL-Augmenter library (Dhole et al., 2021). For perturbation probabilities, we choose 0.001, 0.005, 0.01, 0.02, 0.05, 0.10, 0.50, 1.00. We run all experiments across three random seeds and report the average results. + +# 4.3 Perturbation Learnability Analysis + +Figure 3 shows learnability as a function of perturbation probability. Learnability @ $p$ generally increases as we increase the perturbation probability, and when we perturb all the examples (i.e., $p = 1.0$ ), every model can easily identify it well, resulting in the maximum learnability of 1.0. This shows that neural NLP models master these perturbations eventually. At lower perturbation probabilities, some models still learn that perturbation alone predicts the label. In fact, the major difference between different $p$ -learnability curves is the area of lower perturbation probabilities and this provides motivation for using log AUC instead of AUC as the summarization of learnability at different $p$ (Section 2.1). + +Table 2 shows the average learnability over all perturbation probabilities of each model-perturbation pair on IMDB dataset in Figure 3.4 It reveals the most learnable perturbation for each model. For example, the learnability of "visual_attackletters" and "leetletters" are very high for all four models, likely due to their strong effects on the tokenization process (Salesky et al., 2021). Perturbations like "white_space_perturbation" and "Duplicate_pctuations" are less learnable for pretrained models, probably because they have weaker effects on the subword level tokenization, or they may have encountered similar noise in the pretraining corpora. We observe that "duplicatements already exists in the original text of YELP dataset (e.g., "The burgers are awesomewhat violating our assumptions for perturbations in Section 4.1. As a result, the curve for + +
ρIMDBYELPQQP
Avg. learnability vs. robustness-0.643*-0.821*-0.695*
Avg. learnability vs. post aug Δ0.756*0.846*0.750*
+ +Table 3: Correlations of average learnability vs. robustness vs. post data augmentation $\Delta$ . $\rho$ is Spearman correlation. * indicates high significance (p-value $< 0.001$ ). + +this perturbation substantially deviates from others in Figure 3. We do not count this perturbation on YELP dataset in the following analysis. The perturbation learnability experiments provide a clean setup for NLP practitioners to analyze the effect of textual perturbations on models. + +# 4.4 Empirical Findings + +We observe a negative correlation between learnability (Equation 4) and robustness (Equation 1) across all three datasets in Table 2, validating Hypothesis 1. Table 2 also quantifies the trend that data augmentation with a perturbation the model is less robust to has more improvement on robustness (Hypothesis 2). We plot the correlations on IMDB dataset in Figure 4a and 4b. Both the correlations between 1) learnability vs. robustness and 2) learnability vs. improvement by data augmentation are strong (Spearman $|\rho| > 0.6$ ) and highly significant $(p\text{-value} < 0.001)$ , which firmly supports our hypotheses. Our findings provide insight about when the model is less robust and when data augmentation works better for improving robustness. + +Figure 4c shows that the more learnable a perturbation is for a model, the greater the likelihood that its robustness can be improved through data augmentation along this perturbation. We argue that this is not simply because there is more room for improvement by data augmentation. From a causal perspective, learnability acts as a common cause (confounder) for both robustness and improvement by data augmentation. This indicates a potential limitation of using data augmentation for improving robustness to perturbations (Jha et al., 2020): data augmentation is only more effective at improving robustness against perturbations more learnable for a model. + +# 5 Discussion + +Potential Impacts. Our findings seem intuitive but are non-trivial. The NLP models were not trained on perturbed examples when measuring robustness, but still they display a strong correlation with perturbation learnability. Understanding these findings are important for a more principled evaluation of and control over NLP models (Lovering et al., 2020). Specifically, the learnability metric complements to the evaluation of newly designed perturbations by revealing model weaknesses in a clean setup. Reducing perturbation learnability is promising for improving robustness of models. Contrastive learning (Gao et al., 2021; Yan et al., 2021) that pulls the representations of the original and perturbed text together, makes it difficult for the model to identify the perturbation (reducing learnability) and thus may help improve robustness. Perturbation can also be viewed as injecting spurious feature into the examples, so the learnability metric also helps to interpret robustness to spurious correlation (Sagawa et al., 2020). Moreover, learnability may facilitate the development of model architectures with explicit inductive biases (Warstadt and Bowman, 2020; Lovering et al., 2020) to avoid sensitivity to noisy perturbations. Grounding the learnability within the causality framework inspires future researchers to incorporate the causal perspective into model design (Zhang et al., 2020), and make the model robust to different types of perturbations. + +Limitations. In this work, we focus on the robust accuracy (Section 2.1), which is accuracy on the perturbed test set. We do not assume that the test accuracy of the original test set, a.k.a in-distribution accuracy, is invariant invariant against training with augmentation or not. It would be interesting to investigate the trade-off between robust accuracy and in-distribution accuracy in the future. We also note that this work has not established that the relationship between learnability and robustness is causal. This could be explored with other approaches in causal inference for deconfounding besides simulation on randomized control trials, such as working with real data but stratifying it (Frangakis and Rubin, 2002), to bring the learnability experiment closer to more naturalistic settings. Although we restrict to balanced, binary classification for simplicity in this pilot study, our framework can also be extended to imbalanced, multi-class classification. + +We are aware that computing average learnability is expensive for large models and datasets, which is further discussed in Section 8. We provide a greener solution in Appendix D. We could further verify our assumptions for perturbations with a user study (Moradi and Samwald, 2021) which investigates how understandable the perturbed texts are to humans. + +# 6 Related Work + +Robustness of NLP Models to Perturbations. The performance of NLP models can decrease when encountering noisy data in the real world. Recent works (Prabhakaran et al., 2019; Ribeiro et al., 2020; Niu et al., 2020; Moradi and Samwald, 2021) present comprehensive evaluations of the robustness of NLP models to different types of perturbations, including typos, changed entities, negation, etc. Their results reveal the phenomenon that NLP models can handle some specific types of perturbation more effectively than others. However, they do not go into a deeper analysis of the reason behind the difference of robustness between models and perturbations. + +Interpretation of Data Augmentation. Although data augmentation has been widely used in CV (Sato et al., 2015; DeVries and Taylor, 2017; Dwibedi et al., 2017) and NLP (Wang and Yang, 2015; Kobayashi, 2018; Wei and Zou, 2019), the underlying mechanism of its effectiveness remains under-researched. Recent studies aim to quantify intuitions of how data augmentation improves model generalization. Gontijo-Lopes et al. (2020) introduce affinity and diversity, and find a correlation between the two metrics and augmentation performance in image classification. In NLP, Kashefi and Hwa (2020) propose a KL-divergence-based metric to predict augmentation performance. Our proposed learnability metric implies when data augmentation works better and thus acts as a complement to this line of research. + +# 7 Conclusion + +This work targets at an open question in NLP: why models are less robust to some textual perturbations than others? We find that learnability, which causally quantifies how well a model learns to identify a perturbation, is predictive of the model robustness to the perturbation. In future work, we will investigate whether these findings can generalize to other domains, including computer vision. + +# 8 Ethics Statement + +Computing average learnability requires training a model for multiple times at different perturbation probabilities, which can be computationally intensive if the sizes of the datasets and models are large. This can be a non-trivial problem for NLP practitioners with limited computational resources. We hope that our benchmark results of typical perturbations for NLP models work as a reference for potential users. Collaboratively sharing the results of such metrics on popular models and perturbations in public fora can also help reduce duplicate investigation and coordinate efforts across teams. + +To alleviate the computational efficiency issue of average learnability estimation, using learnability at selected perturbation probabilities may help at the cost of reduced precision (Appendix D). We are not alone in facing this issue: two similar metrics for interpreting model inductive bias, extractability and s-only error (Lovering et al., 2020) also require training the model repeatedly over the whole dataset. Therefore, finding an efficient proxy for average learnability is promising for more practical use of learnability in model interpretation. + +# Acknowledgements + +This research is supported by the National Research Foundation, Singapore under its International Research Centres in Singapore Funding Initiative. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of National Research Foundation, Singapore. We acknowledge the support of NVIDIA Corporation for their donation of the GeForce RTX 3090 GPU that facilitated this research. + +# References + +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. +Terrance DeVries and Graham W Taylor. 2017. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552. +Kaustubh D Dhole, Varun Gangal, Sebastian Gehrmann, Aadesh Gupta, Zhenhao Li, Saad Mahamood, Abi + +naya Mahendiran, Simon Mille, Ashish Srivastava, Samson Tan, et al. 2021. Nl-augmenter: A framework for task-sensitive natural language augmentation. arXiv preprint arXiv:2112.02721. +Debidatta Dwibedi, Ishan Misra, and Martial Hebert. 2017. Cut, paste and learn: Surprisingly easy synthesis for instance detection. In 2017 IEEE International Conference on Computer Vision (ICCV), pages 1310-1319. IEEE Computer Society. +Steffen Eger, Gözde Gül Şahin, Andreas Rücklé, Ji-Ung Lee, Claudia Schulz, Mohsen Mesgar, Krishnkant Swarnkar, Edwin Simpson, and Iryna Gurevych. 2019. Text processing like humans do: Visually attacking and shielding NLP systems. 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 1634-1647, Minneapolis, Minnesota. Association for Computational Linguistics. +Constantine E Frangakis and Donald B Rubin. 2002. Principal stratification in causal inference. Biometrics, 58(1):21-29. +Tianyu Gao, Xingcheng Yao, and Danqi Chen. 2021. SimCSE: Simple contrastive learning of sentence embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6894-6910, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Karan Goel, Nazneen Fatema Rajani, Jesse Vig, Zachary Taschdjian, Mohit Bansal, and Christopher Ré. 2021. Robustness gym: Unifying the nlp evaluation landscape. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Demonstrations, pages 42-55. +Raphael Gontijo-Lopes, Sylvia Smullin, Ekin Dogus Cubuk, and Ethan Dyer. 2020. Tradeoffs in data augmentation: An empirical study. In International Conference on Learning Representations. +Paul W Holland. 1986. Statistics and causal inference. Journal of the American statistical Association, 81(396):945-960. +Shankar Iyer, Nikhil Dandekar, and Kornel Csernai. 2017. First quora dataset release: Question pairs. +Rohan Jha, Charles Lovering, and Ellie Pavlick. 2020. Does data augmentation improve generalization in nlp? arXiv preprint arXiv:2004.15012. +Omid Kashefi and Rebecca Hwa. 2020. Quantifying the evaluation of heuristic methods for textual data augmentation. In Proceedings of the Sixth Workshop on Noisy User-generated Text (W-NUT 2020), pages 200-208. + +Sosuke Kobayashi. 2018. Contextual augmentation: Data augmentation by words with paradigmatic relations. 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 452-457. +Zhenhao Li and Lucia Specia. 2019. Improving neural machine translation robustness via data augmentation: Beyond back-translation. In Proceedings of the 5th Workshop on Noisy User-generated Text (W-NUT 2019), pages 328-336, Hong Kong, China. Association for Computational Linguistics. +Liquun Liu, Funan Mu, Pengyu Li, Xin Mu, Jing Tang, Xingsheng Ai, Ran Fu, Lifeng Wang, and Xing Zhou. 2019a. NeuralClassifier: An open-source neural hierarchical multi-label text classification toolkit. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 87-92, Florence, Italy. Association for Computational Linguistics. +Pengfei Liu, Xipeng Qiu, and Xuanjing Huang. 2016. Recurrent neural network for text classification with multi-task learning. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, pages 2873-2879. +Xiao Liu, Da Yin, Yansong Feng, Yuting Wu, and Dongyan Zhao. 2021. Everything has a cause: Leveraging causal inference in legal text analysis. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1928-1941. +Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019b. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692. +Charles Lovering, Rohan Jha, Tal Linzen, and Ellie Pavlick. 2020. Predicting inductive biases of pretrained models. In International Conference on Learning Representations. +Junghyun Min, R Thomas McCoy, Dipanjan Das, Emily Pitler, and Tal Linzen. 2020. Syntactic data augmentation increases robustness to inference heuristics. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2339-2352. +Milad Moradi and Matthias Samwald. 2021. Evaluating the robustness of neural language models to input perturbations. +John Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. 2020. TextAttack: A framework for adversarial attacks, data augmentation, and adversarial training in NLP. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, + +pages 119-126, Online. Association for Computational Linguistics. +Brady Neal. 2020. Introduction to causal inference from a machine learning perspective. *Course Lecture Notes (draft)*. +Xing Niu, Prashant Mathur, Georgiana Dinu, and Yaser Al-Onaizan. 2020. Evaluating robustness to input perturbations for neural machine translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8538-8544. +Bo Pang and Lillian Lee. 2005. Seeing stars: exploiting class relationships for sentiment categorization with respect to rating scales. In Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics, pages 115-124. +Vinodkumar Prabhakaran, Ben Hutchinson, and Margaret Mitchell. 2019. Perturbation sensitivity analysis to detect unintended model 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 5740-5745. +Marco Tulio Ribeiro, Tongshuang Wu, Carlos Guestrin, and Sameer Singh. 2020. Beyond accuracy: Behavioral testing of nlp models with checklist. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4902-4912. +Donald B Rubin. 1974. Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of educational Psychology, 66(5):688. +Shiori Sagawa, Aditi Raghunathan, Pang Wei Koh, and Percy Liang. 2020. An investigation of why overparameterization exacerbates spurious correlations. In International Conference on Machine Learning, pages 8346-8356. PMLR. +Elizabeth Salesky, David Etter, and Matt Post. 2021. Robust open-vocabulary translation from visual text representations. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7235-7252. +Ikuro Sato, Hiroki Nishimura, and Kensuke Yokoi. 2015. Apac: Augmented pattern classification with neural networks. arXiv preprint arXiv:1505.03229. +Samson Tan and Shafiq Joty. 2021. Code-mixing on sesame street: Dawn of the adversarial polyglots. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3596-3616, Online. Association for Computational Linguistics. +Lifu Tu, Garima Lalwani, Spandana Gella, and He He. 2020. An empirical study on robustness to spurious correlations using pre-trained language models. Transactions of the Association for Computational Linguistics, 8:621-633. + +William Yang Wang and Diyi Yang. 2015. That's so annoying!!!: A lexical and frame-semantic embedding based data augmentation approach to automatic categorization of annoying behaviors using #petpeeve tweets. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 2557-2563, Lisbon, Portugal. Association for Computational Linguistics. +Xiao Wang, Qin Liu, Tao Gui, Qi Zhang, et al. 2021. Textflint: Unified multilingual robustness evaluation toolkit for natural language processing. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing: System Demonstrations, pages 347-355, Online. Association for Computational Linguistics. +Alex Warstadt and Samuel R Bowman. 2020. Can neural networks acquire a structural bias from raw linguistic data? In Proceedings of the Annual Meeting of the Cognitive Science Society. +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. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric 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. +Yuanmeng Yan, Rumei Li, Sirui Wang, Fuzheng Zhang, Wei Wu, and Weiran Xu. 2021. ConSERT: A contrastive framework for self-supervised sentence representation transfer. 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 5065-5075, Online. Association for Computational Linguistics. +Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. 2019. Xlnet: generalized autoregressive pretraining for language understanding. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, pages 5753-5763. +Cheng Zhang, Kun Zhang, and Yingzhen Li. 2020. A causal view on robustness of neural networks. Advances in Neural Information Processing Systems, 33:289-301. + +Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. Advances in neural information processing systems, 28:649-657. + +# A Algorithm for Perturbation Learnability Estimation + +Algorithm 1 Learnability Estimation + +
Input: training set Dtrain = +{ (x1, l1), ..., (xn, ln) }, test set Dtest = +{ (xn+1, ln+1), ..., (xn+m, ln+m) }, D = +Dtrain ∪ Dtest, model f : (x;θ) → {0,1}, +perturbation g : (x;β) → x*, perturbation +probability p
Output: learnability(f, g, p, D)
+ +1: // ① assigning random labels +2: Initialize an empty dataset $D^{\prime}$ +3: for $i$ in $\{1,2,\dots,n + m\}$ do +4: $l_{j}^{\prime} \gets \text{randint}[0,1]$ +5: $D^{\prime}\gets D^{\prime}\cup \{(x_{i},l_{i}^{\prime})\}$ + +# 6: end for + +7: // ② perturbing with probabilities + +8: Initialize an empty dataset $D^{\prime *}$ + +9: for $i$ in $\{1, 2, \dots, n + m\}$ do + +10: $z\gets rand(0,1)$ + +11: $x_{i}^{*}\gets x_{i}$ + +12: if $l_i' = 1 \land z < p$ then + +13: $x_{i}^{*}\gets g(x_{i})$ + +# 14: end if + +15: $D^{\prime *} \gets D^{\prime *} \cup \{(x_i^*, l_i')\}$ + +# 16: end for + +17: // ③ estimating model performance +18: $D_{train}^{\prime}, D_{test}^{\prime} \gets D^{\prime}[1:n], D^{\prime}[n + 1:n + m]$ +19: $D_{train}^{\prime *}, D_{test}^{\prime *} \gets D^{\prime *} [1:n], D^{\prime *} [n + 1:n + m]$ + +20: fit the model $f(\cdot)$ on $D_{train}^{t*}$ +21: $\mathcal{A}(f,g,p,D_{test}^{\prime *})\gets f(\cdot)$ accuracy on $D_{test}^{\prime *}$ +22: $\mathcal{A}(f,g,p,D_{test}^{\prime})\gets f(\cdot)$ accuracy on $D_{test}^{\prime}$ +23: return $\mathcal{A}(f,g,p,D_{test}^{\prime *}) - \mathcal{A}(f,g,p,D_{test}^{\prime})$ + +# B Background on Causal Inference + +The aim of causal inference is to investigate how a treatment $T$ affects the outcome $Y$ . Confounder $X$ refers to a variable that influences both treatment $T$ and outcome $Y$ . For example, sleeping with shoes on $(T)$ is strongly associated with waking up with a headache $(Y)$ , but they both have a common cause: drinking the night before $(X)$ (Neal, 2020). In our work, we aim to study how a perturbation (treatment) affects the model's prediction (outcome). However, the latent features and other noise usually act as confounders. + +Causality offers solutions for two questions: 1) + +how to eliminate the spurious association and isolate the treatment's causal effect; and 2) how varying $T$ affects $Y$ , given both variables are causally-related (Liu et al., 2021). We leverage both of these properties in our proposed method. Let us now introduce Randomized Controlled Trial and Average Treatment Effect as key concepts in answering the above two questions, respectively. + +Randomized Controlled Trial (RCT). In an RCT, each participant is randomly assigned to either the treatment group or the non-treatment group. In this way, the only difference between the two groups is the treatment they receive. Randomized experiments ideally guarantee that there is no confounding factor, and thus any observed association is actually causal. We operationalize RCT as a perturbation classification task in Section 3.1. + +Average Treatment Effect (ATE). In Section 3.2, we apply ATE (Holland, 1986) as a measure of learnability. ATE is based on Individual Treatment Effect (ITE, Equation 9), which is the difference of the outcome with and without treatment. + +$$ +I T E _ {i} = Y _ {i} (1) - Y _ {i} (0). \tag {9} +$$ + +Here, $Y_{i}(1)$ is the outcome $Y$ of individual $i$ that receives treatment $(T = 1)$ , while $Y_{i}(0)$ is the opposite. In the above example, waking up with a headache $(Y = 1)$ with shoes on $(T = 1)$ means $Y_{i}(1) = 1$ . + +We calculate the Average Treatment Effect (ATE) by taking an average over ITEs: + +$$ +A T E = E [ Y (1) ] - E [ Y (0) ]. \tag {10} +$$ + +ATE quantifies how the outcome $Y$ is expected to change if we modify the treatment $T$ from 0 to 1. We provide specific definitions of ITE and ATE in Section 3.2. + +# C Alternate Definition of Perturbation Learnability + +In Section 3.2, we propose an accuracy-based identification of ATE. Now we discuss another probability-based identification and compare between them. We can also define the outcome $Y$ of a test example $x_{i}$ as the predicted probability of (pseudo) true label given by the trained model $f(\cdot)$ : + +$$ +Y _ {i} (0) := P _ {f} \left(L ^ {\prime} = l _ {i} ^ {\prime} \mid X = x _ {i}\right) \in (0, 1). \tag {11} +$$ + +Similarly, the performance outcome $Y$ of a perturbed test data point $x_{i}^{*}$ is: + +$$ +Y _ {i} (1) := P _ {f} \left(L ^ {\prime} = l _ {i} ^ {\prime} \mid X = x _ {i} ^ {*}\right) \in (0, 1). \tag {12} +$$ + +For example, for a test example $(x_{i},l_{i}^{\prime})$ which receives treatment $(l_i^{\prime} = 1)$ , the trained model $f(\cdot)$ predicts its label as 1 with only a small probability 0.1 before treatment (it has not been perturbed yet), and 0.9 after treatment. So the Individual Treatment Effect (ITE, see Equation 9) of this example is calculated as $ITE_{i} = Y_{i}(1) - Y_{i}(0) = 0.9 - 0.1 = 0.8$ . We then take an average over all the perturbed test examples (half of the test set) as Average Treatment Effect (ATE, see Equation 10), which is exactly the learnability of a perturbation for a model. To clarify, the two operands in Equation 10 are defined as follows: + +$$ +E [ Y (1) ] := \mathcal {P} (f, g, p, D _ {t e s t} ^ {\prime *}). \tag {13} +$$ + +It means the average predicted probability of (pseudo) true label given by the trained model $f(\cdot)$ on the perturbed test set $D_{test}^{\prime *}$ . + +$$ +E [ Y (0) ] := \mathcal {P} (f, g, p, D _ {t e s t} ^ {\prime}). \tag {14} +$$ + +Similarly, this is the average predicted probability on the randomly labeled test set $D_{test}^{\prime}$ . + +Notice that the accuracy-based definition of outcome $Y$ (Equation 6) can also be written in a similar form to the probability-based one (Equation 11): + +$$ +Y _ {i} (0) := \mathbf {1} _ {\left\{f \left(x _ {i}\right) = l _ {i} ^ {\prime} \right\}} = \mathbf {1} _ {\left\{P _ {f} \left(L ^ {\prime} = l _ {i} ^ {\prime} \mid X = x _ {i}\right) > 0. 5 \right\}} \in \{0, 1 \}. \tag {15} +$$ + +because the correctness of the prediction is equal to whether the predicted probability of true (pseudo) label exceeds a certain threshold (i.e., 0.5). + +The major difference is that, accuracy-based $ITE$ is a discrete variable falling in $\{-1,0,1\}$ , while probability-based $ITE$ is a continuous one ranging from -1 to 1. For example, if a model learns to identify a perturbation and thus changes its prediction from wrong (before perturbation) to correct (after perturbation), accuracy-based $ITE$ will be $1 - 0 = 1$ while probability-based $ITE$ will be less than 1. That is to say, accuracy-based $ATE$ tends to vary more drastically than probability-based if inconsistent predictions occur more often, and thus can better capture the nuance of perturbation learnability. Empirically, we find that accuracy-based + +average learnability varies greatly ( $\sigma = 0.375$ , Table 4) and thus can better distinguish between different model-perturbation pairs than probability-based one ( $\sigma = 0.288$ , Table 4). As a result, we choose accuracy-based ATE as the primary measurement of learnability in this paper. + +# D Investigating Learnability at a Specific Perturbation Probability + +Inspired by Precision @ K in Information Retrieval (IR), we propose a similar metric dubbed Learnability @ $p$ , which is the learnability of a perturbation for a model at a specific perturbation probability $p$ . We are primarily interested in whether a selected $p$ can represent the learnability over different perturbation probabilities and correlates well with robustness and post data augmentation $\Delta$ . + +We calculate the standard deviation $(\sigma)$ of Learnability @ $p$ and average learnability $(\log AUC)$ over all model-perturbation pairs to measure how well it can distinguish between different models and perturbations. Table 4 shows that average learnability is more diversified than all Learnability @ $p$ and diversity $(\sigma)$ peaks at $p = 0.01$ for accuracy-based/probability-based measurement. Accuracy-based Learnability @ $p$ is generally more diversified across models and perturbations than its counterpart. To investigate the strength of the correlations, we also calculate Spearman $\rho$ between accuracy-based/probability-based learnability @ $p$ vs. average learnability/robustness/post data augmentation $\Delta$ over all model-perturbation pairs. Table 4 shows that generally average learnability has stronger correlation than Learnability @ $p$ . Correlations with both robustness and post data augmentation $\Delta$ peak at $p = 0.02$ for accuracy-based/probability-based measurements, and the correlations with average learnability $(0.816^{*} / 0.886^{*})$ are also strong at these perturbation probabilities. + +Overall, Learnability @ $p$ with higher standard deviation correlates better with average learnability, robustness and post data augmentation $\Delta$ . Our analysis shows that if $p$ is carefully selected by $\sigma$ , Learnability @ $p$ is also a promising metric, though not as accurate as average learnability. One advantage of Learnability @ $p$ over average learnability is that it costs less time to obtain learnability at a single perturbation probability. + +# E Additional Experiment Results + +
pAccuracy-based Learnability @ pProbability-based Learnability @ p
σAvg Learn.Robu.Post Aug ΔσAvg Learn.Robu.Post Aug Δ
Avg.0.3751.000*-0.643*0.756*0.2881.000*-0.652*0.727*
0.0010.1820.426*-0.2650.2590.1140.367*-0.2790.288
0.0050.2350.637*-0.383*0.522*0.1920.925*-0.620*0.702*
0.010.2630.741*-0.530*0.635*0.1920.893*-0.567*0.586*
0.020.2570.816*-0.636*0.743*0.1920.886*-0.686*0.690*
0.050.2360.279-0.1580.1360.1210.576*-0.371*0.350*
0.10.2410.354*-0.1620.1920.1150.543*-0.2880.258
0.50.0940.0240.155-0.1790.037-0.0800.114-0.258
1.00.011-0.1990.252-0.3320.019-0.2200.294-0.402*
+ +Table 4: Standard deviations $(\sigma)$ of Learnability @ $p$ and Spearman correlations between accuracy-based/probability-based learnability @ $p$ vs. average learnability/robustness/post data augmentation $\Delta$ over all model-perturbation pairs on IMDB dataset. * indicates significance (p-value < 0.05). + +![](images/4e28f856bf097570481977ae4ce899ecca61aea0bc611ffb8938b6e5d0224264.jpg) +(a) Learnability vs. Robustness + +![](images/09881341432855068f43b444bb2ffccc65b67bd5faf6f485dec7b705085d30cb.jpg) +(b) Learnability vs. Post Aug $\Delta$ + +![](images/c0aa635da41422278fbd7a785621b345b36504b41372df3033a4d9a1c268c05c.jpg) +(c) Learn. vs. Robu. vs. Post Aug $\Delta$ +Figure 5: Linear regression plots of learnability vs. robustness vs. post data augmentation $\Delta$ on YELP dataset. Each point in the plots represents a model-perturbation pair. $\rho$ is Spearman correlation. * indicates high significance (p-value $< 0.001$ ). + +![](images/f0816eb7f4e64fbc923eba694db65583ea9eaa08621e450c74acb5f427fff959.jpg) +(a) Learnability vs. Robustness + +![](images/b98f9c4159fe4c10a8e9d7313b7f65e69d1a8936c01df471472ed8f2fd2a5fd3.jpg) +(b) Learnability vs. Post Aug $\Delta$ + +![](images/7721a2580fca154f5971c76d5714e045df810acdca4414da2764efe5d16da49e.jpg) +(c) Learn. vs. Robu. vs. Post Aug $\Delta$ +Figure 6: Linear regression plots of learnability vs. robustness vs. post data augmentation $\Delta$ on QQP dataset. Each point in the plots represents a model-perturbation pair. $\rho$ is Spearman correlation. * indicates high significance (p-value $< 0.001$ ). + +
PerturbationRoBERTaXLNetTextRNNBERTAverage over models
shuffle_word1.5381.5860.4011.8541.345
butter_fingers_perturbation1.3011.4331.4251.7581.479
whitespace_perturbation1.2761.4491.7201.5691.504
insert_abbreviation1.4371.3702.2411.5721.655
random_upper Transformation1.4321.8281.7331.7151.677
visual_attackletters2.0602.0062.0301.8081.976
leetletters2.0831.9472.3591.8242.053
+ +Table 5: Average learnability (log AUC of corresponding curve in Figure 3) of each model-perturbation pair on YELP dataset. Rows are sorted by average values over all models. The perturbation for which a model is most learnable is highlighted in bold while the following one is underlined. + +
PerturbationRoBERTaTextRNNXLNetBERTAverage over models
whitespace_perturbation0.7320.3990.5620.7110.601
Duplicate punctuations0.7220.8230.6400.8720.764
butter_fingers_perturbation0.5550.8780.7751.0220.808
insert_abbreviation0.8201.4400.9601.2061.107
random_upper_transformation1.0620.6641.3921.4831.150
shuffle_word1.2310.8161.5521.6231.306
visual_attackletters1.4291.8101.7441.6081.648
leetletters1.7201.6761.8401.7181.738
+ +Table 6: Average learnability (log AUC of corresponding curve in Figure 3) of each model-perturbation pair on QQP dataset. Rows are sorted by average values over all models. The perturbation for which a model is most learnable is highlighted in bold while the following one is underlined. \ No newline at end of file diff --git a/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/images.zip b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fe238f9fe3496907722ce0b0113211500ad41240 --- /dev/null +++ b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:210fa02c955e7f2d5c03366e0ec51c38bb79d4b014a46e5483907f1dd359b458 +size 787255 diff --git a/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/layout.json b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..1ae8cd493f715597c550193e332e2f347e13aa9e --- /dev/null +++ b/interpretingtherobustnessofneuralnlpmodelstotextualperturbations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9026fe6fe5417e4a4bc09a4f637340160e452e4ac4545f2203e003bb756b8289 +size 572279 diff --git a/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_content_list.json b/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e2a77c7a4e4a5f491c875122b342f5b994169a7f --- /dev/null +++ b/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d71abba1999b7b88b0c65637b3e6ad7fbd3a271548ee0da684fa9830ea60c67 +size 80362 diff --git a/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_model.json b/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1fde416f25a62f5d7908ee380c2090ae760298d7 --- /dev/null +++ b/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b5f67e427c20710845f48cdf70c6e155f23a1fa8e6d63c7b8a4cb1123c2176c +size 97004 diff --git a/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_origin.pdf b/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4cad1a964bc78a6d8db6909e0a90732aec316b4c --- /dev/null +++ b/inverseisbetterfastandaccuratepromptforfewshotslottagging/5f439dcd-1bd6-4a01-a51b-563a450130ed_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17dd25801068f4550a067bd18d326233cb2c73a488cd4ed1639e4ed840d21f9b +size 797653 diff --git a/inverseisbetterfastandaccuratepromptforfewshotslottagging/full.md b/inverseisbetterfastandaccuratepromptforfewshotslottagging/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ae0736c1aa142db05660d4253d302986c463ea0f --- /dev/null +++ b/inverseisbetterfastandaccuratepromptforfewshotslottagging/full.md @@ -0,0 +1,317 @@ +# Inverse is Better! Fast and Accurate Prompt for Few-shot Slot Tagging + +Yutai Hou*, Cheng Chen*, Xianzhen Luo, Bohan Li, Wanxiang Che† +Research Center for Social Computing and Information Retrieval, Harbin Institute of Technology +{ythou, cchen, xzluo, bhli, car} @ir.hit.edu.cn + +# Abstract + +Prompting methods recently achieve impressive success in few-shot learning. These methods modify input samples with prompt sentence pieces, and decode label tokens to map samples to corresponding labels. However, such a paradigm is very inefficient for the task of slot tagging. Since slot tagging samples are multiple consecutive words in a sentence, the prompting methods have to enumerate all n-grams token spans to find all the possible slots, which greatly slows down the prediction. To tackle this, we introduce an inverse paradigm for prompting. Different from the classic prompts mapping tokens to labels, we reversely predict slot values given slot types. Such inverse prompting only requires a one-turn prediction for each slot type and greatly speeds up the prediction. Besides, we propose a novel Iterative Prediction Strategy, from which the model learns to refine predictions by considering the relations between different slot types. We find, somewhat surprisingly, the proposed method not only predicts faster but also significantly improves the effect (improve over 6.1 F1-scores on 10-shot setting) and achieves new state-of-the-art performance. + +# 1 Introduction + +Few-shot learning (FSL) aims at learning a model from only a few examples and is regarded as one of the key steps toward more human-like artificial intelligence (Wang et al., 2020). Recently, prompt-based methods achieve impressive results and show promising prospects for few-shot learning of Natural Language Processing (NLP) (Liu et al., 2021a; Zhao et al., 2021). + +Prompt-based methods reformulate a target task into the language modeling problem, which takes advantages of the powerful pretrained Language Models (LM) (Devlin et al., 2019; Liu et al., 2019; + +![](images/ed6a3a930ddd2b37d77ddc61019bb737f61948a6365fe10689b79c122b499a29.jpg) +Figure 1: An example of normal (a) and inverse (b) prompting methods for slot tagging. For normal prompts, identifying all slots in the query sentence requires enumeration of all spans, while inverse prompt only needs 1-time prediction for each label. + +Lewis et al., 2020; Brown et al., 2020). For example, when classifying the sentiment of the movie review "no reason to watch", prompting methods insert a piece of text "It was", i.e. prompts, to the input example, getting "No reason to watch. It was ____". It is natural to expect a higher probability from the LM to fill the template with "terrible" than "great", and the original task is then converted to a language modeling task. Such conversion reduces the gap between pretraining and target tasks, which allows less dependency on target task data and helps to achieve better performance in low data scenarios (Gao et al., 2021). + +However, while achieving great success in sentence level tasks, prompting-based methods show incompatibility for sequence labeling tasks, such as slot tagging. Firstly, the aforementioned prompting paradigm is quite inefficient for slot tagging tasks. Different from the sentence-level tasks that classify samples of whole sentences, slot tagging sam + +plies are multiple consecutive words in a sentence. Therefore, as shown in Fig. 1, to find all the possible slots, prompt-based methods have to enumerate all n-gram word spans, and then query LM for each of them, which greatly slows down the prediction (Cui et al., 2021). Further, as a structure prediction problem, slot tagging benefits from taking the dependencies between labels into account (Ma and Hovy, 2016; Hou et al., 2020). For example in Fig. 1, where the arrival entity often appears after a departure entity. Such label dependency is hard to be captured by current prompting methods since they predict labels one-by-one independently. + +To tackle the above issues, we introduce an inverse paradigm for prompting. Different from the classic prompts mapping tokens to labels, we reversely predict slot values given slot types. For the example in Fig. 1, we use an inverse prompt to modify the input as "book a flight from Beijing to New York tomorrow morning. ____", and then LM is able to decode multi-word span "New York" at a time. Compared to the classic prompts that require predictions for every n-gram word span (55-times in Fig. 1), we only need to perform decoding for $V$ -times, where $V$ is the number of label types (4-times in Fig. 1), which therefore greatly speeds up the prediction. Surprisingly, experiments show the proposed method not only predicts faster but also significantly improves the performance, indicating that prompting LM reversely is a better fit for the slot tagging task. Besides, to further improve the prediction accuracy, we propose a novel Iterative Prediction Strategy, from which the model learns to refine predictions by considering the relations between different slot types. + +To summarize the contribution of this work: + +(1) We introduce the idea of inverse prediction to prompting methods for slot tagging tasks, which greatly speeds up the prediction process. +(2) We propose an Iterative Prediction Strategy for learning and prediction with slot tagging prompts, which allows the prompting model to consider dependency between different slot types and refine prediction. +(3) We extensively evaluate the proposed method in various few-shot settings, where the proposed method brings significant improvements not only in speed but also in accuracy. + +The code and data are available at https://github.com/AtmaHou/ PromptSlotTagging. + +# 2 Background + +In this section, we begin with a formal definition of the few-shot slot tagging task (§2.1), and then introduce the conventional sequence labeling approaches (§2.2) and recent prompts-based methods (§2.3) for this task. + +# 2.1 Few Shot Slot Tagging + +Slot tagging aims at finding key slots within a sentence, such as time or location entities. Given an input sentence $\pmb{x} = (x_{1}, x_{2}, \ldots, x_{n})$ as a sequence of words, a slot tagging model extracts all $M$ slot label-values pairs $\pmb{y} = \{(l_{i}, s_{i})\}_{i=1}^{M}$ in the sentence, where $l_{i}$ is the $i$ th label in the label set $L$ and $s_{j}^{k} = \{x_{j}, \ldots, x_{k}\}$ is a word span starting from $x_{j}$ and ending with $x_{k}$ . + +In few-shot settings, model are often evaluated on multiple low-resource domains $\{D_L^{(1)},D_L^{(2)},\ldots \}$ which is called target domain (Wang et al., 2020). Each target domain $D_{L}^{(j)}$ only contains a few labeled instances called support set $S = \{(x^{(i)},y^{(i)})\}_{i = 1}^{NS}$ , which usually includes $K$ examples (K-shot) for each of $N$ labels (N-way). On each target domain, given support set examples as references, few-shot slot tagging models are required to make predictions for query set samples. Optionally, some few-shot settings also include a set of data-rich domains $\{D_H^{(1)},D_H^{(2)},\ldots \}$ called source domains, which are used for pretraining of few-shot models. + +# 2.2 Conventional Sequence Labeling Approaches + +Conventional approaches often formulate slot tagging as a sequence labeling problem, where each word in input is associated with a sequence label. Given sentence $\pmb{x} = (x_{1}, x_{2}, \dots, x_{n})$ as input, these method predicts the best-match sequence labels $\pmb{y} = (y_{1}, y_{2}, \dots, y_{n})$ . To predict slots with multiple words, sequence labeling approaches adopt a "BIO" labeling strategy, which uses "B" to mark the begin word of a slot, "I" to mark the inner words of a slot and "O" to mark non-slot words. For the example in the Fig. 2, B-time is tagged to the first word in a time slot, I-time is tagged to a nonbegin word within a time slot, and O label refers to non-slot words. As shown in Fig. 2(a), few-shot + +![](images/9f08cb50b93adb0d4e6ee599854e3ef4fb67a9e8ddd45daf2c18d8e629946c8c.jpg) +(a) + +![](images/fdfdaf35725451795a2e57991a27450193ae61c717833a3398cd0eb44592d2e7.jpg) +(b) +Figure 2: Illustration of conventional sequence labeling method (a) and classic prompting methods (b). + +sequence labeling model is usually formulated as: + +$$ +\begin{array}{l} \boldsymbol {h} _ {1: n} = \operatorname {E n c o d e r} \left(\boldsymbol {x} _ {1: n}\right), \\ p (\boldsymbol {y} _ {i} | \boldsymbol {x}, S) = \operatorname {S o f t m a x} \left(\operatorname {D e c o d e r} \left(\mathrm {h} _ {\mathrm {i}}\right)\right), \\ (i \in [ 1, 2, \dots , n ]), \\ \boldsymbol {y} ^ {*} = (y _ {1}, y _ {2}, \dots , y _ {n}) = \underset {\boldsymbol {y}} {\arg \max } p (\boldsymbol {y} | \boldsymbol {x}, S), \\ \end{array} +$$ + +where $S$ is a K-shot support set, Encoder is usually a pretrained language model such as BERT (Devlin et al., 2019), $\pmb{h}_{1:n}$ is the hidden state of the encoder with a dimension $d_h$ , and Decoder can either be a linear layer, a CRF layer or any other parametric or non-parametric classifier. + +# 2.3 Sequence Labeling with Prompts + +Prompt-based methods have been proven effective in many NLU tasks, especially in few-shot settings, but things become complicated when it comes to slot tagging tasks. To identify the slot label for a word span $s_i^j = \{x_i, \dots, x_j\}$ in sentence $\mathbf{x}$ , previous works construct templates, e.g., "[x] [s_i^j] is a [z] entity", and prompt a pretrained language model with such templates to predict label-related words $[z]$ (Cui et al., 2021). For example in the Fig. 2(b), predicting the time slot can be achieved as "book a flight from Beijing to New York tomorrow morning. tomorrow morning is a time entity." However, to find all possible slots, these methods need to traverse all the n-gram spans $s_i^j$ , $i, j \in [1, n]$ in a sentence, which is quite expensive in time and computation. + +# 3 Method + +To remedy the high cost of prompt prediction mentioned in the previous section, we introduce a novel inverse paradigm for prompting of slot tagging task, which significantly improves the speed of prediction by transforming the past fill-in-the-blank problem into a generative task. Specifically, we first introduce the construction of our inverse prompts templates (§3.1), and then describe how to use inverse prompts during training and inference (§3.2). + +Further, we propose an Iterative Prediction Strategy to refine prediction by considering the relation between different slot types (§3.3). The overview of proposed method is shown in Fig. 3. + +# 3.1 Prompt Creation + +In this section, we introduce the creation of the proposed inverse prompts, which includes three main components: the label mapping, the inverse template and the control tokens. + +Label Mapping Before prompt construction, we first need to convert each label into a word form that can be easily understood by the pre-trained language model. We employ a label mapping process to achieve this, which use a one-to-one mapping function to convert the label set $L = \{l_1, \dots, l_{|L|}\}$ to a natural language word set $\hat{L} = \{\hat{l}_1, \dots, \hat{l}_{|L|}\}$ . For example, in Fig. 3, we convert the label set $\mathbf{L} = \{\text{from}, \text{Loc}, \text{to}, \text{Loc}, \text{Time}, \text{Price}\}$ to a natural language label set $\hat{L} = \{\text{departure}, \text{arrival}, \text{time}, \text{price}\}$ . + +Inverse Template Prompt template is a piece of sentence with blanks, which is used to modify the original inputs and get prompting inputs for a pretrained language model. To achieve inverse prompting, our template fills in an original sentence and a label as prefixes and subsequently leaves blanks for the LM to generate the corresponding slot values. Specifically, given an input sentence $s$ and a set of mapped labels $\hat{L}$ , for each mapped label $\hat{l}_i \in \hat{L}$ , the inverse template is defined as: + +$$ +\text {"} \boldsymbol {x} \text {"} \hat {l _ {i}} \text {r e f e r s t o} +$$ + +For instance, in Fig. 3, we fill the input "book a flight from beijing to new york tomorrow morning" and each label in $\hat{L}$ into the template to get four prompted inputs $p$ : + +"book a flight from beijing to new york tomorrow morning" departure refers to +"book a flight from beijing to new york tomorrow morning" arrival refers to + +![](images/43fe3683f49da3fd5436d70925bf62de73fb04b038c34cdddc6d9cce0299cefb.jpg) +Figure 3: Overview of the proposed method with Inverse Prediction and Iterative Prediction Strategy. We first embed the input sentence with inverse prompts and directly decode slot values given slot types. Then we iteratively refine predictions by reinforcing the prompts with predicted slot-value pairs. + +"book a flight from beijing to new york tomorrow morning" time refers to _ "book a flight from beijing to new york tomorrow morning" price refers to + +Control tokens Additionally, we introduce control tokens $C$ to complete the prompts function for the slot tagging task. In order to recognize the case that there's no corresponding entity of the queried slot type, we introduce token to pad the output, and in practice, we use "none" as token to make the model output more natural. In order to tag more than one entity of the same slot type, we introduce "; as to divide more than one entity of the same slot type. And we also use "." as token to indicate the end of a single generation. + +# 3.2 Training and Inference with Inverse Prompts + +Till now, we have presented the construction of the inverse prompt. This section will show how to perform training and inference with the prompts. + +Training At the training time, we pre-construct the prompt with answers such as "book a flight from beijing to new york tomorrow morning" departure refers to new york. Then we finetune a pre-trained language model with the answered prompts, and we only calculate loss on the answer tokens (i.e. new york) instead of the loss on the whole sentence. + +$$ +L = \sum_ {i > | \boldsymbol {p} |} \mathrm {C E} \left(\hat {y} _ {\mathrm {i}}, \mathrm {y} _ {\mathrm {i}}\right) +$$ + +where $|\pmb{p}|$ is the length of the prompted input, $\hat{y}_i$ denotes the model predictions, and $y_i$ is the pre-constructed answer. + +Inference At the inference time, we feed the prompted inputs into the fine-tuned pre-trained language model and let LM generate the appeared slot values. During generation, we restrict LM to generate only words that appear in the original input sentence or predefined control words. For each prompted input $\pmb{p}$ , the next token $t_k \in x \cup C$ is determined by language model probability: + +$$ +\boldsymbol{t}_{k} = \operatorname *{arg max}_{\boldsymbol{t}_{k}\in \boldsymbol {s}\cup \boldsymbol{C}}\boldsymbol{p}_{\mathrm{LM}}(\boldsymbol{t}_{k}|\boldsymbol {p};\boldsymbol{t}_{1:k - 1}) +$$ + +Note that restricting the scope of output tokens is crucial to the performance. + +# 3.3 Iterative Prediction Strategy + +In the previous section, different slot types are predicted separately. To consider the relations between different slot types, we introduce the Iterative Prediction Strategy, which also provides the model a second chance to revise those unrecognized entities. We assume that different labels are interactive, so the predicted slots could be used as a hint to help predict the missed slots. For example in Fig. 3, it is often easier to generate the "arrival" slot given the results of "departure" and "time". Motivated by this, as shown in the Fig. 3, we construct another template that concatenates those filled prompts as additional generation conditions and use them to revise the slot values that are "none" in the first round of prediction. Below we describe the details of this strategy during training and testing. + +Training At the training time, we simulate the cases where the slots are not recognized to enable the model to revise the none slot values. We do this by randomly constructing none slot value examples. For example, at training time, suppose there + +are four training prompts filled with true answers: "book a flight from beijing to new york tomorrow morning" departure refers to beijing. + +"book a flight from beijing to new york tomorrow morning" arrival refers to new york. + +"book a flight from beijing to new york tomorrow morning" time refers to tomorrow morning. + +"book a flight from beijing to new york tomorrow morning" price refers to none. + +We randomly select some occurred labels (e.g., "arrival") pretending it was not predicted, and construct a second round prompt: + +"book a flight from beijing to new york tomorrow morning" departure refers to beijing. time refers to tomorrow morning. price refers to none. arrival refers to + +By using these second round prompts for model training, we encourage the language model to find those unrecognized slots in the first round prediction and allow the model to consider relationships between labels. + +Inference During the inference time, we construct the second-round prompts and revise the slots that are not recognized in the first round. For example in the Fig. 3, the model predict none value for "price" and "arrival" slot in the first round. We then construct another iteration of the prompted inputs that query the unrecognized slots, given all the labels and slot values that have been predicted: "book a flight from beijing to new york tomorrow morning" departure refers to beijing . time refers to tomorrow morning . arrival refers to + +"book a flight from beijing to new york tomorrow morning" departure refers to beijing. time refers to tomorrow morning. price refers to + +The model is expected to predict the first-round missed slots during the second iteration, considering relations between labels. + +# 4 Experiment + +We evaluate the performance of the proposed method on two classic few-shot scenarios: (1) Setting with Only In-domain data, where all training data are only a few labeled support data. (2) Setting with Meta Source Tasks, where some additional data-rich source domains are available for pretraining. + +Evaluation To use same evaluation criteria as conventional sequence labeling methods, we need to label tokens reversely and get output in same + +format. After generation, we first separate outputs into slot values. For each slot value, we label tokens in the source sentence with three principles: (1) Slot value is complete: only if the whole slot value matches a span in the source sentence, we label it with the corresponding label. (2) Choose the first overlap predicted slot span: if any token in the source sentence has been labeled, we do not relabel this token even when it matches another slot value. (3) Use BIO labels: add “B-” to the beginning token of the slot span, add “I-” to the non-begin token of the slot span, and label non-slot tokens with “O”. After labeling tokens reversely, we evaluate F1 scores within each few-shot episode. + +# 4.1 Setting with Only In-domain data + +Datasets For few-shot setting without source domain transfer, we conduct experiments on three few-shot datasets with only in-domain data: MIT-Restaurant Review (Liu et al., 2013), MIT-Movie Review (Liu et al., 2013) and MIT-Movie-Hard Review. We conduct experiments with $K \in \{10, 20, 50, 100, 200, 500\}$ shots settings to fully evaluate the performance of our method in all three datasets. To overcome the randomness associated with support set selection, we sample 10 different support set for each $K$ -shot setting and report averaged results. All models are trained and tested with the same data. + +**Implements** Our model employs the smallest GPT2 (Radford et al., 2019) pre-trained model as the base model for fine-tuning, and no new parameters are introduced. Besides, we set the learning rate as $6.25e - 5$ and batch size as 2 for few-shot training. For all our experiments, we finetune the model only on few-shot support set for 2 epochs (4 on 10/20 shots settings) with the AdamW optimizer and linear decaying scheduler. Since there is no development set, all hyperparameters are roughly set based on experience without tuning. Data and code used are public available. + +Baselines In our experiments, we compare with competitive baselines including both conventional sequence labeling methods and recent prompt-based methods. + +
ModelMIT-Restaurant
102050100200500
Wiseman and Stratos (2019) + PT4.13.64.04.65.58.1
Ziyadi et al. (2020) + PT27.629.531.233.734.534.6
Huang et al. (2020) + PT46.148.249.650.050.1-
Sequence Labeling BART + PT8.811.142.745.347.858.2
Sequence Labeling BERT + PT27.240.956.357.458.675.3
Template-based BART + PT53.160.364.167.372.275.7
Sequence Labeling BERT21.839.452.753.557.461.3
Template-based BART46.057.158.760.162.865.0
Ours49.3560.4865.3470.4173.6976.13
Ours + Iterative52.1061.4966.8370.9873.9776.37
ModelMIT-Movie-Hard
102050100200500
Wiseman and Stratos (2019) + PT3.14.54.15.35.48.6
Ziyadi et al. (2020) + PT40.139.540.240.040.039.5
Huang et al. (2020) + PT36.436.838.038.235.438.3
Sequence Labeling BART + PT13.630.447.849.155.866.9
Sequence Labeling BERT + PT28.345.250.052.460.776.8
Template-based BART + PT42.454.259.665.369.680.3
Sequence Labeling BERT25.242.249.6450.759.374.4
Template-based BART37.348.552.256.362.074.9
Ours52.0759.1165.6369.3572.3675.03
Ours + Iterative53.3160.1966.1369.6372.4574.83
ModelMIT-Movie
102050100200500
Sequence Labeling BERT50.6059.3471.33---
NNShot50.4758.9471.17---
StructShot53.1961.4272.07---
Template-based BART49.3059.0965.13---
EntLM57.3162.3671.93---
Ours57.0467.8676.8180.2882.4384.55
Ours + Iterative59.7470.0977.6080.6382.6484.51
+ +Table 1: F1 scores of few-shot slot tagging task on three different datasets.10 indicates 10 instances for each entity type. +PT denotes the model is pre-trained on additional datasets. +Iterative denotes enhance model with Iterative Prediction Strategy. + +- Sequence Labeling BERT (Devlin et al., 2019) can be seen as a BERT-based sequence labeling baseline which fine-tunes the BERT model with a token-level linear classifier head. +- Template-based BART (Cui et al., 2021) is a prompt-based method that query BART-based LM (Lewis et al., 2020) every possible span in sentence if it belong to a certain category and therefore also need to enumerate all label for inference. +- NNShot and StructShot (Yang and Katiyar, 2020) are two metric-based few-shot learning approaches for slot tagging and NER. NNShot is an instance-level nearest neighbor classifier for few-shot prediction, and StructShot promotes NNShot with a Viterbi algorithm during decoding. +- EntLM (Ma et al., 2021b) is a prompt-based method that leverage substitution between words of the same type to achieve one pass prediction. + +Results Table 1 shows the results of the proposed method only finetuned on few-shot in-domain data. Among these results, we can observe that: + +(1) Our proposed method performs consistently better than all the baseline methods on all three datasets. It outperforms the strongest baseline Template-based BART which uses BART-large by average F1 scores on three datasets of 11.96 in 10-shot setting even with a much smaller pre-trained language model (the smallest GPT2). +(2) Our proposed method is even comparable or outperforms those baselines with data-rich domain pre-training. +(3) Our proposed method performs much better than baselines in fewer labeled samples settings, especially in 10 and 20 shot settings, which indicates our method can leverage information from limited labeled data more efficiently. + +
Model5-shot Slot TaggingAve.
WeMuPlBoSeReCr
Bi-LSTM25.4439.6945.3673.5855.0340.3040.4945.70
SimBERT53.4654.1342.8175.5457.1055.3032.3852.96
TransferBERT56.0143.8550.6514.1923.8936.9914.2934.27
MN38.8037.9851.9770.6137.2434.2972.3449.03
WPZ+BERT69.0657.9744.4471.9774.6251.0169.2262.61
TapNet+CDT67.8368.7273.7486.9472.1269.1966.5472.15
L-WPZ+CDT78.2362.3659.7476.1983.6669.6971.5171.62
L-TapNet+CDT69.5864.0974.9385.3783.7669.8973.8074.49
ConVEx*71.577.679.084.584.073.867.476.8
Ours70.4471.6378.6787.3781.3871.7774.4276.53
Ours + Iterative70.6371.9778.7387.3481.9572.0774.4476.73
+ +Table 2: F1 score results on 5-shot Snips. * denotes using additional Reddit data for pretraining. Our methods achieve the best performance among those using same training data. + +(4) Our method significantly outperformed Sequence Labeling BERT whose performance is quite poor on 10 and 20 shot settings, which indicates that the number of labeled data is too scarce for conventional sequence labeling tasks, and proves that the prompt-based method is effective in few-shot slot tagging tasks. + +(5) The proposed Iterative Prediction Strategy consistently improves the slot tagging performance. The improvements become greater with fewer learning shots and the averaged improvement in 10 and 20 shot setting on three datasets are 2.23 and 1.44. This shows that when there is less data, the iterative revising mechanism is more important. + +# 4.2 Setting with Meta Source Tasks + +Datasets We also evaluate the model ability of transferring from data-rich domains to unseen few-shot domains and conduct experiments on SNIPS (Coucke et al., 2018) dataset. Following the data split provided by Hou et al. (2020), we construct 5-shot SNIPS datasets from the original SNIPS datasets. The few-shot SNIPS dataset consists of 7 domains with different label sets: GetWeather (We), Music (Mu), PlayList (Pl), Rate-Book (Bo), SearchScreenEvent (Se), BookRestaurant (Re), and SearchCreativeWork (Cr). Each domain contains 100 few-shot episodes, and each episode consists of a support set and a query. + +Implements Following Henderson and Vulic (2021), we conduct our cross-domain experiments with 5-shot few-shot settings to evaluate the ability of our model to transfer from rich-data domains to unseen few-shot domains. For our proposed method, same as in-domain settings, we use the + +smallest GPT2 as the base model, and no new parameters are introduced. We pretrain the model in source domains and fine-tune it on the target few-shot domain. We set learning rate as $6.25e - 5$ and batch size as 16 for pretraining and batch size as 2 for 5-shot finetuning. During finetuning, we use the same AdamW optimizer and linear decaying scheduler. The hyper-parameters are decided according to performance on the dev set. Data and code used are public available. + +Baselines We provided competitive strong baselines, including traditional finetune-based methods and advanced few-shot learning methods. + +- Bi-LSTM (Schuster and Paliwal, 1997) uses GLoVe (Pennington et al., 2014) embedding for slot tagging and is trained on the support sets. +- SimBERT is a metric-based method using cosine similarity of BERT-based embedding to label tokens with the most similar token's label. +- Matching Network (MN) (Vinyals et al., 2016) is a few-shot sequence labeling model based on the matching network and uses BERT embedding. +- TransferBERT is a domain transfer-based conventional NER model using BERT, which is first pre-trained on source domains and then fine-tuned on the target domain support set. +- WPZ (Fritzler et al., 2019) is a metric-based few-shot slot tagging method similar to MN, but is based on the prototypical network (Snell et al., 2017). +- TapNet+CDT, L-TapNet+CDT, L-WPZ+CDT (Hou et al., 2020) are metric-based few-shot learning methods designed for slot tagging, which in + +produces a CRF-based framework to consider the relation between different slots. + +- ConVEx (Henderson and Vulic, 2021) is a fine-tuning-based method that models slot tagging as a cloze task and is first pre-trained on Reddit data then fine-tuned on few-shot slot tagging data. Note that the Reddit data is not used by our method and other baselines during the experiments. + +Results Table 2 shows the results of the cross-domain few-shot setting, from which we can observe that: + +(1) Our proposed method outperforms all the baselines except ConVEx which uses extra Reddit data in the cross-domain 5-shot setting. Despite using less training data, our model still achieves comparable results with Covex, proving its superiority. +(2) We outperform TransferBERT by 42.36 F1 scores which strongly proved that the prompt-based method can transfer more knowledge from the source domain and is more data-efficient than conventional methods. +(3) Our method outperforms metric-based few-shot learning baselines, for example, 2.24 F1 scores higher than L-TapNet+CDT, which proves its competitiveness compared to classical few-shot learning methods. +(4) Our Iterative Prediction Strategy improved Our method by about 0.5 F1 scores, demonstrating that the revising ability is likely to be transferable and is effective under cross-domain scenarios. + +# 4.3 Analysis + +Effects of Iterative Prediction Strategy As shown in Table 1, the proposed Iterative Prediction Learning brings consistent improvement, especially in low-resource settings. It works by revising predictions with a second-round query to recognize those missing slots, which can bring an increase in recall score. To confirm that, we make a detailed analysis with precision score (P), recall score (R) and F1 score (F) in Table 3. + +When Iterative Revise Strategy is added, we can get a rise in recall score about 4 points in 10-shot, $2\sim 4$ points in 20 shot and more than 1 points in other shot settings in exchange for a slight precision drop, resulting in a rise in overall F1 score by about 2 points in 10 and 20 shots. + +
ModelMIT-RestaurantMIT-Movie
PRFPRF
10Ours67.742.452.184.046.459.7
w/o Iter69.438.349.485.942.757.0
w/o Joint68.838.949.785.643.057.2
20Ours70.154.761.583.560.470.1
w/o Iter71.652.360.586.355.967.9
w/o Joint70.9253.4561.085.656.968.3
50Ours73.661.266.883.672.477.6
w/o Iter75.457.665.385.969.576.8
w/o Joint74.359.265.784.770.877.1
100Ours76.166.571.084.477.280.6
w/o Iter78.064.270.486.375.080.3
w/o Joint76.766.071.085.076.580.5
200Ours77.870.574.085.480.082.6
w/o Iter79.568.773.787.178.282.4
w/o Joint78.070.173.885.179.982.4
500Ours79.473.576.486.382.884.5
w/o Iter81.071.876.187.981.484.6
w/o Joint79.673.476.486.682.184.3
+ +Table 3: Ablation analysis Iterative Prediction Strategy w/o Iter denotes removing iterative strategy and w/o joint denotes using two separate models for the two iterative steps. + +We further explore the effect of jointly learning of the first-round prediction and the second-round revising, and learn two abilities separately with two models. As shown in Table 3, w/o Joint model outperforms the no-revising model but lags behind the joint model. This indicates that joint learning the revising ability may act as data augmentation and brings more improvements than simple revising. + +Efficiency Study Unlike Template-based BART that queries every n-gram span in the source sentence for each label (with $O(n^{2} * m)$ where $n$ is the length of the source sentence and $m$ is the size of the label set) time complexity, our proposed method queries labels in the label set and directly generate slot values (with $O(n * m)$ time complexity). In theory, our method is much faster than Template-based BART, especially dealing with long sentences with sparse slots. To prove this, we conduct efficiency experiments by calculating the decoding time of each method on a Titan XP GPU with batch size as 8, and we set our max generation length at 40. As shown in Table 4, our method is about 8 times as fast as the Template-based BART method, and more than 3 times as fast as theirs with Iterative Prediction Strategy. During experiments, we find that as the number of labels increases, the model does become linearly slower, which may become limitations. However, the number of label types is usually smaller than the sentence length + +
ModelMIT-MovieMIT-Restaurant
Baseline (Normal Prompt)408.0236.0
Ours51.233.2
Ours + Iterative119.471.4
+ +Table 4: Comparison of the decoding time (second). + +and much smaller than the number of spans, so that this growth does not affect the value of our method in practice. Besides, we find no significant correlation between the number of labels and our performance. + +# 5 Related Work + +Prompt-based learning Prompt-based learning approaches have been a broadly discussed topic since large language models like GPT models (Brown et al., 2020) are hard to fine-tune in low-resource scenarios. Early attempts (Schick and Schütze, 2021a,b) introduce manual prompts to text classification tasks. For natural language understanding (NLU) tasks, automatically searching discrete prompts methods are proposed such as Jiang et al. (2020); Shin et al. (2020); Gao et al. (2021). Meanwhile, due to the continuity of parameters in neural networks, continuous prompts for both text classification and generation tasks (Li and Liang, 2021; Liu et al., 2021b; Han et al., 2021) have been proposed. Unlike sentence-level tasks, prompting methods are very complicated for slot tagging and NER tasks. Cui et al. (2021) proposes a template-based method querying every slot span with each label which is expensive for decoding. Different from them, we introduce an inverse paradigm for prompting slot tagging tasks. Note that inverse prompting (Zou et al., 2021) has a similar name to our work but is entirely different in method and task. They aim to generate prompt templates inversely. Amendable generation (Tian et al., 2021) share a similar idea of using Iterative Prediction Strategy to generate and revise dialog state. By contrast, we focus on a different task for sequence labeling and first introduce an Iterative Prediction Strategy to prompting models. There are also generation-based methods for sequence labeling (Yan et al., 2021), which is not a prompting method, since it re-initializes decoding layers and learns a generative model from scratch. + +Few-shot slot tagging Previous few-shot slot tagging methods focus on metric learning based methods, which classify tokens by word-label similarity + +(Snell et al., 2017; Vinyals et al., 2016). Hou et al. (2020) leverage label name semantics to get better label representation and model label dependency in few-shot settings. Yang and Katiyar (2020) make a prediction based on the nearest neighbor sample instead of the nearest label representation. Besides, some works also explore training a model with additional data from non-slot-tagging task (Huang et al., 2020; Henderson and Vulic, 2021). Hou et al. (2021) improves few-shot slot tagging performance by jointly learning it with intent detection. Different from directly learning the few-shot slot tagging model, some researches explore to reformulate the slot tagging into other NLP tasks. Ma et al. (2021a) reforms slot tagging into a reading comprehension task. Yu et al. (2021) treats slot tagging as a retrieval task, Coope et al. (2020) uses span extracting task to extract slot and predict corresponding label and Cui et al. (2021) leverages prompts for few-shot NER. Different from those methods above, we are the first to reformulate the slot tagging task into a prompt-based generation task. + +# 6 Conclusion + +In this paper, to liberate the prompting methods from the burdensome prediction of slot-tagging tasks, we introduce a novel inverse prediction manner to prompting methods of slot-tagging, which significantly improves both the efficiency and accuracy. To further improve performance, we propose an Iterative Prediction Strategy for learning, which enables the prompting model to consider dependency between labels and refine prediction. Extensive experiments verify the effectiveness of the proposed method in various few-shot settings, indicating inverse prediction is a better fit for prompting of slot tagging task. + +# Acknowledgments + +We are grateful for the helpful comments and suggestions from the anonymous reviewers. This work was supported by the National Key R&D Program of China via grant 2020AAA0106501 and the National Natural Science Foundation of China (NSFC) via grant 61976072 and 62176078. + +# Ethics Section + +We analyze the limitations of the proposed method in both efficiency and effectiveness aspects, and the proposed method has no obvious potential risks. + +All the scientific artifacts used-created are properly cited/licenses, and the usage is consistent with their intended use. This paper does not collect new datasets, nor does the data used contain sensitive information. + +# References + +Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877-1901. Curran Associates, Inc. + +Sam Coope, Tyler Farghly, Daniela Gerz, Ivan Vulic, and Matthew Henderson. 2020. Span-convert: Few-shot span extraction for dialog with pretrained conversational representations. In Proc. of the ACL, pages 107-121. + +Alice Coucke, Alaa Saade, Adrien Ball, Théodore Bluche, Alexandre Caulier, David Leroy, Clément Doumouro, Thibault Gisselbrecht, Francesco Caltagirone, Thibaut Lavril, Maël Primet, and Joseph Dureau. 2018. Snips voice platform: an embedded spoken language understanding system for private-by-design voice interfaces. CoRR, abs/1805.10190. + +Leyang Cui, Yu Wu, Jian Liu, Sen Yang, and Yue Zhang. 2021. Template-based named entity recognition using BART. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 1835-1845, Online. Association for Computational Linguistics. + +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. + +Alexander Fritzler, Varvara Logacheva, and Maksim Kretov. 2019. Few-shot classification in named entity recognition task. Proceedings of the 34th ACM/SIGAPP Symposium on Applied Computing. + +Tianyu Gao, Adam Fisch, and Danqi Chen. 2021. Making pre-trained language models better few-shot learners. 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 3816-3830, Online. Association for Computational Linguistics. + +Xu Han, Weilin Zhao, Ning Ding, Zhiyuan Liu, and Maosong Sun. 2021. *Ptr: Prompt tuning with rules for text classification*. + +Matthew Henderson and Ivan Vulic. 2021. Convex: Data-efficient and few-shot slot labeling. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT, pages 3375-3389. + +Yutai Hou, Wanxiang Che, Yongkui Lai, Zhihan Zhou, Yijia Liu, Han Liu, and Ting Liu. 2020. Few-shot slot tagging with collapsed dependency transfer and label-enhanced task-adaptive projection network. In Proc. of ACL, pages 1381-1393. Association for Computational Linguistics. + +Yutai Hou, Yongkui Lai, Cheng Chen, Wanxiang Che, and Ting Liu. 2021. Learning to bridge metric spaces: Few-shot joint learning of intent detection and slot filling. In *Findings of the ACL*, pages 3190–3200. + +Jiaxin Huang, Chunyuan Li, Krishan Subudhi, Damien Jose, Shobana Balakrishnan, Weizhu Chen, Baolin Peng, Jianfeng Gao, and Jiawei Han. 2020. Few-shot named entity recognition: A comprehensive study. arXiv preprint arXiv:2012.14978. + +Zhengbao Jiang, Frank F Xu, Jun Araki, and Graham Neubig. 2020. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423-438. + +Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. 2020. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proc. of the ACL, pages 7871-7880. + +Xiang Lisa Li and Percy Liang. 2021. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190. + +Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2021a. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804. + +Jingjing Liu, Panupong Pasupat, Yining Wang, Scott Cyphers, and Jim Glass. 2013. Query understanding enhanced by hierarchical parsing structures. In 2013 IEEE Workshop on Automatic Speech Recognition and Understanding, pages 72-77. IEEE. + +Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. 2021b. GPT understands, too. CoRR, abs/2103.10385. + +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. + +Jianqiang Ma, Zeyu Yan, Chang Li, and Yang Zhang. + +2021a. Frustratingly simple few-shot slot tagging. In Findings of the ACL, pages 1028-1033. +Ruotian Ma, Xin Zhou, Tao Gui, Yiding Tan, Qi Zhang, and Xuanjing Huang. 2021b. Template-free prompt tuning for few-shot NER. CoRR, abs/2109.13532. +Xuezhe Ma and Eduard Hovy. 2016. End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF. In Proceedings of the 54th Annual Meeting of the Association for Computational LinguisticsACL, pages 1064-1074. Proc. of the ACL. +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. +Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. +Timo Schick and Hinrich Schütze. 2021a. Exploiting cloze-questions for few-shot text classification and natural language inference. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 255–269, Online. Association for Computational Linguistics. +Timo Schick and Hinrich Schütze. 2021b. It's not just size that matters: Small language models are also few-shot learners. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2339-2352, Online. Association for Computational Linguistics. +Mike Schuster and Kuldip K. Paliwal. 1997. Bidirectional recurrent neural networks. IEEE Trans. Signal Process., 45(11):2673-2681. +Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. 2020. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. arXiv preprint arXiv:2010.15980. +Jake Snell, Kevin Swersky, and Richard Zemel. 2017. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc. +Xin Tian, Liankai Huang, Yingzhan Lin, Siqi Bao, Huang He, Yunyi Yang, Hua Wu, Fan Wang, and Shuqi Sun. 2021. Amendable generation for dialogue state tracking. CoRR, abs/2110.15659. +Oriol Vinyals, Charles Blundell, Tim Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. 2016. Matching networks for one shot learning. In Proc. of NIPS, pages 3630-3638. +Yaqing Wang, Quanming Yao, James T. Kwok, and Lionel M. Ni. 2020. Generalizing from a few examples: + +A survey on few-shot learning. ACM Comput. Surv., 53(3):63:1-63:34. +Sam Wiseman and Karl Stratos. 2019. Label-agnostic sequence labeling by copying nearest neighbors. In Proceedings of the 57th Annual Meeting of the Association for Computational LinguisticsACL, pages 5363-5369. +Hang Yan, Tao Gui, Junqi Dai, Qipeng Guo, Zheng Zhang, and Xipeng Qiu. 2021. A unified generative framework for various NER subtasks. In Proc. of the ACL/IJCNLP, pages 5808-5822. Association for Computational Linguistics. +Yi Yang and Arzoo Katiyar. 2020. Simple and effective few-shot named entity recognition with structured nearest neighbor learning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6365-6375, Online. Association for Computational Linguistics. +Dian Yu, Luheng He, Yuan Zhang, Xinya Du, Panupong Pasupat, and Qi Li. 2021. Few-shot intent classification and slot filling with retrieved examples. In Proc. of the NAACL, pages 734-749. +Tony Z Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Improving few-shot performance of language models. arXiv preprint arXiv:2102.09690. +Morteza Ziyadi, Yuting Sun, Abhishek Goswami, Jade Huang, and Weizhu Chen. 2020. Example-based named entity recognition. CoRR, abs/2008.10570. +Xu Zou, Da Yin, Qingyang Zhong, Hongxia Yang, Zhilin Yang, and Jie Tang. 2021. Controllable generation from pre-trained language models via inverse prompting. In KDD '21: The 27th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, Singapore, August 14-18, 2021, pages 2450-2460. ACM. \ No newline at end of file diff --git a/inverseisbetterfastandaccuratepromptforfewshotslottagging/images.zip b/inverseisbetterfastandaccuratepromptforfewshotslottagging/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..568f8eeb00407e64a6811c85ef3012b2ce2c126e --- /dev/null +++ b/inverseisbetterfastandaccuratepromptforfewshotslottagging/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e69b188c37d78f59513e85bdffd8febd65020121ab3baaef71c7132ddf41cc9a +size 468423 diff --git a/inverseisbetterfastandaccuratepromptforfewshotslottagging/layout.json b/inverseisbetterfastandaccuratepromptforfewshotslottagging/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2feb338ac6d8733e5577f41c088d969ae9d1ed02 --- /dev/null +++ b/inverseisbetterfastandaccuratepromptforfewshotslottagging/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8da717f7d527098b270081b8e8b4f5ddf245bed6ac8119e755a54da2740b9ac +size 336109 diff --git a/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_content_list.json b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4434a4f50d7fefe24c3310f5056f7735851e7c80 --- /dev/null +++ b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a31755ee3a16078b496cb96f1f15e55b1e9677c2fa6790b1f61797b4c1bb1165 +size 51000 diff --git a/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_model.json b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..03d3657dc72a0d09949f5bd3f2125f3458bede29 --- /dev/null +++ b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad2ec5d37690dc49c11a7dd41380e0cb7ddc73dcf003490abedd875e4fd1755f +size 61002 diff --git a/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_origin.pdf b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0262c488d6612c0f30db2db3752d0bcb174af91a --- /dev/null +++ b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/9a9575eb-62c4-41c2-ac75-e1f30739f06a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ac14feceeffedc91cb8a8bc94ded3290e8182af57854802a29f2d122aad4679 +size 234103 diff --git a/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/full.md b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/full.md new file mode 100644 index 0000000000000000000000000000000000000000..899287fb0ce170f8f958bc2fbcd344c5dd9e1b34 --- /dev/null +++ b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/full.md @@ -0,0 +1,183 @@ +# Investigating Data Variance in Evaluations of Automatic Machine Translation Metrics + +Jiannan Xiang\*, Huayang Li\*, Yahui Liu\*, Lemao Liu\*, Guoping Huang\*, Defu Lian\*, Shuming Shi\* + +$^{\text{心}}$ Carnegie Mellon University, $^{\spadesuit}$ Nara Institute of Science and Technology + +$\diamond$ University of Science and Technology of China + +$^{\star}$ University of Trento, Italy, $^{\clubsuit}$ Tencent AI Lab + +jiannanx@cs.cmu.edu, li.huayang.lh6@is.naist.jp + +yahui.liu@unitn.it, lemaoliu@gmail.com, {donkeyhuang, shumingshi}@tencent.com + +# Abstract + +Current practices in metric evaluation focus on one single dataset, e.g., Newstest dataset in each year's WMT Metrics Shared Task. However, in this paper, we qualitatively and quantitatively show that the performances of metrics are sensitive to data. The ranking of metrics varies when the evaluation is conducted on different datasets. Then this paper further investigates two potential hypotheses, i.e., insignificant data points and the deviation of Independent and Identically Distributed (i.i.d) assumption, which may take responsibility for the issue of data variance. In conclusion, our findings suggest that when evaluating automatic translation metrics, researchers should take data variance into account and be cautious to claim the result on a single dataset, because it may leads to inconsistent results with most of other datasets. + +# 1 Introduction + +Assessing the quality of machine translation (MT) systems is always crucial to promote MT research (Marie et al., 2021). Since it is costly and time-consuming for human graders to evaluate machine translation (MT) systems, designing automatic metrics for MT has drawn booming attention during the past decades, and many metrics such as BLEU (Papineni et al., 2002) and TER (Snover et al., 2006) have been proposed consequently. + +Generally, it is non-trivial to measure automatic metrics. Conference Machine Translation (WMT) (Ma et al., 2019, 2018; Macháček and Bojar, 2013a,b; Bojar et al., 2016) thereby holds the Metric Shared Task to evaluate the performance of automatic metrics. In each year, WMT organizers collect a dataset consisting of many MT outputs annotated with human judgments, and automatic metrics are evaluated on the dataset in terms of + +their correlations to human judgments. Over the past ten years, the official evaluation reports only independently analyzed the results of that year. To the best of our knowledge, there are no studies to put the evaluation results of ten years together and make a more systematic analysis. Therefore, some key questions remain unknown: are the evaluation results consistent across different years? Are the results on each dataset reliable? + +One may simply summarize the existing results from the official evaluation reports of the past years and answer the above questions accordingly. However, the existing results use Pearson's correlation for evaluation which suffers from sensitivity to outlier data points as argued by Mathur et al. (2020). Besides, involved metrics in the evaluation are different year by year, thus it is difficult to directly compare the results among different years. To this end, in this work, we firstly re-evaluate ten popular metrics on all available datasets in the past ten years, with the Error Number evaluation method (Mathur et al., 2020). We then empirically investigate the fluctuation of metric evaluation results. Surprisingly, our experiments show that the evaluation result is sensitive to the choice of datasets, which suggests that the results on some datasets may not be reliable ( $\S 3$ ). + +Then we investigate two potential hypotheses about the emergence of data variance, i.e., the insignificant data points (§4.1) and deviation of Independent and Identically Distributed (i.i.d) assumption (§4.2). First, we show that the data variance issue is substantially alleviated when the insignificant data points are removed. To further understand the variance that cannot be alleviated by the first hypothesis, we design a simple method to measure the distributional differences between datasets, and hypothesize that the deviation of the i.i.d assumption may contribute to the variance. For future metric evaluation, we recommend WMT community pay attention to the potential issue of data variance + +
DatasetSizeSystem NumberLink
Newssyscombtest20102,03431http://www.statmt.org/wmt10/results.html
Newssyscombtest20112,00026http://www.statmt.org/wmt11/results.html
Newstest20123,00316http://www.statmt.org/wmt12/results.html
Newstest20133,00023http://www.statmt.org/wmt13/results.html
Newstest20143,00313http://www.statmt.org/wmt14/results.html
Newstest20152,16913http://www.statmt.org/wmt15/results.html
Newstest20162,99910http://www.statmt.org/wmt16/results.html
Newstest20173,00411http://www.statmt.org/wmt17/results.html
Newstest20182,99816http://www.statmt.org/wmt18/results.html
Newstest20192,00016http://www.statmt.org/wmt19/results.html
+ +when conducting evaluations. + +Table 1: The data statistics for German-English language pair. + +
MetricsFeaturesAverage Type
BLEUn-gramsmacro
WERLevenshtein distancemacro
TERedit distancemacro
PERedit distancemacro
chrFcharacter n-gramsmicro
chrF+character n-gramsmicro
BEERchar. n-grams, treesmicro
CharacTERchar. edit distancemicro
BERTScoreneural representationsmicro
MoverScoreneural representationsmicro
+ +Table 2: Features for the metrics we use in the paper. Note that we implement PER by ourselves. + +# 2 Experiment Settings + +# 2.1 Datasets and evaluation metrics + +We collect the testing set data and the human assessments of the WMT Metrics Task from 2010 to 2019. In this work, we mainly conduct experiments on the De $\Rightarrow$ En task and more details about datasets are shown in Table 1. However, as shown in §3.1, our conclusions are consistent on other translation tasks, such as Ru $\Rightarrow$ En. + +Since participating metrics in the WMT Metrics Task varied over years, we collect ten most popular metrics and re-evaluate them on all ten datasets to study their performance. These metrics are summarized as follows: BLEU (Papineni et al., 2002),WER (Morris et al., 2004),PER (Tillmann et al., 1997), TER (Snover et al., 2006),chrF (Popovic, 2015), $\mathrm{chrF + }$ (Popovic, 2017), BEER (Stanojevic and Sima'an, 2014), CharacTER (Wang et al., 2016), BERTScore (Zhang et al., 2020), and MoverScore (Zhao et al., 2019). The first 4 metrics are in system-level (i.e., macro) while others are in sentence-level (i.e., micro), as shown in Table 2. Since extending sentence-level metrics to systemlevel is more natural (Zhang et al., 2020), we only + +compare them on the system-level. + +For each system pair, metrics or humans give a comparison result about whether one system is better than another. Following Graham et al. (2014), we use statistical significance tests to detect if the difference in scores (metrics or humans) between two systems is significant. Specifically, for RR scores, we use the bootstrap method (Koehn, 2004). For DA scores, we apply the Wilcoxon rank-sum test. For macro-average metrics, i.e., BLEU,WER,PER,and TER,we use the bootstrap method (Koehn, 2004). For other micro-average metrics, we use the paired t-test method. + +# 2.2 Measuring Automatic Metrics + +The previous WMT Metrics Tasks used Pearson's $r$ to measure the ability of a metric to evaluate MT systems. However, as pointed out by Mathur et al. (2020), Pearson's $r$ is unstable for a small sample size and sensitive to outlier systems. Besides, in practice, metric scores are always used to compare pairs of MT systems1. Thus following Mathur et al. (2020), we measure an automatic metric with the number of errors made by the metric when comparing system pairs. Error Number can be considered as an absolute view of measuring a metric. + +Error Number Following Mathur et al. (2020), we measure the performance of a metric by its consistency with humans. Specifically, each metric or human can judge whether a system performs better compared to another system (details of system comparison process are presented in the appendix), and the error number is the number of contrary cases between the results of metric and human. As mentioned by Graham and Liu (2016), when the number of compared MT systems are too small on a dataset, differences among different metrics + +
MetricDataset
2010201120122013201420152016201720182019
BERTScore1 / 24.41 / 37.12 / 28.91 / 10.62 / 20.41 / 14.71 / 14.56 / 24.62 / 15.33 / 37.0
CharacTER6 / 27.61 / 37.11 / 24.26 / 18.01 / 17.31 / 14.73 / 17.61 / 20.81 / 14.44 / 38.2
MoverScore2 / 25.24 / 39.32 / 28.82 / 11.72 / 20.31 / 14.72 / 16.05 / 23.92 / 15.41 / 36.6
chrF3 / 26.71 / 37.84 / 29.72 / 12.12 / 20.84 / 17.74 / 18.92 / 22.92 / 15.31 / 37.0
BEER3 / 26.35 / 45.35 / 33.54 / 13.46 / 25.05 / 19.05 / 19.52 / 23.22 / 15.26 / 38.4
chrF+3 / 26.95 / 45.86 / 35.14 / 13.87 / 26.46 / 19.25 / 20.22 / 23.32 / 15.24 / 37.7
BLEU8 / 32.38 / 58.38 / 42.37 / 20.98 / 29.37 / 23.18 / 21.27 / 26.39 / 18.17 / 41.3
WER7 / 31.77 / 57.77 / 40.88 / 23.49 / 32.37 / 22.95 / 19.78 / 27.27 / 17.07 / 40.9
TER9 / 35.09 / 61.29 / 43.99 / 24.710 / 36.27 / 22.78 / 20.910 / 28.67 / 17.29 / 43.0
PER10 / 38.69 / 61.710 / 48.010 / 26.95 / 23.87 / 22.810 / 28.28 / 27.69 / 18.49 / 43.5
+ +Table 3: Metric evaluation results on De $\Rightarrow$ En datasets from 2010 to 2019. The tuple "R / E" shows the performance of a metric, where R denotes Significant Ranking (§2.3) among all metrics and E denotes the Error Rate (Error Number divided by the total number of system pairs). + +may be insignificant. Thus, the results of the metric evaluation can be highly inconclusive. We indeed observe similar results in our experimental setting. Therefore, we use the hybrid super-sampling method (Graham and Liu, 2016) to create a large number of hybrid system pairs: on each dataset, we synthesize 142 systems in total, which form 10K system pairs. Finally, we calculate the error number of each metric on all 10K system pairs. + +# 2.3 Measuring Data Variance + +Significant Ranking Based on the measurement of error number, a qualitative approach to know whether those metrics perform consistently on different datasets is to evaluate the variance of their rankings. To make the ranking more reliable, we propose a significant ranking method, which conducts significant test when sorting the error numbers of metrics. For example, in Table 3, the significant ranking of all metrics on 2010 dataset is "1, 6, 2, 3, 3, 3, 8, 7, 9, 10" where chrF, BEER and chrF+ are with the same relative ranking of 3. This is because they are not significantly different, although their absolute error numbers are slightly different. We employ the bootstrap re-sampling method (Koehn, 2004) to test if the number of errors of one metric is significantly less than the others. For the bootstrap method, we repeat resampling 1000 times and set the p-value to 0.05 for all the significance tests. + +Disagreement Number In addition, we also propose a method to quantitatively measure the variance between two datasets $\mathcal{D}$ and $D^{\prime}$ , namely, disagreement number. Specifically, we construct a set $S_{D}$ by collecting all pairwise metrics that one is significantly better than the other on dataset $\mathcal{D}$ . Then to measure the mismatch between $\mathcal{D}$ and $D^{\prime}$ , + +![](images/4176af7b090841ab05debd0a1fb8a57910c3172fb0eab865091bb7f1d71f7b69.jpg) +Figure 1: The heatmap for the disagreement numbers between every two datasets on $\mathrm{De} \Rightarrow \mathrm{En}$ task. + +we count the disagreement number between the pairwise metrics in $S_{\mathcal{D}}$ and that in $S_{\mathcal{D}'}$ . For example, disagreement number plus one, if BLEU is significantly better than TER on $\mathcal{D}$ and worse than TER on $\mathcal{D}'$ . Although this number is linear to Kendall's Tau (Kendall, 1938), it is able to show more informative difference between two overall rankings. For example, two metrics with totally different ranks may just have a slight difference on disagreement number. As a result, we employ disagreement number rather than Kendall's Tau to show the quantitative difference between two overall rankings more intuitively for more detailed analysis. It is worth mentioning that the disagreement number is at most 45 in our setting where there are 10 metrics in total. + +# 3 Data Variance in Metric Evaluations + +# 3.1 Variance of Different Datasets + +We conduct experiments on all 10 datasets. We have 10 metrics, which can form 45 metric pairs. On each dataset, for each metric, we calculate its + +
MetricDataset
20152016201720182019
BERTScore2 / 18.03 / 16.72 / 32.13 / 24.51 / 35.8
CharacTER6 / 20.56 / 19.41 / 30.41 / 22.34 / 37.2
MoverScore1 / 14.91 / 15.12 / 31.43 / 24.51 / 36.1
chrF3 / 18.72 / 15.72 / 31.92 / 24.04 / 37.1
BEER3 / 19.03 / 17.05 / 33.23 / 24.39 / 39.6
chrF+5 / 19.75 / 17.65 / 33.33 / 24.54 / 36.9
BLEU10 / 27.97 / 21.09 / 34.88 / 25.09 / 39.8
WER8 / 23.47 / 21.55 / 33.28 / 25.08 / 37.9
TER8 / 23.410 / 23.39 / 34.510 / 25.84 / 36.9
PER6 / 21.17 / 21.57 / 34.02 / 23.41 / 35.7
+ +Table 4: Metric evaluation results on $\mathrm{Ru}\Rightarrow \mathrm{En}$ datasets from 2015 - 2019. + +error number (described in Section 2.2). In addition, we perform a statistical significance test for each metric pairs in terms of both error numbers, from which we can obtain a ranking result among 10 metrics accordingly. + +Table 3 illustrates the error numbers and ranks on 10 datasets. It shows that the ranks are always variant along with different datasets. For example, on the dataset of 2011, the error rate of MoveScore is larger than chrF (39.3 v.s. 37.8), and the former ranks 4 while the latter ranks 1. However, it is opposite on the dataset of 2015, where MoveScore ranks 1 with an error rate of 14.7 while chrF ranks 4 with an error rate of 17.7. As shown in Table 4, we observe a similar trend on the $\mathrm{Ru}\Rightarrow \mathrm{En}$ task. + +As shown in Figure 1, there is a high inconsistency between the results of different datasets and none of the dataset pairs achieve zero disagreements. The difference between the datasets in 2010 and 2013 is the smallest (i.e., only 4 disagreed metric pairs). However, most of the disagreement numbers are larger than 10 (the maximum achieves 18). Moreover, datasets from 2017 to 2019 not only have a high disagreement number with datasets of early years, but also have high variances among themselves. This finding is a little surprising, because in our sense the quality of WMT's datasets must be improved year by year. + +# 4 Potential Reasons for Data Variance + +Many factors may contribute to the data variance issue, but lots of them are difficult to be evaluated, such as the personal preferences of humans. In this section, we propose to analyze two potential factors that can be quantitatively evaluated. + +![](images/66ec50dae37a451d44a7653b2fbc3af043992499a97770f0e5c97b78468b626e.jpg) +Figure 2: The heatmap for the disagreement numbers between every two datasets on $\mathrm{De} \Rightarrow \mathrm{En}$ task. Insignificant system pairs according to human assessments are removed. + +# 4.1 Insignificant Data Points + +Intuitively, if the translations $H_{A}$ from system $A$ are much better than those $H_{B}$ from system $B$ in translation quality according to human evaluation, then it is easy to judge the better system even for a weak automatic metric. In contrast, if $H_{A}$ is similar to $H_{B}$ in translation quality, it is typically difficult to judge the better system even for a good metric. This motivates us that such an insignificant data point $\langle H_{A}, H_{B} \rangle$ may take responsibility for the data variance issue. + +To validate the above intuition, we remove the system pairs that are not significantly different according to human evaluation, and compute the disagreement number between any two datasets again. The experimental results are shown in Figure 2. We can see the disagreement number decreases greatly comparing to the results in Figure 1. In the previous experiment, most of the disagreement numbers are greater than 10, while in the new experiment most of them are less than 5, and some of them even achieve 0, such as the number between 2012 and 2015, which means the ranks of metrics are exactly the same on those datasets. The results indicate that part of the data variance issue can be explained by system pairs that humans think are not significantly different. + +However, After the removal of insignificant data points, some disagreement number are still high, e.g., the number between 2013 and 2017 is 13. It demonstrates that there are still some other underlying problems that give rise to the data variance phenomenon. In addition, the datasets for both 2014 and 2017 do not agree well with others. This + +indicates that we should be cautious to report overall results on some datasets, e.g., 2014 and 2017. + +# 4.2 Deviation of I.I.D Assumption + +How to interpret the high variance on datasets, e.g., 2014 and 2017, remains to be an open question. In this section we try to give a hypothesis based on the i.i.d assumption. According to the principle of statistical sampling, if two samples are drawn from the same distribution, then a statement made on one sample is likely to hold on the other sample. Therefore, one hypothesis about the high variance may be that datasets from different years deviate i.i.d assumption. In fact, this may be true in our scenario because each dataset is generated by a set of translation systems but the set of systems is variant each year. + +To this end, we design an experiment to measure the extent to which each dataset is drawn from the same distribution during the past ten years. Since the standard method such as Kolmogorov-Smirnov test (Massey Jr, 1951) is difficult to scale with respect to feature dimension, we employ adversarial validation to distinguish the difference between two datasets (Pan et al., 2020). Its basic idea is to formulate the i.i.d test as a classification problem and train a classifier between two datasets. If the classifier can accurately distinguish the data from different datasets, then the distributions of the two datasets are regarded as highly different. Since it is too slow to train classifiers for all pairs of datasets, we conduct experiments on three years from 2017 to 2019. More details are shown in appendix. + +The results on two kinds of datasets are shown in Table 5, where higher accuracy indicates clearer distributional differences between two datasets. Note that accuracy scores in main diagonal are got from two subsets of each year via randomly splitting. As shown in Table 5, the distributional differences between MT datasets have been introduced by source sentences. After accompanied with the system outputs, the distributional differences are more severe between different years. This fact shows that some datasets in past ten years deviate the i.i.d assumption, which may be related to the inconsistency of metrics. + +# 4.3 Suggestions + +According to those potential factors, we propose some suggestions to alleviate some potential issues for metric evaluation due to data variance in future. First, it would be better if pay more attention to + +
171819
1750.452.865.8
1852.851.467.5
1965.867.550.9
+ +(a) Src + +
171819
1751.475.380.2
1875.355.679.2
1980.279.252.2
+ +(b) Src+Output + +Table 5: The accuracy of classifiers. The higher value means two datasets deviate i.i.d assumption. We run the model with 5 different random seeds to calculate the average accuracy. + +those insignificant data points such that their manual annotations are as good as possible. Since it is costly to hire more annotators for data points, it would be possible to ask more annotators only for those insignificant data points. Second, it would be helpful to construct a dataset with diverse domains and explicitly show the evaluation results for each subset with the same domain rather than a single evaluation result for the entire dataset. Generally, although inconsistent results from different domains are possible, however, the inconsistency in the same domain may be undesirable. Thus, showing the domain information could help researchers to better promote the datasets and metrics. + +# 5 Conclusion + +Over the past ten years, the official evaluation reports of WMT Metrics Shared Task only independently analyzed the results of that year. In this paper, we re-evaluate ten popular metrics on all available datasets in the past ten years and comparatively analyze the evaluation results among different years together. We show the problem of conducting evaluations with only one dataset. In addition, we analyze its potential reasons that the insignificant data points and deviation of i.i.d assumption may induce the issue of data variance. This fact suggests that future researches on evaluating automatic translation metrics should take data variance into account and be cautious to conclude the result on a single dataset. + +# Acknowledgement + +We would like to thank the anonymous reviewers for their constructive comments. + +# References + +Ondrej Bojar, Christian Federmann, Barry Haddow, Philipp Koehn, Matt Post, and Lucia Specia. 2016. Ten years of wmt evaluation campaigns: Lessons + +learnt. In Proceedings of the LREC 2016 Workshop "Translation Evaluation-From Fragmented Tools and Data Sets to an Integrated Ecosystem, pages 27-34. +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, pages 4171-4186, Minneapolis, Minnesota. Association for Computational Linguistics. +Yvette Graham and Qun Liu. 2016. Achieving accurate conclusions in evaluation of automatic machine translation metrics. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1-10, San Diego, California. Association for Computational Linguistics. +Yvette Graham, Nitika Mathur, and Timothy Baldwin. 2014. Randomized significance tests in machine translation. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pages 266-274, Baltimore, Maryland, USA. Association for Computational Linguistics. +Maurice G Kendall. 1938. A new measure of rank correlation. Biometrika, 30(1/2):81-93. +Philipp Koehn. 2004. Statistical significance tests for machine translation evaluation. In Proceedings of the 2004 Conference on Empirical Methods in Natural Language Processing, pages 388-395, Barcelona, Spain. Association for Computational Linguistics. +Qingsong Ma, Ondrej Bojar, and Yvette Graham. 2018. Results of the WMT18 metrics shared task: Both characters and embeddings achieve good performance. In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pages 671-688, Belgium, Brussels. Association for Computational Linguistics. +Qingsong Ma, Johnny Wei, Ondrej Bojar, and Yvette Graham. 2019. Results of the WMT19 metrics shared task: Segment-level and strong MT systems pose big challenges. In Proceedings of the Fourth Conference on Machine Translation, pages 62-90, Florence, Italy. Association for Computational Linguistics. +Matous Machacek and Ondrej Bojar. 2013a. Results of the WMT13 metrics shared task. In Proceedings of the Eighth Workshop on Statistical Machine Translation, pages 45-51, Sofia, Bulgaria. Association for Computational Linguistics. +Matouš Macháček and Ondřej Bojar. 2013b. Results of the WMT13 metrics shared task. In Proceedings of the Eighth Workshop on Statistical Machine Translation, pages 45-51, Sofia, Bulgaria. Association for Computational Linguistics. + +Benjamin Marie, Atsushi Fujita, and Raphael Rubino. 2021. Scientific credibility of machine translation research: A meta-evaluation of 769 papers. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, pages 7297-7306, Online. Association for Computational Linguistics. +Frank J Massey Jr. 1951. The kolmogorov-smirnov test for goodness of fit. Journal of the American statistical Association, 46(253):68-78. +Nitika Mathur, Timothy Baldwin, and Trevor Cohn. 2020. Tangled up in BLEU: Reevaluating the evaluation of automatic machine translation evaluation metrics. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4984-4997, Online. Association for Computational Linguistics. +Andrew Cameron Morris, Viktoria Maier, and Phil Green. 2004. From wer and ril to mer and wil: improved evaluation measures for connected speech recognition. In *Eighth International Conference on Spoken Language Processing*. +Jing Pan, Vincent Pham, Mohan Dorairaj, Huigang Chen, and Jeong-Yoon Lee. 2020. Adversarial validation approach to concept drift problem in user-targeting automation systems at uber. arXiv preprint arXiv:2004.03045. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pages 311-318, Philadelphia, Pennsylvania, USA. Association for Computational Linguistics. +Maja Popovic. 2015. chrF: character n-gram F-score for automatic MT evaluation. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pages 392-395, Lisbon, Portugal. Association for Computational Linguistics. +Maja Popovic. 2017. $\mathrm{chrF}++$ : words helping character n-grams. In Proceedings of the Second Conference on Machine Translation, pages 612-618, Copenhagen, Denmark. Association for Computational Linguistics. +Matthew Snover, Bonnie Dorr, Rich Schwartz, Linnea Micciulla, and John Makhoul. 2006. A study of translation edit rate with targeted human annotation. In Proceedings of the 7th Conference of the Association for Machine Translation in the Americas: Technical Papers, pages 223-231, Cambridge, Massachusetts, USA. Association for Machine Translation in the Americas. +Miloš Stanojevic and Khalil Sima'an. 2014. Fitting sentence level translation evaluation with many dense features. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language + +Processing (EMNLP), pages 202-206, Doha, Qatar. +Association for Computational Linguistics. +Christoph Tillmann, Stephan Vogel, Hermann Ney, Arkaitz Zubiaga, and Hassan Sawaf. 1997. Accelerated dp based search for statistical translation. In Fifth European Conference on Speech Communication and Technology. +Weiyue Wang, Jan-Thorsten Peter, Hendrik Rosendahl, and Hermann Ney. 2016. CharacTer: Translation edit rate on character level. In Proceedings of the First Conference on Machine Translation, pages 505-510, Berlin, Germany. Association for Computational Linguistics. +Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumont, Clement Delangue, Anthony Moi, Pierric 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. +Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. 2020. Bertscore: Evaluating text generation with BERT. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net. +Wei Zhao, Maxime Peyrard, Fei Liu, Yang Gao, Christian M. Meyer, and Steffen Eger. 2019. MoverScore: Text generation evaluating with contextualized embeddings and earth mover distance. 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 563-578, Hong Kong, China. Association for Computational Linguistics. + +# A Settings for Adversarial Validation + +To train the classifier, we need to construct a binary classification dataset first. Since the difference between distributions may come from both the source sentences and system outputs, we consider two types of classification datasets correspondingly. The first kind of dataset only considers the source information. Supposing that we want to compare the distributions of source sentences of MT datasets from year Y1 and Y2, we follow the three steps below to construct the classification dataset: + +1. We label the source sentences from Y1 and Y2 with 0 and 1, respectively; +2. We split the data from Y1 and Y2 to train, dev, and test sets without overlap; +3. We merge the data from Y1 and Y2 according to their split. + +For each pairs of MT datasets from year 2010 to 2019, we construct a classification dataset following the steps above. Besides the source information, we also construct another kind of classification datasets that also consider the information of system outputs. The procedure to construct this kind of dataset is almost similar to the previous one, except that we concatenate each system outputs with its source sentences after the Step-2 is finished. In our experiments, we use mBERT (Devlin et al., 2019; Wolf et al., 2020) as the classifier, thus an unified structure can be used for the two kinds of datasets. \ No newline at end of file diff --git a/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/images.zip b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0eb8d267172d9caf94a910b15e1f11311c01fc54 --- /dev/null +++ b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66f6046b672c16610105c3b3c8a45bba43c082bca4a8787ca8b6ee03ee7edeba +size 367478 diff --git a/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/layout.json b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6af4f13c41c110d13b1f3a1dd7216116a329f9eb --- /dev/null +++ b/investigatingdatavarianceinevaluationsofautomaticmachinetranslationmetrics/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0b39cc356f3f343010f873ae0b35f4ad711524aefea1eb3da34093d2886a6d2 +size 212061 diff --git a/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_content_list.json b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f02c880553648d043dddd3a0215c33ffa2edc726 --- /dev/null +++ b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ead12d6ff14cb91788e63e4c627b024024154840537ccfe9549060b667468efa +size 57451 diff --git a/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_model.json b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_model.json new file mode 100644 index 0000000000000000000000000000000000000000..487e4c0e99347bd0214787e3d89ba0fe39750220 --- /dev/null +++ b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68726bc168ca6662f82454c9b767fc5b4da98b98c4b42bf9ebf0eed800257b4c +size 70722 diff --git a/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_origin.pdf b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e6f7bacae1132275a3f21dca5e517b459933b5cf --- /dev/null +++ b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/57a85542-cb14-4931-a005-0cd8740b7f83_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ebb583f6180cee028e68f592f4c99168382ae440ae85e40ab6529dcdd775407 +size 375538 diff --git a/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/full.md b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/full.md new file mode 100644 index 0000000000000000000000000000000000000000..623ac18811f0758e59f4673dd21f459a6376559a --- /dev/null +++ b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/full.md @@ -0,0 +1,257 @@ +# Investigating Selective Prediction Approaches Across Several Tasks in IID, OOD, and Adversarial Settings + +Neeraj Varshney, Swaroop Mishra, Chitta Baral + +Arizona State University + +{nvarshn2, srmishrl, cbaral}@asu.edu + +# Abstract + +In order to equip NLP systems with 'selective prediction' capability, several task-specific approaches have been proposed. However, which approaches work best across tasks or even if they consistently outperform the simplest baseline MaxProb remains to be explored. To this end, we systematically study selective prediction in a large-scale setup of 17 datasets across several NLP tasks. Through comprehensive experiments under in-domain (IID), out-of-domain (OOD), and adversarial (ADV) settings, we show that despite leveraging additional resources (held-out data/computation), none of the existing approaches consistently and considerably outperforms MaxProb in all three settings. Furthermore, their performance does not translate well across tasks. For instance, Monte-Carlo Dropout outperforms all other approaches on Duplicate Detection datasets but does not fare well on NLI datasets, especially in the OOD setting. Thus, we recommend that future selective prediction approaches should be evaluated across tasks and settings for reliable estimation of their capabilities. + +# 1 Introduction + +Despite impressive progress made in Natural Language Processing (NLP), it is unreasonable to expect models to be perfect in their predictions. They often make incorrect predictions, especially when inputs tend to diverge from their training data distribution (Elsahar and Galle, 2019; Miller et al., 2020; Koh et al., 2021). While this is acceptable for tolerant applications like movie recommendations, high risk associated with incorrect predictions hinders the adoption of these systems in real-world safety-critical domains like biomedical and autonomous robots. In such scenarios, selective prediction becomes crucial as it allows maintaining high accuracy by abstaining on instances where error is likely. + +Selective Prediction (SP) has been studied in machine learning (Chow, 1957; El-Yaniv et al., + +2010) and computer vision (Geifman and El-Yaniv, 2017, 2019), but has only recently gained attention in NLP. Kamath et al. (2020) proposed a post-hoc calibration-based SP technique for Question-Answering (QA) datasets. Garg and Moschitti (2021) distill the QA model to filter out error-prone questions. Unfortunately, despite the shared goal of making NLP systems robust and reliable for real-world applications, SP has remained underexplored; the community does not know which techniques work best across tasks/settings or even if they consistently outperform the simplest baseline MaxProb (Hendrycks and Gimpel, 2017) (that uses a threshold over the maximum softmax probability for selective prediction). + +In this work, we address the above point and study selective prediction in a large-scale setup of 17 datasets spanning over Natural Language Inference (NLI), Duplicate Detection, and QA tasks. Our comprehensive experiments under In-Domain (IID), Out-Of-Domain (OOD), and Adversarial (ADV) settings result in the following findings: + +1. None of the existing SP approaches consistently and considerably outperforms MaxProb. + +Slight improvement in IID: Most of the approaches outperform MaxProb in the IID setting; however, the magnitude of improvement is very small (Figure 1). For instance, MCD achieves an average improvement of just 0.28 on AUC value across all NLI datasets. + +Negligible improvement in OOD: The magnitude of improvement in OOD is even lesser (0.08) than that observed in the IID (Figure 2a). In a few cases, we also observe performance degradation (higher AUC than MaxProb). + +Performance degradation in ADV: Most of the approaches fail to even match the MaxProb's performance in ADV setting (Figure 2b). For instance, MCD degrades the AUC value by 1.76 on Duplicate Detection datasets and Calibration degrades by 1.27 on NLI datasets. + +2. Approaches do not translate well across tasks: We find that a single approach does not achieve the best performance across all tasks. For instance, MCD outperforms all other approaches on Duplicate Detection datasets but does not fare well on the NLI datasets. +3. Existing approaches fail to outperform Max-Prob despite leveraging additional resources: + +$MCD$ requires additional computation (for multiple inferences) while calibration-based approaches require a held-out dataset. In contrast, MaxProb does not require any such resources and still outperforms them, especially in the ADV setting. + +Overall, our results highlight that there is a need to develop stronger selective prediction approaches that perform well across tasks while being computationally efficient. + +# 2 Selective Prediction + +# 2.1 Formulation + +A selective prediction system comprises of a predictor $(f)$ that gives the model's prediction on an input $(x)$ , and a selector $(g)$ that determines if the system should output the prediction made by $f$ i.e. + +$$ +(f, g) (x) = \left\{ \begin{array}{l l} f (x), & \text {i f} \mathrm {g} (\mathrm {x}) = 1 \\ A b s t a i n, & \text {i f} \mathrm {g} (\mathrm {x}) = 0 \end{array} \right. +$$ + +Usually, $g$ comprises of a confidence estimator $\tilde{g}$ that indicates $f^{\prime}s$ prediction confidence and a threshold $th$ that controls the abstention level: + +$$ +g (x) = \mathbb {1} [ \tilde {g} (x)) > t h ] +$$ + +An SP system makes trade-offs between coverage and risk. For a dataset $D$ , coverage at a threshold $th$ is defined as the fraction of total instances answered by the system (where $\tilde{g} > th$ ) and risk is the error on the answered instances: + +$$ +\text {c o v e r a g e} _ {\text {t h}} = \frac {\sum_ {x _ {i} \in D} \mathbb {1} [ \tilde {g} (x _ {i})) > t h ]}{| D |} +$$ + +$$ +r i s k _ {t h} = \frac {\sum_ {x _ {i} \in D} \mathbb {1} [ \tilde {g} (x _ {i})) > t h ] l _ {i}}{\sum_ {x _ {i} \in D} \mathbb {1} [ \tilde {g} (x _ {i})) > t h ]} +$$ + +where, $l_{i}$ is the error on instance $x_{i}$ . + +With decrease in $th$ , coverage will increase, but the risk will usually also increase. The overall SP performance is measured by the area under Risk-Coverage curve (El-Yaniv et al., 2010) which plots risk against coverage for all threshold values. + +Lower the AUC, the better the SP system as it represents lower average risk across all confidence thresholds. We note that 'confidence calibration' and 'OOD detection' are related tasks but are nontrivially different from selective prediction as detailed in Appendix A. + +# 2.2 Approaches + +Usually, the last layer of models has a softmax activation function that gives the probability distribution $P(y)$ over all possible answer candidates $Y$ . $Y$ is the set of labels for classification tasks, answer options for multiple-choice QA, all input tokens (for start and end logits) for extractive QA, and all vocabulary tokens for generative tasks. Thus, predictor $f$ is defined as: $\operatorname*{argmax}_{y\in Y}P(y)$ + +Maximum Softmax Probability (MaxProb): Hendrycks and Gimpel (2017) introduced a simple method that uses the maximum softmax probability across all answer candidates as the confidence estimator $\tilde{g}$ i.e. $\max_{y\in Y}P(y)$ + +Monte-Carlo Dropout (MCD): Gal and Ghahramani (2016) proposed to infer a test input multiple times using different dropout masks and ensemble them to get the confidence estimate. + +Label Smoothing (LS): Szegedy et al. (2016) proposed to compute cross-entropy loss value with a weighted mixture of target labels during training instead of one hot 'hard' label. This prevents the network from becoming over-confident in its predictions. + +Calibration (Calib): In calibration, a held-out dataset is annotated conditioned on the correctness of the model's predictions (correct as 'positive' class and incorrect as 'negative' class), and another model (calibrator) is trained on this annotated binary classification dataset. Softmax probability assigned to the positive class by this trained calibrator is used as the confidence estimator for SP. Kamath et al. (2020) study a calibration-based SP technique for Question Answering datasets. They train a random forest model using features such as input text length and probabilities of top 5 predictions and use it as a calibrator. We refer to this approach as Calib C. Inspired by the calibration technique presented in Jiang et al. (2021), we also train calibrator as a regression model (Calib R) by annotating the heldout instances on a continuous scale instead of categorical labels 'positive' and + +'negative' (unlike the annotation done in Calib C). We compute these annotations using MaxProb as: + +$$ +s = \left\{ \begin{array}{l l} 0. 5 + \frac {\text {m a x P r o b}}{2}, & \text {i f c o r r e c t} \\ 0. 5 - \frac {\text {m a x P r o b}}{2}, & \text {o t h e r w i s e} \end{array} \right. +$$ + +Furthermore, we train a transformer-based model for calibration (Calib T) that leverages the entire input text for training instead of features derived from it (Garg and Moschitti, 2021). + +# 3 Experimental Setup + +# 3.1 Tasks and Settings: + +We conduct comprehensive experiments with 17 datasets spanning over Natural Language Inference (NLI), Duplicate Detection, and Question-Answering (QA) tasks and evaluate the efficacy of various selective prediction approaches in IID, OOD, and adversarial (ADV) settings. + +NLI: We train our models with SNLI (Bowman et al., 2015) / MNLI (Williams et al., 2018) / DNLI (Welleck et al., 2019) and use HANS (McCoy et al., 2019), Breaking NLI (Glockner et al., 2018), NLI-Diagnostics (Wang et al., 2018), Stress Test (Naik et al., 2018) as adversarial datasets. While training with SNLI, we consider SNLI evaluation dataset as IID and MNLI, DNLI datasets as OOD. Similarly, while training with MNLI, we consider SNLI and DNLI datasets as OOD. + +Duplicate Detection: We train with QQP (Iyer et al., 2017) / MRPC (Dolan and Brockett, 2005) and use PAWS-QQP, PAWS-Wiki (Zhang et al., 2019) as adversarial datasets. + +QA: We train with SQuAD (Rajpurkar et al., 2016) and evaluate on NewsQA (Trischler et al., 2017), TriviaQA (Joshi et al., 2017), SearchQA (Dunn et al., 2017), HotpotQA (Yang et al., 2018), and Natural Questions (Kwiatkowski et al., 2019). + +# 3.2 Training Details: + +We run all our experiments using bert-base model (Devlin et al., 2019) with batch size of 32 and learning rate ranging in $\{1 - 5\} e - 5$ . All experiments are done with Nvidia V100 16GB GPUs. + +Calibration: For calibrating QA models, we use input length, predicted answer length, and softmax probabilities of top 5 predictions as the features (similar to Kamath et al. (2020)). For calibrating NLI and Duplicate Detection models, we use input lengths (of premise/sentence1 and hypothesis/sentence2), softmax probabilities assigned to + +![](images/b55c6366ff1012f7042ed77dda9375ef0e65783950a8539756975527e8f28c02.jpg) +Figure 1: Comparing AUC of risk-coverage plot of various SP approaches with MaxProb in IID settings. + +the labels, and the predicted label as the features. We train calibrators using random forest implementations of Scikit-learn (Pedregosa et al., 2011) for Calib C and Calib R approaches, and train a bert-base model for Calib T. In all calibration approaches, we calibrate using the IID held-out dataset and use softmax probability assigned to the positive class as the confidence estimate for SP. + +Label Smoothing: For LS, we use MaxProb of the model trained with label smoothing as the confidence estimator for SP. To the best of our knowledge, LS is designed for classification tasks only. Hence, we do not evaluate it for QA tasks. + +# 4 Results and Analysis + +# 4.1 Slight Improvement in IID + +We compare the selective prediction performance of various approaches in the IID setting in Figure 1. Though all the approaches except Calib T outperform MaxProb in most cases, the magnitude of improvement is very small. For instance, MCD achieves an average AUC improvement of just 0.28 across all NLI datasets. + +Calib C and Calib R achieve the highest improvement on DNLI: We find that these approaches benefit from using the predicted label as a feature for calibration. Specifically, the model's prediction accuracy varies greatly across labels (0.94, 0.91, and 0.76 for entailment, contradiction, and neutral predictions respectively). This implies when the model predicts the label to be neutral, it is relatively less likely to be correct as compared to the scenario when the prediction is entailment or contradiction. Calib C and R approaches leverage this signal by training a calibrator over a held-out dataset and thus achieve superior SP performance. + +![](images/8973c03f67b3c0d1ce09b4341169aad913c4b729d4544747c0f2e61172926f71.jpg) +(a) Out-Of-Domain + +![](images/cb0a0f5a5ce701bef32e66dcce8b45592e3283e0a6630e6aedf38c7fb1577546.jpg) +(b) Adversarial +Figure 2: Comparing AUC of risk-coverage plot of various approaches with MaxProb in OOD and ADV settings. The results have been averaged over all the task-specific OOD/ADV datasets mentioned in Section 3 to highlight the general trend. Results of individual datasets have been provided in the Appendix. + +# 4.2 Negligible Improvement / Degradation in OOD and ADV + +In Figure 2, we compare the selective prediction performance of various approaches in OOD and ADV settings. To highlight the general trend, the results have been averaged over all the task-specific OOD/ADV datasets mentioned in Section 3. Individual scores are provided in Appendix. + +In OOD setting, we find that the approaches lead to a negligible improvement in AUC. Notable improvement is achieved only by MCD in the case of the QQP dataset. In the ADV setting, all approaches degrade SP performance. Surprisingly, MCD that performed relatively well in IID and OOD settings, degrades more (by 1.74 AUC) in comparison to other approaches (except Calib T which does not perform well in all three settings). This is because the individual models of the ensemble achieve poor prediction accuracy in the ADV setting and thus ensembling them further degrades the overall confidence estimate. + +# 4.3 Calib T Degrades Performance + +Calib C and Calib R slightly outperform MaxProb in most IID and OOD cases. However, Calib T considerably degrades the performance in nearly all the cases. We hypothesize that associating correctness directly with the input text embeddings could be a harder challenge for the model as embeddings of correct and incorrect instances usually do not differ significantly. In contrast, as discussed before, providing features such as predicted label and softmax probabilities explicitly assists Calib C and R approaches in finding some distinguishing patterns that improve the selective prediction performance. + +# 4.4 Existing Approaches Fail to Utilize Additional Resources + +Unlike typical ensembling, MCD does not require training or storing multiple models but, it requires making multiple inferences (using different dropout masks) and can still become practically infeasible for large models such as BERT as their inference cost is high. Calibration-based approaches need additional held-out data and careful feature engineering to train the calibrator. Despite being computationally expensive, these approaches fail to consistently outperform MaxProb that does not require any such additional resources. + +# 4.5 Effect of Increasing Dropout Masks in Monte-Carlo Dropout + +With the increase in number of dropout masks used in MCD, the SP performance improves (from MCD lite with 10 masks to MCD with 30 masks). This is due to the ensembling effect as combining more predictions on the same input results in a more accurate overall output. However, we note that both MCD lite and MCD degrade SP performance in the ADV setting as discussed in 4.2. + +# 4.6 No Clear Winner + +None of the approaches consistently and considerably outperforms MaxProb in all three settings. Most approaches do not fare well in OOD and ADV settings. Furthermore, a single approach does not achieve the highest performance across all tasks. For instance, MCD outperforms all other approaches on Duplicate Detection datasets but does not perform well on NLI datasets (Calib C achieves better performance, especially in the OOD setting). This reveals that the existing selective prediction approaches do not translate well across tasks. + +# 5 Conclusion + +Selective prediction ability is crucial for NLP systems to be reliably deployed in real-world applications and we presented the most systematic study of existing selective prediction approaches. Our study involved experiments in IID, OOD, and ADV settings with 17 datasets across several NLP tasks. We showed that despite leveraging additional resources (held-out data/computation), existing approaches fail to consistently and considerably outperform the simplest baseline (MaxProb). Furthermore, we demonstrated that these approaches do not translate well across tasks. Overall, our results highlight that there is a need to develop stronger selective prediction approaches that perform well across multiple tasks (QA, NLI, etc.) and settings (IID, OOD, and ADV) while being resource-efficient. + +# Acknowledgements + +We thank the anonymous reviewers for their insightful feedback. This research was supported by DARPA SAIL-ON and DARPA CHESS programs. + +# References + +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. +Chi-Keung Chow. 1957. An optimum character recognition system using decision functions. IRE Transactions on Electronic Computers, (4):247-254. +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. +William B Dolan and Chris Brockett. 2005. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005). +Matthew Dunn, Levent Sagun, Mike Higgins, V Ugur Guney, Volkan Cirik, and Kyunghyun Cho. 2017. Searchqa: A new q&a dataset augmented with context from a search engine. arXiv preprint arXiv:1704.05179. + +Ran El-Yaniv et al. 2010. On the foundations of noise-free selective classification. Journal of Machine Learning Research, 11(5). +Hady Elsahar and Matthias Galle. 2019. To annotate or not? predicting performance drop under domain shift. 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 2163-2173, Hong Kong, China. Association for Computational Linguistics. +Yarin Gal and Zoubin Ghahramani. 2016. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pages 1050-1059. PMLR. +Siddhant Garg and Alessandro Moschitti. 2021. Will this question be answered? question filtering via answer model distillation for efficient question answering. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7329-7346, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics. +Yonatan Geifman and Ran El-Yaniv. 2017. Selective classification for deep neural networks. In NIPS. +Yonatan Geifman and Ran El-Yaniv. 2019. Selectivenet: A deep neural network with an integrated reject option. In ICML. +Max Glockner, Vered Shwartz, and Yoav Goldberg. 2018. Breaking NLI systems with sentences that require simple lexical inferences. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 650-655, Melbourne, Australia. Association for Computational Linguistics. +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. +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. +Shankar Iyer, Nikhil Dandekar, and Kornél Csernai. 2017. First quora dataset release: Question pairs. data.quora.com. +Zhengbao Jiang, Jun Araki, Haibo Ding, and Graham Neubig. 2021. How Can We Know When Language Models Know? On the Calibration of Language Models for Question Answering. Transactions of the Association for Computational Linguistics, 9:962-977. + +Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. 2017. TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1601-1611, Vancouver, Canada. Association for Computational Linguistics. +Amita Kamath, Robin Jia, and Percy Liang. 2020. Selective question answering under domain shift. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5684-5696, Online. Association for Computational Linguistics. +Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, Tony Lee, Etienne David, Ian Stavness, Wei Guo, Berton Earnshaw, Imran Haque, Sara M Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. 2021. Wilds: A benchmark of in-the-wild distribution shifts. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 5637-5664. PMLR. +Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: A benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:452-466. +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. +John Miller, Karl Krauth, Benjamin Recht, and Ludwig Schmidt. 2020. The effect of natural distribution shift on question answering models. In International Conference on Machine Learning, pages 6905-6916. PMLR. +Swaroop Mishra, Anjana Arunkumar, Chris Bryan, and Chitta Baral. 2020. Our evaluation metric needs an update to encourage generalization. arXiv preprint arXiv:2007.06898. +Aakanksha Naik, Abhilasha Ravichander, Norman Sadeh, Carolyn Rose, and Graham Neubig. 2018. Stress test evaluation for natural language inference. In Proceedings of the 27th International Conference on Computational Linguistics, pages 2340-2353, Santa Fe, New Mexico, USA. Association for Computational Linguistics. +Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, + +Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, et al. 2011. Scikit-learn: Machine learning in python. the Journal of machine Learning research, 12:2825-2830. +John Platt et al. 1999. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in large margin classifiers, 10(3):61-74. +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. +Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. 2016. Rethinking the inception architecture for computer vision. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2818-2826. +Alon Talmor and Jonathan Berant. 2019. MultiQA: An empirical investigation of generalization and transfer in reading comprehension. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4911-4921, Florence, Italy. Association for Computational Linguistics. +Adam Trischler, Tong Wang, Xingdi Yuan, Justin Harris, Alessandro Sordoni, Philip Bachman, and Kaheer Suleman. 2017. NewsQA: A machine comprehension dataset. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pages 191-200, Vancouver, Canada. Association for Computational Linguistics. +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. +Sean Welleck, Jason Weston, Arthur Szlam, and Kyunghyun Cho. 2019. Dialogue natural language inference. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3731-3741, Florence, Italy. Association for Computational Linguistics. +Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence 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. + +Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. 2018. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2369-2380, Brussels, Belgium. Association for Computational Linguistics. + +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. + +# Appendix + +# A Related Tasks + +# A.1 Confidence Calibration + +Selective Prediction is closely related to confidence calibration (Platt et al., 1999) i.e aligning model's output probability with the true probability of its predictions. Calibration focuses on adjusting the overall confidence level of a model, while selective prediction is based on relative confidence among the examples i.e systems are judged on their ability to rank correct predictions higher than incorrect predictions. + +# A.2 Out-of-Domain Detection + +Using OOD Detection systems for selective prediction (abstain on all detected OOD instances) would be too conservative as it has been shown that models are able to correctly answer a significant fraction of OOD instances (Talmor and Berant, 2019; Hendrycks et al., 2020; Mishra et al., 2020). + +# B Why Lower AUC is Better? + +Small magnitude values of area under curve (AUC) are preferred as they represent low average risk across all confidence thresholds. + +# C Comparing SP Approaches + +Table 1 compares SP performance (AUC of risk-coverage curve) of various approaches for Duplicate Detection datasets. Table 2 compares SP performance (AUC of risk-coverage curve) of various approaches for QA datasets. Table 3 compares SP performance (AUC of risk-coverage curve) of various approaches for NLI datasets. + +
Train OnMethodIID↓OOD avg.↓ADV avg.↓
QQPMaxProb2.031.7260.9
MCD lite1.8523.8362.53
MCD1.823.6162.52
LS2.0827.9261.92
Calib C2.0431.0961.22
Calib R2.0728.5360.68
Calib T4.2138.2560.25
MRPCMaxProb6.1340.4663.88
MCD lite5.4838.2365.76
MCD(5.3538.2165.62
LS6.0839.0564.99
Calib C6.1739.8264.99
Calib R6.5239.9965.13
Calib T13.3539.7564.22
+ +Table 1: Comparing selective prediction performance (AUC of risk-coverage curve) of various approaches for Duplicate Detection datasets. Lower AUC is better in SP. MaxProb baseline scores are underlined, best performance is in bold, and scores that considerably outperform MaxProb are highlighted. + +
Train OnMethodIID↓OOD avg.↓ADV avg.↓
SQuADMaxProb6.7146.7333.69
MCD lite6.0644.5633.34
MCD6.0044.3533.05
Calib C6.1545.9333.27
Calib R6.2545.9433.18
Calib T14.7260.3147.87
+ +Table 2: Comparing selective prediction performance (AUC of risk-coverage curve) of various approaches for QA datasets. Lower AUC is better in SP. MaxProb baseline scores are underlined, best performance is in bold, and scores that considerably outperform MaxProb are highlighted. + +# D MaxProb for Selective Prediction + +Figure 3a shows the trend of accuracy against maxProb for various models in the IID setting. It can be observed that with the increase in MaxProb the accuracy usually increases. This implies that a higher value of MaxProb corresponds to more likelihood of the model's prediction being correct. Hence, MaxProb can be directly used as the confidence estimator for selective prediction. We plot the risk-coverage curves using MaxProb as the SP technique in Figure 3b. As expected, the risk increases with the increase in coverage for all the models. We plot such curves for all techniques and compute area under them to compare their SP performance. This shows that MaxProb is a simple yet strong baseline for selective prediction. + +Figure 3: Trend of Accuracy vs. MaxProb, Risk vs. Coverage for various models in the IID setting. +![](images/20356295652d334997604391e0164d7e230eba8f0e5bbe3668cd01c318bc3953.jpg) +(a) With increase in MaxProb, the accuracy usually (b) With increase in coverage (i.e. decrease in ab-stention threshold), the risk usually increases. + +![](images/e837e8de47a701cb35f31ecaacd4ac028ece24665d2d9787af135cd248903b7c.jpg) + +
Train OnMethodIID↓OOD avg.↓ADV avg.↓
SNLIMaxProb2.7823.3432.4
MCD(K=10)2.5223.9632.61
MCD(K=30)2.4723.8132.47
LS2.722.4231.7
Calib C2.5722.4733.0
Calib R2.6123.1233.95
Calib T7.0234.7440.68
MNLIMaxProb5.4716.4828.39
MCD(K=10)5.0716.2929.42
MCD(K=30)4.9216.1829.18
LS5.1816.9428.55
Calib C5.1614.1629.57
Calib R5.2814.8429.67
Calib T13.5126.1235.79
DNLIMaxProb7.3653.5951.85
MCD(K=10)7.1753.7753.23
MCD(K=30)6.6953.6753.24
LS5.1353.0453.67
Calib C3.8852.3552.91
Calib R3.953.0852.83
Calib T5.4653.5858.13
+ +Table 3: Comparing selective prediction performance (AUC of risk-coverage curve) of various approaches for NLI datasets. Lower AUC is better in SP. MaxProb baseline scores are underlined, best performance is in bold, and scores that considerably outperform MaxProb are highlighted. + +# E Comparing Risk-Coverage Curves of MCD and Calib C for DNLI Dataset in IID Setting + +We compare the risk-coverage curves of MCD and Calib C approaches on DNLI in Figure 4. We observe that at all coverage points, Calib C achieves lower risk than MCD and hence is a better SP technique. We find that they benefit from using the predicted label as a feature for calibration. Specifically, the model's prediction accuracy varies greatly + +![](images/67f67bd94f743fa084966723ba656eb77efa3e643a61602ac0c93524504ad5dc.jpg) +Figure 4: Comparing risk-coverage curves of MCD and Calib C for DNLI dataset in IID setting. + +across labels (0.94, 0.91, and 0.76 for entailment, contradiction, and neutral labels respectively). This implies that when the model's prediction is neutral, it is relatively less likely to be correct (at least in the IID setting). Calib C and R approaches leverage this signal and tune the confidence estimator using a held-out dataset and thus achieve superior SP performance. + +# F Composite SP Approach: + +We note that calibration techniques can be used in combination with Monte-Carlo dropout to further improve the SP performance. However, it would require even more additional resources i.e held-out datasets in addition to multiple inferences. \ No newline at end of file diff --git a/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/images.zip b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..271ef1fe62aea82a0ab5a3ad4b95065e91f76a96 --- /dev/null +++ b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eafd6ec9af991f4390ffd97773b25f97a70bdf69c6f3d4d81cd6c64cacf8f8c5 +size 279774 diff --git a/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/layout.json b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ec1a53fd746fc2d0e29a6f2c48135d6396a2d357 --- /dev/null +++ b/investigatingselectivepredictionapproachesacrossseveraltasksiniidoodandadversarialsettings/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:622891c54b1b0f186c53411166462414f2d82378f06c8da8072bd2c7d76bd5c7 +size 248705 diff --git a/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_content_list.json b/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8bd2319cdbea6dda006f135951e6d1716711a1bb --- /dev/null +++ b/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f934fbf9885173d7d63d34f36a410eb3461a634ed91daca48e5c4ee52c18e9c +size 109416 diff --git a/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_model.json b/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9b90046eb6fb590cbbf5fffb9dddc2e541e9d262 --- /dev/null +++ b/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71fa559373a660a90e9eaea6ad28fc20bd208a0dd686d1889ea1f4f272e56cc3 +size 128650 diff --git a/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_origin.pdf b/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bba37116b0e7e66a0050bfef8b72d6cc02f9257e --- /dev/null +++ b/isoscoremeasuringtheuniformityofembeddingspaceutilization/c62fb03c-8199-44ea-93a8-dade0bc56295_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69a4291c7c68dcc026921f86691d8a8c22467bebdd5b3b06f6a658cc49c65091 +size 1415929 diff --git a/isoscoremeasuringtheuniformityofembeddingspaceutilization/full.md b/isoscoremeasuringtheuniformityofembeddingspaceutilization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4b40f5e0340fa0fcbcc85c259b179303f063647a --- /dev/null +++ b/isoscoremeasuringtheuniformityofembeddingspaceutilization/full.md @@ -0,0 +1,528 @@ +# IsoScore: Measuring the Uniformity of Embedding Space Utilization + +William Rudman†, Nate Gillman‡, Taylor Rayne*, Carsten Eickhoff† +Department of Computer Science, Brown University† +Department of Mathematics, Brown University‡ +Quest University* + +{william_rudman, ngillman, carsten}@brown.edu +taylor.rayne@questu.ca + +# Abstract + +The recent success of distributed word representations has led to an increased interest in analyzing the properties of their spatial distribution. Several studies have suggested that contextualized word embedding models do not isotropically project tokens into vector space. However, current methods designed to measure isotropy, such as average random cosine similarity and the partition score, have not been thoroughly analyzed and are not appropriate for measuring isotropy. We propose IsoScore: a novel tool that quantifies the degree to which a point cloud uniformly utilizes the ambient vector space. Using rigorously designed tests, we demonstrate that IsoScore is the only tool available in the literature that accurately measures how uniformly distributed variance is across dimensions in vector space. Additionally, we use IsoScore to challenge a number of recent conclusions in the NLP literature that have been derived using brittle metrics of isotropy. We caution future studies from using existing tools to measure isotropy in contextualized embedding space as resulting conclusions will be misleading or altogether inaccurate. + +# 1 Introduction & Background + +The first step in any natural language processing pipeline is to represent text in a vector space. Understanding how contextualized word embedding models project tokens into vector space is crucial for advancing the field of natural language processing. Several recent studies analyzing the spatial distribution of contextualized word embeddings claim that the point clouds induced by models such as BERT or GPT-2 do not uniformly utilize all dimensions of the vector space they occupy (Ethayarajh, 2019; Mickus et al., 2019; Cai et al., 2021; Coenen et al., 2019b; Gao et al., 2019). + +Figure 1 illustrates a two-dimensional disk that uniformly utilizes the $x$ and $y$ axes in two-dimensional space, but does not uniformly utilize + +all dimensions when embedded into three dimensions. + +![](images/7e6c706f5faa198b42ed346ef1496327453b1b88d71c2bcf5805ae2d7d7a6afb.jpg) +Figure 1: From left to right, a line, disk, and ball embedded in 3D space. + +![](images/407fb9fc1b4ce9c195e2044c2d94c73601aec2a78dc3544a92d2469870770982.jpg) + +![](images/62580af73fc11acd870fb426c28f3fa38b86b78379d49ab24c0c468b3f4a6edf.jpg) + +A distribution is isotropic when variance is uniformly distributed across all dimensions. Namely, a distribution is fully isotropic when the covariance matrix is proportional to the identity matrix. Several authors suggest that isotropy correlates with improved performance of embedding models (Biš et al., 2021; Wang et al., 2019; Coenen et al., 2019a; Gong et al., 2018; Hasan and Curry, 2017; Hewitt and Manning, 2019; Liang et al., 2021; Zhou et al., 2019, 2021). However, current methods of measuring the spatial utilization of contextualized embedding models do not truly measure isotropy. The most commonly used methods for measuring spatial distribution in embedding spaces include average random cosine similarity, the partition score, variance explained and intrinsic dimensionality estimation. In Section 5 we argue that all current methods of measuring isotropy have fundamental shortcomings that render them inadequate measures of spatial distribution. + +To overcome these limitations, we introduce IsoScore: a novel tool for measuring the extent to which the variance of a point cloud is uniformly distributed across all dimensions in vector space. In contrast to previous attempts of measuring isotropy, IsoScore is the first score that incorporates the mathematical definition of isotropy into its formulation. As a result, IsoScore has the following desirable properties that surpass the capabilities of existing metrics: (i) It is a global measure of how + +uniformly distributed points are in vector space that is robust to changes in the distribution mean and scalar changes in covariance; (ii) It is rotation invariant; (iii) It increases linearly as more dimensions are utilized; and (iv) It is not skewed by highly isotropic subspaces within the data. This paper makes the following novel contributions. + +1. This paper outlines essential conditions for measuring isotropy and uses a testing suite to empirically verify if a given method meets these conditions. +2. We highlight fundamental shortcomings of state-of-the-art tools and demonstrate that none of the existing methods accurately measure isotropy. +3. We present IsoScore, the first rigorously defined method for measuring isotropy in point clouds of data. +4. We share an efficient Python implementation of IsoScore with the community. $^{1}$ + +The remainder of this paper is structured as follows: Section 2 reviews previous works attempting to study isotropy in contextualized word embeddings. Section 3 formally defines isotropy and describes existing tools in detail. The formal definition of IsoScore is presented in Section 4 and in Section 5, we report empirical results from experiments on contextualized word embeddings. Finally, Section 6 concludes with an outlook on future directions of work. + +# 2 Related Work + +# 2.1 Word Embeddings + +In recent years, there has been an increased interest in analyzing the spatial organization of point clouds induced by word embeddings (Biš et al., 2021; Mickus et al., 2019; Ethayarajh, 2019; Coenen et al., 2019b; Cai et al., 2021; Mu et al., 2017; Liang et al., 2021). Several studies have concluded that contextualized embeddings form highly anisotropic, "narrow cones" in vector space (Ethayarajh, 2019; Cai et al., 2021; Gao et al., 2019; Gong et al., 2018). The most prevalent tools used to quantify the geometry of word embedding models calculate the average cosine similarity of a small number of randomly sampled pairs of points in + +embedding space. Ethayarajh (2019) claims that in some cases, contextualized embedding models have an average random cosine similarity that approaches 1.0, meaning all points are oriented in the same direction in space irrespective of their syntactic or semantic function. + +![](images/933bf7eb91729b4c0732e40ac8e86b1efc14348ad37f8019919ef5775c4f975f.jpg) +Figure 2: Left: Point cloud $X \subset \mathbb{R}^2$ . Right: Result of applying a zero-mean transform to $X$ . + +In Section 5, we demonstrate that both average random cosine similarity and the partition score are significantly influenced by the mean of the data irrespective of how data points are distributed in vector space. Namely, if we normalize data to have zero-mean, average random cosine similarity and the partition score will artificially produce a score that reflects maximal isotropy. Figure 2 demonstrates that applying a zero-mean transform to a point cloud increases the angle of randomly sampled points. Accordingly, the average random cosine of the left point cloud in Figure 2 approaches 1 while the average random cosine similarity of the right point cloud approaches 0. It is well known that word embedding models have non-zero mean vectors (Yonghe et al., 2019; Liang et al., 2021). In the case of GPT-2 embeddings obtained from the WikiText-2 corpus (Merit et al., 2016), we find values in the mean vector range from $-32.36$ to $198.19$ . Although cosine similarity has long been used to capture the "semantic" differences between words in static embeddings, adapting any cosine similarity-based methods to measure isotropy obscures the true distribution of contextualized word embeddings. + +# 2.2 Existing Methods + +We briefly review the most commonly used tools to measure the spatial distribution of point clouds $X \subseteq \mathbb{R}^n$ . A mathematical exposition of these tools can be found in Appendix B. + +Average Random Cosine Similarity: We define the Average Random Cosine Similarity Score as 1 minus the average cosine similarity of $N = 100,000$ randomly sampled pairs of points from $X$ . Note: for ease of comparison to other methods, we + +
TestIsoScoreAvgRandCosSimPartitionID ScoreVarEx
1. Mean Agnostic
2. Scalar Covariance
3. Maximum Variance
4. Rotation Invariance
5. Dimensions Used
6. Global Stability
+ +Table 1: Performance of current methods for measuring spatial utilization. + +calculate 1 minus the absolute value of the average random cosine similarity so that 0 would indicate minimal isotropy and 1 would indicate maximal isotropy. We demonstrate in Section 5 that average random cosine similarity is not a measure of isotropy. + +Partition Isotropy Score: Mu et al. (2017) define this score to be a particular quotient involving the partition function first proposed by Arora et al. (2015): $Z(c) \coloneqq \sum_{x \in X} \exp(c^{\mathrm{T}} x)$ , where $c$ is carefully chosen from the eigenspectrum of $XX^{\mathrm{T}}$ . It is believed that a score closer to 0 indicates an anisotropic space, while a score near 1 indicates an isotropic space. We refer to this as the Partition Score. + +Intrinsic Dimensionality: Algorithms for estimating intrinsic dimensionality aim to compute the true dimension of a given manifold from which we assume a point cloud has been sampled. Intrinsic dimensionality has been used to argue word embedding models are anisotropic (Cai et al., 2021). We use the MLE method to calculate intrinsic dimensionality (Levina and Bickel, 2004). Dividing the intrinsic dimensionality of $X \subseteq \mathbb{R}^n$ by $n$ provides us with a normalized score of isotropy, which we refer to as the ID Score. + +Variance Explained Ratio: The variance explained ratio, which we refer to as the VarEx Score, measures how much total variance is explained by the first $k$ principal components of the data. We compute this by dividing the variance explained by the first $k$ principal components by $k / n$ . The VarEx Score requires us to specify a priori the number of principal components we wish to examine, which makes comparisons between vector spaces with different dimensions difficult and results in undesirable behavior, particularly when the dimension of the vector space is large. + +Section 5 demonstrates that all existing methods have fundamental shortcomings that make them unreliable measures of spatial distribution. Using any of the above existing tools to make claims + +about isotropy will be misleading as none of the described methods truly measure isotropy. + +# 3 Measuring Embedding Space Utilization + +# 3.1 Definition of Isotropy + +A distribution is isotropic if its variance is uniformly distributed across all dimensions. Namely, the covariance matrix of an isotropic distribution is proportional to the identity matrix. Conversely, an anisotropic distribution of data is one where the variance is dominated by a single dimension. For example, a line in $n$ -dimensional vector space is maximally anisotropic. Robust isotropy metrics should return maximally isotropic scores for balls and minimally isotropic (i.e. anisotropic) scores for lines. Appendix D provides a geometric interpretation of "medium isotropy". We interpret a medium isotropic space in $\mathbb{R}^n$ to be one where the data uniformly utilizes approximately $n/2$ dimensions in space as defined below. Note that we exclude two edge cases for measuring isotropy. Firstly, since isotropy is a property of the covariance matrix of a distribution, the dimensionality of the space needs to be greater than 1. Secondly, we do not consider the extreme case where the data consists of a single point. + +# 3.2 Dimensions utilized + +Given a point cloud $X \subseteq \mathbb{R}^n$ , we measure how many dimensions of $\mathbb{R}^n$ are truly utilized by $X$ . For example, we denote by $I_n^{(k)}$ the $n \times n$ covariance matrix where $a_{i,i} = 1$ for $i \in \{1,2,\dots,k\}$ and all other elements are 0. Note that when $k = n$ , we recover the identity matrix. Thus, $I_n^{(k)}$ represents a covariance matrix where the first $k$ dimensions are being uniformly utilized. Figure 1 illustrates point clouds in $\mathbb{R}^3$ that have covariance matrix $I_3^{(1)}, I_3^{(2)}$ , and $I_3^{(3)}$ . These utilize 1, 2, and 3 dimensions in $\mathbb{R}^3$ . To make this discussion rigorous and general, we make the following definition: + +
\(\iota(I_9^{(1)})\)\(\iota(I_9^{(2)})\)\(\iota(I_9^{(3)})\)\(\iota(I_9^{(4)})\)\(\iota(I_9^{(5)})\)\(\iota(I_9^{(6)})\)\(\iota(I_9^{(7)})\)\(\iota(I_9^{(8)})\)\(\iota(I_9^{(9)})\)
0.0000.1250.2500.3750.5000.6250.7500.8751.000
+ +Table 2: Linearly increasing dimensions utilized in $\mathbb{R}^9$ linearly increases IsoScore. We prove in Appendix D that IsoScore satisfies the formula $\iota(I_n^{(k)}) = \frac{k - 1}{n - 1}$ . + +Definition 3.1. Consider a point cloud $X \subseteq \mathbb{R}^n$ . Let $\Sigma$ be the covariance matrix of $X$ and assume all the off-diagonal entries of $\Sigma$ are zero. Let $\Sigma_D \in \mathbb{R}^n$ denote the diagonal of $\Sigma$ . + +1. We say $X$ utilizes $k$ dimensions in $\mathbb{R}^n$ if the first $k$ entries of $\Sigma_D$ are non-zero and the remaining $n - k$ entries are zero. +2. We say $X$ uniformly utilizes $k$ dimensions in $\mathbb{R}^n$ if $X$ utilizes $k$ dimensions in $\mathbb{R}^n$ and if all the non-zero entries in $\Sigma_D$ are equal. + +Having a diagonal sample covariance matrix $\Sigma$ implies there are no correlations between any coordinates of $X$ . In Section 4, we reduce the general case of $X$ to the case where the covariance matrix of $X$ is diagonal. Figure 3 illustrates three point clouds in $\mathbb{R}^2$ that each utilize 2 dimensions. We argue that it is of practical importance to differentiate between the cases in Figure 3. The leftmost panel uniformly utilizes all dimensions of $\mathbb{R}^2$ , while the rightmost panel does not uniformly utilize two dimensions of space. Note that average random cosine similarity returns maximal isotropy scores for each point cloud pictured in Figure 3. + +Our proposed IsoScore reflects the dimensions utilized by a point cloud in a linear fashion. See Table 2 for a concrete example of how IsoScore reflects dimensions utilized in $\mathbb{R}^9$ . + +![](images/6d1002bd1d8684150c597dd118b4ba21c3e28370dafce5f6bd97b7b8f0b74382.jpg) +Figure 3: Points sampled from a 0 mean, 2D Gaussian with covariance $\left( \begin{array}{cc}x & 0\\ 0 & 1 \end{array} \right)$ where $x = 1,3,75$ + +# 3.3 Essential Properties of Isotropy + +We now outline the essential properties that a measure of isotropy must possess. + +1: Mean Agnostic. Recall that a distribution is isotropic if variance is uniform across all dimensions. It is essential to note that isotropy is strictly a + +property of the covariance matrix of a distribution. If changes to the mean of a distribution influence an isotropy score, then the given score does not measure isotropy. + +2: Scalar Changes to the Covariance Matrix. Since isotropy is defined as the uniformity of variance across all dimensions, isotropy scores should not change when we multiply the covariance matrix of the underlying distribution of the data by a positive scalar value. If the covariance matrix of a distribution of data is equal to $\lambda \cdot I_{n}$ where $\lambda > 0$ is some scalar value and $I_{n}$ is the $n \times n$ identity matrix, then a tool must return an isotropy score approaching 1. + +3: Maximum Variance. As we increase the difference between the maximum variance value in our covariance matrix and the average variance value of the remaining dimensions, isotropy scores should monotonically decrease to zero. Figure 3 illustrates the effect of increasing the difference between the average variance value and the maximum value in the covariance matrix. Increasing the difference between the maximum variance value and the average variance value increases the amount of variance explained by the first principal component of the data. Namely, larger maximum variance values reduce the efficiency of spatial utilization. + +4: Rotation Invariance. Given a point cloud $X \subset \mathbb{R}^n$ , an ideal measure of spatial utilization should remain constant under rotations of $X$ since the distribution of principal components remains constant under rotation. Accordingly, we consider the canonical distribution of the variance of $X$ to be the variance after projecting $X$ using principal component analysis. Figure 4 illustrates the process of PCA-reorientation. + +5: Dimensions Used. As described in Subsection 3.2, there is a direct link between isotropy and the number of dimensions utilized by the data. Intuitively, increasing the number of dimensions uniformly utilized by the data expands the number of principal components it takes to explain all of the variance in the data. Accordingly, a good score of spatial utilization should increase linearly as we + +increase the number of dimensions uniformly utilized by the data. Figure 1 depicts data utilizing one, two, and three out of three ambient dimensions, respectively. + +![](images/459baed040a167583d920d931fc14d50a18b4dada55d85c27355e262dfc76e34.jpg) +Figure 4: Left: 2D zero-mean Gaussian with covariance $\left( \begin{array}{ll}1 & 0.8\\ 0.8 & 1 \end{array} \right)$ . We rotate $X$ by $120^{\circ}$ and $240^{\circ}$ , respectively. Right: Points after applying PCA reorientation. + +6: Global stability. A metric of efficient spatial utilization should be a global reflection of the distribution. A robust method should be stable even when the data exhibits small subpopulations where a score would return an extreme value. + +We test this by computing IsoScore for the union of a noisy sphere and a line; we provide a geometric rendering of this in Figure 5 in Appendix E. We refer to this test as the "skewered meatball" test. A good score of spatial distribution for a "skewered meatball" should reflect the ratio of the number of points sampled from the line and the number of points sampled from the sphere. + +![](images/3e0f937a7d0c01eecf70ec73802c31659bafd0a878bb1c8700edeff010586740.jpg) +Figure 5: 2D rendering of a line in 3D space intersecting noisy sphere. AKA "skewered meatball." + +In Table 1, we list which existing methods satisfy which essential conditions. Section 5 outlines the numerical experiments we execute to obtain this table. As each of the above properties have been derived from the mathematical definition of isotropy, an accurate tool for measuring isotropy needs to satisfy each essential condition. + +# 4 IsoScore + +This section introduces the proposed IsoScore metric of uniform spatial utilization. + +# 4.1 Formal Definition of IsoScore + +Algorithm 1 gives a high-level overview of the procedure. Afterwards, we discuss the individual steps in detail. + +Step 1: Start with a point cloud $X \subseteq \mathbb{R}^n$ . IsoScore takes as input a finite subset of $\mathbb{R}^n$ and outputs a number in the interval [0, 1] that represents the extent to which $X$ is isotropic. + +Step 2: PCA-reorientation of data set. Execute PCA on $X$ , where the target dimension remains the original $n$ . Performing PCA reorients the axes of $X$ so that the $i$ 'th coordinate accounts for the $i$ 'th greatest variance. Further, it eliminates all correlation between dimensions making the covariance matrix diagonal. We denote the transformed space as $X^{\mathrm{PCA}}$ . + +Step 3: Compute variance vector of reoriented data. Compute the $n \times n$ covariance matrix of $X^{\mathrm{PCA}}$ ; denote this matrix by $\Sigma$ . Let $\Sigma_D$ denote the diagonal of the covariance matrix. We refer to $\Sigma_D$ as the variance vector, and we identify $\Sigma_D$ as a vector in $\mathbb{R}^n$ . Performing Step 2 causes all off-diagonal entries of the covariance matrix of $X_T$ to vanish, which allows us to ignore off-diagonal elements for the rest of the computation. + +Step 4: Length normalization of variance vector. We define the normalized variance vector to be + +$$ +\hat {\Sigma} _ {D} := \sqrt {n} \cdot \frac {\Sigma_ {D}}{\| \Sigma_ {D} \|}, +$$ + +where $\| (x_1,\dots,x_n)\| \coloneqq \sqrt{x_1^2 + \cdots + x_n^2}$ denotes the standard Euclidean norm on $\mathbb{R}^n$ . Note that as a result of this normalization, we have $\| \hat{\Sigma}_D\| = \sqrt{n}$ . + +Step 5: Compute the distance between the covariance matrix and identity matrix. Denote the diagonal of the $n \times n$ identity matrix by $\mathbf{1} \in \mathbb{R}^n$ . Then we define the isotropy defect of $X$ to be + +$$ +\delta (X) := \frac {\| \hat {\Sigma} _ {D} - \mathbf {1} \|}{\sqrt {2 (n - \sqrt {n})}}. +$$ + +By definition of the Euclidean norm, we have $\| \hat{\Sigma}_D\| = \| \mathbf{1}\| = \sqrt{n}$ . It follows from the triangle inequality that $\| \hat{\Sigma}_D - \mathbf{1}\| \in [0,2\sqrt{n}]$ . Crucially, we prove in Appendix C that achieving a value of $2\sqrt{n}$ using a valid covariance matrix is impossible. The largest value that can be attained is with the matrix $(a_{ij})_{i,j=1,\dots,n}$ defined by + +Algorithm 1 IsoScore +1: begin Let $X\subset \mathbb{R}^n$ be a finite collection of points. +2: Let $X^{\mathrm{PCA}}$ denote the points in $X$ transformed by the first $n$ principal components. +3: Define $\Sigma_D\in \mathbb{R}^n$ as the diagonal of the covariance matrix of $X^{\mathrm{PCA}}$ . +4:Normalize diagonal to $\hat{\Sigma}_D\coloneqq \sqrt{n}\cdot \Sigma_D / \| \Sigma_D\|$ , where $\| \cdot \|$ is the standard Euclidean norm. +5: The isotropy defect is $\delta (X)\coloneqq \| \hat{\Sigma}_D - \mathbf{1}\| /\sqrt{2(n - \sqrt{n})}$ , where $\mathbf{1} = (1,\ldots ,1)^{\top}\in \mathbb{R}^{n}$ +6: $X$ uniformly occupies $\phi (X)\coloneqq (n - \delta (X)^2 (n - \sqrt{n}))^2 /n^2$ percent of ambient dimensions. +7: Transform $\phi (X)$ so it can take values in [0, 1], via $\iota (X)\coloneqq (n\cdot \phi (X) - 1) / (n - 1)$ +8: return: $\iota (X)$ +9: end + +$a_{11} = \sqrt{n}$ and $a_{ii} = 0$ whenever $i > 1$ . One can compute that the Euclidean norm in this case is $\| \hat{\Sigma}_D - \mathbf{1}\| = \sqrt{2(n - \sqrt{n})}$ . Choosing this normalization factor guarantees that $\delta (X)\in [0,1]$ , where 0 represents a perfectly isotropic space and 1 represents a perfectly anisotropic space. + +Step 6: Use the isotropy defect to compute percentage of dimensions isotropically utilized. We argue in Heuristic D.1 that if $X$ has isotropy defect $\delta(X)$ , then $X$ isotropically occupies approximately $k(X) = (n - \delta(X)^2(n - \sqrt{n}))^2 / n$ dimensions in $\mathbb{R}^n$ . Because $\delta(X) \in [0,1]$ , one can estimate that $k(X) \in [1,n]$ so the fraction of dimensions utilized is $\phi(X) := k(X) / n \in [1/n,1]$ . + +Step 7: Linearly scale percentage of dimensions utilized to obtain IsoScore. The fraction of dimensions utilized, $\phi(X)$ , is close to the final IsoScore, but it falls within the interval $[1/n, 1]$ . As we want the possible range of scores to fill the interval $[0, 1]$ , we apply the affine function that maps $1/n \mapsto 0$ and $1 \mapsto 1$ . Thus, $S:[1/n, 1] \to [0, 1]: x \mapsto (nx - 1) / (n - 1)$ . Once we compose these transformations, we obtain IsoScore: + +$$ +\iota (X) := \frac {(n - \delta (X) ^ {2} (n - \sqrt {n})) ^ {2} - n}{n (n - 1)}. \tag {4.1} +$$ + +# 4.2 Geometric Interpretation for IsoScore + +In Subsection 4.1 we described how to compute an IsoScore $\iota(X)$ for any point cloud $X \subseteq \mathbb{R}^n$ . We will now present a heuristic interpretation for a given IsoScore. Intuitively, our heuristic says that $\iota(X)$ is roughly the fraction of dimensions of $\mathbb{R}^n$ utilized by $X$ . More precisely, the quantity of dimensions of $\mathbb{R}^n$ utilized by $X$ is some number inside the interval $[\iota(X)n, \iota(X)n + 1] \cap [1,n]$ . We formalize this below. + +Heuristic 4.1. When the ambient space $\mathbb{R}^n$ has large dimension, the IsoScore $\iota(X)$ is approximately the fraction of dimensions uniformly utilized by $X$ . + +We prove this heuristic in Appendix D. Note in particular that $\iota(X) = 0$ implies that D.1 simplifies to a single dimension utilized and $\iota(X) = 1$ implies that D.1 simplifies to all $n$ dimensions utilized. + +Because IsoScore covers a continuous spectrum, one should carefully interpret what we mean when we say that $X$ occupies approximately $k$ dimensions of $\mathbb{R}^n$ . For example, consider the 2D Gaussian distributions depicted in Figure 3. Heuristic D.1 predicts $k = 1.9996, 1.6105, 1.0281$ dimensions are used when $x = 1, 3, 75$ , respectively. These should be interpreted as follows: "when $x = 75$ , the points sampled are mostly using one direction of space" and "when $x = 3$ , the points sampled are using somewhere between one and two dimensions of space." + +# 5 Experiments + +In Subsection 5.1, we present results from numerical experiments designed to test each of the isotropy scores presented in this paper against the six essential properties outlined in Section 3.3. Exact descriptions of the numerical experiments are provided in Appendix E. We reiterate that each of the essential conditions have been derived directly from the mathematical definition of isotropy and violating any of the essential properties disqualifies a method from being a correct measure of isotropy. + +In Subsection 5.2, we demonstrate the merit of IsoScore by recreating the experimental setup presented in (Cai et al., 2021). We create word embeddings for tokens from the WikiText-2 corpus using GPT (Radford and Narasimhan, 2018), GPT-2 (Radford et al., 2019), BERT (Devlin et al., 2018) and DistilBERT (Sanh et al., 2019) and calculate isotropy scores for each layer of the model. + +Figure 6: Left: Scores of points sampled from a 10-dimensional Gaussian with identity covariance and common mean vector ranging from 0 to 20. Center: Scores for the scalar covariance test for a 5-dimensional, zero-mean Gaussian. Right: Scores for the Maximum Variance test for 10-dimensional, zero-mean Gaussians. +![](images/dc2707432a575b2bd1ab8d4c5a4a8b742b38f1678974b678595bdf6d2197d676.jpg) +Partition Score Avg. Cos. Score VarEx Score ID Score IsoScore + +![](images/6bf70bb91549a587c8ffd762b4af8711ce1cc31d1fe5d433adb6f94060fce888.jpg) + +![](images/0799fd40bf52c245f7d503f6b5a6ef5965fb6819711c3225cf8738e7fd4e7189.jpg) + +# 5.1 Testing methods against the essential properties + +Test 1: Mean Agnostic. When the covariance matrix of a distribution is proportional to the identity matrix, measures of isotropy should return a score of 1 regardless of the value of the mean. Figure 6 demonstrates that neither average random cosine similarity nor the partition score are mean-agnostic. IsoScore is mean-agnostic since it is a function of the covariance matrix. Importantly average random cosine similarity and the partition score are skewed by non-zero mean data. Our results show that, for an isotropic Gaussian with covariance matrix $\lambda \cdot I_n$ and mean vector $M = [\mu, \mu, \dots, \mu]$ , the average random cosine similarity of points sampled from this distribution will approach 0 as we increase the ratio between $\mu/\lambda$ . Consequently, zero-centering data will cause average random cosine similarity to return maximally isotropic scores without impacting the distribution of the variance. + +Test 2: Scalar Changes to the Covariance Matrix. For a 5-dimensional Gaussian distribution with a zero mean vector and covariance matrix $\lambda \cdot I_n$ , scores should reflect uniform utilization of space for any $\lambda > 0$ . Figure 6 shows that IsoScore and the intrinsic dimensionality score are the only metrics that are agnostic to scalar multiplication to the covariance matrix and return a score 1 for each value of $\lambda$ . In Step 4 of IsoScore, we normalize the diagonal of the covariance matrix to have the same norm as the diagonal of the identity matrix, which ensures IsoScore is invariant to scalar changes in covariance. + +Test 3: Maximum Variance. An effective score should monotonically decrease to 0 as we increase the difference between the maximum variance value and average variance. Steps 4 and 5 of + +Table 3: Performance of current methods on Test 4: Rotation Invariance + +
IsoScoreAvgCosSimPartitionID ScoreVarEx
X0.2160.9900.4451.0000.500
X120°0.2160.9680.6731.0000.500
X240°0.2160.9810.6691.0000.500
XPCA0.2160.9930.4461.0000.500
+ +IsoScore ensure that the less equitably the mass in the covariance vector is distributed, the greater the isotropy defect will be. Figure 3 visualizes this phenomenon for a 2 Dimensional Gaussian. The ID Score fails this test since the intrinsic dimensionality estimate is 2.0 for all point clouds depicted in Figure 3. + +Test 4: Rotation Invariance. We rotate our baseline point cloud $X$ by $120^{\circ}$ and $240^{\circ}$ . Lastly, we project $X$ using PCA reorientation while retaining dimensionality to obtain a point cloud $X^{\mathrm{PCA}}$ . We record results in Table ??. Only IsoScore, ID Score, and VarEx Score return constant values. The partition score would return a constant value if it were feasible to compute the true optimization problem. The approximate version of the partition score, however, depends too strongly on the basis. IsoScore is rotation invariant by design. In Step 2, IsoScore projects the point cloud of data in the directions of maximum variance before computing the covariance matrix of the data. + +Test 5: Dimensions Used (Fraction of Dimensions Used Test). The number of dimensions used in a point cloud $X \subset \mathbb{R}^n$ provides a sense of how uniformly $X$ utilizes the ambient space. A reliable metric should return scores near 0.0, 0.5, and 1.0 when number of dimensions used is 1, $\lfloor n / 2 \rfloor$ , and $n$ , respectively. Figure 7 shows that only IsoScore models ideal behavior for the dimensions used test. + +![](images/67978af9f3f4d77e6526f76593ebb94920c5b2c53a7a805d9aff0153ff74c81b.jpg) +Figure 7: Left and center: Scores for the two Dimensions Used tests. Right: Scores for the "skewered meatball" test in 3 dimensions. + +A rigorous explanation of why IsoScore reflects the percentage of 1s present in the diagonal of the covariance matrix is provided in Heuristic 4.1. Although the intrinsic dimensionality score monotonically increases as we increase $k$ , it fails to reach 1 when all dimensions are uniformly utilized. Average cosine similarity fails this test, as it stays constant near 1 regardless of the fraction of dimensions uniformly utilized. + +Test 5: Dimensions Used (High Dimensional Test). Metrics of spatial utilization should allow for easy comparison between different vector spaces even when the dimensionality of the two spaces is different. Figure 7 illustrates that IsoScore, the average cosine similarity score, and the partition score pass this test, as they stay constant near 1. Note that the line for IsoScore decreases slightly. By the law of large numbers, the more data points we sample from the Gaussian distribution, the closer the covariance matrix will be to the covariance matrix from which it was sampled. The VarEx Score is not stable under an increase in dimension primarily because it requires the user to specify the percentage of principal components used in calculating the score. Note that the ID Score begins to decrease simply by increasing the dimensionality of the space since the MLE method is not very well suited for estimating the intrinsic dimension of isotropic Gaussian balls. + +Test 6: Global Stability. To evaluate which scores are not skewed by highly concentrated subspaces, we design the "skewered meatball test" (see Figure 5 for a geometric rendering). As we increase the ratio between the number of points sampled from a 3D isotropic Gaussian and a 1D anisotropic line, we should see isotropy scores increase from 0 to 1, and hit 0.5 precisely when the number of points sampled from the Gaussian distribution and the line are equal. Results from the skewered meat- + +ball test in Figure 7 indicate that the partition score, IsoScore and intrinsic dimensionality estimation are the only metrics that are global estimators of the data. + +# 5.2 Isotropy in Contextualized Embeddings + +Recent literature suggests that contextualized word embeddings are anisotropic. However, as demonstrated in Subsection 5.1, no existing methods truly measure isotropy. We replicate experiments by (Cai et al., 2021), and present isotropy scores for the vector space of token embeddings generated from the WikiText-2 corpus for GPT (110M parameters) and GPT2 (117M parameters) in Figure 8, as well as the scores for BERT (base, uncased) and DistilBERT (base, uncased) in Figure 9. + +![](images/bf8ff4239517f763894f50ce842e52c00f5e09e1bf26b8208d1f9f0e0a3f1057.jpg) +Figure 8: The 5 scores for each of the 12 layers of GPT-2 and GPT + +![](images/ed6970b4978dc47c148c113a517d4db723d378f6e125e04014dd2c2f83846f0f.jpg) +Figure 9: The 5 scores for the 12 layers of BERT, and the 6 layers of DistilBERT + +Our findings using IsoScore challenge and extend upon the literature in the following ways. Contextualized embedding models (i) utilize even fewer dimensions than previously thought; (ii) do not utilize fewer dimensions in deeper layers; and (iii) in agreement with Bis et al. (2021), contextualized embedding models do not necessarily occupy a "narrow cone" in space. + +IsoScore returns values of less than 0.18 for every considered contextualized embedding model. GPT and GPT-2 embeddings do not even isotropically utilize a single dimension in space, in the sense of Heuristic D.1. Using average random cosine similarity, Cai et al. concluded that earlier layers in contextualized embedding models are more isotropic than layers deeper in the network. While this may appear to be true using inaccurate measures of isotropy, there is no significant decrease in IsoScore between the earlier and later layers of contextualized embedding models. Bis et al. (2021) argue that isotropy improves performance for contextualized embedding models and that enforcing zero mean embeddings recovers "isotropy". The author's claim to improve isotropy by subtracting the mean vector from the point clouds of embeddings produced from BERT, GPT-2 and RoBERTa, however, the authors use the partition score in attempts to measure isotropy which will return values close to 1 when the data is zero-mean. As demonstrated throughout the paper, isotropy is strictly a property of the covariance matrix of a distribution and is by definition mean-agnostic. + +Note that our average random cosine similarity score finds contextualized embedding models to be much more isotropic than previously reported. When computing the average random cosine similarity score for contextualized word embeddings we sample 250,000 pairs of points. Prior studies such as Ethayarajh (2019) and Cai et al. (2021) sample as few as 1000 pairs of points when calculating average random cosine similarity. In both cases, the point clouds contain millions of tokens embedded into 768 dimensional vector space and differences in reported scores are likely due to sampling noise. We found empirically that the quantity of points sampled should be orders of magnitude larger than the dimension. + +The notion of isotropy is often conflated with geometry. The geometry of isotropic vector spaces, however, will differ depending on the distribution that generates the points in space. For ex + +ample, multivariate isotropic Gaussians form $n$ -dimensional balls and uniform distributions form $n$ -dimensional cubes, yet both distributions receive an IsoScore of 1. For an illustrated example of points generated from different isotropic distributions, consult Appendix F. It is therefore not necessarily the case that even highly anisotropic embedding spaces form narrow, anisotropic cones. + +# 6 Conclusion & Future Works + +Several studies have attempted to study isotropy in contextualized embedding models. Using mathematically rigorous tests, we demonstrate that current methods do not accurately measure isotropy. This paper presents IsoScore: a novel method for measuring isotropy that corrects the current misunderstandings in the literature. IsoScore is the only tool that is mean agnostic, robust to scalar changes to the covariance matrix and rotation invariant. Furthermore, IsoScore scales linearly with the number dimensions used and is stable when distributions contain highly isotropic subspaces. Future studies should avoid using existing methods to measure isotropy as resulting conclusions will be misleading or altogether inaccurate. + +There are several promising directions for future work. Current studies have used inaccurate methods to claim that increasing isotropy improves the performance of contextualized embedding models. However, we believe that further decreasing isotropy could improve performance, especially in language modeling applications. IsoScore could be used as a regularizer when fine tuning word embeddings to penalize distributions that exhibit isotropy. + +As point clouds of data arise in nearly all deep learning applications, IsoScore presents itself as a useful tool to study and refine a variety of models beyond the domain of NLP. + +# Acknowledgements + +This research is supported in part by the NSF (IIS-1956221). The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of NSF, or the U.S. Government. + +# References + +Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. 2015. Random walks on context spaces: Towards an explanation of the mysteries of semantic word embeddings. CoRR, abs/1502.03520. +Daniel Bis, Maksim Podkorytov, and Xiuwen Liu. 2021. Too much in common: Shifting of embeddings in transformer language models and its implications. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5117-5130, Online. Association for Computational Linguistics. +Xingyu Cai, Jiaji Huang, Yuchen Bian, and Kenneth Church. 2021. Isotropy in the contextual embedding space: Clusters and manifolds. In International Conference on Learning Representations. +Paola Campadelli, Elena Casiraghi, Claudio Ceruti, and Alessandro Rozza. 2015. Intrinsic dimension estimation: Relevant techniques and a benchmark framework. Mathematical Problems in Engineering, 2015:1-21. +Andy Coenen, Emily Reif, Ann Yuan, Been Kim, Adam Pearce, F. Viégas, and M. Wattenberg. 2019a. Visualizing and measuring the geometry of bert. In NeurIPS. +Andy Coenen, Emily Reif, Ann Yuan, Been Kim, Adam Pearce, Fernanda Viégas, and Martin Wattenberg. 2019b. Visualizing and measuring the geometry of bert. +Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805. +Kawin Ethayarajh. 2019. How contextual are contextualized word representations? comparing the geometry of bert, elmo, and GPT-2 embeddings. CoRR, abs/1909.00512. +Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and TieYan Liu. 2019. Representation degeneration problem in training natural language generation models. +Chengyue Gong, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. 2018. Frage: Frequency-agnostic word representation. ArXiv, abs/1809.06858. +S. Hasan and E. Curry. 2017. Word re-embedding via manifold dimensionality retention. In EMNLP. +John Hewitt and Christopher D. Manning. 2019. A structural probe for finding syntax in word representations. In NAACL-HLT. +Elizaveta Levina and Peter J. Bickel. 2004. Maximum likelihood estimation of intrinsic dimension. In Proceedings of the 17th International Conference on Neural Information Processing Systems, NIPS'04, page 777-784, Cambridge, MA, USA. MIT Press. + +Yuxin Liang, Rui Cao, Jie Zheng, Jie Ren, and Ling Gao. 2021. Learning to remove: Towards isotropic pre-trained BERT embedding. CoRR, abs/2104.05274. +Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2016. Pointer sentinel mixture models. +Timothee Mickus, Denis Paperno, Mathieu Constant, and Kees van Deemter. 2019. What do you mean, bert? assessing BERT as a distributional semantics model. CoRR, abs/1911.05758. +Jiaqi Mu, Suma Bhat, and Pramod Viswanath. 2017. All-but-the-top: Simple and effective postprocessing for word representations. CoRR, abs/1702.01417. +Alec Radford and Karthik Narasimhan. 2018. Improving language understanding by generative pretraining. +Alec Radford, Jeff Wu, R. Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. +Victor Sanh, Lysandre Debut, Julien Chaumont, and Thomas Wolf. 2019. Distilbert, a distilled version of BERT: smaller, faster, cheaper and lighter. CoRR, abs/1910.01108. +Dilin Wang, Chengyue Gong, and Qiang Liu. 2019. Improving neural language modeling via adversarial training. ArXiv, abs/1906.03805. +Chu Yonghe, Hongfei Lin, Liang Yang, Yufeng Diao, Zhang Shaowu, and Fan Xiaochao. 2019. Refining word representations by manifold learning. pages 5394-5400. +Tianyuan Zhou, João Sedoc, and J. Rodu. 2019. Getting in shape: Word embedding subspaces. In *IJ-CAI*. +Wenxuan Zhou, Bill Yuchen Lin, and Xiang Ren. 2021. Isobn: Fine-tuning bert with isotropic batch normalization. In AAAI. + +# A Interpretation: IsoScore as a Summary Statistic + +We will now provide an intuitive interpretation for the IsoScore of a point cloud $X \subseteq \mathbb{R}^n$ . The interested reader should consult Appendix D for an in-depth explanation of this heuristic. + +Heuristic A.1. The IsoScore of $X$ is roughly the fraction of dimensions uniformly utilized by $X$ . + +For example, an IsoScore near 0.5 indicates that around half of the dimensions are utilized; and more generally, an IsoScore near $\alpha \in [0,1]$ indicates that approximately $n\cdot \alpha$ of the dimensions of $\mathbb{R}^n$ are uniformly utilized by $X$ . Table 2 illustrates this trend where IsoScore increases linearly as more dimensions are uniformly utilized in $\mathbb{R}^9$ . + +# B Pre-existing metrics, in detail + +Average Cosine Similarity: We define the Average Cosine Similarity Score as 1 minus the average cosine similarity of $N$ randomly sampled pairs of points from $X$ . That is, + +$$ +\operatorname {A v g C o s S i m} (X) := 1 - \left| \sum_ {i = 1} ^ {N} \frac {\cos \left(x _ {i} , y _ {i}\right)}{N} \right|, \tag {B.1} +$$ + +where $\{(x_1, y_1), \ldots, (x_N, y_N)\} \subseteq X \times X$ are randomly chosen with $x_i \neq y_i$ for all $i$ , and $\cos(x_i, y_i)$ denotes the cosine similarity of $x_i$ and $y_i$ . Some authors define the average cosine similarity score to be exactly the average, rather than one minus the average. However, for ease of comparison to other metrics, our score ensures that $\operatorname{AvgCosSim}(X)$ is between 0 and 1. Under our convention, it is commonly believed that a score of 0 indicates that the point cloud $X$ is anisotropic and a score of 1 indicates that $X$ is isotropic. In Section 5, we demonstrate that this is not the case. + +Partition Isotropy Score: For any unit vector $c \in \mathbb{R}^n$ , let the partition function be denoted as $Z(c) := \sum_{x \in X} \exp(c^{\mathrm{T}} x)$ . Mu et al. (2017) measure isotropy as $I(X) := (\min_{||c||=1} Z(c)) / (\max_{||c||=1} Z(c))$ . It is believed that a score closer to zero indicates an anisotropic space while a score closer to one indicates an isotropic space. Mu et al. (2017) demonstrate that a score of 1 implies that the eigenspectrum of $X$ is flat. Computing $I(X)$ explicitly is intractable since the set of unit vectors is infinite. Accordingly, Mu et al. (2017) approximate $I(X)$ by + +$$ +I (X) \approx \frac {\operatorname* {m i n} _ {c \in C} Z (c)}{\operatorname* {m a x} _ {c \in C} Z (c)} \tag {B.2} +$$ + +where $C$ is the set of eigenvectors of $X^{\mathrm{T}}X$ . For the remainder of the paper we refer to (B.2) as the Partition Score. + +Intrinsic Dimensionality: Given a point cloud $X \subseteq \mathbb{R}^n$ , it is sometimes useful to assume that $X$ is sampled from a manifold of dimension less than $n$ . For example, points in the left panel in Figure 1 are sampled from a 1-dimensional space and points in the middle panel are sampled from a 2-dimensional space. Algorithms for intrinsic dimensionality aim to estimate the true dimension of a given manifold from which we assume a point cloud has been sampled. Intrinsic dimensionality has been used to argue that word embedding models are anisotropic (Cai et al., 2021). For a point cloud $X \subset \mathbb{R}^n$ , it + +is commonly thought that the more isotropic $X$ is, the closer the intrinsic dimensionality of $X$ is to $n$ . Dividing the intrinsic dimensionality of $X$ by $n$ provides us with a normalized score of isotropy, which we refer to as the $ID$ Score. We use the maximum likelihood estimation (MLE) method to calculate intrinsic dimensionality. For a detailed description of the MLE method for intrinsic dimensionality estimation please consult (Levina and Bickel, 2004; Campadelli et al., 2015). + +Variance Explained Ratio: The variance explained ratio measures how much total variance is explained by the first $k$ principal components of the data. Note that when all principal components are considered, the variance explained ratio is equal to 1. Examining the eigenspectrum of principal components is undoubtedly a useful tool in quantifying the spatial distribution of high dimensional data. However, the variance explained ratio requires us to specify a priori the number of principal components we wish to examine. We divide the variance explained by the first $k$ principal components by $k / n$ to convert the variance explained ratio into a normalized score. + +# C Bounds on IsoScore + +Proposition C.1. Let $X \subseteq \mathbb{R}^n$ be a finite set. Then $\iota(X) \in [0,1]$ . + +Proof. Define $\Sigma$ to be the $n\times n$ sample covariance matrix of $X^{\mathrm{PCA}}$ . Let $c > 0$ be so that if we define $\hat{\Sigma} := c\cdot \Sigma$ , then $\| \hat{\Sigma}_D\| = \sqrt{n}$ . Let us enumerate the entries of this vector as $\hat{\Sigma}_D = (\operatorname {Var}(x_1),\ldots ,\operatorname {Var}(x_n))$ . In order to show that $\iota (X)\in [0,1]$ , it is equivalent to show that $\| \hat{\Sigma}_D - \mathbf{1}\| \in [0,\sqrt{2(n - \sqrt{n})} ]$ , and by definition of the Euclidian norm, the latter estimate is equivalent to + +$$ +2 (n - \sqrt {n}) \geq \sum_ {i = 1} ^ {n} (\operatorname {V a r} (x _ {i}) - 1) ^ {2}. \tag {C.1} +$$ + +But the identity $\| \hat{\Sigma}_D\| = \sqrt{n}$ implies that $\sum_{i = 1}^{n}\mathrm{Var}(x_i)^2 = n$ so in fact (C.1) is equivalent to + +$$ +\sum_ {i = 1} ^ {n} \operatorname {V a r} \left(x _ {i}\right) \geq \sqrt {n}. +$$ + +If this inequality were flipped, then we could esti + +mate that + +$$ +\begin{array}{l} n = \operatorname {V a r} \left(x _ {1}\right) ^ {2} + \dots + \operatorname {V a r} \left(x _ {n}\right) ^ {2} \\ \leq \left(\operatorname {V a r} \left(x _ {1}\right) + \dots + \operatorname {V a r} \left(x _ {n}\right)\right) ^ {2} \\ < n, \\ \end{array} +$$ + +which is a contradiction. + +![](images/1277760d0088bc40a80e4f445ba8f23409cc5c80858bc28e74fb93110489e0dd.jpg) + +# D Interpretation of IsoScore, in Detail + +This appendix provides rigorous mathematical justification for the claims that we made in Appendix A about the interpretation of IsoScore. It is split into two parts. In Appendix D.1 we formalize, and prove, the claim that the IsoScore for a point cloud $X$ is approximately the fraction of dimensions uniformly utilized by $X$ . And in Appendix D.2 we argue that IsoScore is an honest indicator of uniform spatial utilization. + +# D.1 IsoScore Reflects the Fraction of Dimensions Uniformly Utilized + +In Section A we provided an interpretation for the value of the IsoScore $\iota(X)$ in Heuristic A.1. Intuitively, our heuristic says that $\iota(X)$ is roughly the fraction of dimensions of $\mathbb{R}^n$ utilized by $X$ . We will now explain and justify this heuristic in detail. We formalize our heuristic below. + +Heuristic D.1. Suppose that a point cloud $X \subseteq \mathbb{R}^n$ gives an IsoScore $\iota(X)$ . Then $X$ occupies approximately + +$$ +k (X) := \iota (X) \cdot n + 1 - \iota (X) \tag {D.1} +$$ + +dimensions of $\mathbb{R}^n$ + +Note in particular that $\iota(X) = 0$ implies that (D.1) simplifies to a single dimension utilized and $\iota(X) = 1$ implies that (D.1) simplifies to all $n$ dimensions utilized. + +In the remainder of this subsection, we will justify the above heuristic. We will make reference to the notations and equations in Section 4. Fix $n \geq 1$ and $k \in \{1, \dots, n\}$ , and consider the matrix $I_n^{(k)}$ . Recall that $I_n^{(k)}$ is the covariance matrix for a $k$ -dimensional uncorrelated Gaussian distribution in $\mathbb{R}^n$ . For example, spaces sampled using the matrices $I_3^{(k)}$ , for $k = 1, 2, 3$ are rendered in Figure 1 as a line, a circle, and a ball, respectively. One can compute directly that the IsoScores for these three spaces are + +Our main insight in this section is that it is worthwhile to apply these statistics for reverse reasoning in the following sense: suppose you have some point cloud $X \subseteq \mathbb{R}^3$ which satisfies $\iota(X) \approx 1/2$ . Then this IsoScore should allow you to infer that $X$ uniformly occupies approximately 2 dimensions of $\mathbb{R}^3$ . + +In Heuristic D.1, we provide the closed formula (D.1) for generalizing the above reasoning to all dimensions $n$ . We will now prove this formula. + +Proof of Heuristic D.1. Once we normalize $I_{n}^{(k)}$ so that its Euclidean norm is $\sqrt{n}$ , we get that the first $k$ diagonal entries are $\sqrt{n / k}$ . Therefore, the isotropy defect is + +$$ +\begin{array}{l} \delta \left(I _ {n} ^ {(k)}\right) = \frac {\left\| \hat {I} _ {n} ^ {(k)} - \mathbf {1} \right\|}{\sqrt {2 (n - \sqrt {n})}} (D.2) \\ = \frac {\sqrt {k (1 - \sqrt {n / k}) ^ {2} + n - k}}{\sqrt {2 (n - \sqrt {n})}} \quad (D.3) \\ = \frac {\sqrt {n - \sqrt {n k}}}{\sqrt {n - \sqrt {n}}}. \\ \end{array} +$$ + +It is natural to consider the map $k\mapsto \delta (I_n^{(k)})$ A priori, this is a discrete function defined on $\{1,\dots ,n\}$ ; a fortiori, this is in fact a continuous, monotonically decreasing bijection on the connected interval $[1,n]$ . Therefore, the function defined by + +$$ +\tilde {\delta} _ {n}: [ 1, n ] \rightarrow [ 0, 1 ]: k \mapsto \delta \left(I _ {n} ^ {(k)}\right) +$$ + +is invertible, and one can compute that its inverse is + +$$ +\tilde {\delta} _ {n} ^ {- 1}: [ 0, 1 ] \to [ 1, n ]: d \mapsto \frac {(n - d ^ {2} (n - \sqrt {n})) ^ {2}}{n}. +$$ + +The truth of this heuristic rests upon the validity of the following assumption, which is reasonable to use in many contexts. + +Assumption Underpinning The Heuristic. The isotropy defect corresponding to a point cloud sampled using the covariance matrix $I_{n}^{(k)}$ is the prototypical isotropy defect for any point cloud in $\mathbb{R}^n$ which uniformly utilizes $k$ dimensions. + +We will now invoke this assumption. Let $\delta(X)$ be the isotropy defect for an arbitrary point cloud $X$ . If we assume that we are in the nontrivial case where $\delta(X) > 0$ , then $\tilde{\delta}_n^{-1}(\delta(X))$ is in the interval $[1, n)$ . Because $\tilde{\delta}_n^{-1}$ is bijective, there exists + +$$ +\iota (I _ {3} ^ {(1)}) \approx 0. 0, \qquad \iota (I _ {3} ^ {(2)}) \approx 0. 5, \qquad \iota (I _ {3} ^ {(3)}) \approx 1. 0. +$$ + +a unique $k\in \{1,\ldots ,n - 1\}$ with the property that $\tilde{\delta}_n^{-1}(\delta (X))\in [k,k + 1)$ . But by construction, $[k,k + 1) = [\tilde{\delta}_n^{-1}(\delta (I_n^{(k)})),\tilde{\delta}_n^{-1}(\delta (I_n^{(k + 1)}))]$ . By monotonicity of $\tilde{\delta}_n^{-1}$ , this implies that + +$$ +\delta (X) \in [ \delta (I _ {n} ^ {(k)}), \delta (I _ {n} ^ {(k + 1)})). +$$ + +Therefore, by the assumption underpinning the heuristic, we can deduce that $X$ is uniformly utilizing between $k$ and $k + 1$ dimensions of $\mathbb{R}^n$ . To be specific, we say that $X$ is uniformly utilizing $\tilde{\delta}_n^{-1}(\delta(X)) \in [k, k + 1)$ dimensions. Recalling Section 4, we can recognize that in Step 6, the formula for $k(X)$ , the quantity of dimensions uniformly utilized by $X$ , is precisely $k(X) := \tilde{\delta}_n^{-1}(\delta(X))$ ; likewise, the formula for $\phi(X)$ , the fraction of dimensions uniformly utilized by $X$ , is $\phi(X) := \tilde{\delta}_n^{-1}(\delta(X)) / n$ . + +Now we are in a position to verify Equation D.1, the main claim of Heuristic D.1. By the assumption underpinning the heuristic, it is sufficient to verify Equation D.1 in the case of $I_{n}^{(k)}$ , for $k = 1, \dots, n$ . This is because all functions that we will utilize are monotonic bijections. Using the notation in Steps 6 and 7 in Section 4, we can compute that + +$$ +\begin{array}{l} \iota \left(I _ {n} ^ {(k)}\right) (n - 1) + 1 = S \left(\phi_ {n} \left(I _ {n} ^ {(k)}\right)\right) (n - 1) + 1 \\ = n \cdot \phi_ {n} \left(I _ {n} ^ {(k)}\right) \\ = k \left(I _ {n} ^ {(k)}\right). \\ \end{array} +$$ + +Using the formula $k(X) = (n - \delta(X)^2(n - \sqrt{n}))^2 / n$ , we can continue: + +$$ +\begin{array}{l} k (I _ {n} ^ {(k)}) = \frac {(n - \delta (I _ {n} ^ {(k)}) ^ {2} (n - \sqrt {n})) ^ {2}}{n} \\ = \frac {\left(n - \frac {n - \sqrt {n k}}{n - \sqrt {n}} (n - \sqrt {n})\right) ^ {2}}{n} \\ = k, \\ \end{array} +$$ + +where in the penultimate equality we used Equation D.2. This completes the proof. + +Because IsoScore covers a continuous spectrum, one should carefully interpret what we mean when we say that $X$ occupies approximately $k$ dimensions of $\mathbb{R}^n$ . For example, consider the 2D Gaussian distributions depicted in Figure 3. Heuristic D.1 predicts $k = 1.9996, 1.6105, 1.0281$ dimensions are used when $x = 1, 3, 75$ , respectively. These should be interpreted as follows: "when $x = 75$ , the points sampled are mostly using one direction of space" and "when $x = 3$ , the points + +sampled are using somewhere between one and two dimensions of space." + +Heuristic D.1 suggests that an IsoScore near $1/2$ means that the corresponding point cloud $X$ occupies approximately half of the dimensions of its ambient space. We can make this reasoning rigorous as follows: for any $n \geq 2$ , one can compute that + +$$ +\iota \left(I _ {n} ^ {(k)}\right) = \frac {k - 1}{n - 1} \approx \frac {k}{n}, \quad \text {f o r a n y} k = 1, \dots , n. \tag {D.4} +$$ + +Proof of (D.4). In Equation D.2 computed that the isotropy defect is $\delta(I_n^{(k)}) = \sqrt{n - \sqrt{nk}} / \sqrt{n - \sqrt{n}}$ . If we substitute this expression into (4.1), then we obtain the formula $\iota(I_n^{(k)}) = \frac{k - 1}{n - 1}$ . Furthermore, one can easily estimate that $|\frac{k - 1}{n - 1} - \frac{k}{n}| \leq \frac{1}{n}$ . + +Table 2 illustrates this formula in the concrete case of $\mathbb{R}^9$ . This formula implies the following key relationship: + +$$ +\lim _ {n \rightarrow \infty} \iota (I _ {n} ^ {(\lfloor n / 2 \rfloor)}) = 1 / 2. +$$ + +Generalizing this line of reasoning yields our second heuristic explanation for the meaning of IsoScore, Heuristic 4.1. We copy it here: + +Heuristic D.2. When the ambient space $\mathbb{R}^n$ has large dimension, the IsoScore $\iota(X)$ is approximately the fraction of dimensions uniformly utilized by $X$ . + +Proof of Heuristic 4.1. By the assumption underpinning Heuristic D.1, it suffices to show this in the case of matrices of the form $I_{n}^{(k)}$ . Fix $\alpha \in [0,1]$ and consider the covariance matrix $I_{n}^{(\lfloor \alpha n\rfloor)}$ . For large $n$ , the fraction of dimensions uniformly utilized by $I_{n}^{(\lfloor \alpha n\rfloor)}$ is approximately $\alpha$ , according to Definition 3.1. But by (D.4), we can compute that + +$$ +\lim _ {n \to \infty} \iota (I _ {n} ^ {(\lfloor \alpha n \rfloor)}) = \lim _ {n \to \infty} \frac {\lfloor \alpha n \rfloor - 1}{n - 1} = \alpha . +$$ + +This completes the proof. + +![](images/ae51885dfe3a516d3e80008109c7ba16dbdaedd6d002cf9300e7dd139a0f90e9.jpg) + +# D.2 The IsoScore for $I_{n}^{(k)}$ Reflects Uniform Utilization of $k$ Dimensions + +We will now investigate what range of IsoScores are obtained by sample covariance matrices that utilize $k$ out of $n$ dimensions. It is easy to see + +that these scores at least fill the interval $(0,\iota (I_n^{(k)}))]$ since the map + +$$ +\begin{array}{l} [ 1, \infty) \rightarrow (0, \iota (I _ {n} ^ {(k)})) ] \\ x \mapsto \iota (\operatorname {d i a g} (x, 1, \dots , 1, 0, \dots , 0)) \\ \end{array} +$$ + +is surjective. Conversely, we can show that this interval is the only possible range of IsoScores corresponding to such covariance matrices. We make this claim rigorous in the following proposition. + +Proposition D.3. Fix $n \geq 2$ . For any $k = 1, \ldots, n$ , we have that + +$$ +\begin{array}{l} I _ {n} ^ {(k)} = \operatorname {a r g m a x} \left\{\iota (J): J \text {u t i l i z e s} k \text {o u t} \right. \tag {D.5} \\ \left. \text {o f} n \text {d i m e n s i o n s} \right\}. \\ \end{array} +$$ + +This result justifies the use of IsoScore for measuring the extent to which a point cloud optimally utilizes all dimensions of the ambient space because it demonstrates that $\iota(I_n^{(k)})$ is the maximal IsoScore for any covariance matrix with $k$ non-zero entries and $n - k$ zero entries. + +Proof of Proposition D.3. In this section we let $\mathrm{Diag}^{+}(n)$ denote the set of $n\times n$ real matrices which vanish away from the diagonal and whose diagonal entries are all non-negative. The set $\mathrm{Diag}^{+}(n)$ parameterizes the set of all $n\times n$ sample covariance matrices after performing PCA-reorientation. We also let $\mathrm{Diag}^{+}(n,k)\subseteq$ $\mathrm{Diag}^{+}(n)$ denote that subset whose first $k$ diagonal entries are non zero and whose last $n - k$ diagonal entries are zero. The set $\mathrm{Diag}^{+}(n,k)$ parameterizes the set of sample covariance matrices post-PCA reorientation which utilize $k$ out of $n$ dimensions of space. Covariance matrices in $\mathrm{Diag}^{+}(n,k)$ represent point clouds with the property that $\operatorname {Var}(x_i) > 0$ for $i = 1,\dots ,k$ , and $\operatorname {Var}(x_i) = 0$ for $i = k + 1,\ldots ,n$ . + +It suffices to show that, for every $J \in \mathrm{Diag}^+(n,k)$ , we have that $\iota(J) \leq \iota(I_n^{(k)})$ , or equivalently, $\delta(J) \geq \delta(I_n^{(k)})$ . Write $\hat{I}_{n,D}^{(k)} = (\sqrt{n/k}, \ldots, \sqrt{n/k}, 0, \ldots, 0)$ and $J_D = (a_1, \ldots, a_k, 0, \ldots, 0)$ , where $a_1^2 + \cdots + a_k^2 = n$ . Then we must show that $\|J_D - \mathbf{1}\| \geq \|I_{n,D}^{(k)} - \mathbf{1}\|$ , or equivalently, + +$$ +\sum_ {i = 1} ^ {k} (a _ {i} - 1) ^ {2} + n - k \geq \sum_ {i = 1} ^ {k} (\sqrt {n / k} - 1) ^ {2} + n - k. +$$ + +This latter estimate is equivalent to + +$$ +\sum_ {i = 1} ^ {k} a _ {i} \leq \sqrt {n k}. +$$ + +By Jensen's inequality, applied with the convex function $f(x) = x^{2}$ , we have that + +$$ +f \left(\sum_ {i = 1} ^ {k} \frac {a _ {i}}{k}\right) \leq \sum_ {i = 1} ^ {k} \frac {f (a _ {i})}{k}. +$$ + +Simplifying, this implies that $(a_{1} + \dots +a_{k})^{2}\leq kn$ This completes the proof. + +# E Numerical Experiments + +In this section, we provide explicit details of how each test is designed. We provide code for all experiments at: https://github.com/bcbi-edu/p_eickhoff_isoscore. + +1. Test 1: Mean Invariance. To assess whether the five scores are mean invariant, we start with 100,000 points sampled from a 10-dimensional multivariate Gaussian distribution with covariance matrix equal to the identity and a common mean vector $M = [\mu, \mu, \dots, \mu]$ . We compute scores for $\mu = 0, 1, 2, \dots, 20$ . +2. Test 2: Scalar Invariance. We test for the property of scalar invariance by sampling 100,000 points from a 5D Gaussian distribution with common mean vector $M = [3,3,3,3,3]$ and covariance matrix equal to $\lambda \cdot I_5$ . We then compute scores for each point cloud as we increase $\lambda$ from 1 to 25. +3. Test 3: Maximum Variance. We start by sampling 100,000 points from a 10D multivariate Gaussian distribution with zero common mean vector and a diagonal covariance matrix with nine entries equal to 1 and one diagonal entry equal to $x$ . In our experimental setup, we compute all five scores as we increase $x$ from 1 to 75. +4. Test 4: Rotation Invariance. Our baseline point cloud $X \subset \mathbb{R}^n$ consists of 100,000 points sampled from a 2D zero-mean Gaussian distribution with a covariance matrix equal to $\left( \begin{array}{ll}1 & 0.8\\ 0.8 & 1 \end{array} \right)$ . We rotate $X$ by $120^{\circ}$ and $240^{\circ}$ . Lastly, we project $X$ using PCA reorientation while retaining dimensionality to obtain a point cloud $X^{\mathrm{PCA}}$ . +5. Test 5: Dimensions Used (Fraction of Dimensions Used Test). For our first experiment, which we term the "fraction of dimensions used test," we sample 100,000 points + +from a 25D multivariate Gaussian distribution with a zero common mean vector and a diagonal covariance matrix where the first $k$ entries are 1 and the remaining $n - k$ diagonal elements are 0. We refer to $k$ as the number of dimensions uniformly used by our data (see Definition 3.1). For our experiment we let $k = 1,2,3,\ldots,25$ , and compute the corresponding scores. + +6. Test 5: Dimensions Used (High Dimensional Test). A good score of spatial utilization should allow for easy comparison between different vector spaces even when the dimensionality of the two spaces is different. We sample 100,000 points from a zero-mean Gaussian distribution with identity covariance matrix $I_{n}$ and increase the dimension of the distribution from $n = 2,\ldots ,100$ +7. Test 6: Global Stability. We generate a "skewered meatball" by sampling 1,000 points from a line in 3D space and increase the number of points sampled from a 3-Dimensional, zero-mean, isotropic Gaussian from 0 to 150,000. + +# F Geometry of Isotropy + +![](images/6190e585fffecae36c904d119487713e00b4e26b7fc956a12a5e2d1acdf07214.jpg) +Figure 10: Points sampled from a Uniform distribution, Poisson distribution, Student-T distribution and ChiSquare distribution respectively + +Each of the distributions illustrated in Figure 10 has a covariance matrix proportional to the identity and is therefore maximally isotropic. Namely, the variance is distributed equally in all directions. Despite receiving an IsoScore of 1, the geometry of the point clouds are vastly different. We can only + +comment on the geometry of the point cloud if the underlying distribution of the space is known. \ No newline at end of file diff --git a/isoscoremeasuringtheuniformityofembeddingspaceutilization/images.zip b/isoscoremeasuringtheuniformityofembeddingspaceutilization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..333b73676ee4c9a2969b66c0c095c087f6e69088 --- /dev/null +++ b/isoscoremeasuringtheuniformityofembeddingspaceutilization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:effe75ef14563543a42ea689da301004d118202cf7ea19a18720f094e42b54a2 +size 421103 diff --git a/isoscoremeasuringtheuniformityofembeddingspaceutilization/layout.json b/isoscoremeasuringtheuniformityofembeddingspaceutilization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..4d3bd376d9fb71c0eccf394e107f6ce7cac66522 --- /dev/null +++ b/isoscoremeasuringtheuniformityofembeddingspaceutilization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f823eeedb727da3f26b7baf12567883142b57b66f50f832b458265bc211dbfa5 +size 736477 diff --git a/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_content_list.json b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..5324440b9584d7799d3de55bd785073c5aa94330 --- /dev/null +++ b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e791c166881e3325905cb7033d01c3d2f4c1dfe93c5b436d2606df9a4a59af5e +size 89359 diff --git a/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_model.json b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..858ed26d1f7660b1ef384b116a2d6ee402bdbee7 --- /dev/null +++ b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21788c910ac95aff3e1a8226f7d5704f02f6010e9ff1d81495d651ea26895e04 +size 107078 diff --git a/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_origin.pdf b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8bbe5aa42df2bb409a91810b972eff2853d2b3d0 --- /dev/null +++ b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/23f7934d-9d21-445b-bb09-ec5fcb4aa1aa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48d1549a3c18657dc2442bc596750fdc43c8f2be3cb0df5d4f4aba6242ae0a45 +size 731292 diff --git a/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/full.md b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c0cc5cc182b4d98cc99f1ef8c7c1e61ef252a0e5 --- /dev/null +++ b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/full.md @@ -0,0 +1,354 @@ +# KSAM: Infusing Multi-Source Knowledge into Dialogue Generation via Knowledge Source Aware Multi-Head Decoding + +Sixing $\mathbf{W u}^{1}$ , Ying $\mathbf{L i}^{2,3^{*}}$ , Dawei Zhang $^{1}$ , Zhonghai $\mathbf{W u}^{2,3}$ + +$^{1}$ School of Computer Science, Peking University, Beijing, China + +$^{2}$ National Research Center of Software Engineering, Peking University, Beijing, China + +3Key Lab of High Confidence Software Technologies (MOE), Peking University, Beijing, China + +# Abstract + +Knowledge-enhanced methods have bridged the gap between human beings and machines in generating dialogue responses. However, most previous works solely seek knowledge from a single source, and thus they often fail to obtain available knowledge because of the insufficient coverage of a single knowledge source. To this end, infusing knowledge from multiple sources becomes a trend. This paper proposes a novel approach Knowledge Source Aware Multi-Head Decoding, KSAM, to infuse multi-source knowledge into dialogue generation more efficiently. Rather than following the traditional single decoder paradigm, KSAM uses multiple independent source-aware decoder heads to alleviate three challenging problems in infusing multi-source knowledge, namely, the diversity among different knowledge sources, the indefinite knowledge alignment issue, and the insufficient flexibility/scalability in knowledge usage. Experiments on a Chinese multi-source knowledge-aligned dataset demonstrate the superior performance of KSAM against various competitive approaches. + +# 1 Introduction + +Conversational AIs play an indispensable role in the human-computer interaction (Chen et al., 2017). Humans can use their learned knowledge to understand the context, reason the intrinsic semantic, and generate informative responses. However, traditional dialogue generation methods can only use dialogue history that carries limited knowledge to generate responses (Sutskever et al., 2014), bringing meaningless responses and frustrating user experience (Li et al., 2016; Ghazvininejad et al., 2018). To bridge such a gap, incorporating external knowledge into the dialogue generation is a feasible way (Zhou et al., 2018). + +![](images/642b7a5afb5a967788c36afc292219135a3c48bf5d82b618fcf9233af1c1664e.jpg) +Figure 1: Examples. Diversity: the above three knowledge sources have different structures; Indefinite Alignment: each case uses different knowledge sources. Scalability: case #3 may require a new knowledge source. + +Compared to the traditional non-knowledge-enhanced methods, the advantages of knowledge-enhanced methods come from the adopted external knowledge source (Wu et al., 2022). If a knowledge-enhanced model fails to seek available knowledge from the given knowledge source, it can only degenerate into a traditional manner. However, most previous works (Zhang et al., 2020a; Yu et al., 2020) only seek knowledge from a single source. The knowledge coverage1 of a single knowledge source is always insufficient (Wu et al., 2021a); thus, dialogues often can not benefit from the given knowledge source. Meanwhile, a single knowledge source is also difficult to meet the various requirements in the real scenarios (Liu et al., 2019). Recently, researchers began to seek knowledge from multiple sources to alleviate such issues. GOKC generates dialogues conditioned on both the background knowledge and the goal knowledge (Bai et al., 2021); The recent MSKE leverages heterogeneous knowledge from multiple sources (Wu et al., 2021a). With more knowledge sources, they have successfully improved the performance of knowledge-enhanced dialogue generation. + +Nonetheless, as illustrated in Figure 1, many challenges in infusing multi-source knowledge into + +dialogue generation have not been well solved: 1) Knowledge Diversity: Notable differences inevitably appear among different types of knowledge sources, which can be attributed to the different structures (i.e., text knowledge (Dinan et al., 2019) vs. commonsense knowledge graph (Zhang et al., 2020a)), different domains (i.e., open-domain (Speer et al., 2017) vs. specific-domain (Liu et al., 2018a)), and many other factors (Yu et al., 2020). Previous works only considered the difference in the encoding stage by using different knowledge-specific encoders, but failed to handle the difference in the decoding stage; 2) Indefinite Alignment: Due to the limitation of knowledge coverage, a single dialogue usually can not fully use all $n$ provided knowledge sources. Depending on the situation, each case may use an arbitrary number $\in [0, n]$ of sources, bringing more complexities; 3) Insufficient Flexibility and Scalability: A model itself should not be limited to a knowledge combination of specific types and a specific amount. + +This paper proposes a KSAM (Knowledge Source Aware Multi-Head Decoding) approach for multi-source knowledge-enhanced dialogue generation, which explicitly considers the three challenges mentioned above. Besides the dialogue history, KSAM uses three different knowledge sources, i.e., plain text knowledge, commonsense fact knowledge, and table attribute knowledge, to generate the target response. We propose four Source-Specific Encoders to encode such four input sources2. In the decoding stage, unlike previous works that only adopt a single-head decoder, we assign an independent Source-Aware Decoder Head for each input source. Each decoder head is a source-aware and fully functional decoder network, generating a source-aware response independently. Thus, we can handle the differences among multiple sources by tuning the source-specific encoder or the source-aware decoder head without impacting other encoders/heads. Subsequently, we propose a Source Fusion Network (SFN) to make the final prediction by collecting and fusing the outputs from decoder heads. With source-aware decoder heads and the fusion gates outputted by SFN, KSAM can alleviate the issue of indefinite knowledge-alignment. Meanwhile, SFN does not limit the number of decoder heads or the type of a decoder head; thus, KSAM theoretically supports the use of any combination of knowledge sources. + +We evaluate KSAM and baseline models on a previously released Chinese dataset (Wu et al., 2021a), which is aligned to three knowledge sources, i.e., a plain text knowledge base, a commonsense knowledge base, and a table knowledge base. Both the automatic and human evaluation results demonstrate the superior performance of KSAM against various competitive baselines. We also conduct extensive experiments to analyze KSAM further. + +# 2 Approach + +# 2.1 Problem Statement and Overview + +The goal is to generate a response $Y$ conditioned the dialogue history $X$ and a set of knowledge $\{K_i\}$ . Each $X = (x_1, \dots, x_{l_X}) / Y = (y_1, \dots, y_{l_Y})$ is a word sequence; each knowledge $K_i = (k_{i,1}, \dots, k_{i,l_{K_i}})$ is a set/list of entries that are retrieved from the $i$ -th knowledge source. + +As illustrated in Figure 2, this paper proposes a novel Knowledge Source Aware Multi-Head Decoding approach (KSAM), which consists of three parts: 1) Source-Specific Encoders: We propose a history encoder $Enc_{X}$ and several knowledge encoders $\{Enc_{K_i}\}$ to encode the $X$ and $\{K_i\}$ into $\mathbf{H}_{\mathbf{X}}$ and $\{\mathbf{K_i}\}$ ; 2) Source-Aware Decoder Heads: For alleviating the interference among sources and improving the scalability, each $X$ or $K_{i}$ has an independent and fully functional decoder head $Dec_{H / K_i}$ ; 3) Source Fusion Network: It stepwisely collects the predicted outputs from decoder heads and makes the final prediction. + +# 2.2 Source-Specific Encoders + +# 2.2.1 Dialogue History Encoder + +Dialogue history encoder $Enc_{X}$ aims at encoding the dialogue history $X$ into hidden states; thus, a bidirectional GRU $(g)$ (Cho et al., 2014) is adopted. At each time step $t$ , the forward/backward GRU reads $x_{t}$ and the last state $\mathbf{h}_{\mathbf{t}-\mathbf{1}}^{\mathbf{f}} / \mathbf{h}_{\mathbf{t}+\mathbf{1}}^{\mathbf{b}}$ : + +$$ +\mathbf {h} _ {\mathbf {t}} = \left[ \mathbf {h} _ {\mathbf {t}} ^ {\mathbf {f}}; \mathbf {h} _ {\mathbf {t}} ^ {\mathbf {b}} \right] = \left[ \vec {g} \left(\mathbf {x} _ {\mathbf {t}}, \mathbf {h} _ {\mathbf {t} - \mathbf {1}} ^ {\mathbf {f}}\right); \vec {g} \left(\mathbf {x} _ {\mathbf {t}}, \mathbf {h} _ {\mathbf {t} + \mathbf {1}} ^ {\mathbf {b}}\right) \right] \tag {1} +$$ + +where $\mathbf{x}$ is the word embedding of $x$ , $[\cdot; \cdot]$ is the concatenation. The result is $\mathbf{H} = (\mathbf{h}_1, \dots, \mathbf{h}_{\mathbf{l}_{\mathbf{X}}})$ . + +# 2.2.2 Knowledge Encoders + +This paper studies three knowledge sources: plain text knowledge $K_{P}$ , commonsense fact knowledge $K_{C}$ , and table key-value attribute knowledge $K_{T}$ . + +![](images/8c3a798656ab839009e7009e249b134ac071e0636a48bdf8cccde3038cc1898e.jpg) +Figure 2: The architecture of KSAM. In this paper, the implementation considers three knowledge sources, i.e., text knowledge, commonsense knowledge, and table knowledge; thus, there are four source-specific encoders and four source-aware decoder heads. Each source-specific encoder or source-aware decoder has its own unique internal independent network. At each time step, the Source Fusion States first gathers the predictions of all decoder heads, then makes a fused final prediction. + +Plain Text: Each text $K_P$ is a word sequence $(k_{P,1},\dots ,k_{P,l_P})$ ; therefore, we embed $K_P$ to $\mathbf{K}_{\mathbf{P}}^{\mathrm{e}} = (\mathbf{k}_{\mathbf{P},1}^{\mathrm{e}},\dots ,\mathbf{k}_{\mathbf{P},l_{\mathbf{P}}}^{\mathrm{e}})$ using word embedding. + +Commonsense Facts: Each $K_{C}$ is a set of facts $\{k_{C,i}\}$ , where each $k_{C,i}$ has a head entity $e_{C,i,h}$ , a relation $e_{C,i,r}$ , and a tail entity $e_{C,i,t}$ . Thus, $k_{C,i}$ can be embedded as $\mathbf{k}_{\mathbf{C},\mathbf{i}}^{\mathbf{e}} = [\mathbf{e}_{\mathbf{C},\mathbf{i},\mathbf{h}};\mathbf{e}_{\mathbf{C},\mathbf{i},\mathbf{r}};\mathbf{e}_{\mathbf{C},\mathbf{i},\mathbf{t}}]$ using embedding pretrained by TransE (Bordes et al., 2013) or other learning approaches. Finally, $K_{C}$ is embedded to a set of embedding, i.e., $\mathbf{K}_{\mathbf{C}}^{\mathbf{e}} = \{\mathbf{k}_{\mathbf{C},\mathbf{i}}^{\mathbf{e}}\}$ + +Table Attributes: Each table $K_{T}$ is a set of key-value attribute pairs $\{k_{T,i} = (a_{i}^{k},a_{i}^{v})\}$ , where the key $a_{i}^{k}$ is a word and the value $a_{i}^{v} = (a_{i,1}^{w},\dots ,a_{i,j}^{w}\dots)$ is a text sequence. Such a structure is inconvenient for the encoding. Thus, following (Wu et al., 2021a), $K_{T}$ is first decomposed into to a set of key-word pairs $\{k_{T,i,j}^{kw}\}$ , and each key-word pair is embedded as: + +$$ +\mathbf {k} _ {\mathrm {T}, \mathrm {i}, \mathrm {j}} ^ {\mathrm {k w}} = \left[ \mathbf {a} _ {\mathrm {i}} ^ {\mathrm {k}}; \mathbf {a} _ {\mathrm {i}, \mathrm {j}} ^ {\mathrm {w}}; \mathbf {p o s} _ {\mathrm {i}, \mathrm {j}} \right] \tag {2} +$$ + +where $a_{i}^{k}$ is the word embedding of the $i$ -th key, $\mathbf{a}_{\mathbf{i},\mathbf{j}}^{\mathbf{w}}$ is the word embedding of the $j$ -th word of the $i$ -th value, $\mathbf{pos}_{\mathbf{i},\mathbf{j}}$ is the positional embedding to indicate the structure information. Finally, $K_{T}$ is embed to a set of embedding, $\mathbf{K}_{\mathbf{T}}^{\mathrm{e}} = \{\mathbf{k}_{\mathbf{T},\mathbf{i},\mathbf{j}}^{\mathrm{kw}}\}$ . + +Encoders: Three knowledge encoders $Enc_{K_P}$ , $Enc_{K_C}$ , $Enc_{K_T}$ are implemented as three independent Transformer networks (Vaswani et al., 2017): + +$$ +\mathbf {K} _ {\mathbf {P}} = E n c _ {K _ {P}} (P O S (\mathbf {K} _ {\mathbf {P}} ^ {\mathbf {e}})) +$$ + +$$ +\mathbf {K} _ {\mathbf {C}} = E n c _ {K _ {C}} (\mathbf {K} _ {\mathbf {C}} ^ {\mathbf {e}}) \qquad (3) +$$ + +$$ +\mathbf {K} _ {\mathbf {T}} = E n c _ {K _ {T}} (\mathbf {K} _ {\mathbf {T}} ^ {\mathrm {e}}) +$$ + +where an output $\mathbf{K}_{*}$ can be viewed as a list or a set of vectors depending on the input $\mathbf{K}_{*}^{\mathrm{e}}$ . We use a set to pack $\mathbf{K}_{\mathbf{C}}^{\mathrm{e}} / \mathbf{K}_{\mathbf{T}}^{\mathrm{e}}$ because no strong sequential correlation appears; thus, their encoders do not use the positional layer $POS$ . While the plain text $\mathbf{K}_{\mathbf{P}}^{\mathrm{e}}$ is a sequence, unlike encoding the dialogue history $X$ , we use a Transformer with $POS$ because $\mathbf{K}_{\mathbf{P}}^{\mathrm{e}}$ has a significantly longer length. + +# 2.3 Multi-Head Decoding + +Previous knowledge-enhanced works (Wu et al., 2020; Bai et al., 2021) often use the single decoder paradigm. However, when using multiple sources, a single decoder always faces more challenges; namely, Knowledge Diversity, Indefinite Alignment, and Insufficient Flexibility and Scalability. + +Thus, we propose to use multiple source-aware decoder heads, allocating one independent and fully functional decoder head for using the dialogue history or each knowledge source. The results of such decoder heads are subsequently fused by Source Fusion Network. The advantages can be summarized as 1) Each decoder head is independent; we can easily tune each network based on the source-specific characteristics without impacting other heads; 2) Each head does not need to + +consider the complex combinations of knowledge usage. Each head only considers the usage of the corresponding input source. Thus, we can employ the more professional Source Fusion Network to alleviate the impact of indefinite alignment more efficiently; 3) Higher flexibility and scalability because Source Fusion Network does not limit the number and the knowledge-type of heads. + +# 2.3.1 Source-Aware Decoder Head + +Each decoder head $Dec_{*} \in \{Dec_{H}, Dec_{K_{P}}, Dec_{K_{C}}, Dec_{K_{T}}\}$ uses the corresponding source-specific dialogue/knowledge memory $\mathbf{M}_{*} \in \{\mathbf{H}, \mathbf{K}_{\mathbf{P}}, \mathbf{K}_{\mathbf{C}}, \mathbf{K}_{\mathbf{T}}\}$ to predict the target response with own networks/parameters $\theta_{*}$ : + +$$ +D e c _ {*} (\mathbf {M} _ {*}; \theta_ {*}), * \in \{H, K _ {P}, K _ {C}, K _ {T} \} \quad (4) +$$ + +State Updating: At time $t$ , each $Dec_*$ first updates its state $\mathbf{z}_*$ with a GRU network $(g_*)$ : + +$$ +\mathbf {z} _ {* \mathbf {t}} = g _ {*} \left(\mathbf {z} _ {* \mathbf {t} - 1}, \mathbf {y} _ {\mathbf {t} - 1}, \mathbf {a} _ {* \mathbf {t}}\right), \mathbf {z} _ {* 0} = \mathbf {h} _ {\mathbf {l} _ {\mathbf {X}}} \tag {5} +$$ + +where each initial state $\mathbf{z}_{*,0}$ is universally initialized by the last dialogue history state $\mathbf{h}_{\mathbf{l}_X}, \mathbf{y}_{t-1}$ is the embedding of the last generated token, $\mathbf{a}_{*,t}$ is the attentive readout of the corresponding $\mathbf{M}_*$ . + +Memory Selection: To obtain the attentive readout $\mathbf{a}_{*,\mathrm{t}}$ by selecting the memory $\mathbf{M}_*$ , we propose a Single-Side Attention for selecting the $X$ or $K_P$ (i.e., $\mathbf{M}_* = \mathbf{H} / \mathbf{K}_{\mathbf{P}}$ ), and a Dual-Side Attention for selecting the $K_{C / T}$ (i.e., $\mathbf{M}_* = \mathbf{K}_{\mathbf{C} / \mathbf{T}}$ ). + +1. Single-Side Attention: we use a distribution $\mathrm{align}_{*,\mathbf{t}}$ to measure the relevance between each memory slot $^4\mathbf{m}\in \mathbf{M}_*$ and the current context: + +$$ +\operatorname {a l i g n} _ {*, \mathbf {t}} \in \mathbb {R} ^ {1 \times l _ {M *}} = F ^ {S} \left(\left[ \mathbf {y} _ {\mathbf {t} - \mathbf {1}}; \mathbf {z} _ {*, \mathbf {t} - \mathbf {1}} \right] \mathbf {W} _ {*} ^ {\mathbf {A}} \mathbf {M} _ {*} ^ {\mathbf {T}}\right) \tag {6} +$$ + +where $F^S$ is softmax, $\mathbf{W}_{*}^{\mathbf{A}}$ is a parameter, $\mathrm{align}_{*,\mathbf{t}}$ is an align distribution, i.e., weights. Then, the attentive readout $\mathbf{a}_{*,\mathbf{t}} = \mathbf{align}_{*,\mathbf{t}}\mathbf{M}_{*}$ is the weighted sum of the memory $\mathbf{M}_{*} \in \mathbb{R}^{l_{M_{*}} \times dim}$ . + +2. Dual-Side Attention: The commonsense knowledge $K_{C}$ and the table knowledge $K_{T}$ have two value sides (head/tail entities, attribute key/words). Considering this, similar to the multi-head attention, the corresponding attentive readout adopts two different side-aware align distributions: + +$$ +\mathbf {a} _ {\mathbf {K} _ {\mathrm {C}}, \mathrm {t}} = \left[ \operatorname {a l i g n} _ {\mathbf {K} _ {\mathrm {C}}, \mathrm {t}} ^ {\text {h e a d}} \mathbf {K} _ {\mathrm {C}}; \operatorname {a l i g n} _ {\mathbf {K} _ {\mathrm {C}}, \mathrm {t}} ^ {\text {t a i l}} \mathbf {K} _ {\mathrm {C}} \right] \tag {7} +$$ + +$$ +\mathbf {a} _ {\mathbf {K} _ {\mathrm {T}}, \mathrm {t}} = [ \mathrm {a l i g n} _ {\mathbf {K} _ {\mathrm {T}}, \mathrm {t}} ^ {\mathrm {k e y}} \mathbf {K} _ {\mathrm {P}}; \mathrm {a l i g n} _ {\mathbf {K} _ {\mathrm {T}}, \mathrm {t}} ^ {\mathrm {v a l u e}} \mathbf {K} _ {\mathrm {P}} ] +$$ + +The computations of aligns in Equation 7 still follow the same way in Equation 6. In each head, two aligns use the same network but the different parameters; the differences and the uniqueness of two aligns come from the following copy mechanism. + +Token Perdition: Each source-aware decoder head in KSAM can generate a complete probability distribution to predict the next token. + +First, a decoder head can generate a token by selecting a word from the fixed vocabulary $V$ using the distribution $\mathbf{P}_{*,\mathbf{t}}^{\mathbf{V}}(\mathbf{w})$ , which is given by: + +$$ +F ^ {S} \left(\tanh \left(\left[ \mathbf {z} _ {*}, \mathbf {t}; \mathbf {y} _ {\mathbf {t} - \mathbf {1}}; \mathbf {a} _ {*}, \mathbf {t} \right] \mathbf {W} _ {*} ^ {\mathbf {V} \mathbf {1}}\right) \mathbf {W} _ {*} ^ {\mathbf {V} \mathbf {2}}\right) \tag {8} +$$ + +Next, to address the OOV issue and improve the informativeness, a decoder head can also copy a word from the corresponding source by using the previous attentive distribution $\mathbf{align}_{*}$ . In $Dec_{H}$ and $Dec_{K_P}$ , $\mathbf{align}_{\mathbf{H} / \mathbf{K}_{\mathbf{P}},\mathbf{t}}(w)$ points out the probability to copy the word $w$ from $X / K_{P}$ . In $Dec_{K_C}$ , $\mathbf{align}_{\mathbf{K}_{\mathbf{C}},\mathbf{t}}^{\mathrm{head / tail}}(w)$ points to the head/tail entity of the corresponding commonsense fact $w$ . In $Dec_{K_T}$ , $\mathbf{align}_{\mathbf{KT},\mathbf{t}}^{\mathrm{head / tail}}(w)$ points to the attribute key/word of the corresponding attribute key-word pair $w$ . + +Finally, we use the following fusion gate $\mathbf{f}_{*}$ to fuse all generation modes for each head: + +$$ +\mathbf {f} _ {*} \in \mathbb {R} ^ {1 \times 2 / 3} = F ^ {S} \left(\left[ \mathbf {z} _ {*}, \mathbf {t}; \mathbf {y} _ {\mathbf {t} - \mathbf {1}}; \mathbf {a} _ {*}, \mathbf {t} \right] \mathbf {W} _ {*} ^ {\mathbf {M}}\right) \tag {9} +$$ + +then, the aggregated probability is given by: + +$$ +\mathbf {P} _ {*, \mathbf {t}} (\mathbf {w}) = \sum_ {i} \mathbf {f} _ {*} [ i ] \operatorname {a l i g n} _ {*, \mathbf {t}} ^ {\mathbf {i}} (w) + \mathbf {f} _ {*} [ - 1 ] \mathbf {P} _ {*, \mathbf {t}} ^ {\mathbf {V}} (w) \tag {10} +$$ + +# 2.3.2 Source Fusion Network + +Each head takes the responsibility for a single-source-aware prediction. For generating multi-source knowledge-enhanced responses, we propose a Source Fusion Network, which uses two gates, $\mathbf{f^h}$ and $\mathbf{f_t^s}$ , to fuse the probability distributions outputted by decoder heads: + +$$ +\mathbf {P} _ {\mathbf {t}} (\mathbf {w}) = \sum_ {\mathbf {P} _ {\mathbf {i}, \mathbf {t}}} \mathbf {f} ^ {\mathbf {h}} [ \mathbf {i} ] \mathbf {f} _ {\mathbf {t}} ^ {\mathbf {s}} [ \mathbf {i} ] \mathbf {P} _ {\mathbf {i}, \mathbf {t}} (\mathbf {w}) \tag {11} +$$ + +$$ +\mathbf {P _ {i , t}} \in \{\mathbf {P _ {H , t}}, \mathbf {P _ {K _ {P} , t}}, \mathbf {P _ {K _ {C} , t}}, \mathbf {P _ {K _ {T} , t}} \} +$$ + +where the decoder head gates $\mathbf{f}^{\mathbf{h}}\in \mathbb{R}^{1\times 4}$ are: + +$$ +F ^ {S} \left(\tanh \left(\left[\left\{\mathbf {a} _ {*}, \mathbf {1} \right\}\right] \mathbf {W} ^ {\mathbf {H} 1}\right) \mathbf {W} ^ {\mathbf {H} 2}\right)\left. \right) \tag {12} +$$ + +and the step-wise gates $\mathbf{f}_{\mathbf{t}}^{\mathbf{s}} \in \mathbb{R}^{1 \times 4}$ are given by: + +$$ +F ^ {S} \left(\tanh \left(\left[ \mathbf {y} _ {\mathbf {t} - \mathbf {1}}; \left\{\mathbf {z} _ {*}, \mathbf {t} \right\}; \left\{\mathbf {a} _ {*}, \mathbf {t} \right\} \right] \mathbf {W} ^ {\mathbf {S} 1}\right) \mathbf {W} ^ {\mathbf {S} 2})\right) \tag {13} +$$ + +Training: The objective function has two terms: + +$$ +\mathcal {L} = \mathcal {L} _ {f u s e d} + \sum_ {h e a d _ {i}} \mathcal {L} _ {h e a d _ {i}} \tag {14} +$$ + +The first adopts the aggregated $\mathbf{P}_{\mathbf{t}}(\mathbf{w})$ to compute the overall negative log-likelihood (NLL): + +$$ +\mathcal {L} _ {f u s e d} = - \sum_ {t} \log \mathbf {P} _ {\mathbf {t}} \left(y _ {t} \mid y _ {1: t - 1}, X, \{K \}\right) \tag {15} +$$ + +The next term sums the NLLs of all heads: + +$$ +\sum_ {\text {h e a d} _ {i}} \mathcal {L} _ {\text {h e a d} _ {i}} = - \sum_ {\text {h e a d} _ {i}} \sum_ {t} \log \mathbf {P} _ {\mathbf {i}, \mathbf {t}} \left(y _ {t} \mid y _ {1: t - 1}, X, M _ {i}\right) \tag {16} +$$ + +The first $\mathcal{L}_{fused}$ can optimize the whole model, and the second $\sum_{head_i} \mathcal{L}_{head_i}$ makes sure that each head can move towards a better direction. + +# 3 Experiment + +# 3.1 Settings + +Dataset: As reported in Table 1, we use a multisource knowledge-aligned conversational dataset released by Wu et al. (2021a), which collected dialogues from three weibo datasets (Shang et al., 2015; Ke et al., 2018; Cai et al., 2019), commonsense knowledge from ConceptNet (Speer et al., 2017), and plain text/table knowledge from the Wikipedia. The vocab size is 21,924. + +Baselines: Depending on the knowledge source: + +1. Traditional: The attentive Seq2Seq (Luong et al., 2015), and the improved Pointer-Generator Network (PGN) (See et al., 2017); a GPT-based model CDial-GPT (Wang et al., 2020b), which has been pre-trained on 1.3B words+6.8M dialogues. +2.Plain Text: RefNet uses a reference network to use the text-based knowledge (Meng et al., 2020). +3. Commonsense: The first work CCM (Zhou et al., 2018), and two prior STOAs ConpetFlow (Zhang et al., 2020a), ConKADI (Wu et al., 2020). +4.Table: SA-S2S (Liu et al., 2018b) and TransInfo (Bai et al., 2020) use table knowledge via a SA-LSTM/Transformer encoder, respectively. +5.Heterogeneous: GOKC is a recent knowledge-enhanced approach (Bai et al., 2021). It supports a variety of knowledge types. We disable the use of goal knowledge because we study the open-domain dialogue and no goal is provided in the + +dataset. MSKE (Wu et al., 2021a) is a multi-source knowledge-enhanced approach, which supports to use multiple sources at the same time. + +Implementations: For Seq2Seq and PGN, we use our re-implemented PyTorch codes; for ConKADI, GOKC, and MSKE, we use the official codes; for the remaining baselines, the experimental results are collected from MSKE (Wu et al., 2021a). Therefore, in our (re-)implementations, we keep the same hyper-parameter setting as MSKE if available. In short, all dialogue history encoders are a 512-dimensional bi-GRU, all Transformers of knowledge encoders are 2-layer 8-head and 512-dimensional, all decoders are a 512-dimensional GRU. We use a 200-dimensional pretrained Chinese embedding (Song et al., 2018) to initialize all word embedding matrix, a 100-dimensional pretrained TransE embedding (Bordes et al., 2013) to initial the embedding of commonsense knowledge entities/relations. We use Adam as the optimizer. The mini-batch size is 32; the learning rate is 0.0001. If the loss on the validation set starts to increase after an epoch, the learning rate will be halved. The training will be automatically stopped if the loss on the validation set increases in two successive epochs. Consequently, our model costs about two days on an Nvidia RTX 3090 GPU. In the inference stage, we apply the beam-search decoding strategy, where the beam width is 10. + +# 3.2 Automatic Metrics + +For measuring the relevance between the ground-truth response and the generated responses. We use the sentence-level embedding-based EmbedA/G/X (Average / Greedy / Extreme) (Liu et al., 2016; Bai et al., 2021), the character-level uni-gram CharF1, the word-level BLEU-1/2/3/4 (Papineni et al., 2002), and the word-level Rouge-L (Lin, 2004). Following Zhang et al. (2020a), we use the uni/bi-gram DISTINCT (DIST-1/2) to evaluate the word-level diversity, and the 4-gram Ent-4 to evaluate the word-level informativeness. + +# 3.3 Results + +# 3.3.1 Automatic Evaluation + +We report the results in Table 2. For $MSKE$ and our $KSAM$ , we evaluate their single-source ablated variants at the same time. For $KSAM$ , we additionally evaluate some ablated/modified variants. + +Single-Source Knowledge: Compared to traditional models, most single knowledge-enhanced + +
Dialogues#Training Set / #Dev Set/ #Test set70K/ 4K/ 4KKnowledge Coverage in Three Sets
Commonsense#Entities/ #Relations/ # Facts27K/ 26/ 696K48.8%/ 48.8%/ 48.8%
Text#Paragraphs1,663K24.7%/ 24.2%/ 24.4%
Table#Infobox Tables1,581K26.9%/ 26.9%/ 27.6%
Any of themAt least one type of knowledge can be matchedN/A79.6%/ 79.8%/ 79.8%
+ +Table 1: Dataset Statistics. The coverage reports the ratio of how many dialogues can be aligned to a source. + +
ModelKnow. UsagePPL ↓Embed-A/G/XCharF1ROUGE-LBLEU-1/2/3/4DIST-1/2Ent-4
Seq2SeqX100.480.8480.6890.63517.4913.3014.074.951.910.801.9310.14
PGNX95.540.8420.6840.63519.3714.0813.855.432.381.167.2428.07
CDialGPT*X + Pretrain-0.8360.6780.631-12.8815.035.962.861.565.0723.97
RefNet*X + Kp-0.8290.6820.622-11.9214.254.671.620.592.7514.53
GOKCPlainX + Kp94.530.8420.6980.64417.0713.8015.036.112.971.612.5416.75
MSKEPlainX + Kp89.810.8520.7000.64720.4515.1115.045.902.541.195.3821.25
KSAMPlainX + Kp84.480.8510.6890.64220.9415.2315.796.793.512.046.9533.69
CCM*X + Kc-0.8400.6970.635-13.0314.164.971.980.821.429.01
ConceptFlow*X + Kc-0.8450.6960.637-12.8214.955.102.000.841.569.89
ConKADIX + Kc-0.8490.6880.63318.3213.5515.905.752.441.113.3518.97
GOKCCSKX + Kc-0.8460.6890.64220.5815.0314.576.273.121.777.0431.94
MSKECSKX + Kc86.140.8500.6940.64720.7115.2314.736.253.091.736.5227.53
KSAMCSKX + Kc83.130.8490.6860.64320.9115.2015.496.753.522.057.5636.34
SA-S2S*X + Kt-0.8240.6900.636-12.8314.245.422.260.993.2212.70
TransInfo*X + Kt-0.8250.6890.638-13.1614.185.452.261.013.7815.34
GOKCTableX + Kt89.860.8430.6990.64717.5614.1315.386.162.921.552.5117.45
MSKETableX + Kt87.020.8500.6940.64720.7115.2314.736.253.091.736.5227.53
KSAMTableX + Kt83.850.8510.6890.64421.2515.3515.746.843.582.107.5135.97
MSKEX + Kp+C+T81.100.8540.7000.65321.7016.1415.736.823.401.926.0427.50
KSAMX + Kp+C+T77.650.8560.6970.64921.8616.0916.957.303.722.156.3130.20
-PV_K*X + Kp+C+T85.700.8490.6900.64421.7015.7216.237.033.612.087.8736.25
+LinkX + Kp+C+T83.070.8580.7020.65421.4716.0116.847.053.451.885.2321.77
+ +Table 2: Automatic results. The last section evaluates the ablated/modified KSAM variants. * is collected from Wu et al. (2021a), - is not available or comparable ( GOKC ${}_{CSK}$ outputs a abnormally large PPL ), $\downarrow$ indicates lower is better, and PPL refers to perplexity. We use different colors to indicate the best performance in each group; and we use colored to indicate the best score among models except the ablated/modified KSAM . + +models have notable improvements, indicating the external knowledge is quite helpful in the open-domain dialogue generation. The recent GOKC, MSKE, and our KSAM are not limited to a specific type of knowledge, and such three models are almost the best three in each group. It implies that they do not improve flexibility at the expense of performance. Meanwhile, our KSAM is undoubtedly better: 1) KSAM has more the best results in every group; 2) The results among the three knowledge sources are pretty stable and deliver similar trends; on the contrary, GOKC is not stable because it has quite different results with different knowledge. Consequently, we can say that every source-specific encoder and source-aware decoder in KSAM are well-designed and more efficient. + +Multi-Source Knowledge: Only $MSKE$ and $KSAM$ can use all three knowledge sources at the same time. Two models have the best and the most balanced performance among all models. Comparing them, $MSKE$ only achieves slight advantages in three metrics (Embed-G/X & ROUGE-L), but + +KSAM has more notable leaderships in the remaining metrics. In addition, the automatic evaluation can not fully reflect our advantages. Compared to MSKE, KSAM has better scalability and flexibility in using knowledge sources, due to the design of independent source-aware heads. + +The Partial Degradation of KSAM: The full KSAM brings notable improvements except in DIST-1/2 (diversity) and Ent-4 (informativeness). Such performance degradation does not surprise us: 1) Copying words besides the fixed vocabulary is a crucial way to improve diversity and informativeness. In KSAM, the probability distribution used to copy is already fused in each decoder head; therefore, Source Fusion Network can not explicitly perceive all copy distributions when fusing single-source distributions to make the final prediction. This may impact the enthusiasm/chance of copying words when appending more decoder heads; 2) The adopted beam-search decoding algorithm can only consider one distribution; thus, we have no chance to leverage such source-aware distribu + +tions. 3) DIST and Ent do not consider fluency and rationality, higher is not always better. For example, DIST/Ent will give high scores if we randomly generate some disordered sentences. We should comprehensively consider every dimension. We verified 1) and 3) in our model variant $-\mathbf{P}_{\mathbf{K}_*}^{\mathbf{V}}$ , where three knowledge source-aware heads only output the copy probability without being fused with the vocab probability $\mathbf{P}_{\mathbf{K}_*}^{\mathbf{V}}$ . It can be seen that $-\mathbf{P}_{\mathbf{K}_*}^{\mathbf{V}}$ increased diversity/informativeness, but decreased the relevance and fluency. We will continue to improve this in the future. + +The Coupling among Heads: In KSAM, each decoder head $Dec_*$ is an independent and fully functional network. The internal state of a head can not communicate with each other. Does KSAM need to strengthen the coupling between heads? To verify this, we design a model variant +Link. Similar to the (Kim et al., 2020; Zhao et al., 2020), we use a GRU to manage a global sequential state $\mathbf{s}_{\mathrm{t}}$ , which is updated with the memory readouts and the states of heads: $\mathbf{s}_{\mathrm{t}} = GRU(\mathbf{s}_{\mathrm{t-1}}, [\mathbf{y}_{\mathrm{t-1}}; \{\mathbf{z}_{*,\mathrm{t}}\}; \{\mathbf{a}_{*,\mathrm{t}}\}])$ . Then, we replace $\mathbf{y}_{\mathrm{t}}$ by $[\mathbf{s}_{\mathrm{t-1}}; \mathbf{y}_{\mathrm{t-1}}]$ when operating each head, where $\mathbf{s}_{\mathrm{t}}$ can be regarded as a link to strengthen the coupling. As reported in Table 2, the performance has decreased. It indicates that there may be interference among different sources, and our decoupled design is helpful to alleviate this issue. + +# 3.3.2 Human Evaluation: + +The comparison is pair-wise and we select 5 better baselines in the automatic evaluation. We employed 3 well-educated native speakers as volunteers to score 200 sampled cases (1,000 comparisons in total) from three criteria: 1) Fluency considers the fluency; 2) Rationality measures the relevance and rationality; 3) Informativeness measures the quality of the information offered in the generated response. Following (Wu et al., 2021a), we count the agreement among volunteers. The 2/3 agreements for three metrics are $98.7\%$ , $93.7\%$ , and $94.1\%$ ; the 3/3 agreements are $61.0\%$ , $52.7\%$ , $51.6\%$ . + +Table 3 reports the averaged human evaluation score. Notably, $KSAM$ significantly outperforms baselines in all dimensions, demonstrating the same advantage as in the automatic evaluation. In terms of fluency, the results are less distinguishable than the other two metrics (except $GOKC_{CSK}$ ), indicating most models can already generate fluent + +
(%)FluencyRationalityInformativeness
vs.-0+-0+-0+
Seq2Seq11.255.233.621.825.652.521.024.055.0
PGN7.757.834.52.026.054.020.320.759.0
GOKC5K3.020.077.05.79.385.09.810.879.4
ConKADI7.564.328.226.520.852.734.516.748.8
MSKE7.765.726.718.732.848.519.626.254.2
+ +responses in most cases. In terms of rationality and informativeness, the results are more distinguishable and can reflect the advantage of using external knowledge. $GOKC_{CSK}$ does not perform well in human evaluation because the generated responses are always disordered and unnatural. + +# 3.4 Analyses and Discussions + +Table 3: Human evaluation. $- / 0 / +$ means the ratio that KSAM is worse/tie/better. Score means significantly better (sign test, p-value $< 0.0001$ , ties are removed). + +
FusedEach Head DecCase-LevelBounds
SFNXKCKPKTBest WorstUpper Lower
77.7104.5124.3116.7119.493.1133.7
47.9
258.0
+ +Table 4: Perplexities. 'Fused' considers the prob (probability) fused by ${SFN}$ . ' Dec' considers the prob predicted by each head. 'Case-Level' selects the best/worse prob from four source-aware heads for each response. 'Bounds' uses the ground-truth to select the best/worse prob from four heads for each token, which can roughly show the theoretically best/worst fusion performance. All results are computed on the same full KSAM. + +
MetricsBaseDecHDecKPDecKCDecKPFull
PPL↓98.092.196.694.695.377.7
Embed-A0.8480.8480.8520.8500.8510.856
BLEU-40.952.031.040.991.032.15
DIST-28.5636.810.412.59.930.2
+ +Table 5: Head Ablation. Each is trained separately. + +Source Fusion Network (SFN): We analyze it with Table 4: 1) The PPL of each source-aware head, even we select the best head case by case, is significantly worse than the fused one, which shows a) SFN can effectively and step-wisely select/fuse results from various heads; b) independent source-aware decoder heads can work together; 2) Although SFN has achieved promising results, the upper bound is still significantly better. It means fusing multiple complete distributions is quite challenging, there is still have great potential to study. We will continue to explore this in the future. + +Decoder Head Ablation: Table 5 reports the performance if only using a single source-aware head. + +
Case #1:History:吃什么可以瘦身? How to lose weight through diet? +Text Know:节食指限制吃的食物分量,通常是以减肥瘦身作为目的。 +Dieting refers to limiting the amount of food eaten, usually with the goal of losing weight. +Commonsense:(多喝水 Drinking more water, MotivatedByGoal, 瘦身 Loosing weight)
Seq2Seq吃减肥药最容易发胖. Taking diet pills is the easiest way to gain weight.
ConKADI可以吃一些东西 喝就可以了. You can eat something and drink on it.
MSKE少吃什么都可以瘦身. You can lose weight if you eat less.
KSAM多喝水,多吃蔬菜,少吃油腻的食物. Drink more water, eat more vegetables, and eat less greasy food
Case #2:History:您认为“吸烟有害健康”的宣传教育有效果吗? Do you think the publicity and education of "Smoking is harmful to health" is effective? +Table Attributes of Smoking:(Category,习惯 habit), (Category,烟草 tobacco)
Seq2Seq吸烟有害健康. Smoking is harmful to health.
ConKADI吸烟有害健康,不知道[...]吗? Smoking is harmful to health. Don’t you know smoking is harmful to health?
MSKE吸烟有害健康. Smoking is harmful to health.
KSAM吸烟有害健康,戒烟戒酒! Smoking is harmful to health. Quit smoking and alcohol!
+ +Table 6: Case Study. '[...]'=吸烟有害健康' in #2. Besides the history, we show the related available knowledge. + +Base removes the usage of the history memory $\mathbf{H}$ from $Dec_{H}$ , and we regard it as the baseline. 1) Compared to Base, $Dec_{K_{*}}$ further adopts a single-source memory and achieves improvements. The dialogue history memory $\mathbf{H}$ is undoubtedly more crucial than the external knowledge; 2) Common sense knowledge memory $\mathbf{K_C}$ brings more improvements than the other two knowledge memories; 3) Using all heads (Full) has the best performance, indicating the necessity of using multisource knowledge. Meanwhile, the improvement of PPL is significantly more than other metrics, indicating the decoding algorithm (beam search) should be improved in the future. + +Case Study: Table 6 provides two cases for four better models in human evaluation. As a whole, we can find the Indefinite Alignment issue appears, where case #1 is aligned to both plain text knowledge and commonsense knowledge, and #2 is aligned to table knowledge. In addition, we can also notice the Knowledge Diversity, where such three knowledge sources have different characteristics. In case #1, Seq2Seq and ConKADI generated irrational responses. The response generated by KSAM is more informative than MSKE while both two responses are acceptable. In case #2, the provided knowledge is not straightforward; all baselines repeated the question. KSAM provided new information by reasoning on the table knowledge. + +# 4 Related Work + +Dialogue Systems: Dialogue systems have achieved promising results (Vinyals and Le, 2015; Chen et al., 2017). However, traditional models tend to generate safe but meaningless responses + +(Li et al., 2016). To this end, massive efforts are devoted to diversity the generated dialogues: leveraging the large-scale pretrained model (Zhang et al., 2020b; Gu et al., 2021), incorporating visual features (Das et al., 2017; Wang et al., 2021), employing topics (Xu et al., 2021; Zhong et al., 2021), and many others (Zhao et al., 2021). + +Knowledge-Enhanced Methods: Recently, researchers noticed that a crucial reason that results in meaningless responses is the insufficient knowledge carried by the dialogue history (Ghazvininejad et al., 2018; Yu et al., 2020). Thus, infusing external knowledge into the dialogue generation has become a trend. Knowledge sources are diverse. The text knowledge can be easily collected and can provide rich information (Dinan et al., 2019; Ren et al., 2020; Meng et al., 2020). The commonsense knowledge includes the every knowledge (Speer et al., 2017; Zhou et al., 2018; Zhang et al., 2020a; Wang et al., 2020a). The table knowledge (Wu et al., 2019, 2021b) provides the entity-centric information. To improve the knowledge coverage and combine the advantages of different sources. (Liu et al., 2019) uses both text+commonsense knowledge; (Liang et al., 2021) uses different emotional sources; (Bai et al., 2021) treats goal knowledge as an additional source. (Wu et al., 2021a) does not limit the number/type of knowledge in theory; however, it ignored the Knowledge Diversity / Indefinite Alignment issue. In addition, the proposed multi-head decoding is different from the multiprocessor decoding (Zhao et al., 2020): 1) our head is a fully functional decoder rather than a partially functional module; 2) we do not use a sequential state to strengthen the decoupling of heads; 3) our approach is not a single-source method. + +# 5 Conclusion & Future Work + +This paper studies the multi-source knowledge-enhanced dialogue generation. We find three challenging problems, i.e., 1) Knowledge Diversity, 2) Indefinite Alignment, and 3) Insufficient Flexibility and Scalability. Consequently, this paper proposes a novel Knowledge Source Aware Multi-Head Decoding approach, KSAM, which employs multiple source-aware decoder heads to handle each knowledge source more efficiently. In the future, we will continue to improve the applicability and the performance of multi-source knowledge-enhanced dialogue generation. For example, improving the fusing the predictions of heads. + +Ethical Considerations: We did not propose a new dataset or use any private dataset. In addition, this work did not involve any sensitive topic. Thus, we believe no ethical concern in this paper. + +# References + +Jiaqi Bai, Ze Yang, Xinnian Liang, Wei Wang, and Zhoujun Li. 2021. Learning to copy coherent knowledge for response generation. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 12535-12543. AAAI Press. +Yang Bai, Ziran Li, Ning Ding, Ying Shen, and Hai-Tao Zheng. 2020. Infobox-to-text generation with tree-like planning based attention network. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020, pages 3773-3779. +Antoine Bordes, Nicolas Usunier, Jason Weston, and Oksana Yakhnenko. 2013. Translating Embeddings for Modeling Multi-Relational Data. In NIPS, pages 2787-2795. +Deng Cai, Yan Wang, Wei Bi, Zhaopeng Tu, Xiaojiang Liu, and Shuming Shi. 2019. Retrieval-guided dialogue response generation via a matching-to-generation framework. 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 2019, Hong Kong, China, November 3-7, 2019, pages 1866-1875. +Hongshen Chen, Xiaorui Liu, Dawei Yin, and Jiliang Tang. 2017. A Survey on Dialogue Systems: Recent Advances and New Frontiers. ACM SIGKDD Explorations Newsletter, 19. + +Kyunghyun Cho, Bart van Merrienboer, Caglar Gülcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. 2014. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In EMNLP, pages 1724-1734. +Abhishek Das, Satwik Kottur, Khushi Gupta, Avi Singh, Deshraj Yadav, José M. F. Moura, Devi Parikh, and Dhruv Batra. 2017. Visual dialog. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pages 1080-1089. +Emily Dinan, Stephen Roller, Kurt Shuster, Angela Fan, Michael Auli, and Jason Weston. 2019. Wizard of wikipedia: Knowledge-powered conversational agents. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. +Marjan Ghazvininejad, Chris Brockett, Ming-Wei Chang, Bill Dolan, Jianfeng Gao, Wen-tau Yih, and Michel Galley. 2018. A knowledge-grounded neural conversation model. In AAAI, pages 5110-5117. +Xiaodong Gu, Kang Min Yoo, and Jung-Woo Ha. 2021. Dialogbert: Discourse-aware response generation via learning to recover and rank utterances. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 12911-12919. AAAI Press. +Pei Ke, Jian Guan, Minlie Huang, and Xiaoyan. 2018. Generating Informative Responses with Controlled Sentence Function. Proceedings of ACL, pages 1499-1508. +Byeongchang Kim, Jaewoo Ahn, and Gunhee Kim. 2020. Sequential latent knowledge selection for knowledge-grounded dialogue. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. +Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. 2016. A diversity-promoting objective function for neural conversation models. In *NAACL*, pages 110-119. +Yunlong Liang, Fandong Meng, Ying Zhang, Yufeng Chen, Jinan Xu, and Jie Zhou. 2021. Infusing multisource knowledge with heterogeneous graph neural network for emotional conversation generation. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 13343-13352. AAAI Press. + +Chin-Yew Lin. 2004. ROUGE: A package for automatic evaluation of summaries. In Text Summarization Branches Out, pages 74-81, Barcelona, Spain. Association for Computational Linguistics. +Chia-Wei Liu, Ryan Lowe, Iulian Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. 2016. How NOT to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. In EMNLP, pages 2122-2132. +Shuman Liu, Hongshen Chen, Zhaochun Ren, Yang Feng, Qun Liu, and Dawei Yin. 2018a. Knowledge diffusion for neural dialogue generation. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 1489-1498. +Tianyu Liu, Kexiang Wang, Lei Sha, Baobao Chang, and Zhifang Sui. 2018b. Table-to-text generation by structure-aware seq2seq learning. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, Louisiana, USA, February 2-7, 2018, pages 4881-4888. +Zhibin Liu, Zheng-Yu Niu, Hua Wu, and Haifeng Wang. 2019. Knowledge Aware Conversation Generation with Explainable Reasoning over Augmented Graphs. In EMNLP, pages 1782-1792. +Thang Luong, Hieu Pham, and Christopher D. Manning. 2015. Effective approaches to attention-based neural machine translation. In EMNLP, pages 1412-1421. +Chuan Meng, Pengjie Ren, Zhumin Chen, Christof Monz, Jun Ma, and Maarten de Rijke. 2020. Refnet: A reference-aware network for background based conversation. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pages 8496-8503. +Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, July 6-12, 2002, Philadelphia, PA, USA, pages 311-318. ACL. +Pengjie Ren, Zhumin Chen, Christof Monz, Jun Ma, and Maarten de Rijke. 2020. Thinking globally, acting locally: Distantly supervised global-to-local knowledge selection for background based conversation. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, + +New York, NY, USA, February 7-12, 2020, pages 8697-8704. +Abigail See, Peter J. Liu, and Christopher D. Manning. 2017. Get To The Point: Summarization with Pointer-Generator Networks. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1073–1083, Stroudsburg, PA, USA. Association for Computational Linguistics. +Lifeng Shang, Zhengdong Lu, and Hang Li. 2015. Neural Responding Machine for Short-Text Conversation. In Annual Meeting of the Association for Computational Linguistics, pages 1577-1586. +Yan Song, Shuming Shi, Jing Li, and Haisong Zhang. 2018. Directional skip-gram: Explicitly distinguishing left and right context for word embeddings. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT, New Orleans, Louisiana, USA, June 1-6, 2018, Volume 2 (Short Papers), pages 175-180. Association for Computational Linguistics. +Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. Conceptnet 5.5: An open multilingual graph of general knowledge. In AAAI, pages 4444-4451. +Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. 2014. Sequence to sequence learning with neural networks. In NIPS, pages 3104-3112. +Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. CoRR, abs/1706.03762. +Oriol Vinyals and Quoc Le. 2015. A neural conversational model. Computer Science. +Jian Wang, Junhao Liu, Wei Bi, Xiaojiang Liu, Kejing He, Ruifeng Xu, and Min Yang. 2020a. Improving knowledge-aware dialogue generation via knowledge base question answering. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pages 9169-9176. AAAI Press. +Shuhe Wang, Yuxian Meng, Xiaofei Sun, Fei Wu, Rongbin Ouyang, Rui Yan, Tianwei Zhang, and Jiwei Li. 2021. Modeling text-visual mutual dependency for multi-modal dialog generation. CoRR, abs/2105.14445. +Yida Wang, Pei Ke, Yinhe Zheng, Kaili Huang, Yong Jiang, Xiaoyan Zhu, and Minlie Huang. 2020b. A large-scale chinese short-text conversation dataset. In NLPCC. + +Sixing Wu, Ying Li, Minghui Wang, Dawei Zhang, Yang Zhou, and Zhonghai Wu. 2021a. More is better: Enhancing open-domain dialogue generation via multi-source heterogeneous knowledge. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, 2021, pages 2286-2300. Association for Computational Linguistics. +Sixing Wu, Ying Li, Dawei Zhang, Yang Zhou, and Zhonghai Wu. 2020. Diverse and informative dialogue generation with context-specific commonsense knowledge awareness. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5811-5820, Online. Association for Computational Linguistics. +Sixing Wu, Minghui Wang, Ying Li, Dawei Zhang, and Zhonghai Wu. 2022. Improving the applicability of knowledge-enhanced dialogue generation systems by using heterogeneous knowledge from multiple sources. In WSDM '22: The Fifteenth ACM International Conference on Web Search and Data Mining, Virtual Event / Tempe, AZ, USA, February 21 - 25, 2022, pages 1149-1157. ACM. +Sixing Wu, Minghui Wang, Dawei Zhang, Yang Zhou, Ying Li, and Zhonghai Wu. 2021b. Knowledge-aware dialogue generation via hierarchical infobox accessing and infobox-dialogue interaction graph network. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI 2021, Virtual Event / Montreal, Canada, 19-27 August 2021, pages 3964-3970. ijcai.org. +Wenquan Wu, Zhen Guo, Xiangyang Zhou, Hua Wu, Xiyuan Zhang, Rongzhong Lian, and Haifeng Wang. 2019. Proactive human-machine conversation with explicit conversation goal. In Proceedings of the 57th Conference of the Association for Computational Linguistics, ACL 2019, Florence, Italy, July 28-August 2, 2019, Volume 1: Long Papers, pages 3794-3804. +Yi Xu, Hai Zhao, and Zhuosheng Zhang. 2021. Topiaware multi-turn dialogue modeling. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 14176-14184. AAAI Press. +Wenhao Yu, Chenguang Zhu, Zaitang Li, Zhiting Hu, Qingyun Wang, Heng Ji, and Meng Jiang. 2020. A survey of knowledge-enhanced text generation. CoRR, abs/2010.04389. +Houyu Zhang, Zhenghao Liu, Chenyan Xiong, and Zhiyuan Liu. 2020a. Grounded conversation generation as guided traverses in commonsense knowledge graphs. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pages 2031-2043. + +Yizhe Zhang, Siqi Sun, Michel Galley, Yen-Chun Chen, Chris Brockett, Xiang Gao, Jianfeng Gao, Jingjing Liu, and Bill Dolan. 2020b. DIALOGPT: Large-scale generative pre-training for conversational response generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 270-278, Online. Association for Computational Linguistics. +Xueliang Zhao, Wei Wu, Chongyang Tao, Can Xu, Dongyan Zhao, and Rui Yan. 2020. Low-resource knowledge-grounded dialogue generation. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. +Yangyang Zhao, Zhenyu Wang, and Zhenhua Huang. 2021. Automatic curriculum learning with overrepetition penalty for dialogue policy learning. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 14540-14548. AAAI Press. +Peixiang Zhong, Yong Liu, Hao Wang, and Chunyan Miao. 2021. Keyword-guided neural conversational model. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 14568-14576. AAAI Press. +Hao Zhou, Tom Young, Minlie Huang, Haizhou Zhao, Jingfang Xu, and Xiaoyan Zhu. 2018. Common-sense Knowledge Aware Conversation Generation with Graph Attention. In *IJCAI*, pages 4623-4629. \ No newline at end of file diff --git a/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/images.zip b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d4828185a641bcfee05b2b8bdc0288f83613c27f --- /dev/null +++ b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72c5b631065ca8ddef5a5606f306eeb951a6e0368edbde187764330908d4855e +size 744874 diff --git a/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/layout.json b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7e04daf8cacc1e963fb82df02a8d31fa47f96fb9 --- /dev/null +++ b/ksaminfusingmultisourceknowledgeintodialoguegenerationviaknowledgesourceawaremultiheaddecoding/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a03a7cc89da04cf12bf84d91626426783996aecc770117f2d39d1a01c17c99b +size 448950